mpv: fix app-bundling

This commit is contained in:
David Knaack 2024-01-30 13:28:38 +01:00 committed by Anderson Torres
parent 3d1ef6d39a
commit ce6ca5eb06
3 changed files with 16 additions and 7 deletions

View File

@ -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'):

View File

@ -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
'';

View File

@ -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 = {