summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
authorFrederik Rietdijk <fridh@fridh.nl>2018-10-20 09:40:09 +0200
committerFrederik Rietdijk <fridh@fridh.nl>2018-10-20 09:40:09 +0200
commitca6ee8f519733e1f45b7598d995245dd687f535c (patch)
tree3c84d14a7da3b890b5f3be62ab13e6eae2805695 /lib
parent4c774f24acf2b674b99f70690f73a67c095f1968 (diff)
parentceb0ce849fe01fcbc221e3b978a0744bf3735752 (diff)
downloadnixlib-ca6ee8f519733e1f45b7598d995245dd687f535c.tar
nixlib-ca6ee8f519733e1f45b7598d995245dd687f535c.tar.gz
nixlib-ca6ee8f519733e1f45b7598d995245dd687f535c.tar.bz2
nixlib-ca6ee8f519733e1f45b7598d995245dd687f535c.tar.lz
nixlib-ca6ee8f519733e1f45b7598d995245dd687f535c.tar.xz
nixlib-ca6ee8f519733e1f45b7598d995245dd687f535c.tar.zst
nixlib-ca6ee8f519733e1f45b7598d995245dd687f535c.zip
Merge master into staging-next
Diffstat (limited to 'lib')
-rw-r--r--lib/licenses.nix5
-rw-r--r--lib/systems/default.nix19
-rw-r--r--lib/systems/doubles.nix5
-rw-r--r--lib/tests/systems.nix29
4 files changed, 43 insertions, 15 deletions
diff --git a/lib/licenses.nix b/lib/licenses.nix
index c370af346791..611e6ddb35b7 100644
--- a/lib/licenses.nix
+++ b/lib/licenses.nix
@@ -585,6 +585,11 @@ lib.mapAttrs (n: v: v // { shortName = n; }) rec {
     fullName = "Ruby License";
   };
 
+  sendmail = spdx {
+    spdxId = "Sendmail";
+    fullName = "Sendmail License";
+  };
+
   sgi-b-20 = spdx {
     spdxId = "SGI-B-2.0";
     fullName = "SGI Free Software License B v2.0";
diff --git a/lib/systems/default.nix b/lib/systems/default.nix
index 5eacc9eb23e1..8f5ef44ae72f 100644
--- a/lib/systems/default.nix
+++ b/lib/systems/default.nix
@@ -46,6 +46,25 @@ rec {
       # Misc boolean options
       useAndroidPrebuilt = false;
       useiOSPrebuilt = false;
+
+      # Output from uname
+      uname = {
+        # uname -s
+        system = {
+          "linux" = "Linux";
+          "windows" = "Windows";
+          "darwin" = "Darwin";
+          "netbsd" = "NetBSD";
+          "freebsd" = "FreeBSD";
+          "openbsd" = "OpenBSD";
+        }.${final.parsed.kernel.name} or null;
+
+         # uname -p
+         processor = final.parsed.cpu.name;
+
+         # uname -r
+         release = null;
+      };
     } // mapAttrs (n: v: v final.parsed) inspect.predicates
       // args;
   in assert final.useAndroidPrebuilt -> final.isAndroid;
diff --git a/lib/systems/doubles.nix b/lib/systems/doubles.nix
index a00165db1716..58677c0bdd90 100644
--- a/lib/systems/doubles.nix
+++ b/lib/systems/doubles.nix
@@ -15,6 +15,8 @@ let
 
     "x86_64-cygwin" "x86_64-darwin" "x86_64-freebsd" "x86_64-linux"
     "x86_64-netbsd" "x86_64-openbsd" "x86_64-solaris"
+
+    "x86_64-windows" "i686-windows"
   ];
 
   allParsed = map parse.mkSystemFromString all;
@@ -37,12 +39,13 @@ in rec {
   darwin  = filterDoubles predicates.isDarwin;
   freebsd = filterDoubles predicates.isFreeBSD;
   # Should be better, but MinGW is unclear.
-  gnu     = filterDoubles (matchAttrs { kernel = parse.kernels.linux; abi = parse.abis.gnu; });
+  gnu     = filterDoubles (matchAttrs { kernel = parse.kernels.linux; abi = parse.abis.gnu; }) ++ filterDoubles (matchAttrs { kernel = parse.kernels.linux; abi = parse.abis.gnueabi; }) ++ filterDoubles (matchAttrs { kernel = parse.kernels.linux; abi = parse.abis.gnueabihf; });
   illumos = filterDoubles predicates.isSunOS;
   linux   = filterDoubles predicates.isLinux;
   netbsd  = filterDoubles predicates.isNetBSD;
   openbsd = filterDoubles predicates.isOpenBSD;
   unix    = filterDoubles predicates.isUnix;
+  windows = filterDoubles predicates.isWindows;
 
   mesaPlatforms = ["i686-linux" "x86_64-linux" "x86_64-darwin" "armv5tel-linux" "armv6l-linux" "armv7l-linux" "aarch64-linux" "powerpc64le-linux"];
 }
diff --git a/lib/tests/systems.nix b/lib/tests/systems.nix
index 91604280e4e7..5e1293658215 100644
--- a/lib/tests/systems.nix
+++ b/lib/tests/systems.nix
@@ -12,20 +12,21 @@ let
     expected = lib.sort lib.lessThan y;
   };
 in with lib.systems.doubles; lib.runTests {
-  all = assertTrue (mseteq all (linux ++ darwin ++ cygwin ++ freebsd ++ openbsd ++ netbsd ++ illumos));
+  testall = mseteq all (linux ++ darwin ++ freebsd ++ openbsd ++ netbsd ++ illumos ++ windows);
 
-  arm = assertTrue (mseteq arm [ "armv5tel-linux" "armv6l-linux" "armv7l-linux" ]);
-  i686 = assertTrue (mseteq i686 [ "i686-linux" "i686-freebsd" "i686-netbsd" "i686-openbsd" "i686-cygwin" ]);
-  mips = assertTrue (mseteq mips [ "mipsel-linux" ]);
-  x86_64 = assertTrue (mseteq x86_64 [ "x86_64-linux" "x86_64-darwin" "x86_64-freebsd" "x86_64-openbsd" "x86_64-netbsd" "x86_64-cygwin" "x86_64-solaris" ]);
+  testarm = mseteq arm [ "armv5tel-linux" "armv6l-linux" "armv7l-linux" ];
+  testi686 = mseteq i686 [ "i686-linux" "i686-freebsd" "i686-netbsd" "i686-openbsd" "i686-cygwin" "i686-windows" ];
+  testmips = mseteq mips [ "mipsel-linux" ];
+  testx86_64 = mseteq x86_64 [ "x86_64-linux" "x86_64-darwin" "x86_64-freebsd" "x86_64-openbsd" "x86_64-netbsd" "x86_64-cygwin" "x86_64-solaris" "x86_64-windows" ];
 
-  cygwin = assertTrue (mseteq cygwin [ "i686-cygwin" "x86_64-cygwin" ]);
-  darwin = assertTrue (mseteq darwin [ "x86_64-darwin" ]);
-  freebsd = assertTrue (mseteq freebsd [ "i686-freebsd" "x86_64-freebsd" ]);
-  gnu = assertTrue (mseteq gnu (linux /* ++ kfreebsd ++ ... */));
-  illumos = assertTrue (mseteq illumos [ "x86_64-solaris" ]);
-  linux = assertTrue (mseteq linux [ "i686-linux" "x86_64-linux" "armv5tel-linux" "armv6l-linux" "armv7l-linux" "aarch64-linux" "mipsel-linux" ]);
-  netbsd = assertTrue (mseteq netbsd [ "i686-netbsd" "x86_64-netbsd" ]);
-  openbsd = assertTrue (mseteq openbsd [ "i686-openbsd" "x86_64-openbsd" ]);
-  unix = assertTrue (mseteq unix (linux ++ darwin ++ freebsd ++ openbsd ++ netbsd ++ illumos));
+  testcygwin = mseteq cygwin [ "i686-cygwin" "x86_64-cygwin" ];
+  testdarwin = mseteq darwin [ "x86_64-darwin" ];
+  testfreebsd = mseteq freebsd [ "i686-freebsd" "x86_64-freebsd" ];
+  testgnu = mseteq gnu (linux /* ++ kfreebsd ++ ... */);
+  testillumos = mseteq illumos [ "x86_64-solaris" ];
+  testlinux = mseteq linux [ "i686-linux" "x86_64-linux" "armv5tel-linux" "armv6l-linux" "armv7l-linux" "aarch64-linux" "mipsel-linux" ];
+  testnetbsd = mseteq netbsd [ "i686-netbsd" "x86_64-netbsd" ];
+  testopenbsd = mseteq openbsd [ "i686-openbsd" "x86_64-openbsd" ];
+  testwindows = mseteq windows [ "i686-cygwin" "x86_64-cygwin" "i686-windows" "x86_64-windows" ];
+  testunix = mseteq unix (linux ++ darwin ++ freebsd ++ openbsd ++ netbsd ++ illumos ++ cygwin);
 }