* 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
This commit is contained in:
Eelco Dolstra 2006-08-23 15:58:54 +00:00
parent ab1557ee96
commit ca6ae0b53d
2 changed files with 30 additions and 10 deletions

View File

@ -5,7 +5,15 @@
# Posix utilities, the GNU C compiler, and so on. On other systems, # Posix utilities, the GNU C compiler, and so on. On other systems,
# we use the native C library. # 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 { rec {
@ -47,7 +55,7 @@ rec {
# Linux standard environment. # 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 # Darwin (Mac OS X) standard environment. Very simple for now
@ -73,18 +81,20 @@ rec {
inherit genericStdenv gccWrapper; inherit genericStdenv gccWrapper;
}; };
# MinGW/MSYS standard environment. # MinGW/MSYS standard environment.
stdenvMinGW = (import ./mingw) { stdenvMinGW = (import ./mingw) {
inherit system; inherit system;
}; };
# Select the appropriate stdenv for the platform `system'. # Select the appropriate stdenv for the platform `system'.
stdenv = stdenv =
if system == "i686-linux" then stdenvLinux if stdenvType == "i686-linux" then stdenvLinux
else if system == "i686-freebsd" then stdenvFreeBSD else if stdenvType == "i686-freebsd" then stdenvFreeBSD
else if system == "i686-cygwin" then stdenvCygwin else if stdenvType == "i686-cygwin" then stdenvCygwin
else if system == "i686-mingw" then stdenvMinGW else if stdenvType == "i686-mingw" then stdenvMinGW
else if system == "powerpc-darwin" then stdenvDarwin else if stdenvType == "powerpc-darwin" then stdenvDarwin
else if system == "i686-darwin" then stdenvNix else if stdenvType == "i686-darwin" then stdenvNix
else stdenvNative; else stdenvNative;
} }

View File

@ -5,9 +5,18 @@
platform. */ platform. */
{ # The system for which to build the packages. { # The system (e.g., `i686-linux') for which to build the packages.
system ? __currentSystem 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 , # The standard environment to use. Only used for bootstrapping. If
# null, the default standard environment is used. # null, the default standard environment is used.
bootStdenv ? null bootStdenv ? null
@ -71,7 +80,7 @@ rec {
defaultStdenv = defaultStdenv =
(import ../stdenv { (import ../stdenv {
inherit system; inherit system stdenvType;
allPackages = import ./all-packages.nix; allPackages = import ./all-packages.nix;
}).stdenv; }).stdenv;
@ -1248,6 +1257,7 @@ rec {
inherit fetchurl stdenv pkgconfig gettext perl x11 inherit fetchurl stdenv pkgconfig gettext perl x11
libtiff libjpeg libpng; libtiff libjpeg libpng;
}; };
gtkLibs22 = import ../development/libraries/gtk-libs-2.2 { gtkLibs22 = import ../development/libraries/gtk-libs-2.2 {
inherit fetchurl stdenv pkgconfig gettext perl x11 inherit fetchurl stdenv pkgconfig gettext perl x11
libtiff libjpeg libpng; libtiff libjpeg libpng;