summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
authorAaron Janse <aaron@ajanse.me>2020-07-21 13:11:36 -0700
committerAaron Janse <aaron@ajanse.me>2020-07-21 13:11:36 -0700
commit60fd049b6552d73a5162109e7d8aa0839b54c398 (patch)
treea6a0ceb163583a17d390366f1c0973c2128a78ae /lib
parent903a0cac04a10ca50ca461e2fad127d05b7f1419 (diff)
downloadnixpkgs-60fd049b6552d73a5162109e7d8aa0839b54c398.tar
nixpkgs-60fd049b6552d73a5162109e7d8aa0839b54c398.tar.gz
nixpkgs-60fd049b6552d73a5162109e7d8aa0839b54c398.tar.bz2
nixpkgs-60fd049b6552d73a5162109e7d8aa0839b54c398.tar.lz
nixpkgs-60fd049b6552d73a5162109e7d8aa0839b54c398.tar.xz
nixpkgs-60fd049b6552d73a5162109e7d8aa0839b54c398.tar.zst
nixpkgs-60fd049b6552d73a5162109e7d8aa0839b54c398.zip
redox: add as target
Diffstat (limited to 'lib')
-rw-r--r--lib/systems/default.nix2
-rw-r--r--lib/systems/doubles.nix3
-rw-r--r--lib/systems/examples.nix9
-rw-r--r--lib/systems/inspect.nix3
-rw-r--r--lib/systems/parse.nix3
-rw-r--r--lib/tests/systems.nix7
6 files changed, 23 insertions, 4 deletions
diff --git a/lib/systems/default.nix b/lib/systems/default.nix
index 210674cc639..c929781dd8f 100644
--- a/lib/systems/default.nix
+++ b/lib/systems/default.nix
@@ -32,6 +32,7 @@ rec {
         /**/ if final.isDarwin              then "libSystem"
         else if final.isMinGW               then "msvcrt"
         else if final.isWasi                then "wasilibc"
+        else if final.isRedox               then "relibc"
         else if final.isMusl                then "musl"
         else if final.isUClibc              then "uclibc"
         else if final.isAndroid             then "bionic"
@@ -65,6 +66,7 @@ rec {
           freebsd = "FreeBSD";
           openbsd = "OpenBSD";
           wasi = "Wasi";
+          redox = "Redox";
           genode = "Genode";
         }.${final.parsed.kernel.name} or null;
 
diff --git a/lib/systems/doubles.nix b/lib/systems/doubles.nix
index a839b3d3d57..c0e78595d85 100644
--- a/lib/systems/doubles.nix
+++ b/lib/systems/doubles.nix
@@ -22,6 +22,8 @@ let
 
     "wasm64-wasi" "wasm32-wasi"
 
+    "x86_64-redox"
+
     "powerpc64le-linux"
 
     "riscv32-linux" "riscv64-linux"
@@ -69,6 +71,7 @@ in {
   openbsd = filterDoubles predicates.isOpenBSD;
   unix    = filterDoubles predicates.isUnix;
   wasi    = filterDoubles predicates.isWasi;
+  redox   = filterDoubles predicates.isRedox;
   windows = filterDoubles predicates.isWindows;
   genode  = filterDoubles predicates.isGenode;
 
diff --git a/lib/systems/examples.nix b/lib/systems/examples.nix
index 19b3790ecbe..ca562d2e456 100644
--- a/lib/systems/examples.nix
+++ b/lib/systems/examples.nix
@@ -164,6 +164,15 @@ rec {
   };
 
   #
+  # Redox
+  #
+
+  x86_64-unknown-redox = {
+    config = "x86_64-unknown-redox";
+    libc = "relibc";
+  };
+
+  #
   # Darwin
   #
 
diff --git a/lib/systems/inspect.nix b/lib/systems/inspect.nix
index 90a1fb6d80c..8fa63057250 100644
--- a/lib/systems/inspect.nix
+++ b/lib/systems/inspect.nix
@@ -33,7 +33,7 @@ rec {
 
     isBSD          = { kernel = { families = { inherit (kernelFamilies) bsd; }; }; };
     isDarwin       = { kernel = { families = { inherit (kernelFamilies) darwin; }; }; };
-    isUnix         = [ isBSD isDarwin isLinux isSunOS isCygwin ];
+    isUnix         = [ isBSD isDarwin isLinux isSunOS isCygwin isRedox ];
 
     isMacOS        = { kernel = kernels.macos; };
     isiOS          = { kernel = kernels.ios; };
@@ -46,6 +46,7 @@ rec {
     isCygwin       = { kernel = kernels.windows; abi = abis.cygnus; };
     isMinGW        = { kernel = kernels.windows; abi = abis.gnu; };
     isWasi         = { kernel = kernels.wasi; };
+    isRedox        = { kernel = kernels.redox; };
     isGhcjs        = { kernel = kernels.ghcjs; };
     isGenode       = { kernel = kernels.genode; };
     isNone         = { kernel = kernels.none; };
diff --git a/lib/systems/parse.nix b/lib/systems/parse.nix
index 648e7c27024..6bd44a00746 100644
--- a/lib/systems/parse.nix
+++ b/lib/systems/parse.nix
@@ -277,6 +277,7 @@ rec {
     openbsd = { execFormat = elf;     families = { inherit bsd; }; };
     solaris = { execFormat = elf;     families = { }; };
     wasi    = { execFormat = wasm;    families = { }; };
+    redox   = { execFormat = elf;     families = { }; };
     windows = { execFormat = pe;      families = { }; };
     ghcjs   = { execFormat = unknown; families = { }; };
     genode  = { execFormat = elf;     families = { }; };
@@ -390,6 +391,8 @@ rec {
         then { cpu = elemAt l 0; vendor = elemAt l 1; kernel = "windows";                    }
       else if (elemAt l 2 == "wasi")
         then { cpu = elemAt l 0; vendor = elemAt l 1; kernel = "wasi";                       }
+      else if (elemAt l 2 == "redox")
+        then { cpu = elemAt l 0; vendor = elemAt l 1; kernel = "redox";                      }
       else if hasPrefix "netbsd" (elemAt l 2)
         then { cpu = elemAt l 0; vendor = elemAt l 1;    kernel = elemAt l 2;                }
       else if (elem (elemAt l 2) ["eabi" "eabihf" "elf"])
diff --git a/lib/tests/systems.nix b/lib/tests/systems.nix
index ea6e337937f..ea8ceedd43f 100644
--- a/lib/tests/systems.nix
+++ b/lib/tests/systems.nix
@@ -12,22 +12,23 @@ let
     expected = lib.sort lib.lessThan y;
   };
 in with lib.systems.doubles; lib.runTests {
-  testall = mseteq all (linux ++ darwin ++ freebsd ++ openbsd ++ netbsd ++ illumos ++ wasi ++ windows ++ embedded ++ js ++ genode);
+  testall = mseteq all (linux ++ darwin ++ freebsd ++ openbsd ++ netbsd ++ illumos ++ wasi ++ windows ++ embedded ++ js ++ genode ++ redox);
 
   testarm = mseteq arm [ "armv5tel-linux" "armv6l-linux" "armv6l-none" "armv7a-linux" "armv7l-linux" "arm-none" "armv7a-darwin" ];
   testi686 = mseteq i686 [ "i686-linux" "i686-freebsd" "i686-netbsd" "i686-openbsd" "i686-cygwin" "i686-windows" "i686-none" "i686-darwin" ];
   testmips = mseteq mips [ "mipsel-linux" ];
-  testx86_64 = mseteq x86_64 [ "x86_64-linux" "x86_64-darwin" "x86_64-freebsd" "x86_64-genode" "x86_64-openbsd" "x86_64-netbsd" "x86_64-cygwin" "x86_64-solaris" "x86_64-windows" "x86_64-none" ];
+  testx86_64 = mseteq x86_64 [ "x86_64-linux" "x86_64-darwin" "x86_64-freebsd" "x86_64-genode" "x86_64-redox" "x86_64-openbsd" "x86_64-netbsd" "x86_64-cygwin" "x86_64-solaris" "x86_64-windows" "x86_64-none" ];
 
   testcygwin = mseteq cygwin [ "i686-cygwin" "x86_64-cygwin" ];
   testdarwin = mseteq darwin [ "x86_64-darwin" "i686-darwin" "aarch64-darwin" "armv7a-darwin" ];
   testfreebsd = mseteq freebsd [ "i686-freebsd" "x86_64-freebsd" ];
   testgenode = mseteq genode [ "aarch64-genode" "x86_64-genode" ];
+  testredox = mseteq redox [ "x86_64-redox" ];
   testgnu = mseteq gnu (linux /* ++ kfreebsd ++ ... */);
   testillumos = mseteq illumos [ "x86_64-solaris" ];
   testlinux = mseteq linux [ "aarch64-linux" "armv5tel-linux" "armv6l-linux" "armv7a-linux" "armv7l-linux" "i686-linux" "mipsel-linux" "riscv32-linux" "riscv64-linux" "x86_64-linux" "powerpc64le-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);
+  testunix = mseteq unix (linux ++ darwin ++ freebsd ++ openbsd ++ netbsd ++ illumos ++ cygwin ++ redox);
 }