diff options
author | David Stritzl <437018+davidstritzl@users.noreply.github.com> | 2023-11-04 21:19:07 +0100 |
---|---|---|
committer | Anderson Torres <torres.anderson.85@protonmail.com> | 2023-11-10 11:03:01 -0300 |
commit | acd80bbf005658bf55dad08819d31529b91fe6cd (patch) | |
tree | 2ef3bef47a2a99945b648d7e6c8a85a504483043 /pkgs/applications/video/mpv | |
parent | 94633f04a3497b60cf15184b05fae12f283e1111 (diff) | |
download | nixlib-acd80bbf005658bf55dad08819d31529b91fe6cd.tar nixlib-acd80bbf005658bf55dad08819d31529b91fe6cd.tar.gz nixlib-acd80bbf005658bf55dad08819d31529b91fe6cd.tar.bz2 nixlib-acd80bbf005658bf55dad08819d31529b91fe6cd.tar.lz nixlib-acd80bbf005658bf55dad08819d31529b91fe6cd.tar.xz nixlib-acd80bbf005658bf55dad08819d31529b91fe6cd.tar.zst nixlib-acd80bbf005658bf55dad08819d31529b91fe6cd.zip |
mpv: sign darwin bundle executable
This fixes the application exiting immediately after launch via application bundle on macOS 14 (#261072).
Diffstat (limited to 'pkgs/applications/video/mpv')
-rw-r--r-- | pkgs/applications/video/mpv/default.nix | 8 | ||||
-rw-r--r-- | pkgs/applications/video/mpv/wrapper.nix | 2 |
2 files changed, 8 insertions, 2 deletions
diff --git a/pkgs/applications/video/mpv/default.nix b/pkgs/applications/video/mpv/default.nix index 8290e39979c3..95681d4a4ab4 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 ''; diff --git a/pkgs/applications/video/mpv/wrapper.nix b/pkgs/applications/video/mpv/wrapper.nix index b427318121ef..a86c9671a481 100644 --- a/pkgs/applications/video/mpv/wrapper.nix +++ b/pkgs/applications/video/mpv/wrapper.nix @@ -97,7 +97,7 @@ let '' + lib.optionalString stdenv.isDarwin '' # wrapProgram can't operate on symlinks rm "$out/Applications/mpv.app/Contents/MacOS/mpv" - makeWrapper "${mpv}/Applications/mpv.app/Contents/MacOS/mpv" "$out/Applications/mpv.app/Contents/MacOS/mpv" ${mostMakeWrapperArgs} + makeWrapper "${mpv}/Applications/mpv.app/Contents/MacOS/mpv-bundle" "$out/Applications/mpv.app/Contents/MacOS/mpv" ${mostMakeWrapperArgs} ''; meta = { |