summary refs log tree commit diff
path: root/pkgs/applications/video/mpv/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/video/mpv/default.nix')
-rw-r--r--pkgs/applications/video/mpv/default.nix13
1 files changed, 10 insertions, 3 deletions
diff --git a/pkgs/applications/video/mpv/default.nix b/pkgs/applications/video/mpv/default.nix
index 057b9874162..33fb4fc7821 100644
--- a/pkgs/applications/video/mpv/default.nix
+++ b/pkgs/applications/video/mpv/default.nix
@@ -9,7 +9,7 @@
 , ninja
 , pkg-config
 , python3
-, ffmpeg_5
+, ffmpeg
 , freefont_ttf
 , freetype
 , libass
@@ -19,6 +19,7 @@
 , libuchardet
 , libiconv
 , xcbuild
+, sigtool
 
 , waylandSupport ? stdenv.isLinux
   , wayland
@@ -154,12 +155,12 @@ in stdenv'.mkDerivation (finalAttrs: {
     pkg-config
     python3
   ]
-  ++ lib.optionals stdenv.isDarwin [ xcbuild.xcrun ]
+  ++ lib.optionals stdenv.isDarwin [ xcbuild.xcrun sigtool ]
   ++ lib.optionals swiftSupport [ swift ]
   ++ lib.optionals waylandSupport [ wayland-scanner ];
 
   buildInputs = [
-    ffmpeg_5
+    ffmpeg
     freetype
     libass
     libpthreadstubs
@@ -203,6 +204,11 @@ in stdenv'.mkDerivation (finalAttrs: {
   postBuild = lib.optionalString stdenv.isDarwin ''
     pushd .. # Must be run from the source dir because it uses relative paths
     python3 TOOLS/osxbundle.py -s build/mpv
+    # Swap binary and bundle symlink to sign bundle executable as symlinks cannot be signed
+    rm build/mpv.app/Contents/MacOS/mpv-bundle
+    mv build/mpv.app/Contents/MacOS/mpv build/mpv.app/Contents/MacOS/mpv-bundle
+    ln -s mpv-bundle build/mpv.app/Contents/MacOS/mpv
+    codesign --force --sign - build/mpv.app/Contents/MacOS/mpv-bundle
     popd
   '';
 
@@ -250,6 +256,7 @@ in stdenv'.mkDerivation (finalAttrs: {
     '';
     changelog = "https://github.com/mpv-player/mpv/releases/tag/v${finalAttrs.version}";
     license = licenses.gpl2Plus;
+    mainProgram = "mpv";
     maintainers = with maintainers; [ AndersonTorres fpletz globin ma27 tadeokondrak ];
     platforms = platforms.unix;
   };