aboutsummaryrefslogtreecommitdiff
path: root/lib/systems/parse.nix
diff options
context:
space:
mode:
authorMatthew Bauer <mjbauer95@gmail.com>2019-01-29 21:01:24 -0500
committerMatthew Bauer <mjbauer95@gmail.com>2019-04-23 21:48:57 -0400
commit9abff4af4f07c16aecd89bf82051afbc3228d6fd (patch)
tree7a8d8fe316db1636819a43a28192da740ea835c8 /lib/systems/parse.nix
parent6088a4793f2a83921b197a9185034934fcd96d02 (diff)
wasm: init cross target
Adds pkgsCross.wasm32 and pkgsCross.wasm64. Use it to build Nixpkgs with a WebAssembly toolchain. stdenv/cross: use static overlay on isWasm isWasm doesnโ€™t make sense dynamically linked.
Diffstat (limited to '')
-rw-r--r--lib/systems/parse.nix4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/systems/parse.nix b/lib/systems/parse.nix
index 3e23a721f0d..522a3bf71af 100644
--- a/lib/systems/parse.nix
+++ b/lib/systems/parse.nix
@@ -226,6 +226,7 @@ rec {
elf = {};
macho = {};
pe = {};
+ wasm = {};
unknown = {};
};
@@ -268,6 +269,7 @@ rec {
none = { execFormat = unknown; families = { }; };
openbsd = { execFormat = elf; families = { inherit bsd; }; };
solaris = { execFormat = elf; families = { }; };
+ wasi = { execFormat = wasm; families = { }; };
windows = { execFormat = pe; families = { }; };
} // { # aliases
# 'darwin' is the kernel for all of them. We choose macOS by default.
@@ -376,6 +378,8 @@ rec {
then { cpu = elemAt l 0; kernel = elemAt l 1; abi = elemAt l 2; }
else if (elemAt l 2 == "mingw32") # autotools breaks on -gnu for window
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 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"])