Change:
export SWIFT_LIB_DYNAMIC="${lib.getLib swift.swift}/lib/swift/macosx" ''; <del> mesonFlags = [ (lib.mesonOption "default_library" "shared") (lib.mesonBool "libmpv" true) (lib.mesonEnable "libarchive" archiveSupport) (lib.mesonEnable "manpage-build" true) (lib.mesonEnable "cdda" cddaSupport) (lib.mesonEnable "dvbin" dvbinSupport) (lib.mesonEnable "dvdnav" dvdnavSupport) (lib.mesonEnable "openal" openalSupport) (lib.mesonEnable "sdl2" sdl2Support) # Disable whilst Swift isn't supported (lib.mesonEnable "swift-build" swiftSupport) (lib.mesonEnable "macos-cocoa-cb" swiftSupport) ] ++ lib.optionals stdenv.isDarwin [ # Toggle explicitly because it fails on darwin (lib.mesonEnable "videotoolbox-pl" vulkanSupport) ]; </del> <ins> mesonFlags = [ (lib.mesonOption "default_library" "shared") (lib.mesonBool "libmpv" true) (lib.mesonEnable "libarchive" archiveSupport) (lib.mesonEnable "manpage-build" true) (lib.mesonEnable "cdda" cddaSupport) (lib.mesonEnable "dvbin" dvbinSupport) (lib.mesonEnable "dvdnav" dvdnavSupport) (lib.mesonEnable "openal" openalSupport) (lib.mesonEnable "sdl2" sdl2Support) # Disable whilst Swift isn't supported (lib.mesonEnable "swift-build" swiftSupport) (lib.mesonEnable "macos-cocoa-cb" swiftSupport) ] ++ lib.optionals stdenv.isDarwin [ # Toggle explicitly because it fails on darwin (lib.mesonEnable "videotoolbox-pl" vulkanSupport) ]; </ins> mesonAutoFeatures = "auto"; <del> nativeBuildInputs = [ addOpenGLRunpath docutils # for rst2man meson ninja pkg-config ] ++ lib.optionals stdenv.isDarwin [ xcbuild.xcrun rcodesign ] ++ lib.optionals swiftSupport [ swift ] ++ lib.optionals waylandSupport [ wayland-scanner ]; </del> <ins> nativeBuildInputs = [ addOpenGLRunpath docutils # for rst2man meson ninja pkg-config ] ++ lib.optionals stdenv.isDarwin [ buildPackages.darwin.sigtool xcbuild.xcrun ] ++ lib.optionals swiftSupport [ swift ] ++ lib.optionals waylandSupport [ wayland-scanner ]; </ins> <del> buildInputs = [ bash ffmpeg freetype libass libplacebo libpthreadstubs libuchardet luaEnv python3 ] ++ lib.optionals alsaSupport        [ alsa-lib ] ++ lib.optionals archiveSupport     [ libarchive ] ++ lib.optionals bluraySupport      [ libbluray ] ++ lib.optionals bs2bSupport        [ libbs2b ] ++ lib.optionals cacaSupport        [ libcaca ] ++ lib.optionals cddaSupport        [ libcdio libcdio-paranoia ] ++ lib.optionals cmsSupport         [ lcms2 ] ++ lib.optionals drmSupport         [ libdrm mesa ] ++ lib.optionals dvdnavSupport      [ libdvdnav libdvdnav.libdvdread ] ++ lib.optionals jackaudioSupport   [ libjack2 ] ++ lib.optionals javascriptSupport  [ mujs ] ++ lib.optionals libpngSupport      [ libpng ] ++ lib.optionals openalSupport      [ openalSoft ] ++ lib.optionals pipewireSupport    [ pipewire ] ++ lib.optionals pulseSupport       [ libpulseaudio ] ++ lib.optionals rubberbandSupport  [ rubberband ] </del> <ins> buildInputs = [ bash ffmpeg freetype libass libplacebo libpthreadstubs libuchardet luaEnv python3 ] ++ lib.optionals alsaSupport [ alsa-lib ] ++ lib.optionals archiveSupport [ libarchive ] ++ lib.optionals bluraySupport [ libbluray ] ++ lib.optionals bs2bSupport [ libbs2b ] ++ lib.optionals cacaSupport [ libcaca ] ++ lib.optionals cddaSupport [ libcdio libcdio-paranoia ] ++ lib.optionals cmsSupport [ lcms2 ] ++ lib.optionals drmSupport [ libdrm mesa ] ++ lib.optionals dvdnavSupport [ libdvdnav libdvdnav.libdvdread ] ++ lib.optionals jackaudioSupport [ libjack2 ] ++ lib.optionals javascriptSupport [ mujs ] ++ lib.optionals libpngSupport [ libpng ] ++ lib.optionals openalSupport [ openalSoft ] ++ lib.optionals pipewireSupport [ pipewire ] ++ lib.optionals pulseSupport [ libpulseaudio ] ++ lib.optionals rubberbandSupport [ rubberband ] </ins> ++ lib.optionals screenSaverSupport [ libXScrnSaver ] <del> ++ lib.optionals sdl2Support        [ SDL2 ] ++ lib.optionals sixelSupport       [ libsixel ] ++ lib.optionals speexSupport       [ speex ] ++ lib.optionals theoraSupport      [ libtheora ] ++ lib.optionals vaapiSupport       [ libva ] </del> <ins> ++ lib.optionals sdl2Support [ SDL2 ] ++ lib.optionals sixelSupport [ libsixel ] ++ lib.optionals speexSupport [ speex ] ++ lib.optionals theoraSupport [ libtheora ] ++ lib.optionals vaapiSupport [ libva ] </ins> ++ lib.optionals vapoursynthSupport [ vapoursynth ] <del> ++ lib.optionals vdpauSupport       [ libvdpau ] ++ lib.optionals vulkanSupport      [ shaderc vulkan-headers vulkan-loader ] ++ lib.optionals waylandSupport     [ wayland wayland-protocols libxkbcommon ] ++ lib.optionals x11Support         [ libX11 libXext libGLU libGL libXxf86vm libXrandr libXpresent ] ++ lib.optionals xineramaSupport    [ libXinerama ] ++ lib.optionals xvSupport          [ libXv ] ++ lib.optionals zimgSupport        [ zimg ] ++ lib.optionals stdenv.isLinux     [ nv-codec-headers-11 ] ++ lib.optionals stdenv.isDarwin    [ libiconv ] ++ lib.optionals stdenv.isDarwin    [ Accelerate CoreFoundation Cocoa CoreAudio MediaPlayer VideoToolbox ] ++ lib.optionals (stdenv.isDarwin && swiftSupport) [ AVFoundation CoreMedia ]; </del> <ins> ++ lib.optionals vdpauSupport [ libvdpau ] ++ lib.optionals vulkanSupport [ shaderc vulkan-headers vulkan-loader ] ++ lib.optionals waylandSupport [ wayland wayland-protocols libxkbcommon ] ++ lib.optionals x11Support [ libX11 libXext libGLU libGL libXxf86vm libXrandr libXpresent ] ++ lib.optionals xineramaSupport [ libXinerama ] ++ lib.optionals xvSupport [ libXv ] ++ lib.optionals zimgSupport [ zimg ] ++ lib.optionals stdenv.isLinux [ nv-codec-headers-11 ] ++ lib.optionals stdenv.isDarwin [ libiconv ] ++ lib.optionals stdenv.isDarwin [ Accelerate CoreFoundation Cocoa CoreAudio MediaPlayer VideoToolbox ] ++ lib.optionals (stdenv.isDarwin && swiftSupport) [ AVFoundation CoreMedia ]; </ins> postBuild = lib.optionalString stdenv.isDarwin '' pushd .. # Must be run from the source dir because it uses relative paths

Discussion:
Package name: Latest released version: <!-- Search your package here: --- Current version on the unstable channel: Current version on the stable/release channel: <!-- Type the name of your package and try to find an open pull request for the package If you find an open pull request, you can review it! There's a high chance that you'll have the new version right away while helping the community! --- Notify maintainers <!-- If the result shows no maintainers, tag the person that last updated the package. --Note for maintainers: Please tag this issue in your PR. Add a :+1: [reaction] to [issues you find important]. [reaction]: [issues you find important]:
Yeeessaah!