X-Git-Url: https://git.sur5r.net/?p=fstl;a=blobdiff_plain;f=app%2Fpackage.sh;fp=app%2Fpackage.sh;h=bdb4999a91d18306e453a66f17056394719f1abd;hp=d51c470818b0589e07721a0663d78d678be8c522;hb=5dd213695da2eb22219ac5143aa8b5cfe7c89559;hpb=967d178c4343c689c728571bb10d5c94ab8d9d13 diff --git a/app/package.sh b/app/package.sh index d51c470..bdb4999 100755 --- a/app/package.sh +++ b/app/package.sh @@ -1,14 +1,53 @@ #!/bin/sh +set -x -e + cd ../build -macdeployqt fstl.app +make clean +rm -rf fstl.app +make -j8 + +APP=fstl + +# Pull out framework paths info with otool +MACDEPLOYQT=`otool -L $APP.app/Contents/MacOS/fstl | sed -n -e "s:\(.*\)lib/QtCore.*:\1/bin/macdeployqt:gp"` + +$MACDEPLOYQT $APP.app + +# Delete unused Qt plugins cd fstl.app/Contents/PlugIns rm -rf accessible audio imageformats mediaservice playlistformats position printsupport qml1tooling sensorgestures sensors -cd ../Frameworks -rm -rf QtDeclarative.framework QtMultimedia.framework QtMultimediaWidgets.framework QtNetwork.framework QtPositioning.framework QtQml.framework QtQuick.framework QtScript.framework QtSensors.framework QtSql.framework QtXmlPatterns.framework + +fix_qt () { + echo "Fixing Qt for $1" + for LIB in $( otool -L $1 | sed -n -e "s:\(.*Qt.*.framework[^ ]*\).*:\1:gp" ) + do + RENAMED=`echo $LIB | sed -n -e "s:.*\(Qt.*\)\.framework.*:@executable_path/../Frameworks/\1.framework/Versions/5/\1:gp"` + install_name_tool -change $LIB $RENAMED $1 + done +} + +# Remap platform links +cd platforms +fix_qt libqcocoa.dylib + +# Delete unused Qt frameworks +cd ../../Frameworks +rm -rf QtDeclarative.framework QtMultimedia.framework QtMultimediaWidgets.framework QtNetwork.framework QtPositioning.framework QtQml.framework QtQuick.framework QtScript.framework QtSensors.framework QtSql.framework QtXmlPatterns.framework Qt3DCore.framework Qt3DRender.framework QtLocation.framework QtSerialBus.framework QtSerialPort.framework + +# Clean up remaining Qt frameworks +for LIB in $( ls|sed -n -e "s:\(Qt.*\)\.framework:\1:gp" ) +do + fix_qt $LIB.framework/Versions/Current/$LIB +done + cd ../Resources rm empty.lproj -cd ../../.. -cp -r fstl.app .. -cd .. -zip -r fstl_mac.zip fstl.app README.md +# Create a disk image +cd ../../.. +mkdir $APP +cp ../README.md ./$APP/README.txt +cp -R $APP.app ./$APP +hdiutil create $APP.dmg -volname "$APP" -srcfolder $APP +rm -rf $APP +mv $APP.dmg ..