diff options
Diffstat (limited to 'pkgs/os-specific/darwin')
-rw-r--r-- | pkgs/os-specific/darwin/apple-sdk/cf-setup-hook.sh (renamed from pkgs/os-specific/darwin/cf-private/setup-hook.sh) | 9 | ||||
-rw-r--r-- | pkgs/os-specific/darwin/apple-sdk/default.nix | 8 | ||||
-rw-r--r-- | pkgs/os-specific/darwin/apple-sdk/frameworks.nix | 79 | ||||
-rw-r--r-- | pkgs/os-specific/darwin/cf-private/default.nix | 58 | ||||
-rw-r--r-- | pkgs/os-specific/darwin/trash/default.nix | 9 |
5 files changed, 51 insertions, 112 deletions
diff --git a/pkgs/os-specific/darwin/cf-private/setup-hook.sh b/pkgs/os-specific/darwin/apple-sdk/cf-setup-hook.sh index ae9ed5d158457..66e24fe587701 100644 --- a/pkgs/os-specific/darwin/cf-private/setup-hook.sh +++ b/pkgs/os-specific/darwin/apple-sdk/cf-setup-hook.sh @@ -1,12 +1,9 @@ -prependSearchPath() { - NIX_CFLAGS_COMPILE="-F@out@/Library/Frameworks ${NIX_CFLAGS_COMPILE}" -} - -linkWithRealCF() { +linkSystemCoreFoundationFramework() { + NIX_CFLAGS_COMPILE="-F@out@/Library/Frameworks $NIX_CFLAGS_COMPILE" # 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/Versions/A/CoreFoundation" } -preConfigureHooks+=(prependSearchPath linkWithRealCF) +preConfigureHooks+=(linkSystemCoreFoundationFramework) diff --git a/pkgs/os-specific/darwin/apple-sdk/default.nix b/pkgs/os-specific/darwin/apple-sdk/default.nix index 2e3ae22e0b236..4d33fc0f3f88c 100644 --- a/pkgs/os-specific/darwin/apple-sdk/default.nix +++ b/pkgs/os-specific/darwin/apple-sdk/default.nix @@ -156,7 +156,7 @@ in rec { __propagatedImpureHostDeps = [ "/usr/lib/libXplugin.1.dylib" ]; propagatedBuildInputs = with frameworks; [ - OpenGL ApplicationServices Carbon IOKit pkgs.darwin.CF CoreGraphics CoreServices CoreText + OpenGL ApplicationServices Carbon IOKit CoreGraphics CoreServices CoreText ]; installPhase = '' @@ -187,6 +187,10 @@ in rec { ]; }); + CoreFoundation = stdenv.lib.overrideDerivation super.CoreFoundation (drv: { + setupHook = ./cf-setup-hook.sh; + }); + CoreMedia = stdenv.lib.overrideDerivation super.CoreMedia (drv: { __propagatedImpureHostDeps = drv.__propagatedImpureHostDeps ++ [ "/System/Library/Frameworks/CoreImage.framework" @@ -222,7 +226,7 @@ in rec { bareFrameworks = stdenv.lib.mapAttrs framework (import ./frameworks.nix { inherit frameworks libs; - inherit (pkgs.darwin) CF cf-private libobjc; + inherit (pkgs.darwin) libobjc; }); frameworks = bareFrameworks // overrides bareFrameworks; diff --git a/pkgs/os-specific/darwin/apple-sdk/frameworks.nix b/pkgs/os-specific/darwin/apple-sdk/frameworks.nix index 03c800b8dae5a..c803bf421871b 100644 --- a/pkgs/os-specific/darwin/apple-sdk/frameworks.nix +++ b/pkgs/os-specific/darwin/apple-sdk/frameworks.nix @@ -2,81 +2,81 @@ # Epic weird knot-tying happening here. # TODO: clean up the process for generating this and include it -{ frameworks, libs, CF, libobjc, cf-private }: +{ frameworks, libs, libobjc, }: with frameworks; with libs; { AGL = [ Carbon OpenGL ]; AVFoundation = [ ApplicationServices CoreGraphics ]; AVKit = []; Accounts = []; - AddressBook = [ Carbon CF ]; + AddressBook = [ Carbon ]; AppKit = [ AudioToolbox AudioUnit Foundation QuartzCore ]; AppKitScripting = []; AppleScriptKit = []; AppleScriptObjC = []; - AudioToolbox = [ CoreAudio CF CoreMIDI ]; - AudioUnit = [ AudioToolbox Carbon CoreAudio CF ]; + AudioToolbox = [ CoreAudio CoreMIDI ]; + AudioUnit = [ AudioToolbox Carbon CoreAudio ]; AudioVideoBridging = [ Foundation ]; Automator = []; - CFNetwork = [ CF ]; + CFNetwork = []; CalendarStore = []; Cocoa = [ AppKit ]; Collaboration = []; # Impure version of CoreFoundation, this should not be used unless another # framework includes headers that are not available in the pure version. CoreFoundation = []; - CoreAudio = [ CF IOKit ]; + CoreAudio = [ IOKit ]; CoreAudioKit = [ AudioUnit ]; CoreData = []; - CoreGraphics = [ Accelerate CF IOKit IOSurface SystemConfiguration ]; - CoreImage = [ ]; + CoreGraphics = [ Accelerate IOKit IOSurface SystemConfiguration ]; + CoreImage = []; CoreLocation = []; - CoreMIDI = [ CF ]; + CoreMIDI = []; CoreMIDIServer = []; - CoreMedia = [ ApplicationServices AudioToolbox AudioUnit CoreAudio CF CoreGraphics CoreVideo ]; - CoreMediaIO = [ CF CoreMedia ]; - CoreText = [ CF CoreGraphics ]; - CoreVideo = [ ApplicationServices CF CoreGraphics IOSurface OpenGL ]; + CoreMedia = [ ApplicationServices AudioToolbox AudioUnit CoreAudio CoreGraphics CoreVideo ]; + CoreMediaIO = [ CoreMedia ]; + CoreText = [ CoreGraphics ]; + CoreVideo = [ ApplicationServices CoreGraphics IOSurface OpenGL ]; CoreWLAN = [ SecurityFoundation ]; DVDPlayback = []; - DirectoryService = [ CF ]; - DiscRecording = [ CF CoreServices IOKit ]; + DirectoryService = []; + DiscRecording = [ CoreServices IOKit ]; DiscRecordingUI = []; - DiskArbitration = [ CF IOKit ]; + DiskArbitration = [ IOKit ]; EventKit = []; ExceptionHandling = []; FWAUserLib = []; - ForceFeedback = [ CF IOKit ]; - Foundation = [ cf-private libobjc Security ApplicationServices SystemConfiguration ]; - GLKit = [ CF ]; + ForceFeedback = [ IOKit ]; + Foundation = [ libobjc CoreFoundation Security ApplicationServices SystemConfiguration ]; + GLKit = []; GLUT = [ OpenGL ]; GSS = []; GameController = []; GameKit = [ Foundation ]; Hypervisor = []; - ICADevices = [ Carbon CF IOBluetooth ]; + ICADevices = [ Carbon IOBluetooth ]; IMServicePlugIn = []; IOBluetoothUI = [ IOBluetooth ]; - IOKit = [ CF ]; - IOSurface = [ CF IOKit xpc ]; + IOKit = []; + IOSurface = [ IOKit xpc ]; ImageCaptureCore = []; - ImageIO = [ CF CoreGraphics ]; + ImageIO = [ CoreGraphics ]; InputMethodKit = [ Carbon ]; InstallerPlugins = []; InstantMessage = []; JavaFrameEmbedding = []; - JavaScriptCore = [ CF ]; + JavaScriptCore = []; Kerberos = []; - Kernel = [ CF IOKit ]; + Kernel = [ IOKit ]; LDAP = []; - LatentSemanticMapping = [ Carbon CF ]; + LatentSemanticMapping = [ Carbon ]; MapKit = []; - MediaAccessibility = [ CF CoreGraphics CoreText QuartzCore ]; - MediaToolbox = [ AudioToolbox AudioUnit CF CoreMedia ]; + MediaAccessibility = [ CoreGraphics CoreText QuartzCore ]; + MediaToolbox = [ AudioToolbox AudioUnit CoreMedia ]; Metal = []; MetalKit = [ ModelIO Metal ]; ModelIO = [ ]; - NetFS = [ CF ]; + NetFS = []; OSAKit = [ Carbon ]; OpenAL = []; OpenCL = [ IOSurface OpenGL ]; @@ -85,37 +85,38 @@ with frameworks; with libs; { PreferencePanes = []; PubSub = []; QTKit = [ CoreMediaIO CoreMedia MediaToolbox QuickTime VideoToolbox ]; - QuickLook = [ ApplicationServices CF ]; + QuickLook = [ ApplicationServices ]; SceneKit = []; ScreenSaver = []; Scripting = []; ScriptingBridge = []; - Security = [ CF IOKit ]; + Security = [ IOKit ]; SecurityFoundation = []; SecurityInterface = [ Security ]; - ServiceManagement = [ CF Security ]; + ServiceManagement = [ Security ]; Social = []; SpriteKit = []; StoreKit = []; SyncServices = []; - SystemConfiguration = [ CF Security ]; + SystemConfiguration = [ Security ]; TWAIN = [ Carbon ]; Tcl = []; - VideoDecodeAcceleration = [ CF CoreVideo ]; - VideoToolbox = [ CF CoreMedia CoreVideo ]; + VideoDecodeAcceleration = [ CoreVideo ]; + VideoToolbox = [ CoreMedia CoreVideo ]; WebKit = [ ApplicationServices Carbon JavaScriptCore OpenGL ]; # Umbrellas Accelerate = [ CoreWLAN IOBluetooth ]; - ApplicationServices = [ CF CoreServices CoreText ImageIO ]; - Carbon = [ ApplicationServices CF CoreServices Foundation IOKit Security QuartzCore ]; + ApplicationServices = [ CoreServices CoreText ImageIO ]; + Carbon = [ ApplicationServices CoreServices Foundation IOKit Security QuartzCore ]; CoreBluetooth = []; - CoreServices = [ CFNetwork CoreAudio CoreData CF DiskArbitration Security NetFS OpenDirectory ServiceManagement ]; + # TODO: figure out which part of the umbrella depends on CoreFoundation and move it there. + CoreServices = [ CFNetwork CoreFoundation CoreAudio CoreData DiskArbitration Security NetFS OpenDirectory ServiceManagement ]; IOBluetooth = [ IOKit ]; JavaVM = []; OpenDirectory = []; Quartz = [ QuickLook QTKit ]; - QuartzCore = [ ApplicationServices CF CoreVideo OpenCL CoreImage Metal ]; + QuartzCore = [ ApplicationServices CoreVideo OpenCL CoreImage Metal ]; QuickTime = [ ApplicationServices AudioUnit Carbon CoreAudio CoreServices OpenGL QuartzCore ]; vmnet = []; diff --git a/pkgs/os-specific/darwin/cf-private/default.nix b/pkgs/os-specific/darwin/cf-private/default.nix deleted file mode 100644 index eb5f651a1a08c..0000000000000 --- a/pkgs/os-specific/darwin/cf-private/default.nix +++ /dev/null @@ -1,58 +0,0 @@ -{ CF, apple_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. -# The reason it exists is that although our CF headers and build are pretty legit -# now, the underlying runtime is quite different. Apple's in a bit of flux around CF -# right now, and support three different backends for it: swift, "C", and an ObjC -# one. The former two can be built from public sources, but the ObjC one isn't really -# public. Unfortunately, it's also one of the core underpinnings of a lot of Mac- -# specific behavior, and defines a lot of symbols that some Objective C apps depend -# on, even though one might expect those symbols to derive from Foundation. So if -# your app relies on NSArray and several other basic ObjC types, it turns out that -# 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: { - # PLEASE if you add things to this derivation, explain in reasonable detail why - # you're adding them and when the workaround can go away. This whole derivation is - # a workaround and if you don't explain what you're working around, it makes it - # very hard for people to clean it up later. - - name = "${orig.name}-private"; - setupHook = ./setup-hook.sh; - - # TODO: consider re-adding https://github.com/NixOS/nixpkgs/blob/master/pkgs/os-specific/darwin/apple-source-releases/CF/cf-bridging.patch - # once the missing headers are in and see if that fixes all need for this. - - # This can go away once https://bugs.swift.org/browse/SR-8741 happens, which is - # looking more likely these days with the friendly people at Apple! We only need - # the header because the setup hook takes care of linking us against a version - # of the framework with the functionality built into it. The main user I know of - # this is watchman, who can almost certainly switch to the pure CF once the header - # and functionality is merged in. - installPhase = orig.installPhase + '' - basepath="Library/Frameworks/CoreFoundation.framework/Headers" - - # 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}/$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" - sed -i '/CFNotificationCenter.h/a #include <CoreFoundation/CFURLEnumerator.h>' \ - "$out/$basepath/CoreFoundation.h" - - cp ${apple_sdk.frameworks.CoreFoundation}/$path $out/$path - ''; -}) diff --git a/pkgs/os-specific/darwin/trash/default.nix b/pkgs/os-specific/darwin/trash/default.nix index 4044ee4d0ddc4..fcbcfe00a3e7c 100644 --- a/pkgs/os-specific/darwin/trash/default.nix +++ b/pkgs/os-specific/darwin/trash/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchFromGitHub, perl, cf-private, AppKit, Cocoa, ScriptingBridge }: +{ stdenv, fetchFromGitHub, perl, AppKit, Cocoa, ScriptingBridge }: stdenv.mkDerivation rec { version = "0.9.2"; @@ -11,12 +11,7 @@ stdenv.mkDerivation rec { sha256 = "1d3rc03vgz32faj7qi18iiggxvxlqrj9lsk5jkpa9r1mcs5d89my"; }; - buildInputs = [ - perl - Cocoa AppKit ScriptingBridge - # Neded for OBJC_CLASS_$_NSMutableArray symbols. - cf-private - ]; + buildInputs = [ perl Cocoa AppKit ScriptingBridge ]; patches = [ ./trash.diff ]; |