2011-05-21 18:08:00 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2011-05-22 00:43:13 +02:00
|
|
|
APP="${1?}"
|
2011-06-01 21:02:59 +02:00
|
|
|
PLUGINS="${APP}/Contents/Plugins"
|
|
|
|
OP_PLUGINS="${APP}/Contents/Plugins/OpenPilot"
|
2014-01-09 20:13:52 +01:00
|
|
|
QT_LIBS="QtCore QtGui QtMultimedia QtMultimediaWidgets QtNetwork QtOpenGL QtPrintSupport QtQml QtQuick QtScript QtSerialPort QtSql QtSvg QtWidgets QtV8 QtXml"
|
2013-04-04 14:52:16 +02:00
|
|
|
QT_DIR=$(otool -L "${APP}/Contents/MacOS/OpenPilot GCS" | sed -n -e 's/\/QtCore\.framework.*//p' | sed -n -E 's:^.::p')
|
2013-11-10 09:20:40 +01:00
|
|
|
QT_EXTRA="accessible/libqtaccessiblewidgets.dylib bearer/libqgenericbearer.dylib imageformats/libqgif.dylib imageformats/libqico.dylib imageformats/libqjpeg.dylib imageformats/libqmng.dylib imageformats/libqtiff.dylib imageformats/libqsvg.dylib qmltooling/libqmldbg_tcp.dylib sqldrivers/libqsqlodbc.dylib sqldrivers/libqsqlpsql.dylib sqldrivers/libqsqlite.dylib imageformats/libqtga.dylib iconengines/libqsvgicon.dylib"
|
2011-08-04 18:16:10 +02:00
|
|
|
|
2012-06-13 19:30:07 +02:00
|
|
|
OSG_EXTRA="libosgViewer.90.dylib"
|
2011-08-04 18:16:10 +02:00
|
|
|
|
2013-04-03 17:41:30 +02:00
|
|
|
if [ -z "${QT_DIR}" ]
|
|
|
|
then
|
2013-04-04 14:52:16 +02:00
|
|
|
# QT_DIR is empty, then we have (presumably):
|
|
|
|
QT_FRAMEWORKS="/Library/Frameworks"
|
|
|
|
QT_PLUGINS="/Developer/Applications/Qt/plugins"
|
2013-04-03 17:41:30 +02:00
|
|
|
else
|
2013-04-04 14:52:16 +02:00
|
|
|
# Typical Nokia SDK paths
|
|
|
|
QT_FRAMEWORKS="${QT_DIR}"
|
|
|
|
QT_PLUGINS="${QT_DIR}/../plugins"
|
|
|
|
QT_DIR="${QT_DIR}/"
|
2013-04-03 17:41:30 +02:00
|
|
|
fi
|
|
|
|
|
2011-08-04 18:16:10 +02:00
|
|
|
echo "Qt library directory is \"${QT_DIR}\""
|
2011-05-21 18:08:00 +02:00
|
|
|
|
2014-01-09 21:45:16 +01:00
|
|
|
echo "Running macdeployqt from ${QT_DIR}../bin/macdeployqt"
|
2011-05-21 18:08:00 +02:00
|
|
|
|
2014-01-10 01:04:44 +01:00
|
|
|
"${QT_DIR}../bin/macdeployqt" "${APP}" -no-strip -verbose=2
|
2014-01-09 21:46:50 +01:00
|
|
|
|
2014-01-10 23:26:33 +01:00
|
|
|
#Append Qml2Imports config to qt.conf
|
|
|
|
echo "Qml2Imports = Imports" >> "${APP}/"Contents/Resources/qt.conf
|
|
|
|
|
2014-01-09 21:46:50 +01:00
|
|
|
echo "Processing Qt libraries paths in ${APP}"
|
2014-01-10 23:27:10 +01:00
|
|
|
for f in "${PLUGINS}/"*.dylib "${OP_PLUGINS}/"*.dylib "${APP}/"Contents/Imports/QtQuick.2/*.dylib "${APP}/"Contents/Imports/QtQuick/*/*.dylib
|
2011-05-21 18:08:00 +02:00
|
|
|
do
|
2014-01-10 01:04:44 +01:00
|
|
|
if [ -f "${f}" ] && [ ! -L "${f}" ]
|
|
|
|
then
|
|
|
|
# Only process plain files
|
2014-01-09 21:46:50 +01:00
|
|
|
chmod +w "${f}"
|
2014-01-10 01:04:44 +01:00
|
|
|
echo "* ${f}"
|
|
|
|
for g in $QT_LIBS
|
|
|
|
do
|
|
|
|
install_name_tool -change \
|
|
|
|
"${QT_DIR}${g}.framework/Versions/5/${g}" \
|
|
|
|
@executable_path/../Frameworks/${g}.framework/Versions/5/${g} \
|
|
|
|
"${f}"
|
|
|
|
done
|
2014-01-09 21:46:50 +01:00
|
|
|
chmod -w "${f}"
|
2014-01-10 01:04:44 +01:00
|
|
|
fi
|
2011-05-21 18:08:00 +02:00
|
|
|
done
|
|
|
|
|
2011-08-04 18:16:10 +02:00
|
|
|
echo "Copying SDL"
|
2013-04-03 17:41:30 +02:00
|
|
|
cp -a "/Library/Frameworks/SDL.framework" "${APP}/Contents/Frameworks/"
|
2014-01-09 20:12:45 +01:00
|
|
|
chmod +w "${APP}/Contents/Plugins/libsdlgamepad.1.dylib"
|
|
|
|
chmod +w "${APP}/Contents/Frameworks/SDL.framework/SDL"
|
2011-08-04 18:16:10 +02:00
|
|
|
echo "Changing package identification of SDL"
|
|
|
|
install_name_tool -id \
|
2013-04-04 14:52:16 +02:00
|
|
|
@executable_path/../Frameworks/SDL.framework/SDL \
|
|
|
|
"${APP}/Contents/Frameworks/SDL.framework/SDL"
|
2012-10-09 15:27:20 +02:00
|
|
|
install_name_tool -change \
|
2013-04-04 14:52:16 +02:00
|
|
|
@rpath/SDL.framework/Versions/A/SDL \
|
|
|
|
"@executable_path/../Frameworks/SDL.framework/SDL" \
|
|
|
|
"${APP}/Contents/Plugins/libsdlgamepad.1.dylib"
|
2014-01-09 20:12:45 +01:00
|
|
|
chmod -w "${APP}/Contents/Plugins/libsdlgamepad.1.dylib"
|
|
|
|
chmod -w "${APP}/Contents/Frameworks/SDL.framework/SDL"
|
2011-08-04 18:16:10 +02:00
|
|
|
|
2013-04-03 17:41:30 +02:00
|
|
|
# deleting unnecessary files
|
2011-05-21 18:08:00 +02:00
|
|
|
echo "Deleting unnecessary files"
|
2011-05-22 19:17:50 +02:00
|
|
|
find "${APP}/Contents/Frameworks" -iname "*_debug" -exec rm -rf \{\} \;
|