summary refs log tree commit diff
path: root/pkgs/stdenv/generic
diff options
context:
space:
mode:
authorJude Taylor <me@jude.bio>2015-06-18 10:03:32 -0700
committerJude Taylor <me@jude.bio>2015-06-18 13:19:34 -0700
commitfe75f160324672d639469dc2da69f70d4eb466a4 (patch)
tree2212233e89f7dc5a5daa221e478959ed0a5844c9 /pkgs/stdenv/generic
parent87bca3698a753199a234fca9ca9c64ab60c99983 (diff)
downloadnixlib-fe75f160324672d639469dc2da69f70d4eb466a4.tar
nixlib-fe75f160324672d639469dc2da69f70d4eb466a4.tar.gz
nixlib-fe75f160324672d639469dc2da69f70d4eb466a4.tar.bz2
nixlib-fe75f160324672d639469dc2da69f70d4eb466a4.tar.lz
nixlib-fe75f160324672d639469dc2da69f70d4eb466a4.tar.xz
nixlib-fe75f160324672d639469dc2da69f70d4eb466a4.tar.zst
nixlib-fe75f160324672d639469dc2da69f70d4eb466a4.zip
move pure stdenv into a new directory, bring back the old one
remove __impure from non-darwin OSes
Diffstat (limited to 'pkgs/stdenv/generic')
-rw-r--r--pkgs/stdenv/generic/default.nix14
1 files changed, 10 insertions, 4 deletions
diff --git a/pkgs/stdenv/generic/default.nix b/pkgs/stdenv/generic/default.nix
index bdad51949308..07486093da83 100644
--- a/pkgs/stdenv/generic/default.nix
+++ b/pkgs/stdenv/generic/default.nix
@@ -21,6 +21,8 @@ let
   whitelist = config.whitelistedLicenses or [];
   blacklist = config.blacklistedLicenses or [];
 
+  ifDarwin = attrs: if system == "x86_64-darwin" then attrs else {};
+
   onlyLicenses = list:
     lib.lists.all (license:
       let l = lib.licenses.${license.shortName or "BROKEN"} or false; in
@@ -132,7 +134,9 @@ let
       assert licenseAllowed attrs;
 
       lib.addPassthru (derivation (
-        (removeAttrs attrs ["meta" "passthru" "crossAttrs" "pos"])
+        (removeAttrs attrs
+          ["meta" "passthru" "crossAttrs" "pos"
+           "__impureHostDeps" "__propagatedImpureHostDeps"])
         // (let
           buildInputs = attrs.buildInputs or [];
           nativeBuildInputs = attrs.nativeBuildInputs or [];
@@ -161,14 +165,14 @@ let
           nativeBuildInputs = nativeBuildInputs ++ (if crossConfig == null then buildInputs else []);
           propagatedNativeBuildInputs = propagatedNativeBuildInputs ++
             (if crossConfig == null then propagatedBuildInputs else []);
-
+        } // ifDarwin {
           __impureHostDeps = computedImpureHostDeps ++ computedPropagatedImpureHostDeps ++ __propagatedImpureHostDeps ++ __impureHostDeps ++ __extraImpureHostDeps ++ [
             "/dev/zero"
             "/dev/random"
             "/dev/urandom"
             "/bin/sh"
           ];
-          __propagatedImpureHostDeps = lib.unique (lib.sort (x: y: x < y) (computedPropagatedImpureHostDeps ++ __propagatedImpureHostDeps));
+          __propagatedImpureHostDeps = computedPropagatedImpureHostDeps ++ __propagatedImpureHostDeps;
         }))) (
       {
         # The meta attribute is passed in the resulting attribute set,
@@ -193,7 +197,6 @@ let
     (if isNull allowedRequisites then {} else { allowedRequisites = allowedRequisites ++ defaultNativeBuildInputs; }) //
     {
       inherit system name;
-      __impureHostDeps = __stdenvImpureHostDeps;
 
       builder = shell;
 
@@ -202,6 +205,9 @@ let
       setup = setupScript;
 
       inherit preHook initialPath shell defaultNativeBuildInputs;
+    }
+    // ifDarwin {
+      __impureHostDeps = __stdenvImpureHostDeps;
     })
 
     // rec {