Filter out packages by platform from crossSet
Reviewed-by: Rodrigo Arias Mallo <rodrigo.arias@bsc.es> Tested-by: Rodrigo Arias Mallo <rodrigo.arias@bsc.es>
This commit is contained in:
parent
7d721084a7
commit
7989779c8f
14
overlay.nix
14
overlay.nix
@ -101,14 +101,16 @@ let
|
|||||||
pkgsTopLevel = filterAttrs (_: isDerivation) bscPkgs;
|
pkgsTopLevel = filterAttrs (_: isDerivation) bscPkgs;
|
||||||
|
|
||||||
# Native build in that platform doesn't imply cross build works
|
# Native build in that platform doesn't imply cross build works
|
||||||
canCrossCompile = platform: pkg:
|
canCrossCompile = platform: default: pkg:
|
||||||
(isDerivation pkg) &&
|
(isDerivation pkg) &&
|
||||||
# Must be defined explicitly
|
# If meta.cross is undefined, use default
|
||||||
(pkg.meta.cross or false) &&
|
(pkg.meta.cross or default) &&
|
||||||
(meta.availableOn platform pkg);
|
(meta.availableOn final.pkgsCross.${platform}.stdenv.hostPlatform pkg);
|
||||||
|
|
||||||
# For now only RISC-V
|
# For now only RISC-V
|
||||||
crossSet = { riscv64 = final.pkgsCross.riscv64.bsc.pkgsTopLevel; };
|
crossSet = genAttrs [ "riscv64" ] (platform:
|
||||||
|
filterAttrs (_: canCrossCompile platform true)
|
||||||
|
final.pkgsCross.${platform}.bsc.pkgsTopLevel);
|
||||||
|
|
||||||
buildList = name: paths:
|
buildList = name: paths:
|
||||||
final.runCommandLocal name { } ''
|
final.runCommandLocal name { } ''
|
||||||
@ -128,7 +130,7 @@ let
|
|||||||
# For now only RISC-V
|
# For now only RISC-V
|
||||||
crossList = buildList "ci-cross"
|
crossList = buildList "ci-cross"
|
||||||
(filter
|
(filter
|
||||||
(canCrossCompile final.pkgsCross.riscv64.stdenv.hostPlatform)
|
(canCrossCompile "riscv64" false) # opt-in (pkgs with: meta.cross = true)
|
||||||
(builtins.attrValues crossSet.riscv64));
|
(builtins.attrValues crossSet.riscv64));
|
||||||
|
|
||||||
in bscPkgs // {
|
in bscPkgs // {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user