forked from auxolotl/labs
Compare commits
3 commits
b67847e7eb
...
ef2df44dd8
| Author | SHA1 | Date | |
|---|---|---|---|
| ef2df44dd8 | |||
| 238dddb970 | |||
| f9b7a00988 |
51 changed files with 263 additions and 423 deletions
|
|
@ -25,12 +25,8 @@ in
|
|||
phasesWithHooks =
|
||||
let
|
||||
all = lib.lists.flatten [
|
||||
hooks.build.build
|
||||
hooks.build.host
|
||||
hooks.build.target
|
||||
hooks.host.host
|
||||
hooks.host.target
|
||||
hooks.target.target
|
||||
hooks.build
|
||||
hooks.host
|
||||
];
|
||||
in
|
||||
builtins.foldl' (
|
||||
|
|
@ -62,13 +58,11 @@ in
|
|||
"${foundation.stage2-bash}/bin/bash"
|
||||
else if system == "x86_64-linux" then
|
||||
"${
|
||||
(lib.packages.build packages.foundation.bash.versions."5.2.15-stage1" "i686-linux" system system)
|
||||
.package
|
||||
(lib.packages.build packages.foundation.bash.versions."5.2.15-stage1" "i686-linux" system).package
|
||||
}/bin/bash"
|
||||
else
|
||||
"${
|
||||
(lib.packages.build packages.foundation.bash.versions."5.2.15-stage1" "x86_64-linux" system system)
|
||||
.package
|
||||
(lib.packages.build packages.foundation.bash.versions."5.2.15-stage1" "x86_64-linux" system).package
|
||||
}/bin/bash";
|
||||
|
||||
built = builtins.derivation (
|
||||
|
|
@ -86,28 +80,20 @@ in
|
|||
PATH =
|
||||
let
|
||||
bins = lib.paths.bin (
|
||||
(lib.packages.dependencies.get dependencies.build.build)
|
||||
++ (lib.packages.dependencies.get dependencies.build.host)
|
||||
++ (lib.packages.dependencies.get dependencies.build.target)
|
||||
++ (lib.packages.dependencies.get dependencies.host.host)
|
||||
++ (lib.packages.dependencies.get dependencies.host.target)
|
||||
++ (lib.packages.dependencies.get dependencies.target.target)
|
||||
(lib.packages.dependencies.get dependencies.build)
|
||||
++ (lib.packages.dependencies.get dependencies.host)
|
||||
++ lib.lists.when (system == "i686-linux") [
|
||||
foundation.stage2-bash
|
||||
foundation.stage2-coreutils
|
||||
]
|
||||
++ lib.lists.when (system == "x86_64-linux") [
|
||||
(lib.packages.build packages.foundation.bash.versions."5.2.15-stage1" "i686-linux" system system)
|
||||
.package
|
||||
(lib.packages.build packages.foundation.coreutils.versions."9.4-stage1" "i686-linux" system system)
|
||||
.package
|
||||
(lib.packages.build packages.foundation.bash.versions."5.2.15-stage1" "i686-linux" system).package
|
||||
(lib.packages.build packages.foundation.coreutils.versions."9.4-stage1" "i686-linux" system).package
|
||||
]
|
||||
++ lib.lists.when (system != "i686-linux" && system != "x86_64-linux") [
|
||||
(lib.packages.build packages.foundation.bash.versions."5.2.15-stage1" "x86_64-linux" system system)
|
||||
(lib.packages.build packages.foundation.bash.versions."5.2.15-stage1" "x86_64-linux" system).package
|
||||
(lib.packages.build packages.foundation.coreutils.versions."9.4-stage1" "x86_64-linux" system)
|
||||
.package
|
||||
(lib.packages.build packages.foundation.coreutils.versions."9.4-stage1" "x86_64-linux" system
|
||||
system
|
||||
).package
|
||||
]
|
||||
);
|
||||
in
|
||||
|
|
@ -165,7 +151,7 @@ in
|
|||
Review the phases printed above and resolve the cycle to proceed.
|
||||
|
||||
TIP: This can happen when you have two of the same dependency added as different dependencies
|
||||
such as `build.build` and `build.host`.
|
||||
such as `build` and `host`.
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,8 +15,7 @@ in
|
|||
builtins.map (dependency: dependency.package) available;
|
||||
|
||||
build =
|
||||
build: host: target:
|
||||
builtins.mapAttrs (name: dep: (lib.packages.resolve dep).packages.${build}.${host}.${target});
|
||||
build: host: builtins.mapAttrs (name: dep: (lib.packages.resolve dep).packages.${build}.${host});
|
||||
|
||||
collect =
|
||||
package:
|
||||
|
|
@ -32,31 +31,13 @@ in
|
|||
let
|
||||
dependency = lib.packages.resolve dep;
|
||||
deps = {
|
||||
build = {
|
||||
build =
|
||||
getPropagatedDependencies dependency.deps.build.build ++ process dependency.deps.build.build;
|
||||
host = getPropagatedDependencies dependency.deps.build.host ++ process dependency.deps.build.host;
|
||||
target =
|
||||
getPropagatedDependencies dependency.deps.build.target ++ process dependency.deps.build.target;
|
||||
};
|
||||
host = {
|
||||
host = getPropagatedDependencies dependency.deps.host.host ++ process dependency.deps.host.host;
|
||||
target =
|
||||
getPropagatedDependencies dependency.deps.host.target ++ process dependency.deps.host.target;
|
||||
};
|
||||
target = {
|
||||
target =
|
||||
getPropagatedDependencies dependency.deps.target.target ++ process dependency.deps.target.target;
|
||||
};
|
||||
build = getPropagatedDependencies dependency.deps.build ++ process dependency.deps.build;
|
||||
host = getPropagatedDependencies dependency.deps.host ++ process dependency.deps.host;
|
||||
};
|
||||
in
|
||||
lib.lists.flatten [
|
||||
deps.build.build
|
||||
deps.build.host
|
||||
deps.build.target
|
||||
deps.host.host
|
||||
deps.host.target
|
||||
deps.target.target
|
||||
deps.build
|
||||
deps.host
|
||||
];
|
||||
|
||||
propagated = lib.attrs.mapToList getDeps dependencies;
|
||||
|
|
@ -66,28 +47,8 @@ in
|
|||
withoutNulls = deps: builtins.filter (dep: dep != null) deps;
|
||||
in
|
||||
{
|
||||
build = {
|
||||
build = withoutNulls (
|
||||
builtins.attrValues package.deps.build.build ++ process package.deps.build.build
|
||||
);
|
||||
host = withoutNulls (
|
||||
builtins.attrValues package.deps.build.host ++ process package.deps.build.host
|
||||
);
|
||||
target = withoutNulls (
|
||||
builtins.attrValues package.deps.build.target ++ process package.deps.build.target
|
||||
);
|
||||
};
|
||||
host = {
|
||||
host = withoutNulls (builtins.attrValues package.deps.host.host ++ process package.deps.host.host);
|
||||
target = withoutNulls (
|
||||
builtins.attrValues package.deps.host.target ++ process package.deps.host.target
|
||||
);
|
||||
};
|
||||
target = {
|
||||
target = withoutNulls (
|
||||
builtins.attrValues package.deps.target.target ++ process package.deps.target.target
|
||||
);
|
||||
};
|
||||
build = withoutNulls (builtins.attrValues package.deps.build ++ process package.deps.build);
|
||||
host = withoutNulls (builtins.attrValues package.deps.host ++ process package.deps.host);
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -119,7 +80,6 @@ in
|
|||
type = lib.types.enum [
|
||||
"build"
|
||||
"host"
|
||||
"target"
|
||||
];
|
||||
writable = false;
|
||||
default.value = path;
|
||||
|
|
@ -134,15 +94,11 @@ in
|
|||
result.config;
|
||||
|
||||
build = process "build" [
|
||||
collected.build.build
|
||||
collected.build.host
|
||||
collected.build.target
|
||||
collected.build
|
||||
];
|
||||
host = process "host" [
|
||||
collected.host.host
|
||||
collected.host.target
|
||||
collected.host
|
||||
];
|
||||
target = process "target" [ collected.target.target ];
|
||||
in
|
||||
build
|
||||
// host
|
||||
|
|
@ -150,7 +106,6 @@ in
|
|||
inherit
|
||||
build
|
||||
host
|
||||
target
|
||||
package
|
||||
;
|
||||
|
||||
|
|
@ -190,36 +145,12 @@ in
|
|||
hooks;
|
||||
in
|
||||
{
|
||||
build = {
|
||||
build = process [
|
||||
"build"
|
||||
"build"
|
||||
];
|
||||
host = process [
|
||||
"build"
|
||||
"host"
|
||||
];
|
||||
target = process [
|
||||
"build"
|
||||
"target"
|
||||
];
|
||||
};
|
||||
host = {
|
||||
host = process [
|
||||
"host"
|
||||
"host"
|
||||
];
|
||||
target = process [
|
||||
"host"
|
||||
"target"
|
||||
];
|
||||
};
|
||||
target = {
|
||||
target = process [
|
||||
"target"
|
||||
"target"
|
||||
];
|
||||
};
|
||||
build = process [
|
||||
"build"
|
||||
];
|
||||
host = process [
|
||||
"host"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -263,7 +194,7 @@ in
|
|||
alias;
|
||||
|
||||
build =
|
||||
alias: build: host: target:
|
||||
alias: build: host:
|
||||
let
|
||||
package = lib.packages.resolve alias;
|
||||
|
||||
|
|
@ -277,36 +208,34 @@ in
|
|||
|
||||
buildSystem = lib.systems.withBuildInfo build;
|
||||
hostSystem = lib.systems.withBuildInfo host;
|
||||
targetSystem = lib.systems.withBuildInfo target;
|
||||
|
||||
platform = {
|
||||
build = lib.modules.override 75 build;
|
||||
host = lib.modules.override 75 host;
|
||||
target = lib.modules.override 75 target;
|
||||
};
|
||||
|
||||
built = package.extendTemporarily {
|
||||
inherit platform;
|
||||
};
|
||||
|
||||
support = lib.packages.supports package buildSystem.double hostSystem.double targetSystem.double;
|
||||
support = lib.packages.supports package buildSystem.double hostSystem.double;
|
||||
|
||||
result =
|
||||
if !support.compatible then
|
||||
builtins.throw "📦 [Aux Tidepool] Package `${identifier}` does not support the platform build=${buildSystem.double}, host=${hostSystem.double}, target=${targetSystem.double}."
|
||||
builtins.throw "📦 [Aux Tidepool] Package `${identifier}` does not support the platform build=${buildSystem.double}, host=${hostSystem.double}"
|
||||
else if support.broken then
|
||||
builtins.throw "📦 [Aux Tidepool] Package `${identifier}` is marked as broken and cannot be built."
|
||||
else
|
||||
built;
|
||||
in
|
||||
builtins.addErrorContext "📦 [Aux Tidepool] while building package `${identifier}` for platform build=${buildSystem.double}, host=${hostSystem.double}, target=${targetSystem.double}." result;
|
||||
builtins.addErrorContext "📦 [Aux Tidepool] while building package `${identifier}` for platform build=${buildSystem.double}, host=${hostSystem.double}" result;
|
||||
|
||||
supports =
|
||||
alias: build: host: target:
|
||||
alias: build: host:
|
||||
let
|
||||
package = lib.packages.resolve alias;
|
||||
matches = builtins.filter (
|
||||
platform: platform.build == build && platform.host == host && platform.target == target
|
||||
platform: platform.build == build && platform.host == host
|
||||
) package.platforms;
|
||||
in
|
||||
{
|
||||
|
|
|
|||
|
|
@ -12,31 +12,26 @@ in
|
|||
# {
|
||||
# build = "x86_64-linux";
|
||||
# host = "x86_64-linux";
|
||||
# target = "x86_64-linux";
|
||||
# }
|
||||
#
|
||||
# {
|
||||
# build = "*";
|
||||
# host = "*";
|
||||
# target = "@host";
|
||||
# }
|
||||
#
|
||||
# {
|
||||
# build = "*";
|
||||
# host = ["x86_64-linux", "aarch64-linux"];
|
||||
# target = "@host";
|
||||
# }
|
||||
#
|
||||
# [
|
||||
# {
|
||||
# build = "*";
|
||||
# host = ["x86_64-linux", "aarch64-linux"];
|
||||
# target = "@host";
|
||||
# }
|
||||
# {
|
||||
# build = "i686-linux";
|
||||
# host = "@build";
|
||||
# target = "@host";
|
||||
# }
|
||||
# ]
|
||||
#
|
||||
|
|
@ -51,24 +46,13 @@ in
|
|||
let
|
||||
build = lib.platforms.expand spec spec.build;
|
||||
host = lib.platforms.expand spec spec.host;
|
||||
target = lib.platforms.expand spec spec.target;
|
||||
in
|
||||
builtins.concatMap (
|
||||
build:
|
||||
builtins.concatMap (
|
||||
host:
|
||||
builtins.map (target: {
|
||||
build = build;
|
||||
host = if host == "@build" then build else host;
|
||||
target =
|
||||
if target == "@host" then
|
||||
if host == "@build" then build else host
|
||||
else if target == "@build" then
|
||||
build
|
||||
else
|
||||
target;
|
||||
}) target
|
||||
) host
|
||||
builtins.map (host: {
|
||||
build = build;
|
||||
host = if host == "@build" then build else host;
|
||||
}) host
|
||||
) build
|
||||
) specs
|
||||
);
|
||||
|
|
|
|||
|
|
@ -293,8 +293,7 @@ in
|
|||
|
||||
platforms = {
|
||||
build = lib.types.attrs.of lib.types.platforms.host;
|
||||
host = lib.types.attrs.of lib.types.platforms.target;
|
||||
target = lib.types.attrs.of (lib.types.attrs.of lib.types.platforms.alias);
|
||||
host = lib.types.attrs.of lib.types.platforms.host;
|
||||
alias = lib.types.submodule {
|
||||
options = {
|
||||
stable = lib.options.create {
|
||||
|
|
@ -331,12 +330,6 @@ in
|
|||
type = lib.types.string;
|
||||
default.value = "@build";
|
||||
};
|
||||
|
||||
target = lib.options.create {
|
||||
description = "The target platform for the package.";
|
||||
type = lib.types.string;
|
||||
default.value = "@host";
|
||||
};
|
||||
};
|
||||
}
|
||||
);
|
||||
|
|
@ -491,49 +484,18 @@ in
|
|||
};
|
||||
|
||||
deps =
|
||||
build: host: target:
|
||||
build: host:
|
||||
lib.types.submodule {
|
||||
options = {
|
||||
build = {
|
||||
build = lib.options.create {
|
||||
description = "Dependencies which are created in the build environment and are executed in the build environment.";
|
||||
type = lib.types.dependencies;
|
||||
default.value = { };
|
||||
};
|
||||
|
||||
host = lib.options.create {
|
||||
description = "Dependencies which are created in the build environment and are executed in the host environment.";
|
||||
type = lib.types.dependencies;
|
||||
default.value = { };
|
||||
};
|
||||
|
||||
target = lib.options.create {
|
||||
description = "Dependencies which are created in the build environment and are executed in the target environment.";
|
||||
type = lib.types.dependencies;
|
||||
default.value = { };
|
||||
};
|
||||
build = lib.options.create {
|
||||
description = "Dependencies which are executed in the build environment.";
|
||||
type = lib.types.dependencies;
|
||||
default.value = { };
|
||||
};
|
||||
|
||||
host = {
|
||||
host = lib.options.create {
|
||||
description = "Dependencies which are executed in the host environment.";
|
||||
type = lib.types.dependencies;
|
||||
default.value = { };
|
||||
};
|
||||
|
||||
target = lib.options.create {
|
||||
description = "Dependencies which are executed in the host environment which produces code for the target environment.";
|
||||
type = lib.types.dependencies;
|
||||
default.value = { };
|
||||
};
|
||||
};
|
||||
|
||||
target = {
|
||||
target = lib.options.create {
|
||||
description = "Dependencies which are executed in the target environment.";
|
||||
type = lib.types.dependencies;
|
||||
default.value = { };
|
||||
};
|
||||
host = lib.options.create {
|
||||
description = "Dependencies which are executed in the host environment.";
|
||||
type = lib.types.dependencies;
|
||||
default.value = { };
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
@ -546,7 +508,6 @@ in
|
|||
let
|
||||
build = config.platform.build;
|
||||
host = config.platform.host;
|
||||
target = config.platform.target;
|
||||
in
|
||||
{
|
||||
options = {
|
||||
|
|
@ -728,12 +689,6 @@ in
|
|||
type = lib.types.string;
|
||||
default.value = initial.host or "x86_64-linux";
|
||||
};
|
||||
|
||||
target = lib.options.create {
|
||||
description = "The target platform for the package.";
|
||||
type = lib.types.string;
|
||||
default.value = initial.target or "x86_64-linux";
|
||||
};
|
||||
};
|
||||
|
||||
name = lib.options.create {
|
||||
|
|
@ -815,11 +770,7 @@ in
|
|||
type = lib.types.raw;
|
||||
writable = false;
|
||||
default.value = lib.attrs.generate lib.systems.doubles.all (
|
||||
build:
|
||||
lib.attrs.generate lib.systems.doubles.all (
|
||||
host:
|
||||
lib.attrs.generate lib.systems.doubles.all (target: lib.packages.build config build host target)
|
||||
)
|
||||
build: lib.attrs.generate lib.systems.doubles.all (host: lib.packages.build config build host)
|
||||
);
|
||||
};
|
||||
|
||||
|
|
@ -857,21 +808,11 @@ in
|
|||
|
||||
deps = lib.options.create {
|
||||
description = "The dependencies for the package.";
|
||||
type = deps build host target;
|
||||
type = deps build host;
|
||||
default.value = { };
|
||||
apply = value: {
|
||||
build = {
|
||||
build = lib.packages.dependencies.build build build build value.build.build;
|
||||
host = lib.packages.dependencies.build build build host value.build.host;
|
||||
target = lib.packages.dependencies.build build build target value.build.target;
|
||||
};
|
||||
host = {
|
||||
host = lib.packages.dependencies.build build host host value.host.host;
|
||||
target = lib.packages.dependencies.build build host target value.host.target;
|
||||
};
|
||||
target = {
|
||||
target = lib.packages.dependencies.build build target target value.target.target;
|
||||
};
|
||||
build = lib.packages.dependencies.build build build value.build;
|
||||
host = lib.packages.dependencies.build build host value.host;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -13,17 +13,14 @@ in
|
|||
{
|
||||
build = "i686-linux";
|
||||
host = "i686-linux";
|
||||
target = "i686-linux";
|
||||
}
|
||||
{
|
||||
build = "i686-linux";
|
||||
host = "x86_64-linux";
|
||||
target = "i686-linux";
|
||||
}
|
||||
{
|
||||
build = "i686-linux";
|
||||
host = "x86_64-linux";
|
||||
target = "x86_64-linux";
|
||||
}
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -17,17 +17,14 @@ in
|
|||
{
|
||||
build = "i686-linux";
|
||||
host = "i686-linux";
|
||||
target = "i686-linux";
|
||||
}
|
||||
{
|
||||
build = "i686-linux";
|
||||
host = "x86_64-linux";
|
||||
target = "i686-linux";
|
||||
}
|
||||
{
|
||||
build = "i686-linux";
|
||||
host = "x86_64-linux";
|
||||
target = "x86_64-linux";
|
||||
}
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -17,22 +17,18 @@ in
|
|||
{
|
||||
build = "i686-linux";
|
||||
host = "i686-linux";
|
||||
target = "i686-linux";
|
||||
}
|
||||
{
|
||||
build = "i686-linux";
|
||||
host = "i686-linux";
|
||||
target = "x86_64-linux";
|
||||
}
|
||||
{
|
||||
build = "i686-linux";
|
||||
host = "x86_64-linux";
|
||||
target = "i686-linux";
|
||||
}
|
||||
{
|
||||
build = "i686-linux";
|
||||
host = "x86_64-linux";
|
||||
target = "x86_64-linux";
|
||||
}
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ let
|
|||
"x86_64-linux"
|
||||
);
|
||||
host = lib.modules.overrides.force config.platform.host;
|
||||
target = lib.modules.overrides.force config.platform.target;
|
||||
};
|
||||
};
|
||||
in
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ let
|
|||
platform = {
|
||||
build = lib.systems.withBuildInfo config.platform.build;
|
||||
host = lib.systems.withBuildInfo config.platform.host;
|
||||
target = lib.systems.withBuildInfo config.platform.target;
|
||||
};
|
||||
in
|
||||
{
|
||||
|
|
|
|||
|
|
@ -10,19 +10,31 @@ let
|
|||
package = packages.foundation.binutils.versions."2.41-stage1".extend {
|
||||
platform = {
|
||||
build = lib.modules.overrides.force (
|
||||
if config.platform.build != config.platform.target then
|
||||
config.platform.build
|
||||
else if config.platform.build == "x86_64-linux" || config.platform.build == "i686-linux" then
|
||||
if config.platform.build == "x86_64-linux" || config.platform.build == "i686-linux" then
|
||||
"i686-linux"
|
||||
else
|
||||
"x86_64-linux"
|
||||
config.platform.build
|
||||
);
|
||||
host = lib.modules.overrides.force config.platform.host;
|
||||
target = lib.modules.overrides.force config.platform.target;
|
||||
};
|
||||
inherit (config) settings;
|
||||
};
|
||||
in
|
||||
{
|
||||
options = {
|
||||
settings = {
|
||||
target = lib.options.create {
|
||||
type = lib.types.nullish lib.types.string;
|
||||
default.value = null;
|
||||
};
|
||||
allTargets = lib.options.create {
|
||||
description = "Include all targets (dramatically increases size of binaries).";
|
||||
type = lib.types.bool;
|
||||
default.value = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
meta = {
|
||||
description = "Tools for manipulating binaries (linker, assembler, etc.)";
|
||||
|
|
@ -35,10 +47,6 @@ in
|
|||
build = "@linux";
|
||||
host = "@linux";
|
||||
}
|
||||
{
|
||||
build = "@linux";
|
||||
target = "@linux";
|
||||
}
|
||||
];
|
||||
|
||||
builder = builders.foundation.passthrough.extend {
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ let
|
|||
platform = {
|
||||
build = lib.systems.withBuildInfo config.platform.build;
|
||||
host = lib.systems.withBuildInfo config.platform.host;
|
||||
target = lib.systems.withBuildInfo config.platform.target;
|
||||
};
|
||||
|
||||
version = lib.strings.removeSuffix "-stage1" config.version;
|
||||
|
|
@ -24,7 +23,6 @@ let
|
|||
"--prefix=${builtins.placeholder "out"}"
|
||||
"--build=${platform.build.triple}"
|
||||
"--host=${platform.host.triple}"
|
||||
"--target=${platform.target.triple}"
|
||||
|
||||
"--with-sysroot=/"
|
||||
"--enable-deterministic-archives"
|
||||
|
|
@ -42,9 +40,30 @@ let
|
|||
"--with-lib-path=:"
|
||||
|
||||
"--disable-multilib"
|
||||
"--enable-64-bit-bfd"
|
||||
]
|
||||
++ lib.lists.when (config.settings.allTargets) [
|
||||
"--enable-target=all"
|
||||
]
|
||||
++ lib.lists.when (config.settings.target != null) [
|
||||
"--target=${(lib.systems.withBuildInfo config.settings.target).triple}"
|
||||
];
|
||||
in
|
||||
{
|
||||
options = {
|
||||
settings = {
|
||||
target = lib.options.create {
|
||||
type = lib.types.nullish lib.types.string;
|
||||
default.value = null;
|
||||
};
|
||||
allTargets = lib.options.create {
|
||||
description = "Include all targets (dramatically increases size of binaries).";
|
||||
type = lib.types.bool;
|
||||
default.value = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
meta = {
|
||||
description = "Tools for manipulating binaries (linker, assembler, etc.)";
|
||||
|
|
@ -55,16 +74,15 @@ in
|
|||
platforms = [
|
||||
{
|
||||
build = "i686-linux";
|
||||
target = "x86_64-linux";
|
||||
}
|
||||
{
|
||||
build = "i686-linux";
|
||||
host = "x86_64-linux";
|
||||
}
|
||||
{
|
||||
build = "x86_64-linux";
|
||||
host = "@linux";
|
||||
}
|
||||
{
|
||||
build = "x86_64-linux";
|
||||
target = "@linux";
|
||||
}
|
||||
];
|
||||
|
||||
builder = builders.foundation.basic;
|
||||
|
|
@ -75,8 +93,8 @@ in
|
|||
};
|
||||
|
||||
deps = {
|
||||
build = {
|
||||
build =
|
||||
build =
|
||||
(
|
||||
if (config.platform.build == "i686-linux") then
|
||||
{
|
||||
gnumake = packages.foundation.gnumake.versions."4.4.1-bootstrap";
|
||||
|
|
@ -108,13 +126,21 @@ in
|
|||
xz = packages.foundation.xz.versions."5.4.3-stage1-passthrough";
|
||||
gcc = packages.foundation.gcc.versions."13.2.0-stage4";
|
||||
binutils = packages.foundation.binutils.versions."2.41-stage1-passthrough";
|
||||
};
|
||||
}
|
||||
)
|
||||
// (lib.attrs.when (config.platform.build != config.platform.host) {
|
||||
gcc-cross = packages.foundation.gcc.versions."13.2.0-stage2".extend {
|
||||
target = config.platform.host;
|
||||
};
|
||||
binutils-cross = packages.foundation.binutils.versions."2.41-stage1".extend {
|
||||
settings.target = config.platform.host;
|
||||
};
|
||||
});
|
||||
|
||||
host = lib.attrs.when (config.platform.build != config.platform.host) {
|
||||
gcc = packages.foundation.gcc.versions."13.2.0-stage2";
|
||||
binutils = packages.foundation.binutils.versions."2.41-stage1";
|
||||
};
|
||||
};
|
||||
# host = lib.attrs.when (config.platform.build != config.platform.host) {
|
||||
# gcc = packages.foundation.gcc.versions."13.2.0-stage2";
|
||||
# binutils = packages.foundation.binutils.versions."2.41-stage1";
|
||||
# };
|
||||
};
|
||||
|
||||
phases = {
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ let
|
|||
"x86_64-linux"
|
||||
);
|
||||
host = lib.modules.overrides.force config.platform.host;
|
||||
target = lib.modules.overrides.force config.platform.target;
|
||||
};
|
||||
};
|
||||
in
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ let
|
|||
platform = {
|
||||
build = lib.systems.withBuildInfo config.platform.build;
|
||||
host = lib.systems.withBuildInfo config.platform.host;
|
||||
target = lib.systems.withBuildInfo config.platform.target;
|
||||
};
|
||||
in
|
||||
{
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ let
|
|||
"x86_64-linux"
|
||||
);
|
||||
host = lib.modules.overrides.force config.platform.host;
|
||||
target = lib.modules.overrides.force config.platform.target;
|
||||
};
|
||||
};
|
||||
in
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ let
|
|||
platform = {
|
||||
build = lib.systems.withBuildInfo config.platform.build;
|
||||
host = lib.systems.withBuildInfo config.platform.host;
|
||||
target = lib.systems.withBuildInfo config.platform.target;
|
||||
};
|
||||
|
||||
prefix = lib.strings.when (
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ let
|
|||
"x86_64-linux"
|
||||
);
|
||||
host = lib.modules.overrides.force config.platform.host;
|
||||
target = lib.modules.overrides.force config.platform.target;
|
||||
};
|
||||
};
|
||||
in
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ let
|
|||
platform = {
|
||||
build = lib.systems.withBuildInfo config.platform.build;
|
||||
host = lib.systems.withBuildInfo config.platform.host;
|
||||
target = lib.systems.withBuildInfo config.platform.target;
|
||||
};
|
||||
|
||||
configureFlags = [
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ let
|
|||
"x86_64-linux"
|
||||
);
|
||||
host = lib.modules.overrides.force config.platform.host;
|
||||
target = lib.modules.overrides.force config.platform.target;
|
||||
};
|
||||
};
|
||||
in
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ let
|
|||
platform = {
|
||||
build = lib.systems.withBuildInfo config.platform.build;
|
||||
host = lib.systems.withBuildInfo config.platform.host;
|
||||
target = lib.systems.withBuildInfo config.platform.target;
|
||||
};
|
||||
in
|
||||
{
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ let
|
|||
"x86_64-linux"
|
||||
);
|
||||
host = lib.modules.overrides.force config.platform.host;
|
||||
target = lib.modules.overrides.force config.platform.target;
|
||||
};
|
||||
};
|
||||
in
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ let
|
|||
platform = {
|
||||
build = lib.systems.withBuildInfo config.platform.build;
|
||||
host = lib.systems.withBuildInfo config.platform.host;
|
||||
target = lib.systems.withBuildInfo config.platform.target;
|
||||
};
|
||||
in
|
||||
{
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ let
|
|||
"x86_64-linux"
|
||||
);
|
||||
host = lib.modules.overrides.force config.platform.host;
|
||||
target = lib.modules.overrides.force config.platform.target;
|
||||
};
|
||||
};
|
||||
in
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ let
|
|||
platform = {
|
||||
build = lib.systems.withBuildInfo config.platform.build;
|
||||
host = lib.systems.withBuildInfo config.platform.host;
|
||||
target = lib.systems.withBuildInfo config.platform.target;
|
||||
};
|
||||
in
|
||||
{
|
||||
|
|
|
|||
|
|
@ -51,7 +51,6 @@ in
|
|||
}
|
||||
{
|
||||
build = "x86_64-linux";
|
||||
target = "@linux";
|
||||
}
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ let
|
|||
platform = {
|
||||
build = lib.systems.withBuildInfo config.platform.build;
|
||||
host = lib.systems.withBuildInfo config.platform.host;
|
||||
target = lib.systems.withBuildInfo config.platform.target;
|
||||
target = lib.systems.withBuildInfo config.settings.target;
|
||||
};
|
||||
|
||||
prefix = lib.strings.when (
|
||||
|
|
@ -26,13 +26,12 @@ let
|
|||
];
|
||||
|
||||
configureFlags = [
|
||||
"LDFLAGS=--static"
|
||||
"--prefix=${builtins.placeholder "out"}"
|
||||
"--build=${platform.build.triple}"
|
||||
"--host=${platform.host.triple}"
|
||||
"--target=${platform.target.triple}"
|
||||
"--with-as=${config.deps.build.target.binutils.package}/bin/${prefix}as"
|
||||
"--with-ld=${config.deps.build.target.binutils.package}/bin/${prefix}ld"
|
||||
"--with-as=${config.deps.build.binutils-cross.package}/bin/${prefix}as"
|
||||
"--with-ld=${config.deps.build.binutils-cross.package}/bin/${prefix}ld"
|
||||
"--enable-languages=c,c++"
|
||||
"--disable-bootstrap"
|
||||
"--disable-libsanitizer"
|
||||
|
|
@ -74,6 +73,12 @@ in
|
|||
type = lib.types.string;
|
||||
description = "Version of isl.";
|
||||
};
|
||||
|
||||
settings.target = lib.options.create {
|
||||
type = lib.types.string;
|
||||
default.value = "x86_64-linux";
|
||||
description = "Target of the compiler";
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
|
|
@ -86,11 +91,9 @@ in
|
|||
platforms = [
|
||||
{
|
||||
build = "i686-linux";
|
||||
target = "x86_64-linux";
|
||||
}
|
||||
{
|
||||
build = "x86_64-linux";
|
||||
target = "@linux";
|
||||
}
|
||||
];
|
||||
|
||||
|
|
@ -129,8 +132,8 @@ in
|
|||
};
|
||||
|
||||
deps = {
|
||||
build = {
|
||||
build =
|
||||
build =
|
||||
(
|
||||
if (config.platform.build == "i686-linux") then
|
||||
{
|
||||
bzip2 = packages.foundation.bzip2.versions."1.0.8-bootstrap";
|
||||
|
|
@ -162,11 +165,13 @@ in
|
|||
gzip = packages.foundation.gzip.versions."1.13-stage1-passthrough";
|
||||
xz = packages.foundation.xz.versions."5.4.3-stage1-passthrough";
|
||||
binutils = packages.foundation.binutils.versions."2.41-stage1-passthrough";
|
||||
};
|
||||
target = {
|
||||
binutils = packages.foundation.binutils.versions."2.41-stage1";
|
||||
}
|
||||
)
|
||||
// {
|
||||
binutils-cross = packages.foundation.binutils.versions."2.41-stage1".extend {
|
||||
settings.target = config.settings.target;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
hooks = ctx: {
|
||||
|
|
@ -178,12 +183,8 @@ in
|
|||
export CXX='${config.package}/bin/${prefix}g++ ${
|
||||
builtins.concatStringsSep " " (ctx.host."foundation:cflags")
|
||||
}'
|
||||
export CC_FOR_TARGET='${config.package}/bin/${prefix}gcc ${
|
||||
builtins.concatStringsSep " " (ctx.target."foundation:cflags")
|
||||
}'
|
||||
export CXX_FOR_TARGET='${config.package}/bin/${prefix}g++ ${
|
||||
builtins.concatStringsSep " " (ctx.target."foundation:cflags")
|
||||
}'
|
||||
export CC_FOR_TARGET=$CC
|
||||
export CXX_FOR_TARGET=$CXX
|
||||
alias gcc='$CC'
|
||||
alias g++='$CXX'
|
||||
'';
|
||||
|
|
@ -210,10 +211,6 @@ in
|
|||
'';
|
||||
|
||||
configure = ''
|
||||
echo "--configure: ${builtins.concatStringsSep " " configureFlags}"
|
||||
ls -la ${config.deps.build.build.binutils.package}/bin
|
||||
ls -la ${config.deps.build.build.gcc.package}/bin
|
||||
|
||||
# Configure
|
||||
mkdir build
|
||||
cd build
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ let
|
|||
platform = {
|
||||
build = lib.systems.withBuildInfo config.platform.build;
|
||||
host = lib.systems.withBuildInfo config.platform.host;
|
||||
target = lib.systems.withBuildInfo config.platform.target;
|
||||
target = lib.systems.withBuildInfo config.settings.target;
|
||||
};
|
||||
|
||||
prefix = lib.strings.when (
|
||||
|
|
@ -30,9 +30,9 @@ let
|
|||
];
|
||||
|
||||
gccFlags = [
|
||||
"-Wl,-dynamic-linker=${config.deps.target.target.glibc.dynamicLinker}"
|
||||
"-L${config.deps.target.target.glibc.package}/lib"
|
||||
"-B${config.deps.target.target.glibc.package}/lib"
|
||||
"-Wl,-dynamic-linker=${config.deps.host.glibc.dynamicLinker}"
|
||||
"-L${config.deps.host.glibc.package}/lib"
|
||||
"-B${config.deps.host.glibc.package}/lib"
|
||||
"-L${config.package.outPath}${libPrefix}/lib"
|
||||
"-B${config.package.outPath}${libPrefix}/lib"
|
||||
];
|
||||
|
|
@ -42,16 +42,16 @@ let
|
|||
"--build=${platform.build.triple}"
|
||||
"--host=${platform.host.triple}"
|
||||
"--target=${platform.target.triple}"
|
||||
"--with-as=${config.deps.build.target.binutils.package}/bin/${prefix}as"
|
||||
"--with-ld=${config.deps.build.target.binutils.package}/bin/${prefix}ld"
|
||||
"--with-as=${config.deps.build.binutils-cross.package}/bin/${prefix}as"
|
||||
"--with-ld=${config.deps.build.binutils-cross.package}/bin/${prefix}ld"
|
||||
"--enable-languages=c,c++"
|
||||
"--disable-libsanitizer"
|
||||
"--disable-lto"
|
||||
"--disable-multilib"
|
||||
"--with-headers=${config.deps.target.target.glibc.package}/include"
|
||||
"--with-headers=${config.deps.host.glibc.package}/include"
|
||||
"--with-build-sysroot=/"
|
||||
"--with-native-system-header-dir=${config.deps.target.target.glibc.package}/include"
|
||||
"--with-build-time-tools=${config.deps.build.target.binutils.package}/bin"
|
||||
"--with-native-system-header-dir=${config.deps.host.glibc.package}/include"
|
||||
"--with-build-time-tools=${config.deps.build.binutils-cross.package}/bin"
|
||||
];
|
||||
in
|
||||
{
|
||||
|
|
@ -75,6 +75,12 @@ in
|
|||
type = lib.types.string;
|
||||
description = "Version of isl.";
|
||||
};
|
||||
|
||||
settings.target = lib.options.create {
|
||||
type = lib.types.string;
|
||||
default.value = "x86_64-linux";
|
||||
description = "Target of the compiler";
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
|
|
@ -87,11 +93,9 @@ in
|
|||
platforms = [
|
||||
{
|
||||
build = "i686-linux";
|
||||
target = "x86_64-linux";
|
||||
}
|
||||
{
|
||||
build = "x86_64-linux";
|
||||
target = "@linux";
|
||||
}
|
||||
];
|
||||
|
||||
|
|
@ -130,8 +134,8 @@ in
|
|||
};
|
||||
|
||||
deps = {
|
||||
build = {
|
||||
build =
|
||||
build =
|
||||
(
|
||||
if (config.platform.build == "i686-linux") then
|
||||
{
|
||||
bzip2 = packages.foundation.bzip2.versions."1.0.8-bootstrap";
|
||||
|
|
@ -163,24 +167,25 @@ in
|
|||
gzip = packages.foundation.gzip.versions."1.13-stage1-passthrough";
|
||||
xz = packages.foundation.xz.versions."5.4.3-stage1-passthrough";
|
||||
binutils = packages.foundation.binutils.versions."2.41-stage1-passthrough";
|
||||
};
|
||||
|
||||
target = {
|
||||
binutils = packages.foundation.binutils.versions."2.41-stage1";
|
||||
}
|
||||
)
|
||||
// {
|
||||
binutils-cross = packages.foundation.binutils.versions."2.41-stage1".extend {
|
||||
settings.target = config.settings.target;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
target = {
|
||||
target = {
|
||||
glibc = packages.foundation.glibc.versions."2.38-stage1";
|
||||
host = {
|
||||
glibc = packages.foundation.glibc.versions."2.38-stage1".extend {
|
||||
platform.host = lib.modules.overrides.force config.settings.target;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
env = {
|
||||
CFLAGS_FOR_TARGET = "-Wl,-dynamic-linker -Wl,${config.deps.target.target.glibc.dynamicLinker} -B${config.deps.target.target.glibc.package}/lib";
|
||||
LDFLAGS_FOR_TARGET = "-L$(pwd)/${platform.target.triple}/libgcc -L${config.deps.target.target.glibc.package}/lib";
|
||||
LIBRARY_PATH = "${config.deps.target.target.glibc.package}/lib";
|
||||
CFLAGS_FOR_TARGET = "-Wl,-dynamic-linker -Wl,${config.deps.host.glibc.dynamicLinker} -B${config.deps.host.glibc.package}/lib";
|
||||
LDFLAGS_FOR_TARGET = "-L$(pwd)/${platform.target.triple}/libgcc -L${config.deps.host.glibc.package}/lib";
|
||||
LIBRARY_PATH = "${config.deps.host.glibc.package}/lib";
|
||||
};
|
||||
|
||||
hooks = ctx: {
|
||||
|
|
@ -192,12 +197,8 @@ in
|
|||
export CXX='${config.package}/bin/${prefix}g++ ${
|
||||
builtins.concatStringsSep " " (gccFlags ++ ctx.host."foundation:cflags")
|
||||
}'
|
||||
export CC_FOR_TARGET='${config.package}/bin/${prefix}gcc ${
|
||||
builtins.concatStringsSep " " (gccFlags ++ ctx.target."foundation:cflags")
|
||||
}'
|
||||
export CXX_FOR_TARGET='${config.package}/bin/${prefix}g++ ${
|
||||
builtins.concatStringsSep " " (gccFlags ++ ctx.target."foundation:cflags")
|
||||
}'
|
||||
export CC_FOR_TARGET=$CC
|
||||
export CXX_FOR_TARGET=$CXX
|
||||
alias gcc='$CC'
|
||||
alias g++='$CXX'
|
||||
'';
|
||||
|
|
@ -230,9 +231,9 @@ in
|
|||
|
||||
# TODO(vlinkz) Hack to fix missing crti.o and crtn.o. Figure out how to properly find their paths.
|
||||
mkdir gcc
|
||||
ln -sv ${config.deps.target.target.glibc.package}/lib/{crti.o,crtn.o} gcc
|
||||
ln -sv ${config.deps.host.glibc.package}/lib/{crti.o,crtn.o} gcc
|
||||
mkdir -p ${platform.target.triple}/libstdc++-v3/src
|
||||
ln -sv ${config.deps.target.target.glibc.package}/lib/{crti.o,crtn.o} ${platform.target.triple}/libstdc++-v3/src
|
||||
ln -sv ${config.deps.host.glibc.package}/lib/{crti.o,crtn.o} ${platform.target.triple}/libstdc++-v3/src
|
||||
|
||||
bash ../configure ${builtins.concatStringsSep " " configureFlags}
|
||||
'';
|
||||
|
|
|
|||
|
|
@ -11,10 +11,9 @@ let
|
|||
package = packages.foundation.gcc.versions."13.2.0-stage3".extend {
|
||||
platform = {
|
||||
build = lib.modules.overrides.force (
|
||||
if config.platform.target == "x86_64-linux" then "i686-linux" else "x86_64-linux"
|
||||
if config.target.triple == "x86_64-linux" then "i686-linux" else "x86_64-linux"
|
||||
);
|
||||
host = lib.modules.overrides.force config.platform.host;
|
||||
target = lib.modules.overrides.force config.platform.target;
|
||||
};
|
||||
};
|
||||
in
|
||||
|
|
|
|||
|
|
@ -14,9 +14,12 @@ let
|
|||
platform = {
|
||||
build = lib.systems.withBuildInfo config.platform.build;
|
||||
host = lib.systems.withBuildInfo config.platform.host;
|
||||
target = lib.systems.withBuildInfo config.platform.target;
|
||||
};
|
||||
|
||||
prefix = lib.strings.when (
|
||||
platform.build.triple != platform.target.triple
|
||||
) "${platform.target.triple}-";
|
||||
|
||||
patches = [
|
||||
../patches/libstdc++-target.patch
|
||||
];
|
||||
|
|
@ -25,6 +28,8 @@ let
|
|||
"-Wl,-dynamic-linker=${config.deps.host.host.glibc.dynamicLinker}"
|
||||
"-L${config.deps.host.host.glibc.package}/lib"
|
||||
"-B${config.deps.host.host.glibc.package}/lib"
|
||||
]
|
||||
++ lib.lists.when (config.platform.target == "riscv64-linux") [
|
||||
"-L${config.package.outPath}/lib"
|
||||
"-B${config.package.outPath}/lib"
|
||||
];
|
||||
|
|
@ -33,7 +38,7 @@ let
|
|||
"--prefix=${builtins.placeholder "out"}"
|
||||
"--build=${platform.build.triple}"
|
||||
"--host=${platform.host.triple}"
|
||||
"--target=${platform.target.triple}"
|
||||
"--target=${config.target.triple}"
|
||||
"--enable-languages=c,c++"
|
||||
"--disable-lto"
|
||||
"--disable-bootstrap"
|
||||
|
|
@ -65,6 +70,11 @@ in
|
|||
type = lib.types.string;
|
||||
description = "Version of isl.";
|
||||
};
|
||||
|
||||
target.triple = lib.options.create {
|
||||
type = lib.types.string;
|
||||
description = "Target of GCC";
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
|
|
@ -87,6 +97,7 @@ in
|
|||
|
||||
builder = builders.foundation.basic;
|
||||
|
||||
target.triple = config.platform.host.triple;
|
||||
gmp.version = "6.3.0";
|
||||
mpfr.version = "4.2.1";
|
||||
mpc.version = "1.3.1";
|
||||
|
|
@ -159,6 +170,9 @@ in
|
|||
|
||||
host = {
|
||||
gcc = packages.foundation.gcc.versions."13.2.0-stage2";
|
||||
};
|
||||
|
||||
target = {
|
||||
binutils = packages.foundation.binutils.versions."2.41-stage1";
|
||||
};
|
||||
};
|
||||
|
|
@ -175,6 +189,8 @@ in
|
|||
LDFLAGS_FOR_BUILD = "-L${config.deps.build.build.gcc.package}/lib -L${config.deps.build.build.glibc.package}/lib -Wl,-rpath,${config.deps.build.build.gcc.package}/lib -Wl,-rpath,${config.deps.build.build.glibc.package}/lib";
|
||||
CFLAGS_FOR_TARGET = "-Wl,-dynamic-linker -Wl,${config.deps.host.host.glibc.dynamicLinker} -B${config.deps.host.host.glibc.package}/lib";
|
||||
LDFLAGS_FOR_TARGET = "-L$(pwd)/${platform.target.triple}/libgcc -L${config.deps.host.host.glibc.package}/lib";
|
||||
CC = CC_FOR_TARGET;
|
||||
CXX = CXX_FOR_TARGET;
|
||||
CFLAGS = CFLAGS_FOR_TARGET;
|
||||
LDFLAGS = LDFLAGS_FOR_TARGET;
|
||||
LIBRARY_PATH = "${config.deps.host.host.glibc.package}/lib";
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@ let
|
|||
platform = {
|
||||
build = lib.systems.withBuildInfo config.platform.build;
|
||||
host = lib.systems.withBuildInfo config.platform.host;
|
||||
target = lib.systems.withBuildInfo config.platform.target;
|
||||
};
|
||||
|
||||
patches = [
|
||||
|
|
@ -33,7 +32,7 @@ let
|
|||
"--prefix=${builtins.placeholder "out"}"
|
||||
"--build=${platform.build.triple}"
|
||||
"--host=${platform.host.triple}"
|
||||
"--target=${platform.target.triple}"
|
||||
"--target=${config.target.triple}"
|
||||
"--enable-languages=c,c++"
|
||||
"--disable-lto"
|
||||
"--disable-bootstrap"
|
||||
|
|
@ -64,6 +63,11 @@ in
|
|||
type = lib.types.string;
|
||||
description = "Version of isl.";
|
||||
};
|
||||
|
||||
target.triple = lib.options.create {
|
||||
type = lib.types.string;
|
||||
description = "Target platform of GCC";
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
|
|
@ -77,6 +81,7 @@ in
|
|||
|
||||
builder = builders.foundation.basic;
|
||||
|
||||
target.triple = config.platform.host;
|
||||
gmp.version = "6.3.0";
|
||||
mpfr.version = "4.2.1";
|
||||
mpc.version = "1.3.1";
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ let
|
|||
platform = {
|
||||
build = lib.systems.withBuildInfo config.platform.build;
|
||||
host = lib.systems.withBuildInfo config.platform.host;
|
||||
target = lib.systems.withBuildInfo config.platform.target;
|
||||
};
|
||||
in
|
||||
{
|
||||
|
|
@ -42,26 +41,24 @@ in
|
|||
|
||||
deps = {
|
||||
build = {
|
||||
build = {
|
||||
bzip2 = packages.foundation.bzip2.versions."1.0.8-bootstrap";
|
||||
diffutils = packages.foundation.diffutils.versions."3.10-bootstrap";
|
||||
findutils = packages.foundation.findutils.versions."4.9.0-bootstrap";
|
||||
gawk = packages.foundation.gawk.versions."5.2.2-bootstrap";
|
||||
gnugrep = packages.foundation.gnugrep.versions."3.11-bootstrap";
|
||||
gnumake = packages.foundation.gnumake.versions."4.4.1-bootstrap";
|
||||
gnupatch = packages.foundation.gnupatch.versions."2.7-bootstrap";
|
||||
gnused = packages.foundation.gnused.versions."4.9-bootstrap";
|
||||
gnutar = packages.foundation.gnutar.versions."1.35-bootstrap";
|
||||
gzip = packages.foundation.gzip.versions."1.13-bootstrap";
|
||||
xz = packages.foundation.xz.versions."5.4.3-bootstrap";
|
||||
python = packages.foundation.python.versions."3.12.0-bootstrap";
|
||||
bison = packages.foundation.bison.versions."3.8.2-bootstrap";
|
||||
};
|
||||
host = {
|
||||
gcc = packages.foundation.gcc.versions."13.2.0-bootstrap";
|
||||
binutils = packages.foundation.binutils.versions."2.41-bootstrap";
|
||||
linux-headers = packages.foundation.linux-headers.versions."6.5.6-stage1";
|
||||
};
|
||||
bzip2 = packages.foundation.bzip2.versions."1.0.8-bootstrap";
|
||||
diffutils = packages.foundation.diffutils.versions."3.10-bootstrap";
|
||||
findutils = packages.foundation.findutils.versions."4.9.0-bootstrap";
|
||||
gawk = packages.foundation.gawk.versions."5.2.2-bootstrap";
|
||||
gnugrep = packages.foundation.gnugrep.versions."3.11-bootstrap";
|
||||
gnumake = packages.foundation.gnumake.versions."4.4.1-bootstrap";
|
||||
gnupatch = packages.foundation.gnupatch.versions."2.7-bootstrap";
|
||||
gnused = packages.foundation.gnused.versions."4.9-bootstrap";
|
||||
gnutar = packages.foundation.gnutar.versions."1.35-bootstrap";
|
||||
gzip = packages.foundation.gzip.versions."1.13-bootstrap";
|
||||
xz = packages.foundation.xz.versions."5.4.3-bootstrap";
|
||||
python = packages.foundation.python.versions."3.12.0-bootstrap";
|
||||
bison = packages.foundation.bison.versions."3.8.2-bootstrap";
|
||||
gcc = packages.foundation.gcc.versions."13.2.0-bootstrap";
|
||||
binutils = packages.foundation.binutils.versions."2.41-bootstrap";
|
||||
};
|
||||
host = {
|
||||
linux-headers = packages.foundation.linux-headers.versions."6.5.6-stage1";
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -81,8 +78,8 @@ in
|
|||
--prefix=$out \
|
||||
--build=${platform.build.triple} \
|
||||
--host=${platform.host.triple} \
|
||||
--with-headers=${config.deps.build.host.linux-headers.package}/include \
|
||||
--with-binutils=${config.deps.build.host.binutils.package}/${platform.target.triple}/bin
|
||||
--with-headers=${config.deps.host.linux-headers.package}/include \
|
||||
--with-binutils=${config.deps.build.binutils.package}/bin
|
||||
'';
|
||||
|
||||
build = ''
|
||||
|
|
@ -93,7 +90,7 @@ in
|
|||
install = ''
|
||||
# Install
|
||||
make -j $NIX_BUILD_CORES install
|
||||
ln -sv $(ls -d ${config.deps.build.host.linux-headers.package}/include/* | grep -v scsi\$) $out/include/
|
||||
ln -sv $(ls -d ${config.deps.host.linux-headers.package}/include/* | grep -v scsi\$) $out/include/
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -10,15 +10,12 @@ let
|
|||
package = packages.foundation.glibc.versions."2.38-stage1".extend {
|
||||
platform = {
|
||||
build = lib.modules.overrides.force (
|
||||
if config.platform.build != config.platform.target then
|
||||
config.platform.build
|
||||
else if config.platform.build == "x86_64-linux" || config.platform.build == "i686-linux" then
|
||||
if config.platform.build == "x86_64-linux" || config.platform.build == "i686-linux" then
|
||||
"i686-linux"
|
||||
else
|
||||
"x86_64-linux"
|
||||
config.platform.build
|
||||
);
|
||||
host = lib.modules.overrides.force config.platform.host;
|
||||
target = lib.modules.overrides.force config.platform.target;
|
||||
};
|
||||
};
|
||||
in
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ let
|
|||
platform = {
|
||||
build = lib.systems.withBuildInfo config.platform.build;
|
||||
host = lib.systems.withBuildInfo config.platform.host;
|
||||
target = lib.systems.withBuildInfo config.platform.target;
|
||||
};
|
||||
in
|
||||
{
|
||||
|
|
@ -54,8 +53,8 @@ in
|
|||
};
|
||||
|
||||
deps = {
|
||||
build = {
|
||||
build =
|
||||
build =
|
||||
(
|
||||
if (config.platform.build == "i686-linux") then
|
||||
{
|
||||
bzip2 = packages.foundation.bzip2.versions."1.0.8-bootstrap";
|
||||
|
|
@ -97,25 +96,29 @@ in
|
|||
}
|
||||
// lib.attrs.when (config.platform.build != config.platform.host) {
|
||||
glibc = packages.foundation.glibc.versions."2.38-stage1-passthrough";
|
||||
};
|
||||
host = {
|
||||
linux-headers = packages.foundation.linux-headers.versions."6.5.6-stage1";
|
||||
}
|
||||
}
|
||||
)
|
||||
// lib.attrs.when (config.platform.build != config.platform.host) {
|
||||
gcc = packages.foundation.gcc.versions."13.2.0-stage1";
|
||||
binutils = packages.foundation.binutils.versions."2.41-stage1";
|
||||
gcc-cross = packages.foundation.gcc.versions."13.2.0-stage1".extend {
|
||||
settings.target = config.platform.host;
|
||||
};
|
||||
binutils-cross = packages.foundation.binutils.versions."2.41-stage1".extend {
|
||||
settings.target = config.platform.host;
|
||||
};
|
||||
};
|
||||
host = {
|
||||
linux-headers = packages.foundation.linux-headers.versions."6.5.6-stage1";
|
||||
};
|
||||
};
|
||||
|
||||
dynamicLinker =
|
||||
"${config.package.outPath}/lib/"
|
||||
+ (
|
||||
if platform.target.double == "x86_64-linux" then
|
||||
if platform.host.double == "x86_64-linux" then
|
||||
"ld-linux-x86-64.so.2"
|
||||
else if platform.target.double == "aarch64-linux" then
|
||||
else if platform.host.double == "aarch64-linux" then
|
||||
"ld-linux-aarch64.so.1"
|
||||
else if platform.target.double == "riscv64-linux" then
|
||||
else if platform.host.double == "riscv64-linux" then
|
||||
"ld-linux-riscv64-lp64d.so.1"
|
||||
else
|
||||
"ld-linux.so.2"
|
||||
|
|
@ -134,10 +137,10 @@ in
|
|||
"--prefix=$out"
|
||||
"--build=${platform.build.triple}"
|
||||
"--host=${platform.host.triple}"
|
||||
"--with-headers=${config.deps.build.host.linux-headers.package}/include"
|
||||
"--with-headers=${config.deps.host.linux-headers.package}/include"
|
||||
]
|
||||
++ lib.lists.when (config.platform.build != config.platform.host) [
|
||||
"--with-binutils=${config.deps.build.host.binutils.package}/${platform.target.triple}/bin"
|
||||
"--with-binutils=${config.deps.build.binutils-cross.package}/${platform.host.triple}/bin"
|
||||
]
|
||||
);
|
||||
in
|
||||
|
|
@ -166,15 +169,15 @@ in
|
|||
"make \"localedata/install-locales\" \"localedir=$out/lib/locale\""
|
||||
else
|
||||
''
|
||||
mkdir -p $TMPDIR/${config.deps.build.build.glibc.package}/lib/locale
|
||||
mkdir -p $TMPDIR/${config.deps.build.glibc.package}/lib/locale
|
||||
sed -i -e \
|
||||
's,^$(rtld-prefix) $(common-objpfx)locale/localedef,localedef --prefix=''${TMPDIR} --${platform.host.system.cpu.endian.name}-endian,' \
|
||||
../localedata/Makefile
|
||||
make SHELL='sh -x' "localedata/install-locales" "localedir=$out/lib/locale"
|
||||
cp -r $TMPDIR/${config.deps.build.build.glibc.package}/lib/locale $out/lib
|
||||
cp -r $TMPDIR/${config.deps.build.glibc.package}/lib/locale $out/lib
|
||||
''
|
||||
}
|
||||
ln -sv $(ls -d ${config.deps.build.host.linux-headers.package}/include/* | grep -v scsi\$) $out/include/
|
||||
ln -sv $(ls -d ${config.deps.host.linux-headers.package}/include/* | grep -v scsi\$) $out/include/
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ let
|
|||
"x86_64-linux"
|
||||
);
|
||||
host = lib.modules.overrides.force config.platform.host;
|
||||
target = lib.modules.overrides.force config.platform.target;
|
||||
};
|
||||
};
|
||||
in
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ let
|
|||
platform = {
|
||||
build = lib.systems.withBuildInfo config.platform.build;
|
||||
host = lib.systems.withBuildInfo config.platform.host;
|
||||
target = lib.systems.withBuildInfo config.platform.target;
|
||||
};
|
||||
in
|
||||
{
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ let
|
|||
"x86_64-linux"
|
||||
);
|
||||
host = lib.modules.overrides.force config.platform.host;
|
||||
target = lib.modules.overrides.force config.platform.target;
|
||||
};
|
||||
};
|
||||
in
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ let
|
|||
platform = {
|
||||
build = lib.systems.withBuildInfo config.platform.build;
|
||||
host = lib.systems.withBuildInfo config.platform.host;
|
||||
target = lib.systems.withBuildInfo config.platform.target;
|
||||
};
|
||||
in
|
||||
{
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ let
|
|||
"x86_64-linux"
|
||||
);
|
||||
host = lib.modules.overrides.force config.platform.host;
|
||||
target = lib.modules.overrides.force config.platform.target;
|
||||
};
|
||||
};
|
||||
in
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ let
|
|||
platform = {
|
||||
build = lib.systems.withBuildInfo config.platform.build;
|
||||
host = lib.systems.withBuildInfo config.platform.host;
|
||||
target = lib.systems.withBuildInfo config.platform.target;
|
||||
};
|
||||
|
||||
patches = [
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ let
|
|||
"x86_64-linux"
|
||||
);
|
||||
host = lib.modules.overrides.force config.platform.host;
|
||||
target = lib.modules.overrides.force config.platform.target;
|
||||
};
|
||||
};
|
||||
in
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ let
|
|||
platform = {
|
||||
build = lib.systems.withBuildInfo config.platform.build;
|
||||
host = lib.systems.withBuildInfo config.platform.host;
|
||||
target = lib.systems.withBuildInfo config.platform.target;
|
||||
};
|
||||
in
|
||||
{
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ let
|
|||
"x86_64-linux"
|
||||
);
|
||||
host = lib.modules.overrides.force config.platform.host;
|
||||
target = lib.modules.overrides.force config.platform.target;
|
||||
};
|
||||
};
|
||||
in
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ let
|
|||
platform = {
|
||||
build = lib.systems.withBuildInfo config.platform.build;
|
||||
host = lib.systems.withBuildInfo config.platform.host;
|
||||
target = lib.systems.withBuildInfo config.platform.target;
|
||||
};
|
||||
in
|
||||
{
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ let
|
|||
"x86_64-linux"
|
||||
);
|
||||
host = lib.modules.overrides.force config.platform.host;
|
||||
target = lib.modules.overrides.force config.platform.target;
|
||||
};
|
||||
};
|
||||
in
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ let
|
|||
platform = {
|
||||
build = lib.systems.withBuildInfo config.platform.build;
|
||||
host = lib.systems.withBuildInfo config.platform.host;
|
||||
target = lib.systems.withBuildInfo config.platform.target;
|
||||
};
|
||||
in
|
||||
{
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ let
|
|||
"x86_64-linux"
|
||||
);
|
||||
host = lib.modules.overrides.force config.platform.host;
|
||||
target = lib.modules.overrides.force config.platform.target;
|
||||
};
|
||||
};
|
||||
in
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ let
|
|||
platform = {
|
||||
build = lib.systems.withBuildInfo config.platform.build;
|
||||
host = lib.systems.withBuildInfo config.platform.host;
|
||||
target = lib.systems.withBuildInfo config.platform.target;
|
||||
};
|
||||
in
|
||||
{
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@ let
|
|||
"x86_64-linux"
|
||||
);
|
||||
host = lib.modules.overrides.force config.platform.host;
|
||||
target = lib.modules.overrides.force config.platform.target;
|
||||
};
|
||||
};
|
||||
in
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ let
|
|||
platform = {
|
||||
build = lib.systems.withBuildInfo config.platform.build;
|
||||
host = lib.systems.withBuildInfo config.platform.host;
|
||||
target = lib.systems.withBuildInfo config.platform.target;
|
||||
};
|
||||
in
|
||||
{
|
||||
|
|
@ -20,7 +19,7 @@ in
|
|||
|
||||
platforms = {
|
||||
build = "@linux";
|
||||
target = "@linux";
|
||||
host = "@linux";
|
||||
};
|
||||
|
||||
builder = builders.foundation.basic;
|
||||
|
|
@ -31,43 +30,38 @@ in
|
|||
};
|
||||
|
||||
deps = {
|
||||
build = {
|
||||
build =
|
||||
if (config.platform.build == "i686-linux") then
|
||||
{
|
||||
diffutils = packages.foundation.diffutils.versions."3.10-bootstrap";
|
||||
findutils = packages.foundation.findutils.versions."4.9.0-bootstrap";
|
||||
gawk = packages.foundation.gawk.versions."5.2.2-bootstrap";
|
||||
gnugrep = packages.foundation.gnugrep.versions."3.11-bootstrap";
|
||||
gnumake = packages.foundation.gnumake.versions."4.4.1-bootstrap";
|
||||
gnupatch = packages.foundation.gnupatch.versions."2.7-bootstrap";
|
||||
gnused = packages.foundation.gnused.versions."4.9-bootstrap";
|
||||
gnutar = packages.foundation.gnutar.versions."1.35-bootstrap";
|
||||
gzip = packages.foundation.gzip.versions."1.13-bootstrap";
|
||||
xz = packages.foundation.xz.versions."5.4.3-bootstrap";
|
||||
gcc = packages.foundation.gcc.versions."13.2.0-bootstrap";
|
||||
binutils = packages.foundation.binutils.versions."2.41-bootstrap";
|
||||
}
|
||||
else
|
||||
{
|
||||
diffutils = packages.foundation.diffutils.versions."3.10-stage1-passthrough";
|
||||
findutils = packages.foundation.findutils.versions."4.9.0-stage1-passthrough";
|
||||
gawk = packages.foundation.gawk.versions."5.2.2-stage1-passthrough";
|
||||
gnugrep = packages.foundation.gnugrep.versions."3.11-stage1-passthrough";
|
||||
gnumake = packages.foundation.gnumake.versions."4.4.1-stage1-passthrough";
|
||||
gnupatch = packages.foundation.gnupatch.versions."2.7-stage1-passthrough";
|
||||
gnused = packages.foundation.gnused.versions."4.9-stage1-passthrough";
|
||||
gnutar = packages.foundation.gnutar.versions."1.35-stage1-passthrough";
|
||||
gzip = packages.foundation.gzip.versions."1.13-stage1-passthrough";
|
||||
xz = packages.foundation.xz.versions."5.4.3-stage1-passthrough";
|
||||
gcc = packages.foundation.gcc.versions."13.2.0-stage4";
|
||||
binutils = packages.foundation.binutils.versions."2.41-stage1-passthrough";
|
||||
};
|
||||
host = lib.attrs.when (config.platform.build != config.platform.host) {
|
||||
gcc = packages.foundation.gcc.versions."13.2.0-stage2";
|
||||
binutils = packages.foundation.binutils.versions."2.41-stage1";
|
||||
};
|
||||
};
|
||||
build = (
|
||||
if (config.platform.build == "i686-linux") then
|
||||
{
|
||||
diffutils = packages.foundation.diffutils.versions."3.10-bootstrap";
|
||||
findutils = packages.foundation.findutils.versions."4.9.0-bootstrap";
|
||||
gawk = packages.foundation.gawk.versions."5.2.2-bootstrap";
|
||||
gnugrep = packages.foundation.gnugrep.versions."3.11-bootstrap";
|
||||
gnumake = packages.foundation.gnumake.versions."4.4.1-bootstrap";
|
||||
gnupatch = packages.foundation.gnupatch.versions."2.7-bootstrap";
|
||||
gnused = packages.foundation.gnused.versions."4.9-bootstrap";
|
||||
gnutar = packages.foundation.gnutar.versions."1.35-bootstrap";
|
||||
gzip = packages.foundation.gzip.versions."1.13-bootstrap";
|
||||
xz = packages.foundation.xz.versions."5.4.3-bootstrap";
|
||||
gcc = packages.foundation.gcc.versions."13.2.0-bootstrap";
|
||||
binutils = packages.foundation.binutils.versions."2.41-bootstrap";
|
||||
}
|
||||
else
|
||||
{
|
||||
diffutils = packages.foundation.diffutils.versions."3.10-stage1-passthrough";
|
||||
findutils = packages.foundation.findutils.versions."4.9.0-stage1-passthrough";
|
||||
gawk = packages.foundation.gawk.versions."5.2.2-stage1-passthrough";
|
||||
gnugrep = packages.foundation.gnugrep.versions."3.11-stage1-passthrough";
|
||||
gnumake = packages.foundation.gnumake.versions."4.4.1-stage1-passthrough";
|
||||
gnupatch = packages.foundation.gnupatch.versions."2.7-stage1-passthrough";
|
||||
gnused = packages.foundation.gnused.versions."4.9-stage1-passthrough";
|
||||
gnutar = packages.foundation.gnutar.versions."1.35-stage1-passthrough";
|
||||
gzip = packages.foundation.gzip.versions."1.13-stage1-passthrough";
|
||||
xz = packages.foundation.xz.versions."5.4.3-stage1-passthrough";
|
||||
gcc = packages.foundation.gcc.versions."13.2.0-stage4";
|
||||
binutils = packages.foundation.binutils.versions."2.41-stage1-passthrough";
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
phases = {
|
||||
|
|
@ -80,7 +74,7 @@ in
|
|||
make -j $NIX_BUILD_CORES V=1 \
|
||||
"CC=''${CC_FOR_TARGET:-''${CC}}" \
|
||||
"HOSTCC=$CC" \
|
||||
ARCH=${platform.target.linux.arch} \
|
||||
ARCH=${platform.host.linux.arch} \
|
||||
headers
|
||||
'';
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ let
|
|||
platform = {
|
||||
build = lib.systems.withBuildInfo config.platform.build;
|
||||
host = lib.systems.withBuildInfo config.platform.host;
|
||||
target = lib.systems.withBuildInfo config.platform.target;
|
||||
};
|
||||
|
||||
patches = [
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ let
|
|||
"x86_64-linux"
|
||||
);
|
||||
host = lib.modules.overrides.force config.platform.host;
|
||||
target = lib.modules.overrides.force config.platform.target;
|
||||
};
|
||||
};
|
||||
in
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ let
|
|||
platform = {
|
||||
build = lib.systems.withBuildInfo config.platform.build;
|
||||
host = lib.systems.withBuildInfo config.platform.host;
|
||||
target = lib.systems.withBuildInfo config.platform.target;
|
||||
};
|
||||
in
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue