summary refs log tree commit diff
path: root/pkgs/stdenv/generic
diff options
context:
space:
mode:
authorDan Peebles <pumpkin@me.com>2017-10-06 01:26:19 -0400
committerDan Peebles <pumpkin@me.com>2017-10-08 16:13:46 -0400
commitb426c85ce2f12b81b923bf8d0539d15a41b3a341 (patch)
treef5e463c3cdc9e94fb2484a604594a66c93aec39e /pkgs/stdenv/generic
parent0be2928ac9f8fa7ad2245785e586381ba8002585 (diff)
downloadnixlib-b426c85ce2f12b81b923bf8d0539d15a41b3a341.tar
nixlib-b426c85ce2f12b81b923bf8d0539d15a41b3a341.tar.gz
nixlib-b426c85ce2f12b81b923bf8d0539d15a41b3a341.tar.bz2
nixlib-b426c85ce2f12b81b923bf8d0539d15a41b3a341.tar.lz
nixlib-b426c85ce2f12b81b923bf8d0539d15a41b3a341.tar.xz
nixlib-b426c85ce2f12b81b923bf8d0539d15a41b3a341.tar.zst
nixlib-b426c85ce2f12b81b923bf8d0539d15a41b3a341.zip
Get rid of most @rpath nonsense on Darwin
This requires some small changes in the stdenv, then working around the
weird choice LLVM made to hardcode @rpath in its install name, and then
lets us remove a ton of annoying workaround hacks in many of our Go
packages. With any luck this will mean less hackery going forward.
Diffstat (limited to 'pkgs/stdenv/generic')
-rw-r--r--pkgs/stdenv/generic/default.nix15
1 files changed, 14 insertions, 1 deletions
diff --git a/pkgs/stdenv/generic/default.nix b/pkgs/stdenv/generic/default.nix
index 31de28fdc0c2..d5885193b9bc 100644
--- a/pkgs/stdenv/generic/default.nix
+++ b/pkgs/stdenv/generic/default.nix
@@ -81,7 +81,20 @@ let
 
       setup = setupScript;
 
-      inherit preHook initialPath shell
+      # We pretty much never need rpaths on Darwin, since all library path references
+      # are absolute unless we go out of our way to make them relative (like with CF)
+      # TODO: This really wants to be in stdenv/darwin but we don't have hostPlatform
+      # there (yet?) so it goes here until then.
+      preHook = preHook+ lib.optionalString buildPlatform.isDarwin ''
+        export NIX_BUILD_DONT_SET_RPATH=1
+      '' + lib.optionalString hostPlatform.isDarwin ''
+        export NIX_DONT_SET_RPATH=1
+        export NIX_NO_SELF_RPATH=1
+      '' + lib.optionalString targetPlatform.isDarwin ''
+        export NIX_TARGET_DONT_SET_RPATH=1
+      '';
+
+      inherit initialPath shell
         defaultNativeBuildInputs defaultBuildInputs;
     }
     // lib.optionalAttrs buildPlatform.isDarwin {