From d04a1265a118b0348511549af659c6cbb9b5315d Mon Sep 17 00:00:00 2001 From: zimbatm Date: Tue, 13 Nov 2018 15:56:46 +0100 Subject: libredirect: set install_name on Darwin fixes https://github.com/NixOS/nixpkgs/pull/50246#issuecomment-437975038 --- pkgs/build-support/libredirect/default.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'pkgs/build-support/libredirect') diff --git a/pkgs/build-support/libredirect/default.nix b/pkgs/build-support/libredirect/default.nix index 7caca2fc00331..6e54e2a696c51 100644 --- a/pkgs/build-support/libredirect/default.nix +++ b/pkgs/build-support/libredirect/default.nix @@ -1,4 +1,4 @@ -{ stdenv, coreutils }: +{ stdenv, lib, coreutils }: stdenv.mkDerivation { name = "libredirect-0"; @@ -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 -- cgit 1.4.1