feat: rich platform information
This commit is contained in:
parent
1c67c40213
commit
6bd35bf4d5
|
@ -25,7 +25,7 @@ in {
|
|||
)
|
||||
sorted.result;
|
||||
|
||||
system = package.platform.build;
|
||||
system = package.platform.build.double;
|
||||
in
|
||||
builtins.derivation (
|
||||
package.env
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
platform = {
|
||||
build = system;
|
||||
host = cross;
|
||||
target = cross;
|
||||
target = lib.modules.override 150 cross;
|
||||
};
|
||||
|
||||
deps = {
|
||||
|
|
|
@ -1460,8 +1460,8 @@ in {
|
|||
lib.strings.when
|
||||
(kernel.name == "netbsd" && netbsdExec != kernel.exec)
|
||||
kernel.exec.name;
|
||||
abi = lib.strings.when (abi != types.abis.unknown) "-${abi.name}";
|
||||
in "${cpu.name}-${vendor.name}-${kernelName}${exec}${abi}";
|
||||
abi' = lib.strings.when (abi != types.abis.unknown) "-${abi.name}";
|
||||
in "${cpu.name}-${vendor.name}-${kernelName}${exec}${abi'}";
|
||||
};
|
||||
|
||||
create = components:
|
||||
|
|
|
@ -169,19 +169,43 @@
|
|||
build = lib.options.create {
|
||||
description = "The build platform for the package.";
|
||||
type = lib.types.string;
|
||||
default.value = "unknown";
|
||||
default.value = "x86_64-linux";
|
||||
apply = raw: let
|
||||
system = lib'.systems.from.string raw;
|
||||
in {
|
||||
inherit raw system;
|
||||
|
||||
double = lib'.systems.into.double system;
|
||||
triple = lib'.systems.into.triple system;
|
||||
};
|
||||
};
|
||||
|
||||
host = lib.options.create {
|
||||
description = "The host platform for the package.";
|
||||
type = lib.types.string;
|
||||
default.value = "unknown";
|
||||
default.value = "x86_64-linux";
|
||||
apply = raw: let
|
||||
system = lib'.systems.from.string raw;
|
||||
in {
|
||||
inherit raw system;
|
||||
|
||||
double = lib'.systems.into.double system;
|
||||
triple = lib'.systems.into.triple system;
|
||||
};
|
||||
};
|
||||
|
||||
target = lib.options.create {
|
||||
description = "The target platform for the package.";
|
||||
type = lib.types.string;
|
||||
default.value = "unknown";
|
||||
default.value = "x86_64-linux";
|
||||
apply = raw: let
|
||||
system = lib'.systems.from.string raw;
|
||||
in {
|
||||
inherit raw system;
|
||||
|
||||
double = lib'.systems.into.double system;
|
||||
triple = lib'.systems.into.triple system;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ in {
|
|||
|
||||
phases = {
|
||||
build = ''
|
||||
make --build ${config.platform.build} --host ${config.platform.host}
|
||||
make --build ${config.platform.build.double} --host ${config.platform.host.double}
|
||||
'';
|
||||
|
||||
install = lib.dag.entry.after ["build"] ''
|
||||
|
|
|
@ -51,6 +51,7 @@ in {
|
|||
config = {
|
||||
platform = {
|
||||
host = lib.modules.overrides.force system;
|
||||
target = lib.modules.overrides.default system;
|
||||
};
|
||||
|
||||
deps = {
|
||||
|
|
Loading…
Reference in a new issue