diff options
author | aszlig <aszlig@nix.build> | 2018-11-12 09:59:39 +0100 |
---|---|---|
committer | aszlig <aszlig@nix.build> | 2018-11-12 10:08:02 +0100 |
commit | ba1fddb31535c5721cf2c3913e704f0b258f656b (patch) | |
tree | 6ef99091342deb540f96e24bba0783056d0306fd /pkgs/build-support/libredirect | |
parent | 9ef52352bdce530e00372078e43d46dfebf5e91d (diff) |
libredirect: Use extensions.sharedLibrary
This is to make sure we get the correct shared library suffix of the target platform. While for example on Darwin it would even work with the hardcoded .so prefix it's IMHO a bit nicer to have the actual native extension. Signed-off-by: aszlig <aszlig@nix.build>
Diffstat (limited to 'pkgs/build-support/libredirect')
-rw-r--r-- | pkgs/build-support/libredirect/default.nix | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/pkgs/build-support/libredirect/default.nix b/pkgs/build-support/libredirect/default.nix index d3de805b2f92b..fec659ff5fda9 100644 --- a/pkgs/build-support/libredirect/default.nix +++ b/pkgs/build-support/libredirect/default.nix @@ -5,11 +5,16 @@ stdenv.mkDerivation { unpackPhase = "cp ${./libredirect.c} libredirect.c"; + shlibext = stdenv.targetPlatform.extensions.sharedLibrary; + buildPhase = '' - $CC -Wall -std=c99 -O3 -shared libredirect.c -o libredirect.so -fPIC -ldl + $CC -Wall -std=c99 -O3 -shared libredirect.c \ + -o "libredirect$shlibext" -fPIC -ldl ''; - installPhase = "mkdir -p $out/lib; cp libredirect.so $out/lib"; + installPhase = '' + install -vD "libredirect$shlibext" "$out/lib/libredirect$shlibext" + ''; meta = { platforms = stdenv.lib.platforms.unix; |