top-level: Make config-overriden stdenv bootstrap more normally
This commit is contained in:
parent
ea7bf02268
commit
6bfe04277f
|
@ -1,9 +1,13 @@
|
||||||
{ system, allPackages, platform, crossSystem, config, ... } @ args:
|
{ system, allPackages, platform, crossSystem, config, ... } @ args:
|
||||||
|
|
||||||
rec {
|
rec {
|
||||||
vanillaStdenv = (import ../. (args // {
|
argClobber = {
|
||||||
crossSystem = null;
|
crossSystem = null;
|
||||||
allPackages = args: allPackages ({ crossSystem = null; } // args);
|
# Ignore custom stdenvs when cross compiling for compatability
|
||||||
|
config = builtins.removeAttrs config [ "replaceStdenv" ];
|
||||||
|
};
|
||||||
|
vanillaStdenv = (import ../. (args // argClobber // {
|
||||||
|
allPackages = args: allPackages (argClobber // args);
|
||||||
})).stdenv;
|
})).stdenv;
|
||||||
|
|
||||||
# Yeah this isn't so cleanly just build-time packages yet. Notice the
|
# Yeah this isn't so cleanly just build-time packages yet. Notice the
|
||||||
|
|
17
pkgs/stdenv/custom/default.nix
Normal file
17
pkgs/stdenv/custom/default.nix
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
{ system, allPackages, platform, crossSystem, config, ... } @ args:
|
||||||
|
|
||||||
|
rec {
|
||||||
|
vanillaStdenv = (import ../. (args // {
|
||||||
|
# Remove config.replaceStdenv to ensure termination.
|
||||||
|
config = builtins.removeAttrs config [ "replaceStdenv" ];
|
||||||
|
})).stdenv;
|
||||||
|
|
||||||
|
buildPackages = allPackages {
|
||||||
|
# It's OK to change the built-time dependencies
|
||||||
|
allowCustomOverrides = true;
|
||||||
|
bootStdenv = vanillaStdenv;
|
||||||
|
inherit system platform crossSystem config;
|
||||||
|
};
|
||||||
|
|
||||||
|
stdenvCustom = config.replaceStdenv { pkgs = buildPackages; };
|
||||||
|
}
|
|
@ -40,9 +40,12 @@ rec {
|
||||||
|
|
||||||
inherit (import ./cross { inherit system allPackages platform crossSystem config lib; }) stdenvCross;
|
inherit (import ./cross { inherit system allPackages platform crossSystem config lib; }) stdenvCross;
|
||||||
|
|
||||||
|
inherit (import ./custom { inherit system allPackages platform crossSystem config lib; }) stdenvCustom;
|
||||||
|
|
||||||
# Select the appropriate stdenv for the platform `system'.
|
# Select the appropriate stdenv for the platform `system'.
|
||||||
stdenv =
|
stdenv =
|
||||||
if crossSystem != null then stdenvCross else
|
if crossSystem != null then stdenvCross else
|
||||||
|
if config ? replaceStdenv then stdenvCustom else
|
||||||
if system == "i686-linux" then stdenvLinux else
|
if system == "i686-linux" then stdenvLinux else
|
||||||
if system == "x86_64-linux" then stdenvLinux else
|
if system == "x86_64-linux" then stdenvLinux else
|
||||||
if system == "armv5tel-linux" then stdenvLinux else
|
if system == "armv5tel-linux" then stdenvLinux else
|
||||||
|
|
|
@ -9,16 +9,7 @@ rec {
|
||||||
defaultStdenv = allStdenvs.stdenv // { inherit platform; };
|
defaultStdenv = allStdenvs.stdenv // { inherit platform; };
|
||||||
|
|
||||||
stdenv =
|
stdenv =
|
||||||
if bootStdenv != null then
|
if bootStdenv != null
|
||||||
(bootStdenv // { inherit platform; })
|
then (bootStdenv // { inherit platform; })
|
||||||
else if crossSystem == null && config ? replaceStdenv then
|
else defaultStdenv;
|
||||||
config.replaceStdenv {
|
|
||||||
# We import again all-packages to avoid recursivities.
|
|
||||||
pkgs = nixpkgsFun {
|
|
||||||
# We remove packageOverrides to avoid recursivities
|
|
||||||
config = removeAttrs config [ "replaceStdenv" ];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
else
|
|
||||||
defaultStdenv;
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue