2023-04-20 05:26:33 +00:00
|
|
|
{ lib
|
2023-05-02 17:52:13 +00:00
|
|
|
, config
|
|
|
|
, buildPlatform
|
|
|
|
, hostPlatform
|
2023-05-22 11:23:55 +00:00
|
|
|
, fetchurl
|
|
|
|
, checkMeta
|
2023-04-20 05:26:33 +00:00
|
|
|
}:
|
|
|
|
|
2023-05-02 17:52:13 +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-05-22 11:23:55 +00:00
|
|
|
(extra: lib.callPackageWith ({ inherit lib config buildPlatform hostPlatform fetchurl checkMeta; } // extra))
|
2023-05-02 17:52:13 +00:00
|
|
|
(self: with self; {
|
2023-04-20 05:26:33 +00:00
|
|
|
|
2023-05-18 12:04:13 +00:00
|
|
|
bash_2_05 = callPackage ./bash/2.nix { tinycc = tinycc-mes; };
|
|
|
|
|
2023-07-23 04:51:08 +00:00
|
|
|
bash = callPackage ./bash {
|
|
|
|
bootBash = bash_2_05;
|
2023-09-25 07:12:23 +00:00
|
|
|
tinycc = tinycc-musl;
|
|
|
|
coreutils = coreutils-musl;
|
|
|
|
gnumake = gnumake-musl;
|
|
|
|
gnutar = gnutar-musl;
|
2023-07-23 04:51:08 +00:00
|
|
|
};
|
|
|
|
|
2023-06-25 05:01:04 +00:00
|
|
|
binutils = callPackage ./binutils {
|
2023-09-19 02:13:01 +00:00
|
|
|
bash = bash_2_05;
|
|
|
|
tinycc = tinycc-musl;
|
2023-09-25 10:43:29 +00:00
|
|
|
gnumake = gnumake-musl;
|
|
|
|
gnutar = gnutar-musl;
|
2023-06-25 05:01:04 +00:00
|
|
|
};
|
|
|
|
|
2023-05-22 04:58:11 +00:00
|
|
|
bzip2 = callPackage ./bzip2 {
|
|
|
|
bash = bash_2_05;
|
2023-09-27 05:55:06 +00:00
|
|
|
tinycc = tinycc-musl;
|
|
|
|
gnumake = gnumake-musl;
|
|
|
|
gnutar = gnutar-musl;
|
2023-05-22 04:58:11 +00:00
|
|
|
};
|
|
|
|
|
2023-05-17 23:20:59 +00:00
|
|
|
coreutils = callPackage ./coreutils { tinycc = tinycc-mes; };
|
2023-09-25 03:43:25 +00:00
|
|
|
coreutils-musl = callPackage ./coreutils/musl.nix {
|
|
|
|
bash = bash_2_05;
|
|
|
|
tinycc = tinycc-musl;
|
|
|
|
gnumake = gnumake-musl;
|
|
|
|
gnutar = gnutar-musl;
|
|
|
|
};
|
2023-05-17 23:20:59 +00:00
|
|
|
|
2023-07-23 06:03:43 +00:00
|
|
|
diffutils = callPackage ./diffutils {
|
|
|
|
bash = bash_2_05;
|
2023-09-19 02:34:49 +00:00
|
|
|
tinycc = tinycc-musl;
|
2023-09-25 09:11:55 +00:00
|
|
|
gnumake = gnumake-musl;
|
|
|
|
gnutar = gnutar-musl;
|
2023-07-23 06:03:43 +00:00
|
|
|
};
|
|
|
|
|
2023-07-28 09:23:05 +00:00
|
|
|
findutils = callPackage ./findutils {
|
|
|
|
bash = bash_2_05;
|
2023-09-19 05:21:16 +00:00
|
|
|
tinycc = tinycc-musl;
|
2023-09-25 09:13:26 +00:00
|
|
|
gnumake = gnumake-musl;
|
|
|
|
gnutar = gnutar-musl;
|
2023-07-28 09:23:05 +00:00
|
|
|
};
|
|
|
|
|
2023-09-12 03:21:51 +00:00
|
|
|
gawk-mes = callPackage ./gawk/mes.nix {
|
2023-05-22 03:19:00 +00:00
|
|
|
bash = bash_2_05;
|
|
|
|
tinycc = tinycc-mes;
|
2023-07-02 01:54:24 +00:00
|
|
|
gnused = gnused-mes;
|
2023-05-22 03:19:00 +00:00
|
|
|
};
|
|
|
|
|
2023-09-12 04:44:03 +00:00
|
|
|
gawk = callPackage ./gawk {
|
|
|
|
bash = bash_2_05;
|
2023-09-19 04:58:40 +00:00
|
|
|
tinycc = tinycc-musl;
|
2023-09-25 07:26:04 +00:00
|
|
|
gnumake = gnumake-musl;
|
|
|
|
gnutar = gnutar-musl;
|
2023-09-12 04:44:03 +00:00
|
|
|
bootGawk = gawk-mes;
|
|
|
|
};
|
|
|
|
|
2023-06-25 05:01:41 +00:00
|
|
|
gcc2 = callPackage ./gcc/2.nix {
|
|
|
|
bash = bash_2_05;
|
|
|
|
gcc = gcc2-mes;
|
|
|
|
glibc = glibc22;
|
|
|
|
};
|
|
|
|
gcc2-mes = callPackage ./gcc/2.nix {
|
|
|
|
bash = bash_2_05;
|
|
|
|
tinycc = tinycc-mes;
|
|
|
|
mesBootstrap = true;
|
|
|
|
};
|
|
|
|
|
2023-07-23 09:30:53 +00:00
|
|
|
gcc46 = callPackage ./gcc/4.6.nix {
|
2023-09-25 03:44:46 +00:00
|
|
|
tinycc = tinycc-musl;
|
|
|
|
gnumake = gnumake-musl;
|
|
|
|
gnutar = gnutar-musl;
|
|
|
|
# FIXME: not sure why new gawk doesn't work
|
|
|
|
gawk = gawk-mes;
|
2023-07-23 09:30:53 +00:00
|
|
|
};
|
2023-09-27 08:51:31 +00:00
|
|
|
gcc46-cxx = callPackage ./gcc/4.6.cxx.nix {
|
|
|
|
gcc = gcc46;
|
|
|
|
gnumake = gnumake-musl;
|
|
|
|
gnutar = gnutar-musl;
|
|
|
|
# FIXME: not sure why new gawk doesn't work
|
|
|
|
gawk = gawk-mes;
|
|
|
|
};
|
2023-07-23 09:30:53 +00:00
|
|
|
|
2023-10-07 15:29:44 +00:00
|
|
|
gcc8 = callPackage ./gcc/8.nix {
|
|
|
|
gcc = gcc46-cxx;
|
|
|
|
gnumake = gnumake-musl;
|
|
|
|
gnutar = gnutar-latest;
|
|
|
|
# FIXME: not sure why new gawk doesn't work
|
|
|
|
gawk = gawk-mes;
|
|
|
|
};
|
|
|
|
|
2023-06-25 05:01:57 +00:00
|
|
|
inherit (callPackage ./glibc {
|
|
|
|
bash = bash_2_05;
|
2023-07-02 01:54:24 +00:00
|
|
|
gnused = gnused-mes;
|
2023-06-25 05:01:57 +00:00
|
|
|
}) glibc22;
|
|
|
|
|
2023-05-21 23:44:19 +00:00
|
|
|
gnugrep = callPackage ./gnugrep {
|
|
|
|
bash = bash_2_05;
|
|
|
|
tinycc = tinycc-mes;
|
|
|
|
};
|
|
|
|
|
2023-05-20 02:34:43 +00:00
|
|
|
gnumake = callPackage ./gnumake { tinycc = tinycc-mes; };
|
|
|
|
|
2023-09-20 00:26:06 +00:00
|
|
|
gnumake-musl = callPackage ./gnumake/musl.nix {
|
|
|
|
bash = bash_2_05;
|
|
|
|
tinycc = tinycc-musl;
|
|
|
|
gawk = gawk-mes;
|
|
|
|
gnumakeBoot = gnumake;
|
|
|
|
};
|
|
|
|
|
2023-05-10 06:24:46 +00:00
|
|
|
gnupatch = callPackage ./gnupatch { tinycc = tinycc-mes; };
|
|
|
|
|
2023-05-20 02:34:43 +00:00
|
|
|
gnused = callPackage ./gnused {
|
2023-07-02 01:54:24 +00:00
|
|
|
bash = bash_2_05;
|
2023-09-18 05:21:18 +00:00
|
|
|
tinycc = tinycc-musl;
|
2023-07-02 01:54:24 +00:00
|
|
|
gnused = gnused-mes;
|
|
|
|
};
|
2023-09-18 05:21:18 +00:00
|
|
|
gnused-mes = callPackage ./gnused/mes.nix {
|
2023-05-20 02:34:43 +00:00
|
|
|
bash = bash_2_05;
|
|
|
|
tinycc = tinycc-mes;
|
|
|
|
};
|
2023-05-10 06:24:46 +00:00
|
|
|
|
2023-09-25 03:41:35 +00:00
|
|
|
gnutar = callPackage ./gnutar/mes.nix {
|
2023-05-22 03:41:51 +00:00
|
|
|
bash = bash_2_05;
|
|
|
|
tinycc = tinycc-mes;
|
2023-07-02 01:54:24 +00:00
|
|
|
gnused = gnused-mes;
|
2023-05-22 03:41:51 +00:00
|
|
|
};
|
|
|
|
|
2023-09-25 03:41:35 +00:00
|
|
|
gnutar-musl = callPackage ./gnutar/musl.nix {
|
|
|
|
bash = bash_2_05;
|
|
|
|
tinycc = tinycc-musl;
|
|
|
|
gnused = gnused-mes;
|
|
|
|
};
|
|
|
|
|
2023-10-07 02:12:15 +00:00
|
|
|
# FIXME: better package naming scheme
|
|
|
|
gnutar-latest = callPackage ./gnutar/latest.nix {
|
|
|
|
gcc = gcc46;
|
|
|
|
gnumake = gnumake-musl;
|
|
|
|
gnutarBoot = gnutar-musl;
|
|
|
|
};
|
|
|
|
|
2023-05-22 04:02:16 +00:00
|
|
|
gzip = callPackage ./gzip {
|
|
|
|
bash = bash_2_05;
|
|
|
|
tinycc = tinycc-mes;
|
2023-07-02 01:54:24 +00:00
|
|
|
gnused = gnused-mes;
|
2023-05-22 04:02:16 +00:00
|
|
|
};
|
|
|
|
|
2023-05-29 23:07:43 +00:00
|
|
|
heirloom = callPackage ./heirloom {
|
|
|
|
bash = bash_2_05;
|
|
|
|
tinycc = tinycc-mes;
|
|
|
|
};
|
|
|
|
|
2023-05-28 19:48:24 +00:00
|
|
|
heirloom-devtools = callPackage ./heirloom-devtools { tinycc = tinycc-mes; };
|
|
|
|
|
2023-06-25 04:59:35 +00:00
|
|
|
linux-headers = callPackage ./linux-headers { bash = bash_2_05; };
|
|
|
|
|
2023-05-10 06:24:46 +00:00
|
|
|
ln-boot = callPackage ./ln-boot { };
|
2023-04-24 01:38:32 +00:00
|
|
|
|
2023-05-22 01:34:45 +00:00
|
|
|
mes = lib.recurseIntoAttrs (callPackage ./mes { });
|
2023-05-03 04:31:40 +00:00
|
|
|
mes-libc = callPackage ./mes/libc.nix { };
|
2023-04-24 04:35:22 +00:00
|
|
|
|
2023-09-14 02:38:25 +00:00
|
|
|
musl11 = callPackage ./musl/1.1.nix {
|
|
|
|
bash = bash_2_05;
|
|
|
|
tinycc = tinycc-mes;
|
|
|
|
gnused = gnused-mes;
|
|
|
|
};
|
|
|
|
|
2023-09-13 05:40:23 +00:00
|
|
|
musl = callPackage ./musl {
|
|
|
|
gcc = gcc46;
|
2023-09-22 05:10:32 +00:00
|
|
|
gnumake = gnumake-musl;
|
2023-09-13 05:40:23 +00:00
|
|
|
};
|
|
|
|
|
2023-05-13 21:33:25 +00:00
|
|
|
stage0-posix = callPackage ./stage0-posix { };
|
|
|
|
|
|
|
|
inherit (self.stage0-posix) kaem m2libc mescc-tools mescc-tools-extra;
|
2023-05-01 02:05:30 +00:00
|
|
|
|
2023-05-22 01:34:45 +00:00
|
|
|
tinycc-bootstrappable = lib.recurseIntoAttrs (callPackage ./tinycc/bootstrappable.nix { });
|
|
|
|
tinycc-mes = lib.recurseIntoAttrs (callPackage ./tinycc/mes.nix { });
|
2023-09-18 01:59:31 +00:00
|
|
|
tinycc-musl = lib.recurseIntoAttrs (callPackage ./tinycc/musl.nix {
|
|
|
|
bash = bash_2_05;
|
|
|
|
musl = musl11;
|
|
|
|
});
|
2023-05-10 05:46:59 +00:00
|
|
|
|
2023-06-15 05:30:10 +00:00
|
|
|
xz = callPackage ./xz {
|
|
|
|
bash = bash_2_05;
|
2023-09-19 04:59:03 +00:00
|
|
|
tinycc = tinycc-musl;
|
2023-09-25 09:10:10 +00:00
|
|
|
gnumake = gnumake-musl;
|
|
|
|
gnutar = gnutar-musl;
|
2023-06-15 05:30:10 +00:00
|
|
|
};
|
|
|
|
|
2023-05-22 11:23:55 +00:00
|
|
|
inherit (callPackage ./utils.nix { }) derivationWithMeta writeTextFile writeText;
|
2023-05-10 06:23:28 +00:00
|
|
|
|
2023-05-14 18:51:46 +00:00
|
|
|
test = kaem.runCommand "minimal-bootstrap-test" {} ''
|
2023-07-23 04:51:08 +00:00
|
|
|
echo ${bash.tests.get-version}
|
2023-05-20 02:34:43 +00:00
|
|
|
echo ${bash_2_05.tests.get-version}
|
2023-06-25 05:01:04 +00:00
|
|
|
echo ${binutils.tests.get-version}
|
2023-05-22 04:58:11 +00:00
|
|
|
echo ${bzip2.tests.get-version}
|
2023-09-25 03:43:25 +00:00
|
|
|
echo ${coreutils-musl.tests.get-version}
|
2023-07-23 06:03:43 +00:00
|
|
|
echo ${diffutils.tests.get-version}
|
2023-07-28 09:23:05 +00:00
|
|
|
echo ${findutils.tests.get-version}
|
2023-09-12 03:21:51 +00:00
|
|
|
echo ${gawk-mes.tests.get-version}
|
2023-09-12 04:44:03 +00:00
|
|
|
echo ${gawk.tests.get-version}
|
2023-06-25 05:01:41 +00:00
|
|
|
echo ${gcc2.tests.get-version}
|
|
|
|
echo ${gcc2-mes.tests.get-version}
|
2023-07-23 09:30:53 +00:00
|
|
|
echo ${gcc46.tests.get-version}
|
2023-09-27 08:51:31 +00:00
|
|
|
echo ${gcc46-cxx.tests.hello-world}
|
2023-10-07 15:29:44 +00:00
|
|
|
echo ${gcc8.tests.hello-world}
|
2023-05-21 23:44:19 +00:00
|
|
|
echo ${gnugrep.tests.get-version}
|
2023-05-20 02:34:43 +00:00
|
|
|
echo ${gnused.tests.get-version}
|
2023-07-02 01:54:24 +00:00
|
|
|
echo ${gnused-mes.tests.get-version}
|
2023-05-22 03:41:51 +00:00
|
|
|
echo ${gnutar.tests.get-version}
|
2023-09-25 03:41:35 +00:00
|
|
|
echo ${gnutar-musl.tests.get-version}
|
2023-10-07 02:12:15 +00:00
|
|
|
echo ${gnutar-latest.tests.get-version}
|
2023-05-22 04:02:16 +00:00
|
|
|
echo ${gzip.tests.get-version}
|
2023-05-29 23:07:43 +00:00
|
|
|
echo ${heirloom.tests.get-version}
|
2023-05-14 23:27:15 +00:00
|
|
|
echo ${mes.compiler.tests.get-version}
|
2023-09-13 05:40:23 +00:00
|
|
|
echo ${musl.tests.hello-world}
|
2023-05-14 18:51:46 +00:00
|
|
|
echo ${tinycc-mes.compiler.tests.chain}
|
2023-09-18 01:59:31 +00:00
|
|
|
echo ${tinycc-musl.compiler.tests.hello-world}
|
2023-06-15 05:30:10 +00:00
|
|
|
echo ${xz.tests.get-version}
|
2023-05-14 18:51:46 +00:00
|
|
|
mkdir ''${out}
|
|
|
|
'';
|
2023-05-02 17:52:13 +00:00
|
|
|
})
|