···18with lib.lists;
19with lib.types;
20with lib.attrsets;
021with (import ./inspect.nix { inherit lib; }).predicates;
2223let
···179 } // { # aliases
180 # 'darwin' is the kernel for all of them. We choose macOS by default.
181 darwin = kernels.macos;
182- # TODO(@Ericson2314): Handle these Darwin version suffixes more generally.
183- darwin10 = kernels.macos;
184- darwin14 = kernels.macos;
185 watchos = kernels.ios;
186 tvos = kernels.ios;
187 win32 = kernels.windows;
···269 then { cpu = elemAt l 0; kernel = elemAt l 1; abi = elemAt l 2; }
270 else if (elemAt l 2 == "mingw32") # autotools breaks on -gnu for window
271 then { cpu = elemAt l 0; vendor = elemAt l 1; kernel = "windows"; abi = "gnu"; }
00272 else throw "Target specification with 3 components is ambiguous";
273 "4" = { cpu = elemAt l 0; vendor = elemAt l 1; kernel = elemAt l 2; abi = elemAt l 3; };
274 }.${toString (length l)}
···295 else if isDarwin parsed then vendors.apple
296 else if isWindows parsed then vendors.pc
297 else vendors.unknown;
298- kernel = getKernel args.kernel;
00299 abi =
300 /**/ if args ? abi then getAbi args.abi
301 else if isLinux parsed then
···18with lib.lists;
19with lib.types;
20with lib.attrsets;
21+with lib.strings;
22with (import ./inspect.nix { inherit lib; }).predicates;
2324let
···180 } // { # aliases
181 # 'darwin' is the kernel for all of them. We choose macOS by default.
182 darwin = kernels.macos;
000183 watchos = kernels.ios;
184 tvos = kernels.ios;
185 win32 = kernels.windows;
···267 then { cpu = elemAt l 0; kernel = elemAt l 1; abi = elemAt l 2; }
268 else if (elemAt l 2 == "mingw32") # autotools breaks on -gnu for window
269 then { cpu = elemAt l 0; vendor = elemAt l 1; kernel = "windows"; abi = "gnu"; }
270+ else if hasPrefix "netbsd" (elemAt l 2)
271+ then { cpu = elemAt l 0; vendor = elemAt l 1; kernel = elemAt l 2; }
272 else throw "Target specification with 3 components is ambiguous";
273 "4" = { cpu = elemAt l 0; vendor = elemAt l 1; kernel = elemAt l 2; abi = elemAt l 3; };
274 }.${toString (length l)}
···295 else if isDarwin parsed then vendors.apple
296 else if isWindows parsed then vendors.pc
297 else vendors.unknown;
298+ kernel = if hasPrefix "darwin" args.kernel then getKernel "darwin"
299+ else if hasPrefix "netbsd" args.kernel then getKernel "netbsd"
300+ else getKernel args.kernel;
301 abi =
302 /**/ if args ? abi then getAbi args.abi
303 else if isLinux parsed then