mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-12-01 09:24:10 +01:00
Merge remote-tracking branch 'origin/osx_distributable'
This commit is contained in:
commit
4ffc2a24a9
@ -2,9 +2,19 @@
|
||||
# MacOSX-specific packaging
|
||||
#
|
||||
|
||||
package: gcs release_flight
|
||||
( \
|
||||
ROOT_DIR="$(ROOT_DIR)" \
|
||||
BUILD_DIR="$(BUILD_DIR)" \
|
||||
RELEASE_LBL="$(RELEASE_LBL)" \
|
||||
RELEASE_DIR="$(RELEASE_DIR)" \
|
||||
FW_DIR="$(FW_DIR)" \
|
||||
"$(ROOT_DIR)/release/osx/package" \
|
||||
)
|
||||
|
||||
gcs: uavobjects
|
||||
$(V1) $(MAKE) -C $(ROOT_DIR) GCS_BUILD_CONF=release $@
|
||||
|
||||
ground_package: | gcs
|
||||
ground_package: | package
|
||||
|
||||
.PHONY: gcs ground_package
|
||||
.PHONY: gcs ground_package package
|
||||
|
BIN
release/osx/OpenPilot.dmg
Normal file
BIN
release/osx/OpenPilot.dmg
Normal file
Binary file not shown.
47
release/osx/libraries
Executable file
47
release/osx/libraries
Executable file
@ -0,0 +1,47 @@
|
||||
#!/bin/bash
|
||||
|
||||
APP="${1?}"
|
||||
PLUGINS="${APP}/Contents/PlugIns"
|
||||
OP_PLUGINS="${APP}/Contents/PlugIns/OpenPilot"
|
||||
QT_LIBS="QtGui QtCore QtSvg QtSql QtOpenGL QtNetwork QtXml QtDBus QtScript phonon"
|
||||
|
||||
echo "Processing Qt libraries in $1"
|
||||
macdeployqt "${APP}"
|
||||
|
||||
for f in "${PLUGINS}/"*.dylib "${OP_PLUGINS}/"*.dylib
|
||||
do
|
||||
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
|
||||
done
|
||||
|
||||
# should be redundant but some libs missed by main app and macdeployqt
|
||||
for f in ${QT_LIBS} SDL
|
||||
do
|
||||
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
|
||||
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 \{\} \;
|
||||
find "${APP}/Contents/Frameworks" -iname "*_debug*" -exec rm -rf \{\} \;
|
32
release/osx/package
Executable file
32
release/osx/package
Executable file
@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
|
||||
# the following environment variables must be set
|
||||
: ${ROOT_DIR?} ${BUILD_DIR?} ${RELEASE_LBL?} ${RELEASE_DIR?} ${FW_DIR?}
|
||||
|
||||
# more variables
|
||||
APP_PATH="${BUILD_DIR}/ground/openpilotgcs/bin/OpenPilot GCS.app"
|
||||
TEMP_FILE="${RELEASE_DIR}/OpenPilot-temp.dmg"
|
||||
OUT_FILE="${RELEASE_DIR}/OpenPilot-${RELEASE_LBL}.dmg"
|
||||
VOL_NAME="OpenPilot"
|
||||
|
||||
# prepare the stage
|
||||
rm -f "${TEMP_FILE}"
|
||||
rm -f "${OUT_FILE}"
|
||||
|
||||
hdiutil convert "${ROOT_DIR}/release/osx/OpenPilot.dmg" \
|
||||
-format UDRW -o "${TEMP_FILE}"
|
||||
device=$(hdiutil attach "${TEMP_FILE}" | \
|
||||
egrep '^/dev/' | sed 1q | awk '{print $1}')
|
||||
|
||||
# packaging goes here
|
||||
cp -r "${APP_PATH}" "/Volumes/${VOL_NAME}"
|
||||
cp -r "${FW_DIR}" "/Volumes/${VOL_NAME}/firmware"
|
||||
|
||||
"${ROOT_DIR}/release/osx/libraries" \
|
||||
"/Volumes/${VOL_NAME}/OpenPilot GCS.app" || exit 1
|
||||
|
||||
hdiutil detach ${device}
|
||||
hdiutil convert "${TEMP_FILE}" -format UDZO -o "${OUT_FILE}"
|
||||
|
||||
# cleanup
|
||||
rm "${TEMP_FILE}"
|
Loading…
Reference in New Issue
Block a user