| 1 |
#!/bin/bash |
| 2 |
set -ev |
| 3 |
cd src |
| 4 |
|
| 5 |
echo "About to create dmg file and fix up" |
| 6 |
mkdir GoldenCheetah.app/Contents/Frameworks |
| 7 |
|
| 8 |
# This is a hack to include libicudata.*.dylib, not handled by macdployqt[fix] |
| 9 |
cp /usr/local/opt/icu4c/lib/libicudata.*.dylib GoldenCheetah.app/Contents/Frameworks |
| 10 |
|
| 11 |
# Copy python framework and change permissions to fix paths |
| 12 |
cp -R /Library/Frameworks/Python.framework GoldenCheetah.app/Contents/Frameworks |
| 13 |
chmod -R +w GoldenCheetah.app/Contents/Frameworks |
| 14 |
# Update deployed Python framework path |
| 15 |
install_name_tool -id @executable_path/../Frameworks/Python.framework/Versions/3.7/Python ./GoldenCheetah.app/Contents/Frameworks/Python.framework/Versions/3.7/Python |
| 16 |
# Update GoldenCheetah binary to reference deployed lib |
| 17 |
install_name_tool -change /Library/Frameworks/Python.framework/Versions/3.7/Python @executable_path/../Frameworks/Python.framework/Versions/3.7/Python ./GoldenCheetah.app/Contents/MacOS/GoldenCheetah |
| 18 |
# Update Python binary to reference deployed lib instead of the Cellar one |
| 19 |
OLD_PATH=`otool -L GoldenCheetah.app/Contents/Frameworks/Python.framework/Versions/3.7/bin/python3.7 | grep "Library" | cut -f 1 -d ' '` |
| 20 |
echo $OLD_PATH |
| 21 |
install_name_tool -change $OLD_PATH "@executable_path/../Python" GoldenCheetah.app/Contents/Frameworks/Python.framework/Versions/3.7/bin/python3.7 |
| 22 |
install_name_tool -change $OLD_PATH "@executable_path/../../../../Python" GoldenCheetah.app/Contents/Frameworks/Python.framework/Versions/3.7/Resources/Python.app/Contents/MacOS/Python |
| 23 |
# Add mandatory Python dependencies |
| 24 |
rm -r GoldenCheetah.app/Contents/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages |
| 25 |
cp -R ../site-packages GoldenCheetah.app/Contents/Frameworks/Python.framework/Versions/3.7/lib/python3.7 |
| 26 |
|
| 27 |
# Deployment using macdeployqt |
| 28 |
macdeployqt GoldenCheetah.app -verbose=2 -executable=GoldenCheetah.app/Contents/MacOS/GoldenCheetah -fs=hfs+ -dmg |
| 29 |
|
| 30 |
echo "Renaming dmg file to branch and build number ready for deploy" |
| 31 |
mv GoldenCheetah.dmg ../GoldenCheetah_v3.7_x64.dmg |
| 32 |
|
| 33 |
exit |