summary refs log tree commit diff
path: root/pkgs/stdenv/darwin/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/stdenv/darwin/default.nix')
-rw-r--r--pkgs/stdenv/darwin/default.nix15
1 files changed, 9 insertions, 6 deletions
diff --git a/pkgs/stdenv/darwin/default.nix b/pkgs/stdenv/darwin/default.nix
index 85c406d3703..52f8f007b00 100644
--- a/pkgs/stdenv/darwin/default.nix
+++ b/pkgs/stdenv/darwin/default.nix
@@ -25,7 +25,8 @@ in rec {
   allPackages = import ../../..;
 
   commonPreHook = ''
-    export NIX_ENFORCE_PURITY=1
+    export NIX_ENFORCE_PURITY="''${NIX_ENFORCE_PURITY-1}"
+    export NIX_ENFORCE_NO_NATIVE="''${NIX_ENFORCE_NO_NATIVE-1}"
     export NIX_IGNORE_LD_THROUGH_GCC=1
     stripAllFlags=" " # the Darwin "strip" command doesn't know "-s"
     export MACOSX_DEPLOYMENT_TARGET=10.7
@@ -55,8 +56,7 @@ in rec {
   stageFun = step: last: {shell             ? "${bootstrapTools}/bin/sh",
                           overrides         ? (pkgs: {}),
                           extraPreHook      ? "",
-                          extraBuildInputs  ? with last.pkgs; [ xz darwin.CF libcxx ],
-                          extraInitialPath  ? [],
+                          extraBuildInputs,
                           allowedRequisites ? null}:
     let
       thisStdenv = import ../generic {
@@ -85,7 +85,7 @@ in rec {
           ${commonPreHook}
           ${extraPreHook}
         '';
-        initialPath  = extraInitialPath ++ [ bootstrapTools ];
+        initialPath  = [ bootstrapTools ];
         fetchurlBoot = import ../../build-support/fetchurl {
           stdenv = stage0.stdenv;
           curl   = bootstrapTools;
@@ -174,6 +174,8 @@ in rec {
       export PATH_LOCALE=${pkgs.darwin.locale}/share/locale
     '';
 
+    extraBuildInputs = with pkgs; [ xz darwin.CF libcxx ];
+
     allowedRequisites =
       [ bootstrapTools ] ++
       (with pkgs; [ xz libcxx libcxxabi icu ]) ++
@@ -203,9 +205,10 @@ in rec {
     # enables patchShebangs above. Unfortunately, patchShebangs ignores our $SHELL setting
     # and instead goes by $PATH, which happens to contain bootstrapTools. So it goes and
     # patches our shebangs back to point at bootstrapTools. This makes sure bash comes first.
-    extraInitialPath = [ pkgs.bash ];
+    extraBuildInputs = with pkgs; [ xz darwin.CF libcxx pkgs.bash ];
 
     extraPreHook = ''
+      export PATH=${pkgs.bash}/bin:$PATH
       export PATH_LOCALE=${pkgs.darwin.locale}/share/locale
     '';
 
@@ -236,7 +239,7 @@ in rec {
 
   stage4 = with stage3; stageFun 4 stage3 {
     shell = "${pkgs.bash}/bin/bash";
-    extraInitialPath = [ pkgs.bash ];
+    extraBuildInputs = with pkgs; [ xz darwin.CF libcxx pkgs.bash ];
     extraPreHook = ''
       export PATH_LOCALE=${pkgs.darwin.locale}/share/locale
     '';