summary refs log tree commit diff
path: root/pkgs/top-level
diff options
context:
space:
mode:
authorJohn Ericson <Ericson2314@yahoo.com>2017-05-22 13:30:20 -0400
committerGitHub <noreply@github.com>2017-05-22 13:30:20 -0400
commit0d88299019bcd0611ec7356e7e380d9706f09f9d (patch)
treefdcabf9744f1169270a06e5b170ee00a6d9b9d4c /pkgs/top-level
parent37c89aaaa7948574529e05a88d42d5343d1053c9 (diff)
parent1dc6f15de995da2d0351b34c40215336e219cf82 (diff)
downloadnixlib-0d88299019bcd0611ec7356e7e380d9706f09f9d.tar
nixlib-0d88299019bcd0611ec7356e7e380d9706f09f9d.tar.gz
nixlib-0d88299019bcd0611ec7356e7e380d9706f09f9d.tar.bz2
nixlib-0d88299019bcd0611ec7356e7e380d9706f09f9d.tar.lz
nixlib-0d88299019bcd0611ec7356e7e380d9706f09f9d.tar.xz
nixlib-0d88299019bcd0611ec7356e7e380d9706f09f9d.tar.zst
nixlib-0d88299019bcd0611ec7356e7e380d9706f09f9d.zip
Merge pull request #25976 from obsidiansystems/no-stdenv-is
Add `*Platform.is*` predicates and alias `stdenv.is*` to `hostPlatform`'s
Diffstat (limited to 'pkgs/top-level')
-rw-r--r--pkgs/top-level/all-packages.nix24
1 files changed, 14 insertions, 10 deletions
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 84f15fccfecd..d72af8b24c8b 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -6461,7 +6461,7 @@ with pkgs;
   bin_replace_string = callPackage ../development/tools/misc/bin_replace_string { };
 
   binutils =
-    if lib.systems.parse.isDarwin targetPlatform.parsed
+    if targetPlatform.isDarwin
     then darwin.binutils
     else binutils-raw;
 
@@ -8719,15 +8719,19 @@ with pkgs;
 
   libgsf = callPackage ../development/libraries/libgsf { };
 
-  # glibc provides libiconv so systems with glibc don't need to build libiconv
-  # separately, but we also provide libiconvReal, which will always be a
-  # standalone libiconv, just in case you want it
-  libiconv = if stdenv ? cross then
-    (if stdenv.cross.libc == "glibc" then libcCross
-      else if stdenv.cross.libc == "libSystem" then darwin.libiconv
-      else libiconvReal)
-    else if stdenv.isGlibc then glibcIconv stdenv.cc.libc
-    else if stdenv.isDarwin then darwin.libiconv
+  # GNU libc provides libiconv so systems with glibc don't need to build
+  # libiconv separately. Additionally, Apple forked/repackaged libiconv so we
+  # use that instead of the vanilla version on that OS.
+  #
+  # We also provide `libiconvReal`, which will always be a standalone libiconv,
+  # just in case you want it regardless of platform.
+  libiconv =
+    if hostPlatform.libc == "glibc"
+      then glibcIconv (if hostPlatform != buildPlatform
+                       then libcCross
+                       else stdenv.cc.libc)
+    else if hostPlatform.isDarwin
+      then darwin.libiconv
     else libiconvReal;
 
   glibcIconv = libc: let