From aab353a0e032b196d3f55eb2299f7383f2c8e374 Mon Sep 17 00:00:00 2001 From: Stefan Dunca Date: Mon, 4 Mar 2019 09:08:40 +0100 Subject: [PATCH] Add support for AppImage customization Also copy all dependencies of ICU libs to cover all configurations --- QGCSetup.pri | 7 +++--- deploy/create_linux_appimage.sh | 39 +++++++++++++++++++-------------- 2 files changed, 27 insertions(+), 19 deletions(-) diff --git a/QGCSetup.pri b/QGCSetup.pri index efbbee3e4..84cc7f1f8 100644 --- a/QGCSetup.pri +++ b/QGCSetup.pri @@ -132,13 +132,14 @@ LinuxBuild { libQt5Widgets.so.5 \ libQt5XcbQpa.so.5 \ libQt5Xml.so.5 \ - libicui18n.so \ + libicui18n.so* \ libQt5TextToSpeech.so.5 !contains(DEFINES, __rasp_pi2__) { + # Some Qt distributions link with *.so.56 QT_LIB_LIST += \ - libicudata.so \ - libicuuc.so + libicudata.so* \ + libicuuc.so* } for(QT_LIB, QT_LIB_LIST) { diff --git a/deploy/create_linux_appimage.sh b/deploy/create_linux_appimage.sh index 24bb69456..004dc1dd6 100755 --- a/deploy/create_linux_appimage.sh +++ b/deploy/create_linux_appimage.sh @@ -3,30 +3,37 @@ #set +e if [[ $# -eq 0 ]]; then - echo 'create_linux_appimage.sh QGC_SRC_DIR QGC_RELEASE_DIR' - exit 1 + echo 'create_linux_appimage.sh QGC_SRC_DIR QGC_RELEASE_DIR' + exit 1 fi +QGC_CUSTOM_APP_NAME="${QGC_CUSTOM_APP_NAME:-QGroundControl}" +QGC_CUSTOM_GENERIC_NAME="${QGC_CUSTOM_GENERIC_NAME:-Ground Control Station}" +QGC_CUSTOM_BINARY_NAME="${QGC_CUSTOM_BINARY_NAME:-QGroundControl}" +QGC_CUSTOM_LINUX_START_SH="${QGC_CUSTOM_LINUX_START_SH:-${QGC_SRC}/deploy/qgroundcontrol-start.sh}" +QGC_CUSTOM_APP_ICON="${QGC_CUSTOM_APP_ICON:-${QGC_SRC}/resources/icons/qgroundcontrol.png}" +QGC_CUSTOM_APP_ICON_NAME="${QGC_CUSTOM_APP_ICON_NAME:-QGroundControl}" + QGC_SRC=$1 if [ ! -f ${QGC_SRC}/qgroundcontrol.pro ]; then - echo 'please specify path to qgroundcontrol source as the 1st argument' - exit 1 + echo "please specify path to $(QGC_CUSTOM_APP_NAME) source as the 1st argument" + exit 1 fi QGC_RELEASE_DIR=$2 -if [ ! -f ${QGC_RELEASE_DIR}/QGroundControl ]; then - echo 'please specify path to QGroundControl release as the 2nd argument' - exit 1 +if [ ! -f ${QGC_RELEASE_DIR}/${QGC_CUSTOM_BINARY_NAME} ]; then + echo "please specify path to ${QGC_CUSTOM_BINARY_NAME} release as the 2nd argument" + exit 1 fi OUTPUT_DIR=${3-`pwd`} echo "Output directory:" ${OUTPUT_DIR} # Generate AppImage using the binaries currently provided by the project. -# These require at least GLIBC 2.14, which older distributions might not have. +# These require at least GLIBC 2.14, which older distributions might not have. # On the other hand, 2.14 is not that recent so maybe we can just live with it. -APP=QGroundControl +APP=${QGC_CUSTOM_BINARY_NAME} TMPDIR=`mktemp -d` APPDIR=${TMPDIR}/$APP".AppDir" @@ -58,26 +65,26 @@ cp -L libts/usr/lib/x86_64-linux-gnu/libts-0.0.so.0 ${APPDIR}/usr/lib/x86_64-lin # copy QGroundControl release into appimage rsync -av --exclude=*.cpp --exclude=*.h --exclude=*.o --exclude="CMake*" --exclude="*.cmake" ${QGC_RELEASE_DIR}/* ${APPDIR}/ rm -rf ${APPDIR}/package -cp ${QGC_SRC}/deploy/qgroundcontrol-start.sh ${APPDIR}/AppRun +cp ${QGC_CUSTOM_LINUX_START_SH} ${APPDIR}/AppRun # copy icon -cp ${QGC_SRC}/resources/icons/qgroundcontrol.png ${APPDIR}/ +cp ${QGC_CUSTOM_APP_ICON} ${APPDIR}/ cat > ./QGroundControl.desktop <<\EOF [Desktop Entry] Type=Application -Name=QGroundControl -GenericName=Ground Control Station +Name=${QGC_CUSTOM_APP_NAME} +GenericName=${QGC_CUSTOM_GENERIC_NAME} Comment=UAS ground control station -Icon=QGroundControl +Icon=${QGC_CUSTOM_APP_ICON_NAME} Exec=AppRun Terminal=false Categories=Utility; Keywords=computer; EOF -VERSION=$(strings ${APPDIR}/QGroundControl | grep '^v[0-9*]\.[0-9*].[0-9*]' | head -n 1) -echo QGC Version: ${VERSION} +VERSION=$(strings ${APPDIR}/${QGC_CUSTOM_BINARY_NAME} | grep '^v[0-9*]\.[0-9*].[0-9*]' | head -n 1) +echo ${QGC_CUSTOM_APP_NAME} Version: ${VERSION} # Go out of AppImage cd ${TMPDIR} -- 2.22.0