cf-private: prepend self to system includes

This commit is contained in:
Jude Taylor 2015-10-26 17:12:45 -07:00
parent 0a23e412b4
commit 5ea8770263
3 changed files with 29 additions and 9 deletions

View File

@ -34,7 +34,7 @@ let
cd Library/Frameworks/QuartzCore.framework/Versions/A/Headers cd Library/Frameworks/QuartzCore.framework/Versions/A/Headers
for file in CI*.h; do for file in CI*.h; do
rm $file rm $file
ln -s ../Frameworks/CoreImage.framework/Versions/A/Headers/$file ln -s ../Frameworks/CoreImage.framework/Headers/$file
done done
''; '';
@ -151,10 +151,6 @@ in rec {
}; };
overrides = super: { overrides = super: {
CoreText = stdenv.lib.overrideDerivation super.CoreText (drv: {
propagatedNativeBuildInputs = drv.propagatedNativeBuildInputs ++ [ pkgs.darwin.cf-private ];
});
QuartzCore = stdenv.lib.overrideDerivation super.QuartzCore (drv: { QuartzCore = stdenv.lib.overrideDerivation super.QuartzCore (drv: {
installPhase = drv.installPhase + '' installPhase = drv.installPhase + ''
f="$out/Library/Frameworks/QuartzCore.framework/Headers/CoreImage.h" f="$out/Library/Frameworks/QuartzCore.framework/Headers/CoreImage.h"

View File

@ -3,16 +3,28 @@
let let
headers = [ headers = [
"CFAttributedString.h" "CFAttributedString.h"
"CFFileDescriptor.h"
"CFFileSecurity.h"
"CFNotificationCenter.h" "CFNotificationCenter.h"
"CFStringTokenizer.h"
"CFURLEnumerator.h"
"CoreFoundation.h" "CoreFoundation.h"
]; ];
in stdenv.mkDerivation { in stdenv.mkDerivation {
name = "${CF.name}-private"; name = "${CF.name}-private";
unpackPhase = ":"; phases = [ "installPhase" "fixupPhase" ];
buildPhase = ":";
installPhase = '' installPhase = ''
mkdir -p $out/include/CoreFoundation dest=$out/Library/Frameworks/CoreFoundation.framework/Headers
install -m 0644 ${osx_private_sdk}/PrivateSDK10.10.sparse.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/{${stdenv.lib.concatStringsSep "," headers}} $out/include/CoreFoundation 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;
} }

View File

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