envision-unwrapped: 0-unstable-2024-10-20 -> 1.1.1 (#360652)
[NixPkgs.git] / pkgs / os-specific / linux / minimal-bootstrap / default.nix
blobd344b85a4d64b15a1bef061b5ae86b9fc86eaa00
1 { lib
2 , config
3 , buildPlatform
4 , hostPlatform
5 , fetchurl
6 , checkMeta
7 }:
9 lib.makeScope
10   # Prevent using top-level attrs to protect against introducing dependency on
11   # non-bootstrap packages by mistake. Any top-level inputs must be explicitly
12   # declared here.
13   (extra: lib.callPackageWith ({ inherit lib config buildPlatform hostPlatform fetchurl checkMeta; } // extra))
14   (self: with self; {
16     bash_2_05 = callPackage ./bash/2.nix { tinycc = tinycc-mes; };
18     bash = callPackage ./bash {
19       bootBash = bash_2_05;
20       tinycc = tinycc-musl;
21       coreutils = coreutils-musl;
22       gnumake = gnumake-musl;
23       gnutar = gnutar-musl;
24     };
26     binutils = callPackage ./binutils {
27       tinycc = tinycc-musl;
28       gnumake = gnumake-musl;
29       gnutar = gnutar-musl;
30     };
32     bzip2 = callPackage ./bzip2 {
33       tinycc = tinycc-musl;
34       gnumake = gnumake-musl;
35       gnutar = gnutar-musl;
36     };
38     coreutils = callPackage ./coreutils { tinycc = tinycc-mes; };
39     coreutils-musl = callPackage ./coreutils/musl.nix {
40       bash = bash_2_05;
41       tinycc = tinycc-musl;
42       gnumake = gnumake-musl;
43       gnutar = gnutar-musl;
44     };
46     diffutils = callPackage ./diffutils {
47       bash = bash_2_05;
48       tinycc = tinycc-musl;
49       gnumake = gnumake-musl;
50       gnutar = gnutar-musl;
51     };
53     findutils = callPackage ./findutils {
54       tinycc = tinycc-musl;
55       gnumake = gnumake-musl;
56       gnutar = gnutar-musl;
57     };
59     gawk-mes = callPackage ./gawk/mes.nix {
60       bash = bash_2_05;
61       tinycc = tinycc-mes;
62       gnused = gnused-mes;
63     };
65     gawk = callPackage ./gawk {
66       bash = bash_2_05;
67       tinycc = tinycc-musl;
68       gnumake = gnumake-musl;
69       gnutar = gnutar-musl;
70       bootGawk = gawk-mes;
71     };
73     gcc46 = callPackage ./gcc/4.6.nix {
74       tinycc = tinycc-musl;
75       gnumake = gnumake-musl;
76       gnutar = gnutar-musl;
77       # FIXME: not sure why new gawk doesn't work
78       gawk = gawk-mes;
79     };
80     gcc46-cxx = callPackage ./gcc/4.6.cxx.nix {
81       gcc = gcc46;
82       gnumake = gnumake-musl;
83       gnutar = gnutar-musl;
84       # FIXME: not sure why new gawk doesn't work
85       gawk = gawk-mes;
86     };
88     gcc8 = callPackage ./gcc/8.nix {
89       gcc = gcc46-cxx;
90       gnumake = gnumake-musl;
91       gnutar = gnutar-latest;
92       # FIXME: not sure why new gawk doesn't work
93       gawk = gawk-mes;
94     };
96     gcc-latest = callPackage ./gcc/latest.nix {
97       gcc = gcc8;
98       gnumake = gnumake-musl;
99       gnutar = gnutar-latest;
100       # FIXME: not sure why new gawk doesn't work
101       gawk = gawk-mes;
102     };
104     gnugrep = callPackage ./gnugrep {
105       bash = bash_2_05;
106       tinycc = tinycc-mes;
107     };
109     gnumake = callPackage ./gnumake { tinycc = tinycc-mes; };
111     gnumake-musl = callPackage ./gnumake/musl.nix {
112       bash = bash_2_05;
113       tinycc = tinycc-musl;
114       gawk = gawk-mes;
115       gnumakeBoot = gnumake;
116     };
118     gnupatch = callPackage ./gnupatch { tinycc = tinycc-mes; };
120     gnused = callPackage ./gnused {
121       bash = bash_2_05;
122       tinycc = tinycc-musl;
123       gnused = gnused-mes;
124     };
125     gnused-mes = callPackage ./gnused/mes.nix {
126       bash = bash_2_05;
127       tinycc = tinycc-mes;
128     };
130     gnutar = callPackage ./gnutar/mes.nix {
131       bash = bash_2_05;
132       tinycc = tinycc-mes;
133       gnused = gnused-mes;
134     };
136     gnutar-musl = callPackage ./gnutar/musl.nix {
137       bash = bash_2_05;
138       tinycc = tinycc-musl;
139       gnused = gnused-mes;
140     };
142     # FIXME: better package naming scheme
143     gnutar-latest = callPackage ./gnutar/latest.nix {
144       gcc = gcc46;
145       gnumake = gnumake-musl;
146       gnutarBoot = gnutar-musl;
147     };
149     gzip = callPackage ./gzip {
150       bash = bash_2_05;
151       tinycc = tinycc-mes;
152       gnused = gnused-mes;
153     };
155     heirloom = callPackage ./heirloom {
156       bash = bash_2_05;
157       tinycc = tinycc-mes;
158     };
160     heirloom-devtools = callPackage ./heirloom-devtools { tinycc = tinycc-mes; };
162     linux-headers = callPackage ./linux-headers { bash = bash_2_05; };
164     ln-boot = callPackage ./ln-boot { };
166     mes = callPackage ./mes { };
167     mes-libc = callPackage ./mes/libc.nix { };
169     musl11 = callPackage ./musl/1.1.nix {
170       bash = bash_2_05;
171       tinycc = tinycc-mes;
172       gnused = gnused-mes;
173     };
175     musl = callPackage ./musl {
176       gcc = gcc46;
177       gnumake = gnumake-musl;
178     };
180     stage0-posix = callPackage ./stage0-posix { };
182     inherit (self.stage0-posix) kaem m2libc mescc-tools mescc-tools-extra;
184     tinycc-bootstrappable = lib.recurseIntoAttrs (callPackage ./tinycc/bootstrappable.nix { });
185     tinycc-mes = lib.recurseIntoAttrs (callPackage ./tinycc/mes.nix { });
186     tinycc-musl = lib.recurseIntoAttrs (callPackage ./tinycc/musl.nix {
187       bash = bash_2_05;
188       musl = musl11;
189     });
191     xz = callPackage ./xz {
192       bash = bash_2_05;
193       tinycc = tinycc-musl;
194       gnumake = gnumake-musl;
195       gnutar = gnutar-musl;
196     };
198     inherit (callPackage ./utils.nix { }) derivationWithMeta writeTextFile writeText;
200     test = kaem.runCommand "minimal-bootstrap-test" {} ''
201       echo ${bash.tests.get-version}
202       echo ${bash_2_05.tests.get-version}
203       echo ${binutils.tests.get-version}
204       echo ${bzip2.tests.get-version}
205       echo ${coreutils-musl.tests.get-version}
206       echo ${diffutils.tests.get-version}
207       echo ${findutils.tests.get-version}
208       echo ${gawk-mes.tests.get-version}
209       echo ${gawk.tests.get-version}
210       echo ${gcc46.tests.get-version}
211       echo ${gcc46-cxx.tests.hello-world}
212       echo ${gcc8.tests.hello-world}
213       echo ${gcc-latest.tests.hello-world}
214       echo ${gnugrep.tests.get-version}
215       echo ${gnused.tests.get-version}
216       echo ${gnused-mes.tests.get-version}
217       echo ${gnutar.tests.get-version}
218       echo ${gnutar-musl.tests.get-version}
219       echo ${gnutar-latest.tests.get-version}
220       echo ${gzip.tests.get-version}
221       echo ${heirloom.tests.get-version}
222       echo ${mes.compiler.tests.get-version}
223       echo ${musl.tests.hello-world}
224       echo ${tinycc-mes.compiler.tests.chain}
225       echo ${tinycc-musl.compiler.tests.hello-world}
226       echo ${xz.tests.get-version}
227       mkdir ''${out}
228     '';
229   })