]> git.sur5r.net Git - fstl/blob - app/package.sh
Update watchfile to use Github API
[fstl] / app / package.sh
1 #!/bin/sh
2 set -x -e
3
4 cd ../build
5 make clean
6 rm -rf fstl.app
7 make -j8
8
9 APP=fstl
10
11 # Pull out framework paths info with otool
12 MACDEPLOYQT=`otool -L $APP.app/Contents/MacOS/fstl | sed -n -e "s:\(.*\)lib/QtCore.*:\1/bin/macdeployqt:gp"`
13
14 $MACDEPLOYQT $APP.app
15 cp ../app/Info.plist $APP.app/Contents/
16
17 # Delete unused Qt plugins
18 cd fstl.app/Contents/PlugIns
19 rm -rf accessible audio imageformats mediaservice playlistformats position printsupport qml1tooling sensorgestures sensors
20
21 fix_qt () {
22     echo "Fixing Qt for $1"
23     for LIB in $( otool -L $1 | sed -n -e "s:\(.*Qt.*.framework[^ ]*\).*:\1:gp" )
24     do
25         RENAMED=`echo $LIB | sed -n -e "s:.*\(Qt.*\)\.framework.*:@executable_path/../Frameworks/\1.framework/Versions/5/\1:gp"`
26         install_name_tool -change $LIB $RENAMED $1
27     done
28 }
29
30 # Remap platform links
31 cd platforms
32 fix_qt libqcocoa.dylib
33
34 # Delete unused Qt frameworks
35 cd ../../Frameworks
36 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
37
38 # Clean up remaining Qt frameworks
39 for LIB in $( ls|sed -n -e "s:\(Qt.*\)\.framework:\1:gp" )
40 do
41     fix_qt $LIB.framework/Versions/Current/$LIB
42 done
43
44 cd ../Resources
45
46 # Create a disk image
47 cd ../../..
48 mkdir $APP
49 cp ../README.md ./$APP/README.txt
50 cp -R $APP.app ./$APP
51 hdiutil create $APP.dmg -volname "$APP" -srcfolder $APP
52 rm -rf $APP
53 mv $APP.dmg ..