2012-04-04 21:12:52 +02:00
|
|
|
#!/bin/bash
|
2012-04-05 09:36:37 +02:00
|
|
|
#
|
2017-03-18 16:48:11 +01:00
|
|
|
# Usage: ./macdeploy.sh <full-path-to-macdeployqt>
|
2014-02-05 01:37:26 +01:00
|
|
|
#
|
2012-04-05 09:36:37 +02:00
|
|
|
# macdeployqt is usually located in QTDIR/bin/macdeployqt
|
|
|
|
|
2017-03-18 16:48:11 +01:00
|
|
|
if [ -z "$1" ]; then
|
|
|
|
echo "Required parameter missing for full path to macdeployqt"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
MACDEPLOYQT=$1
|
|
|
|
QTDIR="`dirname $MACDEPLOYQT`/.."
|
2016-04-03 11:10:39 +02:00
|
|
|
LIBRARY_NAME="libQupZilla.2.dylib"
|
2017-01-31 19:16:14 +01:00
|
|
|
PLUGINS="QupZilla.app/Contents/Resources/plugins"
|
|
|
|
QTPLUGINS="QupZilla.app/Contents/PlugIns"
|
2012-04-04 21:12:52 +02:00
|
|
|
|
|
|
|
# cd to directory with bundle
|
2012-04-05 09:36:37 +02:00
|
|
|
test -d bin || cd ..
|
|
|
|
cd bin
|
2012-04-04 21:12:52 +02:00
|
|
|
|
|
|
|
# copy libQupZilla into bundle
|
2012-04-04 23:28:19 +02:00
|
|
|
cp $LIBRARY_NAME QupZilla.app/Contents/MacOS/
|
2012-04-04 21:12:52 +02:00
|
|
|
|
2017-01-31 19:16:14 +01:00
|
|
|
# copy all QupZilla plugins into bundle
|
|
|
|
test -d $PLUGINS || mkdir $PLUGINS
|
|
|
|
cp plugins/*.dylib $PLUGINS/
|
2012-04-04 21:12:52 +02:00
|
|
|
|
|
|
|
# fix libQupZilla
|
2012-04-04 23:28:19 +02:00
|
|
|
install_name_tool -change $LIBRARY_NAME @executable_path/$LIBRARY_NAME QupZilla.app/Contents/MacOS/QupZilla
|
2012-04-04 21:12:52 +02:00
|
|
|
|
|
|
|
# fix plugins
|
2017-01-31 19:16:14 +01:00
|
|
|
for plugin in $PLUGINS/*.dylib
|
2012-04-04 21:12:52 +02:00
|
|
|
do
|
2012-04-04 23:28:19 +02:00
|
|
|
install_name_tool -change $LIBRARY_NAME @executable_path/$LIBRARY_NAME $plugin
|
2012-04-04 21:12:52 +02:00
|
|
|
done
|
|
|
|
|
2017-03-18 16:48:11 +01:00
|
|
|
# copy known, missing, Qt native library plugins into bundle
|
|
|
|
#
|
|
|
|
# See:
|
|
|
|
# * http://code.qt.io/cgit/qt/qttools.git/tree/src/macdeployqt/shared/shared.cpp#n1044
|
|
|
|
#
|
|
|
|
mkdir -p $QTPLUGINS
|
2017-01-31 19:16:14 +01:00
|
|
|
|
2017-03-18 16:48:11 +01:00
|
|
|
FILE="$QTDIR/plugins/iconengines/libqsvgicon.dylib"
|
|
|
|
if [ -f "$FILE" ]; then
|
|
|
|
cp $FILE $QTPLUGINS/
|
|
|
|
else
|
|
|
|
echo "$FILE: No such file"
|
|
|
|
exit 1
|
2017-01-31 19:16:14 +01:00
|
|
|
fi
|
|
|
|
|
2012-04-04 21:12:52 +02:00
|
|
|
# run macdeployqt
|
2017-03-21 21:02:45 +01:00
|
|
|
$MACDEPLOYQT QupZilla.app -qmldir=$PWD/../src/lib/data/data
|
2014-02-05 01:37:26 +01:00
|
|
|
|
|
|
|
# create final dmg image
|
2015-11-24 17:40:52 +01:00
|
|
|
cd ../mac
|
2014-02-05 01:37:26 +01:00
|
|
|
./create_dmg.sh
|