opencomposite: add meta.platforms (#357198)
[NixPkgs.git] / lib / systems / doubles.nix
blobf60c6a8addef2157b99ec97f55ec640f8677d971
1 { lib }:
2 let
3   inherit (lib) lists;
4   inherit (lib.systems) parse;
5   inherit (lib.systems.inspect) predicates;
6   inherit (lib.attrsets) matchAttrs;
8   all = [
9     # Cygwin
10     "i686-cygwin" "x86_64-cygwin"
12     # Darwin
13     "x86_64-darwin" "i686-darwin" "aarch64-darwin" "armv7a-darwin"
15     # FreeBSD
16     "i686-freebsd" "x86_64-freebsd"
18     # Genode
19     "aarch64-genode" "i686-genode" "x86_64-genode"
21     # illumos
22     "x86_64-solaris"
24     # JS
25     "javascript-ghcjs"
27     # Linux
28     "aarch64-linux" "armv5tel-linux" "armv6l-linux" "armv7a-linux"
29     "armv7l-linux" "i686-linux" "loongarch64-linux" "m68k-linux" "microblaze-linux"
30     "microblazeel-linux" "mips-linux" "mips64-linux" "mips64el-linux"
31     "mipsel-linux" "powerpc64-linux" "powerpc64le-linux" "riscv32-linux"
32     "riscv64-linux" "s390-linux" "s390x-linux" "x86_64-linux"
34     # MMIXware
35     "mmix-mmixware"
37     # NetBSD
38     "aarch64-netbsd" "armv6l-netbsd" "armv7a-netbsd" "armv7l-netbsd"
39     "i686-netbsd" "m68k-netbsd" "mipsel-netbsd" "powerpc-netbsd"
40     "riscv32-netbsd" "riscv64-netbsd" "x86_64-netbsd"
42     # none
43     "aarch64_be-none" "aarch64-none" "arm-none" "armv6l-none" "avr-none" "i686-none"
44     "microblaze-none" "microblazeel-none" "mips-none" "mips64-none" "msp430-none" "or1k-none" "m68k-none"
45     "powerpc-none" "powerpcle-none" "riscv32-none" "riscv64-none" "rx-none"
46     "s390-none" "s390x-none" "vc4-none" "x86_64-none"
48     # OpenBSD
49     "i686-openbsd" "x86_64-openbsd"
51     # Redox
52     "x86_64-redox"
54     # WASI
55     "wasm64-wasi" "wasm32-wasi"
57     # Windows
58     "aarch64-windows" "x86_64-windows" "i686-windows"
59   ];
61   allParsed = map parse.mkSystemFromString all;
63   filterDoubles = f: map parse.doubleFromSystem (lists.filter f allParsed);
65 in {
66   inherit all;
68   none = [];
70   arm           = filterDoubles predicates.isAarch32;
71   armv7         = filterDoubles predicates.isArmv7;
72   aarch         = filterDoubles predicates.isAarch;
73   aarch64       = filterDoubles predicates.isAarch64;
74   x86           = filterDoubles predicates.isx86;
75   i686          = filterDoubles predicates.isi686;
76   x86_64        = filterDoubles predicates.isx86_64;
77   microblaze    = filterDoubles predicates.isMicroBlaze;
78   mips          = filterDoubles predicates.isMips;
79   mmix          = filterDoubles predicates.isMmix;
80   power         = filterDoubles predicates.isPower;
81   riscv         = filterDoubles predicates.isRiscV;
82   riscv32       = filterDoubles predicates.isRiscV32;
83   riscv64       = filterDoubles predicates.isRiscV64;
84   rx            = filterDoubles predicates.isRx;
85   vc4           = filterDoubles predicates.isVc4;
86   or1k          = filterDoubles predicates.isOr1k;
87   m68k          = filterDoubles predicates.isM68k;
88   s390          = filterDoubles predicates.isS390;
89   s390x         = filterDoubles predicates.isS390x;
90   loongarch64   = filterDoubles predicates.isLoongArch64;
91   js            = filterDoubles predicates.isJavaScript;
93   bigEndian     = filterDoubles predicates.isBigEndian;
94   littleEndian  = filterDoubles predicates.isLittleEndian;
96   cygwin        = filterDoubles predicates.isCygwin;
97   darwin        = filterDoubles predicates.isDarwin;
98   freebsd       = filterDoubles predicates.isFreeBSD;
99   # Should be better, but MinGW is unclear.
100   gnu           = filterDoubles (matchAttrs { kernel = parse.kernels.linux; abi = parse.abis.gnu; })
101                   ++ filterDoubles (matchAttrs { kernel = parse.kernels.linux; abi = parse.abis.gnueabi; })
102                   ++ filterDoubles (matchAttrs { kernel = parse.kernels.linux; abi = parse.abis.gnueabihf; })
103                   ++ filterDoubles (matchAttrs { kernel = parse.kernels.linux; abi = parse.abis.gnuabin32; })
104                   ++ filterDoubles (matchAttrs { kernel = parse.kernels.linux; abi = parse.abis.gnuabi64; })
105                   ++ filterDoubles (matchAttrs { kernel = parse.kernels.linux; abi = parse.abis.gnuabielfv1; })
106                   ++ filterDoubles (matchAttrs { kernel = parse.kernels.linux; abi = parse.abis.gnuabielfv2; });
107   illumos       = filterDoubles predicates.isSunOS;
108   linux         = filterDoubles predicates.isLinux;
109   netbsd        = filterDoubles predicates.isNetBSD;
110   openbsd       = filterDoubles predicates.isOpenBSD;
111   unix          = filterDoubles predicates.isUnix;
112   wasi          = filterDoubles predicates.isWasi;
113   redox         = filterDoubles predicates.isRedox;
114   windows       = filterDoubles predicates.isWindows;
115   genode        = filterDoubles predicates.isGenode;
117   embedded      = filterDoubles predicates.isNone;