diff --git a/pkgs/os-specific/darwin/apple-sdk/default.nix b/pkgs/os-specific/darwin/apple-sdk/default.nix index 47dce7b6620..ea899b6abcf 100644 --- a/pkgs/os-specific/darwin/apple-sdk/default.nix +++ b/pkgs/os-specific/darwin/apple-sdk/default.nix @@ -34,7 +34,7 @@ let cd Library/Frameworks/QuartzCore.framework/Versions/A/Headers for file in CI*.h; do rm $file - ln -s ../Frameworks/CoreImage.framework/Versions/A/Headers/$file + ln -s ../Frameworks/CoreImage.framework/Headers/$file done ''; @@ -151,10 +151,6 @@ in rec { }; overrides = super: { - CoreText = stdenv.lib.overrideDerivation super.CoreText (drv: { - propagatedNativeBuildInputs = drv.propagatedNativeBuildInputs ++ [ pkgs.darwin.cf-private ]; - }); - QuartzCore = stdenv.lib.overrideDerivation super.QuartzCore (drv: { installPhase = drv.installPhase + '' f="$out/Library/Frameworks/QuartzCore.framework/Headers/CoreImage.h" diff --git a/pkgs/os-specific/darwin/cf-private/default.nix b/pkgs/os-specific/darwin/cf-private/default.nix index 8c91e7fb297..17b2861a107 100644 --- a/pkgs/os-specific/darwin/cf-private/default.nix +++ b/pkgs/os-specific/darwin/cf-private/default.nix @@ -3,16 +3,28 @@ let headers = [ "CFAttributedString.h" + "CFFileDescriptor.h" + "CFFileSecurity.h" "CFNotificationCenter.h" + "CFStringTokenizer.h" + "CFURLEnumerator.h" "CoreFoundation.h" ]; in stdenv.mkDerivation { name = "${CF.name}-private"; - unpackPhase = ":"; - buildPhase = ":"; + phases = [ "installPhase" "fixupPhase" ]; installPhase = '' - mkdir -p $out/include/CoreFoundation - install -m 0644 ${osx_private_sdk}/PrivateSDK10.10.sparse.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/{${stdenv.lib.concatStringsSep "," headers}} $out/include/CoreFoundation + dest=$out/Library/Frameworks/CoreFoundation.framework/Headers + mkdir -p $dest + pushd $dest + for file in ${CF}/Library/Frameworks/CoreFoundation.framework/Headers/*; do + ln -s $file + done + popd + + install -m 0644 ${osx_private_sdk}/PrivateSDK10.10.sparse.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/{${stdenv.lib.concatStringsSep "," headers}} $dest ''; + + setupHook = ./setup-hook.sh; } diff --git a/pkgs/os-specific/darwin/cf-private/setup-hook.sh b/pkgs/os-specific/darwin/cf-private/setup-hook.sh new file mode 100644 index 00000000000..a83a1323bf8 --- /dev/null +++ b/pkgs/os-specific/darwin/cf-private/setup-hook.sh @@ -0,0 +1,12 @@ +prependSearchPath() { + NIX_CFLAGS_COMPILE="-F@out@/Library/Frameworks ${NIX_CFLAGS_COMPILE/"-F@out@/Library/Frameworks"/}" +} + +linkWithRealCF() { + # gross! many symbols (such as _OBJC_CLASS_$_NSArray) are defined in system CF, but not + # in the opensource release + # if the package needs private headers, we assume they also want to link with system CF + NIX_LDFLAGS+=" /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation" +} + +preConfigureHooks+=(prependSearchPath linkWithRealCF)