mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-18 19:06:10 +00:00
29cbd06ab2
* Enable running of macOS packaging in GHA, most of the work done in dedbabde56
* Cleanup breakpad handling
* Have single version of main executable in folder expected by macOS and most tools instead of executable+symlink+shell script
* Handle Breakpad library lookup in more CMake way using FindBreakpad just like it's done on other platforms and packages
* Refactor error handling in some of the shell scripts to use `set -e` instead of `|| exit 1` for each command.
* Fix DMG background setup
52 lines
1.8 KiB
Bash
Executable File
52 lines
1.8 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
set -euo pipefail
|
|
if ! [[ $# -eq 3 ]]; then
|
|
echo "Usage: $0 [Python.framework] [AppBundle.app] [AppBundle.app/Contents/MacOS/Executable]"
|
|
exit 1
|
|
fi
|
|
|
|
python_version=python3.9
|
|
|
|
py_framework=$1
|
|
appbundle=$2
|
|
executable=$3
|
|
|
|
echo "Embedding $py_framework into $appbundle | $executable"
|
|
|
|
mkdir -p "$appbundle/Contents/Frameworks"
|
|
if [ ! -d "$appbundle/Contents/Frameworks/Python.framework" ]
|
|
then
|
|
cp -a -n "$py_framework" "$appbundle/Contents/Frameworks/"
|
|
echo "Cleaning up embedded Python Framework"
|
|
cd "$appbundle/Contents/Frameworks/Python.framework"
|
|
find . | grep -E "(__pycache__|\.pyc|\.pyo$)" | xargs rm -rf
|
|
rm -r Versions/Current/Resources/* "Versions/Current/lib/$python_version/test" "Versions/Current/lib/$python_version/idlelib" "Versions/Current/lib/$python_version/curses" "Versions/Current/lib/$python_version/lib2to3" || echo "Couldn't remove something"
|
|
else
|
|
echo "Python.framework already exists, skipping copying"
|
|
cd "$appbundle/Contents/Frameworks/Python.framework"
|
|
fi
|
|
|
|
echo "Making executable $executable point to embedded Framework"
|
|
install_name_tool -change `otool -L "$executable" | sed -n "s/^[[:blank:]]*\([^[:blank:]]*Python\) (.*$/\1/p"` @executable_path/../Frameworks/Python.framework/Versions/Current/Python "$executable"
|
|
|
|
echo "Checking if PySide2 is available"
|
|
|
|
pyside_prefix=$(pkg-config --variable=prefix pyside2)
|
|
if [ $? -ne 0 ]; then
|
|
echo "PySide2 is not available, ignoring."
|
|
exit 0
|
|
fi
|
|
|
|
echo "PySide is at $pyside_prefix"
|
|
|
|
if [ ! -d "Versions/Current/lib/$python_version/site-packages/PySide2" ]
|
|
then
|
|
cp -va "$pyside_prefix/lib/$python_version/" "Versions/Current/lib/$python_version"
|
|
cd .. # $appbundle/Contents/Frameworks
|
|
cp -va "$pyside_prefix/lib/"*.dylib .
|
|
else
|
|
echo "site-packages/Pyside2 exists, skipping copying"
|
|
fi
|
|
|