apple_sdk_11_0: generate frameworks.nix

+399 -338
+87 -31
pkgs/os-specific/darwin/apple-sdk-11.0/apple_sdk.nix
··· 160 }; 161 }; 162 163 - overrides = super: { 164 - CoreFoundation = lib.overrideDerivation super.CoreFoundation (drv: { 165 - setupHook = ./cf-setup-hook.sh; 166 - }); 167 168 - # This framework doesn't exist in newer SDKs (somewhere around 10.13), but 169 - # there are references to it in nixpkgs. 170 - QuickTime = throw "QuickTime framework not available"; 171 172 - # Seems to be appropriate given https://developer.apple.com/forums/thread/666686 173 - JavaVM = super.JavaNativeFoundation; 174 175 - CoreVideo = lib.overrideDerivation super.CoreVideo (drv: { 176 - installPhase = drv.installPhase + '' 177 - # When used as a module, complains about a missing import for 178 - # Darwin.C.stdint. Apparently fixed in later SDKs. 179 - awk -i inplace '/CFBase.h/ { print "#include <stdint.h>" } { print }' \ 180 - $out/Library/Frameworks/CoreVideo.framework/Headers/CVBase.h 181 - ''; 182 - }); 183 - }; 184 185 - bareFrameworks = ( 186 - lib.mapAttrs framework (import ./frameworks.nix { 187 - inherit frameworks libs; 188 - inherit (pkgs.darwin.apple_sdk_11_0) libnetwork; 189 - libobjc = pkgs.darwin.apple_sdk_11_0.objc4; 190 - }) 191 - ) // ( 192 - lib.mapAttrs privateFramework (import ./private-frameworks.nix { 193 - inherit frameworks; 194 - libobjc = pkgs.darwin.apple_sdk_11_0.objc4; 195 - }) 196 - ); 197 198 - frameworks = bareFrameworks // overrides bareFrameworks; 199 }
··· 160 }; 161 }; 162 163 + frameworks = let 164 + # Dependency map created by gen-frameworks.py. 165 + generatedDeps = import ./frameworks.nix { 166 + inherit frameworks libs; 167 + }; 168 169 + # Additional dependencies that are not picked up by gen-frameworks.py. 170 + # Some of these are simply private frameworks the generator does not see. 171 + extraDeps = with libs; with frameworks; let 172 + inherit (pkgs.darwin.apple_sdk_11_0) libnetwork; 173 + libobjc = pkgs.darwin.apple_sdk_11_0.objc4; 174 + in { 175 + # Below this comment are entries migrated from before the generator was 176 + # added. If, for a given framework, you are able to reverify the extra 177 + # deps are really necessary on top of the generator deps, move it above 178 + # this comment (and maybe document your findings). 179 + AVFoundation = { inherit ApplicationServices AVFCapture AVFCore; }; 180 + Accelerate = { inherit CoreWLAN IOBluetooth; }; 181 + AddressBook = { inherit AddressBookCore ContactsPersistence libobjc; }; 182 + AppKit = { inherit AudioToolbox AudioUnit UIFoundation; }; 183 + AudioToolbox = { inherit AudioToolboxCore; }; 184 + AudioUnit = { inherit Carbon CoreAudio; }; 185 + Carbon = { inherit IOKit QuartzCore libobjc; }; 186 + CoreAudio = { inherit IOKit; }; 187 + CoreFoundation = { inherit libobjc; }; 188 + CoreGraphics = { inherit Accelerate IOSurface SystemConfiguration; }; 189 + CoreMIDIServer = { inherit CoreMIDI; }; 190 + CoreMedia = { inherit ApplicationServices AudioToolbox AudioUnit; }; 191 + CoreServices = { inherit CoreAudio CoreData NetFS OpenDirectory ServiceManagement; }; 192 + CoreWLAN = { inherit SecurityFoundation; }; 193 + DiscRecording = { inherit IOKit libobjc; }; 194 + Foundation = { inherit SystemConfiguration libobjc; }; 195 + GameKit = { inherit GameCenterFoundation GameCenterUI GameCenterUICore ReplayKit; }; 196 + ICADevices = { inherit Carbon libobjc; }; 197 + IOBluetooth = { inherit CoreBluetooth; }; 198 + JavaScriptCore = { inherit libobjc; }; 199 + Kernel = { inherit IOKit; }; 200 + LinkPresentation = { inherit URLFormatting; }; 201 + MediaToolbox = { inherit AudioUnit; }; 202 + MetricKit = { inherit SignpostMetrics; }; 203 + Network = { inherit libnetwork; }; 204 + PCSC = { inherit CoreData; }; 205 + PassKit = { inherit PassKitCore; }; 206 + QTKit = { inherit CoreMedia CoreMediaIO MediaToolbox VideoToolbox; }; 207 + Quartz = { inherit QTKit; }; 208 + QuartzCore = { inherit ApplicationServices CoreImage CoreVideo Metal OpenCL libobjc; }; 209 + Security = { inherit IOKit libDER; }; 210 + TWAIN = { inherit Carbon; }; 211 + VideoDecodeAcceleration = { inherit CoreVideo; }; 212 + WebKit = { inherit ApplicationServices Carbon libobjc; }; 213 + }; 214 215 + # Overrides for framework derivations. 216 + overrides = super: { 217 + CoreFoundation = lib.overrideDerivation super.CoreFoundation (drv: { 218 + setupHook = ./cf-setup-hook.sh; 219 + }); 220 221 + # This framework doesn't exist in newer SDKs (somewhere around 10.13), but 222 + # there are references to it in nixpkgs. 223 + QuickTime = throw "QuickTime framework not available"; 224 + 225 + # Seems to be appropriate given https://developer.apple.com/forums/thread/666686 226 + JavaVM = super.JavaNativeFoundation; 227 + 228 + CoreVideo = lib.overrideDerivation super.CoreVideo (drv: { 229 + installPhase = drv.installPhase + '' 230 + # When used as a module, complains about a missing import for 231 + # Darwin.C.stdint. Apparently fixed in later SDKs. 232 + awk -i inplace '/CFBase.h/ { print "#include <stdint.h>" } { print }' \ 233 + $out/Library/Frameworks/CoreVideo.framework/Headers/CVBase.h 234 + ''; 235 + }); 236 + }; 237 238 + # Merge extraDeps into generatedDeps. 239 + deps = generatedDeps // ( 240 + lib.mapAttrs 241 + (name: deps: generatedDeps.${name} // deps) 242 + extraDeps 243 + ); 244 245 + # Create derivations, and add private frameworks. 246 + bareFrameworks = (lib.mapAttrs framework deps) // ( 247 + lib.mapAttrs privateFramework (import ./private-frameworks.nix { 248 + inherit frameworks; 249 + libobjc = pkgs.darwin.apple_sdk_11_0.objc4; 250 + }) 251 + ); 252 + in 253 + # Apply derivation overrides. 254 + bareFrameworks // overrides bareFrameworks; 255 }
+171 -168
pkgs/os-specific/darwin/apple-sdk-11.0/frameworks.nix
··· 1 - { frameworks, libs, libobjc, libnetwork }: with frameworks; with libs; 2 { 3 AGL = { inherit Carbon OpenGL; }; 4 - AVFoundation = { inherit ApplicationServices AVFCapture AVFCore CoreGraphics simd UniformTypeIdentifiers; }; 5 - AVKit = {}; 6 - Accelerate = { inherit CoreWLAN IOBluetooth; }; 7 - Accessibility = {}; 8 - Accounts = {}; 9 - AdSupport = {}; 10 - AddressBook = { inherit AddressBookCore Carbon ContactsPersistence libobjc; }; 11 - AppKit = { inherit ApplicationServices AudioToolbox AudioUnit Foundation QuartzCore UIFoundation; }; 12 - AppTrackingTransparency = {}; 13 AppleScriptKit = {}; 14 - AppleScriptObjC = {}; 15 - ApplicationServices = { inherit ColorSync CoreGraphics CoreServices CoreText ImageIO; }; 16 - AudioToolbox = { inherit AudioToolboxCore CoreAudio CoreMIDI; }; 17 - AudioUnit = { inherit AudioToolbox Carbon CoreAudio; }; 18 - AudioVideoBridging = { inherit Foundation; }; 19 - AuthenticationServices = {}; 20 - AutomaticAssessmentConfiguration = {}; 21 - Automator = {}; 22 - BackgroundTasks = {}; 23 - BusinessChat = {}; 24 - CFNetwork = {}; 25 CalendarStore = {}; 26 - CallKit = {}; 27 - Carbon = { inherit ApplicationServices CoreServices Foundation IOKit QuartzCore Security libobjc; }; 28 - ClassKit = {}; 29 - CloudKit = { inherit CoreLocation; }; 30 - Cocoa = { inherit AppKit CoreData; }; 31 - Collaboration = {}; 32 - ColorSync = {}; 33 Combine = {}; 34 - Contacts = {}; 35 - ContactsUI = {}; 36 - CoreAudio = { inherit IOKit CoreAudioTypes; }; 37 - CoreAudioKit = { inherit AudioUnit; }; 38 - CoreAudioTypes = {}; 39 - CoreBluetooth = {}; 40 - CoreData = { inherit CloudKit; }; 41 CoreDisplay = {}; 42 - CoreFoundation = { inherit libobjc; }; 43 - CoreGraphics = { inherit Accelerate IOKit IOSurface SystemConfiguration; }; 44 - CoreHaptics = {}; 45 - CoreImage = {}; 46 - CoreLocation = {}; 47 - CoreMIDI = {}; 48 - CoreMIDIServer = { inherit CoreMIDI; }; 49 - CoreML = {}; 50 - CoreMedia = { inherit ApplicationServices AudioToolbox AudioUnit CoreAudio CoreGraphics CoreVideo; }; 51 - CoreMediaIO = { inherit CoreMedia; }; 52 - CoreMotion = {}; 53 - CoreServices = { inherit CFNetwork CoreAudio CoreData CoreFoundation DiskArbitration NetFS OpenDirectory Security ServiceManagement; }; 54 - CoreSpotlight = {}; 55 CoreTelephony = {}; 56 - CoreText = { inherit CoreGraphics; }; 57 - CoreVideo = { inherit ApplicationServices CoreGraphics IOSurface OpenGL; }; 58 - CoreWLAN = { inherit SecurityFoundation; }; 59 - CryptoKit = {}; 60 - CryptoTokenKit = {}; 61 - DVDPlayback = {}; 62 - DeveloperToolsSupport = {}; 63 - DeviceCheck = {}; 64 - DirectoryService = {}; 65 - DiscRecording = { inherit CoreServices IOKit libobjc; }; 66 - DiscRecordingUI = {}; 67 - DiskArbitration = { inherit IOKit; }; 68 DriverKit = {}; 69 - EventKit = {}; 70 - ExceptionHandling = {}; 71 - ExecutionPolicy = {}; 72 - ExternalAccessory = {}; 73 - FWAUserLib = {}; 74 - FileProvider = {}; 75 - FileProviderUI = {}; 76 - FinderSync = {}; 77 - ForceFeedback = { inherit IOKit; }; 78 - Foundation = { inherit ApplicationServices CoreFoundation Security SystemConfiguration Combine libobjc; }; 79 - GLKit = {}; 80 GLUT = { inherit OpenGL; }; 81 - GSS = {}; 82 - GameController = {}; 83 - GameKit = { inherit Cocoa Foundation GameCenterFoundation GameCenterUI GameCenterUICore GameController GameplayKit Metal MetalKit ModelIO ReplayKit SceneKit SpriteKit; }; 84 - GameplayKit = {}; 85 - HIDDriverKit = {}; 86 Hypervisor = {}; 87 - ICADevices = { inherit Carbon IOBluetooth libobjc; }; 88 - IMServicePlugIn = {}; 89 - IOBluetooth = { inherit CoreBluetooth IOKit; }; 90 - IOBluetoothUI = { inherit IOBluetooth; }; 91 - IOKit = {}; 92 - IOSurface = { inherit IOKit; }; 93 - IOUSBHost = {}; 94 - IdentityLookup = {}; 95 - ImageCaptureCore = {}; 96 - ImageIO = { inherit CoreGraphics; }; 97 - InputMethodKit = { inherit Carbon; }; 98 InstallerPlugins = {}; 99 InstantMessage = {}; 100 - Intents = {}; 101 - JavaNativeFoundation = {}; 102 - JavaRuntimeSupport = {}; 103 - JavaScriptCore = { inherit libobjc; }; 104 Kerberos = {}; 105 - Kernel = { inherit IOKit; }; 106 - KernelManagement = {}; 107 LDAP = {}; 108 - LatentSemanticMapping = { inherit Carbon; }; 109 - LinkPresentation = { inherit URLFormatting; }; 110 - LocalAuthentication = {}; 111 - MLCompute = {}; 112 - MapKit = {}; 113 - MediaAccessibility = { inherit CoreGraphics CoreText QuartzCore; }; 114 - MediaLibrary = {}; 115 - MediaPlayer = {}; 116 - MediaToolbox = { inherit AudioToolbox AudioUnit CoreMedia; }; 117 Message = {}; 118 - Metal = {}; 119 - MetalKit = { inherit Metal ModelIO; }; 120 - MetalPerformanceShaders = {}; 121 - MetalPerformanceShadersGraph = {}; 122 - MetricKit = { inherit SignpostMetrics; }; 123 - ModelIO = {}; 124 - MultipeerConnectivity = {}; 125 - NaturalLanguage = {}; 126 - NearbyInteraction = {}; 127 - NetFS = {}; 128 - Network = { inherit libnetwork; }; 129 - NetworkExtension = { inherit Network; }; 130 NetworkingDriverKit = {}; 131 - NotificationCenter = {}; 132 - OSAKit = { inherit Carbon; }; 133 - OSLog = {}; 134 OpenAL = {}; 135 - OpenCL = { inherit IOSurface OpenGL; }; 136 - OpenDirectory = {}; 137 OpenGL = {}; 138 - PCIDriverKit = {}; 139 - PCSC = { inherit CoreData; }; 140 - PDFKit = {}; 141 - ParavirtualizedGraphics = {}; 142 - PassKit = { inherit PassKitCore; }; 143 - PencilKit = {}; 144 - Photos = {}; 145 - PhotosUI = {}; 146 - PreferencePanes = {}; 147 - PushKit = {}; 148 - Python = {}; 149 - QTKit = { inherit CoreMedia CoreMediaIO MediaToolbox VideoToolbox; }; 150 - Quartz = { inherit QTKit QuartzCore QuickLook PDFKit; }; 151 - QuartzCore = { inherit ApplicationServices CoreImage CoreVideo Metal OpenCL libobjc; }; 152 - QuickLook = { inherit ApplicationServices; }; 153 - QuickLookThumbnailing = {}; 154 - RealityKit = {}; 155 - ReplayKit = {}; 156 Ruby = {}; 157 - SafariServices = {}; 158 - SceneKit = {}; 159 - ScreenSaver = {}; 160 - ScreenTime = {}; 161 - ScriptingBridge = {}; 162 - Security = { inherit IOKit libDER; }; 163 - SecurityFoundation = { inherit Security; }; 164 - SecurityInterface = { inherit Security SecurityFoundation; }; 165 - SensorKit = {}; 166 - ServiceManagement = { inherit Security; }; 167 - Social = {}; 168 - SoundAnalysis = {}; 169 - Speech = {}; 170 - SpriteKit = {}; 171 - StoreKit = {}; 172 - SwiftUI = { inherit AppKit DeveloperToolsSupport UniformTypeIdentifiers; }; 173 SyncServices = {}; 174 System = {}; 175 - SystemConfiguration = { inherit Security; }; 176 - SystemExtensions = {}; 177 - TWAIN = { inherit Carbon; }; 178 Tcl = {}; 179 Tk = {}; 180 - USBDriverKit = {}; 181 - UniformTypeIdentifiers = {}; 182 - UserNotifications = {}; 183 - UserNotificationsUI = {}; 184 - VideoDecodeAcceleration = { inherit CoreVideo; }; 185 - VideoSubscriberAccount = {}; 186 - VideoToolbox = { inherit CoreMedia CoreVideo; }; 187 - Virtualization = {}; 188 - Vision = {}; 189 - WebKit = { inherit ApplicationServices Carbon JavaScriptCore OpenGL libobjc; }; 190 - WidgetKit = {}; 191 - iTunesLibrary = {}; 192 vmnet = {}; 193 }
··· 1 + # This file is generated by gen-frameworks.nix. 2 + # Do not edit, put overrides in apple_sdk.nix instead. 3 + { libs, frameworks }: with libs; with frameworks; 4 { 5 AGL = { inherit Carbon OpenGL; }; 6 + AVFoundation = { inherit AudioToolbox CoreAudio CoreAudioTypes CoreFoundation CoreGraphics CoreImage CoreMIDI CoreMedia CoreVideo Foundation IOKit ImageIO MediaToolbox Metal QuartzCore UniformTypeIdentifiers simd; }; 7 + AVKit = { inherit AVFoundation AppKit Cocoa Foundation; }; 8 + Accelerate = { inherit CoreFoundation CoreGraphics CoreVideo Foundation IOKit Metal; }; 9 + Accessibility = { inherit CoreGraphics Foundation; }; 10 + Accounts = { inherit Foundation; }; 11 + AdServices = { inherit Foundation; }; 12 + AdSupport = { inherit Foundation; }; 13 + AddressBook = { inherit Carbon Cocoa CoreFoundation Foundation; }; 14 + AppKit = { inherit ApplicationServices CloudKit CoreData CoreFoundation CoreGraphics CoreImage CoreLocation Foundation IOKit Metal OpenGL QuartzCore; }; 15 + AppTrackingTransparency = { inherit Foundation; }; 16 AppleScriptKit = {}; 17 + AppleScriptObjC = { inherit Foundation; }; 18 + ApplicationServices = { inherit ColorSync CoreFoundation CoreGraphics CoreServices CoreText ImageIO; }; 19 + AudioToolbox = { inherit Carbon CoreAudio CoreAudioTypes CoreFoundation CoreMIDI Foundation; }; 20 + AudioUnit = { inherit AudioToolbox; }; 21 + AudioVideoBridging = { inherit Foundation IOKit; }; 22 + AuthenticationServices = { inherit AppKit Foundation; }; 23 + AutomaticAssessmentConfiguration = { inherit Foundation; }; 24 + Automator = { inherit AppKit Cocoa Foundation OSAKit; }; 25 + BackgroundTasks = { inherit Foundation; }; 26 + BusinessChat = { inherit Cocoa Foundation; }; 27 + CFNetwork = { inherit CoreFoundation; }; 28 CalendarStore = {}; 29 + CallKit = { inherit CoreFoundation CoreGraphics Foundation IOKit; }; 30 + Carbon = { inherit ApplicationServices CoreServices Foundation Security; }; 31 + ClassKit = { inherit CoreGraphics Foundation; }; 32 + CloudKit = { inherit CoreFoundation CoreGraphics CoreLocation Foundation IOKit; }; 33 + Cocoa = { inherit AppKit CoreData Foundation; }; 34 + Collaboration = { inherit AppKit CoreServices Foundation; }; 35 + ColorSync = { inherit CoreFoundation; }; 36 Combine = {}; 37 + Contacts = { inherit CoreFoundation CoreGraphics Foundation IOKit; }; 38 + ContactsUI = { inherit AppKit; }; 39 + CoreAudio = { inherit CoreAudioTypes CoreFoundation; }; 40 + CoreAudioKit = { inherit AppKit AudioUnit Cocoa Foundation; }; 41 + CoreAudioTypes = { inherit CoreFoundation; }; 42 + CoreBluetooth = { inherit Foundation; }; 43 + CoreData = { inherit CloudKit Combine CoreFoundation CoreGraphics CoreLocation Foundation IOKit; }; 44 CoreDisplay = {}; 45 + CoreFoundation = {}; 46 + CoreGraphics = { inherit CoreFoundation IOKit; }; 47 + CoreHaptics = { inherit Foundation; }; 48 + CoreImage = { inherit ApplicationServices CoreFoundation CoreGraphics CoreVideo Foundation IOKit IOSurface ImageIO Metal OpenGL; }; 49 + CoreLocation = { inherit CoreFoundation CoreGraphics Foundation IOKit; }; 50 + CoreMIDI = { inherit CoreFoundation CoreGraphics Foundation IOKit; }; 51 + CoreMIDIServer = {}; 52 + CoreML = { inherit CoreFoundation CoreGraphics CoreVideo Foundation IOKit ImageIO Metal; }; 53 + CoreMedia = { inherit CoreAudio CoreAudioTypes CoreFoundation CoreGraphics CoreVideo Foundation IOKit Metal; }; 54 + CoreMediaIO = { inherit CoreFoundation CoreMedia; }; 55 + CoreMotion = { inherit Foundation; }; 56 + CoreServices = { inherit CFNetwork CoreFoundation DiskArbitration Security; }; 57 + CoreSpotlight = { inherit Foundation UniformTypeIdentifiers; }; 58 CoreTelephony = {}; 59 + CoreText = { inherit CoreFoundation CoreGraphics; }; 60 + CoreVideo = { inherit ApplicationServices CoreFoundation CoreGraphics IOSurface Metal OpenGL; }; 61 + CoreWLAN = { inherit Foundation IOKit; }; 62 + CryptoKit = { inherit CoreFoundation CoreGraphics Foundation IOKit LocalAuthentication Security; }; 63 + CryptoTokenKit = { inherit CoreFoundation CoreGraphics Foundation IOKit Security; }; 64 + DVDPlayback = { inherit ApplicationServices CoreFoundation Security; }; 65 + DeveloperToolsSupport = { inherit Foundation; }; 66 + DeviceCheck = { inherit Foundation; }; 67 + DirectoryService = { inherit CoreFoundation; }; 68 + DiscRecording = { inherit CoreServices Foundation; }; 69 + DiscRecordingUI = { inherit Carbon Cocoa DiscRecording; }; 70 + DiskArbitration = { inherit CoreFoundation IOKit; }; 71 DriverKit = {}; 72 + EventKit = { inherit CoreGraphics CoreLocation Foundation; }; 73 + ExceptionHandling = { inherit Foundation; }; 74 + ExecutionPolicy = { inherit Foundation; }; 75 + ExternalAccessory = { inherit Foundation; }; 76 + FWAUserLib = { inherit IOKit; }; 77 + FileProvider = { inherit CoreGraphics Foundation; }; 78 + FileProviderUI = { inherit AppKit FileProvider Foundation; }; 79 + FinderSync = { inherit AppKit Foundation; }; 80 + ForceFeedback = { inherit CoreFoundation IOKit; }; 81 + Foundation = { inherit ApplicationServices Combine CoreFoundation CoreGraphics CoreServices IOKit Security; }; 82 + GLKit = { inherit AppKit CloudKit CoreData CoreFoundation CoreGraphics CoreImage CoreLocation Foundation IOKit Metal ModelIO OpenGL QuartzCore simd; }; 83 GLUT = { inherit OpenGL; }; 84 + GSS = { inherit CoreFoundation; }; 85 + GameController = { inherit AppKit Foundation IOKit; }; 86 + GameKit = { inherit AppKit Cocoa Contacts CoreGraphics Foundation GameController GameplayKit Metal MetalKit ModelIO SceneKit SpriteKit simd; }; 87 + GameplayKit = { inherit AppKit CloudKit CoreData CoreFoundation CoreGraphics CoreImage CoreLocation Foundation GLKit IOKit Metal ModelIO QuartzCore SceneKit SpriteKit simd; }; 88 + HIDDriverKit = { inherit IOKit USBDriverKit; }; 89 Hypervisor = {}; 90 + ICADevices = { inherit CoreFoundation CoreGraphics CoreServices IOBluetooth; }; 91 + IMServicePlugIn = { inherit Foundation; }; 92 + IOBluetooth = { inherit CoreAudio CoreFoundation CoreServices Foundation IOKit; }; 93 + IOBluetoothUI = { inherit Cocoa IOBluetooth; }; 94 + IOKit = { inherit CoreFoundation; }; 95 + IOSurface = { inherit CoreFoundation Foundation IOKit; }; 96 + IOUSBHost = { inherit Foundation IOKit; }; 97 + IdentityLookup = { inherit Foundation; }; 98 + ImageCaptureCore = { inherit Cocoa CoreGraphics Foundation; }; 99 + ImageIO = { inherit CoreFoundation CoreGraphics; }; 100 + InputMethodKit = { inherit Carbon Cocoa Foundation; }; 101 InstallerPlugins = {}; 102 InstantMessage = {}; 103 + Intents = { inherit CoreFoundation CoreGraphics CoreLocation Foundation IOKit; }; 104 + JavaNativeFoundation = { inherit Foundation; }; 105 + JavaRuntimeSupport = { inherit ApplicationServices Cocoa Foundation QuartzCore; }; 106 + JavaScriptCore = { inherit CoreFoundation CoreGraphics Foundation; }; 107 Kerberos = {}; 108 + Kernel = {}; 109 + KernelManagement = { inherit Foundation; }; 110 LDAP = {}; 111 + LatentSemanticMapping = { inherit Carbon CoreFoundation; }; 112 + LinkPresentation = { inherit AppKit Foundation; }; 113 + LocalAuthentication = { inherit Foundation; }; 114 + MLCompute = { inherit CoreFoundation CoreGraphics Foundation IOKit Metal; }; 115 + MapKit = { inherit AppKit CloudKit CoreData CoreFoundation CoreGraphics CoreImage CoreLocation Foundation IOKit Metal QuartzCore; }; 116 + MediaAccessibility = { inherit CoreFoundation CoreGraphics CoreText QuartzCore; }; 117 + MediaLibrary = { inherit Foundation; }; 118 + MediaPlayer = { inherit AVFoundation CoreGraphics Foundation; }; 119 + MediaToolbox = { inherit AudioToolbox CoreFoundation CoreMedia; }; 120 Message = {}; 121 + Metal = { inherit CoreFoundation CoreGraphics Foundation IOKit IOSurface; }; 122 + MetalKit = { inherit AppKit CloudKit CoreData CoreFoundation CoreGraphics CoreImage CoreLocation Foundation IOKit Metal ModelIO QuartzCore simd; }; 123 + MetalPerformanceShaders = { inherit CoreGraphics Foundation Metal simd; }; 124 + MetalPerformanceShadersGraph = { inherit Foundation MetalPerformanceShaders; }; 125 + MetricKit = { inherit CoreFoundation CoreGraphics Foundation IOKit; }; 126 + ModelIO = { inherit CoreFoundation CoreGraphics Foundation IOKit simd; }; 127 + MultipeerConnectivity = { inherit Cocoa Foundation; }; 128 + NaturalLanguage = { inherit CoreFoundation CoreGraphics Foundation IOKit; }; 129 + NearbyInteraction = { inherit CoreFoundation CoreGraphics Foundation IOKit simd; }; 130 + NetFS = { inherit CoreFoundation; }; 131 + Network = { inherit CoreFoundation Foundation Security; }; 132 + NetworkExtension = { inherit Foundation Network Security; }; 133 NetworkingDriverKit = {}; 134 + NotificationCenter = { inherit AppKit Foundation; }; 135 + OSAKit = { inherit Carbon Cocoa; }; 136 + OSLog = { inherit CoreFoundation CoreGraphics Foundation IOKit; }; 137 OpenAL = {}; 138 + OpenCL = { inherit OpenGL; }; 139 + OpenDirectory = { inherit CoreFoundation Foundation; }; 140 OpenGL = {}; 141 + PCIDriverKit = { inherit IOKit; }; 142 + PCSC = {}; 143 + PDFKit = { inherit AppKit Cocoa; }; 144 + ParavirtualizedGraphics = { inherit AppKit CoreVideo Foundation IOSurface Metal; }; 145 + PassKit = { inherit AppKit Contacts CoreGraphics Foundation; }; 146 + PencilKit = { inherit AppKit CloudKit Cocoa CoreData CoreFoundation CoreGraphics CoreImage CoreLocation Foundation IOKit Metal QuartzCore; }; 147 + Photos = { inherit AVFoundation CoreAudio CoreFoundation CoreGraphics CoreImage CoreLocation CoreMIDI CoreMedia Foundation IOKit ImageIO Metal QuartzCore UniformTypeIdentifiers simd; }; 148 + PhotosUI = { inherit AppKit Foundation MapKit Photos; }; 149 + PreferencePanes = { inherit Cocoa; }; 150 + PushKit = { inherit Foundation; }; 151 + Python = { inherit Carbon; }; 152 + QTKit = {}; 153 + Quartz = { inherit AppKit ApplicationServices Cocoa Foundation ImageCaptureCore OpenGL PDFKit QuartzCore QuickLook; }; 154 + QuartzCore = { inherit CoreFoundation CoreGraphics CoreImage CoreVideo Foundation IOKit Metal OpenGL; }; 155 + QuickLook = { inherit ApplicationServices CoreFoundation; }; 156 + QuickLookThumbnailing = { inherit CoreGraphics Foundation UniformTypeIdentifiers; }; 157 + RealityKit = { inherit AVFoundation AppKit AudioToolbox CloudKit Combine CoreAudio CoreData CoreFoundation CoreGraphics CoreImage CoreLocation CoreMIDI CoreText Foundation IOKit Metal MultipeerConnectivity QuartzCore simd; }; 158 + ReplayKit = { inherit AVFoundation AppKit Foundation; }; 159 Ruby = {}; 160 + SafariServices = { inherit AppKit CloudKit CoreData CoreFoundation CoreGraphics CoreImage CoreLocation Foundation IOKit Metal QuartzCore; }; 161 + SceneKit = { inherit AppKit CloudKit CoreData CoreFoundation CoreGraphics CoreImage CoreLocation Foundation GLKit IOKit Metal ModelIO QuartzCore simd; }; 162 + ScreenSaver = { inherit AppKit Foundation; }; 163 + ScreenTime = { inherit AppKit Foundation; }; 164 + ScriptingBridge = { inherit ApplicationServices CoreServices Foundation; }; 165 + Security = { inherit CoreFoundation; }; 166 + SecurityFoundation = { inherit Foundation Security; }; 167 + SecurityInterface = { inherit AppKit Cocoa Security SecurityFoundation; }; 168 + SensorKit = { inherit CoreFoundation CoreLocation Foundation; }; 169 + ServiceManagement = { inherit CoreFoundation Security; }; 170 + Social = { inherit AppKit Foundation; }; 171 + SoundAnalysis = { inherit AVFoundation CoreML CoreMedia Foundation; }; 172 + Speech = { inherit AVFoundation CoreAudio CoreFoundation CoreGraphics CoreImage CoreMIDI CoreMedia Foundation IOKit Metal QuartzCore UniformTypeIdentifiers simd; }; 173 + SpriteKit = { inherit AppKit CloudKit Cocoa CoreData CoreFoundation CoreGraphics CoreImage CoreLocation Foundation GLKit IOKit Metal ModelIO QuartzCore simd; }; 174 + StoreKit = { inherit AppKit CoreGraphics Foundation; }; 175 + SwiftUI = { inherit AppKit CloudKit Combine CoreData CoreFoundation CoreGraphics CoreImage CoreLocation DeveloperToolsSupport Foundation IOKit Metal QuartzCore UniformTypeIdentifiers; }; 176 SyncServices = {}; 177 System = {}; 178 + SystemConfiguration = { inherit CoreFoundation Security; }; 179 + SystemExtensions = { inherit Foundation; }; 180 + TWAIN = {}; 181 Tcl = {}; 182 Tk = {}; 183 + USBDriverKit = { inherit IOKit; }; 184 + UniformTypeIdentifiers = { inherit CoreFoundation CoreGraphics Foundation IOKit; }; 185 + UserNotifications = { inherit Foundation; }; 186 + UserNotificationsUI = { inherit AppKit; }; 187 + VideoDecodeAcceleration = {}; 188 + VideoSubscriberAccount = { inherit Foundation; }; 189 + VideoToolbox = { inherit CoreFoundation CoreGraphics CoreMedia CoreVideo; }; 190 + Virtualization = { inherit CoreFoundation CoreGraphics Foundation IOKit; }; 191 + Vision = { inherit CoreAudio CoreFoundation CoreGraphics CoreML CoreMedia CoreVideo Foundation IOKit ImageIO Metal simd; }; 192 + WebKit = { inherit AppKit CloudKit CoreData CoreFoundation CoreGraphics CoreImage CoreLocation Foundation IOKit JavaScriptCore Metal OpenGL QuartzCore; }; 193 + WidgetKit = { inherit Combine CoreFoundation CoreGraphics CoreVideo Foundation IOKit Intents Metal SwiftUI; }; 194 + iTunesLibrary = { inherit Foundation; }; 195 vmnet = {}; 196 }
-139
pkgs/os-specific/darwin/gen-frameworks-baseline.py
··· 1 - #!/usr/bin/env nix-shell 2 - #!nix-shell -i python -p python3 swiftPackages.swift-unwrapped 3 - 4 - """ 5 - Generate a baseline frameworks.nix for a macOS SDK. 6 - """ 7 - 8 - import json 9 - import os 10 - import subprocess 11 - import sys 12 - 13 - ALLOWED_LIBS = ["simd"] 14 - 15 - HEADER = """\ 16 - { libs, frameworks }: with libs; with frameworks; 17 - { 18 - """ 19 - 20 - FOOTER = """\ 21 - } 22 - """ 23 - 24 - 25 - def eprint(*args): 26 - print(*args, file=sys.stderr) 27 - 28 - 29 - def name_from_ident(ident): 30 - return ident.get("swift", ident.get("clang")) 31 - 32 - 33 - def scan_sdk(sdk): 34 - # Find frameworks by scanning the SDK frameworks directory. 35 - frameworks = [ 36 - framework.removesuffix(".framework") 37 - for framework in os.listdir(f"{sdk}/System/Library/Frameworks") 38 - if not framework.startswith("_") 39 - ] 40 - frameworks.sort() 41 - 42 - # Determine the longest name for padding output. 43 - width = len(max(frameworks, key=len)) 44 - 45 - output = HEADER 46 - 47 - for framework in frameworks: 48 - deps = [] 49 - 50 - # Use Swift to scan dependencies, because a module may have both Clang 51 - # and Swift parts. Using Clang only imports the Clang module, whereas 52 - # using Swift will usually import both Clang + Swift overlay. 53 - # 54 - # TODO: The above is an assumption. Not sure if it's possible a Swift 55 - # module completely shadows a Clang module. (Seems unlikely) 56 - # 57 - # TODO: Handle "module 'Foobar' is incompatible with feature 'swift'" 58 - # 59 - # If there were a similar Clang invocation for scanning, we could fix 60 - # the above todos, but that doesn't appear to exist. 61 - eprint(f"# scanning {framework}") 62 - result = subprocess.run( 63 - [ 64 - "swiftc", 65 - "-scan-dependencies", 66 - # We provide a source snippet via stdin. 67 - "-", 68 - # Use the provided SDK. 69 - "-sdk", 70 - sdk, 71 - # This search path is normally added automatically by the 72 - # compiler based on the SDK, but we have a patch in place that 73 - # removes that for SDKs in /nix/store, because our xcbuild stub 74 - # SDK doesn't have the directory. 75 - # (swift-prevent-sdk-dirs-warning.patch) 76 - "-I", 77 - f"{sdk}/usr/lib/swift", 78 - # For some reason, 'lib/swift/shims' from both the SDK and 79 - # Swift compiler are picked up, causing redefinition errors. 80 - # This eliminates the latter. 81 - "-resource-dir", 82 - f"{sdk}/usr/lib/swift", 83 - ], 84 - input=f"import {framework}".encode(), 85 - stdout=subprocess.PIPE, 86 - ) 87 - if result.returncode != 0: 88 - eprint(f"# Scanning {framework} failed (exit code {result.returncode})") 89 - result.stdout = b"" 90 - 91 - # Parse JSON output. 92 - if len(result.stdout) != 0: 93 - data = json.loads(result.stdout) 94 - 95 - # Entries in the modules list come in pairs. The first is an 96 - # identifier (`{ swift: "foobar" }` or `{ clang: "foobar" }`), and 97 - # the second metadata for that module. Here we look for the pair 98 - # that matches the framework we're scanning (and ignore the rest). 99 - modules = data["modules"] 100 - for i in range(0, len(modules), 2): 101 - ident, meta = modules[i : i + 2] 102 - 103 - # NOTE: We may match twice, for a Swift module _and_ for a 104 - # Clang module. So matching here doesn't break from the loop, 105 - # and deps is appended to. 106 - if name_from_ident(ident) == framework: 107 - dep_idents = meta["directDependencies"] 108 - deps += [name_from_ident(ident) for ident in dep_idents] 109 - # List unfiltered deps in progress output. 110 - eprint(ident, "->", dep_idents) 111 - 112 - # Filter out modules that are not separate derivations. 113 - # Also filter out duplicates (when a Swift overlay imports the Clang module) 114 - allowed = frameworks + ALLOWED_LIBS 115 - deps = set([dep for dep in deps if dep in allowed]) 116 - 117 - # Filter out self-references. (Swift overlay importing Clang module.) 118 - if framework in deps: 119 - deps.remove(framework) 120 - 121 - # Generate a Nix attribute line. 122 - if len(deps) != 0: 123 - deps = list(deps) 124 - deps.sort() 125 - deps = " ".join(deps) 126 - output += f" {framework.ljust(width)} = {{ inherit {deps}; }};\n" 127 - else: 128 - output += f" {framework.ljust(width)} = {{}};\n" 129 - 130 - output += FOOTER 131 - sys.stdout.write(output) 132 - 133 - 134 - if __name__ == "__main__": 135 - if len(sys.argv) != 2: 136 - eprint(f"Usage: {sys.argv[0]} <path to MacOSX.sdk>") 137 - sys.exit(64) 138 - 139 - scan_sdk(sys.argv[1])
···
+141
pkgs/os-specific/darwin/gen-frameworks.py
···
··· 1 + #!/usr/bin/env nix-shell 2 + #!nix-shell -i python -p python3 swiftPackages.swift-unwrapped 3 + 4 + """ 5 + Generate a frameworks.nix for a macOS SDK. 6 + """ 7 + 8 + import json 9 + import os 10 + import subprocess 11 + import sys 12 + 13 + ALLOWED_LIBS = ["simd"] 14 + 15 + HEADER = """\ 16 + # This file is generated by gen-frameworks.nix. 17 + # Do not edit, put overrides in apple_sdk.nix instead. 18 + { libs, frameworks }: with libs; with frameworks; 19 + { 20 + """ 21 + 22 + FOOTER = """\ 23 + } 24 + """ 25 + 26 + 27 + def eprint(*args): 28 + print(*args, file=sys.stderr) 29 + 30 + 31 + def name_from_ident(ident): 32 + return ident.get("swift", ident.get("clang")) 33 + 34 + 35 + def scan_sdk(sdk): 36 + # Find frameworks by scanning the SDK frameworks directory. 37 + frameworks = [ 38 + framework.removesuffix(".framework") 39 + for framework in os.listdir(f"{sdk}/System/Library/Frameworks") 40 + if not framework.startswith("_") 41 + ] 42 + frameworks.sort() 43 + 44 + # Determine the longest name for padding output. 45 + width = len(max(frameworks, key=len)) 46 + 47 + output = HEADER 48 + 49 + for framework in frameworks: 50 + deps = [] 51 + 52 + # Use Swift to scan dependencies, because a module may have both Clang 53 + # and Swift parts. Using Clang only imports the Clang module, whereas 54 + # using Swift will usually import both Clang + Swift overlay. 55 + # 56 + # TODO: The above is an assumption. Not sure if it's possible a Swift 57 + # module completely shadows a Clang module. (Seems unlikely) 58 + # 59 + # TODO: Handle "module 'Foobar' is incompatible with feature 'swift'" 60 + # 61 + # If there were a similar Clang invocation for scanning, we could fix 62 + # the above todos, but that doesn't appear to exist. 63 + eprint(f"# scanning {framework}") 64 + result = subprocess.run( 65 + [ 66 + "swiftc", 67 + "-scan-dependencies", 68 + # We provide a source snippet via stdin. 69 + "-", 70 + # Use the provided SDK. 71 + "-sdk", 72 + sdk, 73 + # This search path is normally added automatically by the 74 + # compiler based on the SDK, but we have a patch in place that 75 + # removes that for SDKs in /nix/store, because our xcbuild stub 76 + # SDK doesn't have the directory. 77 + # (swift-prevent-sdk-dirs-warning.patch) 78 + "-I", 79 + f"{sdk}/usr/lib/swift", 80 + # For some reason, 'lib/swift/shims' from both the SDK and 81 + # Swift compiler are picked up, causing redefinition errors. 82 + # This eliminates the latter. 83 + "-resource-dir", 84 + f"{sdk}/usr/lib/swift", 85 + ], 86 + input=f"import {framework}".encode(), 87 + stdout=subprocess.PIPE, 88 + ) 89 + if result.returncode != 0: 90 + eprint(f"# Scanning {framework} failed (exit code {result.returncode})") 91 + result.stdout = b"" 92 + 93 + # Parse JSON output. 94 + if len(result.stdout) != 0: 95 + data = json.loads(result.stdout) 96 + 97 + # Entries in the modules list come in pairs. The first is an 98 + # identifier (`{ swift: "foobar" }` or `{ clang: "foobar" }`), and 99 + # the second metadata for that module. Here we look for the pair 100 + # that matches the framework we're scanning (and ignore the rest). 101 + modules = data["modules"] 102 + for i in range(0, len(modules), 2): 103 + ident, meta = modules[i : i + 2] 104 + 105 + # NOTE: We may match twice, for a Swift module _and_ for a 106 + # Clang module. So matching here doesn't break from the loop, 107 + # and deps is appended to. 108 + if name_from_ident(ident) == framework: 109 + dep_idents = meta["directDependencies"] 110 + deps += [name_from_ident(ident) for ident in dep_idents] 111 + # List unfiltered deps in progress output. 112 + eprint(ident, "->", dep_idents) 113 + 114 + # Filter out modules that are not separate derivations. 115 + # Also filter out duplicates (when a Swift overlay imports the Clang module) 116 + allowed = frameworks + ALLOWED_LIBS 117 + deps = set([dep for dep in deps if dep in allowed]) 118 + 119 + # Filter out self-references. (Swift overlay importing Clang module.) 120 + if framework in deps: 121 + deps.remove(framework) 122 + 123 + # Generate a Nix attribute line. 124 + if len(deps) != 0: 125 + deps = list(deps) 126 + deps.sort() 127 + deps = " ".join(deps) 128 + output += f" {framework.ljust(width)} = {{ inherit {deps}; }};\n" 129 + else: 130 + output += f" {framework.ljust(width)} = {{}};\n" 131 + 132 + output += FOOTER 133 + sys.stdout.write(output) 134 + 135 + 136 + if __name__ == "__main__": 137 + if len(sys.argv) != 2: 138 + eprint(f"Usage: {sys.argv[0]} <path to MacOSX.sdk>") 139 + sys.exit(64) 140 + 141 + scan_sdk(sys.argv[1])