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"
|
2011-08-05 01:07:52 +02:00
|
|
|
QT_LIBS="QtGui QtTest QtCore QtSvg QtSql QtOpenGL QtNetwork QtXml QtDBus QtScript phonon"
|
2011-08-04 18:16:10 +02:00
|
|
|
QT_DIR=$(otool -L "${APP}/Contents/MacOS/OpenPilot GCS" | sed -n -e 's/\/QtCore\.framework.*//p' | sed -n -E 's:^.::p')
|
2012-01-31 21:46:58 +01:00
|
|
|
QT_EXTRA="accessible/libqtaccessiblewidgets.dylib bearer/libqgenericbearer.dylib codecs/libqcncodecs.dylib codecs/libqjpcodecs.dylib codecs/libqkrcodecs.dylib codecs/libqtwcodecs.dylib graphicssystems/libqtracegraphicssystem.dylib imageformats/libqgif.dylib imageformats/libqico.dylib imageformats/libqjpeg.dylib imageformats/libqmng.dylib imageformats/libqtiff.dylib imageformats/libqsvg.dylib qmltooling/libqmldbg_inspector.dylib qmltooling/libqmldbg_tcp.dylib"
|
2011-08-04 18:16:10 +02:00
|
|
|
|
|
|
|
|
|
|
|
echo "Qt library directory is \"${QT_DIR}\""
|
2011-05-21 18:08:00 +02:00
|
|
|
|
2011-05-22 00:43:13 +02:00
|
|
|
echo "Processing Qt libraries in $1"
|
2011-05-21 18:08:00 +02:00
|
|
|
macdeployqt "${APP}"
|
|
|
|
|
|
|
|
for f in "${PLUGINS}/"*.dylib "${OP_PLUGINS}/"*.dylib
|
|
|
|
do
|
2011-05-22 00:43:13 +02:00
|
|
|
for g in $QT_LIBS
|
|
|
|
do
|
|
|
|
install_name_tool -change \
|
2011-08-04 18:16:10 +02:00
|
|
|
"${QT_DIR}/${g}.framework/Versions/4/${g}" \
|
2011-05-22 00:43:13 +02:00
|
|
|
@executable_path/../Frameworks/${g}.framework/Versions/4/${g} \
|
|
|
|
"${f}"
|
|
|
|
done
|
2011-05-21 18:08:00 +02:00
|
|
|
done
|
|
|
|
|
2011-07-14 20:56:48 +02:00
|
|
|
|
2011-05-21 18:08:00 +02:00
|
|
|
# should be redundant but some libs missed by main app and macdeployqt
|
2011-05-22 19:17:50 +02:00
|
|
|
for f in ${QT_LIBS}
|
2011-05-21 18:08:00 +02:00
|
|
|
do
|
2011-05-22 00:43:13 +02:00
|
|
|
echo "Copying ${f}"
|
2011-08-04 18:16:10 +02:00
|
|
|
cp -r "${QT_DIR}/${f}.framework" "${APP}/Contents/Frameworks/"
|
2011-05-22 00:43:13 +02:00
|
|
|
|
|
|
|
echo "Changing package identification of ${f}"
|
|
|
|
install_name_tool -id \
|
2011-08-04 18:16:10 +02:00
|
|
|
@executable_path/../Frameworks/${f}.framework/Versions/4/${f} \
|
2011-05-22 00:43:13 +02:00
|
|
|
"${APP}/Contents/Frameworks/${f}.framework/Versions/4/${f}"
|
|
|
|
|
2011-08-05 01:45:27 +02:00
|
|
|
rm "${APP}/Contents/Frameworks/${f}.framework/${f}"
|
|
|
|
|
2011-05-22 00:43:13 +02:00
|
|
|
echo "Changing package linkages"
|
|
|
|
for g in $QT_LIBS
|
|
|
|
do
|
|
|
|
install_name_tool -change \
|
2011-08-04 18:16:10 +02:00
|
|
|
"${QT_DIR}/${g}.framework/Versions/4/${g}" \
|
2011-05-22 00:43:13 +02:00
|
|
|
@executable_path/../Frameworks/${g}.framework/Versions/4/${g} \
|
|
|
|
"${APP}/Contents/Frameworks/${f}.framework/Versions/4/${f}"
|
|
|
|
done
|
2011-05-21 18:08:00 +02:00
|
|
|
done
|
|
|
|
|
2011-08-04 18:16:10 +02:00
|
|
|
for f in ${QT_EXTRA}
|
|
|
|
do
|
2012-01-31 21:46:58 +01:00
|
|
|
echo "Copying package ${f}"
|
|
|
|
cp "${QT_DIR}/../plugins/${f}" "${APP}/Contents/Plugins/${f}"
|
2011-08-04 18:16:10 +02:00
|
|
|
echo "Changing package identification of ${f}"
|
|
|
|
install_name_tool -id \
|
|
|
|
@executable_path/../Plugins/${f} \
|
|
|
|
"${PLUGINS}/${f}"
|
2012-01-31 21:46:58 +01:00
|
|
|
|
|
|
|
echo "Changing package linkages"
|
|
|
|
for g in $QT_LIBS
|
|
|
|
do
|
|
|
|
install_name_tool -change \
|
|
|
|
"${QT_DIR}/${g}.framework/Versions/4/${g}" \
|
|
|
|
@executable_path/../Frameworks/${g}.framework/Versions/4/${g} \
|
|
|
|
"${APP}/Contents/Plugins/${f}"
|
|
|
|
done
|
2011-08-04 18:16:10 +02:00
|
|
|
done
|
|
|
|
|
|
|
|
echo "Copying SDL"
|
|
|
|
cp -r "/Library/Frameworks/SDL.framework" "${APP}/Contents/Frameworks/"
|
|
|
|
|
|
|
|
echo "Changing package identification of SDL"
|
|
|
|
install_name_tool -id \
|
|
|
|
@executable_path/../Frameworks/SDL.framework/Versions/A/SDL \
|
|
|
|
"${APP}/Contents/Frameworks/SDL.framework/Versions/A/SDL"
|
|
|
|
|
2011-05-21 18:08:00 +02:00
|
|
|
# deleting unnecessary files
|
|
|
|
echo "Deleting unnecessary files"
|
|
|
|
find "${APP}/Contents/Frameworks" -iname "current" -exec rm -rf \{\} \;
|
|
|
|
find "${APP}/Contents/Frameworks" -iname "4.0" -exec rm -rf \{\} \;
|
2011-05-22 19:17:50 +02:00
|
|
|
find "${APP}/Contents/Frameworks" -iname "*_debug" -exec rm -rf \{\} \;
|