summary refs log tree commit diff
path: root/pkgs/stdenv/native
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2009-02-02 15:03:38 +0000
committerEelco Dolstra <eelco.dolstra@logicblox.com>2009-02-02 15:03:38 +0000
commit1dee2d3de0baf12ac4dd700c95c6a4da54bfaaf6 (patch)
tree41d0cdffd3840e346797417a210aaac34ff4b04a /pkgs/stdenv/native
parent3e727ebe97d37394c06c0de28635535cd527e0ab (diff)
downloadnixpkgs-1dee2d3de0baf12ac4dd700c95c6a4da54bfaaf6.tar
nixpkgs-1dee2d3de0baf12ac4dd700c95c6a4da54bfaaf6.tar.gz
nixpkgs-1dee2d3de0baf12ac4dd700c95c6a4da54bfaaf6.tar.bz2
nixpkgs-1dee2d3de0baf12ac4dd700c95c6a4da54bfaaf6.tar.lz
nixpkgs-1dee2d3de0baf12ac4dd700c95c6a4da54bfaaf6.tar.xz
nixpkgs-1dee2d3de0baf12ac4dd700c95c6a4da54bfaaf6.tar.zst
nixpkgs-1dee2d3de0baf12ac4dd700c95c6a4da54bfaaf6.zip
* Fix stdenvNative/stdenvNix.
svn path=/nixpkgs/branches/stdenv-updates/; revision=13957
Diffstat (limited to 'pkgs/stdenv/native')
-rw-r--r--pkgs/stdenv/native/default.nix76
1 files changed, 43 insertions, 33 deletions
diff --git a/pkgs/stdenv/native/default.nix b/pkgs/stdenv/native/default.nix
index ee2f9e9eb9f..248cc2a3357 100644
--- a/pkgs/stdenv/native/default.nix
+++ b/pkgs/stdenv/native/default.nix
@@ -1,11 +1,11 @@
-{stdenvInitial}:
+{system, allPackages ? import ../../..}:
 
-let
-
-  system = stdenvInitial.system;
+rec {
 
   shell = "/bin/bash";
 
+  path = ["/" "/usr" "/usr/local"];
+
 
   prehookBase = builtins.toFile "prehook-base.sh" ''
     # Disable purity tests; it's allowed (even needed) to link to
@@ -46,44 +46,53 @@ let
 
   # A function that builds a "native" stdenv (one that uses tools in
   # /usr etc.).  
-  makeStdenv = {stdenvBoot, extraPath, forceFetchurlBoot}: import ../generic {
-    name = "stdenv-native";
+  makeStdenv =
+    {gcc, fetchurl, extraPath ? []}:
+
+    import ../generic {
+      name = "stdenv-native";
 
-    preHook =
-      if system == "i686-darwin" || system == "powerpc-darwin" then prehookDarwin else
-      if system == "i686-freebsd" then prehookFreeBSD else
-      prehookBase;
+      preHook =
+        if system == "i686-darwin" || system == "powerpc-darwin" then prehookDarwin else
+        if system == "i686-freebsd" then prehookFreeBSD else
+        prehookBase;
 
-    initialPath = extraPath ++ ["/" "/usr" "/usr/local"];
+      initialPath = extraPath ++ path;
 
-    stdenv = stdenvBoot;
+      fetchurlBoot = fetchurl;
 
-    gcc = import ../../build-support/gcc-wrapper {
-      name = "gcc-native";
-      nativeTools = true;
-      nativeLibc = true;
-      nativePrefix = "/usr";
-      stdenv = stdenvBoot;
+      inherit system shell gcc;
     };
 
-    inherit shell forceFetchurlBoot;
 
-    fetchurlBoot = import ../../build-support/fetchurl {
-      stdenv = stdenvBoot;
-      # Curl should be in /usr/bin or so.
-      curl = null;
-    };
+  stdenvBoot0 = makeStdenv {
+    gcc = "/no-such-path";
+    fetchurl = null;
+  };
+  
+
+  gcc = import ../../build-support/gcc-wrapper {
+    name = "gcc-native";
+    nativeTools = true;
+    nativeLibc = true;
+    nativePrefix = "/usr";
+    stdenv = stdenvBoot0;
   };
 
-
+    
+  fetchurl = import ../../build-support/fetchurl {
+    stdenv = stdenvBoot0;
+    # Curl should be in /usr/bin or so.
+    curl = null;
+  };
+  
+    
   # First build a stdenv based only on tools outside the store.
   stdenvBoot1 = makeStdenv {
-    stdenvBoot = stdenvInitial;
-    extraPath = [];
-    forceFetchurlBoot = true;
-  };
+    inherit gcc fetchurl;
+  } // {inherit fetchurl;};
 
-  stdenvBoot1Pkgs = import ../../.. {
+  stdenvBoot1Pkgs = allPackages {
     inherit system;
     bootStdenv = stdenvBoot1;
   };
@@ -93,9 +102,10 @@ let
   # most systems don't have, so we mustn't rely on the native
   # environment providing it).
   stdenvBoot2 = makeStdenv {
-    stdenvBoot = stdenvBoot1;
+    inherit gcc fetchurl;
     extraPath = [stdenvBoot1Pkgs.replace];
-    forceFetchurlBoot = false;
   };
 
-in stdenvBoot2
+
+  stdenv = stdenvBoot2;
+}