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 000000000000..35ca32653a36 --- /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 e0b53747485d..88c13cf1c105 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 a86c9671a481..b427318121ef 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 = {