Commit aab353a0 authored by Stefan Dunca's avatar Stefan Dunca

Add support for AppImage customization

Also copy all dependencies of ICU libs to cover all configurations
parent 9c6b1ea7
...@@ -132,13 +132,14 @@ LinuxBuild { ...@@ -132,13 +132,14 @@ LinuxBuild {
libQt5Widgets.so.5 \ libQt5Widgets.so.5 \
libQt5XcbQpa.so.5 \ libQt5XcbQpa.so.5 \
libQt5Xml.so.5 \ libQt5Xml.so.5 \
libicui18n.so \ libicui18n.so* \
libQt5TextToSpeech.so.5 libQt5TextToSpeech.so.5
!contains(DEFINES, __rasp_pi2__) { !contains(DEFINES, __rasp_pi2__) {
# Some Qt distributions link with *.so.56
QT_LIB_LIST += \ QT_LIB_LIST += \
libicudata.so \ libicudata.so* \
libicuuc.so libicuuc.so*
} }
for(QT_LIB, QT_LIB_LIST) { for(QT_LIB, QT_LIB_LIST) {
......
...@@ -3,30 +3,37 @@ ...@@ -3,30 +3,37 @@
#set +e #set +e
if [[ $# -eq 0 ]]; then if [[ $# -eq 0 ]]; then
echo 'create_linux_appimage.sh QGC_SRC_DIR QGC_RELEASE_DIR' echo 'create_linux_appimage.sh QGC_SRC_DIR QGC_RELEASE_DIR'
exit 1 exit 1
fi 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 QGC_SRC=$1
if [ ! -f ${QGC_SRC}/qgroundcontrol.pro ]; then if [ ! -f ${QGC_SRC}/qgroundcontrol.pro ]; then
echo 'please specify path to qgroundcontrol source as the 1st argument' echo "please specify path to $(QGC_CUSTOM_APP_NAME) source as the 1st argument"
exit 1 exit 1
fi fi
QGC_RELEASE_DIR=$2 QGC_RELEASE_DIR=$2
if [ ! -f ${QGC_RELEASE_DIR}/QGroundControl ]; then if [ ! -f ${QGC_RELEASE_DIR}/${QGC_CUSTOM_BINARY_NAME} ]; then
echo 'please specify path to QGroundControl release as the 2nd argument' echo "please specify path to ${QGC_CUSTOM_BINARY_NAME} release as the 2nd argument"
exit 1 exit 1
fi fi
OUTPUT_DIR=${3-`pwd`} OUTPUT_DIR=${3-`pwd`}
echo "Output directory:" ${OUTPUT_DIR} echo "Output directory:" ${OUTPUT_DIR}
# Generate AppImage using the binaries currently provided by the project. # 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. # 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` TMPDIR=`mktemp -d`
APPDIR=${TMPDIR}/$APP".AppDir" 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 ...@@ -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 # copy QGroundControl release into appimage
rsync -av --exclude=*.cpp --exclude=*.h --exclude=*.o --exclude="CMake*" --exclude="*.cmake" ${QGC_RELEASE_DIR}/* ${APPDIR}/ rsync -av --exclude=*.cpp --exclude=*.h --exclude=*.o --exclude="CMake*" --exclude="*.cmake" ${QGC_RELEASE_DIR}/* ${APPDIR}/
rm -rf ${APPDIR}/package rm -rf ${APPDIR}/package
cp ${QGC_SRC}/deploy/qgroundcontrol-start.sh ${APPDIR}/AppRun cp ${QGC_CUSTOM_LINUX_START_SH} ${APPDIR}/AppRun
# copy icon # copy icon
cp ${QGC_SRC}/resources/icons/qgroundcontrol.png ${APPDIR}/ cp ${QGC_CUSTOM_APP_ICON} ${APPDIR}/
cat > ./QGroundControl.desktop <<\EOF cat > ./QGroundControl.desktop <<\EOF
[Desktop Entry] [Desktop Entry]
Type=Application Type=Application
Name=QGroundControl Name=${QGC_CUSTOM_APP_NAME}
GenericName=Ground Control Station GenericName=${QGC_CUSTOM_GENERIC_NAME}
Comment=UAS ground control station Comment=UAS ground control station
Icon=QGroundControl Icon=${QGC_CUSTOM_APP_ICON_NAME}
Exec=AppRun Exec=AppRun
Terminal=false Terminal=false
Categories=Utility; Categories=Utility;
Keywords=computer; Keywords=computer;
EOF EOF
VERSION=$(strings ${APPDIR}/QGroundControl | grep '^v[0-9*]\.[0-9*].[0-9*]' | head -n 1) VERSION=$(strings ${APPDIR}/${QGC_CUSTOM_BINARY_NAME} | grep '^v[0-9*]\.[0-9*].[0-9*]' | head -n 1)
echo QGC Version: ${VERSION} echo ${QGC_CUSTOM_APP_NAME} Version: ${VERSION}
# Go out of AppImage # Go out of AppImage
cd ${TMPDIR} cd ${TMPDIR}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment