diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2019-09-03 23:07:37 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-09-05 17:54:09 -0700 |
commit | a921acb3ce30ef5cbc4ea8093fcc0bdae13fb109 (patch) | |
tree | f366b1ba56c348185a83de00daff85627040a0de /scripts/linux-trusty-qt512 | |
parent | 6670ea7bdb580db5630ce4176334801ef6c811d4 (diff) | |
download | subsurface-a921acb3ce30ef5cbc4ea8093fcc0bdae13fb109.tar.gz |
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 <dirk@hohndel.org>
Diffstat (limited to 'scripts/linux-trusty-qt512')
-rw-r--r-- | scripts/linux-trusty-qt512/after_success.sh | 23 | ||||
-rw-r--r-- | scripts/linux-trusty-qt512/before_install.sh | 31 | ||||
-rw-r--r-- | scripts/linux-trusty-qt512/in-container-build.sh | 40 | ||||
-rw-r--r-- | scripts/linux-trusty-qt512/travisbuild.sh | 13 |
4 files changed, 107 insertions, 0 deletions
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 + |