diff --git a/pkgs/stdenv/default.nix b/pkgs/stdenv/default.nix index ee4cf8355f4..5cfefe6b178 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; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 1fa6aacad57..9308894d531 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5,9 +5,18 @@ platform. */ -{ # The system for which to build the packages. +{ # The system (e.g., `i686-linux') for which to build the packages. system ? __currentSystem + # Usually, the system type uniquely determines the stdenv and thus + # how to build the packages. But on some platforms we have + # different stdenvs, leading to different ways to build the + # packages. For instance, on Windows we support both Cygwin and + # Mingw builds. In both cases, `system' is `i686-cygwin'. The + # attribute `stdenvType' is used to select the specific kind of + # stdenv to use, e.g., `i686-mingw'. +, stdenvType ? system + , # The standard environment to use. Only used for bootstrapping. If # null, the default standard environment is used. bootStdenv ? null @@ -71,7 +80,7 @@ rec { defaultStdenv = (import ../stdenv { - inherit system; + inherit system stdenvType; allPackages = import ./all-packages.nix; }).stdenv; @@ -1248,6 +1257,7 @@ rec { inherit fetchurl stdenv pkgconfig gettext perl x11 libtiff libjpeg libpng; }; + gtkLibs22 = import ../development/libraries/gtk-libs-2.2 { inherit fetchurl stdenv pkgconfig gettext perl x11 libtiff libjpeg libpng;