* Folded the Cygwin, powerpc-darwin and FreeBSD stdenv into the "native"
stdenv. svn path=/nixpkgs/trunk/; revision=12147
This commit is contained in:
parent
aab9aee56e
commit
7bf0c5ba01
|
@ -21,7 +21,10 @@ stdenv.mkDerivation {
|
||||||
utils = ./utils.sh;
|
utils = ./utils.sh;
|
||||||
addFlags = ./add-flags;
|
addFlags = ./add-flags;
|
||||||
|
|
||||||
inherit nativeTools nativeLibc nativePrefix gcc libc binutils;
|
inherit nativeTools nativeLibc nativePrefix gcc;
|
||||||
|
libc = if nativeLibc then null else libc;
|
||||||
|
binutils = if nativeTools then null else binutils;
|
||||||
|
|
||||||
name = if name == "" then gcc.name else name;
|
name = if name == "" then gcc.name else name;
|
||||||
langC = if nativeTools then true else gcc.langC;
|
langC = if nativeTools then true else gcc.langC;
|
||||||
langCC = if nativeTools then true else gcc.langCC;
|
langCC = if nativeTools then true else gcc.langCC;
|
||||||
|
|
|
@ -1,25 +0,0 @@
|
||||||
{stdenv, genericStdenv, gccWrapper}:
|
|
||||||
|
|
||||||
genericStdenv {
|
|
||||||
name = "stdenv-native";
|
|
||||||
preHook = ./prehook.sh;
|
|
||||||
initialPath = "/usr/local /usr /";
|
|
||||||
|
|
||||||
inherit stdenv;
|
|
||||||
|
|
||||||
gcc = gccWrapper {
|
|
||||||
name = "gcc-native";
|
|
||||||
nativeTools = true;
|
|
||||||
nativeLibc = true;
|
|
||||||
nativePrefix = "/usr";
|
|
||||||
inherit stdenv;
|
|
||||||
};
|
|
||||||
|
|
||||||
shell = "/bin/bash";
|
|
||||||
|
|
||||||
fetchurlBoot = import ../../build-support/fetchurl {
|
|
||||||
inherit stdenv;
|
|
||||||
# Curl should be in /usr/bin or so.
|
|
||||||
curl = null;
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,7 +0,0 @@
|
||||||
export NIX_ENFORCE_PURITY=
|
|
||||||
|
|
||||||
if test -z "$cygwinConfigureEnableShared"; then
|
|
||||||
export configureFlags="$configureFlags --disable-shared"
|
|
||||||
fi
|
|
||||||
|
|
||||||
PATH_DELIMITER=';'
|
|
|
@ -17,12 +17,9 @@ assert system != "i686-cygwin" -> system == stdenvType;
|
||||||
|
|
||||||
rec {
|
rec {
|
||||||
|
|
||||||
gccWrapper = import ../build-support/gcc-wrapper;
|
|
||||||
genericStdenv = import ./generic;
|
|
||||||
|
|
||||||
|
|
||||||
# Trivial environment used for building other environments.
|
# Trivial environment used for building other environments.
|
||||||
stdenvInitial = (import ./initial) {
|
stdenvInitial = import ./initial {
|
||||||
name = "stdenv-initial";
|
name = "stdenv-initial";
|
||||||
inherit system;
|
inherit system;
|
||||||
};
|
};
|
||||||
|
@ -33,9 +30,8 @@ rec {
|
||||||
# i.e., the stuff in /bin, /usr/bin, etc. This environment should
|
# i.e., the stuff in /bin, /usr/bin, etc. This environment should
|
||||||
# be used with care, since many Nix packages will not build properly
|
# be used with care, since many Nix packages will not build properly
|
||||||
# with it (e.g., because they require GNU Make).
|
# with it (e.g., because they require GNU Make).
|
||||||
stdenvNative = (import ./native) {
|
stdenvNative = import ./native {
|
||||||
stdenv = stdenvInitial;
|
inherit stdenvInitial;
|
||||||
inherit genericStdenv gccWrapper;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
stdenvNativePkgs = allPackages {
|
stdenvNativePkgs = allPackages {
|
||||||
|
@ -45,13 +41,9 @@ rec {
|
||||||
|
|
||||||
|
|
||||||
# The Nix build environment.
|
# The Nix build environment.
|
||||||
stdenvNix = (import ./nix) (rec {
|
stdenvNix = import ./nix (rec {
|
||||||
stdenv = if system == "i686-darwin" then stdenvPowerpcDarwin else stdenvNative; # !!! hack
|
stdenv = stdenvNative;
|
||||||
pkgs = allPackages {
|
pkgs = stdenvNativePkgs;
|
||||||
inherit system;
|
|
||||||
bootStdenv = removeAttrs stdenv ["gcc"]; # Hack
|
|
||||||
noSysDirs = false;
|
|
||||||
};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
@ -59,32 +51,8 @@ rec {
|
||||||
stdenvLinux = (import ./linux {inherit system allPackages;}).stdenvLinux;
|
stdenvLinux = (import ./linux {inherit system allPackages;}).stdenvLinux;
|
||||||
|
|
||||||
|
|
||||||
# powerpc-darwin (Mac OS X) standard environment. Very simple for now
|
|
||||||
# (essentially it's just the native environment).
|
|
||||||
stdenvPowerpcDarwin = (import ./powerpc-darwin) {
|
|
||||||
stdenv = stdenvInitial;
|
|
||||||
inherit genericStdenv gccWrapper;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
# FreeBSD standard environment. Right now this is more or less the
|
|
||||||
# same as the native environemnt. Eventually we'll want a pure
|
|
||||||
# environment similar to stdenvLinux.
|
|
||||||
stdenvFreeBSD = (import ./freebsd) {
|
|
||||||
stdenv = stdenvInitial;
|
|
||||||
inherit genericStdenv gccWrapper;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
# Cygwin standard environment.
|
|
||||||
stdenvCygwin = (import ./cygwin) {
|
|
||||||
stdenv = stdenvInitial;
|
|
||||||
inherit genericStdenv gccWrapper;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
# MinGW/MSYS standard environment.
|
# MinGW/MSYS standard environment.
|
||||||
stdenvMinGW = (import ./mingw) {
|
stdenvMinGW = import ./mingw {
|
||||||
inherit system;
|
inherit system;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -94,10 +62,7 @@ rec {
|
||||||
if stdenvType == "i686-linux" then stdenvLinux else
|
if stdenvType == "i686-linux" then stdenvLinux else
|
||||||
if stdenvType == "x86_64-linux" then stdenvLinux else
|
if stdenvType == "x86_64-linux" then stdenvLinux else
|
||||||
if stdenvType == "powerpc-linux" then stdenvLinux else
|
if stdenvType == "powerpc-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 == "i686-mingw" then stdenvMinGW else
|
||||||
if stdenvType == "powerpc-darwin" then stdenvPowerpcDarwin else
|
|
||||||
if stdenvType == "i686-darwin" then stdenvNix else
|
if stdenvType == "i686-darwin" then stdenvNix else
|
||||||
stdenvNative;
|
stdenvNative;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,25 +0,0 @@
|
||||||
{stdenv, genericStdenv, gccWrapper}:
|
|
||||||
|
|
||||||
genericStdenv {
|
|
||||||
name = "stdenv-native";
|
|
||||||
preHook = ./prehook.sh;
|
|
||||||
initialPath = "/usr/local /usr /";
|
|
||||||
|
|
||||||
inherit stdenv;
|
|
||||||
|
|
||||||
gcc = gccWrapper {
|
|
||||||
name = "gcc-native";
|
|
||||||
nativeTools = true;
|
|
||||||
nativeLibc = true;
|
|
||||||
nativePrefix = "/usr";
|
|
||||||
inherit stdenv;
|
|
||||||
};
|
|
||||||
|
|
||||||
shell = "/bin/bash";
|
|
||||||
|
|
||||||
fetchurlBoot = import ../../build-support/fetchurl {
|
|
||||||
inherit stdenv;
|
|
||||||
# Curl should be in /usr/bin or so.
|
|
||||||
curl = null;
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,7 +0,0 @@
|
||||||
export NIX_ENFORCE_PURITY=
|
|
||||||
alias make=gmake
|
|
||||||
export MAKE=gmake
|
|
||||||
shopt -s expand_aliases
|
|
||||||
|
|
||||||
# Filter out stupid GCC warnings (in gcc-wrapper).
|
|
||||||
export NIX_GCC_NEEDS_GREP=1
|
|
|
@ -1,7 +1,7 @@
|
||||||
{ stdenv, name, preHook ? null, postHook ? null, initialPath, gcc, shell
|
{ stdenv, name, preHook ? null, postHook ? null, initialPath, gcc, shell
|
||||||
, param1 ? "", param2 ? "", param3 ? "", param4 ? "", param5 ? ""
|
, param1 ? "", param2 ? "", param3 ? "", param4 ? "", param5 ? ""
|
||||||
, extraAttrs ? {}
|
, extraAttrs ? {}
|
||||||
, fetchurlBoot
|
, fetchurlBoot, forceFetchurlBoot
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let {
|
let {
|
||||||
|
@ -80,7 +80,9 @@ let {
|
||||||
# "lift" packages like curl from the final stdenv for Linux to
|
# "lift" packages like curl from the final stdenv for Linux to
|
||||||
# all-packages.nix for that platform (meaning that it has a line
|
# all-packages.nix for that platform (meaning that it has a line
|
||||||
# like curl = if stdenv ? curl then stdenv.curl else ...).
|
# like curl = if stdenv ? curl then stdenv.curl else ...).
|
||||||
// extraAttrs;
|
// extraAttrs
|
||||||
|
|
||||||
|
// (if forceFetchurlBoot then {fetchurl = fetchurlBoot;} else {});
|
||||||
|
|
||||||
}.result;
|
}.result;
|
||||||
|
|
||||||
|
|
|
@ -114,7 +114,7 @@ rec {
|
||||||
shell = bootstrapTools.bash;
|
shell = bootstrapTools.bash;
|
||||||
initialPath = [staticTools] ++ extraPath;
|
initialPath = [staticTools] ++ extraPath;
|
||||||
inherit fetchurlBoot;
|
inherit fetchurlBoot;
|
||||||
extraAttrs = extraAttrs // {fetchurl = fetchurlBoot;};
|
forceFetchurlBoot = true;
|
||||||
inherit gcc;
|
inherit gcc;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -211,6 +211,7 @@ rec {
|
||||||
shell = stdenvLinuxBoot3Pkgs.bash + "/bin/sh";
|
shell = stdenvLinuxBoot3Pkgs.bash + "/bin/sh";
|
||||||
|
|
||||||
fetchurlBoot = stdenvLinuxBoot3.fetchurlBoot;
|
fetchurlBoot = stdenvLinuxBoot3.fetchurlBoot;
|
||||||
|
forceFetchurlBoot = false;
|
||||||
|
|
||||||
extraAttrs = {
|
extraAttrs = {
|
||||||
inherit (stdenvLinuxBoot2Pkgs) binutils /* gcc */ glibc;
|
inherit (stdenvLinuxBoot2Pkgs) binutils /* gcc */ glibc;
|
||||||
|
|
|
@ -1,24 +1,101 @@
|
||||||
{stdenv, genericStdenv, gccWrapper}:
|
{stdenvInitial}:
|
||||||
|
|
||||||
genericStdenv {
|
let
|
||||||
name = "stdenv-native";
|
|
||||||
preHook = ./prehook.sh;
|
|
||||||
initialPath = "/usr/local /usr /";
|
|
||||||
|
|
||||||
inherit stdenv;
|
system = stdenvInitial.system;
|
||||||
|
|
||||||
gcc = gccWrapper {
|
|
||||||
name = "gcc-native";
|
|
||||||
nativeTools = true;
|
|
||||||
nativeLibc = true;
|
|
||||||
nativePrefix = "/usr";
|
|
||||||
inherit stdenv;
|
|
||||||
};
|
|
||||||
|
|
||||||
shell = "/bin/bash";
|
shell = "/bin/bash";
|
||||||
|
|
||||||
extraAttrs = {
|
|
||||||
# Curl should be in /usr/bin or so.
|
prehookBase = builtins.toFile "prehook-base.sh" ''
|
||||||
curl = null;
|
# Disable purity tests; it's allowed (even needed) to link to
|
||||||
|
# libraries outside the Nix store (like the C library).
|
||||||
|
export NIX_ENFORCE_PURITY=
|
||||||
|
'';
|
||||||
|
|
||||||
|
prehookDarwin = builtins.toFile "prehook-darwin.sh" ''
|
||||||
|
source ${prehookBase}
|
||||||
|
export NIX_DONT_SET_RPATH=1
|
||||||
|
export NIX_NO_SELF_RPATH=1
|
||||||
|
dontFixLibtool=1
|
||||||
|
NIX_STRIP_DEBUG=0
|
||||||
|
stripAllFlags=" " # the Darwin "strip" command doesn't know "-s"
|
||||||
|
'';
|
||||||
|
|
||||||
|
prehookFreeBSD = builtins.toFile "prehook-freebsd.sh" ''
|
||||||
|
source ${prehookBase}
|
||||||
|
|
||||||
|
alias make=gmake
|
||||||
|
export MAKE=gmake
|
||||||
|
shopt -s expand_aliases
|
||||||
|
|
||||||
|
# Filter out stupid GCC warnings (in gcc-wrapper).
|
||||||
|
export NIX_GCC_NEEDS_GREP=1
|
||||||
|
'';
|
||||||
|
|
||||||
|
prehookCygwin = builtins.toFile "prehook-cygwin.sh" ''
|
||||||
|
source ${prehookBase}
|
||||||
|
|
||||||
|
if test -z "$cygwinConfigureEnableShared"; then
|
||||||
|
export configureFlags="$configureFlags --disable-shared"
|
||||||
|
fi
|
||||||
|
|
||||||
|
PATH_DELIMITER=';'
|
||||||
|
'';
|
||||||
|
|
||||||
|
|
||||||
|
# A function that builds a "native" stdenv (one that uses tools in
|
||||||
|
# /usr etc.).
|
||||||
|
makeStdenv = {stdenvBoot, extraPath, forceFetchurlBoot}: import ../generic {
|
||||||
|
name = "stdenv-native";
|
||||||
|
|
||||||
|
preHook =
|
||||||
|
if system == "i686-darwin" || system == "powerpc-darwin" then prehookDarwin else
|
||||||
|
if system == "i686-freebsd" then prehookFreeBSD else
|
||||||
|
prehookBase;
|
||||||
|
|
||||||
|
initialPath = extraPath ++ ["/" "/usr" "/usr/local"];
|
||||||
|
|
||||||
|
stdenv = stdenvBoot;
|
||||||
|
|
||||||
|
gcc = import ../../build-support/gcc-wrapper {
|
||||||
|
name = "gcc-native";
|
||||||
|
nativeTools = true;
|
||||||
|
nativeLibc = true;
|
||||||
|
nativePrefix = "/usr";
|
||||||
|
stdenv = stdenvBoot;
|
||||||
|
};
|
||||||
|
|
||||||
|
inherit shell forceFetchurlBoot;
|
||||||
|
|
||||||
|
fetchurlBoot = import ../../build-support/fetchurl {
|
||||||
|
stdenv = stdenvBoot;
|
||||||
|
# Curl should be in /usr/bin or so.
|
||||||
|
curl = null;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
|
||||||
|
|
||||||
|
# First build a stdenv based only on tools outside the store.
|
||||||
|
stdenvBoot1 = makeStdenv {
|
||||||
|
stdenvBoot = stdenvInitial;
|
||||||
|
extraPath = [];
|
||||||
|
forceFetchurlBoot = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
stdenvBoot1Pkgs = import ../../.. {
|
||||||
|
inherit system;
|
||||||
|
bootStdenv = stdenvBoot1;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
# Using that, build a stdenv that adds the `replace' command (which
|
||||||
|
# most systems don't have, so we mustn't rely on the native
|
||||||
|
# environment providing it).
|
||||||
|
stdenvBoot2 = makeStdenv {
|
||||||
|
stdenvBoot = stdenvBoot1;
|
||||||
|
extraPath = [stdenvBoot1Pkgs.replace];
|
||||||
|
forceFetchurlBoot = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
in stdenvBoot2
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
export NIX_ENFORCE_PURITY=
|
|
|
@ -22,8 +22,6 @@ import ../generic {
|
||||||
|
|
||||||
shell = pkgs.bash + "/bin/sh";
|
shell = pkgs.bash + "/bin/sh";
|
||||||
|
|
||||||
fetchurlBoot = import ../../build-support/fetchurl {
|
fetchurlBoot = stdenv.fetchurlBoot;
|
||||||
inherit stdenv;
|
forceFetchurlBoot = false;
|
||||||
curl = pkgs.curl;
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,25 +0,0 @@
|
||||||
{stdenv, genericStdenv, gccWrapper}:
|
|
||||||
|
|
||||||
genericStdenv {
|
|
||||||
name = "stdenv-darwin";
|
|
||||||
preHook = ./prehook.sh;
|
|
||||||
initialPath = "/usr/local /usr /";
|
|
||||||
|
|
||||||
inherit stdenv;
|
|
||||||
|
|
||||||
gcc = gccWrapper {
|
|
||||||
name = "gcc-darwin";
|
|
||||||
nativeTools = true;
|
|
||||||
nativeLibc = true;
|
|
||||||
nativePrefix = "/usr";
|
|
||||||
inherit stdenv;
|
|
||||||
};
|
|
||||||
|
|
||||||
shell = "/bin/sh";
|
|
||||||
|
|
||||||
fetchurlBoot = import ../../build-support/fetchurl {
|
|
||||||
inherit stdenv;
|
|
||||||
# Curl should be in /usr/bin or so.
|
|
||||||
curl = null;
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,6 +0,0 @@
|
||||||
export NIX_ENFORCE_PURITY=
|
|
||||||
export NIX_DONT_SET_RPATH=1
|
|
||||||
export NIX_NO_SELF_RPATH=1
|
|
||||||
dontFixLibtool=1
|
|
||||||
NIX_STRIP_DEBUG=0
|
|
||||||
stripAllFlags=" " # the Darwin "strip" command doesn't know "-s"
|
|
|
@ -247,11 +247,12 @@ let pkgs = rec {
|
||||||
### STANDARD ENVIRONMENT
|
### STANDARD ENVIRONMENT
|
||||||
|
|
||||||
|
|
||||||
defaultStdenv =
|
allStdenvs = import ../stdenv {
|
||||||
(import ../stdenv {
|
inherit system stdenvType;
|
||||||
inherit system stdenvType;
|
allPackages = import ./all-packages.nix;
|
||||||
allPackages = import ./all-packages.nix;
|
};
|
||||||
}).stdenv;
|
|
||||||
|
defaultStdenv = allStdenvs.stdenv;
|
||||||
|
|
||||||
stdenv =
|
stdenv =
|
||||||
if bootStdenv != null then bootStdenv else
|
if bootStdenv != null then bootStdenv else
|
||||||
|
@ -1713,17 +1714,15 @@ let pkgs = rec {
|
||||||
inherit fetchurl stdenv visualcpp windowssdk;
|
inherit fetchurl stdenv visualcpp windowssdk;
|
||||||
};
|
};
|
||||||
|
|
||||||
wrapGCC = baseGCC: wrapGCCWithGlibc baseGCC glibc;
|
wrapGCC = baseGCC: import ../build-support/gcc-wrapper {
|
||||||
|
|
||||||
wrapGCCWithGlibc = baseGCC: glibc: import ../build-support/gcc-wrapper {
|
|
||||||
nativeTools = stdenv ? gcc && stdenv.gcc.nativeTools;
|
nativeTools = stdenv ? gcc && stdenv.gcc.nativeTools;
|
||||||
nativeLibc = stdenv ? gcc && stdenv.gcc.nativeLibc;
|
nativeLibc = stdenv ? gcc && stdenv.gcc.nativeLibc;
|
||||||
|
nativePrefix = if stdenv ? gcc then stdenv.gcc.nativePrefix else "";
|
||||||
gcc = baseGCC;
|
gcc = baseGCC;
|
||||||
libc = glibc;
|
libc = glibc;
|
||||||
inherit stdenv binutils;
|
inherit stdenv binutils;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
# FIXME: This is a specific hack for GCC-UPC. Eventually, we may
|
# FIXME: This is a specific hack for GCC-UPC. Eventually, we may
|
||||||
# want to merge `gcc-upc-wrapper' and `gcc-wrapper'.
|
# want to merge `gcc-upc-wrapper' and `gcc-wrapper'.
|
||||||
wrapGCCUPC = baseGCC: import ../build-support/gcc-upc-wrapper {
|
wrapGCCUPC = baseGCC: import ../build-support/gcc-upc-wrapper {
|
||||||
|
|
Loading…
Reference in a new issue