diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2018-01-31 16:36:52 -0500 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2018-03-15 00:44:38 -0400 |
commit | eae19f3c28503a8623b0fee10bfb0b3322122637 (patch) | |
tree | 54beb9d51e4654cc2688735c6ebf2ac51a1fb06d /pkgs/top-level/release-lib.nix | |
parent | c26252af3e8a102e8ac7ab67ae3ceb2c19845cac (diff) | |
download | nixpkgs-eae19f3c28503a8623b0fee10bfb0b3322122637.tar nixpkgs-eae19f3c28503a8623b0fee10bfb0b3322122637.tar.gz nixpkgs-eae19f3c28503a8623b0fee10bfb0b3322122637.tar.bz2 nixpkgs-eae19f3c28503a8623b0fee10bfb0b3322122637.tar.lz nixpkgs-eae19f3c28503a8623b0fee10bfb0b3322122637.tar.xz nixpkgs-eae19f3c28503a8623b0fee10bfb0b3322122637.tar.zst nixpkgs-eae19f3c28503a8623b0fee10bfb0b3322122637.zip |
release-lib: Adapt to work with new meta.platforms
`packagePlatforms` now filters `supportedSystems` with the new-style `meta.platforms`, rather than just plopping it in as is.
Diffstat (limited to 'pkgs/top-level/release-lib.nix')
-rw-r--r-- | pkgs/top-level/release-lib.nix | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/pkgs/top-level/release-lib.nix b/pkgs/top-level/release-lib.nix index 3e842f8b556..e377ca30f3a 100644 --- a/pkgs/top-level/release-lib.nix +++ b/pkgs/top-level/release-lib.nix @@ -98,7 +98,18 @@ rec { packagePlatforms = mapAttrs (name: value: let res = builtins.tryEval ( if isDerivation value then - value.meta.hydraPlatforms or (value.meta.platforms or [ "x86_64-linux" ]) + # TODO(@Ericson2314) deduplicate with `checkPlatform` in + # `pkgs/stdenv/generic/check-meta.nix`. + value.meta.hydraPlatforms or (let + raw = value.meta.platforms or [ "x86_64-linux" ]; + toPattern = x: if builtins.isString x + then { system = x; } + else { parsed = x; }; + uniform = map toPattern raw; + pred = hostPlatform: + lib.any (pat: lib.matchAttrs pat hostPlatform) uniform; + pred' = system: pred (lib.systems.elaborate { inherit system; }); + in lib.filter pred' supportedSystems) else if value.recurseForDerivations or false || value.recurseForRelease or false then packagePlatforms value else |