* Prepend the "prehook" rather than sourcing it.
* Don't call xargs with the -r flag in the Darwin bootstrap. svn path=/nixpkgs/branches/stdenv-updates/; revision=31703
This commit is contained in:
parent
6208059079
commit
ee45e160b1
@ -6,12 +6,13 @@ done
|
|||||||
|
|
||||||
mkdir $out
|
mkdir $out
|
||||||
|
|
||||||
sed \
|
echo "$preHook" > $out/setup
|
||||||
-e "s^@preHook@^$preHook^g" \
|
cat "$setup" >> $out/setup
|
||||||
|
|
||||||
|
sed -i "$out/setup" \
|
||||||
-e "s^@initialPath@^$initialPath^g" \
|
-e "s^@initialPath@^$initialPath^g" \
|
||||||
-e "s^@gcc@^$gcc^g" \
|
-e "s^@gcc@^$gcc^g" \
|
||||||
-e "s^@shell@^$shell^g" \
|
-e "s^@shell@^$shell^g"
|
||||||
< "$setup" > "$out/setup"
|
|
||||||
|
|
||||||
# Allow the user to install stdenv using nix-env and get the packages
|
# Allow the user to install stdenv using nix-env and get the packages
|
||||||
# in stdenv.
|
# in stdenv.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ system, name, preHook ? null, initialPath, gcc, shell
|
{ system, name, preHook ? "", initialPath, gcc, shell
|
||||||
, extraAttrs ? {}, overrides ? (pkgs: {})
|
, extraAttrs ? {}, overrides ? (pkgs: {})
|
||||||
|
|
||||||
, # The `fetchurl' to use for downloading curl and its dependencies
|
, # The `fetchurl' to use for downloading curl and its dependencies
|
||||||
|
@ -103,7 +103,6 @@ fi
|
|||||||
# Execute the pre-hook.
|
# Execute the pre-hook.
|
||||||
export SHELL=@shell@
|
export SHELL=@shell@
|
||||||
if [ -z "$shell" ]; then export shell=@shell@; fi
|
if [ -z "$shell" ]; then export shell=@shell@; fi
|
||||||
if [ -n "@preHook@" ]; then source @preHook@; fi
|
|
||||||
runHook preHook
|
runHook preHook
|
||||||
|
|
||||||
|
|
||||||
@ -174,6 +173,7 @@ for i in $buildNativeInputs $propagatedBuildNativeInputs; do
|
|||||||
findInputs $i nativePkgs propagated-build-native-inputs
|
findInputs $i nativePkgs propagated-build-native-inputs
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
# Set the relevant environment variables to point to the build inputs
|
# Set the relevant environment variables to point to the build inputs
|
||||||
# found above.
|
# found above.
|
||||||
addToNativeEnv() {
|
addToNativeEnv() {
|
||||||
|
@ -55,10 +55,10 @@ rec {
|
|||||||
|
|
||||||
builder = bootstrapFiles.sh;
|
builder = bootstrapFiles.sh;
|
||||||
|
|
||||||
args = if (system == "armv5tel-linux") then
|
args =
|
||||||
([ ./scripts/unpack-bootstrap-tools-arm.sh ])
|
if system == "armv5tel-linux"
|
||||||
else
|
then [ ./scripts/unpack-bootstrap-tools-arm.sh ]
|
||||||
([ ./scripts/unpack-bootstrap-tools.sh ]);
|
else [ ./scripts/unpack-bootstrap-tools.sh ];
|
||||||
|
|
||||||
inherit (bootstrapFiles) bzip2 mkdir curl cpio;
|
inherit (bootstrapFiles) bzip2 mkdir curl cpio;
|
||||||
|
|
||||||
@ -82,7 +82,7 @@ rec {
|
|||||||
import ../generic {
|
import ../generic {
|
||||||
inherit system;
|
inherit system;
|
||||||
name = "stdenv-linux-boot";
|
name = "stdenv-linux-boot";
|
||||||
preHook = builtins.toFile "prehook.sh"
|
preHook =
|
||||||
''
|
''
|
||||||
# Don't patch #!/interpreter because it leads to retained
|
# Don't patch #!/interpreter because it leads to retained
|
||||||
# dependencies on the bootstrapTools in the final stdenv.
|
# dependencies on the bootstrapTools in the final stdenv.
|
||||||
@ -263,7 +263,7 @@ rec {
|
|||||||
|
|
||||||
inherit system;
|
inherit system;
|
||||||
|
|
||||||
preHook = builtins.toFile "prehook.sh" commonPreHook;
|
preHook = commonPreHook;
|
||||||
|
|
||||||
initialPath =
|
initialPath =
|
||||||
((import ../common-path.nix) {pkgs = stdenvLinuxBoot4Pkgs;})
|
((import ../common-path.nix) {pkgs = stdenvLinuxBoot4Pkgs;})
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
export NIX_ENFORCE_PURITY=1
|
|
||||||
|
|
||||||
havePatchELF=1
|
|
@ -11,22 +11,23 @@ rec {
|
|||||||
(if system == "i686-netbsd" then [ "/usr/pkg" ] else []) ++
|
(if system == "i686-netbsd" then [ "/usr/pkg" ] else []) ++
|
||||||
["/" "/usr" "/usr/local"];
|
["/" "/usr" "/usr/local"];
|
||||||
|
|
||||||
prehookBase = builtins.toFile "prehook-base.sh" ''
|
prehookBase = ''
|
||||||
# Disable purity tests; it's allowed (even needed) to link to
|
# Disable purity tests; it's allowed (even needed) to link to
|
||||||
# libraries outside the Nix store (like the C library).
|
# libraries outside the Nix store (like the C library).
|
||||||
export NIX_ENFORCE_PURITY=
|
export NIX_ENFORCE_PURITY=
|
||||||
'';
|
'';
|
||||||
|
|
||||||
prehookDarwin = builtins.toFile "prehook-darwin.sh" ''
|
prehookDarwin = ''
|
||||||
source ${prehookBase}
|
${prehookBase}
|
||||||
export NIX_DONT_SET_RPATH=1
|
export NIX_DONT_SET_RPATH=1
|
||||||
export NIX_NO_SELF_RPATH=1
|
export NIX_NO_SELF_RPATH=1
|
||||||
dontFixLibtool=1
|
dontFixLibtool=1
|
||||||
stripAllFlags=" " # the Darwin "strip" command doesn't know "-s"
|
stripAllFlags=" " # the Darwin "strip" command doesn't know "-s"
|
||||||
|
xargsFlags=" "
|
||||||
'';
|
'';
|
||||||
|
|
||||||
prehookFreeBSD = builtins.toFile "prehook-freebsd.sh" ''
|
prehookFreeBSD = ''
|
||||||
source ${prehookBase}
|
${prehookBase}
|
||||||
|
|
||||||
alias make=gmake
|
alias make=gmake
|
||||||
alias tar=gtar
|
alias tar=gtar
|
||||||
@ -38,8 +39,8 @@ rec {
|
|||||||
export NIX_GCC_NEEDS_GREP=1
|
export NIX_GCC_NEEDS_GREP=1
|
||||||
'';
|
'';
|
||||||
|
|
||||||
prehookOpenBSD = builtins.toFile "prehook-openbsd.sh" ''
|
prehookOpenBSD = ''
|
||||||
source ${prehookBase}
|
${prehookBase}
|
||||||
|
|
||||||
alias make=gmake
|
alias make=gmake
|
||||||
alias grep=ggrep
|
alias grep=ggrep
|
||||||
@ -55,8 +56,8 @@ rec {
|
|||||||
export NIX_GCC_NEEDS_GREP=1
|
export NIX_GCC_NEEDS_GREP=1
|
||||||
'';
|
'';
|
||||||
|
|
||||||
prehookNetBSD = builtins.toFile "prehook-netbsd.sh" ''
|
prehookNetBSD = ''
|
||||||
source ${prehookBase}
|
${prehookBase}
|
||||||
|
|
||||||
alias make=gmake
|
alias make=gmake
|
||||||
alias sed=gsed
|
alias sed=gsed
|
||||||
@ -68,8 +69,8 @@ rec {
|
|||||||
export NIX_GCC_NEEDS_GREP=1
|
export NIX_GCC_NEEDS_GREP=1
|
||||||
'';
|
'';
|
||||||
|
|
||||||
prehookCygwin = builtins.toFile "prehook-cygwin.sh" ''
|
prehookCygwin = ''
|
||||||
source ${prehookBase}
|
${prehookBase}
|
||||||
|
|
||||||
if test -z "$cygwinConfigureEnableShared"; then
|
if test -z "$cygwinConfigureEnableShared"; then
|
||||||
export configureFlags="$configureFlags --disable-shared"
|
export configureFlags="$configureFlags --disable-shared"
|
||||||
|
@ -2,7 +2,21 @@
|
|||||||
|
|
||||||
import ../generic {
|
import ../generic {
|
||||||
name = "stdenv-nix";
|
name = "stdenv-nix";
|
||||||
preHook = ./prehook.sh;
|
|
||||||
|
preHook =
|
||||||
|
''
|
||||||
|
export NIX_ENFORCE_PURITY=1
|
||||||
|
export NIX_IGNORE_LD_THROUGH_GCC=1
|
||||||
|
|
||||||
|
if [ "$system" = "i686-darwin" -o "$system" = "powerpc-darwin" -o "$system" = "x86_64-darwin" ]; then
|
||||||
|
export NIX_DONT_SET_RPATH=1
|
||||||
|
export NIX_NO_SELF_RPATH=1
|
||||||
|
dontFixLibtool=1
|
||||||
|
stripAllFlags=" " # the Darwin "strip" command doesn't know "-s"
|
||||||
|
xargsFlags=" "
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
|
||||||
initialPath = (import ../common-path.nix) {pkgs = pkgs;};
|
initialPath = (import ../common-path.nix) {pkgs = pkgs;};
|
||||||
|
|
||||||
system = stdenv.system;
|
system = stdenv.system;
|
||||||
|
@ -1,10 +0,0 @@
|
|||||||
export NIX_ENFORCE_PURITY=1
|
|
||||||
export NIX_IGNORE_LD_THROUGH_GCC=1
|
|
||||||
|
|
||||||
if test "$system" = "i686-darwin" -o "$system" = "powerpc-darwin" -o "$system" = "x86_64-darwin"; then
|
|
||||||
export NIX_DONT_SET_RPATH=1
|
|
||||||
export NIX_NO_SELF_RPATH=1
|
|
||||||
dontFixLibtool=1
|
|
||||||
stripAllFlags=" " # the Darwin "strip" command doesn't know "-s"
|
|
||||||
xargsFlags=" "
|
|
||||||
fi
|
|
Loading…
x
Reference in New Issue
Block a user