lib: Make platform predicates more ergonomic to use

`hostPlatform.isDarwin` instead of `lib.system.parse.isDarwin
hostPlatform.parsed`
This commit is contained in:
John Ericson
2017-05-22 00:25:02 -04:00
parent da8b2f1412
commit 2e7ec6fb70
6 changed files with 71 additions and 43 deletions
+3 -5
View File
@@ -5,17 +5,15 @@
}:
let
inherit (stdenv.lib.systems.parse) isDarwin;
prefix = stdenv.lib.optionalString
(targetPlatform != hostPlatform)
"${targetPlatform.config}-";
in
assert isDarwin targetPlatform.parsed;
assert targetPlatform.isDarwin;
# Non-Darwin alternatives
assert (!isDarwin hostPlatform.parsed) -> (maloader != null && xctoolchain != null);
assert (!hostPlatform.isDarwin) -> (maloader != null && xctoolchain != null);
let
baseParams = rec {
@@ -91,7 +89,7 @@ let
'';
postInstall =
if isDarwin hostPlatform.parsed
if hostPlatform.isDarwin
then ''
cat >$out/bin/dsymutil << EOF
#!${stdenv.shell}