From b190e6cd93616f67e981e4a3c37e2d296553ef89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Batlle=20i=20Rossell?= Date: Wed, 26 Dec 2012 22:20:43 +0100 Subject: [PATCH] Fixing problems in the previous commit. It didn't work. --- pkgs/stdenv/generic/builder.sh | 10 ++++++---- pkgs/stdenv/linux/default.nix | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/pkgs/stdenv/generic/builder.sh b/pkgs/stdenv/generic/builder.sh index 81e11c2df650..6274200900cc 100644 --- a/pkgs/stdenv/generic/builder.sh +++ b/pkgs/stdenv/generic/builder.sh @@ -9,14 +9,16 @@ 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 -if [ -n "$withNixImpure" ]; then - sed -i -e 's^@niximpure@^test -f /niximupure/impure.sh && . /niximpure/impure.sh^g' \ - $out/setup.tmp -fi mv $out/setup.tmp $out/setup # Allow the user to install stdenv using nix-env and get the packages diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix index df89b3714f8a..73768e8f40e7 100644 --- a/pkgs/stdenv/linux/default.nix +++ b/pkgs/stdenv/linux/default.nix @@ -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; };