about summary refs log tree commit diff
path: root/pkgs/applications/video
diff options
context:
space:
mode:
authorDavid Knaack <davidkna@users.noreply.github.com>2024-01-30 13:28:38 +0100
committerAnderson Torres <torres.anderson.85@protonmail.com>2024-02-09 21:28:46 -0300
commitce6ca5eb065dfe98789b6cd698788f02328efc67 (patch)
treea9339df7f7b6157f6f5093e51a992f1160cef103 /pkgs/applications/video
parent3d1ef6d39a14efd65b6b43cc1b93f0cb633b83b0 (diff)
mpv: fix app-bundling
Diffstat (limited to 'pkgs/applications/video')
-rw-r--r--pkgs/applications/video/mpv/darwin-sigtool-no-deep.patch13
-rw-r--r--pkgs/applications/video/mpv/default.nix8
-rw-r--r--pkgs/applications/video/mpv/wrapper.nix2
3 files changed, 16 insertions, 7 deletions
diff --git a/pkgs/applications/video/mpv/darwin-sigtool-no-deep.patch b/pkgs/applications/video/mpv/darwin-sigtool-no-deep.patch
new file mode 100644
index 0000000000000..35ca32653a36f
--- /dev/null
+++ b/pkgs/applications/video/mpv/darwin-sigtool-no-deep.patch
@@ -0,0 +1,13 @@
+diff --git a/TOOLS/osxbundle.py b/TOOLS/osxbundle.py
+index 98699e478b..d02ecf610e 100755
+--- a/TOOLS/osxbundle.py
++++ b/TOOLS/osxbundle.py
+@@ -39,7 +39,7 @@ def apply_plist_template(plist_file, version):
+         print(line.rstrip().replace('${VERSION}', version))
+ 
+ def sign_bundle(binary_name):
+-    sh('codesign --force --deep -s - ' + bundle_path(binary_name))
++    sh('codesign --force -s - ' + bundle_path(binary_name))
+ 
+ def bundle_version():
+     if os.path.exists('VERSION'):
diff --git a/pkgs/applications/video/mpv/default.nix b/pkgs/applications/video/mpv/default.nix
index e0b53747485d5..88c13cf1c105e 100644
--- a/pkgs/applications/video/mpv/default.nix
+++ b/pkgs/applications/video/mpv/default.nix
@@ -113,6 +113,8 @@ in stdenv'.mkDerivation (finalAttrs: {
 
   env.NIX_LDFLAGS = lib.optionalString x11Support "-lX11 -lXext ";
 
+  patches = [ ./darwin-sigtool-no-deep.patch ];
+
   # A trick to patchShebang everything except mpv_identify.sh
   postPatch = ''
     pushd TOOLS
@@ -206,12 +208,6 @@ 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 a86c9671a4813..b427318121ef0 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-bundle" "$out/Applications/mpv.app/Contents/MacOS/mpv" ${mostMakeWrapperArgs}
+        makeWrapper "${mpv}/Applications/mpv.app/Contents/MacOS/mpv" "$out/Applications/mpv.app/Contents/MacOS/mpv" ${mostMakeWrapperArgs}
       '';
 
       meta = {