Skip to content

Commit

Permalink
darwin-packages: avoid exporting attributes that don't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
thefloweringash committed Apr 28, 2021
1 parent 50ef311 commit 6fe3a10
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions pkgs/top-level/darwin-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,18 @@ let
# SDK.
useAppleSDKLibs = stdenv.hostPlatform.isAarch64;

chooseLibs = {
inherit (
selectAttrs = attrs: names:
lib.listToAttrs (lib.concatMap (n: if attrs ? "${n}" then [(lib.nameValuePair n attrs."${n}")] else []) names);

chooseLibs = (
# There are differences in which libraries are exported. Avoid evaluation
# errors when a package is not provided.
selectAttrs (
if useAppleSDKLibs
then apple_sdk
else appleSourcePackages
) Libsystem LibsystemCross libcharset libunwind objc4 configd IOKit;

) ["Libsystem" "LibsystemCross" "libcharset" "libunwind" "objc4" "configd" "IOKit"]
) // {
inherit (
if useAppleSDKLibs
then apple_sdk.frameworks
Expand Down

0 comments on commit 6fe3a10

Please sign in to comment.