2012-12-28 19:36:09 +04:00
|
|
|
|
{ system, allPackages ? import ../../.., config }:
|
2004-03-08 19:02:46 +03:00
|
|
|
|
|
2009-02-02 18:03:38 +03:00
|
|
|
|
rec {
|
2004-03-08 19:02:46 +03:00
|
|
|
|
|
2012-11-29 17:10:49 +04:00
|
|
|
|
shell =
|
2011-11-21 18:11:04 +04:00
|
|
|
|
if system == "i686-freebsd" || system == "x86_64-freebsd" then "/usr/local/bin/bash"
|
2011-11-18 21:41:21 +04:00
|
|
|
|
else "/bin/bash";
|
2008-06-18 19:09:13 +04:00
|
|
|
|
|
2012-11-29 17:10:49 +04:00
|
|
|
|
path =
|
2011-11-21 18:11:04 +04:00
|
|
|
|
(if system == "i686-solaris" then [ "/usr/gnu" ] else []) ++
|
2009-10-16 14:03:27 +04:00
|
|
|
|
(if system == "i686-netbsd" then [ "/usr/pkg" ] else []) ++
|
2013-02-20 13:20:07 +04:00
|
|
|
|
(if system == "x86_64-solaris" then [ "/opt/local/gnu" ] else []) ++
|
2009-09-30 19:19:25 +04:00
|
|
|
|
["/" "/usr" "/usr/local"];
|
2008-06-18 19:09:13 +04:00
|
|
|
|
|
2012-01-19 19:56:17 +04:00
|
|
|
|
prehookBase = ''
|
2008-06-18 19:09:13 +04:00
|
|
|
|
# Disable purity tests; it's allowed (even needed) to link to
|
|
|
|
|
# libraries outside the Nix store (like the C library).
|
|
|
|
|
export NIX_ENFORCE_PURITY=
|
|
|
|
|
'';
|
|
|
|
|
|
2012-01-19 19:56:17 +04:00
|
|
|
|
prehookDarwin = ''
|
|
|
|
|
${prehookBase}
|
2008-06-18 19:09:13 +04:00
|
|
|
|
export NIX_DONT_SET_RPATH=1
|
|
|
|
|
export NIX_NO_SELF_RPATH=1
|
|
|
|
|
dontFixLibtool=1
|
2012-11-29 17:10:49 +04:00
|
|
|
|
stripAllFlags=" " # the Darwin "strip" command doesn't know "-s"
|
2012-01-19 19:56:17 +04:00
|
|
|
|
xargsFlags=" "
|
2008-06-18 19:09:13 +04:00
|
|
|
|
'';
|
|
|
|
|
|
2012-01-19 19:56:17 +04:00
|
|
|
|
prehookFreeBSD = ''
|
|
|
|
|
${prehookBase}
|
2012-11-29 17:10:49 +04:00
|
|
|
|
|
2010-02-10 14:54:49 +03:00
|
|
|
|
alias make=gmake
|
|
|
|
|
alias tar=gtar
|
|
|
|
|
alias sed=gsed
|
2008-06-18 19:09:13 +04:00
|
|
|
|
export MAKE=gmake
|
|
|
|
|
shopt -s expand_aliases
|
|
|
|
|
|
|
|
|
|
# Filter out stupid GCC warnings (in gcc-wrapper).
|
|
|
|
|
export NIX_GCC_NEEDS_GREP=1
|
|
|
|
|
'';
|
|
|
|
|
|
2012-01-19 19:56:17 +04:00
|
|
|
|
prehookOpenBSD = ''
|
|
|
|
|
${prehookBase}
|
2012-11-29 17:10:49 +04:00
|
|
|
|
|
2010-02-08 15:41:15 +03:00
|
|
|
|
alias make=gmake
|
|
|
|
|
alias grep=ggrep
|
|
|
|
|
alias mv=gmv
|
|
|
|
|
alias ln=gln
|
|
|
|
|
alias sed=gsed
|
|
|
|
|
alias tar=gtar
|
2012-11-29 17:10:49 +04:00
|
|
|
|
|
2009-09-23 17:30:04 +04:00
|
|
|
|
export MAKE=gmake
|
|
|
|
|
shopt -s expand_aliases
|
|
|
|
|
|
|
|
|
|
# Filter out stupid GCC warnings (in gcc-wrapper).
|
|
|
|
|
export NIX_GCC_NEEDS_GREP=1
|
|
|
|
|
'';
|
|
|
|
|
|
2012-01-19 19:56:17 +04:00
|
|
|
|
prehookNetBSD = ''
|
|
|
|
|
${prehookBase}
|
2012-11-29 17:10:49 +04:00
|
|
|
|
|
2009-10-16 14:03:27 +04:00
|
|
|
|
alias make=gmake
|
|
|
|
|
alias sed=gsed
|
2009-10-16 14:09:33 +04:00
|
|
|
|
alias tar=gtar
|
2009-10-16 14:03:27 +04:00
|
|
|
|
export MAKE=gmake
|
|
|
|
|
shopt -s expand_aliases
|
2012-11-29 17:10:49 +04:00
|
|
|
|
|
2009-10-16 14:03:27 +04:00
|
|
|
|
# Filter out stupid GCC warnings (in gcc-wrapper).
|
|
|
|
|
export NIX_GCC_NEEDS_GREP=1
|
|
|
|
|
'';
|
|
|
|
|
|
2012-01-19 19:56:17 +04:00
|
|
|
|
prehookCygwin = ''
|
|
|
|
|
${prehookBase}
|
2012-11-29 17:10:49 +04:00
|
|
|
|
|
2008-06-18 19:09:13 +04:00
|
|
|
|
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
|
2012-11-29 17:10:49 +04:00
|
|
|
|
# /usr etc.).
|
2009-02-02 18:03:38 +03:00
|
|
|
|
makeStdenv =
|
2012-01-19 20:50:09 +04:00
|
|
|
|
{ gcc, fetchurl, extraPath ? [], overrides ? (pkgs: { }) }:
|
2009-02-02 18:03:38 +03:00
|
|
|
|
|
|
|
|
|
import ../generic {
|
|
|
|
|
preHook =
|
2012-11-29 17:10:49 +04:00
|
|
|
|
if system == "x86_64-darwin" then prehookDarwin else
|
2009-02-02 18:03:38 +03:00
|
|
|
|
if system == "i686-freebsd" then prehookFreeBSD else
|
2011-11-18 21:41:21 +04:00
|
|
|
|
if system == "x86_64-freebsd" then prehookFreeBSD else
|
2009-09-23 17:30:04 +04:00
|
|
|
|
if system == "i686-openbsd" then prehookOpenBSD else
|
2012-11-29 17:10:49 +04:00
|
|
|
|
if system == "i686-netbsd" then prehookNetBSD else
|
2009-02-02 18:03:38 +03:00
|
|
|
|
prehookBase;
|
2008-06-18 19:09:13 +04:00
|
|
|
|
|
2009-02-02 18:03:38 +03:00
|
|
|
|
initialPath = extraPath ++ path;
|
2008-06-18 19:09:13 +04:00
|
|
|
|
|
2009-02-02 18:03:38 +03:00
|
|
|
|
fetchurlBoot = fetchurl;
|
2008-06-18 19:09:13 +04:00
|
|
|
|
|
2012-12-28 19:36:09 +04:00
|
|
|
|
inherit system shell gcc overrides config;
|
2008-06-18 19:09:13 +04:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
2009-02-02 18:03:38 +03:00
|
|
|
|
stdenvBoot0 = makeStdenv {
|
|
|
|
|
gcc = "/no-such-path";
|
|
|
|
|
fetchurl = null;
|
|
|
|
|
};
|
2012-11-29 17:10:49 +04:00
|
|
|
|
|
2009-02-02 18:03:38 +03:00
|
|
|
|
|
|
|
|
|
gcc = import ../../build-support/gcc-wrapper {
|
|
|
|
|
name = "gcc-native";
|
|
|
|
|
nativeTools = true;
|
|
|
|
|
nativeLibc = true;
|
2013-02-28 18:52:14 +04:00
|
|
|
|
nativePrefix = if system == "i686-solaris" then "/usr/gnu" else if system == "x86_64-solaris" then "/opt/local/gcc47" else "/usr";
|
2009-02-02 18:03:38 +03:00
|
|
|
|
stdenv = stdenvBoot0;
|
2004-03-08 19:02:46 +03:00
|
|
|
|
};
|
2004-03-29 21:23:01 +04:00
|
|
|
|
|
2012-11-29 17:10:49 +04:00
|
|
|
|
|
2009-02-02 18:03:38 +03:00
|
|
|
|
fetchurl = import ../../build-support/fetchurl {
|
|
|
|
|
stdenv = stdenvBoot0;
|
|
|
|
|
# Curl should be in /usr/bin or so.
|
|
|
|
|
curl = null;
|
|
|
|
|
};
|
2012-11-29 17:10:49 +04:00
|
|
|
|
|
|
|
|
|
|
2008-06-18 19:09:13 +04:00
|
|
|
|
# First build a stdenv based only on tools outside the store.
|
|
|
|
|
stdenvBoot1 = makeStdenv {
|
2009-02-02 18:03:38 +03:00
|
|
|
|
inherit gcc fetchurl;
|
|
|
|
|
} // {inherit fetchurl;};
|
2008-06-18 19:09:13 +04:00
|
|
|
|
|
2009-02-02 18:03:38 +03:00
|
|
|
|
stdenvBoot1Pkgs = allPackages {
|
2008-06-18 19:09:13 +04:00
|
|
|
|
inherit system;
|
|
|
|
|
bootStdenv = stdenvBoot1;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
2012-01-19 20:50:09 +04:00
|
|
|
|
# Using that, build a stdenv that adds the ‘xz’ command (which most
|
|
|
|
|
# systems don't have, so we mustn't rely on the native environment
|
|
|
|
|
# providing it).
|
2008-06-18 19:09:13 +04:00
|
|
|
|
stdenvBoot2 = makeStdenv {
|
2009-02-02 18:03:38 +03:00
|
|
|
|
inherit gcc fetchurl;
|
2012-01-19 20:50:09 +04:00
|
|
|
|
extraPath = [ stdenvBoot1Pkgs.xz ];
|
|
|
|
|
overrides = pkgs: { inherit (stdenvBoot1Pkgs) xz; };
|
2008-06-18 19:09:13 +04:00
|
|
|
|
};
|
|
|
|
|
|
2009-02-02 18:03:38 +03:00
|
|
|
|
|
|
|
|
|
stdenv = stdenvBoot2;
|
|
|
|
|
}
|