chore: format code
This commit is contained in:
parent
a17ac0ff2b
commit
397419d8ab
17 changed files with 511 additions and 501 deletions
|
|
@ -24,8 +24,10 @@ in
|
|||
cross-foundation-glibc-x86_64-linux = config.packages.cross.x86_64-linux.foundation.glibc;
|
||||
cross-foundation-binutils-x86_64-linux = config.packages.cross.x86_64-linux.foundation.binutils;
|
||||
|
||||
cross-tool-foundation-gcc-newlib-x86_64-linux = config.packages.cross-tools.x86_64-linux.foundation.gcc-newlib;
|
||||
cross-tool-foundation-gcc-x86_64-linux = config.packages.cross-tools.x86_64-linux.foundation.gcc-cross;
|
||||
cross-tool-foundation-gcc-newlib-x86_64-linux =
|
||||
config.packages.cross-tools.x86_64-linux.foundation.gcc-newlib;
|
||||
cross-tool-foundation-gcc-x86_64-linux =
|
||||
config.packages.cross-tools.x86_64-linux.foundation.gcc-cross;
|
||||
cross-foundation-gcc-x86_64-linux = config.packages.cross.x86_64-linux.foundation.gcc-bootstrap;
|
||||
|
||||
example-a = config.packages.foundation.gcc.versions.latest.extend {
|
||||
|
|
|
|||
|
|
@ -211,15 +211,13 @@ in
|
|||
path:
|
||||
let
|
||||
dependencies = lib.attrs.selectOrThrow path collected;
|
||||
hooks = builtins.map
|
||||
(
|
||||
dependency:
|
||||
let
|
||||
getHooks = dependency.hooks or (lib.fp.const { });
|
||||
in
|
||||
getHooks ctx
|
||||
)
|
||||
dependencies;
|
||||
hooks = builtins.map (
|
||||
dependency:
|
||||
let
|
||||
getHooks = dependency.hooks or (lib.fp.const { });
|
||||
in
|
||||
getHooks ctx
|
||||
) dependencies;
|
||||
in
|
||||
hooks;
|
||||
in
|
||||
|
|
|
|||
|
|
@ -263,7 +263,8 @@ in
|
|||
type = lib.types.function lib.types.raw;
|
||||
internal = true;
|
||||
writable = false;
|
||||
default.value = module:
|
||||
default.value =
|
||||
module:
|
||||
let
|
||||
normalized =
|
||||
if builtins.isList module then
|
||||
|
|
@ -271,17 +272,19 @@ in
|
|||
else if builtins.isFunction module || module ? config then
|
||||
[ module ]
|
||||
else
|
||||
[{
|
||||
config = module;
|
||||
}];
|
||||
[
|
||||
{
|
||||
config = module;
|
||||
}
|
||||
];
|
||||
|
||||
modules = config.__modules__ ++ normalized;
|
||||
modules = config.__modules__ ++ normalized;
|
||||
|
||||
result = lib.modules.run {
|
||||
modules = [
|
||||
submodule
|
||||
{ config.__modules__ = modules; }
|
||||
] ++ modules;
|
||||
submodule
|
||||
{ config.__modules__ = modules; }
|
||||
] ++ modules;
|
||||
};
|
||||
in
|
||||
result.config;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,10 @@ let
|
|||
|
||||
doubles = lib.systems.doubles.all;
|
||||
|
||||
packages = builtins.removeAttrs config.packages [ "cross" "cross-tools" ];
|
||||
packages = builtins.removeAttrs config.packages [
|
||||
"cross"
|
||||
"cross-tools"
|
||||
];
|
||||
in
|
||||
{
|
||||
includes = [
|
||||
|
|
@ -64,64 +67,60 @@ in
|
|||
config = {
|
||||
packages.cross-tools = lib.attrs.generate doubles (
|
||||
system:
|
||||
builtins.mapAttrs
|
||||
(
|
||||
namespace:
|
||||
builtins.mapAttrs (
|
||||
name: alias:
|
||||
let
|
||||
setTarget =
|
||||
package:
|
||||
package
|
||||
// {
|
||||
__modules__ = package.__modules__ ++ [
|
||||
{
|
||||
config.platform = {
|
||||
target = lib.modules.override 5 system;
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
builtins.mapAttrs (
|
||||
namespace:
|
||||
builtins.mapAttrs (
|
||||
name: alias:
|
||||
let
|
||||
setTarget =
|
||||
package:
|
||||
package
|
||||
// {
|
||||
__modules__ = package.__modules__ ++ [
|
||||
{
|
||||
config.platform = {
|
||||
target = lib.modules.override 5 system;
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
updated = alias // {
|
||||
versions = builtins.mapAttrs (version: package: setTarget package) alias.versions;
|
||||
};
|
||||
in
|
||||
updated
|
||||
)
|
||||
updated = alias // {
|
||||
versions = builtins.mapAttrs (version: package: setTarget package) alias.versions;
|
||||
};
|
||||
in
|
||||
updated
|
||||
)
|
||||
packages
|
||||
) packages
|
||||
);
|
||||
packages.cross = lib.attrs.generate doubles (
|
||||
system:
|
||||
builtins.mapAttrs
|
||||
(
|
||||
namespace:
|
||||
builtins.mapAttrs (
|
||||
name: alias:
|
||||
let
|
||||
setPlatform =
|
||||
package:
|
||||
package
|
||||
// {
|
||||
__modules__ = package.__modules__ ++ [
|
||||
{
|
||||
config.platform = {
|
||||
host = lib.modules.override 5 system;
|
||||
target = lib.modules.override 5 system;
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
builtins.mapAttrs (
|
||||
namespace:
|
||||
builtins.mapAttrs (
|
||||
name: alias:
|
||||
let
|
||||
setPlatform =
|
||||
package:
|
||||
package
|
||||
// {
|
||||
__modules__ = package.__modules__ ++ [
|
||||
{
|
||||
config.platform = {
|
||||
host = lib.modules.override 5 system;
|
||||
target = lib.modules.override 5 system;
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
updated = alias // {
|
||||
versions = builtins.mapAttrs (version: package: setPlatform package) alias.versions;
|
||||
};
|
||||
in
|
||||
updated
|
||||
)
|
||||
updated = alias // {
|
||||
versions = builtins.mapAttrs (version: package: setPlatform package) alias.versions;
|
||||
};
|
||||
in
|
||||
updated
|
||||
)
|
||||
packages
|
||||
) packages
|
||||
);
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
{ lib
|
||||
, lib'
|
||||
, config
|
||||
, options
|
||||
,
|
||||
{
|
||||
lib,
|
||||
lib',
|
||||
config,
|
||||
options,
|
||||
}:
|
||||
let
|
||||
inherit (config)
|
||||
|
|
@ -56,13 +56,12 @@ in
|
|||
only = {
|
||||
gcc = lib.modules.when (!isBootstrapped) (
|
||||
if isCross then
|
||||
packages.foundation.gcc-cross.versions.latest.extend
|
||||
{
|
||||
platform = lib.modules.override 0 {
|
||||
inherit (config.platform) build target;
|
||||
host = config.platform.build;
|
||||
};
|
||||
}
|
||||
packages.foundation.gcc-cross.versions.latest.extend {
|
||||
platform = lib.modules.override 0 {
|
||||
inherit (config.platform) build target;
|
||||
host = config.platform.build;
|
||||
};
|
||||
}
|
||||
else
|
||||
packages.foundation.gcc.versions.latest
|
||||
);
|
||||
|
|
@ -85,26 +84,28 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
env = {
|
||||
PATH = lib.paths.bin (
|
||||
lib.lists.when (isBootstrapped) [ foundation.stage2-gcc ]
|
||||
env =
|
||||
{
|
||||
PATH = lib.paths.bin (
|
||||
lib.lists.when (isBootstrapped) [ foundation.stage2-gcc ]
|
||||
++ [
|
||||
foundation.stage2-gcc
|
||||
foundation.stage2-binutils
|
||||
foundation.stage2-gnumake
|
||||
foundation.stage2-gnupatch
|
||||
foundation.stage2-gnused
|
||||
foundation.stage2-gnugrep
|
||||
foundation.stage2-gawk
|
||||
foundation.stage2-diffutils
|
||||
foundation.stage2-findutils
|
||||
foundation.stage2-gnutar
|
||||
foundation.stage1-xz
|
||||
]
|
||||
);
|
||||
} // (lib.attrs.when (isCross) {
|
||||
LDFLAGS_FOR_TARGET = "-B${config.deps.build.only.glibc.package}/lib -L${config.deps.build.only.glibc.package}/lib -I${config.deps.build.only.glibc.package}/include";
|
||||
});
|
||||
foundation.stage2-gcc
|
||||
foundation.stage2-binutils
|
||||
foundation.stage2-gnumake
|
||||
foundation.stage2-gnupatch
|
||||
foundation.stage2-gnused
|
||||
foundation.stage2-gnugrep
|
||||
foundation.stage2-gawk
|
||||
foundation.stage2-diffutils
|
||||
foundation.stage2-findutils
|
||||
foundation.stage2-gnutar
|
||||
foundation.stage1-xz
|
||||
]
|
||||
);
|
||||
}
|
||||
// (lib.attrs.when (isCross) {
|
||||
LDFLAGS_FOR_TARGET = "-B${config.deps.build.only.glibc.package}/lib -L${config.deps.build.only.glibc.package}/lib -I${config.deps.build.only.glibc.package}/include";
|
||||
});
|
||||
|
||||
phases =
|
||||
let
|
||||
|
|
|
|||
|
|
@ -8,77 +8,74 @@ in
|
|||
{
|
||||
config.packages.foundation.gcc-bootstrap = {
|
||||
versions = {
|
||||
"latest" = config.packages.foundation.gcc.versions.latest.extend
|
||||
(
|
||||
{ config }:
|
||||
{
|
||||
config = {
|
||||
meta = {
|
||||
platforms = lib.modules.override 0 [
|
||||
"i686-linux"
|
||||
];
|
||||
};
|
||||
|
||||
deps = {
|
||||
build = {
|
||||
build = {
|
||||
gcc = lib.modules.override 0 (
|
||||
packages.foundation.gcc-cross.versions.latest.extend {
|
||||
platform = lib.modules.override 0 {
|
||||
build = "i686-linux";
|
||||
target = config.platform.target;
|
||||
host = "i686-linux";
|
||||
};
|
||||
}
|
||||
);
|
||||
binutils = lib.modules.override 0 (
|
||||
packages.foundation.binutils.versions.latest.extend {
|
||||
platform = lib.modules.override 0 {
|
||||
build = "i686-linux";
|
||||
target = config.platform.target;
|
||||
host = config.platform.host;
|
||||
};
|
||||
}
|
||||
);
|
||||
glibc = lib.modules.override 0 (
|
||||
packages.foundation.glibc.versions.latest.extend {
|
||||
platform = lib.modules.override 0 {
|
||||
build = "i686-linux";
|
||||
target = config.platform.target;
|
||||
host = config.platform.host;
|
||||
};
|
||||
}
|
||||
);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
env = {
|
||||
LIBRARY_PATH = lib.modules.override 0 "${config.deps.build.build.glibc.package}/lib";
|
||||
LDFLAGS_FOR_TARGET =
|
||||
lib.modules.override 0
|
||||
"-L$(pwd)/${config.platform.target.triple}/libgcc -L${config.deps.build.build.glibc.package}/lib";
|
||||
};
|
||||
|
||||
configureFlags = lib.modules.override 0 [
|
||||
"--prefix=${builtins.placeholder "out"}"
|
||||
# Pretend we're native even though we're not
|
||||
"--build=${config.platform.target.triple}"
|
||||
"--host=${config.platform.host.triple}"
|
||||
"--target=${config.platform.target.triple}"
|
||||
"--with-as=${config.deps.build.build.binutils.package}/bin/as"
|
||||
"--with-ld=${config.deps.build.build.binutils.package}/bin/ld"
|
||||
"--enable-languages=c,c++"
|
||||
"--disable-bootstrap"
|
||||
"--disable-libsanitizer"
|
||||
"--disable-multilib"
|
||||
"--with-native-system-header-dir=${config.deps.build.build.glibc.package}/include"
|
||||
"--with-gxx-include-dir=${placeholder "out"}/include/c++/${config.version}/"
|
||||
"--with-build-sysroot=/"
|
||||
"latest" = config.packages.foundation.gcc.versions.latest.extend (
|
||||
{ config }:
|
||||
{
|
||||
config = {
|
||||
meta = {
|
||||
platforms = lib.modules.override 0 [
|
||||
"i686-linux"
|
||||
];
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
deps = {
|
||||
build = {
|
||||
build = {
|
||||
gcc = lib.modules.override 0 (
|
||||
packages.foundation.gcc-cross.versions.latest.extend {
|
||||
platform = lib.modules.override 0 {
|
||||
build = "i686-linux";
|
||||
target = config.platform.target;
|
||||
host = "i686-linux";
|
||||
};
|
||||
}
|
||||
);
|
||||
binutils = lib.modules.override 0 (
|
||||
packages.foundation.binutils.versions.latest.extend {
|
||||
platform = lib.modules.override 0 {
|
||||
build = "i686-linux";
|
||||
target = config.platform.target;
|
||||
host = config.platform.host;
|
||||
};
|
||||
}
|
||||
);
|
||||
glibc = lib.modules.override 0 (
|
||||
packages.foundation.glibc.versions.latest.extend {
|
||||
platform = lib.modules.override 0 {
|
||||
build = "i686-linux";
|
||||
target = config.platform.target;
|
||||
host = config.platform.host;
|
||||
};
|
||||
}
|
||||
);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
env = {
|
||||
LIBRARY_PATH = lib.modules.override 0 "${config.deps.build.build.glibc.package}/lib";
|
||||
LDFLAGS_FOR_TARGET = lib.modules.override 0 "-L$(pwd)/${config.platform.target.triple}/libgcc -L${config.deps.build.build.glibc.package}/lib";
|
||||
};
|
||||
|
||||
configureFlags = lib.modules.override 0 [
|
||||
"--prefix=${builtins.placeholder "out"}"
|
||||
# Pretend we're native even though we're not
|
||||
"--build=${config.platform.target.triple}"
|
||||
"--host=${config.platform.host.triple}"
|
||||
"--target=${config.platform.target.triple}"
|
||||
"--with-as=${config.deps.build.build.binutils.package}/bin/as"
|
||||
"--with-ld=${config.deps.build.build.binutils.package}/bin/ld"
|
||||
"--enable-languages=c,c++"
|
||||
"--disable-bootstrap"
|
||||
"--disable-libsanitizer"
|
||||
"--disable-multilib"
|
||||
"--with-native-system-header-dir=${config.deps.build.build.glibc.package}/include"
|
||||
"--with-gxx-include-dir=${placeholder "out"}/include/c++/${config.version}/"
|
||||
"--with-build-sysroot=/"
|
||||
];
|
||||
};
|
||||
}
|
||||
);
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,96 +9,90 @@ in
|
|||
{
|
||||
config.packages.foundation.gcc-cross = {
|
||||
versions = {
|
||||
"latest" = config.packages.foundation.gcc.versions.latest.extend
|
||||
(
|
||||
{ config }:
|
||||
{
|
||||
config =
|
||||
let
|
||||
programPrefix = lib.strings.when
|
||||
(
|
||||
config.platform.build.triple != config.platform.target.triple
|
||||
) "${config.platform.target.triple}-";
|
||||
in
|
||||
{
|
||||
meta = {
|
||||
platforms = lib.modules.override 0 [
|
||||
"i686-linux"
|
||||
];
|
||||
};
|
||||
"latest" = config.packages.foundation.gcc.versions.latest.extend (
|
||||
{ config }:
|
||||
{
|
||||
config =
|
||||
let
|
||||
programPrefix = lib.strings.when (
|
||||
config.platform.build.triple != config.platform.target.triple
|
||||
) "${config.platform.target.triple}-";
|
||||
in
|
||||
{
|
||||
meta = {
|
||||
platforms = lib.modules.override 0 [
|
||||
"i686-linux"
|
||||
];
|
||||
};
|
||||
|
||||
deps = {
|
||||
deps = {
|
||||
build = {
|
||||
build = {
|
||||
build = {
|
||||
binutils = (
|
||||
packages.foundation.binutils.versions.latest.extend {
|
||||
platform = lib.modules.override 0 config.platform;
|
||||
}
|
||||
);
|
||||
glibc = (
|
||||
packages.foundation.glibc.versions.latest.extend {
|
||||
platform = lib.modules.override 0 {
|
||||
inherit (config.platform) build target;
|
||||
host = config.platform.target;
|
||||
};
|
||||
}
|
||||
);
|
||||
linux-headers = (
|
||||
packages.foundation.linux-headers.versions.latest.extend {
|
||||
platform.target = lib.modules.override 0 config.platform.target;
|
||||
}
|
||||
);
|
||||
};
|
||||
binutils = (
|
||||
packages.foundation.binutils.versions.latest.extend {
|
||||
platform = lib.modules.override 0 config.platform;
|
||||
}
|
||||
);
|
||||
glibc = (
|
||||
packages.foundation.glibc.versions.latest.extend {
|
||||
platform = lib.modules.override 0 {
|
||||
inherit (config.platform) build target;
|
||||
host = config.platform.target;
|
||||
};
|
||||
}
|
||||
);
|
||||
linux-headers = (
|
||||
packages.foundation.linux-headers.versions.latest.extend {
|
||||
platform.target = lib.modules.override 0 config.platform.target;
|
||||
}
|
||||
);
|
||||
};
|
||||
};
|
||||
|
||||
env = {
|
||||
# LIBRARY_PATH = lib.modules.override 0 "${foundation.stage1-musl}/lib";
|
||||
CC = lib.modules.override 0 "gcc -Wl,-dynamic-linker -Wl,${foundation.stage1-musl}/lib/libc.so -idirafter ${foundation.stage1-musl}/include";
|
||||
CXX = lib.modules.override 0 "g++ -Wl,-dynamic-linker -Wl,${foundation.stage1-musl}/lib/libc.so -idirafter ${foundation.stage1-musl}/include";
|
||||
CFLAGS_FOR_TARGET =
|
||||
lib.modules.override 0
|
||||
"-Wl,-dynamic-linker -Wl,${config.deps.build.build.glibc.package}/lib/ld-linux-x86-64.so.2 -B${config.deps.build.build.glibc.package}/lib";
|
||||
LDFLAGS_FOR_TARGET =
|
||||
lib.modules.override 0
|
||||
"-L$(pwd)/${config.platform.target.triple}/libgcc -L${config.deps.build.build.glibc.package}/lib";
|
||||
};
|
||||
|
||||
configureFlags = lib.modules.override 0 [
|
||||
"--prefix=${builtins.placeholder "out"}"
|
||||
"--build=${config.platform.build.triple}"
|
||||
"--host=${config.platform.host.triple}"
|
||||
"--target=${config.platform.target.triple}"
|
||||
"--with-as=${config.deps.build.build.binutils.package}/bin/${programPrefix}as"
|
||||
"--with-ld=${config.deps.build.build.binutils.package}/bin/${programPrefix}ld"
|
||||
"--enable-languages=c,c++"
|
||||
"--disable-libsanitizer"
|
||||
"--disable-lto"
|
||||
"--disable-multilib"
|
||||
"--with-headers=${config.deps.build.build.glibc.package}/include"
|
||||
"--with-build-sysroot=/"
|
||||
# "--with-sysroot=${config.deps.build.build.glibc.package}"
|
||||
"--with-native-system-header-dir=${config.deps.build.build.glibc.package}/include"
|
||||
];
|
||||
|
||||
phases.configure = lib.modules.override 0 ''
|
||||
# Configure
|
||||
|
||||
mkdir build
|
||||
cd build
|
||||
echo PATH=$PATH
|
||||
|
||||
# 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.build.build.glibc.package}/lib/{crti.o,crtn.o} gcc
|
||||
mkdir -p x86_64-unknown-linux-gnu/libstdc++-v3/src
|
||||
ln -sv ${config.deps.build.build.glibc.package}/lib/{crti.o,crtn.o} x86_64-unknown-linux-gnu/libstdc++-v3/src
|
||||
|
||||
bash ../configure ${builtins.concatStringsSep " " config.configureFlags}
|
||||
'';
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
env = {
|
||||
# LIBRARY_PATH = lib.modules.override 0 "${foundation.stage1-musl}/lib";
|
||||
CC = lib.modules.override 0 "gcc -Wl,-dynamic-linker -Wl,${foundation.stage1-musl}/lib/libc.so -idirafter ${foundation.stage1-musl}/include";
|
||||
CXX = lib.modules.override 0 "g++ -Wl,-dynamic-linker -Wl,${foundation.stage1-musl}/lib/libc.so -idirafter ${foundation.stage1-musl}/include";
|
||||
CFLAGS_FOR_TARGET = lib.modules.override 0 "-Wl,-dynamic-linker -Wl,${config.deps.build.build.glibc.package}/lib/ld-linux-x86-64.so.2 -B${config.deps.build.build.glibc.package}/lib";
|
||||
LDFLAGS_FOR_TARGET = lib.modules.override 0 "-L$(pwd)/${config.platform.target.triple}/libgcc -L${config.deps.build.build.glibc.package}/lib";
|
||||
};
|
||||
|
||||
configureFlags = lib.modules.override 0 [
|
||||
"--prefix=${builtins.placeholder "out"}"
|
||||
"--build=${config.platform.build.triple}"
|
||||
"--host=${config.platform.host.triple}"
|
||||
"--target=${config.platform.target.triple}"
|
||||
"--with-as=${config.deps.build.build.binutils.package}/bin/${programPrefix}as"
|
||||
"--with-ld=${config.deps.build.build.binutils.package}/bin/${programPrefix}ld"
|
||||
"--enable-languages=c,c++"
|
||||
"--disable-libsanitizer"
|
||||
"--disable-lto"
|
||||
"--disable-multilib"
|
||||
"--with-headers=${config.deps.build.build.glibc.package}/include"
|
||||
"--with-build-sysroot=/"
|
||||
# "--with-sysroot=${config.deps.build.build.glibc.package}"
|
||||
"--with-native-system-header-dir=${config.deps.build.build.glibc.package}/include"
|
||||
];
|
||||
|
||||
phases.configure = lib.modules.override 0 ''
|
||||
# Configure
|
||||
|
||||
mkdir build
|
||||
cd build
|
||||
echo PATH=$PATH
|
||||
|
||||
# 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.build.build.glibc.package}/lib/{crti.o,crtn.o} gcc
|
||||
mkdir -p x86_64-unknown-linux-gnu/libstdc++-v3/src
|
||||
ln -sv ${config.deps.build.build.glibc.package}/lib/{crti.o,crtn.o} x86_64-unknown-linux-gnu/libstdc++-v3/src
|
||||
|
||||
bash ../configure ${builtins.concatStringsSep " " config.configureFlags}
|
||||
'';
|
||||
};
|
||||
}
|
||||
);
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -107,10 +107,9 @@ in
|
|||
(config.platform.target.triple != config.platform.host.triple)
|
||||
&& (config.platform.host.triple == config.platform.target.triple);
|
||||
|
||||
programPrefix = lib.strings.when
|
||||
(
|
||||
config.platform.build.triple != config.platform.target.triple
|
||||
) "${config.platform.target.triple}-";
|
||||
programPrefix = lib.strings.when (
|
||||
config.platform.build.triple != config.platform.target.triple
|
||||
) "${config.platform.target.triple}-";
|
||||
|
||||
libc = if isBootstrapped then foundation.stage1-musl else config.deps.build.build.glibc.package;
|
||||
libcLd =
|
||||
|
|
@ -148,22 +147,25 @@ in
|
|||
env =
|
||||
{
|
||||
PATH = lib.modules.when (isBuildBootstrapped) (
|
||||
lib.paths.bin ([
|
||||
foundation.stage2-gnumake
|
||||
foundation.stage2-gnused
|
||||
foundation.stage2-gnugrep
|
||||
foundation.stage2-gnupatch
|
||||
foundation.stage2-gawk
|
||||
foundation.stage2-diffutils
|
||||
foundation.stage2-findutils
|
||||
foundation.stage2-gnutar
|
||||
foundation.stage2-gzip
|
||||
foundation.stage2-bzip2
|
||||
foundation.stage1-xz
|
||||
] ++ (lib.lists.when (isBootstrapped) [
|
||||
foundation.stage2-gcc
|
||||
foundation.stage2-binutils
|
||||
]))
|
||||
lib.paths.bin (
|
||||
[
|
||||
foundation.stage2-gnumake
|
||||
foundation.stage2-gnused
|
||||
foundation.stage2-gnugrep
|
||||
foundation.stage2-gnupatch
|
||||
foundation.stage2-gawk
|
||||
foundation.stage2-diffutils
|
||||
foundation.stage2-findutils
|
||||
foundation.stage2-gnutar
|
||||
foundation.stage2-gzip
|
||||
foundation.stage2-bzip2
|
||||
foundation.stage1-xz
|
||||
]
|
||||
++ (lib.lists.when (isBootstrapped) [
|
||||
foundation.stage2-gcc
|
||||
foundation.stage2-binutils
|
||||
])
|
||||
)
|
||||
);
|
||||
CFLAGS_FOR_TARGET = "-Wl,-dynamic-linker -Wl,${libcLd}";
|
||||
}
|
||||
|
|
@ -186,7 +188,9 @@ in
|
|||
else
|
||||
[
|
||||
"-Wl,-dynamic-linker"
|
||||
"-Wl,${config.deps.build.build.glibc.package}/lib/ld-linux${lib.strings.when (target.isx86 && target.is64bit) "-x86-64"}.so.2"
|
||||
"-Wl,${config.deps.build.build.glibc.package}/lib/ld-linux${
|
||||
lib.strings.when (target.isx86 && target.is64bit) "-x86-64"
|
||||
}.so.2"
|
||||
"-B${config.deps.build.build.glibc.package}/lib"
|
||||
# "-idirafter ${config.deps.build.build.glibc.package}/include"
|
||||
];
|
||||
|
|
@ -246,7 +250,7 @@ in
|
|||
|
||||
patch = ''
|
||||
${lib.strings.concatMapSep "\n" (file: "patch -Np1 -i ${file}") patches}
|
||||
${lib.strings.when (isBootstrapped && !(crossTool || cross))''
|
||||
${lib.strings.when (isBootstrapped && !(crossTool || cross)) ''
|
||||
# force musl even if host triple is gnu
|
||||
sed -i 's|"os/gnu-linux"|"os/generic"|' libstdc++-v3/configure.host
|
||||
''}
|
||||
|
|
@ -267,12 +271,10 @@ in
|
|||
|
||||
install = ''
|
||||
# Install
|
||||
${
|
||||
lib.strings.when (host.is64bit) ''
|
||||
mkdir -p $out/lib
|
||||
ln -s lib $out/lib64
|
||||
''
|
||||
}
|
||||
${lib.strings.when (host.is64bit) ''
|
||||
mkdir -p $out/lib
|
||||
ln -s lib $out/lib64
|
||||
''}
|
||||
make -j $NIX_BUILD_CORES install
|
||||
'';
|
||||
};
|
||||
|
|
|
|||
|
|
@ -13,10 +13,9 @@ in
|
|||
{
|
||||
config =
|
||||
let
|
||||
programPrefix = lib.strings.when
|
||||
(
|
||||
config.platform.build.triple != config.platform.target.triple
|
||||
) "${config.platform.target.triple}-";
|
||||
programPrefix = lib.strings.when (
|
||||
config.platform.build.triple != config.platform.target.triple
|
||||
) "${config.platform.target.triple}-";
|
||||
in
|
||||
{
|
||||
meta = {
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
{ lib
|
||||
, lib'
|
||||
, config
|
||||
, options
|
||||
,
|
||||
{
|
||||
lib,
|
||||
lib',
|
||||
config,
|
||||
options,
|
||||
}:
|
||||
let
|
||||
inherit (config)
|
||||
|
|
@ -28,7 +28,10 @@ in
|
|||
|
||||
config = {
|
||||
meta = {
|
||||
platforms = [ "x86_64-linux" "i686-linux" ];
|
||||
platforms = [
|
||||
"x86_64-linux"
|
||||
"i686-linux"
|
||||
];
|
||||
};
|
||||
|
||||
pname = "linux-headers";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue