From 7c83633048c46ac7300539603d02fd8c8f055d27 Mon Sep 17 00:00:00 2001 From: Emily Date: Mon, 21 Oct 2024 19:18:02 +0100 Subject: [PATCH 01/21] moltenvk: adjust default log level --- pkgs/by-name/mo/moltenvk/package.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/by-name/mo/moltenvk/package.nix b/pkgs/by-name/mo/moltenvk/package.nix index 946287d89598b..72c59cb3dc915 100644 --- a/pkgs/by-name/mo/moltenvk/package.nix +++ b/pkgs/by-name/mo/moltenvk/package.nix @@ -108,6 +108,10 @@ stdenv.mkDerivation (finalAttrs: { "-isystem ${lib.getDev libcxx}/include/c++/v1" "-I${lib.getDev spirv-cross}/include/spirv_cross" "-I${lib.getDev spirv-headers}/include/spirv/unified1" + + # MoltenVK prints a lot of verbose output to the console out of + # the box; we adjust this to match Homebrew’s default log level. + "-DMVK_CONFIG_LOG_LEVEL=MVK_CONFIG_LOG_LEVEL_NONE" ] ++ lib.optional enablePrivateAPIUsage "-DMVK_USE_METAL_PRIVATE_API=1" ); From 40a1f6de8c7c9f6f15c8e0c4a4f01d088dbe50c1 Mon Sep 17 00:00:00 2001 From: Emily Date: Thu, 17 Oct 2024 16:08:29 +0100 Subject: [PATCH 02/21] =?UTF-8?q?mpv:=20don=E2=80=99t=20override=20Lua=20w?= =?UTF-8?q?ith=20Lua?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkgs/top-level/all-packages.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 2c3bc98f968f2..40ee0d60265fb 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -31183,7 +31183,6 @@ with pkgs; mpv-unwrapped = darwin.apple_sdk_11_0.callPackage ../applications/video/mpv { stdenv = if stdenv.hostPlatform.isDarwin then swiftPackages.stdenv else stdenv; - inherit lua; }; # Wrap avoiding rebuild From 472f5217ccf4c8386319099c4dc58e2c53a494cf Mon Sep 17 00:00:00 2001 From: Emily Date: Mon, 21 Oct 2024 19:26:32 +0100 Subject: [PATCH 03/21] mpv: fix typo --- pkgs/applications/video/mpv/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/video/mpv/default.nix b/pkgs/applications/video/mpv/default.nix index d1f44b09b16d3..327009b88e232 100644 --- a/pkgs/applications/video/mpv/default.nix +++ b/pkgs/applications/video/mpv/default.nix @@ -162,7 +162,7 @@ stdenv'.mkDerivation (finalAttrs: { '' substituteInPlace meson.build \ --replace-fail "conf_data.set_quoted('CONFIGURATION', configuration)" \ - "conf_data.set_quoted('CONFIGURATION', '')" + "conf_data.set_quoted('CONFIGURATION', '')" '' # A trick to patchShebang everything except mpv_identify.sh '' From f2280510e3e431e9c0907fe233a3534def4a7162 Mon Sep 17 00:00:00 2001 From: Emily Date: Thu, 17 Oct 2024 16:08:29 +0100 Subject: [PATCH 04/21] mpv: remove legacy Darwin SDK pattern detritus MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Oh, this is satisfying. Swift already propagates its corresponding SDK, so we don’t need the patch. --- pkgs/applications/video/mpv/default.nix | 49 +------------------------ pkgs/top-level/all-packages.nix | 2 +- 2 files changed, 3 insertions(+), 48 deletions(-) diff --git a/pkgs/applications/video/mpv/default.nix b/pkgs/applications/video/mpv/default.nix index 327009b88e232..cf14df58e6567 100644 --- a/pkgs/applications/video/mpv/default.nix +++ b/pkgs/applications/video/mpv/default.nix @@ -7,7 +7,6 @@ buildPackages, callPackage, config, - darwin, docutils, fetchFromGitHub, ffmpeg, @@ -33,7 +32,6 @@ libcdio-paranoia, libdrm, libdvdnav, - libiconv, libjack2, libplacebo, libpng, @@ -68,7 +66,6 @@ wayland, wayland-protocols, wayland-scanner, - xcbuild, zimg, # Boolean @@ -107,33 +104,9 @@ }: let - inherit (darwin.apple_sdk_11_0.frameworks) - AVFoundation - Accelerate - Cocoa - CoreAudio - CoreFoundation - CoreMedia - MediaPlayer - VideoToolbox - ; luaEnv = lua.withPackages (ps: with ps; [ luasocket ]); - - overrideSDK = - platform: version: - platform // lib.optionalAttrs (platform ? darwinMinVersion) { darwinMinVersion = version; }; - - stdenv' = - if swiftSupport && stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64 then - stdenv.override (old: { - buildPlatform = overrideSDK old.buildPlatform "11.0"; - hostPlatform = overrideSDK old.hostPlatform "11.0"; - targetPlatform = overrideSDK old.targetPlatform "11.0"; - }) - else - stdenv; in -stdenv'.mkDerivation (finalAttrs: { +stdenv.mkDerivation (finalAttrs: { pname = "mpv"; version = "0.39.0"; @@ -151,11 +124,6 @@ stdenv'.mkDerivation (finalAttrs: { hash = "sha256-BOGh+QBTO7hrHohh+RqjSF8eHQH8jVBPjG/k4eyFaaM="; }; - patches = [ - # Fix build with Darwin SDK 11 - ./0001-fix-darwin-build.patch - ]; - postPatch = lib.concatStringsSep "\n" [ # Don't reference compile time dependencies or create a build outputs cycle # between out and dev @@ -211,7 +179,6 @@ stdenv'.mkDerivation (finalAttrs: { ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ buildPackages.darwin.sigtool - xcbuild.xcrun ] ++ lib.optionals swiftSupport [ swift ] ++ lib.optionals waylandSupport [ wayland-scanner ]; @@ -284,19 +251,7 @@ stdenv'.mkDerivation (finalAttrs: { ++ lib.optionals xvSupport [ libXv ] ++ lib.optionals zimgSupport [ zimg ] ++ lib.optionals stdenv.hostPlatform.isLinux [ nv-codec-headers-11 ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - Accelerate - CoreFoundation - Cocoa - CoreAudio - MediaPlayer - VideoToolbox - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin && swiftSupport) [ - AVFoundation - CoreMedia - ]; + ; postBuild = lib.optionalString stdenv.hostPlatform.isDarwin '' pushd .. # Must be run from the source dir because it uses relative paths diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 40ee0d60265fb..63ff10afe552c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -31181,7 +31181,7 @@ with pkgs; libdvdnav = libdvdnav_4_2_1; } // (config.mplayer or {})); - mpv-unwrapped = darwin.apple_sdk_11_0.callPackage ../applications/video/mpv { + mpv-unwrapped = callPackage ../applications/video/mpv { stdenv = if stdenv.hostPlatform.isDarwin then swiftPackages.stdenv else stdenv; }; From c7a1d6097d2414dc1a029ae8672af199fb78ee13 Mon Sep 17 00:00:00 2001 From: Emily Date: Thu, 17 Oct 2024 16:08:29 +0100 Subject: [PATCH 05/21] mpv: remove `swiftSupport` flag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit mpv currently doesn’t even build successfully on macOS without Swift, and there’s no use of Swift outside of the platform. --- pkgs/applications/video/mpv/default.nix | 38 +++++++++---------------- 1 file changed, 14 insertions(+), 24 deletions(-) diff --git a/pkgs/applications/video/mpv/default.nix b/pkgs/applications/video/mpv/default.nix index cf14df58e6567..3dec86129609a 100644 --- a/pkgs/applications/video/mpv/default.nix +++ b/pkgs/applications/video/mpv/default.nix @@ -90,7 +90,6 @@ sdl2Support ? !stdenv.hostPlatform.isDarwin, sixelSupport ? false, speexSupport ? true, - swiftSupport ? stdenv.hostPlatform.isDarwin, theoraSupport ? true, vaapiSupport ? x11Support || waylandSupport, vapoursynthSupport ? false, @@ -143,29 +142,21 @@ stdenv.mkDerivation (finalAttrs: { ]; # Ensure we reference 'lib' (not 'out') of Swift. - preConfigure = lib.optionalString swiftSupport '' + preConfigure = lib.optionalString stdenv.hostPlatform.isDarwin '' export SWIFT_LIB_DYNAMIC="${lib.getLib swift.swift}/lib/swift/macosx" ''; - 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.hostPlatform.isDarwin [ - # Toggle explicitly because it fails on darwin - (lib.mesonEnable "videotoolbox-pl" vulkanSupport) - ]; + 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) + ]; mesonAutoFeatures = "auto"; @@ -179,8 +170,8 @@ stdenv.mkDerivation (finalAttrs: { ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ buildPackages.darwin.sigtool + swift ] - ++ lib.optionals swiftSupport [ swift ] ++ lib.optionals waylandSupport [ wayland-scanner ]; buildInputs = @@ -250,8 +241,7 @@ stdenv.mkDerivation (finalAttrs: { ++ lib.optionals xineramaSupport [ libXinerama ] ++ lib.optionals xvSupport [ libXv ] ++ lib.optionals zimgSupport [ zimg ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ nv-codec-headers-11 ] - ; + ++ lib.optionals stdenv.hostPlatform.isLinux [ nv-codec-headers-11 ]; postBuild = lib.optionalString stdenv.hostPlatform.isDarwin '' pushd .. # Must be run from the source dir because it uses relative paths From 2226998074e595bfd275f851217238f2d7c9a93e Mon Sep 17 00:00:00 2001 From: Emily Date: Thu, 17 Oct 2024 16:08:29 +0100 Subject: [PATCH 06/21] mpv: enable Vulkan on Darwin Using `--vo=gpu` or `--vo=gpu-next` with MoltenVK is now supported and has replaced the previous `cocoa-cb` as the default. --- pkgs/applications/video/mpv/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/video/mpv/default.nix b/pkgs/applications/video/mpv/default.nix index 3dec86129609a..d2f8993bc2f8c 100644 --- a/pkgs/applications/video/mpv/default.nix +++ b/pkgs/applications/video/mpv/default.nix @@ -94,7 +94,7 @@ vaapiSupport ? x11Support || waylandSupport, vapoursynthSupport ? false, vdpauSupport ? true, - vulkanSupport ? stdenv.hostPlatform.isLinux, + vulkanSupport ? true, waylandSupport ? stdenv.hostPlatform.isLinux, x11Support ? stdenv.hostPlatform.isLinux, xineramaSupport ? stdenv.hostPlatform.isLinux, From 84d64ade98bd69f4dbe3534560e15dae2839d1d4 Mon Sep 17 00:00:00 2001 From: Emily Date: Mon, 21 Oct 2024 19:29:27 +0100 Subject: [PATCH 07/21] mpv: remove obsolete Swift library path hack This is now detected correctly as part of the SDK, as it should be. --- pkgs/applications/video/mpv/default.nix | 5 ----- 1 file changed, 5 deletions(-) diff --git a/pkgs/applications/video/mpv/default.nix b/pkgs/applications/video/mpv/default.nix index d2f8993bc2f8c..68bb464dcff9c 100644 --- a/pkgs/applications/video/mpv/default.nix +++ b/pkgs/applications/video/mpv/default.nix @@ -141,11 +141,6 @@ stdenv.mkDerivation (finalAttrs: { '' ]; - # Ensure we reference 'lib' (not 'out') of Swift. - preConfigure = lib.optionalString stdenv.hostPlatform.isDarwin '' - export SWIFT_LIB_DYNAMIC="${lib.getLib swift.swift}/lib/swift/macosx" - ''; - mesonFlags = [ (lib.mesonOption "default_library" "shared") (lib.mesonBool "libmpv" true) From 0e11e05d5e98d60479a44b20c99fe2d150c1f3a9 Mon Sep 17 00:00:00 2001 From: Emily Date: Mon, 21 Oct 2024 20:21:25 +0100 Subject: [PATCH 08/21] mpv: remove `speexSupport` flag Does nothing, removed upstream in 2012(!): . --- pkgs/applications/video/mpv/default.nix | 3 --- 1 file changed, 3 deletions(-) diff --git a/pkgs/applications/video/mpv/default.nix b/pkgs/applications/video/mpv/default.nix index 68bb464dcff9c..2b54a7979458a 100644 --- a/pkgs/applications/video/mpv/default.nix +++ b/pkgs/applications/video/mpv/default.nix @@ -56,7 +56,6 @@ python3, rubberband, shaderc, # instead of spirv-cross - speex, stdenv, swift, testers, @@ -89,7 +88,6 @@ screenSaverSupport ? true, sdl2Support ? !stdenv.hostPlatform.isDarwin, sixelSupport ? false, - speexSupport ? true, theoraSupport ? true, vaapiSupport ? x11Support || waylandSupport, vapoursynthSupport ? false, @@ -209,7 +207,6 @@ stdenv.mkDerivation (finalAttrs: { ++ lib.optionals screenSaverSupport [ libXScrnSaver ] ++ lib.optionals sdl2Support [ SDL2 ] ++ lib.optionals sixelSupport [ libsixel ] - ++ lib.optionals speexSupport [ speex ] ++ lib.optionals theoraSupport [ libtheora ] ++ lib.optionals vaapiSupport [ libva ] ++ lib.optionals vapoursynthSupport [ vapoursynth ] From cc7d201a92c9ae81fdfc37d18a88ee32f5ca6254 Mon Sep 17 00:00:00 2001 From: Emily Date: Mon, 21 Oct 2024 20:21:25 +0100 Subject: [PATCH 09/21] mpv: remove `theoraSupport` flag Does nothing, removed upstream in 2012(!): . --- pkgs/applications/video/mpv/default.nix | 3 --- 1 file changed, 3 deletions(-) diff --git a/pkgs/applications/video/mpv/default.nix b/pkgs/applications/video/mpv/default.nix index 2b54a7979458a..d7df14c76e4ed 100644 --- a/pkgs/applications/video/mpv/default.nix +++ b/pkgs/applications/video/mpv/default.nix @@ -38,7 +38,6 @@ libpthreadstubs, libpulseaudio, libsixel, - libtheora, libuchardet, libva, libvdpau, @@ -88,7 +87,6 @@ screenSaverSupport ? true, sdl2Support ? !stdenv.hostPlatform.isDarwin, sixelSupport ? false, - theoraSupport ? true, vaapiSupport ? x11Support || waylandSupport, vapoursynthSupport ? false, vdpauSupport ? true, @@ -207,7 +205,6 @@ stdenv.mkDerivation (finalAttrs: { ++ lib.optionals screenSaverSupport [ libXScrnSaver ] ++ lib.optionals sdl2Support [ SDL2 ] ++ lib.optionals sixelSupport [ libsixel ] - ++ lib.optionals theoraSupport [ libtheora ] ++ lib.optionals vaapiSupport [ libva ] ++ lib.optionals vapoursynthSupport [ vapoursynth ] ++ lib.optionals vdpauSupport [ libvdpau ] From 45d592fbbeeecad61d345950c65dc30e461c078b Mon Sep 17 00:00:00 2001 From: Emily Date: Mon, 21 Oct 2024 20:24:18 +0100 Subject: [PATCH 10/21] mpv: remove `libpngSupport` flag Does nothing, removed upstream in 2012(!): . --- pkgs/applications/video/mpv/default.nix | 3 --- 1 file changed, 3 deletions(-) diff --git a/pkgs/applications/video/mpv/default.nix b/pkgs/applications/video/mpv/default.nix index d7df14c76e4ed..aec2083f09e35 100644 --- a/pkgs/applications/video/mpv/default.nix +++ b/pkgs/applications/video/mpv/default.nix @@ -34,7 +34,6 @@ libdvdnav, libjack2, libplacebo, - libpng, libpthreadstubs, libpulseaudio, libsixel, @@ -79,7 +78,6 @@ dvdnavSupport ? stdenv.hostPlatform.isLinux, jackaudioSupport ? false, javascriptSupport ? true, - libpngSupport ? true, openalSupport ? true, pipewireSupport ? stdenv.hostPlatform.isLinux, pulseSupport ? config.pulseaudio or stdenv.hostPlatform.isLinux, @@ -197,7 +195,6 @@ stdenv.mkDerivation (finalAttrs: { ] ++ lib.optionals jackaudioSupport [ libjack2 ] ++ lib.optionals javascriptSupport [ mujs ] - ++ lib.optionals libpngSupport [ libpng ] ++ lib.optionals openalSupport [ openalSoft ] ++ lib.optionals pipewireSupport [ pipewire ] ++ lib.optionals pulseSupport [ libpulseaudio ] From 01f798521fc194723343a6b1dce7251f1d86d537 Mon Sep 17 00:00:00 2001 From: Emily Date: Mon, 21 Oct 2024 20:28:39 +0100 Subject: [PATCH 11/21] mpv: remove `screenSaverSupport` flag This is required as part of X11 support since the Meson transition. --- pkgs/applications/video/mpv/default.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkgs/applications/video/mpv/default.nix b/pkgs/applications/video/mpv/default.nix index aec2083f09e35..7f12e95168463 100644 --- a/pkgs/applications/video/mpv/default.nix +++ b/pkgs/applications/video/mpv/default.nix @@ -82,7 +82,6 @@ pipewireSupport ? stdenv.hostPlatform.isLinux, pulseSupport ? config.pulseaudio or stdenv.hostPlatform.isLinux, rubberbandSupport ? true, - screenSaverSupport ? true, sdl2Support ? !stdenv.hostPlatform.isDarwin, sixelSupport ? false, vaapiSupport ? x11Support || waylandSupport, @@ -199,7 +198,6 @@ stdenv.mkDerivation (finalAttrs: { ++ lib.optionals pipewireSupport [ pipewire ] ++ lib.optionals pulseSupport [ libpulseaudio ] ++ lib.optionals rubberbandSupport [ rubberband ] - ++ lib.optionals screenSaverSupport [ libXScrnSaver ] ++ lib.optionals sdl2Support [ SDL2 ] ++ lib.optionals sixelSupport [ libsixel ] ++ lib.optionals vaapiSupport [ libva ] @@ -223,6 +221,7 @@ stdenv.mkDerivation (finalAttrs: { libXxf86vm libXrandr libXpresent + libXScrnSaver ] ++ lib.optionals xineramaSupport [ libXinerama ] ++ lib.optionals xvSupport [ libXv ] From fefef477f99b8203b2b6b78404cd619ddf5b9dd5 Mon Sep 17 00:00:00 2001 From: Emily Date: Mon, 21 Oct 2024 20:29:37 +0100 Subject: [PATCH 12/21] mpv: remove `xineramaSupport` flag Removed upstream: . --- pkgs/applications/video/mpv/default.nix | 3 --- 1 file changed, 3 deletions(-) diff --git a/pkgs/applications/video/mpv/default.nix b/pkgs/applications/video/mpv/default.nix index 7f12e95168463..dfe27d34276d4 100644 --- a/pkgs/applications/video/mpv/default.nix +++ b/pkgs/applications/video/mpv/default.nix @@ -18,7 +18,6 @@ libX11, libXScrnSaver, libXext, - libXinerama, libXpresent, libXrandr, libXv, @@ -90,7 +89,6 @@ vulkanSupport ? true, waylandSupport ? stdenv.hostPlatform.isLinux, x11Support ? stdenv.hostPlatform.isLinux, - xineramaSupport ? stdenv.hostPlatform.isLinux, xvSupport ? stdenv.hostPlatform.isLinux, zimgSupport ? true, }: @@ -223,7 +221,6 @@ stdenv.mkDerivation (finalAttrs: { libXpresent libXScrnSaver ] - ++ lib.optionals xineramaSupport [ libXinerama ] ++ lib.optionals xvSupport [ libXv ] ++ lib.optionals zimgSupport [ zimg ] ++ lib.optionals stdenv.hostPlatform.isLinux [ nv-codec-headers-11 ]; From 0ef8ba26e1d8222ec3d905a6edaafb9d66494cfe Mon Sep 17 00:00:00 2001 From: Emily Date: Mon, 21 Oct 2024 20:34:39 +0100 Subject: [PATCH 13/21] mpv: remove unused `libXxf86vm` dependency --- pkgs/applications/video/mpv/default.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkgs/applications/video/mpv/default.nix b/pkgs/applications/video/mpv/default.nix index dfe27d34276d4..0bea24c1b7da1 100644 --- a/pkgs/applications/video/mpv/default.nix +++ b/pkgs/applications/video/mpv/default.nix @@ -21,7 +21,6 @@ libXpresent, libXrandr, libXv, - libXxf86vm, libarchive, libass, libbluray, @@ -216,7 +215,6 @@ stdenv.mkDerivation (finalAttrs: { libXext libGLU libGL - libXxf86vm libXrandr libXpresent libXScrnSaver From 93222c08a5721fd3e6ce6e26bb4f84bd03f29a08 Mon Sep 17 00:00:00 2001 From: Emily Date: Mon, 21 Oct 2024 20:36:41 +0100 Subject: [PATCH 14/21] mpv: remove unused `libGLU` dependency --- pkgs/applications/video/mpv/default.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkgs/applications/video/mpv/default.nix b/pkgs/applications/video/mpv/default.nix index 0bea24c1b7da1..32dd5506bf0d1 100644 --- a/pkgs/applications/video/mpv/default.nix +++ b/pkgs/applications/video/mpv/default.nix @@ -14,7 +14,6 @@ freetype, lcms2, libGL, - libGLU, libX11, libXScrnSaver, libXext, @@ -213,7 +212,6 @@ stdenv.mkDerivation (finalAttrs: { ++ lib.optionals x11Support [ libX11 libXext - libGLU libGL libXrandr libXpresent From 5c59345ef6f1e22b8c7dac2437ede32bb83bf687 Mon Sep 17 00:00:00 2001 From: Emily Date: Mon, 21 Oct 2024 20:46:01 +0100 Subject: [PATCH 15/21] mpv: disable `vaapiSupport` on Darwin --- pkgs/applications/video/mpv/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/video/mpv/default.nix b/pkgs/applications/video/mpv/default.nix index 32dd5506bf0d1..cf5793b12b524 100644 --- a/pkgs/applications/video/mpv/default.nix +++ b/pkgs/applications/video/mpv/default.nix @@ -81,7 +81,7 @@ rubberbandSupport ? true, sdl2Support ? !stdenv.hostPlatform.isDarwin, sixelSupport ? false, - vaapiSupport ? x11Support || waylandSupport, + vaapiSupport ? !stdenv.hostPlatform.isDarwin && (x11Support || waylandSupport), vapoursynthSupport ? false, vdpauSupport ? true, vulkanSupport ? true, From 61f229078dd30a45dbd1a0931022b0aa1681ee48 Mon Sep 17 00:00:00 2001 From: Emily Date: Mon, 21 Oct 2024 20:38:49 +0100 Subject: [PATCH 16/21] =?UTF-8?q?mpv:=20enable=20`dvdnavSupport`=20on=20no?= =?UTF-8?q?n=E2=80=90Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It builds fine on macOS. --- pkgs/applications/video/mpv/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/video/mpv/default.nix b/pkgs/applications/video/mpv/default.nix index cf5793b12b524..2e35de7145922 100644 --- a/pkgs/applications/video/mpv/default.nix +++ b/pkgs/applications/video/mpv/default.nix @@ -72,7 +72,7 @@ cmsSupport ? true, drmSupport ? stdenv.hostPlatform.isLinux, dvbinSupport ? stdenv.hostPlatform.isLinux, - dvdnavSupport ? stdenv.hostPlatform.isLinux, + dvdnavSupport ? true, jackaudioSupport ? false, javascriptSupport ? true, openalSupport ? true, From 7691ab6b73a0ca01ef314ad27ea6e661e746321d Mon Sep 17 00:00:00 2001 From: Emily Date: Mon, 21 Oct 2024 20:51:56 +0100 Subject: [PATCH 17/21] mpv: disable `sdl2Support` by default MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Upstream’s Meson defaults, upstream’s CI binaries, and Arch don’t enable this. --- pkgs/applications/video/mpv/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/video/mpv/default.nix b/pkgs/applications/video/mpv/default.nix index 2e35de7145922..ecdffc7755710 100644 --- a/pkgs/applications/video/mpv/default.nix +++ b/pkgs/applications/video/mpv/default.nix @@ -79,7 +79,7 @@ pipewireSupport ? stdenv.hostPlatform.isLinux, pulseSupport ? config.pulseaudio or stdenv.hostPlatform.isLinux, rubberbandSupport ? true, - sdl2Support ? !stdenv.hostPlatform.isDarwin, + sdl2Support ? false, sixelSupport ? false, vaapiSupport ? !stdenv.hostPlatform.isDarwin && (x11Support || waylandSupport), vapoursynthSupport ? false, From 41bdd317725c2d28c9a5ce161e35839ba5ad8aa3 Mon Sep 17 00:00:00 2001 From: Emily Date: Mon, 21 Oct 2024 20:53:51 +0100 Subject: [PATCH 18/21] mpv: remove `xvSupport` flag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This prints out a big warning about how you shouldn’t be using it. Upstream CI builds and Arch don’t enable it. There are other backends of questionable worth that we don’t expose options for, so let’s ditch this one. --- pkgs/applications/video/mpv/default.nix | 3 --- 1 file changed, 3 deletions(-) diff --git a/pkgs/applications/video/mpv/default.nix b/pkgs/applications/video/mpv/default.nix index ecdffc7755710..88847ef096a2c 100644 --- a/pkgs/applications/video/mpv/default.nix +++ b/pkgs/applications/video/mpv/default.nix @@ -19,7 +19,6 @@ libXext, libXpresent, libXrandr, - libXv, libarchive, libass, libbluray, @@ -87,7 +86,6 @@ vulkanSupport ? true, waylandSupport ? stdenv.hostPlatform.isLinux, x11Support ? stdenv.hostPlatform.isLinux, - xvSupport ? stdenv.hostPlatform.isLinux, zimgSupport ? true, }: @@ -217,7 +215,6 @@ stdenv.mkDerivation (finalAttrs: { libXpresent libXScrnSaver ] - ++ lib.optionals xvSupport [ libXv ] ++ lib.optionals zimgSupport [ zimg ] ++ lib.optionals stdenv.hostPlatform.isLinux [ nv-codec-headers-11 ]; From 8db2730152a05298ff4eb194aca760641cf826d8 Mon Sep 17 00:00:00 2001 From: Emily Date: Mon, 21 Oct 2024 20:51:33 +0100 Subject: [PATCH 19/21] =?UTF-8?q?mpv:=20enable=20`{pipewire,pulse,wayland,?= =?UTF-8?q?x11}Support`=20on=20non=E2=80=90Darwin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit No reason for FreeBSD to miss out on the fun. --- pkgs/applications/video/mpv/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/video/mpv/default.nix b/pkgs/applications/video/mpv/default.nix index 88847ef096a2c..de161e2e8a537 100644 --- a/pkgs/applications/video/mpv/default.nix +++ b/pkgs/applications/video/mpv/default.nix @@ -75,8 +75,8 @@ jackaudioSupport ? false, javascriptSupport ? true, openalSupport ? true, - pipewireSupport ? stdenv.hostPlatform.isLinux, - pulseSupport ? config.pulseaudio or stdenv.hostPlatform.isLinux, + pipewireSupport ? !stdenv.hostPlatform.isDarwin, + pulseSupport ? config.pulseaudio or (!stdenv.hostPlatform.isDarwin), rubberbandSupport ? true, sdl2Support ? false, sixelSupport ? false, @@ -84,8 +84,8 @@ vapoursynthSupport ? false, vdpauSupport ? true, vulkanSupport ? true, - waylandSupport ? stdenv.hostPlatform.isLinux, - x11Support ? stdenv.hostPlatform.isLinux, + waylandSupport ? !stdenv.hostPlatform.isDarwin, + x11Support ? !stdenv.hostPlatform.isDarwin, zimgSupport ? true, }: From bd2b925756acd5e305d86925d18983bd199fc6c4 Mon Sep 17 00:00:00 2001 From: Emily Date: Mon, 21 Oct 2024 21:30:15 +0100 Subject: [PATCH 20/21] mpv: remove redundant Meson flag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since we’re doing auto‐detection anyway, this is unnecessary. --- pkgs/applications/video/mpv/default.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/pkgs/applications/video/mpv/default.nix b/pkgs/applications/video/mpv/default.nix index de161e2e8a537..87ace96d60c29 100644 --- a/pkgs/applications/video/mpv/default.nix +++ b/pkgs/applications/video/mpv/default.nix @@ -131,7 +131,6 @@ stdenv.mkDerivation (finalAttrs: { 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) From 12ce8fdbc6f22b2c9f24b31e1e0887984f4169bb Mon Sep 17 00:00:00 2001 From: Emily Date: Mon, 21 Oct 2024 21:43:57 +0100 Subject: [PATCH 21/21] mpv: use wrapped bundle executable on Darwin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On macOS, many things won’t work properly unless mpv is executed from the app bundle, such as spatial audio with `--ao=avfoundation`. This ensures that those features work reliably and also avoids duplicating the entire `mpv` binary. --- pkgs/applications/video/mpv/default.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/applications/video/mpv/default.nix b/pkgs/applications/video/mpv/default.nix index 87ace96d60c29..8624506e52e4f 100644 --- a/pkgs/applications/video/mpv/default.nix +++ b/pkgs/applications/video/mpv/default.nix @@ -38,6 +38,7 @@ libvdpau, libxkbcommon, lua, + makeWrapper, mesa, meson, mujs, @@ -152,6 +153,7 @@ stdenv.mkDerivation (finalAttrs: { ++ lib.optionals stdenv.hostPlatform.isDarwin [ buildPackages.darwin.sigtool swift + makeWrapper ] ++ lib.optionals waylandSupport [ wayland-scanner ]; @@ -244,6 +246,13 @@ stdenv.mkDerivation (finalAttrs: { + lib.optionalString stdenv.hostPlatform.isDarwin '' mkdir -p $out/Applications cp -r mpv.app $out/Applications + + # On macOS, many things won’t work properly unless `mpv(1)` is + # executed from the app bundle, such as spatial audio with + # `--ao=avfoundation`. This wrapper ensures that those features + # work reliably and also avoids shipping two copies of the entire + # `mpv` executable. + makeWrapper $out/Applications/mpv.app/Contents/MacOS/mpv $out/bin/mpv ''; # Set RUNPATH so that libcuda in /run/opengl-driver(-32)/lib can be found.