1{
2 pkgspath ? ../../..,
3 test-pkgspath ? pkgspath,
4 localSystem ? {
5 system = builtins.currentSystem;
6 },
7 crossSystem ? null,
8 bootstrapFiles ? null,
9}:
10
11let
12 cross = if crossSystem != null then { inherit crossSystem; } else { };
13
14 custom-bootstrap =
15 if bootstrapFiles != null then
16 {
17 stdenvStages =
18 args:
19 let
20 args' = args // {
21 bootstrapFiles = bootstrapFiles;
22 };
23 in
24 (import "${pkgspath}/pkgs/stdenv/darwin" args');
25 }
26 else
27 { };
28
29 pkgs = import pkgspath ({ inherit localSystem; } // cross // custom-bootstrap);
30
31 build = pkgs.callPackage ./stdenv-bootstrap-tools.nix { };
32
33 bootstrapTools = pkgs.callPackage ./bootstrap-tools.nix {
34 inherit (build.bootstrapFiles) bootstrapTools unpack;
35 };
36
37 test = pkgs.callPackage ./test-bootstrap-tools.nix { inherit bootstrapTools; };
38
39 # The ultimate test: bootstrap a whole stdenv from the tools specified above and get a package set out of it
40 # eg: nix-build -A freshBootstrapTools.test-pkgs.stdenv
41 test-pkgs = import test-pkgspath {
42 # if the bootstrap tools are for another platform, we should be testing
43 # that platform.
44 localSystem = if crossSystem != null then crossSystem else localSystem;
45
46 stdenvStages =
47 args:
48 let
49 args' = args // {
50 inherit (build) bootstrapFiles;
51 };
52 in
53 (import (test-pkgspath + "/pkgs/stdenv/darwin") args');
54 };
55in
56{
57 inherit
58 build
59 bootstrapTools
60 test
61 test-pkgs
62 ;
63
64 inherit (build) bootstrapFiles;
65}