summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorDaiderd Jordan <daiderd@gmail.com>2018-10-24 12:04:05 +0200
committerDaiderd Jordan <daiderd@gmail.com>2018-10-24 12:04:05 +0200
commit0fcd2ca7b2e313f88687037a835555b31a0892b6 (patch)
treece06c9ffdc5a0b2ea128d808ccb6d2c2767ff129 /pkgs
parent6d746f7d4ac820815cdef6d43285e932a89817d9 (diff)
downloadnixpkgs-0fcd2ca7b2e313f88687037a835555b31a0892b6.tar
nixpkgs-0fcd2ca7b2e313f88687037a835555b31a0892b6.tar.gz
nixpkgs-0fcd2ca7b2e313f88687037a835555b31a0892b6.tar.bz2
nixpkgs-0fcd2ca7b2e313f88687037a835555b31a0892b6.tar.lz
nixpkgs-0fcd2ca7b2e313f88687037a835555b31a0892b6.tar.xz
nixpkgs-0fcd2ca7b2e313f88687037a835555b31a0892b6.tar.zst
nixpkgs-0fcd2ca7b2e313f88687037a835555b31a0892b6.zip
darwin.cf-private: include headers from osx_private_sdk
This includes things like CFURLGetFSRef which are not part of the
swift-corelibs CoreFoundation.
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/os-specific/darwin/cf-private/default.nix16
-rw-r--r--pkgs/top-level/darwin-packages.nix6
2 files changed, 13 insertions, 9 deletions
diff --git a/pkgs/os-specific/darwin/cf-private/default.nix b/pkgs/os-specific/darwin/cf-private/default.nix
index 3fac20d23c7..dc1b0112a21 100644
--- a/pkgs/os-specific/darwin/cf-private/default.nix
+++ b/pkgs/os-specific/darwin/cf-private/default.nix
@@ -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
 # makes a build link against the system CoreFoundation rather than our pure one.
@@ -13,10 +13,10 @@
 # because of their magic "toll-free bridging" support, the symbols for those types
 # live in CoreFoundation with an ObjC runtime. And because that isn't public, we have
 # this hack in place to let people link properly anyway. Phew!
-# 
+#
 # This can be revisited if Apple ever decide to release the ObjC backend in a publicly
 # buildable form.
-# 
+#
 # This doesn't really need to rebuild CF, but it's cheap, and adding a setup hook to
 # an existing package was annoying. We need a buildEnv that knows how to add those
 CF.overrideAttrs (orig: {
@@ -38,22 +38,24 @@ CF.overrideAttrs (orig: {
   # this is watchman, who can almost certainly switch to the pure CF once the header
   # and functionality is merged in.
   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"
-    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
     sed -i '/CFNotificationCenter.h/a #include <CoreFoundation/CFFileDescriptor.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
   # https://bugs.swift.org/browse/SR-8744, and the main user I know of is qtbase
   ''
-    path="$basepath/CFURLEnumerator.h"    
+    path="$basepath/CFURLEnumerator.h"
     sed -i '/CFNotificationCenter.h/a #include <CoreFoundation/CFURLEnumerator.h>' \
       "$out/$basepath/CoreFoundation.h"
 
     cp ${apple_sdk.frameworks.CoreFoundation}/$path $out/$path
   '';
-})
\ No newline at end of file
+})
diff --git a/pkgs/top-level/darwin-packages.nix b/pkgs/top-level/darwin-packages.nix
index 3bf7c31b700..78ca0d20908 100644
--- a/pkgs/top-level/darwin-packages.nix
+++ b/pkgs/top-level/darwin-packages.nix
@@ -31,7 +31,9 @@ in
     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 { };
 
@@ -74,7 +76,7 @@ in
   CoreSymbolication = callPackage ../os-specific/darwin/CoreSymbolication { };
 
   CF = callPackage ../os-specific/darwin/swift-corelibs/corefoundation.nix { inherit (darwin) objc4 ICU; };
-  
+
   # 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
   # libdispatch-broken = callPackage ../os-specific/darwin/swift-corelibs/libdispatch.nix { inherit (darwin) apple_sdk_sierra xnu; };