summary refs log tree commit diff
diff options
context:
space:
mode:
authorDaiderd Jordan <daiderd@gmail.com>2017-07-21 20:29:18 +0200
committerDaiderd Jordan <daiderd@gmail.com>2017-08-28 23:24:58 +0200
commit92652b4d79cf09705c011dbf1c38bc871a4011c8 (patch)
tree5f7977693ef4d8bc8989dd1ea7d510d2915b4076
parent0f043d497d0e736eef217e77e4164cf4bb6f455d (diff)
downloadnixlib-92652b4d79cf09705c011dbf1c38bc871a4011c8.tar
nixlib-92652b4d79cf09705c011dbf1c38bc871a4011c8.tar.gz
nixlib-92652b4d79cf09705c011dbf1c38bc871a4011c8.tar.bz2
nixlib-92652b4d79cf09705c011dbf1c38bc871a4011c8.tar.lz
nixlib-92652b4d79cf09705c011dbf1c38bc871a4011c8.tar.xz
nixlib-92652b4d79cf09705c011dbf1c38bc871a4011c8.tar.zst
nixlib-92652b4d79cf09705c011dbf1c38bc871a4011c8.zip
darwin-CF: use @rpath for library id and add an rpath entry for CF based on NIX_COREFOUNDATION_RPATH
-rw-r--r--pkgs/build-support/cc-wrapper/ld-wrapper.sh4
-rw-r--r--pkgs/os-specific/darwin/apple-source-releases/CF/default.nix2
-rw-r--r--pkgs/stdenv/darwin/default.nix1
3 files changed, 6 insertions, 1 deletions
diff --git a/pkgs/build-support/cc-wrapper/ld-wrapper.sh b/pkgs/build-support/cc-wrapper/ld-wrapper.sh
index a775b6da8237..38712665e432 100644
--- a/pkgs/build-support/cc-wrapper/ld-wrapper.sh
+++ b/pkgs/build-support/cc-wrapper/ld-wrapper.sh
@@ -145,6 +145,10 @@ if [ "$NIX_@infixSalt@_DONT_SET_RPATH" != 1 ]; then
             fi
         done
     done
+
+    if [ -n "${NIX_COREFOUNDATION_RPATH:-}" ]; then
+      extraAfter+=(-rpath $NIX_COREFOUNDATION_RPATH)
+    fi
 fi
 
 
diff --git a/pkgs/os-specific/darwin/apple-source-releases/CF/default.nix b/pkgs/os-specific/darwin/apple-source-releases/CF/default.nix
index e44966aa84d6..5589d1592f46 100644
--- a/pkgs/os-specific/darwin/apple-source-releases/CF/default.nix
+++ b/pkgs/os-specific/darwin/apple-source-releases/CF/default.nix
@@ -18,7 +18,7 @@ appleDerivation {
       --replace "/usr/sbin/" "" \
       --replace "/bin/" "" \
       --replace "INSTALLNAME=/System" "INSTALLNAME=$out" \
-      --replace "install_name_tool -id /System" "install_name_tool -id $out" \
+      --replace "install_name_tool -id /System/Library/Frameworks" "install_name_tool -id @rpath" \
       --replace 'chown -RH -f root:wheel $(DSTBASE)/CoreFoundation.framework' "" \
       --replace 'chmod -RH' 'chmod -R'
 
diff --git a/pkgs/stdenv/darwin/default.nix b/pkgs/stdenv/darwin/default.nix
index 61b7df195434..6739ce3f5c8f 100644
--- a/pkgs/stdenv/darwin/default.nix
+++ b/pkgs/stdenv/darwin/default.nix
@@ -300,6 +300,7 @@ in rec {
     targetPlatform = localSystem;
 
     preHook = commonPreHook + ''
+      export NIX_COREFOUNDATION_RPATH=${pkgs.darwin.CF}/Library/Frameworks
       export PATH_LOCALE=${pkgs.darwin.locale}/share/locale
     '';