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"
|
2013-11-10 09:20:40 +01:00
|
|
|
QT_LIBS="QtDeclarative QtXmlPatterns QtGui QtTest QtCore QtSvg QtSql QtOpenGL QtNetwork QtXml QtScript"
|
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
|
|
|
|
2012-06-13 19:30:07 +02:00
|
|
|
echo "Running macdeployqt"
|
2013-11-10 09:20:40 +01:00
|
|
|
macdeployqt "${APP}" -no-strip
|
2011-05-21 18:08:00 +02:00
|
|
|
|
2013-04-03 17:41:30 +02:00
|
|
|
echo "Processing Qt libraries in ${APP}"
|
2011-05-21 18:08:00 +02:00
|
|
|
for f in "${PLUGINS}/"*.dylib "${OP_PLUGINS}/"*.dylib
|
|
|
|
do
|
2013-04-04 14:52:16 +02:00
|
|
|
# Only process plain files
|
|
|
|
[ ! -L "${f}" ] && for g in $QT_LIBS
|
|
|
|
do
|
|
|
|
install_name_tool -change \
|
2013-11-10 09:20:40 +01:00
|
|
|
"${QT_DIR}${g}.framework/Versions/5/${g}" \
|
|
|
|
@executable_path/../Frameworks/${g}.framework/Versions/5/${g} \
|
2013-04-04 14:52:16 +02:00
|
|
|
"${f}"
|
2011-05-22 00:43:13 +02:00
|
|
|
done
|
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/"
|
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"
|
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 \{\} \;
|