Compare commits

...

2 commits

75 changed files with 1593 additions and 1395 deletions

View file

@ -4,11 +4,7 @@
modules = import ./src;
result = lib.modules.run {
modules =
(builtins.attrValues modules)
++ [
{config.aux.system = system;}
];
modules = (builtins.attrValues modules) ++ [{config.aux.system = system;}];
};
in
result.config.exports.resolved.packages

View file

@ -3,10 +3,10 @@
"lib": {
"locked": {
"dir": "lib",
"dirtyRev": "9c29945531c58ad81f05cd1f4958c8894a733216-dirty",
"dirtyShortRev": "9c29945-dirty",
"lastModified": 1718255029,
"narHash": "sha256-iPMsyNszFA+EzjtIpjmu9EAG7zdjLbuugLtfa64dJos=",
"dirtyRev": "856b88321e5f19019332f8b60b729095c2260340-dirty",
"dirtyShortRev": "856b883-dirty",
"lastModified": 1718299377,
"narHash": "sha256-qsSV+ty3XdEOlxJr5/1ZGheyjDAIu3xWtFxVs1+rDKA=",
"type": "git",
"url": "file:../?dir=lib"
},

View file

@ -14,24 +14,18 @@
forEachSystem = lib.attrs.generate [
"i686-linux"
"x86_64-linux"
];
in {
extras = let
result = lib.modules.run {
modules =
builtins.attrValues modules;
};
result = lib.modules.run {modules = builtins.attrValues modules;};
in
result.config.exports.resolved.extras;
packages = forEachSystem (
system: let
result = lib.modules.run {
modules =
(builtins.attrValues modules)
++ [
{config.aux.system = system;}
];
modules = (builtins.attrValues modules) ++ [{config.aux.system = system;}];
};
in
result.config.exports.resolved.packages

View file

@ -2,7 +2,7 @@
lib,
config,
}: let
system = config.aux.system;
inherit (config.aux) system;
architecture =
if system == "x86_64-linux"

View file

@ -35,7 +35,10 @@ in {
platforms = lib.options.create {
type = lib.types.list.of lib.types.string;
description = "Platforms the package supports.";
default.value = ["i686-linux"];
default.value = [
"x86_64-linux"
"i686-linux"
];
};
};
@ -47,24 +50,26 @@ in {
config = {
aux.foundation.stages.stage0.kaem = {
package = lib.modules.overrides.default (builders.raw.build {
pname = "kaem";
version = "1.6.0";
package = lib.modules.overrides.default (
builders.raw.build {
pname = "kaem";
version = "1.6.0";
meta = cfg.meta;
meta = cfg.meta;
executable = kaem-unwrapped.package;
executable = kaem-unwrapped.package;
args = [
"--verbose"
"--strict"
"--file"
./build.kaem
];
args = [
"--verbose"
"--strict"
"--file"
./build.kaem
];
kaemUnwrapped = kaem-unwrapped.package;
PATH = lib.paths.bin [mescc-tools-extra.package];
});
kaemUnwrapped = kaem-unwrapped.package;
PATH = lib.paths.bin [mescc-tools-extra.package];
}
);
};
};
}

View file

@ -43,7 +43,10 @@ in {
platforms = lib.options.create {
type = lib.types.list.of lib.types.string;
description = "Platforms the package supports.";
default.value = ["i686-linux"];
default.value = [
"x86_64-linux"
"i686-linux"
];
};
};
@ -55,27 +58,29 @@ in {
config = {
aux.foundation.stages.stage0.mescc-tools-extra = {
package = lib.modules.overrides.default (builders.raw.build {
pname = "mescc-tools-tools";
version = "1.6.0";
package = lib.modules.overrides.default (
builders.raw.build {
pname = "mescc-tools-tools";
version = "1.6.0";
meta = cfg.meta;
meta = cfg.meta;
executable = kaem-unwrapped.package;
executable = kaem-unwrapped.package;
args = [
"--verbose"
"--strict"
"--file"
./build.kaem
];
args = [
"--verbose"
"--strict"
"--file"
./build.kaem
];
src = sources.mescc-tools-extra;
src = sources.mescc-tools-extra;
m2libcOS = "linux";
m2libcArch = architecture.m2libc;
mesccTools = mescc-tools.package;
});
m2libcOS = "linux";
m2libcArch = architecture.m2libc;
mesccTools = mescc-tools.package;
}
);
};
};
}

View file

@ -129,7 +129,10 @@ in {
platforms = lib.options.create {
type = lib.types.list.of lib.types.string;
description = "Platforms the package supports.";
default.value = ["i686-linux"];
default.value = [
"x86_64-linux"
"i686-linux"
];
};
};
@ -141,42 +144,44 @@ in {
config = {
aux.foundation.stages.stage0.mescc-tools = {
package = lib.modules.overrides.default (builders.raw.build {
pname = "mescc-tools";
version = "1.6.0";
package = lib.modules.overrides.default (
builders.raw.build {
pname = "mescc-tools";
version = "1.6.0";
meta = cfg.meta;
meta = cfg.meta;
executable = kaem-unwrapped.package;
executable = kaem-unwrapped.package;
args = [
"--verbose"
"--strict"
"--file"
./build.kaem
];
args = [
"--verbose"
"--strict"
"--file"
./build.kaem
];
M1 = M1.package;
M2 = M2.package;
blood-elf-0 = blood-elf.package;
hex2 = hex2.package;
M1 = M1.package;
M2 = M2.package;
blood-elf-0 = blood-elf.package;
hex2 = hex2.package;
m2libc = sources.m2libc;
m2libcArch = architecture.m2libc;
m2planet = sources.m2planet;
m2mesoplanet = sources.m2mesoplanet;
mesccTools = sources.mescc-tools;
mesccToolsExtra = sources.mescc-tools-extra;
m2libc = sources.m2libc;
m2libcArch = architecture.m2libc;
m2planet = sources.m2planet;
m2mesoplanet = sources.m2mesoplanet;
mesccTools = sources.mescc-tools;
mesccToolsExtra = sources.mescc-tools-extra;
bloodFlag = bloodFlag;
endianFlag = endianFlag;
baseAddress = baseAddress;
bloodFlag = bloodFlag;
endianFlag = endianFlag;
baseAddress = baseAddress;
mkdir = getExtraUtil "mkdir";
cp = getExtraUtil "cp";
chmod = getExtraUtil "chmod";
replace = getExtraUtil "replace";
});
mkdir = getExtraUtil "mkdir";
cp = getExtraUtil "cp";
chmod = getExtraUtil "chmod";
replace = getExtraUtil "replace";
}
);
};
};
}

View file

@ -41,7 +41,10 @@ in {
platforms = lib.options.create {
type = lib.types.list.of lib.types.string;
description = "Platforms the package supports.";
default.value = ["i686-linux"];
default.value = [
"x86_64-linux"
"i686-linux"
];
};
};
@ -66,23 +69,25 @@ in {
config = {
aux.foundation.stages.stage0.hex0 = {
package = lib.modules.overrides.default (builders.raw.build {
pname = "hex0";
version = "1.6.0";
package = lib.modules.overrides.default (
builders.raw.build {
pname = "hex0";
version = "1.6.0";
meta = cfg.meta;
meta = cfg.meta;
executable = cfg.executable;
executable = cfg.executable;
args = [
"${sources.base}/hex0_${architecture}.hex0"
(builtins.placeholder "out")
];
args = [
"${sources.base}/hex0_${architecture}.hex0"
(builtins.placeholder "out")
];
outputHashMode = "recursive";
outputHashAlgo = "sha256";
outputHash = cfg.hash;
});
outputHashMode = "recursive";
outputHashAlgo = "sha256";
outputHash = cfg.hash;
}
);
hash = lib.modules.overrides.default (
if system == "x86_64-linux"
@ -94,12 +99,14 @@ in {
else null
);
executable = lib.modules.overrides.default (import <nix/fetchurl.nix> {
name = "hex0-seed";
url = "https://github.com/oriansj/bootstrap-seeds/raw/b1263ff14a17835f4d12539226208c426ced4fba/POSIX/${architecture}/hex0-seed";
executable = true;
hash = cfg.hash;
});
executable = lib.modules.overrides.default (
import <nix/fetchurl.nix> {
name = "hex0-seed";
url = "https://github.com/oriansj/bootstrap-seeds/raw/b1263ff14a17835f4d12539226208c426ced4fba/POSIX/${architecture}/hex0-seed";
executable = true;
hash = cfg.hash;
}
);
};
};
}

View file

@ -34,7 +34,10 @@ in {
platforms = lib.options.create {
type = lib.types.list.of lib.types.string;
description = "Platforms the package supports.";
default.value = ["i686-linux"];
default.value = [
"x86_64-linux"
"i686-linux"
];
};
};
@ -46,19 +49,21 @@ in {
config = {
aux.foundation.stages.stage0.hex1 = {
package = lib.modules.overrides.default (builders.raw.build {
pname = "hex1";
version = "1.6.0";
package = lib.modules.overrides.default (
builders.raw.build {
pname = "hex1";
version = "1.6.0";
meta = cfg.meta;
meta = cfg.meta;
executable = hex0.package;
executable = hex0.package;
args = [
"${sources.base}/hex1_${architecture.base}.hex0"
(builtins.placeholder "out")
];
});
args = [
"${sources.base}/hex1_${architecture.base}.hex0"
(builtins.placeholder "out")
];
}
);
};
};
}

View file

@ -35,7 +35,10 @@ in {
platforms = lib.options.create {
type = lib.types.list.of lib.types.string;
description = "Platforms the package supports.";
default.value = ["i686-linux"];
default.value = [
"x86_64-linux"
"i686-linux"
];
};
};
@ -47,19 +50,21 @@ in {
config = {
aux.foundation.stages.stage0.hex2-0 = {
package = lib.modules.overrides.default (builders.raw.build {
pname = "hex2-0";
version = "1.6.0";
package = lib.modules.overrides.default (
builders.raw.build {
pname = "hex2-0";
version = "1.6.0";
meta = cfg.meta;
meta = cfg.meta;
executable = hex1.package;
executable = hex1.package;
args = [
"${sources.base}/hex2_${architecture.base}.hex1"
(builtins.placeholder "out")
];
});
args = [
"${sources.base}/hex2_${architecture.base}.hex1"
(builtins.placeholder "out")
];
}
);
};
};
}

View file

@ -36,7 +36,10 @@ in {
platforms = lib.options.create {
type = lib.types.list.of lib.types.string;
description = "Platforms the package supports.";
default.value = ["i686-linux"];
default.value = [
"x86_64-linux"
"i686-linux"
];
};
};
@ -48,28 +51,30 @@ in {
config = {
aux.foundation.stages.stage0.catm = {
package = lib.modules.overrides.default (builders.raw.build {
pname = "catm";
version = "1.6.0";
package = lib.modules.overrides.default (
builders.raw.build {
pname = "catm";
version = "1.6.0";
meta = cfg.meta;
meta = cfg.meta;
executable =
if architecture.base == "AArch64"
then hex1.package
else hex2-0.package;
executable =
if architecture.base == "AArch64"
then hex1.package
else hex2-0.package;
args =
if architecture.base == "AArch64"
then [
"${sources.base}/catm_${architecture.base}.hex1"
(builtins.placeholder "out")
]
else [
"${sources.base}/catm_${architecture.base}.hex2"
(builtins.placeholder "out")
];
});
args =
if architecture.base == "AArch64"
then [
"${sources.base}/catm_${architecture.base}.hex1"
(builtins.placeholder "out")
]
else [
"${sources.base}/catm_${architecture.base}.hex2"
(builtins.placeholder "out")
];
}
);
};
};
}

View file

@ -36,7 +36,10 @@ in {
platforms = lib.options.create {
type = lib.types.list.of lib.types.string;
description = "Platforms the package supports.";
default.value = ["i686-linux"];
default.value = [
"x86_64-linux"
"i686-linux"
];
};
};
@ -48,34 +51,36 @@ in {
config = {
aux.foundation.stages.stage0.M0 = {
package = lib.modules.overrides.default (builders.raw.build {
pname = "M0";
version = "1.6.0";
package = lib.modules.overrides.default (
builders.raw.build {
pname = "M0";
version = "1.6.0";
meta = cfg.meta;
meta = cfg.meta;
executable = hex2-0.package;
executable = hex2-0.package;
args = let
M0_hex2-0 = builders.raw.build {
pname = "M0_hex2-0";
version = "1.6.0";
args = let
M0_hex2-0 = builders.raw.build {
pname = "M0_hex2-0";
version = "1.6.0";
meta = cfg.meta;
meta = cfg.meta;
executable = catm.package;
executable = catm.package;
args = [
(builtins.placeholder "out")
"${sources.m2libc}/${architecture.m2libc}/ELF-${architecture.m2libc}.hex2"
"${sources.base}/M0_${architecture.base}.hex2"
];
};
in [
M0_hex2-0
(builtins.placeholder "out")
];
});
args = [
(builtins.placeholder "out")
"${sources.m2libc}/${architecture.m2libc}/ELF-${architecture.m2libc}.hex2"
"${sources.base}/M0_${architecture.base}.hex2"
];
};
in [
M0_hex2-0
(builtins.placeholder "out")
];
}
);
};
};
}

View file

@ -37,7 +37,10 @@ in {
platforms = lib.options.create {
type = lib.types.list.of lib.types.string;
description = "Platforms the package supports.";
default.value = ["i686-linux"];
default.value = [
"x86_64-linux"
"i686-linux"
];
};
};
@ -49,47 +52,49 @@ in {
config = {
aux.foundation.stages.stage0.cc_arch = {
package = lib.modules.overrides.default (builders.raw.build {
pname = "cc_arch";
version = "1.6.0";
package = lib.modules.overrides.default (
builders.raw.build {
pname = "cc_arch";
version = "1.6.0";
meta = cfg.meta;
meta = cfg.meta;
executable = hex2-0.package;
executable = hex2-0.package;
args = let
cc_arch0_hex2-0 = builders.raw.build {
pname = "cc_arch0_hex2-0";
version = "1.6.0";
args = let
cc_arch0_hex2-0 = builders.raw.build {
pname = "cc_arch0_hex2-0";
version = "1.6.0";
meta = cfg.meta;
meta = cfg.meta;
executable = M0.package;
executable = M0.package;
args = [
"${sources.base}/cc_${architecture.m2libc}.M1"
(builtins.placeholder "out")
];
};
cc_arch1_hex2-0 = builders.raw.build {
pname = "cc_arch1_hex2-0";
version = "1.6.0";
args = [
"${sources.base}/cc_${architecture.m2libc}.M1"
(builtins.placeholder "out")
];
};
cc_arch1_hex2-0 = builders.raw.build {
pname = "cc_arch1_hex2-0";
version = "1.6.0";
meta = cfg.meta;
meta = cfg.meta;
executable = catm.package;
executable = catm.package;
args = [
(builtins.placeholder "out")
"${sources.m2libc}/${architecture.m2libc}/ELF-${architecture.m2libc}.hex2"
cc_arch0_hex2-0
];
};
in [
cc_arch1_hex2-0
(builtins.placeholder "out")
];
});
args = [
(builtins.placeholder "out")
"${sources.m2libc}/${architecture.m2libc}/ELF-${architecture.m2libc}.hex2"
cc_arch0_hex2-0
];
};
in [
cc_arch1_hex2-0
(builtins.placeholder "out")
];
}
);
};
};
}

View file

@ -38,7 +38,10 @@ in {
platforms = lib.options.create {
type = lib.types.list.of lib.types.string;
description = "Platforms the package supports.";
default.value = ["i686-linux"];
default.value = [
"x86_64-linux"
"i686-linux"
];
};
};
@ -50,97 +53,99 @@ in {
config = {
aux.foundation.stages.stage0.M2 = {
package = lib.modules.overrides.default (builders.raw.build {
pname = "M2";
version = "1.6.0";
package = lib.modules.overrides.default (
builders.raw.build {
pname = "M2";
version = "1.6.0";
meta = cfg.meta;
meta = cfg.meta;
executable = hex2-0.package;
executable = hex2-0.package;
args = let
M2_c = builders.raw.build {
pname = "M2_c";
version = "1.6.0";
args = let
M2_c = builders.raw.build {
pname = "M2_c";
version = "1.6.0";
meta = cfg.meta;
meta = cfg.meta;
executable = catm.package;
executable = catm.package;
args = [
(builtins.placeholder "out")
"${sources.m2libc}/${architecture.m2libc}/linux/bootstrap.c"
"${sources.m2planet}/cc.h"
"${sources.m2libc}/bootstrappable.c"
"${sources.m2planet}/cc_globals.c"
"${sources.m2planet}/cc_reader.c"
"${sources.m2planet}/cc_strings.c"
"${sources.m2planet}/cc_types.c"
"${sources.m2planet}/cc_core.c"
"${sources.m2planet}/cc_macro.c"
"${sources.m2planet}/cc.c"
];
};
M2_M1 = builders.raw.build {
pname = "M2_M1";
version = "1.6.0";
args = [
(builtins.placeholder "out")
"${sources.m2libc}/${architecture.m2libc}/linux/bootstrap.c"
"${sources.m2planet}/cc.h"
"${sources.m2libc}/bootstrappable.c"
"${sources.m2planet}/cc_globals.c"
"${sources.m2planet}/cc_reader.c"
"${sources.m2planet}/cc_strings.c"
"${sources.m2planet}/cc_types.c"
"${sources.m2planet}/cc_core.c"
"${sources.m2planet}/cc_macro.c"
"${sources.m2planet}/cc.c"
];
};
M2_M1 = builders.raw.build {
pname = "M2_M1";
version = "1.6.0";
meta = cfg.meta;
meta = cfg.meta;
executable = cc_arch.package;
executable = cc_arch.package;
args = [
M2_c
(builtins.placeholder "out")
];
};
M2_M1' = builders.raw.build {
pname = "M2_M1";
version = "1.6.0";
args = [
M2_c
(builtins.placeholder "out")
];
};
M2_M1' = builders.raw.build {
pname = "M2_M1";
version = "1.6.0";
meta = cfg.meta;
meta = cfg.meta;
executable = catm.package;
executable = catm.package;
args = [
(builtins.placeholder "out")
"${sources.m2libc}/${architecture.m2libc}/${architecture.m2libc}_defs.M1"
"${sources.m2libc}/${architecture.m2libc}/libc-core.M1"
M2_M1
];
};
M2_hex2-0 = builders.raw.build {
pname = "M2_hex2-0";
version = "1.6.0";
args = [
(builtins.placeholder "out")
"${sources.m2libc}/${architecture.m2libc}/${architecture.m2libc}_defs.M1"
"${sources.m2libc}/${architecture.m2libc}/libc-core.M1"
M2_M1
];
};
M2_hex2-0 = builders.raw.build {
pname = "M2_hex2-0";
version = "1.6.0";
meta = cfg.meta;
meta = cfg.meta;
executable = M0.package;
executable = M0.package;
args = [
M2_M1'
(builtins.placeholder "out")
];
};
M2_hex2-0' = builders.raw.build {
pname = "M2_hex2-0";
version = "1.6.0";
args = [
M2_M1'
(builtins.placeholder "out")
];
};
M2_hex2-0' = builders.raw.build {
pname = "M2_hex2-0";
version = "1.6.0";
meta = cfg.meta;
meta = cfg.meta;
executable = catm.package;
executable = catm.package;
args = [
(builtins.placeholder "out")
"${sources.m2libc}/${architecture.m2libc}/ELF-${architecture.m2libc}.hex2"
M2_hex2-0
];
};
in [
M2_hex2-0'
(builtins.placeholder "out")
];
});
args = [
(builtins.placeholder "out")
"${sources.m2libc}/${architecture.m2libc}/ELF-${architecture.m2libc}.hex2"
M2_hex2-0
];
};
in [
M2_hex2-0'
(builtins.placeholder "out")
];
}
);
};
};
}

View file

@ -39,7 +39,10 @@ in {
platforms = lib.options.create {
type = lib.types.list.of lib.types.string;
description = "Platforms the package supports.";
default.value = ["i686-linux"];
default.value = [
"x86_64-linux"
"i686-linux"
];
};
};
@ -51,86 +54,88 @@ in {
config = {
aux.foundation.stages.stage0.blood-elf = {
package = lib.modules.overrides.default (builders.raw.build {
pname = "blood-elf";
version = "1.6.0";
package = lib.modules.overrides.default (
builders.raw.build {
pname = "blood-elf";
version = "1.6.0";
meta = cfg.meta;
meta = cfg.meta;
executable = hex2-0.package;
executable = hex2-0.package;
args = let
blood-elf_M1 = builders.raw.build {
pname = "blood-elf_M1";
version = "1.6.0";
args = let
blood-elf_M1 = builders.raw.build {
pname = "blood-elf_M1";
version = "1.6.0";
meta = cfg.meta;
meta = cfg.meta;
executable = M2.package;
executable = M2.package;
args = [
"--architecture"
architecture.m2libc
"-f"
"${sources.m2libc}/${architecture.m2libc}/linux/bootstrap.c"
"-f"
"${sources.m2libc}/bootstrappable.c"
"-f"
"${sources.mescc-tools}/stringify.c"
"-f"
"${sources.mescc-tools}/blood-elf.c"
"--bootstrap-mode"
"-o"
(builtins.placeholder "out")
];
};
blood-elf_M1' = builders.raw.build {
pname = "blood-elf_M1-1";
version = "1.6.0";
args = [
"--architecture"
architecture.m2libc
"-f"
"${sources.m2libc}/${architecture.m2libc}/linux/bootstrap.c"
"-f"
"${sources.m2libc}/bootstrappable.c"
"-f"
"${sources.mescc-tools}/stringify.c"
"-f"
"${sources.mescc-tools}/blood-elf.c"
"--bootstrap-mode"
"-o"
(builtins.placeholder "out")
];
};
blood-elf_M1' = builders.raw.build {
pname = "blood-elf_M1-1";
version = "1.6.0";
meta = cfg.meta;
meta = cfg.meta;
executable = catm.package;
executable = catm.package;
args = [
(builtins.placeholder "out")
"${sources.m2libc}/${architecture.m2libc}/${architecture.m2libc}_defs.M1"
"${sources.m2libc}/${architecture.m2libc}/libc-core.M1"
blood-elf_M1
];
};
blood-elf_hex2-0 = builders.raw.build {
pname = "blood-elf_hex2-0";
version = "1.6.0";
args = [
(builtins.placeholder "out")
"${sources.m2libc}/${architecture.m2libc}/${architecture.m2libc}_defs.M1"
"${sources.m2libc}/${architecture.m2libc}/libc-core.M1"
blood-elf_M1
];
};
blood-elf_hex2-0 = builders.raw.build {
pname = "blood-elf_hex2-0";
version = "1.6.0";
meta = cfg.meta;
meta = cfg.meta;
executable = M0.package;
executable = M0.package;
args = [
blood-elf_M1'
(builtins.placeholder "out")
];
};
blood-elf_hex2-0' = builders.raw.build {
pname = "blood-elf_hex2-0-1";
version = "1.6.0";
args = [
blood-elf_M1'
(builtins.placeholder "out")
];
};
blood-elf_hex2-0' = builders.raw.build {
pname = "blood-elf_hex2-0-1";
version = "1.6.0";
meta = cfg.meta;
meta = cfg.meta;
executable = catm.package;
executable = catm.package;
args = [
(builtins.placeholder "out")
"${sources.m2libc}/${architecture.m2libc}/ELF-${architecture.m2libc}.hex2"
blood-elf_hex2-0
];
};
in [
blood-elf_hex2-0'
(builtins.placeholder "out")
];
});
args = [
(builtins.placeholder "out")
"${sources.m2libc}/${architecture.m2libc}/ELF-${architecture.m2libc}.hex2"
blood-elf_hex2-0
];
};
in [
blood-elf_hex2-0'
(builtins.placeholder "out")
];
}
);
};
};
}

View file

@ -40,7 +40,10 @@ in {
platforms = lib.options.create {
type = lib.types.list.of lib.types.string;
description = "Platforms the package supports.";
default.value = ["i686-linux"];
default.value = [
"x86_64-linux"
"i686-linux"
];
};
};
@ -52,110 +55,112 @@ in {
config = {
aux.foundation.stages.stage0.M1-0 = {
package = lib.modules.overrides.default (builders.raw.build {
pname = "M1-0";
version = "1.6.0";
package = lib.modules.overrides.default (
builders.raw.build {
pname = "M1-0";
version = "1.6.0";
meta = cfg.meta;
meta = cfg.meta;
executable = hex2-0.package;
executable = hex2-0.package;
args = let
M1-macro-0_M1 = builders.raw.build {
pname = "M1-macro-0_M1";
version = "1.6.0";
args = let
M1-macro-0_M1 = builders.raw.build {
pname = "M1-macro-0_M1";
version = "1.6.0";
meta = cfg.meta;
meta = cfg.meta;
executable = M2.package;
executable = M2.package;
args = [
"--architecture"
architecture.m2libc
"-f"
"${sources.m2libc}/${architecture.m2libc}/linux/bootstrap.c"
"-f"
"${sources.m2libc}/bootstrappable.c"
"-f"
"${sources.mescc-tools}/stringify.c"
"-f"
"${sources.mescc-tools}/M1-macro.c"
"--bootstrap-mode"
"--debug"
"-o"
(builtins.placeholder "out")
];
};
M1-macro-0-footer_M1 = builders.raw.build {
pname = "M1-macro-0-footer_M1";
version = "1.6.0";
meta = cfg.meta;
executable = blood-elf.package;
args =
(lib.lists.when (config.aux.platform.bits == 64) "--64")
++ [
args = [
"--architecture"
architecture.m2libc
"-f"
M1-macro-0_M1
(
if config.aux.platform.endian == "little"
then "--little-endian"
else "--big-endian"
)
"${sources.m2libc}/${architecture.m2libc}/linux/bootstrap.c"
"-f"
"${sources.m2libc}/bootstrappable.c"
"-f"
"${sources.mescc-tools}/stringify.c"
"-f"
"${sources.mescc-tools}/M1-macro.c"
"--bootstrap-mode"
"--debug"
"-o"
(builtins.placeholder "out")
];
};
M1-macro-0_M1' = builders.raw.build {
pname = "M1-macro-0_M1-1";
version = "1.6.0";
};
M1-macro-0-footer_M1 = builders.raw.build {
pname = "M1-macro-0-footer_M1";
version = "1.6.0";
meta = cfg.meta;
meta = cfg.meta;
executable = catm.package;
executable = blood-elf.package;
args = [
(builtins.placeholder "out")
"${sources.m2libc}/${architecture.m2libc}/${architecture.m2libc}_defs.M1"
"${sources.m2libc}/${architecture.m2libc}/libc-core.M1"
M1-macro-0_M1
M1-macro-0-footer_M1
];
};
M1-macro-0_hex2-0 = builders.raw.build {
pname = "M1-macro-0_hex2-0";
version = "1.6.0";
args =
(lib.lists.when (config.aux.platform.bits == 64) "--64")
++ [
"-f"
M1-macro-0_M1
(
if config.aux.platform.endian == "little"
then "--little-endian"
else "--big-endian"
)
"-o"
(builtins.placeholder "out")
];
};
M1-macro-0_M1' = builders.raw.build {
pname = "M1-macro-0_M1-1";
version = "1.6.0";
meta = cfg.meta;
meta = cfg.meta;
executable = M0.package;
executable = catm.package;
args = [
M1-macro-0_M1'
(builtins.placeholder "out")
];
};
M1-macro-0_hex2-0' = builders.raw.build {
pname = "M1-macro-0_hex2-0-1";
version = "1.6.0";
args = [
(builtins.placeholder "out")
"${sources.m2libc}/${architecture.m2libc}/${architecture.m2libc}_defs.M1"
"${sources.m2libc}/${architecture.m2libc}/libc-core.M1"
M1-macro-0_M1
M1-macro-0-footer_M1
];
};
M1-macro-0_hex2-0 = builders.raw.build {
pname = "M1-macro-0_hex2-0";
version = "1.6.0";
meta = cfg.meta;
meta = cfg.meta;
executable = catm.package;
executable = M0.package;
args = [
(builtins.placeholder "out")
"${sources.m2libc}/${architecture.m2libc}/ELF-${architecture.m2libc}-debug.hex2"
M1-macro-0_hex2-0
];
};
in [
M1-macro-0_hex2-0'
(builtins.placeholder "out")
];
});
args = [
M1-macro-0_M1'
(builtins.placeholder "out")
];
};
M1-macro-0_hex2-0' = builders.raw.build {
pname = "M1-macro-0_hex2-0-1";
version = "1.6.0";
meta = cfg.meta;
executable = catm.package;
args = [
(builtins.placeholder "out")
"${sources.m2libc}/${architecture.m2libc}/ELF-${architecture.m2libc}-debug.hex2"
M1-macro-0_hex2-0
];
};
in [
M1-macro-0_hex2-0'
(builtins.placeholder "out")
];
}
);
};
};
}

View file

@ -41,7 +41,10 @@ in {
platforms = lib.options.create {
type = lib.types.list.of lib.types.string;
description = "Platforms the package supports.";
default.value = ["i686-linux"];
default.value = [
"x86_64-linux"
"i686-linux"
];
};
};
@ -53,128 +56,130 @@ in {
config = {
aux.foundation.stages.stage0.hex2-1 = {
package = lib.modules.overrides.default (builders.raw.build {
pname = "hex2-1";
version = "1.6.0";
package = lib.modules.overrides.default (
builders.raw.build {
pname = "hex2-1";
version = "1.6.0";
meta = cfg.meta;
meta = cfg.meta;
executable = hex2-0.package;
executable = hex2-0.package;
args = let
hex2_linker_M1 = builders.raw.build {
pname = "hex2_linker_M1";
version = "1.6.0";
args = let
hex2_linker_M1 = builders.raw.build {
pname = "hex2_linker_M1";
version = "1.6.0";
meta = cfg.meta;
meta = cfg.meta;
executable = M2.package;
executable = M2.package;
args = [
"--architecture"
architecture.m2libc
"-f"
"${sources.m2libc}/sys/types.h"
"-f"
"${sources.m2libc}/stddef.h"
"-f"
"${sources.m2libc}/${architecture.m2libc}/linux/unistd.c"
"-f"
"${sources.m2libc}/${architecture.m2libc}/linux/fcntl.c"
"-f"
"${sources.m2libc}/fcntl.c"
"-f"
"${sources.m2libc}/${architecture.m2libc}/linux/sys/stat.c"
"-f"
"${sources.m2libc}/stdlib.c"
"-f"
"${sources.m2libc}/stdio.h"
"-f"
"${sources.m2libc}/stdio.c"
"-f"
"${sources.m2libc}/bootstrappable.c"
"-f"
"${sources.mescc-tools}/hex2.h"
"-f"
"${sources.mescc-tools}/hex2_linker.c"
"-f"
"${sources.mescc-tools}/hex2_word.c"
"-f"
"${sources.mescc-tools}/hex2.c"
"--debug"
"-o"
(builtins.placeholder "out")
];
};
hex2_linker-footer_M1 = builders.raw.build {
pname = "hex2_linker-footer_M1";
version = "1.6.0";
meta = cfg.meta;
executable = blood-elf.package;
args =
(lib.lists.when (config.aux.platform.bits == 64) "--64")
++ [
args = [
"--architecture"
architecture.m2libc
"-f"
hex2_linker_M1
"${sources.m2libc}/sys/types.h"
"-f"
"${sources.m2libc}/stddef.h"
"-f"
"${sources.m2libc}/${architecture.m2libc}/linux/unistd.c"
"-f"
"${sources.m2libc}/${architecture.m2libc}/linux/fcntl.c"
"-f"
"${sources.m2libc}/fcntl.c"
"-f"
"${sources.m2libc}/${architecture.m2libc}/linux/sys/stat.c"
"-f"
"${sources.m2libc}/stdlib.c"
"-f"
"${sources.m2libc}/stdio.h"
"-f"
"${sources.m2libc}/stdio.c"
"-f"
"${sources.m2libc}/bootstrappable.c"
"-f"
"${sources.mescc-tools}/hex2.h"
"-f"
"${sources.mescc-tools}/hex2_linker.c"
"-f"
"${sources.mescc-tools}/hex2_word.c"
"-f"
"${sources.mescc-tools}/hex2.c"
"--debug"
"-o"
(builtins.placeholder "out")
];
};
hex2_linker-footer_M1 = builders.raw.build {
pname = "hex2_linker-footer_M1";
version = "1.6.0";
meta = cfg.meta;
executable = blood-elf.package;
args =
(lib.lists.when (config.aux.platform.bits == 64) "--64")
++ [
"-f"
hex2_linker_M1
(
if config.aux.platform.endian == "little"
then "--little-endian"
else "--big-endian"
)
"-o"
(builtins.placeholder "out")
];
};
hex2_linker_hex2 = builders.raw.build {
pname = "hex2_linker_hex2";
version = "1.6.0";
meta = cfg.meta;
executable = M1-0.package;
args = [
"--architecture"
architecture.m2libc
(
if config.aux.platform.endian == "little"
then "--little-endian"
else "--big-endian"
)
"-f"
"${sources.m2libc}/${architecture.m2libc}/${architecture.m2libc}_defs.M1"
"-f"
"${sources.m2libc}/${architecture.m2libc}/libc-full.M1"
"-f"
hex2_linker_M1
"-f"
hex2_linker-footer_M1
"-o"
(builtins.placeholder "out")
];
};
hex2_linker_hex2 = builders.raw.build {
pname = "hex2_linker_hex2";
version = "1.6.0";
};
hex2_linker_hex2' = builders.raw.build {
pname = "hex2_linker_hex2-1";
version = "1.6.0";
meta = cfg.meta;
meta = cfg.meta;
executable = M1-0.package;
executable = catm.package;
args = [
"--architecture"
architecture.m2libc
(
if config.aux.platform.endian == "little"
then "--little-endian"
else "--big-endian"
)
"-f"
"${sources.m2libc}/${architecture.m2libc}/${architecture.m2libc}_defs.M1"
"-f"
"${sources.m2libc}/${architecture.m2libc}/libc-full.M1"
"-f"
hex2_linker_M1
"-f"
hex2_linker-footer_M1
"-o"
(builtins.placeholder "out")
];
};
hex2_linker_hex2' = builders.raw.build {
pname = "hex2_linker_hex2-1";
version = "1.6.0";
meta = cfg.meta;
executable = catm.package;
args = [
(builtins.placeholder "out")
"${sources.m2libc}/${architecture.m2libc}/ELF-${architecture.m2libc}-debug.hex2"
hex2_linker_hex2
];
};
in [
hex2_linker_hex2'
(builtins.placeholder "out")
];
});
args = [
(builtins.placeholder "out")
"${sources.m2libc}/${architecture.m2libc}/ELF-${architecture.m2libc}-debug.hex2"
hex2_linker_hex2
];
};
in [
hex2_linker_hex2'
(builtins.placeholder "out")
];
}
);
};
};
}

View file

@ -42,7 +42,10 @@ in {
platforms = lib.options.create {
type = lib.types.list.of lib.types.string;
description = "Platforms the package supports.";
default.value = ["i686-linux"];
default.value = [
"x86_64-linux"
"i686-linux"
];
};
};
@ -54,133 +57,135 @@ in {
config = {
aux.foundation.stages.stage0.M1 = {
package = lib.modules.overrides.default (builders.raw.build {
pname = "M1";
version = "1.6.0";
package = lib.modules.overrides.default (
builders.raw.build {
pname = "M1";
version = "1.6.0";
meta = cfg.meta;
meta = cfg.meta;
executable = hex2-1.package;
executable = hex2-1.package;
args = let
M1-macro_M1 = builders.raw.build {
pname = "M1-macro_M1";
version = "1.6.0";
args = let
M1-macro_M1 = builders.raw.build {
pname = "M1-macro_M1";
version = "1.6.0";
meta = cfg.meta;
meta = cfg.meta;
executable = M2.package;
executable = M2.package;
args = [
"--architecture"
architecture.m2libc
"-f"
"${sources.m2libc}/sys/types.h"
"-f"
"${sources.m2libc}/stddef.h"
"-f"
"${sources.m2libc}/${architecture.m2libc}/linux/unistd.c"
"-f"
"${sources.m2libc}/${architecture.m2libc}/linux/fcntl.c"
"-f"
"${sources.m2libc}/fcntl.c"
"-f"
"${sources.m2libc}/${architecture.m2libc}/linux/sys/stat.c"
"-f"
"${sources.m2libc}/string.c"
"-f"
"${sources.m2libc}/stdlib.c"
"-f"
"${sources.m2libc}/stdio.h"
"-f"
"${sources.m2libc}/stdio.c"
"-f"
"${sources.m2libc}/bootstrappable.c"
"-f"
"${sources.mescc-tools}/stringify.c"
"-f"
"${sources.mescc-tools}/M1-macro.c"
"--debug"
"-o"
(builtins.placeholder "out")
];
};
M1-macro-footer_M1 = builders.raw.build {
pname = "M1-macro-footer_M1";
version = "1.6.0";
meta = cfg.meta;
executable = blood-elf.package;
args =
(lib.lists.when (config.aux.platform.bits == 64) "--64")
++ [
args = [
"--architecture"
architecture.m2libc
"-f"
M1-macro_M1
"${sources.m2libc}/sys/types.h"
"-f"
"${sources.m2libc}/stddef.h"
"-f"
"${sources.m2libc}/${architecture.m2libc}/linux/unistd.c"
"-f"
"${sources.m2libc}/${architecture.m2libc}/linux/fcntl.c"
"-f"
"${sources.m2libc}/fcntl.c"
"-f"
"${sources.m2libc}/${architecture.m2libc}/linux/sys/stat.c"
"-f"
"${sources.m2libc}/string.c"
"-f"
"${sources.m2libc}/stdlib.c"
"-f"
"${sources.m2libc}/stdio.h"
"-f"
"${sources.m2libc}/stdio.c"
"-f"
"${sources.m2libc}/bootstrappable.c"
"-f"
"${sources.mescc-tools}/stringify.c"
"-f"
"${sources.mescc-tools}/M1-macro.c"
"--debug"
"-o"
(builtins.placeholder "out")
];
};
M1-macro-footer_M1 = builders.raw.build {
pname = "M1-macro-footer_M1";
version = "1.6.0";
meta = cfg.meta;
executable = blood-elf.package;
args =
(lib.lists.when (config.aux.platform.bits == 64) "--64")
++ [
"-f"
M1-macro_M1
(
if config.aux.platform.endian == "little"
then "--little-endian"
else "--big-endian"
)
"-o"
(builtins.placeholder "out")
];
};
M1-macro_hex2 = builders.raw.build {
pname = "M1-macro_hex2";
version = "1.6.0";
meta = cfg.meta;
executable = M1-0.package;
args = [
"--architecture"
architecture.m2libc
(
if config.aux.platform.endian == "little"
then "--little-endian"
else "--big-endian"
)
"-f"
"${sources.m2libc}/${architecture.m2libc}/${architecture.m2libc}_defs.M1"
"-f"
"${sources.m2libc}/${architecture.m2libc}/libc-full.M1"
"-f"
M1-macro_M1
"-f"
M1-macro-footer_M1
"-o"
(builtins.placeholder "out")
];
};
M1-macro_hex2 = builders.raw.build {
pname = "M1-macro_hex2";
version = "1.6.0";
meta = cfg.meta;
executable = M1-0.package;
args = [
"--architecture"
architecture.m2libc
(
if config.aux.platform.endian == "little"
then "--little-endian"
else "--big-endian"
)
"-f"
"${sources.m2libc}/${architecture.m2libc}/${architecture.m2libc}_defs.M1"
"-f"
"${sources.m2libc}/${architecture.m2libc}/libc-full.M1"
"-f"
M1-macro_M1
"-f"
M1-macro-footer_M1
"-o"
(builtins.placeholder "out")
];
};
in [
"--architecture"
architecture.m2libc
(
if config.aux.platform.endian == "little"
then "--little-endian"
else "--big-endian"
)
"--base-address"
(
if config.aux.system == "x86_64-linux"
then "0x00600000"
else if config.aux.system == "aarch64-linux"
then "0x00600000"
else if config.aux.system == "i686-linux"
then "0x08048000"
else builtins.throw "Unsupported system: ${config.aux.system}"
)
"-f"
"${sources.m2libc}/${architecture.m2libc}/ELF-${architecture.m2libc}-debug.hex2"
"-f"
M1-macro_hex2
"-o"
(builtins.placeholder "out")
];
});
};
in [
"--architecture"
architecture.m2libc
(
if config.aux.platform.endian == "little"
then "--little-endian"
else "--big-endian"
)
"--base-address"
(
if config.aux.system == "x86_64-linux"
then "0x00600000"
else if config.aux.system == "aarch64-linux"
then "0x00600000"
else if config.aux.system == "i686-linux"
then "0x08048000"
else builtins.throw "Unsupported system: ${config.aux.system}"
)
"-f"
"${sources.m2libc}/${architecture.m2libc}/ELF-${architecture.m2libc}-debug.hex2"
"-f"
M1-macro_hex2
"-o"
(builtins.placeholder "out")
];
}
);
};
};
}

View file

@ -41,7 +41,10 @@ in {
platforms = lib.options.create {
type = lib.types.list.of lib.types.string;
description = "Platforms the package supports.";
default.value = ["i686-linux"];
default.value = [
"x86_64-linux"
"i686-linux"
];
};
};
@ -53,135 +56,137 @@ in {
config = {
aux.foundation.stages.stage0.hex2 = {
package = lib.modules.overrides.default (builders.raw.build {
pname = "hex2";
version = "1.6.0";
package = lib.modules.overrides.default (
builders.raw.build {
pname = "hex2";
version = "1.6.0";
meta = cfg.meta;
meta = cfg.meta;
executable = hex2-1.package;
executable = hex2-1.package;
args = let
hex2_linker_M1 = builders.raw.build {
pname = "hex2_linker_M1";
version = "1.6.0";
args = let
hex2_linker_M1 = builders.raw.build {
pname = "hex2_linker_M1";
version = "1.6.0";
meta = cfg.meta;
meta = cfg.meta;
executable = M2.package;
executable = M2.package;
args = [
"--architecture"
architecture.m2libc
"-f"
"${sources.m2libc}/sys/types.h"
"-f"
"${sources.m2libc}/stddef.h"
"-f"
"${sources.m2libc}/${architecture.m2libc}/linux/unistd.c"
"-f"
"${sources.m2libc}/${architecture.m2libc}/linux/fcntl.c"
"-f"
"${sources.m2libc}/fcntl.c"
"-f"
"${sources.m2libc}/${architecture.m2libc}/linux/sys/stat.c"
"-f"
"${sources.m2libc}/stdlib.c"
"-f"
"${sources.m2libc}/stdio.h"
"-f"
"${sources.m2libc}/stdio.c"
"-f"
"${sources.m2libc}/bootstrappable.c"
"-f"
"${sources.mescc-tools}/hex2.h"
"-f"
"${sources.mescc-tools}/hex2_linker.c"
"-f"
"${sources.mescc-tools}/hex2_word.c"
"-f"
"${sources.mescc-tools}/hex2.c"
"--debug"
"-o"
(builtins.placeholder "out")
];
};
hex2_linker-footer_M1 = builders.raw.build {
pname = "hex2_linker-footer_M1";
version = "1.6.0";
meta = cfg.meta;
executable = blood-elf.package;
args =
(lib.lists.when (config.aux.platform.bits == 64) "--64")
++ [
args = [
"--architecture"
architecture.m2libc
"-f"
hex2_linker_M1
"${sources.m2libc}/sys/types.h"
"-f"
"${sources.m2libc}/stddef.h"
"-f"
"${sources.m2libc}/${architecture.m2libc}/linux/unistd.c"
"-f"
"${sources.m2libc}/${architecture.m2libc}/linux/fcntl.c"
"-f"
"${sources.m2libc}/fcntl.c"
"-f"
"${sources.m2libc}/${architecture.m2libc}/linux/sys/stat.c"
"-f"
"${sources.m2libc}/stdlib.c"
"-f"
"${sources.m2libc}/stdio.h"
"-f"
"${sources.m2libc}/stdio.c"
"-f"
"${sources.m2libc}/bootstrappable.c"
"-f"
"${sources.mescc-tools}/hex2.h"
"-f"
"${sources.mescc-tools}/hex2_linker.c"
"-f"
"${sources.mescc-tools}/hex2_word.c"
"-f"
"${sources.mescc-tools}/hex2.c"
"--debug"
"-o"
(builtins.placeholder "out")
];
};
hex2_linker-footer_M1 = builders.raw.build {
pname = "hex2_linker-footer_M1";
version = "1.6.0";
meta = cfg.meta;
executable = blood-elf.package;
args =
(lib.lists.when (config.aux.platform.bits == 64) "--64")
++ [
"-f"
hex2_linker_M1
(
if config.aux.platform.endian == "little"
then "--little-endian"
else "--big-endian"
)
"-o"
(builtins.placeholder "out")
];
};
hex2_linker_hex2 = builders.raw.build {
pname = "hex2_linker_hex2";
version = "1.6.0";
meta = cfg.meta;
executable = M1.package;
args = [
"--architecture"
architecture.m2libc
(
if config.aux.platform.endian == "little"
then "--little-endian"
else "--big-endian"
)
"-f"
"${sources.m2libc}/${architecture.m2libc}/${architecture.m2libc}_defs.M1"
"-f"
"${sources.m2libc}/${architecture.m2libc}/libc-full.M1"
"-f"
hex2_linker_M1
"-f"
hex2_linker-footer_M1
"-o"
(builtins.placeholder "out")
];
};
hex2_linker_hex2 = builders.raw.build {
pname = "hex2_linker_hex2";
version = "1.6.0";
meta = cfg.meta;
executable = M1.package;
args = [
"--architecture"
architecture.m2libc
(
if config.aux.platform.endian == "little"
then "--little-endian"
else "--big-endian"
)
"-f"
"${sources.m2libc}/${architecture.m2libc}/${architecture.m2libc}_defs.M1"
"-f"
"${sources.m2libc}/${architecture.m2libc}/libc-full.M1"
"-f"
hex2_linker_M1
"-f"
hex2_linker-footer_M1
"-o"
(builtins.placeholder "out")
];
};
in [
"--architecture"
architecture.m2libc
(
if config.aux.platform.endian == "little"
then "--little-endian"
else "--big-endian"
)
"--base-address"
(
if config.aux.system == "x86_64-linux"
then "0x00600000"
else if config.aux.system == "aarch64-linux"
then "0x00600000"
else if config.aux.system == "i686-linux"
then "0x08048000"
else builtins.throw "Unsupported system: ${config.aux.system}"
)
"-f"
"${sources.m2libc}/${architecture.m2libc}/ELF-${architecture.m2libc}-debug.hex2"
"-f"
hex2_linker_hex2
"-o"
(builtins.placeholder "out")
];
});
};
in [
"--architecture"
architecture.m2libc
(
if config.aux.platform.endian == "little"
then "--little-endian"
else "--big-endian"
)
"--base-address"
(
if config.aux.system == "x86_64-linux"
then "0x00600000"
else if config.aux.system == "aarch64-linux"
then "0x00600000"
else if config.aux.system == "i686-linux"
then "0x08048000"
else builtins.throw "Unsupported system: ${config.aux.system}"
)
"-f"
"${sources.m2libc}/${architecture.m2libc}/ELF-${architecture.m2libc}-debug.hex2"
"-f"
hex2_linker_hex2
"-o"
(builtins.placeholder "out")
];
}
);
};
};
}

View file

@ -41,7 +41,10 @@ in {
platforms = lib.options.create {
type = lib.types.list.of lib.types.string;
description = "Platforms the package supports.";
default.value = ["i686-linux"];
default.value = [
"x86_64-linux"
"i686-linux"
];
};
};
@ -53,137 +56,139 @@ in {
config = {
aux.foundation.stages.stage0.kaem-unwrapped = {
package = lib.modules.overrides.default (builders.raw.build {
pname = "kaem-unwrapped";
version = "1.6.0";
package = lib.modules.overrides.default (
builders.raw.build {
pname = "kaem-unwrapped";
version = "1.6.0";
meta = cfg.meta;
meta = cfg.meta;
executable = hex2.package;
executable = hex2.package;
args = let
kaem_M1 = builders.raw.build {
pname = "kaem_M1";
version = "1.6.0";
args = let
kaem_M1 = builders.raw.build {
pname = "kaem_M1";
version = "1.6.0";
meta = cfg.meta;
meta = cfg.meta;
executable = M2.package;
executable = M2.package;
args = [
"--architecture"
architecture.m2libc
"-f"
"${sources.m2libc}/sys/types.h"
"-f"
"${sources.m2libc}/stddef.h"
"-f"
"${sources.m2libc}/${architecture.m2libc}/linux/unistd.c"
"-f"
"${sources.m2libc}/${architecture.m2libc}/linux/fcntl.c"
"-f"
"${sources.m2libc}/fcntl.c"
"-f"
"${sources.m2libc}/${architecture.m2libc}/linux/sys/stat.c"
"-f"
"${sources.m2libc}/string.c"
"-f"
"${sources.m2libc}/stdlib.c"
"-f"
"${sources.m2libc}/stdio.h"
"-f"
"${sources.m2libc}/stdio.c"
"-f"
"${sources.m2libc}/bootstrappable.c"
"-f"
"${sources.mescc-tools}/Kaem/kaem.h"
"-f"
"${sources.mescc-tools}/Kaem/variable.c"
"-f"
"${sources.mescc-tools}/Kaem/kaem_globals.c"
"-f"
"${sources.mescc-tools}/Kaem/kaem.c"
"--debug"
"-o"
(builtins.placeholder "out")
];
};
kaem-footer_M1 = builders.raw.build {
pname = "kaem-footer_M1";
version = "1.6.0";
meta = cfg.meta;
executable = blood-elf.package;
args =
(lib.lists.when (config.aux.platform.bits == 64) "--64")
++ [
args = [
"--architecture"
architecture.m2libc
"-f"
kaem_M1
"${sources.m2libc}/sys/types.h"
"-f"
"${sources.m2libc}/stddef.h"
"-f"
"${sources.m2libc}/${architecture.m2libc}/linux/unistd.c"
"-f"
"${sources.m2libc}/${architecture.m2libc}/linux/fcntl.c"
"-f"
"${sources.m2libc}/fcntl.c"
"-f"
"${sources.m2libc}/${architecture.m2libc}/linux/sys/stat.c"
"-f"
"${sources.m2libc}/string.c"
"-f"
"${sources.m2libc}/stdlib.c"
"-f"
"${sources.m2libc}/stdio.h"
"-f"
"${sources.m2libc}/stdio.c"
"-f"
"${sources.m2libc}/bootstrappable.c"
"-f"
"${sources.mescc-tools}/Kaem/kaem.h"
"-f"
"${sources.mescc-tools}/Kaem/variable.c"
"-f"
"${sources.mescc-tools}/Kaem/kaem_globals.c"
"-f"
"${sources.mescc-tools}/Kaem/kaem.c"
"--debug"
"-o"
(builtins.placeholder "out")
];
};
kaem-footer_M1 = builders.raw.build {
pname = "kaem-footer_M1";
version = "1.6.0";
meta = cfg.meta;
executable = blood-elf.package;
args =
(lib.lists.when (config.aux.platform.bits == 64) "--64")
++ [
"-f"
kaem_M1
(
if config.aux.platform.endian == "little"
then "--little-endian"
else "--big-endian"
)
"-o"
(builtins.placeholder "out")
];
};
kaem_hex2 = builders.raw.build {
pname = "kaem_hex2";
version = "1.6.0";
meta = cfg.meta;
executable = M1.package;
args = [
"--architecture"
architecture.m2libc
(
if config.aux.platform.endian == "little"
then "--little-endian"
else "--big-endian"
)
"-f"
"${sources.m2libc}/${architecture.m2libc}/${architecture.m2libc}_defs.M1"
"-f"
"${sources.m2libc}/${architecture.m2libc}/libc-full.M1"
"-f"
kaem_M1
"-f"
kaem-footer_M1
"-o"
(builtins.placeholder "out")
];
};
kaem_hex2 = builders.raw.build {
pname = "kaem_hex2";
version = "1.6.0";
meta = cfg.meta;
executable = M1.package;
args = [
"--architecture"
architecture.m2libc
(
if config.aux.platform.endian == "little"
then "--little-endian"
else "--big-endian"
)
"-f"
"${sources.m2libc}/${architecture.m2libc}/${architecture.m2libc}_defs.M1"
"-f"
"${sources.m2libc}/${architecture.m2libc}/libc-full.M1"
"-f"
kaem_M1
"-f"
kaem-footer_M1
"-o"
(builtins.placeholder "out")
];
};
in [
"--architecture"
architecture.m2libc
(
if config.aux.platform.endian == "little"
then "--little-endian"
else "--big-endian"
)
"--base-address"
(
if config.aux.system == "x86_64-linux"
then "0x00600000"
else if config.aux.system == "aarch64-linux"
then "0x00600000"
else if config.aux.system == "i686-linux"
then "0x08048000"
else builtins.throw "Unsupported system: ${config.aux.system}"
)
"-f"
"${sources.m2libc}/${architecture.m2libc}/ELF-${architecture.m2libc}-debug.hex2"
"-f"
kaem_hex2
"-o"
(builtins.placeholder "out")
];
});
};
in [
"--architecture"
architecture.m2libc
(
if config.aux.platform.endian == "little"
then "--little-endian"
else "--big-endian"
)
"--base-address"
(
if config.aux.system == "x86_64-linux"
then "0x00600000"
else if config.aux.system == "aarch64-linux"
then "0x00600000"
else if config.aux.system == "i686-linux"
then "0x08048000"
else builtins.throw "Unsupported system: ${config.aux.system}"
)
"-f"
"${sources.m2libc}/${architecture.m2libc}/ELF-${architecture.m2libc}-debug.hex2"
"-f"
kaem_hex2
"-o"
(builtins.placeholder "out")
];
}
);
};
};
}

View file

@ -32,7 +32,10 @@ in {
platforms = lib.options.create {
type = lib.types.list.of lib.types.string;
description = "Platforms the package supports.";
default.value = ["i686-linux"];
default.value = [
"i686-linux"
"x86_64-linux"
];
};
};

View file

@ -1,17 +1,14 @@
{
lib,
config,
}: let
{ lib, config }:
let
cfg = config.aux.foundation.stages.stage1.bash;
platform = config.aux.platform;
builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1;
in {
includes = [
./boot.nix
];
in
{
includes = [ ./boot.nix ];
options.aux.foundation.stages.stage1.bash = {
meta = {
@ -37,7 +34,10 @@ in {
platforms = lib.options.create {
type = lib.types.list.of lib.types.string;
description = "Platforms the package supports.";
default.value = ["i686-linux"];
default.value = [
"i686-linux"
"x86_64-linux"
];
};
mainProgram = lib.options.create {
@ -72,12 +72,13 @@ in {
sha256 = "132qng0jy600mv1fs95ylnlisx2wavkkgpb19c6kmz7lnmjhjwhk";
};
package = let
patches = [
# flush output for generated code
./patches/mksignames-flush.patch
];
in
package =
let
patches = [
# flush output for generated code
./patches/mksignames-flush.patch
];
in
builders.bash.boot.build {
name = "bash-${cfg.version}";
@ -108,7 +109,8 @@ in {
export CC="tcc -B ${stage1.tinycc.musl.libs.package}/lib"
export AR="tcc -ar"
export LD=tcc
bash ./configure \
chmod +x ./configure
./configure \
--prefix=$out \
--build=${platform.build} \
--host=${platform.host} \

View file

@ -1,14 +1,13 @@
{
lib,
config,
}: let
{ lib, config }:
let
cfg = config.aux.foundation.stages.stage1.binutils;
platform = config.aux.platform;
builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1;
in {
in
{
options.aux.foundation.stages.stage1.binutils = {
meta = {
description = lib.options.create {
@ -33,7 +32,10 @@ in {
platforms = lib.options.create {
type = lib.types.list.of lib.types.string;
description = "Platforms the package supports.";
default.value = ["i686-linux"];
default.value = [
"i686-linux"
"x86_64-linux"
];
};
};
@ -62,32 +64,33 @@ in {
sha256 = "rppXieI0WeWWBuZxRyPy0//DHAMXQZHvDQFb3wYAdFA=";
};
package = let
patches = [
# Make binutils output deterministic by default.
./patches/deterministic.patch
];
package =
let
patches = [
# Make binutils output deterministic by default.
./patches/deterministic.patch
];
configureFlags = [
"--prefix=${builtins.placeholder "out"}"
"--build=${platform.build}"
"--host=${platform.host}"
"--with-sysroot=/"
"--enable-deterministic-archives"
# depends on bison
"--disable-gprofng"
configureFlags = [
"--prefix=${builtins.placeholder "out"}"
"--build=${platform.build}"
"--host=${platform.host}"
"--with-sysroot=/"
"--enable-deterministic-archives"
# depends on bison
"--disable-gprofng"
# Turn on --enable-new-dtags by default to make the linker set
# RUNPATH instead of RPATH on binaries. This is important because
# RUNPATH can be overridden using LD_LIBRARY_PATH at runtime.
"--enable-new-dtags"
# Turn on --enable-new-dtags by default to make the linker set
# RUNPATH instead of RPATH on binaries. This is important because
# RUNPATH can be overridden using LD_LIBRARY_PATH at runtime.
"--enable-new-dtags"
# By default binutils searches $libdir for libraries. This brings in
# libbfd and libopcodes into a default visibility. Drop default lib
# path to force users to declare their use of these libraries.
"--with-lib-path=:"
];
in
# By default binutils searches $libdir for libraries. This brings in
# libbfd and libopcodes into a default visibility. Drop default lib
# path to force users to declare their use of these libraries.
"--with-lib-path=:"
];
in
builders.bash.boot.build {
name = "binutils-${cfg.version}";
@ -130,7 +133,8 @@ in {
export AR="tcc -ar"
export lt_cv_sys_max_cmd_len=32768
export CFLAGS="-D__LITTLE_ENDIAN__=1"
bash ./configure ${builtins.concatStringsSep " " configureFlags}
chmod +x ./configure
./configure ${builtins.concatStringsSep " " configureFlags}
# Build
make -j $NIX_BUILD_CORES all-libiberty all-gas all-bfd all-libctf all-zlib all-gprof

View file

@ -1,14 +1,13 @@
{
lib,
config,
}: let
{ lib, config }:
let
cfg = config.aux.foundation.stages.stage1.bison;
platform = config.aux.platform;
builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1;
in {
in
{
options.aux.foundation.stages.stage1.bison = {
meta = {
description = lib.options.create {
@ -33,7 +32,10 @@ in {
platforms = lib.options.create {
type = lib.types.list.of lib.types.string;
description = "Platforms the package supports.";
default.value = ["i686-linux"];
default.value = [
"i686-linux"
"x86_64-linux"
];
};
};
@ -87,7 +89,8 @@ in {
cd bison-${cfg.version}
# Configure
bash ./configure \
chmod +x ./configure
./configure \
--prefix=$out \
--build=${platform.build} \
--host=${platform.host} \

View file

@ -34,7 +34,10 @@ in {
type = lib.types.list.of lib.types.string;
description = "Platforms the package supports.";
# TODO: Support more platforms.
default.value = ["i686-linux"];
default.value = [
"i686-linux"
"x86_64-linux"
];
};
};

View file

@ -1,17 +1,14 @@
{
lib,
config,
}: let
{ lib, config }:
let
cfg = config.aux.foundation.stages.stage1.coreutils;
platform = config.aux.platform;
builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1;
in {
includes = [
./boot.nix
];
in
{
includes = [ ./boot.nix ];
options.aux.foundation.stages.stage1.coreutils = {
meta = {
@ -37,7 +34,10 @@ in {
platforms = lib.options.create {
type = lib.types.list.of lib.types.string;
description = "Platforms the package supports.";
default.value = ["i686-linux"];
default.value = [
"i686-linux"
"x86_64-linux"
];
};
};
@ -66,17 +66,18 @@ in {
sha256 = "X2ANkJOXOwr+JTk9m8GMRPIjJlf0yg2V6jHHAutmtzk=";
};
package = let
configureFlags = [
"--prefix=${builtins.placeholder "out"}"
"--build=${platform.build}"
"--host=${platform.host}"
# musl 1.1.x doesn't use 64bit time_t
"--disable-year2038"
# libstdbuf.so fails in static builds
"--enable-no-install-program=stdbuf"
];
in
package =
let
configureFlags = [
"--prefix=${builtins.placeholder "out"}"
"--build=${platform.build}"
"--host=${platform.host}"
# musl 1.1.x doesn't use 64bit time_t
"--disable-year2038"
# libstdbuf.so fails in static builds
"--enable-no-install-program=stdbuf"
];
in
builders.bash.boot.build {
name = "coreutils-${cfg.version}";
@ -100,7 +101,8 @@ in {
# Configure
export CC="tcc -B ${stage1.tinycc.musl.libs.package}/lib"
export LD=tcc
bash ./configure ${builtins.concatStringsSep " " configureFlags}
chmod +x ./configure
./configure ${builtins.concatStringsSep " " configureFlags}
# Build
make -j $NIX_BUILD_CORES AR="tcc -ar" MAKEINFO="true"

View file

@ -1,14 +1,13 @@
{
lib,
config,
}: let
{ lib, config }:
let
cfg = config.aux.foundation.stages.stage1.diffutils;
platform = config.aux.platform;
builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1;
in {
in
{
options.aux.foundation.stages.stage1.diffutils = {
meta = {
description = lib.options.create {
@ -33,7 +32,10 @@ in {
platforms = lib.options.create {
type = lib.types.list.of lib.types.string;
description = "Platforms the package supports.";
default.value = ["i686-linux"];
default.value = [
"i686-linux"
"x86_64-linux"
];
};
};
@ -88,7 +90,8 @@ in {
# Configure
export CC="tcc -B ${stage1.tinycc.musl.libs.package}/lib"
export LD=tcc
bash ./configure \
chmod +x ./configure
./configure \
--prefix=$out \
--build=${platform.build} \
--host=${platform.host}

View file

@ -1,14 +1,13 @@
{
lib,
config,
}: let
{ lib, config }:
let
cfg = config.aux.foundation.stages.stage1.findutils;
platform = config.aux.platform;
builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1;
in {
in
{
options.aux.foundation.stages.stage1.findutils = {
meta = {
description = lib.options.create {
@ -33,7 +32,10 @@ in {
platforms = lib.options.create {
type = lib.types.list.of lib.types.string;
description = "Platforms the package supports.";
default.value = ["i686-linux"];
default.value = [
"i686-linux"
"x86_64-linux"
];
};
};
@ -93,7 +95,8 @@ in {
export CC="tcc -B ${stage1.tinycc.musl.libs.package}/lib"
export AR="tcc -ar"
export LD=tcc
bash ./configure \
chmod +x ./configure
./configure \
--prefix=$out \
--build=${platform.build} \
--host=${platform.host}

View file

@ -1,14 +1,13 @@
{
lib,
config,
}: let
{ lib, config }:
let
cfg = config.aux.foundation.stages.stage1.gawk.boot;
platform = config.aux.platform;
builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1;
in {
in
{
options.aux.foundation.stages.stage1.gawk.boot = {
package = lib.options.create {
type = lib.types.derivation;
@ -35,12 +34,13 @@ in {
sha256 = "1z4bibjm7ldvjwq3hmyifyb429rs2d9bdwkvs0r171vv1khpdwmb";
};
package = let
patches = [
# for reproducibility don't generate date stamp
./patches/no-stamp.patch
];
in
package =
let
patches = [
# for reproducibility don't generate date stamp
./patches/no-stamp.patch
];
in
builders.bash.boot.build {
name = "gawk-boot-${cfg.version}";
@ -68,7 +68,8 @@ in {
export CC="tcc -B ${stage1.tinycc.mes.libs.package}/lib"
export ac_cv_func_getpgrp_void=yes
export ac_cv_func_tzset=yes
bash ./configure \
chmod +x ./configure
./configure \
--build=${platform.build} \
--host=${platform.host} \
--disable-nls \

View file

@ -1,17 +1,14 @@
{
lib,
config,
}: let
{ lib, config }:
let
cfg = config.aux.foundation.stages.stage1.gawk;
platform = config.aux.platform;
builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1;
in {
includes = [
./boot.nix
];
in
{
includes = [ ./boot.nix ];
options.aux.foundation.stages.stage1.gawk = {
meta = {
@ -37,7 +34,10 @@ in {
platforms = lib.options.create {
type = lib.types.list.of lib.types.string;
description = "Platforms the package supports.";
default.value = ["i686-linux"];
default.value = [
"i686-linux"
"x86_64-linux"
];
};
mainProgram = lib.options.create {
@ -96,7 +96,8 @@ in {
export CC="tcc -B ${stage1.tinycc.musl.libs.package}/lib"
export AR="tcc -ar"
export LD=tcc
bash ./configure \
chmod +x ./configure
./configure \
--prefix=$out \
--build=${platform.build} \
--host=${platform.host}

View file

@ -1,14 +1,13 @@
{
lib,
config,
}: let
{ lib, config }:
let
cfg = config.aux.foundation.stages.stage1.gcc;
platform = config.aux.platform;
builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1;
in {
in
{
includes = [
./v4.6.nix
./v4.6.cxx.nix
@ -39,7 +38,10 @@ in {
platforms = lib.options.create {
type = lib.types.list.of lib.types.string;
description = "Platforms the package supports.";
default.value = ["i686-linux"];
default.value = [
"i686-linux"
"x86_64-linux"
];
};
};
@ -198,7 +200,8 @@ in {
export CFLAGS_FOR_TARGET="-Wl,-dynamic-linker -Wl,${stage1.musl.package}/lib/libc.so"
export LIBRARY_PATH="${stage1.musl.package}/lib"
bash ./configure \
chmod +x ./configure
./configure \
--prefix=$out \
--build=${platform.build} \
--host=${platform.host} \

View file

@ -1,14 +1,13 @@
{
lib,
config,
}: let
{ lib, config }:
let
cfg = config.aux.foundation.stages.stage1.gcc.v46.cxx;
platform = config.aux.platform;
builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1;
in {
in
{
options.aux.foundation.stages.stage1.gcc.v46.cxx = {
package = lib.options.create {
type = lib.types.derivation;
@ -112,12 +111,13 @@ in {
};
};
package = let
patches = [
# Remove hardcoded NATIVE_SYSTEM_HEADER_DIR
./patches/no-system-headers.patch
];
in
package =
let
patches = [
# Remove hardcoded NATIVE_SYSTEM_HEADER_DIR
./patches/no-system-headers.patch
];
in
builders.bash.build {
name = "gcc-cxx-${cfg.version}";
@ -162,7 +162,8 @@ in {
export CPLUS_INCLUDE_PATH="$C_INCLUDE_PATH"
export LIBRARY_PATH="${stage1.musl.package}/lib"
bash ./configure \
chmod +x ./configure
./configure \
--prefix=$out \
--build=${platform.build} \
--host=${platform.host} \

View file

@ -1,14 +1,13 @@
{
lib,
config,
}: let
{ lib, config }:
let
cfg = config.aux.foundation.stages.stage1.gcc.v46;
platform = config.aux.platform;
builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1;
in {
in
{
options.aux.foundation.stages.stage1.gcc.v46 = {
package = lib.options.create {
type = lib.types.derivation;
@ -112,12 +111,13 @@ in {
};
};
package = let
patches = [
# Remove hardcoded NATIVE_SYSTEM_HEADER_DIR
./patches/no-system-headers.patch
];
in
package =
let
patches = [
# Remove hardcoded NATIVE_SYSTEM_HEADER_DIR
./patches/no-system-headers.patch
];
in
builders.bash.build {
name = "gcc-${cfg.version}";
@ -163,7 +163,8 @@ in {
export ac_cv_func_memcpy=yes
export ac_cv_func_strerror=yes
bash ./configure \
chmod +x ./configure
./configure \
--prefix=$out \
--build=${platform.build} \
--host=${platform.host} \

View file

@ -1,14 +1,13 @@
{
lib,
config,
}: let
{ lib, config }:
let
cfg = config.aux.foundation.stages.stage1.gcc.v8;
platform = config.aux.platform;
builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1;
in {
in
{
options.aux.foundation.stages.stage1.gcc.v8 = {
package = lib.options.create {
type = lib.types.derivation;
@ -168,7 +167,8 @@ in {
export CPLUS_INCLUDE_PATH="$C_INCLUDE_PATH"
export LIBRARY_PATH="${stage1.musl.package}/lib"
bash ./configure \
chmod +x ./configure
./configure \
--prefix=$out \
--build=${platform.build} \
--host=${platform.host} \

View file

@ -32,7 +32,10 @@ in {
platforms = lib.options.create {
type = lib.types.list.of lib.types.string;
description = "Platforms the package supports.";
default.value = ["i686-linux"];
default.value = [
"i686-linux"
"x86_64-linux"
];
};
mainProgram = lib.options.create {

View file

@ -1,14 +1,13 @@
{
lib,
config,
}: let
{ lib, config }:
let
cfg = config.aux.foundation.stages.stage1.gnum4;
platform = config.aux.platform;
builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1;
in {
in
{
options.aux.foundation.stages.stage1.gnum4 = {
meta = {
description = lib.options.create {
@ -33,7 +32,10 @@ in {
platforms = lib.options.create {
type = lib.types.list.of lib.types.string;
description = "Platforms the package supports.";
default.value = ["i686-linux"];
default.value = [
"i686-linux"
"x86_64-linux"
];
};
};
@ -86,7 +88,8 @@ in {
cd m4-${cfg.version}
# Configure
bash ./configure \
chmod +x ./configure
./configure \
--prefix=$out \
--build=${platform.build} \
--host=${platform.host} \

View file

@ -1,17 +1,14 @@
{
lib,
config,
}: let
{ lib, config }:
let
cfg = config.aux.foundation.stages.stage1.gnumake;
platform = config.aux.platform;
builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1;
in {
includes = [
./boot.nix
];
in
{
includes = [ ./boot.nix ];
options.aux.foundation.stages.stage1.gnumake = {
meta = {
@ -37,7 +34,10 @@ in {
platforms = lib.options.create {
type = lib.types.list.of lib.types.string;
description = "Platforms the package supports.";
default.value = ["i686-linux"];
default.value = [
"i686-linux"
"x86_64-linux"
];
};
};
@ -66,16 +66,17 @@ in {
sha256 = "3Rb7HWe/q3mnL16DkHNcSePo5wtJRaFasfgd23hlj7M=";
};
package = let
patches = [
# Replaces /bin/sh with sh, see patch file for reasoning
./patches/0001-No-impure-bin-sh.patch
# Purity: don't look for library dependencies (of the form `-lfoo') in /lib
# and /usr/lib. It's a stupid feature anyway. Likewise, when searching for
# included Makefiles, don't look in /usr/include and friends.
./patches/0002-remove-impure-dirs.patch
];
in
package =
let
patches = [
# Replaces /bin/sh with sh, see patch file for reasoning
./patches/0001-No-impure-bin-sh.patch
# Purity: don't look for library dependencies (of the form `-lfoo') in /lib
# and /usr/lib. It's a stupid feature anyway. Likewise, when searching for
# included Makefiles, don't look in /usr/include and friends.
./patches/0002-remove-impure-dirs.patch
];
in
builders.bash.boot.build {
name = "gnumake-${cfg.version}";
@ -103,7 +104,8 @@ in {
# Configure
export CC="tcc -B ${stage1.tinycc.musl.libs.package}/lib"
export LD=tcc
bash ./configure \
chmod +x ./configure
./configure \
--prefix=$out \
--build=${platform.build} \
--host=${platform.host}

View file

@ -32,7 +32,10 @@ in {
platforms = lib.options.create {
type = lib.types.list.of lib.types.string;
description = "Platforms the package supports.";
default.value = ["i686-linux"];
default.value = [
"i686-linux"
"x86_64-linux"
];
};
};
@ -118,13 +121,8 @@ in {
];
objects =
builtins.map
(
value:
builtins.replaceStrings
[".c"]
[".o"]
(builtins.baseNameOf value)
builtins.map (
value: builtins.replaceStrings [".c"] [".o"] (builtins.baseNameOf value)
)
sources;
in
@ -134,9 +132,7 @@ in {
meta = cfg.meta;
src = cfg.src;
deps.build.host = [
stage1.tinycc.mes.compiler.package
];
deps.build.host = [stage1.tinycc.mes.compiler.package];
script = ''
# Unpack

View file

@ -9,9 +9,7 @@
stage1 = config.aux.foundation.stages.stage1;
in {
includes = [
./boot.nix
];
includes = [./boot.nix];
options.aux.foundation.stages.stage1.gnused = {
meta = {
@ -37,7 +35,10 @@ in {
platforms = lib.options.create {
type = lib.types.list.of lib.types.string;
description = "Platforms the package supports.";
default.value = ["i686-linux"];
default.value = [
"i686-linux"
"x86_64-linux"
];
};
mainProgram = lib.options.create {

View file

@ -1,14 +1,13 @@
{
lib,
config,
}: let
{ lib, config }:
let
cfg = config.aux.foundation.stages.stage1.gnutar.boot;
platform = config.aux.platform;
builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1;
in {
in
{
options.aux.foundation.stages.stage1.gnutar.boot = {
package = lib.options.create {
type = lib.types.derivation;
@ -35,8 +34,9 @@ in {
sha256 = "02m6gajm647n8l9a5bnld6fnbgdpyi4i3i83p7xcwv0kif47xhy6";
};
package = let
in
package =
let
in
builders.bash.boot.build {
name = "gnutar-boot-${cfg.version}";
@ -58,7 +58,8 @@ in {
# Configure
export CC="tcc -B ${stage1.tinycc.mes.libs.package}/lib"
bash ./configure \
chmod +x ./configure
./configure \
--build=${platform.build} \
--host=${platform.host} \
--disable-nls \

View file

@ -1,14 +1,13 @@
{
lib,
config,
}: let
{ lib, config }:
let
cfg = config.aux.foundation.stages.stage1.gnutar;
platform = config.aux.platform;
builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1;
in {
in
{
includes = [
./boot.nix
./musl.nix
@ -38,7 +37,10 @@ in {
platforms = lib.options.create {
type = lib.types.list.of lib.types.string;
description = "Platforms the package supports.";
default.value = ["i686-linux"];
default.value = [
"i686-linux"
"x86_64-linux"
];
};
mainProgram = lib.options.create {
@ -96,7 +98,8 @@ in {
cd tar-${cfg.version}
# Configure
bash ./configure \
chmod +x ./configure
./configure \
--prefix=$out \
--build=${platform.build} \
--host=${platform.host} \

View file

@ -1,14 +1,13 @@
{
lib,
config,
}: let
{ lib, config }:
let
cfg = config.aux.foundation.stages.stage1.gnutar.musl;
platform = config.aux.platform;
builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1;
in {
in
{
options.aux.foundation.stages.stage1.gnutar.musl = {
package = lib.options.create {
type = lib.types.derivation;
@ -60,7 +59,8 @@ in {
export ac_cv_sizeof_unsigned_long=4
export ac_cv_sizeof_long_long=8
export ac_cv_header_netdb_h=no
bash ./configure \
chmod +x ./configure
./configure \
--prefix=$out \
--build=${platform.build} \
--host=${platform.host} \

View file

@ -1,13 +1,12 @@
{
lib,
config,
}: let
{ lib, config }:
let
cfg = config.aux.foundation.stages.stage1.gzip;
builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1;
in {
in
{
options.aux.foundation.stages.stage1.gzip = {
meta = {
description = lib.options.create {
@ -32,7 +31,10 @@ in {
platforms = lib.options.create {
type = lib.types.list.of lib.types.string;
description = "Platforms the package supports.";
default.value = ["i686-linux"];
default.value = [
"i686-linux"
"x86_64-linux"
];
};
};
@ -61,38 +63,37 @@ in {
sha256 = "0ryr5b00qz3xcdcv03qwjdfji8pasp0007ay3ppmk71wl8c1i90w";
};
package = let
in
builders.bash.boot.build {
name = "gzip-${cfg.version}";
meta = cfg.meta;
package = builders.bash.boot.build {
name = "gzip-${cfg.version}";
meta = cfg.meta;
deps.build.host = [
stage1.tinycc.mes.compiler.package
stage1.gnumake.boot.package
stage1.gnused.boot.package
stage1.gnugrep.package
];
deps.build.host = [
stage1.tinycc.mes.compiler.package
stage1.gnumake.boot.package
stage1.gnused.boot.package
stage1.gnugrep.package
];
script = ''
# Unpack
ungz --file ${cfg.src} --output gzip.tar
untar --file gzip.tar
rm gzip.tar
cd gzip-${cfg.version}
script = ''
# Unpack
ungz --file ${cfg.src} --output gzip.tar
untar --file gzip.tar
rm gzip.tar
cd gzip-${cfg.version}
# Configure
export CC="tcc -B ${stage1.tinycc.mes.libs.package}/lib -Dstrlwr=unused"
bash ./configure --prefix=$out
# Configure
export CC="tcc -B ${stage1.tinycc.mes.libs.package}/lib -Dstrlwr=unused"
chmod +x ./configure
./configure --prefix=$out
# Build
make
# Build
make
# Install
mkdir $out
make install
'';
};
# Install
mkdir $out
make install
'';
};
};
};
}

View file

@ -10,9 +10,7 @@
stage1 = config.aux.foundation.stages.stage1;
stage2 = config.aux.foundation.stages.stage2;
in {
includes = [
./devtools.nix
];
includes = [./devtools.nix];
options.aux.foundation.stages.stage1.heirloom = {
meta = {
@ -48,7 +46,10 @@ in {
platforms = lib.options.create {
type = lib.types.list.of lib.types.string;
description = "Platforms the package supports.";
default.value = ["i686-linux"];
default.value = [
"i686-linux"
"x86_64-linux"
];
};
};

View file

@ -54,7 +54,10 @@ in {
platforms = lib.options.create {
type = lib.types.list.of lib.types.string;
description = "Platforms the package supports.";
default.value = ["i686-linux"];
default.value = [
"i686-linux"
"x86_64-linux"
];
};
};
};

View file

@ -27,7 +27,10 @@ in {
platforms = lib.options.create {
type = lib.types.list.of lib.types.string;
description = "Platforms the package supports.";
default.value = ["i686-linux"];
default.value = [
"i686-linux"
"x86_64-linux"
];
};
};

View file

@ -33,7 +33,10 @@ in {
platforms = lib.options.create {
type = lib.types.list.of lib.types.string;
description = "Platforms the package supports.";
default.value = ["i686-linux"];
default.value = [
"i686-linux"
"x86_64-linux"
];
};
};

View file

@ -34,7 +34,10 @@ in {
platforms = lib.options.create {
type = lib.types.list.of lib.types.string;
description = "Platforms the package supports.";
default.value = ["i686-linux"];
default.value = [
"i686-linux"
"x86_64-linux"
];
};
};
@ -79,11 +82,9 @@ in {
sources = import ./sources.nix;
files =
lib.strings.concatMapSep
" "
(getSourcePath ".o")
(builtins.map compile sources.x86.linux.mescc.mes);
files = lib.strings.concatMapSep " " (getSourcePath ".o") (
builtins.map compile sources.x86.linux.mescc.mes
);
in
builders.kaem.build {
name = "mes-${stage1.mes.version}";

View file

@ -32,7 +32,10 @@ in {
platforms = lib.options.create {
type = lib.types.list.of lib.types.string;
description = "Platforms the package supports.";
default.value = ["i686-linux"];
default.value = [
"i686-linux"
"x86_64-linux"
];
};
};
@ -57,9 +60,7 @@ in {
meta = cfg.meta;
deps.build.host = [
stage1.ln-boot.package
];
deps.build.host = [stage1.ln-boot.package];
script = ''
cd ${stage1.mes.libs.prefix}

View file

@ -34,7 +34,10 @@ in {
platforms = lib.options.create {
type = lib.types.list.of lib.types.string;
description = "Platforms the package supports.";
default.value = ["i686-linux"];
default.value = [
"i686-linux"
"x86_64-linux"
];
};
};
@ -199,11 +202,13 @@ in {
libc-mini = createLib "libc-mini" sources.x86.linux.mescc.libc_mini;
libmescc = createLib "libmescc" sources.x86.linux.mescc.libmescc;
libc = createLib "libc" sources.x86.linux.mescc.libc;
libc_tcc = createLib "libc+tcc" (sources.x86.linux.mescc.libc_tcc
libc_tcc = createLib "libc+tcc" (
sources.x86.linux.mescc.libc_tcc
++ [
# We need `symlink` support for `ln-boot` to work.
"lib/linux/symlink.c"
]);
]
);
in
builders.kaem.build {
name = "mes-m2-libs-${stage1.mes.version}";

View file

@ -1,14 +1,13 @@
{
lib,
config,
}: let
{ lib, config }:
let
cfg = config.aux.foundation.stages.stage1.musl.boot;
platform = config.aux.platform;
builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1;
in {
in
{
options.aux.foundation.stages.stage1.musl.boot = {
package = lib.options.create {
type = lib.types.derivation;
@ -35,52 +34,53 @@ in {
sha256 = "E3DJqBKyzyp9koAlEMygBYzDfmanvt1wBR8KNAFQIqM=";
};
package = let
# Thanks to the live-bootstrap project!
# See https://github.com/fosslinux/live-bootstrap/blob/d98f97e21413efc32c770d0356f1feda66025686/sysa/musl-1.1.24/musl-1.1.24.sh
liveBootstrap = "https://github.com/fosslinux/live-bootstrap/raw/d98f97e21413efc32c770d0356f1feda66025686/sysa/musl-1.1.24";
patches = [
(builtins.fetchurl {
url = "${liveBootstrap}/patches/avoid_set_thread_area.patch";
sha256 = "TsbBZXk4/KMZG9EKi7cF+sullVXrxlizLNH0UHGXsPs=";
})
(builtins.fetchurl {
url = "${liveBootstrap}/patches/avoid_sys_clone.patch";
sha256 = "/ZmH64J57MmbxdfQ4RNjamAiBdkImMTlHsHdgV4gMj4=";
})
(builtins.fetchurl {
url = "${liveBootstrap}/patches/fenv.patch";
sha256 = "vMVGjoN4deAJW5gsSqA207SJqAbvhrnOsGK49DdEiTI=";
})
(builtins.fetchurl {
url = "${liveBootstrap}/patches/makefile.patch";
sha256 = "03iYBAUnsrEdLIIhhhq5mM6BGnPn2EfUmIHu51opxbw=";
})
(builtins.fetchurl {
url = "${liveBootstrap}/patches/musl_weak_symbols.patch";
sha256 = "/d9a2eUkpe9uyi1ye6T4CiYc9MR3FZ9na0Gb90+g4v0=";
})
(builtins.fetchurl {
url = "${liveBootstrap}/patches/set_thread_area.patch";
sha256 = "RIZYqbbRSx4X/0iFUhriwwBRmoXVR295GNBUjf2UrM0=";
})
(builtins.fetchurl {
url = "${liveBootstrap}/patches/sigsetjmp.patch";
sha256 = "wd2Aev1zPJXy3q933aiup5p1IMKzVJBquAyl3gbK4PU=";
})
# FIXME: this patch causes the build to fail
# (builtins.fetchurl {
# url = "${liveBootstrap}/patches/stdio_flush_on_exit.patch";
# sha256 = "/z5ze3h3QTysay8nRvyvwPv3pmTcKptdkBIaMCoeLDg=";
# })
# HACK: always flush stdio immediately
./patches/always-flush.patch
(builtins.fetchurl {
url = "${liveBootstrap}/patches/va_list.patch";
sha256 = "UmcMIl+YCi3wIeVvjbsCyqFlkyYsM4ECNwTfXP+s7vg=";
})
];
in
package =
let
# Thanks to the live-bootstrap project!
# See https://github.com/fosslinux/live-bootstrap/blob/d98f97e21413efc32c770d0356f1feda66025686/sysa/musl-1.1.24/musl-1.1.24.sh
liveBootstrap = "https://github.com/fosslinux/live-bootstrap/raw/d98f97e21413efc32c770d0356f1feda66025686/sysa/musl-1.1.24";
patches = [
(builtins.fetchurl {
url = "${liveBootstrap}/patches/avoid_set_thread_area.patch";
sha256 = "TsbBZXk4/KMZG9EKi7cF+sullVXrxlizLNH0UHGXsPs=";
})
(builtins.fetchurl {
url = "${liveBootstrap}/patches/avoid_sys_clone.patch";
sha256 = "/ZmH64J57MmbxdfQ4RNjamAiBdkImMTlHsHdgV4gMj4=";
})
(builtins.fetchurl {
url = "${liveBootstrap}/patches/fenv.patch";
sha256 = "vMVGjoN4deAJW5gsSqA207SJqAbvhrnOsGK49DdEiTI=";
})
(builtins.fetchurl {
url = "${liveBootstrap}/patches/makefile.patch";
sha256 = "03iYBAUnsrEdLIIhhhq5mM6BGnPn2EfUmIHu51opxbw=";
})
(builtins.fetchurl {
url = "${liveBootstrap}/patches/musl_weak_symbols.patch";
sha256 = "/d9a2eUkpe9uyi1ye6T4CiYc9MR3FZ9na0Gb90+g4v0=";
})
(builtins.fetchurl {
url = "${liveBootstrap}/patches/set_thread_area.patch";
sha256 = "RIZYqbbRSx4X/0iFUhriwwBRmoXVR295GNBUjf2UrM0=";
})
(builtins.fetchurl {
url = "${liveBootstrap}/patches/sigsetjmp.patch";
sha256 = "wd2Aev1zPJXy3q933aiup5p1IMKzVJBquAyl3gbK4PU=";
})
# FIXME: this patch causes the build to fail
# (builtins.fetchurl {
# url = "${liveBootstrap}/patches/stdio_flush_on_exit.patch";
# sha256 = "/z5ze3h3QTysay8nRvyvwPv3pmTcKptdkBIaMCoeLDg=";
# })
# HACK: always flush stdio immediately
./patches/always-flush.patch
(builtins.fetchurl {
url = "${liveBootstrap}/patches/va_list.patch";
sha256 = "UmcMIl+YCi3wIeVvjbsCyqFlkyYsM4ECNwTfXP+s7vg=";
})
];
in
builders.bash.boot.build {
name = "musl-boot-${cfg.version}";
@ -118,7 +118,8 @@ in {
src/misc/wordexp.c
# Configure
bash ./configure \
chmod +x configure
./configure \
--prefix=$out \
--build=${platform.build} \
--host=${platform.host} \
@ -131,7 +132,6 @@ in {
# Install
make install
cp ${stage1.tinycc.mes.libs.package}/lib/libtcc1.a $out/lib
'';
};
};

View file

@ -1,17 +1,14 @@
{
lib,
config,
}: let
{ lib, config }:
let
cfg = config.aux.foundation.stages.stage1.musl;
platform = config.aux.platform;
builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1;
in {
includes = [
./boot.nix
];
in
{
includes = [ ./boot.nix ];
options.aux.foundation.stages.stage1.musl = {
meta = {
@ -38,7 +35,10 @@ in {
type = lib.types.list.of lib.types.string;
description = "Platforms the package supports.";
# TODO: Support more platforms.
default.value = ["i686-linux"];
default.value = [
"i686-linux"
"x86-64_linux"
];
};
};
@ -98,7 +98,8 @@ in {
src/misc/wordexp.c
# Configure
bash ./configure \
chmod +x ./configure
./configure \
--prefix=$out \
--build=${platform.build} \
--host=${platform.host} \

View file

@ -35,7 +35,10 @@ in {
platforms = lib.options.create {
type = lib.types.list.of lib.types.string;
description = "Platforms the package supports.";
default.value = ["i686-linux"];
default.value = [
"i686-linux"
"x86_64-linux"
];
};
};

View file

@ -1,14 +1,13 @@
{
lib,
config,
}: let
{ lib, config }:
let
cfg = config.aux.foundation.stages.stage1.python;
platform = config.aux.platform;
builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1;
in {
in
{
options.aux.foundation.stages.stage1.python = {
meta = {
description = lib.options.create {
@ -33,7 +32,10 @@ in {
platforms = lib.options.create {
type = lib.types.list.of lib.types.string;
description = "Platforms the package supports.";
default.value = ["i686-linux"];
default.value = [
"i686-linux"
"x86_64-linux"
];
};
};
@ -62,16 +64,17 @@ in {
sha256 = "eVw09E30Wg6blxDIxxwVxnGHFSTNQSyhTe8hLozLFV0=";
};
package = let
patches = [
# Disable the use of ldconfig in ctypes.util.find_library (since
# ldconfig doesn't work on NixOS), and don't use
# ctypes.util.find_library during the loading of the uuid module
# (since it will do a futile invocation of gcc (!) to find
# libuuid, slowing down program startup a lot).
./patches/no-ldconfig.patch
];
in
package =
let
patches = [
# Disable the use of ldconfig in ctypes.util.find_library (since
# ldconfig doesn't work on NixOS), and don't use
# ctypes.util.find_library during the loading of the uuid module
# (since it will do a futile invocation of gcc (!) to find
# libuuid, slowing down program startup a lot).
./patches/no-ldconfig.patch
];
in
builders.bash.build {
name = "python-${cfg.version}";
meta = cfg.meta;
@ -104,7 +107,8 @@ in {
export C_INCLUDE_PATH="${stage1.zlib.package}/include"
export LIBRARY_PATH="${stage1.zlib.package}/lib"
export LD_LIBRARY_PATH="$LIBRARY_PATH"
bash ./configure \
chmod +x ./configure
./configure \
--prefix=$out \
--build=${platform.build} \
--host=${platform.host}

View file

@ -38,7 +38,10 @@ in {
platforms = lib.options.create {
type = lib.types.list.of lib.types.string;
description = "Platforms the package supports.";
default.value = ["i686-linux"];
default.value = [
"x86_64-linux"
"i686-linux"
];
};
};

View file

@ -1,14 +1,13 @@
{
lib,
config,
}: let
{ lib, config }:
let
cfg = config.aux.foundation.stages.stage1.xz;
platform = config.aux.platform;
builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1;
in {
in
{
options.aux.foundation.stages.stage1.xz = {
meta = {
description = lib.options.create {
@ -36,7 +35,10 @@ in {
platforms = lib.options.create {
type = lib.types.list.of lib.types.string;
description = "Platforms the package supports.";
default.value = ["i686-linux"];
default.value = [
"x86_64-linux"
"i686-linux"
];
};
};
@ -89,7 +91,8 @@ in {
export CC="tcc -B ${stage1.tinycc.musl.libs.package}/lib"
export AR="tcc -ar"
export LD=tcc
bash ./configure \
chmod +x configure
./configure \
--prefix=$out \
--build=${platform.build} \
--host=${platform.host} \

View file

@ -1,14 +1,13 @@
{
lib,
config,
}: let
{ lib, config }:
let
cfg = config.aux.foundation.stages.stage1.zlib;
platform = config.aux.platform;
builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1;
in {
in
{
options.aux.foundation.stages.stage1.zlib = {
meta = {
description = lib.options.create {
@ -33,7 +32,10 @@ in {
platforms = lib.options.create {
type = lib.types.list.of lib.types.string;
description = "Platforms the package supports.";
default.value = ["i686-linux"];
default.value = [
"x86_64-linux"
"i686-linux"
];
};
};
@ -84,7 +86,8 @@ in {
# Configure
export CC=musl-gcc
bash ./configure --prefix=$out
chmod +x configure
./configure --prefix=$out
# Build
make -j $NIX_BUILD_CORES

View file

@ -1,14 +1,13 @@
{
lib,
config,
}: let
{ lib, config }:
let
cfg = config.aux.foundation.stages.stage2.bash;
platform = config.aux.platform;
builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1;
in {
in
{
options.aux.foundation.stages.stage2.bash = {
meta = {
description = lib.options.create {
@ -33,7 +32,10 @@ in {
platforms = lib.options.create {
type = lib.types.list.of lib.types.string;
description = "Platforms the package supports.";
default.value = ["i686-linux"];
default.value = [
"x86_64-linux"
"i686-linux"
];
};
mainProgram = lib.options.create {
@ -95,7 +97,8 @@ in {
cd bash-${cfg.version}
# Configure
bash ./configure \
chmod +x ./configure
./configure \
--prefix=$out \
--build=${platform.build} \
--host=${platform.host} \

View file

@ -1,14 +1,13 @@
{
lib,
config,
}: let
{ lib, config }:
let
cfg = config.aux.foundation.stages.stage2.binutils;
platform = config.aux.platform;
builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1;
in {
in
{
options.aux.foundation.stages.stage2.binutils = {
meta = {
description = lib.options.create {
@ -33,7 +32,10 @@ in {
platforms = lib.options.create {
type = lib.types.list.of lib.types.string;
description = "Platforms the package supports.";
default.value = ["i686-linux"];
default.value = [
"x86_64-linux"
"i686-linux"
];
};
};
@ -62,35 +64,36 @@ in {
sha256 = "rppXieI0WeWWBuZxRyPy0//DHAMXQZHvDQFb3wYAdFA=";
};
package = let
patches = [
# Make binutils output deterministic by default.
./patches/deterministic.patch
];
package =
let
patches = [
# Make binutils output deterministic by default.
./patches/deterministic.patch
];
configureFlags = [
"CC=musl-gcc"
"LDFLAGS=--static"
"--prefix=${builtins.placeholder "out"}"
"--build=${platform.build}"
"--host=${platform.host}"
configureFlags = [
"CC=musl-gcc"
"LDFLAGS=--static"
"--prefix=${builtins.placeholder "out"}"
"--build=${platform.build}"
"--host=${platform.host}"
"--with-sysroot=/"
"--enable-deterministic-archives"
# depends on bison
"--disable-gprofng"
"--with-sysroot=/"
"--enable-deterministic-archives"
# depends on bison
"--disable-gprofng"
# Turn on --enable-new-dtags by default to make the linker set
# RUNPATH instead of RPATH on binaries. This is important because
# RUNPATH can be overridden using LD_LIBRARY_PATH at runtime.
"--enable-new-dtags"
# Turn on --enable-new-dtags by default to make the linker set
# RUNPATH instead of RPATH on binaries. This is important because
# RUNPATH can be overridden using LD_LIBRARY_PATH at runtime.
"--enable-new-dtags"
# By default binutils searches $libdir for libraries. This brings in
# libbfd and libopcodes into a default visibility. Drop default lib
# path to force users to declare their use of these libraries.
"--with-lib-path=:"
];
in
# By default binutils searches $libdir for libraries. This brings in
# libbfd and libopcodes into a default visibility. Drop default lib
# path to force users to declare their use of these libraries.
"--with-lib-path=:"
];
in
builders.bash.build {
name = "binutils-static-${cfg.version}";
@ -120,7 +123,8 @@ in {
${lib.strings.concatMapSep "\n" (file: "patch -Np1 -i ${file}") patches}
# Configure
bash ./configure ${builtins.concatStringsSep " " configureFlags}
chmod +x ./configure
./configure ${builtins.concatStringsSep " " configureFlags}
# Build
make -j $NIX_BUILD_CORES

View file

@ -34,7 +34,10 @@ in {
platforms = lib.options.create {
type = lib.types.list.of lib.types.string;
description = "Platforms the package supports.";
default.value = ["i686-linux"];
default.value = [
"x86_64-linux"
"i686-linux"
];
};
};
@ -64,9 +67,7 @@ in {
};
package = let
patches = [
./patches/busybox-in-store.patch
];
patches = [./patches/busybox-in-store.patch];
busyboxConfig = [
"CC=musl-gcc"

View file

@ -34,7 +34,10 @@ in {
type = lib.types.list.of lib.types.string;
description = "Platforms the package supports.";
# TODO: Support more platforms.
default.value = ["i686-linux"];
default.value = [
"x86_64-linux"
"i686-linux"
];
};
};

View file

@ -1,14 +1,13 @@
{
lib,
config,
}: let
{ lib, config }:
let
cfg = config.aux.foundation.stages.stage2.coreutils;
platform = config.aux.platform;
builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1;
in {
in
{
options.aux.foundation.stages.stage2.coreutils = {
meta = {
description = lib.options.create {
@ -33,7 +32,10 @@ in {
platforms = lib.options.create {
type = lib.types.list.of lib.types.string;
description = "Platforms the package supports.";
default.value = ["i686-linux"];
default.value = [
"x86_64-linux"
"i686-linux"
];
};
};
@ -62,18 +64,19 @@ in {
sha256 = "X2ANkJOXOwr+JTk9m8GMRPIjJlf0yg2V6jHHAutmtzk=";
};
package = let
configureFlags = [
"--prefix=${builtins.placeholder "out"}"
"--build=${platform.build}"
"--host=${platform.host}"
# libstdbuf.so fails in static builds
"--enable-no-install-program=stdbuf"
"--enable-single-binary=symlinks"
"CC=musl-gcc"
"CFLAGS=-static"
];
in
package =
let
configureFlags = [
"--prefix=${builtins.placeholder "out"}"
"--build=${platform.build}"
"--host=${platform.host}"
# libstdbuf.so fails in static builds
"--enable-no-install-program=stdbuf"
"--enable-single-binary=symlinks"
"CC=musl-gcc"
"CFLAGS=-static"
];
in
builders.bash.build {
name = "coreutils-${cfg.version}";
@ -99,7 +102,8 @@ in {
cd coreutils-${cfg.version}
# Configure
bash ./configure ${builtins.concatStringsSep " " configureFlags}
chmod +x ./configure
./configure ${builtins.concatStringsSep " " configureFlags}
# Build
make -j $NIX_BUILD_CORES

View file

@ -1,14 +1,13 @@
{
lib,
config,
}: let
{ lib, config }:
let
cfg = config.aux.foundation.stages.stage2.diffutils;
platform = config.aux.platform;
builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1;
in {
in
{
options.aux.foundation.stages.stage2.diffutils = {
meta = {
description = lib.options.create {
@ -33,7 +32,10 @@ in {
platforms = lib.options.create {
type = lib.types.list.of lib.types.string;
description = "Platforms the package supports.";
default.value = ["i686-linux"];
default.value = [
"x86_64-linux"
"i686-linux"
];
};
};
@ -87,7 +89,8 @@ in {
cd diffutils-${cfg.version}
# Configure
bash ./configure \
chmod +x ./configure
./configure \
--prefix=$out \
--build=${platform.build} \
--host=${platform.host} \

View file

@ -1,14 +1,13 @@
{
lib,
config,
}: let
{ lib, config }:
let
cfg = config.aux.foundation.stages.stage2.findutils;
platform = config.aux.platform;
builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1;
in {
in
{
options.aux.foundation.stages.stage2.findutils = {
meta = {
description = lib.options.create {
@ -33,7 +32,10 @@ in {
platforms = lib.options.create {
type = lib.types.list.of lib.types.string;
description = "Platforms the package supports.";
default.value = ["i686-linux"];
default.value = [
"x86_64-linux"
"i686-linux"
];
};
};
@ -87,7 +89,8 @@ in {
cd findutils-${cfg.version}
# Configure
bash ./configure \
chmod +x ./configure
./configure \
--prefix=$out \
--build=${platform.build} \
--host=${platform.host} \

View file

@ -1,14 +1,13 @@
{
lib,
config,
}: let
{ lib, config }:
let
cfg = config.aux.foundation.stages.stage2.gawk;
platform = config.aux.platform;
builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1;
in {
in
{
options.aux.foundation.stages.stage2.gawk = {
meta = {
description = lib.options.create {
@ -33,7 +32,10 @@ in {
platforms = lib.options.create {
type = lib.types.list.of lib.types.string;
description = "Platforms the package supports.";
default.value = ["i686-linux"];
default.value = [
"x86_64-linux"
"i686-linux"
];
};
mainProgram = lib.options.create {
@ -93,7 +95,8 @@ in {
cd gawk-${cfg.version}
# Configure
bash ./configure \
chmod +x ./configure
./configure \
--prefix=$out \
--build=${platform.build} \
--host=${platform.host} \

View file

@ -1,14 +1,13 @@
{
lib,
config,
}: let
{ lib, config }:
let
cfg = config.aux.foundation.stages.stage2.gcc;
platform = config.aux.platform;
builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1;
in {
in
{
options.aux.foundation.stages.stage2.gcc = {
meta = {
description = lib.options.create {
@ -33,7 +32,10 @@ in {
platforms = lib.options.create {
type = lib.types.list.of lib.types.string;
description = "Platforms the package supports.";
default.value = ["i686-linux"];
default.value = [
"x86_64-linux"
"i686-linux"
];
};
};
@ -192,7 +194,8 @@ in {
export CFLAGS_FOR_TARGET="-Wl,-dynamic-linker -Wl,${stage1.musl.package}/lib/libc.so"
export LIBRARY_PATH="${stage1.musl.package}/lib"
bash ./configure \
chmod +x ./configure
./configure \
--prefix=$out \
--build=${platform.build} \
--host=${platform.host} \

View file

@ -1,7 +1,5 @@
{
lib,
config,
}: let
{ lib, config }:
let
cfg = config.aux.foundation.stages.stage2.glibc;
platform = config.aux.platform;
@ -9,7 +7,8 @@
stage1 = config.aux.foundation.stages.stage1;
stage2 = config.aux.foundation.stages.stage2;
in {
in
{
options.aux.foundation.stages.stage2.glibc = {
meta = {
description = lib.options.create {
@ -34,7 +33,10 @@ in {
platforms = lib.options.create {
type = lib.types.list.of lib.types.string;
description = "Platforms the package supports.";
default.value = ["i686-linux"];
default.value = [
"x86_64-linux"
"i686-linux"
];
};
};
@ -92,7 +94,8 @@ in {
cd build
# libstdc++.so is built against musl and fails to link
export CXX=false
bash ../configure \
chmod +x ../configure
../configure \
--prefix=$out \
--build=${platform.build} \
--host=${platform.host} \

View file

@ -1,14 +1,13 @@
{
lib,
config,
}: let
{ lib, config }:
let
cfg = config.aux.foundation.stages.stage2.gnugrep;
platform = config.aux.platform;
builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1;
in {
in
{
options.aux.foundation.stages.stage2.gnugrep = {
meta = {
description = lib.options.create {
@ -33,7 +32,10 @@ in {
platforms = lib.options.create {
type = lib.types.list.of lib.types.string;
description = "Platforms the package supports.";
default.value = ["i686-linux"];
default.value = [
"x86_64-linux"
"i686-linux"
];
};
mainProgram = lib.options.create {
@ -92,7 +94,8 @@ in {
cd grep-${cfg.version}
# Configure
bash ./configure \
chmod +x ./configure
./configure \
--prefix=$out \
--build=${platform.build} \
--host=${platform.host} \

View file

@ -1,7 +1,5 @@
{
lib,
config,
}: let
{ lib, config }:
let
cfg = config.aux.foundation.stages.stage2.gnumake;
platform = config.aux.platform;
@ -9,7 +7,8 @@
stage1 = config.aux.foundation.stages.stage1;
stage2 = config.aux.foundation.stages.stage2;
in {
in
{
options.aux.foundation.stages.stage2.gnumake = {
meta = {
description = lib.options.create {
@ -34,7 +33,10 @@ in {
platforms = lib.options.create {
type = lib.types.list.of lib.types.string;
description = "Platforms the package supports.";
default.value = ["i686-linux"];
default.value = [
"x86_64-linux"
"i686-linux"
];
};
};
@ -63,16 +65,17 @@ in {
sha256 = "3Rb7HWe/q3mnL16DkHNcSePo5wtJRaFasfgd23hlj7M=";
};
package = let
patches = [
# Replaces /bin/sh with sh, see patch file for reasoning
./patches/0001-No-impure-bin-sh.patch
# Purity: don't look for library dependencies (of the form `-lfoo') in /lib
# and /usr/lib. It's a stupid feature anyway. Likewise, when searching for
# included Makefiles, don't look in /usr/include and friends.
./patches/0002-remove-impure-dirs.patch
];
in
package =
let
patches = [
# Replaces /bin/sh with sh, see patch file for reasoning
./patches/0001-No-impure-bin-sh.patch
# Purity: don't look for library dependencies (of the form `-lfoo') in /lib
# and /usr/lib. It's a stupid feature anyway. Likewise, when searching for
# included Makefiles, don't look in /usr/include and friends.
./patches/0002-remove-impure-dirs.patch
];
in
builders.bash.boot.build {
name = "gnumake-static-${cfg.version}";
@ -102,7 +105,8 @@ in {
${lib.strings.concatMapSep "\n" (file: "patch -Np1 -i ${file}") patches}
# Configure
bash ./configure \
chmod +x ./configure
./configure \
--prefix=$out \
--build=${platform.build} \
--host=${platform.host} \

View file

@ -1,14 +1,13 @@
{
lib,
config,
}: let
{ lib, config }:
let
cfg = config.aux.foundation.stages.stage2.gnupatch;
platform = config.aux.platform;
builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1;
in {
in
{
options.aux.foundation.stages.stage2.gnupatch = {
meta = {
description = lib.options.create {
@ -33,7 +32,10 @@ in {
platforms = lib.options.create {
type = lib.types.list.of lib.types.string;
description = "Platforms the package supports.";
default.value = ["i686-linux"];
default.value = [
"x86_64-linux"
"i686-linux"
];
};
};
@ -88,7 +90,8 @@ in {
cd patch-${cfg.version}
# Configure
bash ./configure \
chmod +x ./configure
./configure \
--prefix=$out \
--build=${platform.build} \
--host=${platform.host} \

View file

@ -1,14 +1,13 @@
{
lib,
config,
}: let
{ lib, config }:
let
cfg = config.aux.foundation.stages.stage2.gnused;
platform = config.aux.platform;
builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1;
in {
in
{
options.aux.foundation.stages.stage2.gnused = {
meta = {
description = lib.options.create {
@ -33,7 +32,10 @@ in {
platforms = lib.options.create {
type = lib.types.list.of lib.types.string;
description = "Platforms the package supports.";
default.value = ["i686-linux"];
default.value = [
"x86_64-linux"
"i686-linux"
];
};
mainProgram = lib.options.create {
@ -94,7 +96,8 @@ in {
cd sed-${cfg.version}
# Configure
bash ./configure \
chmod +x ./configure
./configure \
--prefix=$out \
--build=${platform.build} \
--host=${platform.host} \

View file

@ -1,14 +1,13 @@
{
lib,
config,
}: let
{ lib, config }:
let
cfg = config.aux.foundation.stages.stage2.gnutar;
platform = config.aux.platform;
builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1;
in {
in
{
options.aux.foundation.stages.stage2.gnutar = {
meta = {
description = lib.options.create {
@ -33,7 +32,10 @@ in {
platforms = lib.options.create {
type = lib.types.list.of lib.types.string;
description = "Platforms the package supports.";
default.value = ["i686-linux"];
default.value = [
"x86_64-linux"
"i686-linux"
];
};
mainProgram = lib.options.create {
@ -93,7 +95,8 @@ in {
cd tar-${cfg.version}
# Configure
bash ./configure \
chmod +x ./configure
./configure \
--prefix=$out \
--build=${platform.build} \
--host=${platform.host} \

View file

@ -1,14 +1,13 @@
{
lib,
config,
}: let
{ lib, config }:
let
cfg = config.aux.foundation.stages.stage2.gzip;
platform = config.aux.platform;
builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1;
in {
in
{
options.aux.foundation.stages.stage2.gzip = {
meta = {
description = lib.options.create {
@ -33,7 +32,10 @@ in {
platforms = lib.options.create {
type = lib.types.list.of lib.types.string;
description = "Platforms the package supports.";
default.value = ["i686-linux"];
default.value = [
"x86_64-linux"
"i686-linux"
];
};
};
@ -86,7 +88,8 @@ in {
cd gzip-${cfg.version}
# Configure
bash ./configure \
chmod +x ./configure
./configure \
--prefix=$out \
--build=${platform.build} \
--host=${platform.host} \

View file

@ -1,7 +1,5 @@
{
lib,
config,
}: let
{ lib, config }:
let
cfg = config.aux.foundation.stages.stage2.patchelf;
platform = config.aux.platform;
@ -9,7 +7,8 @@
stage1 = config.aux.foundation.stages.stage1;
stage2 = config.aux.foundation.stages.stage2;
in {
in
{
options.aux.foundation.stages.stage2.patchelf = {
meta = {
description = lib.options.create {
@ -34,7 +33,10 @@ in {
platforms = lib.options.create {
type = lib.types.list.of lib.types.string;
description = "Platforms the package supports.";
default.value = ["i686-linux"];
default.value = [
"x86_64-linux"
"i686-linux"
];
};
};
@ -87,7 +89,8 @@ in {
cd patchelf-${cfg.version}
# Configure
bash ./configure \
chmod +x ./configure
./configure \
--prefix=$out \
--build=${platform.build} \
--host=${platform.host} \

View file

@ -2,7 +2,7 @@
options.aux = {
system = lib.options.create {
type = lib.types.string;
default.value = "i686-linux";
default.value = "x86_64-linux";
description = ''
The system to build packages for. This value can be provided as either
`config.aux.system` or by setting the `system` argument for modules.