Fixing 'my-env' on stdenv-updates, considering that users will add

'buildInputs' to its mkDerivation parameter, while the stdenv setup.sh script
would expect buildNativeInputs.


svn path=/nixpkgs/branches/stdenv-updates/; revision=19615
This commit is contained in:
Lluís Batlle i Rossell 2010-01-22 15:00:15 +00:00
parent 94ed14ccef
commit fedf79faea

View File

@ -41,7 +41,9 @@
{ mkDerivation, substituteAll, pkgs } : { stdenv ? pkgs.stdenv, name, buildInputs ? [], cTags ? [], extraCmds ? ""} : { mkDerivation, substituteAll, pkgs } : { stdenv ? pkgs.stdenv, name, buildInputs ? [], cTags ? [], extraCmds ? ""} :
mkDerivation { mkDerivation {
buildInputs = [ ] ++ buildInputs ; # The setup.sh script from stdenv will expect the native build inputs in
# the buildNativeInputs environment variable.
buildNativeInputs = [ ] ++ buildInputs ;
name = "env-${name}"; name = "env-${name}";
phases = "buildPhase"; phases = "buildPhase";
setupNew = substituteAll { setupNew = substituteAll {
@ -62,7 +64,7 @@ mkDerivation {
-e 's@trap.*@@' \ -e 's@trap.*@@' \
-i "$s" -i "$s"
cat >> "$out/dev-envs/''${name/env-/}" << EOF cat >> "$out/dev-envs/''${name/env-/}" << EOF
buildInputs="$buildNativeInputs" buildNativeInputs="$buildNativeInputs"
# the setup-new script wants to write some data to a temp file.. so just let it do that and tidy up afterwards # the setup-new script wants to write some data to a temp file.. so just let it do that and tidy up afterwards
tmp="\$("${pkgs.coreutils}/bin/mktemp" -d)" tmp="\$("${pkgs.coreutils}/bin/mktemp" -d)"
NIX_BUILD_TOP="\$tmp" NIX_BUILD_TOP="\$tmp"