@@ -1,7 +1,8 @@
11{ config, stdenv, fetchurl, fetchFromGitHub, makeWrapper
22, addOpenGLRunpath, docutils, perl, pkgconfig, python3, wafHook, which
33, ffmpeg_4, freefont_ttf, freetype, libass, libpthreadstubs, mujs
4−, nv-codec-headers, lua, libuchardet, libiconv ? null, darwin
4+, nv-codec-headers, lua, libuchardet, libiconv ? null
5+, CoreFoundation, Cocoa, CoreAudio, MediaPlayer
56
67, waylandSupport ? stdenv.isLinux
78 , wayland ? null
@@ -38,11 +39,12 @@
3839, libpngSupport ? true, libpng ? null
3940, pulseSupport ? config.pulseaudio or stdenv.isLinux, libpulseaudio ? null
4041, rubberbandSupport ? stdenv.isLinux, rubberband ? null
41−, screenSaverSupport ? true, libXScrnSaver ? null
4242, sambaSupport ? stdenv.isLinux, samba ? null
43+, screenSaverSupport ? true, libXScrnSaver ? null
4344, sdl2Support ? true, SDL2 ? null
4445, sndioSupport ? true, sndio ? null
4546, speexSupport ? true, speex ? null
47+, swiftSupport ? false, swift ? null
4648, theoraSupport ? true, libtheora ? null
4749, vaapiSupport ? stdenv.isLinux, libva ? null
4850, vdpauSupport ? true, libvdpau ? null
@@ -119,7 +121,6 @@ in stdenv.mkDerivation rec {
119121 "--disable-libmpv-static"
120122 "--disable-static-build"
121123 "--disable-build-date" # Purity
122− "--disable-macos-cocoa-cb" # Disable whilst Swift isn't supported
123124 (enableFeature archiveSupport "libarchive")
124125 (enableFeature cddaSupport "cdda")
125126 (enableFeature dvdnavSupport "dvdnav")
@@ -130,11 +131,13 @@ in stdenv.mkDerivation rec {
130131 (enableFeature vaapiSupport "vaapi")
131132 (enableFeature waylandSupport "wayland")
132133 (enableFeature stdenv.isLinux "dvbin")
133− ];
134+ ] # Disable whilst Swift isn't supported
135+ ++ stdenv.lib.optional (!swiftSupport) "--disable-macos-cocoa-cb";
134136
135137 nativeBuildInputs = [
136138 addOpenGLRunpath docutils makeWrapper perl pkgconfig python3 wafHook which
137− ];
139+ ]
140+ ++ optional swiftSupport swift;
138141
139142 buildInputs = [
140143 ffmpeg_4 freetype libass libpthreadstubs
@@ -171,9 +174,7 @@ in stdenv.mkDerivation rec {
171174 ++ optionals waylandSupport [ wayland wayland-protocols libxkbcommon ]
172175 ++ optionals x11Support [ libX11 libXext libGLU libGL libXxf86vm libXrandr ]
173176 ++ optionals vulkanSupport [ libplacebo shaderc vulkan-headers vulkan-loader ]
174− ++ optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
175− CoreFoundation Cocoa CoreAudio
176− ]);
177+ ++ optionals stdenv.isDarwin [ CoreFoundation Cocoa CoreAudio MediaPlayer ];
177178
178179 enableParallelBuilding = true;
179180