1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-01 09:24:10 +01:00
LibrePilot/package/osx/libraries
Stacey Sheldon 2119067722 Merge remote-tracking branch 'op-revo/james/revo' into revo-next
Conflicts:
	Makefile
	flight/Modules/Attitude/revolution/attitude.c
	flight/Modules/Battery/battery.c
	flight/Modules/FixedWingPathFollower/fixedwingpathfollower.c
	flight/Modules/GPS/GPS.c
	flight/Modules/ManualControl/inc/manualcontrol.h
	flight/Modules/ManualControl/manualcontrol.c
	flight/Modules/OveroSync/overosync.c
	flight/Modules/PathPlanner/inc/pathplanner.h
	flight/Modules/PathPlanner/pathplanner.c
	flight/Modules/Sensors/sensors.c
	flight/Modules/VtolPathFollower/vtolpathfollower.c
	flight/PiOS/Boards/STM32F4xx_Revolution.h
	flight/PiOS/Boards/pios_board.h
	flight/PiOS/STM32F4xx/library.mk
	flight/PiOS/inc/pios_hmc5883.h
	flight/PiOS/inc/pios_l3gd20.h
	flight/PiOS/inc/pios_rfm22b_priv.h
	flight/Revolution/Makefile
	flight/Revolution/Makefile.osx
	flight/Revolution/System/inc/pios_config.h
	flight/Revolution/UAVObjects.inc
	ground/openpilotgcs/src/libs/utils/coordinateconversions.cpp
	ground/openpilotgcs/src/libs/utils/homelocationutil.cpp
	ground/openpilotgcs/src/libs/utils/homelocationutil.h
	ground/openpilotgcs/src/plugins/config/configrevowidget.cpp
	ground/openpilotgcs/src/plugins/hitlnew/il2simulator.cpp
	ground/openpilotgcs/src/plugins/opmap/opmapgadgetwidget.cpp
	ground/openpilotgcs/src/plugins/plugins.pro
	ground/openpilotgcs/src/plugins/uavobjects/uavobjects.pro
	package/Makefile
	shared/uavobjectdefinition/fixedwingpathfollowersettings.xml
	shared/uavobjectdefinition/fixedwingpathfollowerstatus.xml
	shared/uavobjectdefinition/flightstatus.xml
	shared/uavobjectdefinition/hwsettings.xml
	shared/uavobjectdefinition/manualcontrolsettings.xml
	shared/uavobjectdefinition/pathdesired.xml
	shared/uavobjectdefinition/vtolpathfollowersettings.xml
	shared/uavobjectdefinition/waypoint.xml
2012-10-30 00:08:43 -04:00

101 lines
3.7 KiB
Bash
Executable File

#!/bin/bash
APP="${1?}"
PLUGINS="${APP}/Contents/Plugins"
OP_PLUGINS="${APP}/Contents/Plugins/OpenPilot"
QT_LIBS="QtDeclarative QtXmlPatterns QtGui QtTest QtCore QtSvg QtSql QtOpenGL QtNetwork QtXml QtDBus QtScript phonon"
QT_DIR=$(otool -L "${APP}/Contents/MacOS/OpenPilot GCS" | sed -n -e 's/\/QtCore\.framework.*//p' | sed -n -E 's:^.::p')
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 graphicssystems/libqglgraphicssystem.dylib sqldrivers/libqsqlodbc.dylib sqldrivers/libqsqlpsql.dylib sqldrivers/libqsqlite.dylib imageformats/libqtga.dylib iconengines/libqsvgicon.dylib"
OSG_EXTRA="libosgViewer.90.dylib"
echo "Qt library directory is \"${QT_DIR}\""
echo "Running macdeployqt"
macdeployqt "${APP}"
echo "Processing Qt libraries in $1"
for f in "${PLUGINS}/"*.dylib "${OP_PLUGINS}/"*.dylib
do
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} \
"${f}"
done
done
echo "Copying other libraries that were missed"
# should be redundant but some libs missed by main app and macdeployqt
for f in ${QT_LIBS}
do
echo "Copying ${f}"
cp -r "${QT_DIR}/${f}.framework" "${APP}/Contents/Frameworks/"
echo "Changing package identification of ${f}"
install_name_tool -id \
@executable_path/../Frameworks/${f}.framework/Versions/4/${f} \
"${APP}/Contents/Frameworks/${f}.framework/Versions/4/${f}"
rm "${APP}/Contents/Frameworks/${f}.framework/${f}"
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/Frameworks/${f}.framework/Versions/4/${f}"
done
done
for f in ${QT_EXTRA}
do
echo "Copying package ${f}"
cp "${QT_DIR}/../plugins/${f}" "${APP}/Contents/Plugins/${f}"
echo "Changing package identification of ${f}"
install_name_tool -id \
@executable_path/../Plugins/${f} \
"${PLUGINS}/${f}"
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
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/SDL \
"${APP}/Contents/Frameworks/SDL.framework/SDL"
install_name_tool -change \
@rpath/SDL.framework/Versions/A/SDL \
"@executable_path/../Frameworks/SDL.framework/SDL" \
"${APP}/Contents/Plugins/libsdlgamepad.1.dylib"
# deleting unnecessary files
echo "Copying OSG libraries"
for f in ${OSG_EXTRA}
do
echo "Copying library ${f}
cp /usr/local/lib/{$f} "${APP}/Contents/Plugins/${f}"
echo "Changing package identification of ${f}
install_name_tool -id \
@executable_path/../Frameworks/SDL.framework/Versions/A/SDL \
"${APP}/Contents/Frameworks/SDL.framework/Versions/A/SDL"
done
echo "Deleting unnecessary files"
find "${APP}/Contents/Frameworks" -iname "current" -exec rm -rf \{\} \;
find "${APP}/Contents/Frameworks" -iname "4.0" -exec rm -rf \{\} \;
find "${APP}/Contents/Frameworks" -iname "*_debug" -exec rm -rf \{\} \;