summaryrefslogtreecommitdiffstats
path: root/TOOLS
diff options
context:
space:
mode:
authorDaniel Brookman <dannntrax@gmail.com>2023-08-10 16:09:37 -0400
committerder richter <der.richter@gmx.de>2023-11-15 23:08:11 +0100
commitaa8af2e66bf9613470c47c3a64e6d4ed7497fa14 (patch)
treef9dce64b4003e1167170105ca90a3ee7caf2e8c0 /TOOLS
parentdcb3213aa7495e4037b6040c103511aaac2f46c5 (diff)
downloadmpv-aa8af2e66bf9613470c47c3a64e6d4ed7497fa14.tar.bz2
mpv-aa8af2e66bf9613470c47c3a64e6d4ed7497fa14.tar.xz
osxbundle: remove mpv-bundle symlink to allow code signing
Apps on Apple silicon have to be codesigned to run, but you can't codesign bundles that have a symlink for the main executable. The "mpv-bundle" symlink was used as the bundle's main executable because it makes the execution name of the binary different. Launch Services runs the CFBundleExecutable key from Info.plist when launching a bundle, so by comparing the execution name to the name of the symlink, you can check if that's how the binary was launched. This replaces that detection method by moving the MPVBUNDLE environmental variable into Info.plist. Launch Services will set anything in LSEnvironment as environmental variables before launching the bundle, so we're able to check for it instead of needing to differentiate the execution name of the binary. Fixes #12116
Diffstat (limited to 'TOOLS')
-rwxr-xr-xTOOLS/osxbundle.py6
-rw-r--r--TOOLS/osxbundle/mpv.app/Contents/Info.plist4
2 files changed, 3 insertions, 7 deletions
diff --git a/TOOLS/osxbundle.py b/TOOLS/osxbundle.py
index bf08061c31..bd1ab45a58 100755
--- a/TOOLS/osxbundle.py
+++ b/TOOLS/osxbundle.py
@@ -38,10 +38,6 @@ def apply_plist_template(plist_file, version):
for line in fileinput.input(plist_file, inplace=1):
print(line.rstrip().replace('${VERSION}', version))
-def create_bundle_symlink(binary_name, symlink_name):
- os.symlink(os.path.basename(binary_name),
- os.path.join(target_directory(binary_name), symlink_name))
-
def bundle_version():
if os.path.exists('VERSION'):
x = open('VERSION')
@@ -72,8 +68,6 @@ def main():
copy_bundle(binary_name)
print("> copying binary")
copy_binary(binary_name)
- print("> create bundle symlink")
- create_bundle_symlink(binary_name, "mpv-bundle")
print("> generating Info.plist")
apply_plist_template(target_plist(binary_name), version)
diff --git a/TOOLS/osxbundle/mpv.app/Contents/Info.plist b/TOOLS/osxbundle/mpv.app/Contents/Info.plist
index 2c52d16d91..e239dc74f9 100644
--- a/TOOLS/osxbundle/mpv.app/Contents/Info.plist
+++ b/TOOLS/osxbundle/mpv.app/Contents/Info.plist
@@ -173,7 +173,7 @@
</dict>
</array>
<key>CFBundleExecutable</key>
- <string>mpv-bundle</string>
+ <string>mpv</string>
<key>CFBundleIconFile</key>
<string>icon</string>
<key>CFBundleIdentifier</key>
@@ -192,6 +192,8 @@
<dict>
<key>MallocNanoZone</key>
<string>0</string>
+ <key>MPVBUNDLE</key>
+ <string>true</string>
</dict>
<key>CFBundleURLTypes</key>
<array>