summary refs log tree commit diff
path: root/pkgs/stdenv/default.nix
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2006-08-23 15:58:54 +0000
committerEelco Dolstra <eelco.dolstra@logicblox.com>2006-08-23 15:58:54 +0000
commitca6ae0b53d7aee64c6d927c85df0d6b25d25fd1d (patch)
tree588e7309f99625baf7f92907121d8e773cb99a79 /pkgs/stdenv/default.nix
parentab1557ee9623936c5f37fc8875c84674ed0a83e3 (diff)
downloadnixlib-ca6ae0b53d7aee64c6d927c85df0d6b25d25fd1d.tar
nixlib-ca6ae0b53d7aee64c6d927c85df0d6b25d25fd1d.tar.gz
nixlib-ca6ae0b53d7aee64c6d927c85df0d6b25d25fd1d.tar.bz2
nixlib-ca6ae0b53d7aee64c6d927c85df0d6b25d25fd1d.tar.lz
nixlib-ca6ae0b53d7aee64c6d927c85df0d6b25d25fd1d.tar.xz
nixlib-ca6ae0b53d7aee64c6d927c85df0d6b25d25fd1d.tar.zst
nixlib-ca6ae0b53d7aee64c6d927c85df0d6b25d25fd1d.zip
* Support different kinds of stdenvs on a particular system (like
  "i686-cygwin") by adding an argument "stdenvType" to specify which
  stdenv to use (like "i686-mingw").

svn path=/nixpkgs/trunk/; revision=6213
Diffstat (limited to 'pkgs/stdenv/default.nix')
-rw-r--r--pkgs/stdenv/default.nix26
1 files changed, 18 insertions, 8 deletions
diff --git a/pkgs/stdenv/default.nix b/pkgs/stdenv/default.nix
index ee4cf8355f4c..5cfefe6b178b 100644
--- a/pkgs/stdenv/default.nix
+++ b/pkgs/stdenv/default.nix
@@ -5,7 +5,15 @@
 # Posix utilities, the GNU C compiler, and so on.  On other systems,
 # we use the native C library.
 
-{system, allPackages}:
+
+# stdenvType exists to support multiple kinds of stdenvs on the same
+# system, e.g., cygwin and mingw builds on i686-cygwin.  Most people
+# can ignore it.
+
+{system, stdenvType ? system, allPackages}:
+
+assert system != "i686-cygwin" -> system == stdenvType;
+
 
 rec {
 
@@ -47,7 +55,7 @@ rec {
 
 
   # Linux standard environment.
-  inherit (import ./linux {inherit allPackages;}) stdenvLinux;
+  stdenvLinux = (import ./linux {inherit allPackages;}).stdenvLinux;
 
     
   # Darwin (Mac OS X) standard environment.  Very simple for now
@@ -73,18 +81,20 @@ rec {
     inherit genericStdenv gccWrapper;
   };
 
+  
   # MinGW/MSYS standard environment.
   stdenvMinGW = (import ./mingw) {
     inherit system;
   };
 
+  
   # Select the appropriate stdenv for the platform `system'.
   stdenv =
-    if system == "i686-linux" then stdenvLinux
-    else if system == "i686-freebsd" then stdenvFreeBSD
-    else if system == "i686-cygwin" then stdenvCygwin
-    else if system == "i686-mingw" then stdenvMinGW
-    else if system == "powerpc-darwin" then stdenvDarwin
-    else if system == "i686-darwin" then stdenvNix
+    if stdenvType == "i686-linux" then stdenvLinux
+    else if stdenvType == "i686-freebsd" then stdenvFreeBSD
+    else if stdenvType == "i686-cygwin" then stdenvCygwin
+    else if stdenvType == "i686-mingw" then stdenvMinGW
+    else if stdenvType == "powerpc-darwin" then stdenvDarwin
+    else if stdenvType == "i686-darwin" then stdenvNix
     else stdenvNative;
 }