darwin.cf-private: include headers from osx_private_sdk

This includes things like CFURLGetFSRef which are not part of the
swift-corelibs CoreFoundation.
This commit is contained in:
Daiderd Jordan 2018-10-24 12:04:05 +02:00
parent 6d746f7d4a
commit 0fcd2ca7b2
No known key found for this signature in database
GPG Key ID: D02435D05B810C96
2 changed files with 13 additions and 9 deletions

View File

@ -1,4 +1,4 @@
{ CF, apple_sdk }: { CF, apple_sdk, osx_private_sdk }:
# cf-private is a bit weird, but boils down to CF with a weird setup-hook that # cf-private is a bit weird, but boils down to CF with a weird setup-hook that
# makes a build link against the system CoreFoundation rather than our pure one. # makes a build link against the system CoreFoundation rather than our pure one.
@ -38,14 +38,16 @@ CF.overrideAttrs (orig: {
# this is watchman, who can almost certainly switch to the pure CF once the header # this is watchman, who can almost certainly switch to the pure CF once the header
# and functionality is merged in. # and functionality is merged in.
installPhase = orig.installPhase + '' installPhase = orig.installPhase + ''
# Copy or overwrite private headers, some of these might already
# exist in CF but the private versions have more information.
basepath="Library/Frameworks/CoreFoundation.framework/Headers" basepath="Library/Frameworks/CoreFoundation.framework/Headers"
path="$basepath/CFFileDescriptor.h" cp -Lfv --no-preserve mode ${osx_private_sdk}/include/CoreFoundationPrivateHeaders/* "$out/$basepath"
# Append the include at top level or nobody will notice the header we're about to add # Append the include at top level or nobody will notice the header we're about to add
sed -i '/CFNotificationCenter.h/a #include <CoreFoundation/CFFileDescriptor.h>' \ sed -i '/CFNotificationCenter.h/a #include <CoreFoundation/CFFileDescriptor.h>' \
"$out/$basepath/CoreFoundation.h" "$out/$basepath/CoreFoundation.h"
cp ${apple_sdk.frameworks.CoreFoundation}/$path $out/$path cp ${apple_sdk.frameworks.CoreFoundation}/$basepath/CFFileDescriptor.h $out/$basepath/CFFileDescriptor.h
'' + '' +
# This one is less likely to go away, but I'll mention it anyway. The issue is at # This one is less likely to go away, but I'll mention it anyway. The issue is at
# https://bugs.swift.org/browse/SR-8744, and the main user I know of is qtbase # https://bugs.swift.org/browse/SR-8744, and the main user I know of is qtbase

View File

@ -31,7 +31,9 @@ in
libcxxabi = pkgs.libcxxabi; libcxxabi = pkgs.libcxxabi;
}; };
cf-private = callPackage ../os-specific/darwin/cf-private { inherit (darwin) CF apple_sdk; }; cf-private = callPackage ../os-specific/darwin/cf-private {
inherit (darwin) CF apple_sdk osx_private_sdk;
};
DarwinTools = callPackage ../os-specific/darwin/DarwinTools { }; DarwinTools = callPackage ../os-specific/darwin/DarwinTools { };