Skip to content

Fix macOS frameworks without bringing back unwanted warnings #2376

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
241 changes: 241 additions & 0 deletions lib/system-nixpkgs-map.nix
Original file line number Diff line number Diff line change
Expand Up @@ -151,3 +151,244 @@ in
# -- mingw32
// { mingwex = null;
}
# -- os x
# TODO remove once planner code is updated not to output frameworks
# (we can only do that once we no longer support old nixpkgs where
# framework derivations are needed)
//
(
let
# If this file exists then the frameworks are all probably stubbed out
# and we can avoid warnings by ignoring them.
hasMkStubs = builtins.pathExists (pkgs.path + "/pkgs/os-specific/darwin/apple-sdk/mk-stub.nix");
frameworkNames =
[
"AGL"
"AVFCapture"
"AVFCore"
"AVFoundation"
"AVKit"
"Accelerate"
"Accessibility"
"Accounts"
"AdServices"
"AdSupport"
"AddressBook"
"AddressBookCore"
"AppKit"
"AppTrackingTransparency"
"Apple80211"
"AppleScriptKit"
"AppleScriptObjC"
"ApplicationServices"
"AudioToolbox"
"AudioToolboxCore"
"AudioUnit"
"AudioVideoBridging"
"AuthenticationServices"
"AutomaticAssessmentConfiguration"
"Automator"
"BackgroundTasks"
"BusinessChat"
"CFNetwork"
"CalendarStore"
"CallKit"
"Carbon"
"ClassKit"
"CloudKit"
"Cocoa"
"Collaboration"
"ColorSync"
"Combine"
"Contacts"
"ContactsPersistence"
"ContactsUI"
"CoreAudio"
"CoreAudioKit"
"CoreAudioTypes"
"CoreBluetooth"
"CoreData"
"CoreDisplay"
"CoreFoundation"
"CoreGraphics"
"CoreHaptics"
"CoreImage"
"CoreLocation"
"CoreMIDI"
"CoreMIDIServer"
"CoreML"
"CoreMedia"
"CoreMediaIO"
"CoreMotion"
"CoreServices"
"CoreSpotlight"
"CoreSymbolication"
"CoreTelephony"
"CoreText"
"CoreVideo"
"CoreWLAN"
"CryptoKit"
"CryptoTokenKit"
"DVDPlayback"
"DebugSymbols"
"DeveloperToolsSupport"
"DeviceCheck"
"DirectoryService"
"DiscRecording"
"DiscRecordingUI"
"DiskArbitration"
"DisplayServices"
"DriverKit"
"EventKit"
"ExceptionHandling"
"ExecutionPolicy"
"ExternalAccessory"
"FWAUserLib"
"FileProvider"
"FileProviderUI"
"FinderSync"
"ForceFeedback"
"Foundation"
"GLKit"
"GLUT"
"GSS"
"GameCenterFoundation"
"GameCenterUI"
"GameCenterUICore"
"GameController"
"GameKit"
"GameplayKit"
"HIDDriverKit"
"Hypervisor"
"ICADevices"
"IMServicePlugIn"
"IOBluetooth"
"IOBluetoothUI"
"IOKit"
"IOSurface"
"IOUSBHost"
"IdentityLookup"
"ImageCaptureCore"
"ImageIO"
"InputMethodKit"
"InstallerPlugins"
"InstantMessage"
"Intents"
"JavaNativeFoundation"
"JavaRuntimeSupport"
"JavaScriptCore"
"JavaVM"
"Kerberos"
"Kernel"
"KernelManagement"
"LDAP"
"LatentSemanticMapping"
"LinkPresentation"
"LocalAuthentication"
"MLCompute"
"MapKit"
"MediaAccessibility"
"MediaLibrary"
"MediaPlayer"
"MediaRemote"
"MediaToolbox"
"Message"
"Metal"
"MetalKit"
"MetalPerformanceShaders"
"MetalPerformanceShadersGraph"
"MetricKit"
"ModelIO"
"MultipeerConnectivity"
"MultitouchSupport"
"NaturalLanguage"
"NearbyInteraction"
"NetFS"
"Network"
"NetworkExtension"
"NetworkingDriverKit"
"NotificationCenter"
"OSAKit"
"OSLog"
"OpenAL"
"OpenCL"
"OpenDirectory"
"OpenGL"
"PCIDriverKit"
"PCSC"
"PDFKit"
"ParavirtualizedGraphics"
"PassKit"
"PassKitCore"
"PencilKit"
"Photos"
"PhotosUI"
"PreferencePanes"
"PushKit"
"Python"
"QTKit"
"Quartz"
"QuartzCore"
"QuickLook"
"QuickLookThumbnailing"
"QuickTime"
"RealityKit"
"ReplayKit"
"Ruby"
"SafariServices"
"SceneKit"
"ScreenSaver"
"ScreenTime"
"ScriptingBridge"
"Security"
"SecurityFoundation"
"SecurityInterface"
"SensorKit"
"ServiceManagement"
"SignpostMetrics"
"SkyLight"
"Social"
"SoundAnalysis"
"Speech"
"SpriteKit"
"StoreKit"
"SwiftUI"
"SyncServices"
"System"
"SystemConfiguration"
"SystemExtensions"
"TWAIN"
"Tcl"
"Tk"
"UIFoundation"
"URLFormatting"
"USBDriverKit"
"UniformTypeIdentifiers"
"UserNotifications"
"UserNotificationsUI"
"VideoDecodeAcceleration"
"VideoSubscriberAccount"
"VideoToolbox"
"Virtualization"
"Vision"
"WebKit"
"WidgetKit"
"iTunesLibrary"
"vmnet"
];

in
lib.optionalAttrs stdenv.hostPlatform.isDarwin
(lib.genAttrs frameworkNames
(n:
# Check to see if this is an old nixpkgs where we need framework derivations
if !hasMkStubs
# In future versions of `nixpkgs` these will be removed
# so make sure they are there.
&& darwin ? apple_sdk
&& darwin.apple_sdk ? frameworks
&& darwin.apple_sdk.frameworks ? ${n}
&& !(darwin.apple_sdk.frameworks.${n}.passthru.isDarwinCompatStub or false)
then darwin.apple_sdk.frameworks.${n}
else null))
)
2 changes: 1 addition & 1 deletion modules/component.nix
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ in
};

frameworks = lib.mkOption {
type = listOfFilteringNulls types.package;
type = listOfFilteringNulls (types.nullOr types.package);
default = [ ];
};

Expand Down
Loading