Making a trick on myEnv so I can put the cross gcc and some 'propagatedBuildInputs',
to have myEnv with cross-builders and cross-built libs. (I'm trying by now to mingw64 + librsync.hostDrv) svn path=/nixpkgs/trunk/; revision=34249
This commit is contained in:
parent
d40123a247
commit
6934b46182
@ -56,17 +56,24 @@
|
|||||||
and show you a shell with a prefixed prompt.
|
and show you a shell with a prefixed prompt.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
{ mkDerivation, substituteAll, pkgs } : { stdenv ? pkgs.stdenv, name, buildInputs ? [], cTags ? [], extraCmds ? "", shell ? "${pkgs.bashInteractive}/bin/bash"} :
|
{ mkDerivation, substituteAll, pkgs }:
|
||||||
|
{ stdenv ? pkgs.stdenv, name, buildInputs ? []
|
||||||
|
, propagatedBuildInputs ? [], gcc ? stdenv.gcc, cTags ? [], extraCmds ? ""
|
||||||
|
, shell ? "${pkgs.bashInteractive}/bin/bash"}:
|
||||||
|
|
||||||
mkDerivation {
|
mkDerivation {
|
||||||
# The setup.sh script from stdenv will expect the native build inputs in
|
# The setup.sh script from stdenv will expect the native build inputs in
|
||||||
# the buildNativeInputs environment variable.
|
# the buildNativeInputs environment variable.
|
||||||
buildNativeInputs = [ ] ++ buildInputs ;
|
buildNativeInputs = [ ] ++ buildInputs;
|
||||||
|
# Trick to bypass the stdenv usual change of propagatedBuildInputs => propagatedNativeBuildInputs
|
||||||
|
propagatedBuildInputs2 = propagatedBuildInputs;
|
||||||
|
|
||||||
name = "env-${name}";
|
name = "env-${name}";
|
||||||
phases = [ "buildPhase" "fixupPhase" ];
|
phases = [ "buildPhase" "fixupPhase" ];
|
||||||
setupNew = substituteAll {
|
setupNew = substituteAll {
|
||||||
src = ../../stdenv/generic/setup.sh;
|
src = ../../stdenv/generic/setup.sh;
|
||||||
initialPath= (import ../../stdenv/common-path.nix) { inherit pkgs; };
|
initialPath= (import ../../stdenv/common-path.nix) { inherit pkgs; };
|
||||||
gcc = stdenv.gcc;
|
inherit gcc;
|
||||||
};
|
};
|
||||||
|
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
@ -81,6 +88,7 @@ mkDerivation {
|
|||||||
-i "$s"
|
-i "$s"
|
||||||
cat >> "$out/dev-envs/''${name/env-/}" << EOF
|
cat >> "$out/dev-envs/''${name/env-/}" << EOF
|
||||||
buildNativeInputs="$buildNativeInputs"
|
buildNativeInputs="$buildNativeInputs"
|
||||||
|
propagatedBuildInputs="$propagatedBuildInputs2"
|
||||||
# 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"
|
||||||
|
Loading…
Reference in New Issue
Block a user