diff --git a/pkgs/os-specific/darwin/apple-source-releases/CF/default.nix b/pkgs/os-specific/darwin/apple-source-releases/CF/default.nix index ed35f8590bf6..55c8279340b7 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/CF/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/CF/default.nix @@ -8,7 +8,6 @@ appleDerivation { patches = [ ./add-cf-initialize.patch ./add-cfmachport.patch ./cf-bridging.patch ]; - # CFAttributedString.h is in the SDK only, not on opensource.apple.com or github __propagatedImpureHostDeps = [ "/System/Library/Frameworks/CoreFoundation.framework" "/usr/lib/libc++.1.dylib" @@ -30,6 +29,10 @@ appleDerivation { --replace 'chown -RH -f root:wheel $(DSTBASE)/CoreFoundation.framework' "" \ --replace 'chmod -RH' 'chmod -R' + # with this file present, CoreFoundation gets a _main symbol defined, which can + # interfere with linking other programs + rm plconvert.c + replacement=''$'#define __PTK_FRAMEWORK_COREFOUNDATION_KEY5 55\n#define _pthread_getspecific_direct(key) pthread_getspecific((key))\n#define _pthread_setspecific_direct(key, val) pthread_setspecific((key), (val))' substituteInPlace CFPlatform.c --replace "#include " "$replacement"