lol

grantlee5: multiple outputs

+43 -3
+20 -3
pkgs/development/libraries/grantlee/5/default.nix
··· 1 - { stdenv, lib, copyPathsToStore, fetchurl, qtbase, qtscript, cmake }: 1 + { mkDerivation, lib, copyPathsToStore, fetchurl, qtbase, qtscript, cmake }: 2 2 3 - stdenv.mkDerivation rec { 3 + mkDerivation rec { 4 4 name = "grantlee-${version}"; 5 5 version = "5.1.0"; 6 + grantleeCompatVersion = "5.1"; 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 - meta = with stdenv.lib; { 20 + outputs = [ "out" "dev" "bin" ]; 21 + postInstall = '' 22 + moveToOutput "$grantleePluginPrefix" "$bin" 23 + 24 + # CMake checks that the provided libraries and plugins exist 25 + # Link libraries into $dev to satisfy CMake 26 + mkdir -p $dev/lib 27 + find $out/lib -name '*.so.*' -exec ln -s \{\} $dev/lib \; 28 + 29 + # Link plugins into $dev to satisfy CMake 30 + ln -s $bin/lib/grantlee $dev/lib 31 + ''; 32 + 33 + setupHook = ./setup-hook.sh; 34 + 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
··· 1 + grantleePluginPrefix=@grantleePluginPrefix@ 2 + 3 + providesGrantleeRuntime() { 4 + [ -d "$1/$grantleePluginPrefix" ] 5 + } 6 + 7 + _grantleeCrossEnvHook() { 8 + if providesQtRuntime "$1"; then 9 + propagatedBuildInputs+=" $1" 10 + propagatedUserEnvPkgs+=" $1" 11 + fi 12 + } 13 + crossEnvHooks+=(_grantleeCrossEnvHook) 14 + 15 + _grantleeEnvHook() { 16 + if providesGrantleeRuntime "$1"; then 17 + propagatedNativeBuildInputs+=" $1" 18 + if [ -z "$crossConfig" ]; then 19 + propagatedUserEnvPkgs+=" $1" 20 + fi 21 + fi 22 + } 23 + envHooks+=(_grantleeEnvHook)