From 52dbd3380e0e9328d69c4abaae2d28b3e7e76bce Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Fri, 19 Oct 2018 11:47:43 -0500 Subject: [PATCH] systems/parse.nix: support weird system configs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There are some weird ones out there that don’t follow any pattern: - arm-none-eabi - powerpc-none-eabi - aarch64-none-elf --- lib/systems/parse.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/systems/parse.nix b/lib/systems/parse.nix index 058d4bed9085..a390a098c60f 100644 --- a/lib/systems/parse.nix +++ b/lib/systems/parse.nix @@ -119,6 +119,7 @@ rec { apple = {}; pc = {}; + none = {}; unknown = {}; }; @@ -202,6 +203,7 @@ rec { cygnus = {}; msvc = {}; eabi = {}; + elf = {}; androideabi = {}; android = { @@ -263,6 +265,8 @@ rec { "2" = # We only do 2-part hacks for things Nix already supports if elemAt l 1 == "cygwin" then { cpu = elemAt l 0; kernel = "windows"; abi = "cygnus"; } + else if (elemAt l 1 == "eabi") + then { cpu = elemAt l 0; vendor = "none"; kernel = "none"; abi = elemAt l 1; } else { cpu = elemAt l 0; kernel = elemAt l 1; }; "3" = # Awkwards hacks, beware! if elemAt l 1 == "apple" @@ -273,6 +277,10 @@ rec { then { cpu = elemAt l 0; vendor = elemAt l 1; kernel = "windows"; abi = "gnu"; } else if hasPrefix "netbsd" (elemAt l 2) then { cpu = elemAt l 0; vendor = elemAt l 1; kernel = elemAt l 2; } + else if (elemAt l 2 == "eabi") + then { cpu = elemAt l 0; vendor = elemAt l 1; kernel = "none"; abi = elemAt l 2; } + else if (elemAt l 2 == "elf") + then { cpu = elemAt l 0; vendor = elemAt l 1; kernel = "none"; abi = elemAt l 2; } else throw "Target specification with 3 components is ambiguous"; "4" = { cpu = elemAt l 0; vendor = elemAt l 1; kernel = elemAt l 2; abi = elemAt l 3; }; }.${toString (length l)}