nixpkgs/pkgs/stdenv/generic/builder.sh
Eelco Dolstra 0e6fa321bb * Don't use the "replace-literal" command in stdenv; instead use
bash's pattern replacement feature.  "replace-literal" is an
  uncommon command so it was a headache during the bootstrap.

svn path=/nixpkgs/branches/stdenv-updates/; revision=31681
2012-01-19 13:47:26 +00:00

36 lines
768 B
Bash

p1=$param1
p2=$param2
p3=$param3
p4=$param4
p5=$param5
_preHook="$preHook"
_postHook="$postHook"
preHook=
postHook=
export PATH=
for i in $initialPath; do
if test "$i" = /; then i=; fi
PATH=$PATH${PATH:+:}$i/bin
done
mkdir $out
sed \
-e "s^@preHook@^$_preHook^g" \
-e "s^@postHook@^$_postHook^g" \
-e "s^@initialPath@^$initialPath^g" \
-e "s^@gcc@^$gcc^g" \
-e "s^@shell@^$shell^g" \
-e "s^@param1@^$p1^g" \
-e "s^@param2@^$p2^g" \
-e "s^@param3@^$p3^g" \
-e "s^@param4@^$p4^g" \
-e "s^@param5@^$p5^g" \
< "$setup" > "$out/setup"
# Allow the user to install stdenv using nix-env and get the packages
# in stdenv.
mkdir $out/nix-support
echo $propagatedUserEnvPkgs > $out/nix-support/propagated-user-env-packages