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