Another initial MinGW environment, having some more basic tools. This will allow us to compile some packages for the stdenv from source.
svn path=/nixpkgs/trunk/; revision=6134
This commit is contained in:
parent
4957325c31
commit
38de63873c
|
@ -8,29 +8,98 @@
|
||||||
{system} :
|
{system} :
|
||||||
|
|
||||||
let {
|
let {
|
||||||
|
body =
|
||||||
|
stdenvFinal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initial standard environment based on native cygwin tools.
|
* Initial standard environment based on native Cygwin tools.
|
||||||
*/
|
*/
|
||||||
stdenvInit1 =
|
stdenvInit1 =
|
||||||
import ./simple-stdenv {
|
import ./simple-stdenv {
|
||||||
inherit system;
|
inherit system;
|
||||||
name = "stdenv-initial-cygwin";
|
name = "stdenv-init1-mingw";
|
||||||
shell = "/bin/bash.exe";
|
shell = "/bin/bash.exe";
|
||||||
path = ["/usr/bin" "/bin"];
|
path = ["/usr/bin" "/bin"];
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initial standard environment based on MSYS tools.
|
* Initial standard environment based on MSYS tools.
|
||||||
* From this point, Cygwin should no longer by involved.
|
|
||||||
*/
|
*/
|
||||||
stdenvInit2 =
|
stdenvInit2 =
|
||||||
import ./simple-stdenv {
|
import ./simple-stdenv {
|
||||||
inherit system;
|
inherit system;
|
||||||
name = "stdenv-initial-msys";
|
name = "stdenv-init2-mingw";
|
||||||
shell = msys + /bin/sh.exe;
|
shell = msysShell;
|
||||||
path = [(msys + /bin)];
|
path = [(msys + /bin)];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initial standard environment with the most basic MinGW packages.
|
||||||
|
*/
|
||||||
|
stdenvInit3 =
|
||||||
|
(import ./simple-stdenv) {
|
||||||
|
inherit system;
|
||||||
|
name = "stdenv-init3-mingw";
|
||||||
|
shell = msysShell;
|
||||||
|
path = [ (make + /bin) (msys + /bin) (binutils /bin) (gccCore + /bin) ];
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Final standard environment, based on generic stdenv.
|
||||||
|
* It would be better to make the generic stdenv usable on
|
||||||
|
* MINGW (i.e. make all environment variables CAPS).
|
||||||
|
*/
|
||||||
|
stdenvFinal =
|
||||||
|
let {
|
||||||
|
body =
|
||||||
|
stdenv // mkDerivationFun;
|
||||||
|
|
||||||
|
shell =
|
||||||
|
msys + /bin/sh + ".exe";
|
||||||
|
|
||||||
|
gccWrapper = (import ../../build-support/gcc-wrapper) {
|
||||||
|
name = "mingw-gcc-wrapper";
|
||||||
|
nativeTools = false;
|
||||||
|
nativeGlibc = true;
|
||||||
|
shell = msysShell;
|
||||||
|
binutils = binutils;
|
||||||
|
gcc = gccCore // { langC = true; langCC = false; langF77 = false; };
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tricky: gcc-wrapper cannot be constructed using the MSYS shell
|
||||||
|
* so we use the Cygwin shell.
|
||||||
|
*/
|
||||||
|
stdenv = stdenvInit1;
|
||||||
|
};
|
||||||
|
|
||||||
|
stdenv =
|
||||||
|
stdenvInit2.mkDerivation {
|
||||||
|
name = "stdenv-mingw";
|
||||||
|
builder = ./builder.sh;
|
||||||
|
substitute = ../../build-support/substitute/substitute.sh;
|
||||||
|
setup = ./setup.sh;
|
||||||
|
initialPath = [make msys];
|
||||||
|
gcc = gccWrapper;
|
||||||
|
shell = msysShell;
|
||||||
|
};
|
||||||
|
|
||||||
|
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 {}; };
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fetchurl, based on Cygwin curl in stdenvInit1
|
* Fetchurl, based on Cygwin curl in stdenvInit1
|
||||||
*/
|
*/
|
||||||
|
@ -61,64 +130,26 @@ let {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
msysShell =
|
||||||
* Complete standard environment, based on generic stdenv.
|
msys + /bin/sh + ".exe";
|
||||||
* It would be better to make the generic stdenv usable on
|
|
||||||
* MINGW (i.e. make all environment variables CAPS).
|
|
||||||
*/
|
|
||||||
body =
|
|
||||||
let {
|
|
||||||
body =
|
|
||||||
stdenv // mkDerivationFun;
|
|
||||||
|
|
||||||
shell = msys + /bin/sh + ".exe";
|
gccCore =
|
||||||
|
(import ./pkgs).gccCore {
|
||||||
|
stdenv = stdenvInit2;
|
||||||
|
inherit fetchurl;
|
||||||
|
};
|
||||||
|
|
||||||
binpkgs =
|
make =
|
||||||
(import ./pkgs) {
|
(import ./pkgs).make {
|
||||||
stdenv = stdenvInit2;
|
stdenv = stdenvInit2;
|
||||||
inherit fetchurl;
|
inherit fetchurl;
|
||||||
};
|
};
|
||||||
|
|
||||||
gcc = (import ../../build-support/gcc-wrapper) {
|
binutils =
|
||||||
name = "mingw-gcc-wrapper";
|
(import ./pkgs).binutils {
|
||||||
nativeTools = false;
|
stdenv = stdenvInit2;
|
||||||
nativeGlibc = true;
|
inherit fetchurl;
|
||||||
inherit shell; # Note: this is the MSYS shell.
|
};
|
||||||
binutils = binpkgs.binutils;
|
|
||||||
gcc = binpkgs.gccCore // { langC = true; langCC = false; langF77 = false; };
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Tricky: gcc-wrapper cannot be constructed using the MSYS shell
|
|
||||||
* so we use the Cygwin shell.
|
|
||||||
*/
|
|
||||||
stdenv = stdenvInit1;
|
|
||||||
};
|
|
||||||
|
|
||||||
stdenv =
|
|
||||||
stdenvInit2.mkDerivation {
|
|
||||||
name = "stdenv-mingw";
|
|
||||||
builder = ./builder.sh;
|
|
||||||
substitute = ../../build-support/substitute/substitute.sh;
|
|
||||||
setup = ./setup.sh;
|
|
||||||
initialPath = [binpkgs.make msys];
|
|
||||||
inherit shell gcc;
|
|
||||||
};
|
|
||||||
|
|
||||||
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 {}; };
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -1,17 +1,7 @@
|
||||||
/**
|
/**
|
||||||
* MinGW packages.
|
* MinGW packages.
|
||||||
*/
|
*/
|
||||||
let {
|
rec {
|
||||||
|
|
||||||
/**
|
|
||||||
* stdenv and fetchurl are parameters of every function to make this more flexible:
|
|
||||||
* after some packages, we might be able to use a better stdenv/fetchurl.
|
|
||||||
*/
|
|
||||||
body = {stdenv, fetchurl} : {
|
|
||||||
make = make { inherit stdenv fetchurl; };
|
|
||||||
gccCore = gccCore { inherit stdenv fetchurl; };
|
|
||||||
binutils = binutils { inherit stdenv fetchurl; };
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Make. Binary.
|
* Make. Binary.
|
||||||
|
@ -55,6 +45,19 @@ let {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MinGW Runtime. Source.
|
||||||
|
*/
|
||||||
|
mingwRuntime = {stdenv, fetchurl} :
|
||||||
|
stdenv.mkDerivation {
|
||||||
|
name = "mingw-runtime-3.10";
|
||||||
|
src =
|
||||||
|
fetchurl {
|
||||||
|
url = http://surfnet.dl.sourceforge.net/sourceforge/mingw/mingw-runtime-3.10-src.tar.gz;
|
||||||
|
md5 = "9225684e663eafa900b4075731c25f4c";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
pkgs.coreutils
|
pkgs.coreutils
|
||||||
pkgs.findutils
|
pkgs.findutils
|
||||||
|
|
|
@ -2,6 +2,16 @@ set -e
|
||||||
|
|
||||||
test -z $NIX_GCC && NIX_GCC=@GCC@
|
test -z $NIX_GCC && NIX_GCC=@GCC@
|
||||||
|
|
||||||
|
# Workaround MSYS shell problem
|
||||||
|
if test -z "$out"; then
|
||||||
|
out="$OUT"
|
||||||
|
src="$SRC"
|
||||||
|
srcs="$SRCS"
|
||||||
|
buildInputs="$BUILDINPUTS"
|
||||||
|
propagatedBuildInputs="$PROPAGATEDBUILDINPUTS"
|
||||||
|
succeedOnFailure="$SUCCEEDONFAILURE"
|
||||||
|
fi
|
||||||
|
|
||||||
# Set up the initial path.
|
# Set up the initial path.
|
||||||
PATH=
|
PATH=
|
||||||
for i in $NIX_GCC @INITIALPATH@; do
|
for i in $NIX_GCC @INITIALPATH@; do
|
||||||
|
|
Loading…
Reference in New Issue