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-05-21 18:08:00 +02:00
|
|
|
QT_LIBS="QtGui QtCore QtSvg QtSql QtOpenGL QtNetwork QtXml QtDBus QtScript phonon"
|
|
|
|
|
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 \
|
|
|
|
${g}.framework/Versions/4/${g} \
|
|
|
|
@executable_path/../Frameworks/${g}.framework/Versions/4/${g} \
|
|
|
|
"${f}"
|
|
|
|
done
|
2011-05-21 18:08:00 +02:00
|
|
|
done
|
|
|
|
|
|
|
|
# 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}"
|
|
|
|
cp -r /Library/Frameworks/${f}.framework "${APP}/Contents/Frameworks/"
|
|
|
|
|
|
|
|
echo "Changing package identification of ${f}"
|
|
|
|
install_name_tool -id \
|
|
|
|
@executable_path/../Frameworks/${f}.framework/Versions/4/QtCore \
|
|
|
|
"${APP}/Contents/Frameworks/${f}.framework/Versions/4/${f}"
|
|
|
|
|
|
|
|
echo "Changing package linkages"
|
|
|
|
for g in $QT_LIBS
|
|
|
|
do
|
|
|
|
install_name_tool -change \
|
|
|
|
${g}.framework/Versions/4/${g} \
|
|
|
|
@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
|
|
|
|
|
|
|
|
# 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 \{\} \;
|