]> 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
16 # Delete unused Qt plugins
17 cd fstl.app/Contents/PlugIns
18 rm -rf accessible audio imageformats mediaservice playlistformats position printsupport qml1tooling sensorgestures sensors
19
20 fix_qt () {
21     echo "Fixing Qt for $1"
22     for LIB in $( otool -L $1 | sed -n -e "s:\(.*Qt.*.framework[^ ]*\).*:\1:gp" )
23     do
24         RENAMED=`echo $LIB | sed -n -e "s:.*\(Qt.*\)\.framework.*:@executable_path/../Frameworks/\1.framework/Versions/5/\1:gp"`
25         install_name_tool -change $LIB $RENAMED $1
26     done
27 }
28
29 # Remap platform links
30 cd platforms
31 fix_qt libqcocoa.dylib
32
33 # Delete unused Qt frameworks
34 cd ../../Frameworks
35 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
36
37 # Clean up remaining Qt frameworks
38 for LIB in $( ls|sed -n -e "s:\(Qt.*\)\.framework:\1:gp" )
39 do
40     fix_qt $LIB.framework/Versions/Current/$LIB
41 done
42
43 cd ../Resources
44 rm empty.lproj
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 ..