From a8f17dafd9aa3e9bfa0ba99cb9dbdadaa6e0d391 Mon Sep 17 00:00:00 2001 From: Drew Weymouth Date: Sun, 26 Mar 2023 11:01:50 -0700 Subject: [PATCH] detect version of vapoursynth Python dependency in Mac OS packaging --- Makefile | 3 +-- copy_python_dep_osx.sh | 5 +++++ 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100755 copy_python_dep_osx.sh diff --git a/Makefile b/Makefile index 28ca584..82122cd 100644 --- a/Makefile +++ b/Makefile @@ -11,8 +11,7 @@ build: package_macos: fyne package -os darwin -name $(app_name) -icon $(icon_path_mac) dylibbundler -od -b -x ./Supersonic.app/Contents/MacOS/supersonic -d ./Supersonic.app/Contents/Frameworks/ -p @executable_path/../Frameworks/ - install_name_tool -change "/usr/local/opt/python@3.11/Frameworks/Python.framework/Versions/3.11/Python" "@executable_path/../Frameworks/Python" "./Supersonic.app/Contents/Frameworks/libvapoursynth-script.0.dylib" - cp /usr/local/opt/python@3.11/Frameworks/Python.framework/Versions/3.11/Python ./Supersonic.app/Contents/Frameworks + ./copy_python_dep_osx.sh codesign --force --deep --preserve-metadata=entitlements,requirements,flags,runtime --sign - "./Supersonic.app/Contents/MacOS/supersonic" package_windows: diff --git a/copy_python_dep_osx.sh b/copy_python_dep_osx.sh new file mode 100755 index 0000000..3b4ac43 --- /dev/null +++ b/copy_python_dep_osx.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +PYTHON_PATH=$(otool -L ./Supersonic.app/Contents/Frameworks/libvapoursynth-script.0.dylib | grep 'Python' | awk '{print $1}') +install_name_tool -change "$PYTHON_PATH" "@executable_path/../Frameworks/Python" "./Supersonic.app/Contents/Frameworks/libvapoursynth-script.0.dylib" +cp "$PYTHON_PATH" ./Supersonic.app/Contents/Frameworks