2 , localSystem, crossSystem, config, overlays, crossOverlays ? []
5 assert crossSystem == localSystem;
6 let inherit (localSystem) system;
7 fetchURL = import <nix/fetchurl.nix>;
8 trivialBuilder = (import ./trivial-builder.nix);
9 make = trivialBuilder rec {
10 inherit (localSystem) system;
13 url = "https://ftp.gnu.org/gnu/${name}/${name}-${ver}.tar.gz";
14 sha256 = "06cfqzpqsvdnsxbysl5p2fgdgxgl9y4p7scpnrfa8z2zgkjdspz0";
15 configureArgs = [ "--disable-nls"
16 "--without-libintl-prefix"
17 "--without-libiconv-prefix"
20 bash = trivialBuilder rec {
21 inherit (localSystem) system;
24 url = "https://ftp.gnu.org/gnu/${name}/${name}-${ver}.tar.gz";
25 sha256 = "08vz660768mnnax7n8d4d85jxafwdmsxsi7fh0hzvmafbvn9wkb0";
26 configureArgs = [ "--disable-nls"
27 "--without-libintl-prefix"
28 "--without-libiconv-prefix"
31 coreutils = trivialBuilder rec {
32 inherit (localSystem) system;
35 url = "https://ftp.gnu.org/gnu/${name}/${name}-${ver}.tar.xz";
36 sha256 = "1zg9m79x1i2nifj4kb0waf9x3i5h6ydkypkjnbsb9rnwis8rqypz";
37 configureArgs = [ "--disable-nls"
38 "--without-libintl-prefix"
39 "--without-libiconv-prefix"
41 "--without-libpth-prefix"
44 findutils = trivialBuilder rec {
45 inherit (localSystem) system;
48 url = "https://ftp.gnu.org/gnu/${name}/${name}-${ver}.tar.xz";
49 sha256 = "16kqz9yz98dasmj70jwf5py7jk558w96w0vgp3zf9xsqk3gzpzn5";
50 configureArgs = [ "--disable-nls"
51 "--without-libintl-prefix"
52 "--without-libiconv-prefix"
54 "--without-libpth-prefix"
57 diffutils = trivialBuilder rec {
58 inherit (localSystem) system;
61 url = "https://ftp.gnu.org/gnu/${name}/${name}-${ver}.tar.xz";
62 sha256 = "09isrg0isjinv8c535nxsi1s86wfdfzml80dbw41dj9x3hiad9xk";
63 configureArgs = [ "--disable-nls"
64 "--without-libintl-prefix"
65 "--without-libiconv-prefix"
66 "--without-libsigsegv-prefix"
69 grep = trivialBuilder rec {
70 inherit (localSystem) system;
73 url = "https://ftp.gnu.org/gnu/${name}/${name}-${ver}.tar.xz";
74 sha256 = "1yy33kiwrxrwj2nxa4fg15bvmwyghqbs8qwkdvy5phm784f7brjq";
75 configureArgs = [ "--disable-nls"
76 "--without-libintl-prefix"
77 "--without-libiconv-prefix"
78 "--disable-perl-regexp"
79 "--without-libsegsegv-prefix"
82 patch = trivialBuilder rec {
83 inherit (localSystem) system;
86 url = "https://ftp.gnu.org/gnu/${name}/${name}-${ver}.tar.xz";
87 sha256 = "1zfqy4rdcy279vwn2z1kbv19dcfw25d2aqy9nzvdkq5bjzd0nqdc";
89 gawk = trivialBuilder rec {
90 inherit (localSystem) system;
93 url = "https://ftp.gnu.org/gnu/${name}/${name}-${ver}.tar.xz";
94 sha256 = "15570p7g2x54asvr2fsc56sxzmm08fbk4mzpcs5n92fp9vq8cklf";
95 configureArgs = [ "--disable-nls"
97 "--without-libintl-prefix"
98 "--without-libiconv-prefix"
99 "--without-libsegsegv-prefix"
102 cpio = trivialBuilder rec {
103 inherit (localSystem) system;
106 url = "https://ftp.gnu.org/gnu/${name}/${name}-${ver}.tar.gz";
107 sha256 = "126vyg4a8wcdwh6npgvxy6gq433bzgz3ph37hmjpycc4r7cp0x78";
108 configureArgs = [ "--disable-nls"
109 "--without-libintl-prefix"
110 "--without-libiconv-prefix"
113 sed = trivialBuilder rec {
114 inherit (localSystem) system;
117 url = "https://ftp.gnu.org/gnu/${name}/${name}-${ver}.tar.xz";
118 sha256 = "0cznxw73fzv1n3nj2zsq6nf73rvsbxndp444xkpahdqvlzz0r6zp";
119 configureArgs = [ "--disable-nls"
120 "--without-libintl-prefix"
121 "--without-libiconv-prefix"
124 cacert = fetchURL rec {
125 url = "https://curl.haxx.se/ca/cacert-2020-01-01.pem";
126 sha256 = "07q808n307gzaga93abpf6an7c3rd35p18psdc1dd83lspgp1xxd";
129 curl = trivialBuilder rec {
130 inherit (localSystem) system;
133 url = "https://curl.haxx.se/download/${name}-${ver}.tar.xz";
134 sha256 = "0nh3j90w6b97wqcgxjfq55qhkz9s38955fbhwzv2fsi7483j895p";
135 configureArgs = [ "--disable-nls"
153 "--disable-unix-sockets"
163 "--with-ca-bundle=${cacert}"
166 bashExe = "${bash}/bin/bash";
173 bootstrapTools = derivation ({
175 inherit make bash coreutils findutils
176 diffutils grep patch gawk cpio sed
179 name = "trivial-bootstrap-tools";
181 args = [ ./trivial-bootstrap.sh ];
182 buildInputs = [ make ];
183 mkdir = "/bin/mkdir";
185 } // lib.optionalAttrs config.contentAddressedByDefault {
186 __contentAddressed = true;
187 outputHashAlgo = "sha256";
188 outputHashMode = "recursive";
192 ({ bootstrapTools, ... }: rec {
195 inherit bootstrapTools;
197 fetchurl = import ../../build-support/fetchurl {
200 curl = bootstrapTools;
203 stdenv = import ../generic {
204 name = "stdenv-freebsd-boot-1";
205 buildPlatform = localSystem;
206 hostPlatform = localSystem;
207 targetPlatform = localSystem;
209 initialPath = [ "/" "/usr" ];
210 shell = "${bootstrapTools}/bin/bash";
213 overrides = self: super: {
221 inherit (prevStage) bootstrapTools;
223 stdenv = import ../generic {
224 name = "stdenv-freebsd-boot-0";
226 initialPath = [ prevStage.bootstrapTools ];
227 inherit (prevStage.stdenv)
228 buildPlatform hostPlatform targetPlatform
230 fetchurlBoot = prevStage.fetchurl;
236 inherit config overlays;
237 stdenv = import ../generic rec {
238 name = "stdenv-freebsd-boot-3";
241 inherit (prevStage.stdenv)
242 buildPlatform hostPlatform targetPlatform
243 initialPath shell fetchurlBoot;
245 cc = lib.makeOverridable (import ../../build-support/cc-wrapper) {
248 nativePrefix = "/usr";
250 stdenvNoCC = prevStage.stdenv;
252 inherit (prevStage) stdenv;
255 name = "clang-9.9.9";
257 outPath = prevStage.bootstrapTools;
260 bintools = import ../../build-support/bintools-wrapper {
262 stdenvNoCC = prevStage.stdenv;
265 propagateDoc = false;
266 nativePrefix = "/usr";
267 bintools = { name = "${name}-binutils";
268 outPath = prevStage.bootstrapTools; };
272 preHook = "export NIX_NO_SELF_RPATH=1";