2023-05-24 13:37:59 +00:00
|
|
|
{ lib
|
|
|
|
, config
|
|
|
|
, buildPlatform
|
|
|
|
, hostPlatform
|
2023-07-15 17:15:38 +00:00
|
|
|
, fetchurl
|
|
|
|
, checkMeta
|
2023-05-24 13:37:59 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
lib.makeScope
|
|
|
|
# Prevent using top-level attrs to protect against introducing dependency on
|
|
|
|
# non-bootstrap packages by mistake. Any top-level inputs must be explicitly
|
|
|
|
# declared here.
|
2023-07-15 17:15:38 +00:00
|
|
|
(extra: lib.callPackageWith ({ inherit lib config buildPlatform hostPlatform fetchurl checkMeta; } // extra))
|
2023-05-24 13:37:59 +00:00
|
|
|
(self: with self; {
|
|
|
|
|
|
|
|
bash_2_05 = callPackage ./bash/2.nix { tinycc = tinycc-mes; };
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
binutils = callPackage ./binutils {
|
|
|
|
bash = bash_2_05;
|
|
|
|
gcc = gcc2;
|
|
|
|
binutils = binutils-mes;
|
|
|
|
glibc = glibc22;
|
|
|
|
sed = heirloom.sed;
|
|
|
|
};
|
|
|
|
binutils-mes = callPackage ./binutils {
|
|
|
|
bash = bash_2_05;
|
|
|
|
tinycc = tinycc-mes;
|
|
|
|
sed = heirloom.sed;
|
|
|
|
mesBootstrap = true;
|
|
|
|
};
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
bzip2 = callPackage ./bzip2 {
|
|
|
|
bash = bash_2_05;
|
|
|
|
tinycc = tinycc-mes;
|
|
|
|
};
|
|
|
|
|
|
|
|
coreutils = callPackage ./coreutils { tinycc = tinycc-mes; };
|
|
|
|
|
|
|
|
gawk = callPackage ./gawk {
|
|
|
|
bash = bash_2_05;
|
|
|
|
tinycc = tinycc-mes;
|
|
|
|
};
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
gcc2 = callPackage ./gcc/2.nix {
|
|
|
|
bash = bash_2_05;
|
|
|
|
gcc = gcc2-mes;
|
|
|
|
binutils = binutils-mes;
|
|
|
|
glibc = glibc22;
|
|
|
|
};
|
|
|
|
gcc2-mes = callPackage ./gcc/2.nix {
|
|
|
|
bash = bash_2_05;
|
|
|
|
tinycc = tinycc-mes;
|
|
|
|
binutils = binutils-mes;
|
|
|
|
mesBootstrap = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
inherit (callPackage ./glibc {
|
|
|
|
bash = bash_2_05;
|
|
|
|
}) glibc22;
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
gnugrep = callPackage ./gnugrep {
|
|
|
|
bash = bash_2_05;
|
|
|
|
tinycc = tinycc-mes;
|
|
|
|
};
|
|
|
|
|
|
|
|
gnumake = callPackage ./gnumake { tinycc = tinycc-mes; };
|
|
|
|
|
|
|
|
gnupatch = callPackage ./gnupatch { tinycc = tinycc-mes; };
|
|
|
|
|
|
|
|
gnused = callPackage ./gnused {
|
|
|
|
bash = bash_2_05;
|
|
|
|
tinycc = tinycc-mes;
|
|
|
|
};
|
|
|
|
|
|
|
|
gnutar = callPackage ./gnutar {
|
|
|
|
bash = bash_2_05;
|
|
|
|
tinycc = tinycc-mes;
|
|
|
|
};
|
|
|
|
|
|
|
|
gzip = callPackage ./gzip {
|
|
|
|
bash = bash_2_05;
|
|
|
|
tinycc = tinycc-mes;
|
|
|
|
};
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
heirloom = callPackage ./heirloom {
|
|
|
|
bash = bash_2_05;
|
|
|
|
tinycc = tinycc-mes;
|
|
|
|
};
|
|
|
|
|
|
|
|
heirloom-devtools = callPackage ./heirloom-devtools { tinycc = tinycc-mes; };
|
|
|
|
|
|
|
|
linux-headers = callPackage ./linux-headers { bash = bash_2_05; };
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
ln-boot = callPackage ./ln-boot { };
|
|
|
|
|
|
|
|
mes = lib.recurseIntoAttrs (callPackage ./mes { });
|
|
|
|
mes-libc = callPackage ./mes/libc.nix { };
|
|
|
|
|
|
|
|
stage0-posix = callPackage ./stage0-posix { };
|
|
|
|
|
|
|
|
inherit (self.stage0-posix) kaem m2libc mescc-tools mescc-tools-extra;
|
|
|
|
|
|
|
|
tinycc-bootstrappable = lib.recurseIntoAttrs (callPackage ./tinycc/bootstrappable.nix { });
|
|
|
|
tinycc-mes = lib.recurseIntoAttrs (callPackage ./tinycc/mes.nix { });
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
xz = callPackage ./xz {
|
|
|
|
bash = bash_2_05;
|
|
|
|
tinycc = tinycc-mes;
|
|
|
|
inherit (heirloom) sed;
|
|
|
|
};
|
|
|
|
|
|
|
|
inherit (callPackage ./utils.nix { }) derivationWithMeta writeTextFile writeText;
|
2023-05-24 13:37:59 +00:00
|
|
|
|
|
|
|
test = kaem.runCommand "minimal-bootstrap-test" {} ''
|
|
|
|
echo ${bash_2_05.tests.get-version}
|
2023-07-15 17:15:38 +00:00
|
|
|
echo ${binutils.tests.get-version}
|
|
|
|
echo ${binutils-mes.tests.get-version}
|
2023-05-24 13:37:59 +00:00
|
|
|
echo ${bzip2.tests.get-version}
|
|
|
|
echo ${gawk.tests.get-version}
|
2023-07-15 17:15:38 +00:00
|
|
|
echo ${gcc2.tests.get-version}
|
|
|
|
echo ${gcc2-mes.tests.get-version}
|
2023-05-24 13:37:59 +00:00
|
|
|
echo ${gnugrep.tests.get-version}
|
|
|
|
echo ${gnused.tests.get-version}
|
|
|
|
echo ${gnutar.tests.get-version}
|
|
|
|
echo ${gzip.tests.get-version}
|
2023-07-15 17:15:38 +00:00
|
|
|
echo ${heirloom.tests.get-version}
|
2023-05-24 13:37:59 +00:00
|
|
|
echo ${mes.compiler.tests.get-version}
|
|
|
|
echo ${tinycc-mes.compiler.tests.chain}
|
2023-07-15 17:15:38 +00:00
|
|
|
echo ${xz.tests.get-version}
|
2023-05-24 13:37:59 +00:00
|
|
|
mkdir ''${out}
|
|
|
|
'';
|
|
|
|
})
|