Skip to content

Commit

Permalink
libredirect: set install_name on Darwin
Browse files Browse the repository at this point in the history
  • Loading branch information
zimbatm committed Nov 13, 2018
1 parent 91c130e commit d04a126
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pkgs/build-support/libredirect/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ stdenv, coreutils }:
{ stdenv, lib, coreutils }:

stdenv.mkDerivation {
name = "libredirect-0";
Expand All @@ -13,8 +13,10 @@ stdenv.mkDerivation {
outputs = ["out" "hook"];

buildPhase = ''
$CC -Wall -std=c99 -O3 -shared libredirect.c \
-o "$libName" -fPIC -ldl
$CC -Wall -std=c99 -O3 -fPIC -ldl -shared \
${lib.optionalString stdenv.isDarwin "-Wl,-install_name,$out/lib/$libName"} \
-o "$libName" \
libredirect.c
if [ -n "$doInstallCheck" ]; then
$CC -Wall -std=c99 -O3 test.c -o test
Expand Down

0 comments on commit d04a126

Please sign in to comment.