File indexing completed on 2024-04-14 04:50:36

0001 #!/bin/bash
0002 #
0003 # Usage: ./macdeploy.sh <full-path-to-macdeployqt>
0004 #
0005 # macdeployqt is usually located in QTDIR/bin/macdeployqt
0006 
0007 if [ -z "$1" ]; then
0008  echo "Required parameter missing for full path to macdeployqt"
0009  exit 1
0010 fi
0011 
0012 MACDEPLOYQT=$1
0013 QTDIR="`dirname $MACDEPLOYQT`/.."
0014 LIBRARY_NAME="libFalkonPrivate.2.dylib"
0015 PLUGINS="Falkon.app/Contents/Resources/plugins"
0016 QTPLUGINS="Falkon.app/Contents/PlugIns"
0017 
0018 # cd to directory with bundle
0019 test -d bin || cd ..
0020 cd bin
0021 
0022 # copy libFalkonPrivate into bundle
0023 cp $LIBRARY_NAME Falkon.app/Contents/MacOS/
0024 
0025 # copy all Falkon plugins into bundle
0026 test -d $PLUGINS || mkdir $PLUGINS
0027 cp plugins/*.dylib $PLUGINS/
0028 
0029 # fix libFalkon
0030 install_name_tool -change $LIBRARY_NAME @executable_path/$LIBRARY_NAME Falkon.app/Contents/MacOS/Falkon
0031 
0032 # fix plugins
0033 for plugin in $PLUGINS/*.dylib
0034 do
0035  install_name_tool -change $LIBRARY_NAME @executable_path/$LIBRARY_NAME $plugin
0036 done
0037 
0038 # copy known, missing, Qt native library plugins into bundle
0039 #
0040 # See:
0041 #  *  http://code.qt.io/cgit/qt/qttools.git/tree/src/macdeployqt/shared/shared.cpp#n1044
0042 #
0043 mkdir -p $QTPLUGINS
0044 
0045 FILE="$QTDIR/plugins/iconengines/libqsvgicon.dylib"
0046 if [ -f "$FILE" ]; then
0047  cp $FILE $QTPLUGINS/
0048 else
0049  echo "$FILE: No such file"
0050  exit 1
0051 fi
0052 
0053 # run macdeployqt
0054 $MACDEPLOYQT Falkon.app -qmldir=$PWD/../src/lib/data/data
0055 
0056 # create final dmg image
0057 cd ../mac
0058 ./create_dmg.sh