git.iko.soy/typeable/nixpkgs
on master help sign in
darwin.cf-private: include headers from osx_private_sdk

This includes things like CFURLGetFSRef which are not part of the swift-corelibs CoreFoundation.

commit0fcd2ca7b2e313f88687037a835555b31a0892b6 authorDaiderd Jordan <daiderd@gmail.com> dateWed 24 Oct 2018, 12:04 (8 years ago) parent6d746f7
2 files changed+13−9
pkgs/os-specific/darwin/cf-private/default.nix+9−7 pkgs/top-level/darwin-packages.nix+4−2
pkgs/os-specific/darwin/cf-private/default.nix+9−7
@@ -1,4 +1,4 @@
1−{ CF, apple_sdk }:
1+{ CF, apple_sdk, osx_private_sdk }:
22
33# cf-private is a bit weird, but boils down to CF with a weird setup-hook that
44# makes a build link against the system CoreFoundation rather than our pure one.
@@ -13,10 +13,10 @@
1313# because of their magic "toll-free bridging" support, the symbols for those types
1414# live in CoreFoundation with an ObjC runtime. And because that isn't public, we have
1515# this hack in place to let people link properly anyway. Phew!
16−#
16+#
1717# This can be revisited if Apple ever decide to release the ObjC backend in a publicly
1818# buildable form.
19−#
19+#
2020# This doesn't really need to rebuild CF, but it's cheap, and adding a setup hook to
2121# an existing package was annoying. We need a buildEnv that knows how to add those
2222CF.overrideAttrs (orig: {
@@ -38,22 +38,24 @@ CF.overrideAttrs (orig: {
3838 # this is watchman, who can almost certainly switch to the pure CF once the header
3939 # and functionality is merged in.
4040 installPhase = orig.installPhase + ''
41+ # Copy or overwrite private headers, some of these might already
42+ # exist in CF but the private versions have more information.
4143 basepath="Library/Frameworks/CoreFoundation.framework/Headers"
42− path="$basepath/CFFileDescriptor.h"
44+ cp -Lfv --no-preserve mode ${osx_private_sdk}/include/CoreFoundationPrivateHeaders/* "$out/$basepath"
4345
4446 # Append the include at top level or nobody will notice the header we're about to add
4547 sed -i '/CFNotificationCenter.h/a #include <CoreFoundation/CFFileDescriptor.h>' \
4648 "$out/$basepath/CoreFoundation.h"
4749
48− cp ${apple_sdk.frameworks.CoreFoundation}/$path $out/$path
50+ cp ${apple_sdk.frameworks.CoreFoundation}/$basepath/CFFileDescriptor.h $out/$basepath/CFFileDescriptor.h
4951 '' +
5052 # This one is less likely to go away, but I'll mention it anyway. The issue is at
5153 # https://bugs.swift.org/browse/SR-8744, and the main user I know of is qtbase
5254 ''
53− path="$basepath/CFURLEnumerator.h"
55+ path="$basepath/CFURLEnumerator.h"
5456 sed -i '/CFNotificationCenter.h/a #include <CoreFoundation/CFURLEnumerator.h>' \
5557 "$out/$basepath/CoreFoundation.h"
5658
5759 cp ${apple_sdk.frameworks.CoreFoundation}/$path $out/$path
5860 '';
59−})
61+})
pkgs/top-level/darwin-packages.nix+4−2
@@ -31,7 +31,9 @@ in
3131 libcxxabi = pkgs.libcxxabi;
3232 };
3333
34− cf-private = callPackage ../os-specific/darwin/cf-private { inherit (darwin) CF apple_sdk; };
34+ cf-private = callPackage ../os-specific/darwin/cf-private {
35+ inherit (darwin) CF apple_sdk osx_private_sdk;
36+ };
3537
3638 DarwinTools = callPackage ../os-specific/darwin/DarwinTools { };
3739
@@ -74,7 +76,7 @@ in
7476 CoreSymbolication = callPackage ../os-specific/darwin/CoreSymbolication { };
7577
7678 CF = callPackage ../os-specific/darwin/swift-corelibs/corefoundation.nix { inherit (darwin) objc4 ICU; };
77−
79+
7880 # As the name says, this is broken, but I don't want to lose it since it's a direction we want to go in
7981 # libdispatch-broken = callPackage ../os-specific/darwin/swift-corelibs/libdispatch.nix { inherit (darwin) apple_sdk_sierra xnu; };
8082