From 6379a7d93778ebe8ebb006694e1ebcbd79f94fda Mon Sep 17 00:00:00 2001 From: Mikael Blomqvist Date: Thu, 9 Jan 2014 15:57:12 +0100 Subject: [PATCH 01/12] deb package now bundles qt5 libs and goodies --- ground/openpilotgcs/copydata.pro | 118 ++++++++++++++++++ ground/openpilotgcs/openpilotgcs.pri | 3 + .../openpilotgcs/src/openpilotgcsplugin.pri | 4 +- ground/openpilotgcs/src/rpath.pri | 3 +- package/linux/deb_common/openpilot.substvars | 2 +- package/linux/deb_common/rules | 7 +- package/linux/qt.conf | 6 + 7 files changed, 136 insertions(+), 7 deletions(-) create mode 100644 package/linux/qt.conf diff --git a/ground/openpilotgcs/copydata.pro b/ground/openpilotgcs/copydata.pro index a0f25f204..bccbd576b 100644 --- a/ground/openpilotgcs/copydata.pro +++ b/ground/openpilotgcs/copydata.pro @@ -5,6 +5,124 @@ TEMPLATE = subdirs # Copy Qt runtime libraries into the build directory (to run or package) equals(copydata, 1) { +GCS_LIBRARY_PATH + + linux-* { + + QT_LIBS = libQt5Core.so.5 \ + libQt5Gui.so.5 \ + libQt5Widgets.so.5 \ + libQt5Network.so.5 \ + libQt5OpenGL.so.5 \ + libQt5Sql.so.5 \ + libQt5Svg.so.5 \ + libQt5Test.so.5 \ + libQt5Xml.so.5 \ + libQt5Declarative.so.5 \ + libQt5XmlPatterns.so.5 \ + libQt5Script.so.5 \ + libQt5Concurrent.so.5 \ + libQt5PrintSupport.so.5 \ + libQt5SerialPort.so.5 \ + libQt5Multimedia.so.5 \ + libQt5MultimediaWidgets.so.5 \ + libQt5Quick.so.5 \ + libQt5Qml.so.5 \ + libQt5V8.so.5 \ + libQt5DBus.so.5 \ + libQt5QuickParticles.so.5 \ + libicui18n.so.51 \ + libicuuc.so.51 \ + libicudata.so.51 + + data_copy.commands += -@$(MKDIR) $$targetPath(\"$$GCS_QT_LIBRARY_PATH\") $$addNewline() + for(lib, QT_LIBS) { + data_copy.commands += $(COPY_FILE) $$targetPath(\"$$[QT_INSTALL_LIBS]/$$lib\") $$targetPath(\"$$GCS_QT_LIBRARY_PATH/$$lib\") $$addNewline() + } + + # create Qt plugin directories + QT_PLUGIN_DIRS = iconengines \ + imageformats \ + platforms \ + mediaservice \ + sqldrivers + for(dir, QT_PLUGIN_DIRS) { + data_copy.commands += -@$(MKDIR) $$targetPath(\"$$GCS_QT_PLUGINS_PATH/$$dir\") $$addNewline() + } + QT_PLUGIN_LIBS = iconengines/libqsvgicon.so \ + imageformats/libqgif.so \ + imageformats/libqico.so \ + imageformats/libqjpeg.so \ + imageformats/libqmng.so \ + imageformats/libqsvg.so \ + imageformats/libqtiff.so \ + platforms/libqxcb.so \ + sqldrivers/libqsqlite.so + for(lib, QT_PLUGIN_LIBS) { + data_copy.commands += $(COPY_FILE) $$targetPath(\"$$[QT_INSTALL_PLUGINS]/$$lib\") $$targetPath(\"$$GCS_QT_PLUGINS_PATH/$$lib\") $$addNewline() + } + + # create QtQuick2 plugin directories + QT_QUICK2_DIRS = QtQuick \ + QtQuick.2 \ + QtQuick/Layouts \ + QtQuick/LocalStorage \ + QtQuick/Particles.2 \ + QtQuick/PrivateWidgets \ + QtQuick/Window.2 \ + QtQuick/XmlListModel + for(dir, QT_QUICK2_DIRS) { + data_copy.commands += -@$(MKDIR) $$targetPath(\"$$GCS_QT_QML_PATH/$$dir\") $$addNewline() + } + + # Copy QtQuick2 complete directories + # These directories have a lot of files + # Easier to copy everything + QTQ_WHOLE_DIRS = QtQuick/Controls \ + QtQuick/Dialogs + for(dir, QTQ_WHOLE_DIRS) { + data_copy.commands += $(COPY_DIR) $$targetPath(\"$$[QT_INSTALL_QML]/$$dir\") $$targetPath(\"$$GCS_QT_QML_PATH/$$dir\") $$addNewline() + } + + # Remove the few unwanted libs after whole dir copy + QT_QUICK2_DELS = QtQuick/Controls/libqtquickcontrolsplugin.so \ + QtQuick/Controls/Private/libqtquickcontrolsprivateplugin.so \ + QtQuick/Dialogs/libdialogplugin.so + + for(delfile, QT_QUICK2_DELS) { + data_copy.commands += $(DEL_FILE) $$targetPath(\"$$GCS_QT_QML_PATH/$${delfile}\") $$addNewline() + } + + # Remaining QtQuick plugin libs + QT_QUICK2_DLLS = QtQuick.2/libqtquick2plugin.so \ + QtQuick.2/plugins.qmltypes \ + QtQuick.2/qmldir \ + QtQuick/Layouts/libqquicklayoutsplugin.so \ + QtQuick/Layouts/plugins.qmltypes \ + QtQuick/Layouts/qmldir \ + QtQuick/LocalStorage/libqmllocalstorageplugin.so \ + QtQuick/LocalStorage/plugins.qmltypes \ + QtQuick/LocalStorage/qmldir \ + QtQuick/Particles.2/libparticlesplugin.so \ + QtQuick/Particles.2/plugins.qmltypes \ + QtQuick/Particles.2/qmldir \ + QtQuick/PrivateWidgets/libwidgetsplugin.so \ + QtQuick/PrivateWidgets/plugins.qmltypes \ + QtQuick/PrivateWidgets/qmldir \ + QtQuick/Window.2/libwindowplugin.so \ + QtQuick/Window.2/plugins.qmltypes \ + QtQuick/Window.2/qmldir \ + QtQuick/XmlListModel/libqmlxmllistmodelplugin.so \ + QtQuick/XmlListModel/plugins.qmltypes \ + QtQuick/XmlListModel/qmldir + + for(lib, QT_QUICK2_DLLS) { + data_copy.commands += $(COPY_FILE) $$targetPath(\"$$[QT_INSTALL_QML]/$$lib\") $$targetPath(\"$$GCS_QT_QML_PATH/$$lib\") $$addNewline() + } + + data_copy.target = FORCE + QMAKE_EXTRA_TARGETS += data_copy + } # Windows release only, no debug target DLLs ending with 'd' # It is assumed that SDL.dll can be found in the same directory as mingw32-make.exe win32 { diff --git a/ground/openpilotgcs/openpilotgcs.pri b/ground/openpilotgcs/openpilotgcs.pri index cf984a611..aed8044f9 100644 --- a/ground/openpilotgcs/openpilotgcs.pri +++ b/ground/openpilotgcs/openpilotgcs.pri @@ -89,6 +89,9 @@ macx { } else { GCS_APP_WRAPPER = openpilotgcs GCS_APP_TARGET = openpilotgcs.bin + GCS_QT_LIBRARY_PATH = $$GCS_BUILD_TREE/$$GCS_LIBRARY_BASENAME/qt5 + GCS_QT_PLUGINS_PATH = $$GCS_BUILD_TREE/$$GCS_LIBRARY_BASENAME/qt5/plugins + GCS_QT_QML_PATH = $$GCS_BUILD_TREE/$$GCS_LIBRARY_BASENAME/qt5/qml } GCS_LIBRARY_PATH = $$GCS_BUILD_TREE/$$GCS_LIBRARY_BASENAME/openpilotgcs GCS_PLUGIN_PATH = $$GCS_LIBRARY_PATH/plugins diff --git a/ground/openpilotgcs/src/openpilotgcsplugin.pri b/ground/openpilotgcs/src/openpilotgcsplugin.pri index 6fee35d8e..9276f1832 100644 --- a/ground/openpilotgcs/src/openpilotgcsplugin.pri +++ b/ground/openpilotgcs/src/openpilotgcsplugin.pri @@ -31,7 +31,7 @@ macx { QMAKE_LFLAGS_SONAME = -Wl,-install_name,@executable_path/../Plugins/$${PROVIDER}/ } else:linux-* { #do the rpath by hand since it's not possible to use ORIGIN in QMAKE_RPATHDIR - QMAKE_RPATHDIR += \$\$ORIGIN + QMAKE_RPATHDIR = \$\$ORIGIN QMAKE_RPATHDIR += \$\$ORIGIN/.. QMAKE_RPATHDIR += \$\$ORIGIN/../.. GCS_PLUGIN_RPATH = $$join(QMAKE_RPATHDIR, ":") @@ -45,7 +45,7 @@ contains(QT_CONFIG, reduce_exports):CONFIG += hGCS_symbols CONFIG += plugin plugin_with_soname !macx { - target.path = /$$GCS_LIBRARY_BASENAME/opnepilotgcs/plugins/$$PROVIDER + target.path = /$$GCS_LIBRARY_BASENAME/openpilotgcs/plugins/$$PROVIDER pluginspec.files += $${TARGET}.pluginspec pluginspec.path = /$$GCS_LIBRARY_BASENAME/openpilotgcs/plugins/$$PROVIDER INSTALLS += target pluginspec diff --git a/ground/openpilotgcs/src/rpath.pri b/ground/openpilotgcs/src/rpath.pri index f6cb4d196..6d000262f 100644 --- a/ground/openpilotgcs/src/rpath.pri +++ b/ground/openpilotgcs/src/rpath.pri @@ -3,7 +3,8 @@ macx { } else:linux-* { #do the rpath by hand since it's not possible to use ORIGIN in QMAKE_RPATHDIR # this expands to $ORIGIN (after qmake and make), it does NOT read a qmake var - QMAKE_RPATHDIR += \$\$ORIGIN/../$$GCS_LIBRARY_BASENAME/openpilotgcs + QMAKE_RPATHDIR = \$\$ORIGIN/../$$GCS_LIBRARY_BASENAME/openpilotgcs + QMAKE_RPATHDIR += \$\$ORIGIN/../$$GCS_LIBRARY_BASENAME/qt5 GCS_PLUGIN_RPATH = $$join(QMAKE_RPATHDIR, ":") QMAKE_LFLAGS += -Wl,-z,origin \'-Wl,-rpath,$${GCS_PLUGIN_RPATH}\' diff --git a/package/linux/deb_common/openpilot.substvars b/package/linux/deb_common/openpilot.substvars index 39006599c..ed7070fc2 100644 --- a/package/linux/deb_common/openpilot.substvars +++ b/package/linux/deb_common/openpilot.substvars @@ -1,2 +1,2 @@ -shlibs:Depends=libc6 (>= 2.3.6-6~), libc6 (>= 2.4), libgcc1 (>= 1:4.1.1), libgl1-mesa-glx | libgl1, libglu1-mesa | libglu1, libphonon4 (>= 4:4.3.0), libqt4-network (>= 4:4.6.1), libqt4-opengl (>= 4:4.6.1), libqt4-script (>= 4:4.5.3), libqt4-sql (>= 4:4.5.3), libqt4-svg (>= 4:4.5.3), libqt4-test (>= 4:4.5.3), libqt4-xml (>= 4:4.5.3), libqtcore4 (>= 4:4.7.0~beta1), libqtgui4 (>= 4:4.6.2), libsdl1.2debian (>= 1.2.10-1), libstdc++6 (>= 4.1.1), libudev0 (>= 147), libusb-0.1-4 (>= 2:0.1.12), phonon +shlibs:Depends=libc6 (>= 2.3.6-6~), libc6 (>= 2.4), libgcc1 (>= 1:4.1.1), libgl1-mesa-glx | libgl1, libglu1-mesa | libglu1, libphonon4 (>= 4:4.3.0), libsdl1.2debian (>= 1.2.10-1), libstdc++6 (>= 4.1.1), libudev0 | libudev1, libusb-0.1-4 (>= 2:0.1.12), phonon misc:Depends= diff --git a/package/linux/deb_common/rules b/package/linux/deb_common/rules index 9bf1a3e68..6af5f63c5 100644 --- a/package/linux/deb_common/rules +++ b/package/linux/deb_common/rules @@ -25,7 +25,7 @@ clean: dh_testdir dh_testroot dh_clean - + install: dh_testdir dh_testroot @@ -37,6 +37,7 @@ install: cp -arp build/openpilotgcs_release/lib debian/openpilot/usr/local/OpenPilot cp -arp build/openpilotgcs_release/share debian/openpilot/usr/local/OpenPilot cp -arp build/openpilotgcs_release/.obj debian/openpilot/usr/local/OpenPilot + cp -arp package/linux/qt.conf debian/openpilot/usr/local/OpenPilot/bin cp -arp package/linux/openpilot.desktop debian/openpilot/usr/share/applications cp -arp package/linux/openpilot.png debian/openpilot/usr/share/pixmaps cp -arp package/linux/openpilot_menu.png debian/openpilot/usr/share/pixmaps @@ -73,10 +74,10 @@ binary-arch: install dh_compress dh_fixperms dh_installdeb - dh_shlibdeps -l/usr/local/OpenPilot/lib/openpilotgcs --dpkg-shlibdeps-params="--ignore-missing-info -v" + dh_shlibdeps -l/usr/local/OpenPilot/lib/openpilotgcs -l/usr/local/OpenPilot/lib/qt5 --dpkg-shlibdeps-params="--ignore-missing-info -v" dh_gencontrol dh_md5sums - dh_builddeb + dh_builddeb -- -Zbzip2 binary: binary-indep binary-arch diff --git a/package/linux/qt.conf b/package/linux/qt.conf new file mode 100644 index 000000000..b8dd60015 --- /dev/null +++ b/package/linux/qt.conf @@ -0,0 +1,6 @@ +[Paths] +Prefix = .. +Plugins = lib/qt5/plugins +Imports = lib/qt5/qml +Qml2Imports = lib/qt5/qml +Libraries = lib/qt5 From f5a7345d75fc8bc7def76323ba8caa98fd1973d0 Mon Sep 17 00:00:00 2001 From: a*morale Date: Thu, 9 Jan 2014 20:05:14 +0100 Subject: [PATCH 02/12] OP-1155 OSX Package: check for existing /Volumes/OpenPilot and try to unmount first. retrieve actual volume name with hdiutil --- package/osx/package | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/package/osx/package b/package/osx/package index 276e74f84..bff3c4b6c 100755 --- a/package/osx/package +++ b/package/osx/package @@ -14,8 +14,9 @@ rm -f "${TEMP_FILE}" rm -f "${OUT_FILE}" # if an OpenPilot volume is already mounted, unmount it -if [ ! -f "/Volumes/${VOL_NAME}" ] +if [ -f "/Volumes/${VOL_NAME}" ] then +echo "Unmount existing /Volumes/${VOL_NAME}" hdiutil unmount "/Volumes/${VOL_NAME}" fi @@ -24,18 +25,30 @@ hdiutil convert "${ROOT_DIR}/package/osx/OpenPilot.dmg" \ device=$(hdiutil attach "${TEMP_FILE}" | \ egrep '^/dev/' | sed 1q | awk '{print $1}') +#Just in case something is still mounted as ${VOL_NAME}, check the correct mount point +mountvolume=$(hdiutil info | egrep "^${device}"| egrep "${VOL_NAME}" | sed 's/.*Volumes\///;s/*//' | sed 1q) + +echo "Image mounted as /Volumes/${mountvolume}" + +if [ ! -d "/Volumes/${mountvolume}/OpenPilot GCS.app" ] +then + echo "Cannot find a valid image at /Volumes/${mountvolume}" + exit 1 +fi + # packaging goes here -cp -a "${APP_PATH}" "/Volumes/${VOL_NAME}" +cp -a "${APP_PATH}" "/Volumes/${mountvolume}" + #ls "${FW_DIR}" | xargs -n 1 -I {} cp "${FW_DIR}/{}" "/Volumes/${VOL_NAME}/Firmware" -cp "${BUILD_DIR}/uavobject-synthetics/matlab/OPLogConvert.m" "/Volumes/${VOL_NAME}/Utilities" -cp "${ROOT_DIR}/WHATSNEW.txt" "/Volumes/${VOL_NAME}" -cp "${ROOT_DIR}/README.txt" "/Volumes/${VOL_NAME}/Docs" -cp "${ROOT_DIR}/MILESTONES.txt" "/Volumes/${VOL_NAME}/Docs" -cp "${ROOT_DIR}/LICENSE.txt" "/Volumes/${VOL_NAME}/Docs" -cp "${ROOT_DIR}/GPLv3.txt" "/Volumes/${VOL_NAME}/Docs" +cp "${BUILD_DIR}/uavobject-synthetics/matlab/OPLogConvert.m" "/Volumes/${mountvolume}/Utilities" +cp "${ROOT_DIR}/WHATSNEW.txt" "/Volumes/${mountvolume}" +cp "${ROOT_DIR}/README.txt" "/Volumes/${mountvolume}/Docs" +cp "${ROOT_DIR}/MILESTONES.txt" "/Volumes/${mountvolume}/Docs" +cp "${ROOT_DIR}/LICENSE.txt" "/Volumes/${mountvolume}/Docs" +cp "${ROOT_DIR}/GPLv3.txt" "/Volumes/${mountvolume}/Docs" "${ROOT_DIR}/package/osx/libraries" \ - "/Volumes/${VOL_NAME}/OpenPilot GCS.app" || exit 1 + "/Volumes/${mountvolume}/OpenPilot GCS.app" || exit 1 hdiutil detach ${device} From 444744c3dab26b9d29fcd4a8662439b9bead2a1b Mon Sep 17 00:00:00 2001 From: a*morale Date: Thu, 9 Jan 2014 20:12:45 +0100 Subject: [PATCH 03/12] OP-1155 OSX Package: chmod SDL and sdlgamepad before running install_name_tool --- package/osx/libraries | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/package/osx/libraries b/package/osx/libraries index 5c091c485..f16fd923e 100755 --- a/package/osx/libraries +++ b/package/osx/libraries @@ -41,6 +41,8 @@ done echo "Copying SDL" cp -a "/Library/Frameworks/SDL.framework" "${APP}/Contents/Frameworks/" +chmod +w "${APP}/Contents/Plugins/libsdlgamepad.1.dylib" +chmod +w "${APP}/Contents/Frameworks/SDL.framework/SDL" echo "Changing package identification of SDL" install_name_tool -id \ @@ -50,6 +52,8 @@ install_name_tool -change \ @rpath/SDL.framework/Versions/A/SDL \ "@executable_path/../Frameworks/SDL.framework/SDL" \ "${APP}/Contents/Plugins/libsdlgamepad.1.dylib" +chmod -w "${APP}/Contents/Plugins/libsdlgamepad.1.dylib" +chmod -w "${APP}/Contents/Frameworks/SDL.framework/SDL" # deleting unnecessary files echo "Deleting unnecessary files" From 21956e75961f76fe4f13012e5f398c2fc9a5f62a Mon Sep 17 00:00:00 2001 From: a*morale Date: Thu, 9 Jan 2014 20:13:52 +0100 Subject: [PATCH 04/12] OP-1155 OSX Package: Update Qt libraries list --- package/osx/libraries | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/osx/libraries b/package/osx/libraries index f16fd923e..90d665ef4 100755 --- a/package/osx/libraries +++ b/package/osx/libraries @@ -3,7 +3,7 @@ APP="${1?}" PLUGINS="${APP}/Contents/Plugins" OP_PLUGINS="${APP}/Contents/Plugins/OpenPilot" -QT_LIBS="QtDeclarative QtXmlPatterns QtGui QtTest QtCore QtSvg QtSql QtOpenGL QtNetwork QtXml QtScript" +QT_LIBS="QtCore QtGui QtMultimedia QtMultimediaWidgets QtNetwork QtOpenGL QtPrintSupport QtQml QtQuick QtScript QtSerialPort QtSql QtSvg QtWidgets QtV8 QtXml" 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 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" From 311e948da31773c31eda2a45f307817a90ddd83e Mon Sep 17 00:00:00 2001 From: a*morale Date: Thu, 9 Jan 2014 21:45:16 +0100 Subject: [PATCH 05/12] OP-1155 OSX Package: Fix macdeployqt search path issue. Use QT_DIR to find it --- package/osx/libraries | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/osx/libraries b/package/osx/libraries index 90d665ef4..efd16eda5 100755 --- a/package/osx/libraries +++ b/package/osx/libraries @@ -23,9 +23,9 @@ fi echo "Qt library directory is \"${QT_DIR}\"" -echo "Running macdeployqt" -macdeployqt "${APP}" -no-strip +echo "Running macdeployqt from ${QT_DIR}../bin/macdeployqt" +"${QT_DIR}../bin/macdeployqt" "${APP}" -no-strip echo "Processing Qt libraries in ${APP}" for f in "${PLUGINS}/"*.dylib "${OP_PLUGINS}/"*.dylib do From 771037eeacaa86bb094e0871bdccb4e1d0f18718 Mon Sep 17 00:00:00 2001 From: a*morale Date: Thu, 9 Jan 2014 21:46:50 +0100 Subject: [PATCH 06/12] OP-1155 OSX Package: chmod +/-w before/after running install_name_tool --- package/osx/libraries | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/package/osx/libraries b/package/osx/libraries index efd16eda5..d22b1a8af 100755 --- a/package/osx/libraries +++ b/package/osx/libraries @@ -26,16 +26,19 @@ echo "Qt library directory is \"${QT_DIR}\"" echo "Running macdeployqt from ${QT_DIR}../bin/macdeployqt" "${QT_DIR}../bin/macdeployqt" "${APP}" -no-strip -echo "Processing Qt libraries in ${APP}" + +echo "Processing Qt libraries paths in ${APP}" for f in "${PLUGINS}/"*.dylib "${OP_PLUGINS}/"*.dylib do # Only process plain files - [ ! -L "${f}" ] && for g in $QT_LIBS + [ ! -L "${f}" ] && echo "* ${f}" && for g in $QT_LIBS do + chmod +w "${f}" install_name_tool -change \ "${QT_DIR}${g}.framework/Versions/5/${g}" \ @executable_path/../Frameworks/${g}.framework/Versions/5/${g} \ "${f}" + chmod -w "${f}" done done @@ -43,7 +46,6 @@ echo "Copying SDL" cp -a "/Library/Frameworks/SDL.framework" "${APP}/Contents/Frameworks/" chmod +w "${APP}/Contents/Plugins/libsdlgamepad.1.dylib" chmod +w "${APP}/Contents/Frameworks/SDL.framework/SDL" - echo "Changing package identification of SDL" install_name_tool -id \ @executable_path/../Frameworks/SDL.framework/SDL \ From bab382a3df32fb422b54d900b7f5990845dd41cd Mon Sep 17 00:00:00 2001 From: a*morale Date: Fri, 10 Jan 2014 00:44:12 +0100 Subject: [PATCH 07/12] OP-1155 OSX Package: Set QMAKE_MACOSX_DEPLOYMENT_TARGET --- ground/openpilotgcs/openpilotgcs.pro | 1 + 1 file changed, 1 insertion(+) diff --git a/ground/openpilotgcs/openpilotgcs.pro b/ground/openpilotgcs/openpilotgcs.pro index 6705d5afd..54f62cc47 100644 --- a/ground/openpilotgcs/openpilotgcs.pro +++ b/ground/openpilotgcs/openpilotgcs.pro @@ -21,6 +21,7 @@ macx { QMAKE_CC = /usr/bin/gcc QMAKE_CXX = /usr/bin/g++ QMAKE_LINK = /usr/bin/g++ + QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.6 } include(openpilotgcs.pri) From 6231b6f85d1758e350943c1b8a22c929d37456c1 Mon Sep 17 00:00:00 2001 From: a*morale Date: Fri, 10 Jan 2014 01:04:44 +0100 Subject: [PATCH 08/12] OP-1155 OSX Package: Provision for running install_name_tool on QTQuick plugins dylib. --- package/osx/libraries | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/package/osx/libraries b/package/osx/libraries index d22b1a8af..bd968814f 100755 --- a/package/osx/libraries +++ b/package/osx/libraries @@ -25,21 +25,25 @@ echo "Qt library directory is \"${QT_DIR}\"" echo "Running macdeployqt from ${QT_DIR}../bin/macdeployqt" -"${QT_DIR}../bin/macdeployqt" "${APP}" -no-strip +"${QT_DIR}../bin/macdeployqt" "${APP}" -no-strip -verbose=2 echo "Processing Qt libraries paths in ${APP}" -for f in "${PLUGINS}/"*.dylib "${OP_PLUGINS}/"*.dylib +for f in "${PLUGINS}/"*.dylib "${OP_PLUGINS}/"*.dylib "${APP}/"Contents/MacOS/QtQuick.2/*.dylib "${APP}/"Contents/MacOS/QtQuick/*/*.dylib do - # Only process plain files - [ ! -L "${f}" ] && echo "* ${f}" && for g in $QT_LIBS - do + if [ -f "${f}" ] && [ ! -L "${f}" ] + then + # Only process plain files chmod +w "${f}" - install_name_tool -change \ - "${QT_DIR}${g}.framework/Versions/5/${g}" \ - @executable_path/../Frameworks/${g}.framework/Versions/5/${g} \ - "${f}" + echo "* ${f}" + for g in $QT_LIBS + do + install_name_tool -change \ + "${QT_DIR}${g}.framework/Versions/5/${g}" \ + @executable_path/../Frameworks/${g}.framework/Versions/5/${g} \ + "${f}" + done chmod -w "${f}" - done + fi done echo "Copying SDL" From 63127011bd1c91e429279fabf1e5fcbb969a6919 Mon Sep 17 00:00:00 2001 From: Mikael Blomqvist Date: Fri, 10 Jan 2014 09:32:04 +0100 Subject: [PATCH 09/12] Removing leaked Makefiles from the deb package --- package/linux/deb_common/rules | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package/linux/deb_common/rules b/package/linux/deb_common/rules index 6af5f63c5..842deee18 100644 --- a/package/linux/deb_common/rules +++ b/package/linux/deb_common/rules @@ -55,7 +55,8 @@ endif rm -rf debian/openpilot/usr/local/OpenPilot/share/openpilotgcs/mapicons/mapicons rm -rf debian/openpilot/usr/local/OpenPilot/share/openpilotgcs/dials/dials rm -rf debian/openpilot/usr/local/OpenPilot/share/openpilotgcs/diagrams/diagrams - +# Removing leaked files from the dist + find debian/openpilot -name Makefile -exec rm -f {} \; # Build architecture-independent files here. binary-indep: install From 4738e4eafc3651f59b9542766d5a41ac427897c4 Mon Sep 17 00:00:00 2001 From: a*morale Date: Fri, 10 Jan 2014 23:25:35 +0100 Subject: [PATCH 10/12] OP-1155 OSX Package: Add QtQuick plugin deployment to copydata.pro --- ground/openpilotgcs/copydata.pro | 26 ++++++++++++++++++++++++++ ground/openpilotgcs/openpilotgcs.pri | 1 + 2 files changed, 27 insertions(+) diff --git a/ground/openpilotgcs/copydata.pro b/ground/openpilotgcs/copydata.pro index bccbd576b..a7e086f7d 100644 --- a/ground/openpilotgcs/copydata.pro +++ b/ground/openpilotgcs/copydata.pro @@ -271,4 +271,30 @@ GCS_LIBRARY_PATH QMAKE_EXTRA_TARGETS += data_copy } + + macx{ + #NOTE: debug dylib can be copied as they will be cleaned out with packaging scripts + #standard plugins directory (will copy just dylib, plugins.qmltypes and qmldir + QT_QUICK2_PLUGINS = QtQuick.2 QtQuick/Layouts QtQuick/LocalStorage QtQuick/Particles.2 QtQuick/PrivateWidgets QtQuick/Window.2 QtQuick/XmlListModel + #those directories will be fully copied to dest + QT_QUICK2_FULL_DIRS = QtQuick/Controls QtQuick/Dialogs + + #create QtQuick dir (that will host all subdirs) + data_copy.commands += -@$(MKDIR) $$targetPath(\"$$GCS_QT_QML_PATH/QtQuick\") $$addNewline() + + for(dir, QT_QUICK2_FULL_DIRS) { + #data_copy.commands += -@$(MKDIR) $$targetPath(\"$$GCS_QT_QML_PATH/$$dir\") $$addNewline() + data_copy.commands += $(COPY_DIR) $$targetPath(\"$$[QT_INSTALL_QML]/$$dir\") $$targetPath(\"$$GCS_QT_QML_PATH/$$dir\") $$addNewline() + } + + for(lib, QT_QUICK2_PLUGINS) { + data_copy.commands += $(MKDIR) $$targetPath(\"$$GCS_QT_QML_PATH/$$lib\") $$addNewline() + data_copy.commands += $(COPY_FILE) $$targetPath(\"$$[QT_INSTALL_QML]/$$lib/\"*.dylib) $$targetPath(\"$$GCS_QT_QML_PATH/$$lib/\") $$addNewline() + data_copy.commands += $(COPY_FILE) $$targetPath(\"$$[QT_INSTALL_QML]/$$lib/plugins.qmltypes\") $$targetPath(\"$$GCS_QT_QML_PATH/$$lib/plugins.qmltypes\") $$addNewline() + data_copy.commands += $(COPY_FILE) $$targetPath(\"$$[QT_INSTALL_QML]/$$lib/qmldir\") $$targetPath(\"$$GCS_QT_QML_PATH/$$lib/qmldir\") $$addNewline() + } + + data_copy.target = FORCE + QMAKE_EXTRA_TARGETS += data_copy + } } diff --git a/ground/openpilotgcs/openpilotgcs.pri b/ground/openpilotgcs/openpilotgcs.pri index aed8044f9..571dda15a 100644 --- a/ground/openpilotgcs/openpilotgcs.pri +++ b/ground/openpilotgcs/openpilotgcs.pri @@ -77,6 +77,7 @@ macx { GCS_APP_TARGET = "OpenPilot GCS" GCS_LIBRARY_PATH = $$GCS_APP_PATH/$${GCS_APP_TARGET}.app/Contents/Plugins GCS_PLUGIN_PATH = $$GCS_LIBRARY_PATH + GCS_QT_QML_PATH = $$GCS_APP_PATH/$${GCS_APP_TARGET}.app/Contents/Imports GCS_LIBEXEC_PATH = $$GCS_APP_PATH/$${GCS_APP_TARGET}.app/Contents/Resources GCS_DATA_PATH = $$GCS_APP_PATH/$${GCS_APP_TARGET}.app/Contents/Resources GCS_DATA_BASENAME = Resources From 589074cf2495667b37ba205b479490ee7ad31e0b Mon Sep 17 00:00:00 2001 From: a*morale Date: Fri, 10 Jan 2014 23:26:33 +0100 Subject: [PATCH 11/12] OP-1155 OSX Package: patch qt.conf adding Qml2Imports --- package/osx/libraries | 3 +++ 1 file changed, 3 insertions(+) diff --git a/package/osx/libraries b/package/osx/libraries index bd968814f..92a428660 100755 --- a/package/osx/libraries +++ b/package/osx/libraries @@ -27,6 +27,9 @@ echo "Running macdeployqt from ${QT_DIR}../bin/macdeployqt" "${QT_DIR}../bin/macdeployqt" "${APP}" -no-strip -verbose=2 +#Append Qml2Imports config to qt.conf +echo "Qml2Imports = Imports" >> "${APP}/"Contents/Resources/qt.conf + echo "Processing Qt libraries paths in ${APP}" for f in "${PLUGINS}/"*.dylib "${OP_PLUGINS}/"*.dylib "${APP}/"Contents/MacOS/QtQuick.2/*.dylib "${APP}/"Contents/MacOS/QtQuick/*/*.dylib do From 8a7dda78d5f01aeceaeeb976c316465e1f6dd317 Mon Sep 17 00:00:00 2001 From: a*morale Date: Fri, 10 Jan 2014 23:27:10 +0100 Subject: [PATCH 12/12] OP-1155 OSX Package: change QtQuick plugin path for install_name_tool processing --- package/osx/libraries | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/osx/libraries b/package/osx/libraries index 92a428660..537015884 100755 --- a/package/osx/libraries +++ b/package/osx/libraries @@ -31,7 +31,7 @@ echo "Running macdeployqt from ${QT_DIR}../bin/macdeployqt" echo "Qml2Imports = Imports" >> "${APP}/"Contents/Resources/qt.conf echo "Processing Qt libraries paths in ${APP}" -for f in "${PLUGINS}/"*.dylib "${OP_PLUGINS}/"*.dylib "${APP}/"Contents/MacOS/QtQuick.2/*.dylib "${APP}/"Contents/MacOS/QtQuick/*/*.dylib +for f in "${PLUGINS}/"*.dylib "${OP_PLUGINS}/"*.dylib "${APP}/"Contents/Imports/QtQuick.2/*.dylib "${APP}/"Contents/Imports/QtQuick/*/*.dylib do if [ -f "${f}" ] && [ ! -L "${f}" ] then