tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
0
fork
atom
lol
0
fork
atom
overview
issues
pulls
pipelines
grantlee5: multiple outputs
Thomas Tuegel
8 years ago
5a609e38
548f52c0
+43
-3
2 changed files
expand all
collapse all
unified
split
pkgs
development
libraries
grantlee
5
default.nix
setup-hook.sh
+20
-3
pkgs/development/libraries/grantlee/5/default.nix
reviewed
···
1
1
-
{ stdenv, lib, copyPathsToStore, fetchurl, qtbase, qtscript, cmake }:
1
1
+
{ mkDerivation, lib, copyPathsToStore, fetchurl, qtbase, qtscript, cmake }:
2
2
3
3
-
stdenv.mkDerivation rec {
3
3
+
mkDerivation rec {
4
4
name = "grantlee-${version}";
5
5
version = "5.1.0";
6
6
+
grantleeCompatVersion = "5.1";
7
7
+
grantleePluginPrefix = "lib/grantlee/${grantleeCompatVersion}";
6
8
7
9
src = fetchurl {
8
10
url = "https://github.com/steveire/grantlee/archive/v${version}.tar.gz";
···
15
17
buildInputs = [ qtbase qtscript ];
16
18
nativeBuildInputs = [ cmake ];
17
19
18
18
-
meta = with stdenv.lib; {
20
20
+
outputs = [ "out" "dev" "bin" ];
21
21
+
postInstall = ''
22
22
+
moveToOutput "$grantleePluginPrefix" "$bin"
23
23
+
24
24
+
# CMake checks that the provided libraries and plugins exist
25
25
+
# Link libraries into $dev to satisfy CMake
26
26
+
mkdir -p $dev/lib
27
27
+
find $out/lib -name '*.so.*' -exec ln -s \{\} $dev/lib \;
28
28
+
29
29
+
# Link plugins into $dev to satisfy CMake
30
30
+
ln -s $bin/lib/grantlee $dev/lib
31
31
+
'';
32
32
+
33
33
+
setupHook = ./setup-hook.sh;
34
34
+
35
35
+
meta = with lib; {
19
36
description = "Qt5 port of Django template system";
20
37
longDescription = ''
21
38
Grantlee is a plugin based String Template system written using the Qt
+23
pkgs/development/libraries/grantlee/5/setup-hook.sh
reviewed
···
1
1
+
grantleePluginPrefix=@grantleePluginPrefix@
2
2
+
3
3
+
providesGrantleeRuntime() {
4
4
+
[ -d "$1/$grantleePluginPrefix" ]
5
5
+
}
6
6
+
7
7
+
_grantleeCrossEnvHook() {
8
8
+
if providesQtRuntime "$1"; then
9
9
+
propagatedBuildInputs+=" $1"
10
10
+
propagatedUserEnvPkgs+=" $1"
11
11
+
fi
12
12
+
}
13
13
+
crossEnvHooks+=(_grantleeCrossEnvHook)
14
14
+
15
15
+
_grantleeEnvHook() {
16
16
+
if providesGrantleeRuntime "$1"; then
17
17
+
propagatedNativeBuildInputs+=" $1"
18
18
+
if [ -z "$crossConfig" ]; then
19
19
+
propagatedUserEnvPkgs+=" $1"
20
20
+
fi
21
21
+
fi
22
22
+
}
23
23
+
envHooks+=(_grantleeEnvHook)