summary refs log tree commit diff
path: root/pkgs/stdenv/nix/default.nix
blob: 9aece3ce829d7910b1bca27767bb652294803209 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
{ 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;
      };
    };
  })
]