From a921acb3ce30ef5cbc4ea8093fcc0bdae13fb109 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Tue, 3 Sep 2019 23:07:37 -0700 Subject: Travis: build Subsurface AppImage against Qt 5.12 For this we need our own hand crafted trusty container with Qt 5.12, including QtWebKit and an updated cmake and libdbus, as well as already build googlemaps plugin, grantlee and libgit2. At the same time stop uploading the Subsurface AppImage in the traditional trusty build. Signed-off-by: Dirk Hohndel --- .travis.yml | 6 ++++ scripts/linux-trusty-qt512/after_success.sh | 23 ++++++++++++++ scripts/linux-trusty-qt512/before_install.sh | 31 ++++++++++++++++++ scripts/linux-trusty-qt512/in-container-build.sh | 40 ++++++++++++++++++++++++ scripts/linux-trusty-qt512/travisbuild.sh | 13 ++++++++ scripts/linux/after_success.sh | 9 ------ 6 files changed, 113 insertions(+), 9 deletions(-) create mode 100644 scripts/linux-trusty-qt512/after_success.sh create mode 100644 scripts/linux-trusty-qt512/before_install.sh create mode 100644 scripts/linux-trusty-qt512/in-container-build.sh create mode 100644 scripts/linux-trusty-qt512/travisbuild.sh diff --git a/.travis.yml b/.travis.yml index 116acbe91..947c52dbd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -69,6 +69,12 @@ matrix: - libglib2.0-dev - mdbtools-dev + - env: SUBSURFACE_PLATFORM='linux-trusty-qt512' + os: linux + language: c++ + services: + - docker + - env: SUBSURFACE_PLATFORM='linux2' os: linux dist: trusty diff --git a/scripts/linux-trusty-qt512/after_success.sh b/scripts/linux-trusty-qt512/after_success.sh new file mode 100644 index 000000000..9587ea08d --- /dev/null +++ b/scripts/linux-trusty-qt512/after_success.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +cd ${TRAVIS_BUILD_DIR} + +if [ ! -z $TRAVIS_BRANCH ] && [ "$TRAVIS_BRANCH" != "master" ] ; then + export UPLOADTOOL_SUFFIX=$TRAVIS_BRANCH +fi + +# set up the release message to use +source ./scripts/release-message.sh + +echo "Submitting the folloing AppImage for continuous build release:" +find . -name "Subsurface*.AppImage" + +# get and run the upload script +wget -c https://raw.githubusercontent.com/dirkhh/uploadtool/master/upload.sh + +# don't fail if the zsync file is missing +if [ -f Subsurface*.AppImage.zsync ] ; then + bash ./upload.sh Subsurface*.AppImage Subsurface*.AppImage.zsync +else + bash ./upload.sh Subsurface*.AppImage +fi diff --git a/scripts/linux-trusty-qt512/before_install.sh b/scripts/linux-trusty-qt512/before_install.sh new file mode 100644 index 000000000..1d1e057cc --- /dev/null +++ b/scripts/linux-trusty-qt512/before_install.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +# prep things so we can build for Linux +# we have a custom built Qt some gives us just what we need, including QtWebKit +# + +set -x + +# when running this locally, set TRAVIS_BUILD_DIR to the Subsurface +# directory inside your Windows build tree +TRAVIS_BUILD_DIR=${TRAVIS_BUILD_DIR:-$PWD} + +git fetch --unshallow || true # if running locally, unshallow could fail +git pull --tags +git submodule init +git describe + +# make sure we have libdivecomputer +echo "Get libdivecomputer" +cd ${TRAVIS_BUILD_DIR} +git submodule update --recursive +cd libdivecomputer +autoreconf --install +autoreconf --install + +export QT_ROOT=/usr/local/Qt/5.12.4 + +cd ${TRAVIS_BUILD_DIR}/.. + +# start the container and keep it running +docker run -v $PWD/subsurface:/subsurface --name=trusty-qt512 -w / -d dirkhh/trusty-qt512:0.6 /bin/sleep 60m diff --git a/scripts/linux-trusty-qt512/in-container-build.sh b/scripts/linux-trusty-qt512/in-container-build.sh new file mode 100644 index 000000000..226170f93 --- /dev/null +++ b/scripts/linux-trusty-qt512/in-container-build.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +set -x +set -e + +# this gets executed by Travis when building an AppImage for Linux +# inside of the trusty-qt512 container + +export PATH=$QT_ROOT/bin:$PATH # Make sure correct qmake is found on the $PATH for linuxdeployqt +export CMAKE_PREFIX_PATH=$QT_ROOT/lib/cmake + +bash -e -x /subsurface/scripts/build.sh -desktop -create-appdir -build-with-webkit -quick + +export QT_PLUGIN_PATH=$QT_ROOT/plugins +export QT_QPA_PLATFORM_PLUGIN_PATH=$QT_ROOT/plugins +export QT_DEBUG_PLUGINS=1 + +# set up the appdir +mkdir -p appdir/usr/plugins/ + +# mv googlemaps and Grantlee plugins into place +mv appdir/usr/usr/local/Qt/5.12.4/gcc_64/plugins/* appdir/usr/plugins # the usr/usr is not a typo, that's where it ends up +mv appdir/usr/lib/grantlee/ appdir/usr/plugins/ +rm -rf appdir/usr/home/ appdir/usr/include/ appdir/usr/share/man/ # No need to ship developer and man files as part of the AppImage +rm -rf appdir/usr/usr appdir/usr/lib/cmake appdir/usr/lib/pkgconfig + +# get the linuxdeployqt tool and run it to collect the libraries +curl -L -O "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage" +chmod a+x linuxdeployqt*.AppImage +unset QTDIR +unset QT_PLUGIN_PATH +unset LD_LIBRARY_PATH +./linuxdeployqt*.AppImage --appimage-extract-and-run ./appdir/usr/share/applications/*.desktop -bundle-non-qt-libs -qmldir=./subsurface/map-widget/ -verbose=2 + +# create the AppImage +export VERSION=$(cd /subsurface/scripts ; ./get-version linux) # linuxdeployqt uses this for naming the file +./linuxdeployqt*.AppImage --appimage-extract-and-run ./appdir/usr/share/applications/*.desktop -appimage -qmldir=./subsurface/map-widget/ -verbose=2 + +# copy AppImage to the calling VM +cp Subsurface*.AppImage* /subsurface diff --git a/scripts/linux-trusty-qt512/travisbuild.sh b/scripts/linux-trusty-qt512/travisbuild.sh new file mode 100644 index 000000000..91981108e --- /dev/null +++ b/scripts/linux-trusty-qt512/travisbuild.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +set -x +set -e + +# this is run to actually trigger the creation of the AppImage +# inside the container + +docker exec -t trusty-qt512 bash subsurface/scripts/linux-trusty-qt512/in-container-build.sh 2>&1 | tee build.log + +# fail the build if we didn't create the target binary +grep "Please consider submitting your AppImage to AppImageHub" build.log + diff --git a/scripts/linux/after_success.sh b/scripts/linux/after_success.sh index 5a1a5f76c..f5e4a54d0 100644 --- a/scripts/linux/after_success.sh +++ b/scripts/linux/after_success.sh @@ -7,16 +7,7 @@ fi # set up the release message to use source ${TRAVIS_BUILD_DIR}/scripts/release-message.sh -echo "Submitting the folloing AppImage for continuous build release:" -ls -lh Subsurface*.AppImage - # get and run the upload script wget -c https://raw.githubusercontent.com/dirkhh/uploadtool/master/upload.sh -# don't fail if the zsync file is missing -if [ -f Subsurface*.AppImage.zsync ] ; then - bash ./upload.sh Subsurface*.AppImage Subsurface*.AppImage.zsync -else - bash ./upload.sh Subsurface*.AppImage -fi bash ./upload.sh smtk2ssrf*.AppImage -- cgit v1.2.3-70-g09d2