lib: Infer libc
field of platform if not specified
This is especially useful when not cross compiling. It means we can remove the `stdenv.isGlibc` predicate too. Additionally, use this to simplify the logic to choose the appropriate libiconv derivation.
This commit is contained in:
parent
2e7ec6fb70
commit
c5c6606048
@ -21,6 +21,12 @@ rec {
|
|||||||
config = parse.tripleFromSystem final.parsed;
|
config = parse.tripleFromSystem final.parsed;
|
||||||
# Just a guess, based on `system`
|
# Just a guess, based on `system`
|
||||||
platform = platforms.selectBySystem final.system;
|
platform = platforms.selectBySystem final.system;
|
||||||
|
libc =
|
||||||
|
/**/ if final.isDarwin then "libSystem"
|
||||||
|
else if final.isMinGW then "msvcrt"
|
||||||
|
else if final.isLinux then "glibc"
|
||||||
|
# TODO(@Ericson2314) think more about other operating systems
|
||||||
|
else "native/impure";
|
||||||
} // mapAttrs (n: v: v final.parsed) inspect.predicates
|
} // mapAttrs (n: v: v final.parsed) inspect.predicates
|
||||||
// args;
|
// args;
|
||||||
in final;
|
in final;
|
||||||
|
@ -402,9 +402,6 @@ let
|
|||||||
|| system == "aarch64-linux"
|
|| system == "aarch64-linux"
|
||||||
|| system == "mips64el-linux";
|
|| system == "mips64el-linux";
|
||||||
isGNU = system == "i686-gnu"; # GNU/Hurd
|
isGNU = system == "i686-gnu"; # GNU/Hurd
|
||||||
isGlibc = isGNU # useful for `stdenvNative'
|
|
||||||
|| isLinux
|
|
||||||
|| system == "x86_64-kfreebsd-gnu";
|
|
||||||
isSunOS = system == "i686-solaris"
|
isSunOS = system == "i686-solaris"
|
||||||
|| system == "x86_64-solaris";
|
|| system == "x86_64-solaris";
|
||||||
isCygwin = system == "i686-cygwin"
|
isCygwin = system == "i686-cygwin"
|
||||||
|
@ -8653,15 +8653,19 @@ with pkgs;
|
|||||||
|
|
||||||
libgsf = callPackage ../development/libraries/libgsf { };
|
libgsf = callPackage ../development/libraries/libgsf { };
|
||||||
|
|
||||||
# glibc provides libiconv so systems with glibc don't need to build libiconv
|
# GNU libc provides libiconv so systems with glibc don't need to build
|
||||||
# separately, but we also provide libiconvReal, which will always be a
|
# libiconv separately. Additionally, Apple forked/repackaged libiconv so we
|
||||||
# standalone libiconv, just in case you want it
|
# use that instead of the vanilla version on that OS.
|
||||||
libiconv = if stdenv ? cross then
|
#
|
||||||
(if stdenv.cross.libc == "glibc" then libcCross
|
# We also provide `libiconvReal`, which will always be a standalone libiconv,
|
||||||
else if stdenv.cross.libc == "libSystem" then darwin.libiconv
|
# just in case you want it regardless of platform.
|
||||||
else libiconvReal)
|
libiconv =
|
||||||
else if stdenv.isGlibc then glibcIconv stdenv.cc.libc
|
if hostPlatform.libc == "glibc"
|
||||||
else if stdenv.isDarwin then darwin.libiconv
|
then glibcIconv (if hostPlatform != buildPlatform
|
||||||
|
then libcCross
|
||||||
|
else stdenv.cc.libc)
|
||||||
|
else if hostPlatform.isDarwin
|
||||||
|
then darwin.libiconv
|
||||||
else libiconvReal;
|
else libiconvReal;
|
||||||
|
|
||||||
glibcIconv = libc: let
|
glibcIconv = libc: let
|
||||||
|
Loading…
x
Reference in New Issue
Block a user