2006-08-15 14:46:41 +00:00
|
|
|
{system} :
|
|
|
|
|
|
|
|
let {
|
2006-08-16 15:43:34 +00:00
|
|
|
body =
|
|
|
|
stdenvFinal;
|
|
|
|
|
2006-08-15 14:46:41 +00:00
|
|
|
/**
|
2006-08-16 15:43:34 +00:00
|
|
|
* Initial standard environment based on native Cygwin tools.
|
2006-08-16 15:48:20 +00:00
|
|
|
* GCC is not requires.
|
|
|
|
* Required (approx): bash, mkdir, gnu tar, curl.
|
2006-08-15 14:46:41 +00:00
|
|
|
*/
|
|
|
|
stdenvInit1 =
|
|
|
|
import ./simple-stdenv {
|
|
|
|
inherit system;
|
2006-08-16 15:43:34 +00:00
|
|
|
name = "stdenv-init1-mingw";
|
2006-08-15 21:25:14 +00:00
|
|
|
shell = "/bin/bash.exe";
|
2006-08-15 14:46:41 +00:00
|
|
|
path = ["/usr/bin" "/bin"];
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Initial standard environment based on MSYS tools.
|
|
|
|
*/
|
|
|
|
stdenvInit2 =
|
|
|
|
import ./simple-stdenv {
|
|
|
|
inherit system;
|
2006-08-16 15:43:34 +00:00
|
|
|
name = "stdenv-init2-mingw";
|
|
|
|
shell = msysShell;
|
2006-08-15 21:25:14 +00:00
|
|
|
path = [(msys + /bin)];
|
2006-08-15 14:46:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2006-08-16 15:43:34 +00:00
|
|
|
* Initial standard environment with the most basic MinGW packages.
|
2006-08-15 14:46:41 +00:00
|
|
|
*/
|
2006-08-16 15:43:34 +00:00
|
|
|
stdenvInit3 =
|
|
|
|
(import ./simple-stdenv) {
|
|
|
|
inherit system;
|
|
|
|
name = "stdenv-init3-mingw";
|
|
|
|
shell = msysShell;
|
2006-08-16 18:35:39 +00:00
|
|
|
path = [
|
|
|
|
(make + /bin)
|
|
|
|
(binutils + /bin)
|
|
|
|
(gccCore + /bin)
|
|
|
|
(mingwRuntimeBin + /bin)
|
|
|
|
(w32apiBin + /bin)
|
|
|
|
(msys + /bin)
|
|
|
|
];
|
|
|
|
|
|
|
|
extraEnv = {
|
|
|
|
C_INCLUDE_PATH = mingwRuntimeBin + "/include" + ":" + w32apiBin + "/include";
|
|
|
|
LIBRARY_PATH = mingwRuntimeBin + "/lib" + ":" + w32apiBin + "/lib";
|
|
|
|
};
|
2006-08-15 14:46:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2006-08-16 15:43:34 +00:00
|
|
|
* Final standard environment, based on generic stdenv.
|
2006-08-15 21:25:14 +00:00
|
|
|
* It would be better to make the generic stdenv usable on
|
|
|
|
* MINGW (i.e. make all environment variables CAPS).
|
2006-08-15 14:46:41 +00:00
|
|
|
*/
|
2006-08-16 15:43:34 +00:00
|
|
|
stdenvFinal =
|
2006-08-15 21:25:14 +00:00
|
|
|
let {
|
|
|
|
body =
|
|
|
|
stdenv // mkDerivationFun;
|
|
|
|
|
2006-08-16 15:43:34 +00:00
|
|
|
shell =
|
|
|
|
msys + /bin/sh + ".exe";
|
2006-08-16 14:15:00 +00:00
|
|
|
|
2006-08-16 15:43:34 +00:00
|
|
|
gccWrapper = (import ../../build-support/gcc-wrapper) {
|
2006-08-16 15:03:13 +00:00
|
|
|
name = "mingw-gcc-wrapper";
|
|
|
|
nativeTools = false;
|
|
|
|
nativeGlibc = true;
|
2006-08-16 15:43:34 +00:00
|
|
|
shell = msysShell;
|
|
|
|
binutils = binutils;
|
|
|
|
gcc = gccCore // { langC = true; langCC = false; langF77 = false; };
|
2006-08-16 15:03:13 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Tricky: gcc-wrapper cannot be constructed using the MSYS shell
|
|
|
|
* so we use the Cygwin shell.
|
|
|
|
*/
|
|
|
|
stdenv = stdenvInit1;
|
|
|
|
};
|
|
|
|
|
2006-08-15 21:25:14 +00:00
|
|
|
stdenv =
|
|
|
|
stdenvInit2.mkDerivation {
|
|
|
|
name = "stdenv-mingw";
|
|
|
|
builder = ./builder.sh;
|
|
|
|
substitute = ../../build-support/substitute/substitute.sh;
|
|
|
|
setup = ./setup.sh;
|
2006-08-16 19:13:43 +00:00
|
|
|
initialPath = [mingwRuntimeSrc w32apiSrc make msys];
|
2006-08-16 15:43:34 +00:00
|
|
|
gcc = gccWrapper;
|
|
|
|
shell = msysShell;
|
2006-08-15 21:25:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
mkDerivationFun = {
|
|
|
|
mkDerivation = attrs:
|
|
|
|
(derivation (
|
|
|
|
(removeAttrs attrs ["meta"])
|
|
|
|
//
|
|
|
|
{
|
|
|
|
builder = if attrs ? realBuilder then attrs.realBuilder else shell;
|
|
|
|
args = if attrs ? args then attrs.args else
|
|
|
|
["-e" (if attrs ? builder then attrs.builder else ../generic/default-builder.sh)];
|
|
|
|
inherit stdenv system;
|
|
|
|
})
|
|
|
|
)
|
|
|
|
// { meta = if attrs ? meta then attrs.meta else {}; };
|
|
|
|
};
|
|
|
|
};
|
2006-08-16 15:43:34 +00:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Fetchurl, based on Cygwin curl in stdenvInit1
|
|
|
|
*/
|
|
|
|
fetchurl =
|
|
|
|
import ../../build-support/fetchurl {
|
|
|
|
stdenv = stdenvInit1;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* use native curl in Cygwin. We could consider to use curl.exe,
|
|
|
|
* which is widely available (or we could bootstrap it ourselves)
|
|
|
|
*/
|
|
|
|
curl = null;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* MSYS, installed using stdenvInit1
|
|
|
|
*
|
|
|
|
* @todo Maybe remove the make of msys?
|
|
|
|
*/
|
|
|
|
msys =
|
|
|
|
stdenvInit1.mkDerivation {
|
|
|
|
name = "msys-1.0.11";
|
|
|
|
builder = ./msys-builder.sh;
|
|
|
|
src =
|
|
|
|
fetchurl {
|
|
|
|
url = http://www.cs.uu.nl/people/martin/msys-1.0.11.tar.gz;
|
|
|
|
md5 = "85ce547934797019d2d642ec3b53934b";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
msysShell =
|
|
|
|
msys + /bin/sh + ".exe";
|
|
|
|
|
2006-08-16 18:35:39 +00:00
|
|
|
/**
|
|
|
|
* Binary packages, based on stdenvInit2
|
|
|
|
*/
|
2006-08-16 15:43:34 +00:00
|
|
|
gccCore =
|
|
|
|
(import ./pkgs).gccCore {
|
|
|
|
stdenv = stdenvInit2;
|
|
|
|
inherit fetchurl;
|
|
|
|
};
|
|
|
|
|
|
|
|
make =
|
|
|
|
(import ./pkgs).make {
|
|
|
|
stdenv = stdenvInit2;
|
|
|
|
inherit fetchurl;
|
|
|
|
};
|
|
|
|
|
|
|
|
binutils =
|
|
|
|
(import ./pkgs).binutils {
|
|
|
|
stdenv = stdenvInit2;
|
|
|
|
inherit fetchurl;
|
|
|
|
};
|
2006-08-16 18:35:39 +00:00
|
|
|
|
|
|
|
mingwRuntimeBin =
|
|
|
|
(import ./pkgs).mingwRuntimeBin {
|
|
|
|
stdenv = stdenvInit2;
|
|
|
|
inherit fetchurl;
|
|
|
|
};
|
|
|
|
|
|
|
|
w32apiBin =
|
|
|
|
(import ./pkgs).w32apiBin {
|
|
|
|
stdenv = stdenvInit2;
|
|
|
|
inherit fetchurl;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Source packages, based on stdenvInit3
|
|
|
|
*/
|
|
|
|
mingwRuntimeSrc =
|
|
|
|
(import ./pkgs).mingwRuntimeSrc {
|
|
|
|
stdenv = stdenvInit3;
|
|
|
|
inherit fetchurl;
|
|
|
|
};
|
2006-08-16 19:13:43 +00:00
|
|
|
|
|
|
|
w32apiSrc =
|
|
|
|
(import ./pkgs).w32apiSrc {
|
|
|
|
stdenv = stdenvInit3;
|
|
|
|
inherit fetchurl;
|
|
|
|
};
|
2006-08-15 21:25:14 +00:00
|
|
|
}
|