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:
John Ericson
2017-05-22 00:25:02 -04:00
parent 2e7ec6fb70
commit c5c6606048
3 changed files with 19 additions and 12 deletions
+6
View File
@@ -21,6 +21,12 @@ rec {
config = parse.tripleFromSystem final.parsed;
# Just a guess, based on `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
// args;
in final;