@@ -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+})