forked from auxolotl/labs
Compare commits
No commits in common. "feat/cross" and "main" have entirely different histories.
feat/cross
...
main
|
@ -3,18 +3,17 @@
|
||||||
"lib": {
|
"lib": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"dir": "lib",
|
"dir": "lib",
|
||||||
"lastModified": 1723737980,
|
"dirtyRev": "2be3111b2c0911f40b47fe0a1fb22b5f5188cf59-dirty",
|
||||||
"narHash": "sha256-1WnFatW5kSuO2jjt62hvSbH84TSYyO+VmvkJ0d5e/ZY=",
|
"dirtyShortRev": "2be3111-dirty",
|
||||||
"ref": "master",
|
"lastModified": 1719251485,
|
||||||
"rev": "cadfaabc853d20f2bc20bad794fcbe520ea48f13",
|
"narHash": "sha256-63NvfFVeTDITfNu60rmCUlaZtAeZUnvrIaOLSk9ScC8=",
|
||||||
"revCount": 82,
|
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "file:../"
|
"url": "file:../?dir=lib"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"dir": "lib",
|
"dir": "lib",
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "file:../"
|
"url": "file:../?dir=lib"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
|
|
|
@ -8,35 +8,33 @@
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"dir": "foundation",
|
"dir": "foundation",
|
||||||
"lastModified": 1724190751,
|
"dirtyRev": "3f9d287065ac685ce500c2cddb35428b2927f5a2-dirty",
|
||||||
"narHash": "sha256-e8sOmeXS9YWuQqjW6gvtS3PIueazkf4S1iiJ/94eXv4=",
|
"dirtyShortRev": "3f9d287-dirty",
|
||||||
"ref": "master",
|
"lastModified": 1720514984,
|
||||||
"rev": "4b36a5a0133f5481840bdfaf693c971215a7ef1f",
|
"narHash": "sha256-AuixwSlYk34Z6+GEc7y4QotF3Hk963zC9I9hAwX5KCE=",
|
||||||
"revCount": 84,
|
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "file:../"
|
"url": "file:../?dir=foundation"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"dir": "foundation",
|
"dir": "foundation",
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "file:../"
|
"url": "file:../?dir=foundation"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"lib": {
|
"lib": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"dir": "lib",
|
"dir": "lib",
|
||||||
"lastModified": 1724190751,
|
"dirtyRev": "3f9d287065ac685ce500c2cddb35428b2927f5a2-dirty",
|
||||||
"narHash": "sha256-e8sOmeXS9YWuQqjW6gvtS3PIueazkf4S1iiJ/94eXv4=",
|
"dirtyShortRev": "3f9d287-dirty",
|
||||||
"ref": "master",
|
"lastModified": 1720514984,
|
||||||
"rev": "4b36a5a0133f5481840bdfaf693c971215a7ef1f",
|
"narHash": "sha256-AuixwSlYk34Z6+GEc7y4QotF3Hk963zC9I9hAwX5KCE=",
|
||||||
"revCount": 84,
|
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "file:../"
|
"url": "file:../?dir=lib"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"dir": "lib",
|
"dir": "lib",
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "file:../"
|
"url": "file:../?dir=lib"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
|
|
|
@ -65,15 +65,7 @@ in
|
||||||
PATH =
|
PATH =
|
||||||
let
|
let
|
||||||
bins = lib.paths.bin (
|
bins = lib.paths.bin (
|
||||||
(lib.packages.dependencies.get dependencies.build.only)
|
(lib.packages.dependencies.get dependencies.build.host)
|
||||||
++ (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.only)
|
|
||||||
++ (lib.packages.dependencies.get dependencies.host.host)
|
|
||||||
++ (lib.packages.dependencies.get dependencies.host.target)
|
|
||||||
++ (lib.packages.dependencies.get dependencies.target.only)
|
|
||||||
++ (lib.packages.dependencies.get dependencies.target.target)
|
|
||||||
++ [
|
++ [
|
||||||
foundation.stage2-bash
|
foundation.stage2-bash
|
||||||
foundation.stage2-coreutils
|
foundation.stage2-coreutils
|
||||||
|
@ -107,7 +99,6 @@ in
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
in
|
in
|
||||||
# (builtins.trace "build: ${package.name} -> build=${package.platform.build.triple} host=${package.platform.host.triple} target=${package.platform.target.triple}")
|
|
||||||
built
|
built
|
||||||
// {
|
// {
|
||||||
inherit (package) meta;
|
inherit (package) meta;
|
||||||
|
|
|
@ -26,32 +26,16 @@ in
|
||||||
# }))
|
# }))
|
||||||
# .config;
|
# .config;
|
||||||
foundation-gcc = config.packages.foundation.gcc;
|
foundation-gcc = config.packages.foundation.gcc;
|
||||||
foundation-glibc = config.packages.foundation.glibc;
|
|
||||||
foundation-binutils = config.packages.foundation.binutils;
|
foundation-binutils = config.packages.foundation.binutils;
|
||||||
foundation-linux-headers = config.packages.foundation.linux-headers;
|
foundation-linux-headers = config.packages.foundation.linux-headers;
|
||||||
# foundation-linux-headers = config.packages.foundation.linux-headers.versions.latest.extend {
|
# foundation-linux-headers = config.packages.foundation.linux-headers.versions.latest.extend {
|
||||||
# platform.host = lib.modules.overrides.force "x86_64-linux";
|
# platform.host = lib.modules.overrides.force "x86_64-linux";
|
||||||
# };
|
# };
|
||||||
|
# example-x = config.packages.example.x;
|
||||||
cross-aux-a-x86_64-linux = config.packages.cross.x86_64-linux.aux.a;
|
cross-aux-a-x86_64-linux = config.packages.cross.x86_64-linux.aux.a;
|
||||||
cross-foundation-gcc-x86_64-linux = config.packages.cross.x86_64-linux.foundation.gcc;
|
cross-foundation-gcc-x86_64-linux = config.packages.cross.x86_64-linux.foundation.gcc;
|
||||||
|
|
||||||
example-a = config.packages.foundation.gcc.versions.latest.extend {
|
|
||||||
platform = {
|
|
||||||
target = lib.modules.override 0 "x86_64-linux";
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
};
|
|
||||||
# exported.packages.i686-linux.example-b =
|
|
||||||
# let
|
|
||||||
# pkg =
|
|
||||||
# config.packages.foundation.gcc.versions.latest.extend {
|
|
||||||
# platform = {
|
|
||||||
# target = "aarch64-linux";
|
|
||||||
# };
|
|
||||||
# };
|
|
||||||
# in
|
|
||||||
# pkg.package;
|
|
||||||
|
|
||||||
# exported.packages.i686-linux.cross-foundation-gcc-x86_64-linux = config.packages.cross.x86_64-linux.foundation.gcc.package;
|
# exported.packages.i686-linux.cross-foundation-gcc-x86_64-linux = config.packages.cross.x86_64-linux.foundation.gcc.package;
|
||||||
};
|
};
|
||||||
|
|
|
@ -230,34 +230,6 @@ in
|
||||||
default.value = [ ];
|
default.value = [ ];
|
||||||
};
|
};
|
||||||
|
|
||||||
# extend = lib.options.create {
|
|
||||||
# description = "Extend the package definition.";
|
|
||||||
# type = lib.types.function lib.types.raw;
|
|
||||||
# internal = true;
|
|
||||||
# writable = false;
|
|
||||||
# default.value = module:
|
|
||||||
# let
|
|
||||||
# normalized =
|
|
||||||
# if builtins.isList module then
|
|
||||||
# module
|
|
||||||
# else if builtins.isFunction module || module ? config then
|
|
||||||
# [ module ]
|
|
||||||
# else
|
|
||||||
# [{
|
|
||||||
# config = module;
|
|
||||||
# }];
|
|
||||||
# result = meta.extend {
|
|
||||||
# modules =
|
|
||||||
# normalized ++ [
|
|
||||||
# {
|
|
||||||
# config.__modules__ = lib.modules.overrides.force (config.__modules__ ++ normalized);
|
|
||||||
# }
|
|
||||||
# ];
|
|
||||||
# };
|
|
||||||
# in
|
|
||||||
# result.config;
|
|
||||||
# };
|
|
||||||
|
|
||||||
extend = lib.options.create {
|
extend = lib.options.create {
|
||||||
description = "Extend the package definition.";
|
description = "Extend the package definition.";
|
||||||
type = lib.types.function lib.types.raw;
|
type = lib.types.function lib.types.raw;
|
||||||
|
@ -274,14 +246,13 @@ in
|
||||||
[{
|
[{
|
||||||
config = module;
|
config = module;
|
||||||
}];
|
}];
|
||||||
|
result = meta.extend {
|
||||||
modules = config.__modules__ ++ normalized;
|
modules =
|
||||||
|
normalized ++ [
|
||||||
result = lib.modules.run {
|
{
|
||||||
modules = [
|
config.__modules__ = lib.modules.overrides.force (config.__modules__ ++ normalized);
|
||||||
submodule
|
}
|
||||||
{ config.__modules__ = modules; }
|
];
|
||||||
] ++ modules;
|
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
result.config;
|
result.config;
|
||||||
|
@ -290,8 +261,8 @@ in
|
||||||
meta = {
|
meta = {
|
||||||
description = lib.options.create {
|
description = lib.options.create {
|
||||||
description = "The description for the package.";
|
description = "The description for the package.";
|
||||||
type = lib.types.string;
|
type = lib.types.nullish lib.types.string;
|
||||||
default.value = "";
|
default.value = null;
|
||||||
};
|
};
|
||||||
|
|
||||||
homepage = lib.options.create {
|
homepage = lib.options.create {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ config }:
|
{ lib', config }:
|
||||||
let
|
let
|
||||||
inherit (config) builders packages;
|
inherit (config) builders packages;
|
||||||
in
|
in
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
{ lib
|
{
|
||||||
, lib'
|
lib,
|
||||||
, config
|
lib',
|
||||||
, options
|
config,
|
||||||
,
|
options,
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
inherit (config)
|
inherit (config)
|
||||||
|
@ -27,14 +27,7 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config =
|
config = {
|
||||||
let
|
|
||||||
isBuildBootstrapped = config.platform.build.double == "i686-linux";
|
|
||||||
isHostBootstrapped = config.platform.host.double == "i686-linux";
|
|
||||||
|
|
||||||
isBootstrapped = isBuildBootstrapped && isHostBootstrapped;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
meta = {
|
meta = {
|
||||||
platforms = [ "i686-linux" ];
|
platforms = [ "i686-linux" ];
|
||||||
};
|
};
|
||||||
|
@ -46,18 +39,15 @@ in
|
||||||
|
|
||||||
deps = {
|
deps = {
|
||||||
build = {
|
build = {
|
||||||
only = {
|
host = {
|
||||||
gcc = lib.modules.when (!isBootstrapped) packages.foundation.gcc;
|
inherit (packages.foundation) gcc;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
env = {
|
env = {
|
||||||
PATH = lib.paths.bin (
|
PATH = lib.paths.bin [
|
||||||
lib.lists.when isBootstrapped
|
# foundation.stage2-gcc
|
||||||
[ foundation.stage2-gcc ]
|
|
||||||
++ [
|
|
||||||
foundation.stage2-gcc
|
|
||||||
foundation.stage2-binutils
|
foundation.stage2-binutils
|
||||||
foundation.stage2-gnumake
|
foundation.stage2-gnumake
|
||||||
foundation.stage2-gnupatch
|
foundation.stage2-gnupatch
|
||||||
|
@ -68,8 +58,7 @@ in
|
||||||
foundation.stage2-findutils
|
foundation.stage2-findutils
|
||||||
foundation.stage2-gnutar
|
foundation.stage2-gnutar
|
||||||
foundation.stage1-xz
|
foundation.stage1-xz
|
||||||
]
|
];
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
phases =
|
phases =
|
||||||
|
|
|
@ -84,80 +84,20 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config =
|
config = {
|
||||||
let
|
|
||||||
isBuildBootstrapped = config.platform.build.double == "i686-linux";
|
|
||||||
isHostBootstrapped = config.platform.host.double == "i686-linux";
|
|
||||||
|
|
||||||
isBootstrapped = isBuildBootstrapped && isHostBootstrapped;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
meta = {
|
meta = {
|
||||||
platforms = [ "i686-linux" ];
|
platforms = [ "i686-linux" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
pname = "gcc-${config.platform.build.double}--${config.platform.host.double}--${config.platform.target.double}";
|
pname = "gcc";
|
||||||
version = "13.2.0";
|
version = "13.2.0";
|
||||||
|
|
||||||
builder = builders.basic;
|
builder = builders.basic;
|
||||||
|
|
||||||
# hooks = ctx: let
|
|
||||||
#
|
|
||||||
# in {
|
|
||||||
# "aux:gcc:env" = lib.dag.entry.before [ "unpack" ] ''
|
|
||||||
#
|
|
||||||
# '';
|
|
||||||
# };
|
|
||||||
|
|
||||||
deps =
|
|
||||||
let
|
|
||||||
platform =
|
|
||||||
if !isBuildBootstrapped then
|
|
||||||
{
|
|
||||||
build = "i686-linux";
|
|
||||||
host = lib.modules.override 0 config.platform.build.triple;
|
|
||||||
target = lib.modules.override 0 config.platform.build.triple;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
build = "i686-linux";
|
|
||||||
host = "i686-linux";
|
|
||||||
target = lib.modules.override 0 config.platform.host.triple;
|
|
||||||
};
|
|
||||||
in
|
|
||||||
{
|
|
||||||
build = {
|
|
||||||
only = {
|
|
||||||
gcc =
|
|
||||||
lib.modules.when
|
|
||||||
(!isBootstrapped)
|
|
||||||
(packages.foundation.gcc.versions.latest.extend {
|
|
||||||
inherit platform;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
build = {
|
|
||||||
binutils = packages.foundation.binutils;
|
|
||||||
linux-headers = packages.foundation.linux-headers;
|
|
||||||
glibc = packages.foundation.glibc;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
hooks = ctx: {
|
|
||||||
"aux:compiler:setup" = lib.dag.entry.before [ "unpack" ] ''
|
|
||||||
: ''${AUX_COMPILER_LIBRARY_PATH:=}
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
env = {
|
env = {
|
||||||
PATH = lib.paths.bin (
|
PATH = lib.paths.bin [
|
||||||
lib.lists.when
|
|
||||||
(isBootstrapped)
|
|
||||||
[
|
|
||||||
foundation.stage2-gcc
|
foundation.stage2-gcc
|
||||||
# foundation.stage2-binutils
|
foundation.stage2-binutils
|
||||||
]
|
|
||||||
++ [
|
|
||||||
foundation.stage2-gnumake
|
foundation.stage2-gnumake
|
||||||
foundation.stage2-gnused
|
foundation.stage2-gnused
|
||||||
foundation.stage2-gnugrep
|
foundation.stage2-gnugrep
|
||||||
|
@ -168,23 +108,16 @@ in
|
||||||
foundation.stage2-gzip
|
foundation.stage2-gzip
|
||||||
foundation.stage2-bzip2
|
foundation.stage2-bzip2
|
||||||
foundation.stage1-xz
|
foundation.stage1-xz
|
||||||
]
|
];
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
phases =
|
phases =
|
||||||
let
|
let
|
||||||
host = lib.systems.withBuildInfo config.platform.host;
|
host = lib.systems.withBuildInfo config.platform.host;
|
||||||
|
|
||||||
compiler = if isBootstrapped then "gcc" else "${config.platform.build.triple}-gcc";
|
|
||||||
|
|
||||||
mbits = if host.system.cpu.family == "x86" then if host.is64bit then "-m64" else "-m32" else "";
|
mbits = if host.system.cpu.family == "x86" then if host.is64bit then "-m64" else "-m32" else "";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
"aux:compiler:setup" = ''
|
|
||||||
: ''${AUX_COMPILER_LIBRARY_PATH:=}
|
|
||||||
'';
|
|
||||||
|
|
||||||
unpack = ''
|
unpack = ''
|
||||||
# Unpack
|
# Unpack
|
||||||
tar xf ${config.src}
|
tar xf ${config.src}
|
||||||
|
@ -218,8 +151,8 @@ in
|
||||||
--build=${config.platform.build.triple} \
|
--build=${config.platform.build.triple} \
|
||||||
--host=${config.platform.host.triple} \
|
--host=${config.platform.host.triple} \
|
||||||
--target=${config.platform.target.triple} \
|
--target=${config.platform.target.triple} \
|
||||||
--with-sysroot=${foundation.stage1-musl} \
|
|
||||||
--with-native-system-header-dir=/include \
|
--with-native-system-header-dir=/include \
|
||||||
|
--with-sysroot=${foundation.stage1-musl} \
|
||||||
--enable-languages=c,c++ \
|
--enable-languages=c,c++ \
|
||||||
--disable-bootstrap \
|
--disable-bootstrap \
|
||||||
--disable-libsanitizer \
|
--disable-libsanitizer \
|
||||||
|
@ -237,7 +170,7 @@ in
|
||||||
|
|
||||||
install = ''
|
install = ''
|
||||||
# Install
|
# Install
|
||||||
make -j $NIX_BUILD_CORES install
|
make -j $NIX_BUILD_CORES install-strip
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -41,12 +41,6 @@ in
|
||||||
|
|
||||||
builder = builders.basic;
|
builder = builders.basic;
|
||||||
|
|
||||||
hooks = ctx: {
|
|
||||||
"aux:glibc:env" = lib.dag.entry.between ["aux:compiler:setup"] ["configure"] ''
|
|
||||||
AUX_COMPILER_LIBRARY_PATH="${config.package}/lib:$AUX_COMPILER_LIBRARY_PATH"
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
env = {
|
env = {
|
||||||
PATH =
|
PATH =
|
||||||
let
|
let
|
||||||
|
@ -80,8 +74,6 @@ in
|
||||||
foundation.stage2-gnutar
|
foundation.stage2-gnutar
|
||||||
foundation.stage2-gzip
|
foundation.stage2-gzip
|
||||||
foundation.stage2-bzip2
|
foundation.stage2-bzip2
|
||||||
foundation.stage1-python
|
|
||||||
foundation.stage1-bison
|
|
||||||
foundation.stage1-xz
|
foundation.stage1-xz
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
@ -111,7 +103,7 @@ in
|
||||||
|
|
||||||
install = ''
|
install = ''
|
||||||
# Install
|
# Install
|
||||||
make -j $NIX_BUILD_CORES INSTALL_UNCOMPRESSED=yes install
|
make -j $NIX_BUILD_CORES install-strip
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue