summary refs log tree commit diff
path: root/pkgs/stdenv
diff options
context:
space:
mode:
authorWill Dietz <w@wdtz.org>2018-01-12 16:19:22 -0600
committerWill Dietz <w@wdtz.org>2018-02-13 09:44:42 -0600
commit4b6b83f159e1f2e03a1001ec31ce4fcf62d2cd8e (patch)
treeb4b42a642008126c5926be026135318e75ddfc56 /pkgs/stdenv
parent4aca016313e08370757ac33dd15e15afe986ea13 (diff)
downloadnixpkgs-4b6b83f159e1f2e03a1001ec31ce4fcf62d2cd8e.tar
nixpkgs-4b6b83f159e1f2e03a1001ec31ce4fcf62d2cd8e.tar.gz
nixpkgs-4b6b83f159e1f2e03a1001ec31ce4fcf62d2cd8e.tar.bz2
nixpkgs-4b6b83f159e1f2e03a1001ec31ce4fcf62d2cd8e.tar.lz
nixpkgs-4b6b83f159e1f2e03a1001ec31ce4fcf62d2cd8e.tar.xz
nixpkgs-4b6b83f159e1f2e03a1001ec31ce4fcf62d2cd8e.tar.zst
nixpkgs-4b6b83f159e1f2e03a1001ec31ce4fcf62d2cd8e.zip
linux stdenv: find bootstrap files by libc, then arch
Diffstat (limited to 'pkgs/stdenv')
-rw-r--r--pkgs/stdenv/linux/default.nix31
1 files changed, 20 insertions, 11 deletions
diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix
index da12eed7d64..a214f8a02c3 100644
--- a/pkgs/stdenv/linux/default.nix
+++ b/pkgs/stdenv/linux/default.nix
@@ -6,17 +6,26 @@
 { lib
 , localSystem, crossSystem, config, overlays
 
-, bootstrapFiles ? if localSystem.libc == "musl" then import ./bootstrap-files/musl64.nix
-else { # switch
-    "i686-linux" = import ./bootstrap-files/i686.nix;
-    "x86_64-linux" = import ./bootstrap-files/x86_64.nix;
-    "armv5tel-linux" = import ./bootstrap-files/armv5tel.nix;
-    "armv6l-linux" = import ./bootstrap-files/armv6l.nix;
-    "armv7l-linux" = import ./bootstrap-files/armv7l.nix;
-    "aarch64-linux" = import ./bootstrap-files/aarch64.nix;
-    "mips64el-linux" = import ./bootstrap-files/loongson2f.nix;
-  }.${localSystem.system}
-    or (abort "unsupported platform for the pure Linux stdenv")
+, bootstrapFiles ?
+  let table = {
+    "glibc" = {
+      "i686-linux" = import ./bootstrap-files/i686.nix;
+      "x86_64-linux" = import ./bootstrap-files/x86_64.nix;
+      "armv5tel-linux" = import ./bootstrap-files/armv5tel.nix;
+      "armv6l-linux" = import ./bootstrap-files/armv6l.nix;
+      "armv7l-linux" = import ./bootstrap-files/armv7l.nix;
+      "aarch64-linux" = import ./bootstrap-files/aarch64.nix;
+      "mips64el-linux" = import ./bootstrap-files/loongson2f.nix;
+    };
+    "musl" = {
+      "x86_64-linux" = import ./bootstrap-files/musl64.nix;
+    };
+  };
+  archLookupTable = table.${localSystem.libc}
+    or (abort "unsupported libc for the pure Linux stdenv");
+  files = archLookupTable.${localSystem.system}
+    or (abort "unsupported platform for the pure Linux stdenv");
+  in files
 }:
 
 assert crossSystem == null;