From acd80bbf005658bf55dad08819d31529b91fe6cd Mon Sep 17 00:00:00 2001 From: David Stritzl <437018+davidstritzl@users.noreply.github.com> Date: Sat, 4 Nov 2023 21:19:07 +0100 Subject: mpv: sign darwin bundle executable This fixes the application exiting immediately after launch via application bundle on macOS 14 (#261072). --- pkgs/applications/video/mpv/default.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'pkgs/applications/video/mpv/default.nix') diff --git a/pkgs/applications/video/mpv/default.nix b/pkgs/applications/video/mpv/default.nix index 8290e39979c..95681d4a4ab 100644 --- a/pkgs/applications/video/mpv/default.nix +++ b/pkgs/applications/video/mpv/default.nix @@ -19,6 +19,7 @@ , libuchardet , libiconv , xcbuild +, sigtool , waylandSupport ? stdenv.isLinux , wayland @@ -154,7 +155,7 @@ 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 ]; @@ -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 ''; -- cgit 1.4.1