2017-07-29 02:05:35 +02:00
|
|
|
{ lib }:
|
2017-02-09 22:09:47 +01:00
|
|
|
let
|
2017-07-29 02:05:35 +02:00
|
|
|
inherit (lib) lists;
|
2018-01-31 04:10:34 +01:00
|
|
|
inherit (lib.systems) parse;
|
|
|
|
inherit (lib.systems.inspect) predicates;
|
2017-07-29 02:05:35 +02:00
|
|
|
inherit (lib.attrsets) matchAttrs;
|
2017-05-21 19:39:23 +02:00
|
|
|
|
2017-02-09 22:09:47 +01:00
|
|
|
all = [
|
|
|
|
"aarch64-linux"
|
|
|
|
"armv5tel-linux" "armv6l-linux" "armv7l-linux"
|
|
|
|
|
2017-12-05 11:27:45 +01:00
|
|
|
"mipsel-linux"
|
2017-02-09 22:09:47 +01:00
|
|
|
|
|
|
|
"i686-cygwin" "i686-freebsd" "i686-linux" "i686-netbsd" "i686-openbsd"
|
|
|
|
|
|
|
|
"x86_64-cygwin" "x86_64-darwin" "x86_64-freebsd" "x86_64-linux"
|
|
|
|
"x86_64-netbsd" "x86_64-openbsd" "x86_64-solaris"
|
|
|
|
];
|
|
|
|
|
|
|
|
allParsed = map parse.mkSystemFromString all;
|
|
|
|
|
|
|
|
filterDoubles = f: map parse.doubleFromSystem (lists.filter f allParsed);
|
|
|
|
|
|
|
|
in rec {
|
|
|
|
inherit all;
|
2009-09-23 21:45:02 +02:00
|
|
|
|
2016-02-26 19:53:03 +01:00
|
|
|
none = [];
|
|
|
|
|
2017-08-24 00:16:02 +02:00
|
|
|
arm = filterDoubles predicates.isArm;
|
2018-03-13 23:00:52 +01:00
|
|
|
aarch64 = filterDoubles predicates.isAarch64;
|
|
|
|
x86 = filterDoubles predicates.isx86;
|
2017-05-21 19:39:23 +02:00
|
|
|
i686 = filterDoubles predicates.isi686;
|
|
|
|
x86_64 = filterDoubles predicates.isx86_64;
|
lib, stdenv: Check `meta.platforms` against host platform and be open world
First, we need check against the host platform, not the build platform.
That's simple enough.
Second, we move away from exahustive finite case analysis (i.e.
exhaustively listing all platforms the package builds on). That only
work in a closed-world setting, where we know all platforms we might
build one. But with cross compilation, we may be building for arbitrary
platforms, So we need fancier filters. This is the closed world to open
world change.
The solution is instead of having a list of systems (strings in the form
"foo-bar"), we have a list of of systems or "patterns", i.e. attributes
that partially match the output of the parsers in `lib.systems.parse`.
The "check meta" logic treats the systems strings as an exact whitelist
just as before, but treats the patterns as a fuzzy whitelist,
intersecting the actual `hostPlatform` with the pattern and then
checking for equality. (This is done using `matchAttrs`).
The default convenience lists for `meta.platforms` are now changed to be
lists of patterns (usually a single pattern) in
`lib/systems/for-meta.nix` for maximum flexibility under this new
system.
Fixes #30902
2018-01-31 06:11:03 +01:00
|
|
|
mips = filterDoubles predicates.isMips;
|
2017-05-21 19:39:23 +02:00
|
|
|
|
|
|
|
cygwin = filterDoubles predicates.isCygwin;
|
|
|
|
darwin = filterDoubles predicates.isDarwin;
|
|
|
|
freebsd = filterDoubles predicates.isFreeBSD;
|
|
|
|
# Should be better, but MinGW is unclear, and HURD is bit-rotted.
|
lib, stdenv: Check `meta.platforms` against host platform and be open world
First, we need check against the host platform, not the build platform.
That's simple enough.
Second, we move away from exahustive finite case analysis (i.e.
exhaustively listing all platforms the package builds on). That only
work in a closed-world setting, where we know all platforms we might
build one. But with cross compilation, we may be building for arbitrary
platforms, So we need fancier filters. This is the closed world to open
world change.
The solution is instead of having a list of systems (strings in the form
"foo-bar"), we have a list of of systems or "patterns", i.e. attributes
that partially match the output of the parsers in `lib.systems.parse`.
The "check meta" logic treats the systems strings as an exact whitelist
just as before, but treats the patterns as a fuzzy whitelist,
intersecting the actual `hostPlatform` with the pattern and then
checking for equality. (This is done using `matchAttrs`).
The default convenience lists for `meta.platforms` are now changed to be
lists of patterns (usually a single pattern) in
`lib/systems/for-meta.nix` for maximum flexibility under this new
system.
Fixes #30902
2018-01-31 06:11:03 +01:00
|
|
|
gnu = filterDoubles (matchAttrs { kernel = parse.kernels.linux; abi = parse.abis.gnu; });
|
2017-05-21 19:39:23 +02:00
|
|
|
illumos = filterDoubles predicates.isSunOS;
|
|
|
|
linux = filterDoubles predicates.isLinux;
|
|
|
|
netbsd = filterDoubles predicates.isNetBSD;
|
|
|
|
openbsd = filterDoubles predicates.isOpenBSD;
|
|
|
|
unix = filterDoubles predicates.isUnix;
|
2016-02-26 19:53:03 +01:00
|
|
|
|
2017-01-27 12:52:06 +01:00
|
|
|
mesaPlatforms = ["i686-linux" "x86_64-linux" "x86_64-darwin" "armv5tel-linux" "armv6l-linux" "armv7l-linux" "aarch64-linux"];
|
2009-08-25 10:28:08 +02:00
|
|
|
}
|