2006-08-15 16:46:41 +02:00
|
|
|
{system} :
|
|
|
|
|
|
|
|
let {
|
2006-08-16 17:43:34 +02:00
|
|
|
body =
|
|
|
|
stdenvFinal;
|
|
|
|
|
2006-08-15 16:46:41 +02:00
|
|
|
/**
|
2006-08-16 17:43:34 +02:00
|
|
|
* Initial standard environment based on native Cygwin tools.
|
2010-08-06 22:23:35 +02:00
|
|
|
* GCC is not required.
|
2006-08-16 17:48:20 +02:00
|
|
|
* Required (approx): bash, mkdir, gnu tar, curl.
|
2006-08-15 16:46:41 +02:00
|
|
|
*/
|
|
|
|
stdenvInit1 =
|
|
|
|
import ./simple-stdenv {
|
|
|
|
inherit system;
|
2006-08-16 17:43:34 +02:00
|
|
|
name = "stdenv-init1-mingw";
|
2006-08-15 23:25:14 +02:00
|
|
|
shell = "/bin/bash.exe";
|
2006-11-13 11:09:56 +01:00
|
|
|
path = ["/usr/bin" "/bin" "/usr/local/bin"];
|
2006-08-15 16:46:41 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Initial standard environment based on MSYS tools.
|
|
|
|
*/
|
|
|
|
stdenvInit2 =
|
|
|
|
import ./simple-stdenv {
|
|
|
|
inherit system;
|
2006-08-16 17:43:34 +02:00
|
|
|
name = "stdenv-init2-mingw";
|
|
|
|
shell = msysShell;
|
2006-10-17 16:06:18 +02:00
|
|
|
path = [(msys + "/bin")];
|
2006-08-15 16:46:41 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2006-08-16 17:43:34 +02:00
|
|
|
* Initial standard environment with the most basic MinGW packages.
|
2006-08-15 16:46:41 +02:00
|
|
|
*/
|
2006-08-16 17:43:34 +02:00
|
|
|
stdenvInit3 =
|
|
|
|
(import ./simple-stdenv) {
|
|
|
|
inherit system;
|
|
|
|
name = "stdenv-init3-mingw";
|
|
|
|
shell = msysShell;
|
2006-08-16 20:35:39 +02:00
|
|
|
path = [
|
2006-10-17 16:06:18 +02:00
|
|
|
(make + "/bin")
|
2009-11-16 09:47:31 +01:00
|
|
|
(tar + "/bin")
|
2006-10-17 16:06:18 +02:00
|
|
|
(binutils + "/bin")
|
2009-11-13 12:58:17 +01:00
|
|
|
(gccFull + "/bin")
|
2006-10-17 16:06:18 +02:00
|
|
|
(mingwRuntimeBin + "/bin")
|
|
|
|
(w32apiBin + "/bin")
|
|
|
|
(msys + "/bin")
|
2006-08-16 20:35:39 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
extraEnv = {
|
|
|
|
C_INCLUDE_PATH = mingwRuntimeBin + "/include" + ":" + w32apiBin + "/include";
|
|
|
|
LIBRARY_PATH = mingwRuntimeBin + "/lib" + ":" + w32apiBin + "/lib";
|
|
|
|
};
|
2006-08-15 16:46:41 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2006-08-16 17:43:34 +02:00
|
|
|
* Final standard environment, based on generic stdenv.
|
2006-08-15 23:25:14 +02:00
|
|
|
* It would be better to make the generic stdenv usable on
|
|
|
|
* MINGW (i.e. make all environment variables CAPS).
|
2006-08-15 16:46:41 +02:00
|
|
|
*/
|
2006-08-16 17:43:34 +02:00
|
|
|
stdenvFinal =
|
2006-08-15 23:25:14 +02:00
|
|
|
let {
|
|
|
|
body =
|
2006-08-26 22:11:31 +02:00
|
|
|
stdenv // mkDerivationFun // {
|
|
|
|
inherit fetchurl;
|
2010-08-06 12:34:34 +02:00
|
|
|
overrides.pkgconfig = pkgconfigBin;
|
2006-08-26 22:11:31 +02:00
|
|
|
};
|
2006-08-15 23:25:14 +02:00
|
|
|
|
2006-08-16 17:43:34 +02:00
|
|
|
shell =
|
2006-10-17 16:06:18 +02:00
|
|
|
msys + "/bin/sh.exe";
|
2006-08-16 16:15:00 +02:00
|
|
|
|
2006-08-15 23:25:14 +02:00
|
|
|
stdenv =
|
|
|
|
stdenvInit2.mkDerivation {
|
|
|
|
name = "stdenv-mingw";
|
|
|
|
builder = ./builder.sh;
|
|
|
|
setup = ./setup.sh;
|
2006-08-17 02:54:32 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* binutils is on the path because it contains dlltool, which
|
|
|
|
* is invoked on the PATH by some packages.
|
|
|
|
*/
|
2009-11-16 09:47:31 +01:00
|
|
|
initialPath = [make tar binutils gccFull mingwRuntimeSrc w32apiSrc msys];
|
2009-11-13 12:58:17 +01:00
|
|
|
gcc = gccFull;
|
2006-08-16 17:43:34 +02:00
|
|
|
shell = msysShell;
|
2006-08-17 02:54:32 +02:00
|
|
|
inherit curl;
|
2006-08-17 03:25:46 +02:00
|
|
|
isDarwin = false;
|
2006-08-25 22:58:02 +02:00
|
|
|
isMinGW = true;
|
2006-08-15 23:25:14 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
mkDerivationFun = {
|
|
|
|
mkDerivation = attrs:
|
|
|
|
(derivation (
|
|
|
|
(removeAttrs attrs ["meta"])
|
|
|
|
//
|
|
|
|
{
|
2006-08-17 03:49:53 +02:00
|
|
|
builder =
|
|
|
|
if attrs ? realBuilder then attrs.realBuilder else shell;
|
|
|
|
args =
|
|
|
|
if attrs ? args then
|
|
|
|
attrs.args
|
|
|
|
else
|
2006-10-02 23:16:55 +02:00
|
|
|
["-e"] ++ (
|
2006-08-17 03:49:53 +02:00
|
|
|
if attrs ? builder then
|
|
|
|
[./fix-builder.sh attrs.builder]
|
|
|
|
else
|
2006-08-17 17:33:49 +02:00
|
|
|
[./fix-builder.sh ./default-builder.sh]
|
2006-10-02 23:16:55 +02:00
|
|
|
);
|
2006-08-15 23:25:14 +02:00
|
|
|
inherit stdenv system;
|
2006-08-17 02:54:32 +02:00
|
|
|
C_INCLUDE_PATH = mingwRuntimeSrc + "/include" + ":" + w32apiSrc + "/include";
|
|
|
|
CPLUS_INCLUDE_PATH = mingwRuntimeSrc + "/include" + ":" + w32apiSrc + "/include";
|
|
|
|
LIBRARY_PATH = mingwRuntimeSrc + "/lib" + ":" + w32apiSrc + "/lib";
|
2006-08-15 23:25:14 +02:00
|
|
|
})
|
|
|
|
)
|
|
|
|
// { meta = if attrs ? meta then attrs.meta else {}; };
|
|
|
|
};
|
|
|
|
};
|
2006-08-16 17:43:34 +02:00
|
|
|
|
|
|
|
/**
|
2006-08-17 02:54:32 +02:00
|
|
|
* fetchurl
|
2006-08-16 17:43:34 +02:00
|
|
|
*/
|
2006-08-17 02:54:32 +02:00
|
|
|
fetchurlInit1 =
|
2006-08-16 17:43:34 +02:00
|
|
|
import ../../build-support/fetchurl {
|
|
|
|
stdenv = stdenvInit1;
|
2006-08-17 02:54:32 +02:00
|
|
|
curl =
|
|
|
|
(import ./pkgs).curl {
|
|
|
|
stdenv = stdenvInit1;
|
|
|
|
};
|
|
|
|
};
|
2006-08-16 17:43:34 +02:00
|
|
|
|
2006-08-17 02:54:32 +02:00
|
|
|
cygpath =
|
|
|
|
import ./cygpath {
|
|
|
|
stdenv = stdenvInit1;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Hack: we need the cygpath of the Cygwin chmod.
|
|
|
|
*/
|
|
|
|
fetchurl =
|
|
|
|
import ./fetchurl {
|
|
|
|
stdenv = stdenvInit2;
|
|
|
|
curl = curl + "/bin/curl.exe";
|
|
|
|
chmod = cygpath "/usr/bin/chmod";
|
2006-08-16 17:43:34 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* MSYS, installed using stdenvInit1
|
|
|
|
*
|
|
|
|
* @todo Maybe remove the make of msys?
|
|
|
|
*/
|
|
|
|
msys =
|
|
|
|
stdenvInit1.mkDerivation {
|
|
|
|
name = "msys-1.0.11";
|
|
|
|
builder = ./msys-builder.sh;
|
|
|
|
src =
|
2006-08-17 02:54:32 +02:00
|
|
|
fetchurlInit1 {
|
2009-11-13 12:41:56 +01:00
|
|
|
url = ftp://ftp.strategoxt.org/pub/mingw/msys-1.0.11.tar.gz;
|
2009-11-16 09:47:31 +01:00
|
|
|
sha256 = "08qp4jk279i66q6ngksg58fx3cfv1r6p5n394h2kfrs56qs9zvz4";
|
2006-08-16 17:43:34 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
msysShell =
|
2006-10-17 16:06:18 +02:00
|
|
|
msys + "/bin/sh.exe";
|
2006-08-16 17:43:34 +02:00
|
|
|
|
2006-08-16 20:35:39 +02:00
|
|
|
/**
|
|
|
|
* Binary packages, based on stdenvInit2
|
|
|
|
*/
|
2006-08-17 02:54:32 +02:00
|
|
|
curl =
|
|
|
|
(import ./pkgs).curl {
|
|
|
|
stdenv = stdenvInit2;
|
|
|
|
};
|
|
|
|
|
2009-11-13 12:58:17 +01:00
|
|
|
gccFull =
|
|
|
|
(import ./pkgs).gccFull {
|
2006-08-17 02:54:32 +02:00
|
|
|
stdenv = stdenvInit2;
|
|
|
|
inherit fetchurl;
|
|
|
|
};
|
|
|
|
|
2006-08-16 17:43:34 +02:00
|
|
|
make =
|
|
|
|
(import ./pkgs).make {
|
|
|
|
stdenv = stdenvInit2;
|
|
|
|
inherit fetchurl;
|
|
|
|
};
|
|
|
|
|
2009-11-16 09:47:31 +01:00
|
|
|
tar =
|
|
|
|
(import ./pkgs).tar {
|
|
|
|
stdenv = stdenvInit2;
|
|
|
|
inherit fetchurl;
|
|
|
|
};
|
|
|
|
|
2006-08-16 17:43:34 +02:00
|
|
|
binutils =
|
|
|
|
(import ./pkgs).binutils {
|
|
|
|
stdenv = stdenvInit2;
|
|
|
|
inherit fetchurl;
|
|
|
|
};
|
2006-08-16 20:35:39 +02:00
|
|
|
|
|
|
|
mingwRuntimeBin =
|
|
|
|
(import ./pkgs).mingwRuntimeBin {
|
|
|
|
stdenv = stdenvInit2;
|
|
|
|
inherit fetchurl;
|
|
|
|
};
|
|
|
|
|
|
|
|
w32apiBin =
|
|
|
|
(import ./pkgs).w32apiBin {
|
|
|
|
stdenv = stdenvInit2;
|
|
|
|
inherit fetchurl;
|
|
|
|
};
|
|
|
|
|
2006-08-26 22:11:31 +02:00
|
|
|
pkgconfigBin =
|
|
|
|
(import ./pkgs).pkgconfigBin {
|
|
|
|
stdenv = stdenvInit3;
|
|
|
|
inherit fetchurl;
|
|
|
|
};
|
|
|
|
|
2006-08-16 20:35:39 +02:00
|
|
|
/**
|
|
|
|
* Source packages, based on stdenvInit3
|
|
|
|
*/
|
|
|
|
mingwRuntimeSrc =
|
|
|
|
(import ./pkgs).mingwRuntimeSrc {
|
|
|
|
stdenv = stdenvInit3;
|
|
|
|
inherit fetchurl;
|
|
|
|
};
|
2006-08-16 21:13:43 +02:00
|
|
|
|
|
|
|
w32apiSrc =
|
|
|
|
(import ./pkgs).w32apiSrc {
|
|
|
|
stdenv = stdenvInit3;
|
|
|
|
inherit fetchurl;
|
|
|
|
};
|
2008-06-17 01:18:56 +02:00
|
|
|
|
|
|
|
replace =
|
|
|
|
(import ./pkgs).replace {
|
|
|
|
stdenv = stdenvInit3;
|
|
|
|
inherit fetchurl;
|
|
|
|
};
|
2006-08-15 23:25:14 +02:00
|
|
|
}
|