nixpkgs/pkgs/stdenv/nix/default.nix
John Ericson 92edcb7ebb top-level: Lay the groundwork for {build,host,target}Platform
The long term goal is a big replace:
  { inherit system platform; } => buildPlatform
  crossSystem => hostPlatform
  stdenv.cross => targetPlatform
And additionally making sure each is defined even when not cross compiling.

This commit refactors the bootstrapping code along that vision, but leaves
the old identifiers with their null semantics in place so packages can be
modernized incrementally.
2017-01-24 11:37:56 -05:00

54 lines
1.3 KiB
Nix

{ lib
, crossSystem, config
, bootStages
, ...
}:
assert crossSystem == null;
bootStages ++ [
(prevStage: let
inherit (prevStage) stdenv;
in {
inherit (prevStage) buildPlatform hostPlatform targetPlatform;
inherit config overlays;
stdenv = import ../generic rec {
inherit config;
preHook = ''
export NIX_ENFORCE_PURITY="''${NIX_ENFORCE_PURITY-1}"
export NIX_ENFORCE_NO_NATIVE="''${NIX_ENFORCE_NO_NATIVE-1}"
export NIX_IGNORE_LD_THROUGH_GCC=1
'';
initialPath = (import ../common-path.nix) { pkgs = prevStage; };
system = stdenv.system;
cc = import ../../build-support/cc-wrapper {
nativeTools = false;
nativePrefix = stdenv.lib.optionalString stdenv.isSunOS "/usr";
nativeLibc = true;
inherit stdenv;
inherit (prevStage) binutils coreutils gnugrep;
cc = prevStage.gcc.cc;
isGNU = true;
shell = prevStage.bash + "/bin/sh";
};
shell = prevStage.bash + "/bin/sh";
fetchurlBoot = stdenv.fetchurlBoot;
overrides = self: super: {
inherit cc;
inherit (cc) binutils;
inherit (prevStage)
gzip bzip2 xz bash coreutils diffutils findutils gawk
gnumake gnused gnutar gnugrep gnupatch perl;
};
};
})
]