diff --git a/pkgs/applications/video/mpv/default.nix b/pkgs/applications/video/mpv/default.nix index 01a2d973bf3d9..0b5928478005c 100644 --- a/pkgs/applications/video/mpv/default.nix +++ b/pkgs/applications/video/mpv/default.nix @@ -65,7 +65,7 @@ , sdl2Support ? true, SDL2 , sixelSupport ? false, libsixel , speexSupport ? true, speex -, swiftSupport ? false, swift +, swiftSupport ? stdenv.isDarwin, swift, xcbuild , theoraSupport ? true, libtheora , vaapiSupport ? stdenv.isLinux, libva , vapoursynthSupport ? false, vapoursynth @@ -100,6 +100,11 @@ in stdenv.mkDerivation rec { NIX_LDFLAGS = lib.optionalString x11Support "-lX11 -lXext " + lib.optionalString stdenv.isDarwin "-framework CoreFoundation"; + preConfigure = lib.optionalString swiftSupport '' + # Ensure we reference 'lib' (not 'out') of Swift. + export SWIFT_LIB_DYNAMIC=${swift.swift.lib}/lib/swift/macosx + ''; + # These flags are not supported and cause the build # to fail, even when cross compilation itself works. dontAddWafCrossFlags = true; @@ -120,8 +125,7 @@ in stdenv.mkDerivation rec { (lib.enableFeature vaapiSupport "vaapi") (lib.enableFeature waylandSupport "wayland") (lib.enableFeature stdenv.isLinux "dvbin") - ] # Disable whilst Swift isn't supported - ++ lib.optional (!swiftSupport) "--disable-macos-cocoa-cb"; + ] ++ lib.optional (!swiftSupport) "--disable-macos-cocoa-cb"; nativeBuildInputs = [ addOpenGLRunpath @@ -131,7 +135,7 @@ in stdenv.mkDerivation rec { python3 wafHook which - ] ++ lib.optionals swiftSupport [ swift ] + ] ++ lib.optionals swiftSupport [ swift xcbuild.xcrun ] ++ lib.optionals waylandSupport [ wayland-scanner ]; buildInputs = [ diff --git a/pkgs/os-specific/darwin/apple-sdk-11.0/frameworks.nix b/pkgs/os-specific/darwin/apple-sdk-11.0/frameworks.nix index 59cbc2b1063a1..ba9c6cd0e2c11 100644 --- a/pkgs/os-specific/darwin/apple-sdk-11.0/frameworks.nix +++ b/pkgs/os-specific/darwin/apple-sdk-11.0/frameworks.nix @@ -1,7 +1,7 @@ { frameworks, libs, libobjc, libnetwork }: with frameworks; with libs; { AGL = { inherit Carbon OpenGL; }; - AVFoundation = { inherit ApplicationServices AVFCapture AVFCore CoreGraphics simd UniformTypeIdentifiers; }; + AVFoundation = { inherit ApplicationServices AVFCapture AVFCore CoreGraphics CoreMedia simd UniformTypeIdentifiers; }; AVKit = {}; Accelerate = { inherit CoreWLAN IOBluetooth; }; Accessibility = {}; @@ -112,7 +112,7 @@ MapKit = {}; MediaAccessibility = { inherit CoreGraphics CoreText QuartzCore; }; MediaLibrary = {}; - MediaPlayer = {}; + MediaPlayer = { inherit AVFoundation; }; MediaToolbox = { inherit AudioToolbox AudioUnit CoreMedia; }; Message = {}; Metal = {};