Merge pull request #229 from viric/niximpure2-stdenv-updates

Allow /niximpure/impure.sh impurity, only for users wanting it
This commit is contained in:
viric 2012-12-27 07:04:56 -08:00
commit e04b17bfba
4 changed files with 13 additions and 2 deletions

View File

@ -9,9 +9,15 @@ mkdir $out
echo "$preHook" > $out/setup
cat "$setup" >> $out/setup
if [ "$withNixImpure" == 1 ]; then
# sed wants \&\& for a &&
niximpure='test -f /niximpure/impure.sh \&\& . /niximpure/impure.sh'
fi
sed -e "s^@initialPath@^$initialPath^g" \
-e "s^@gcc@^$gcc^g" \
-e "s^@shell@^$shell^g" \
-e "s^@niximpure@^$niximpure^g" \
< $out/setup > $out/setup.tmp
mv $out/setup.tmp $out/setup

View File

@ -1,5 +1,6 @@
{ system, name ? "stdenv", preHook ? "", initialPath, gcc, shell
, extraAttrs ? {}, overrides ? (pkgs: {})
, withNixImpure ? false
, # The `fetchurl' to use for downloading curl and its dependencies
# (see all-packages.nix).
@ -26,7 +27,7 @@ let
setup = setupScript;
inherit preHook initialPath gcc shell;
inherit preHook initialPath gcc shell withNixImpure;
propagatedUserEnvPkgs = [gcc] ++
lib.filter lib.isDerivation initialPath;

View File

@ -270,6 +270,7 @@ elif [ "$NIX_BUILD_CORES" -le 0 ]; then
fi
export NIX_BUILD_CORES
@niximpure@
######################################################################
# Misc. helper functions.

View File

@ -94,6 +94,7 @@ rec {
initialPath = [bootstrapTools] ++ extraPath;
fetchurlBoot = fetchurl;
inherit gcc;
withNixImpure = if platform ? nixImpure then platform.nixImpure else false;
# Having the proper 'platform' in all the stdenvs allows getting proper
# linuxHeaders for example.
extraAttrs = extraAttrs // { inherit platform; };
@ -264,7 +265,7 @@ rec {
inherit system;
preHook = commonPreHook;
initialPath =
((import ../common-path.nix) {pkgs = stdenvLinuxBoot4Pkgs;})
++ [stdenvLinuxBoot4Pkgs.patchelf];
@ -281,6 +282,8 @@ rec {
shell = stdenvLinuxBoot4Pkgs.bash + "/bin/bash";
fetchurlBoot = fetchurl;
withNixImpure = if platform ? nixImpure then platform.nixImpure else false;
extraAttrs = {
inherit (stdenvLinuxBoot3Pkgs) glibc;