diff options
author | zimbatm <zimbatm@zimbatm.com> | 2018-11-13 12:26:13 +0100 |
---|---|---|
committer | zimbatm <zimbatm@zimbatm.com> | 2018-11-13 12:26:15 +0100 |
commit | e62db105c4bc1837cff46702d760c3e04403b6b5 (patch) | |
tree | 761829e86500d8e6415b5d19134b80589f4b60ce /pkgs/build-support/libredirect | |
parent | cb95a3c1d1b6cd9da65650be269436cbe9e265fa (diff) |
libredirect: specify libName
reduces a bit of duplication and can also be used from the outside: export LD_PRELOAD=${libredirect}/lib/${libredirect.libName}
Diffstat (limited to 'pkgs/build-support/libredirect')
-rw-r--r-- | pkgs/build-support/libredirect/default.nix | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/pkgs/build-support/libredirect/default.nix b/pkgs/build-support/libredirect/default.nix index 09a3da6729a9f..e92945a4030ca 100644 --- a/pkgs/build-support/libredirect/default.nix +++ b/pkgs/build-support/libredirect/default.nix @@ -8,11 +8,11 @@ stdenv.mkDerivation { cp ${./test.c} test.c ''; - shlibext = stdenv.targetPlatform.extensions.sharedLibrary; + libName = "libredirect" + stdenv.targetPlatform.extensions.sharedLibrary; buildPhase = '' $CC -Wall -std=c99 -O3 -shared libredirect.c \ - -o "libredirect$shlibext" -fPIC -ldl + -o "$libName" -fPIC -ldl if [ -n "$doInstallCheck" ]; then $CC -Wall -std=c99 -O3 test.c -o test @@ -20,18 +20,18 @@ stdenv.mkDerivation { ''; installPhase = '' - install -vD "libredirect$shlibext" "$out/lib/libredirect$shlibext" + install -vD "$libName" "$out/lib/$libName" ''; doInstallCheck = true; installCheckPhase = if stdenv.isDarwin then '' NIX_REDIRECTS="/foo/bar/test=${coreutils}/bin/true" \ - DYLD_INSERT_LIBRARIES="$out/lib/libredirect$shlibext" \ + DYLD_INSERT_LIBRARIES="$out/lib/$libName" \ DYLD_FORCE_FLAT_NAMESPACE=1 ./test '' else '' NIX_REDIRECTS="/foo/bar/test=${coreutils}/bin/true" \ - LD_PRELOAD="$out/lib/libredirect$shlibext" ./test + LD_PRELOAD="$out/lib/$libName" ./test ''; meta = { |