From de53455a75b670e699c233bbfc2ab28b29f38364 Mon Sep 17 00:00:00 2001 From: Anton Lundin Date: Thu, 23 Nov 2017 20:32:27 +0100 Subject: [PATCH 1/7] Add automatic coverity scans This instructs travis to run automatic coverity scans for us. Signed-off-by: Anton Lundin --- .travis.yml | 46 ++++++++-------------------------------------- 1 file changed, 8 insertions(+), 38 deletions(-) diff --git a/.travis.yml b/.travis.yml index 816cd7064..ca43be04a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,18 +1,5 @@ - - matrix: include: - - env: SUBSURFACE_PLATFORM='mac' - os: osx - osx_image: xcode6.4 - language: c++ ruby - - - env: SUBSURFACE_PLATFORM='windows' - os: linux - dist: trusty - sudo: required - language: c++ - - env: SUBSURFACE_PLATFORM='linux' os: linux dist: trusty @@ -46,36 +33,19 @@ matrix: # Not a subsurface dependency, but a QtWebKit dependency - libhyphen-dev - libicu52 - # For SmartTrak import - - libglib2.0-dev - - mdbtools-dev - - - env: SUBSURFACE_PLATFORM="android" - # Currently hard coded to arm - os: linux - language: c++ - filter_secrets: false - services: - - docker -# TODO: caching -# cache: -# timeout: 300 -# directories: -# - 3pp - - - env: SUBSURFACE_PLATFORM="qt55" - # Currently hard coded to arm - os: linux - language: c++ - filter_secrets: false - services: - - docker + coverity_scan: + project: + name: "Subsurface-divelog/subsurface" + description: "Build submitted via Travis CI" + notification_email: glance@acc.umu.se + build_command: bash ${TRAVIS_BUILD_DIR}/scripts/${SUBSURFACE_PLATFORM}/travisbuild.sh + branch_pattern: coverity_scan before_install: - source ${TRAVIS_BUILD_DIR}/scripts/${SUBSURFACE_PLATFORM}/before_install.sh script: - - source ${TRAVIS_BUILD_DIR}/scripts/${SUBSURFACE_PLATFORM}/travisbuild.sh + - if [ "$COVERITY_SCAN_BRANCH" != "1" ] ; then source ${TRAVIS_BUILD_DIR}/scripts/${SUBSURFACE_PLATFORM}/travisbuild.sh ; fi after_success: - source ${TRAVIS_BUILD_DIR}/scripts/${SUBSURFACE_PLATFORM}/after_success.sh From e64da6e219abe4940f1481b785dd1af8fb334a54 Mon Sep 17 00:00:00 2001 From: Anton Lundin Date: Wed, 29 Nov 2017 07:39:40 +0100 Subject: [PATCH 2/7] Run coverty scan on cron triggers This is so we can setup a weekly cron trigger of master, to run the coverty scan. Signed-off-by: Anton Lundin --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index ca43be04a..b49df53e2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -42,6 +42,8 @@ matrix: branch_pattern: coverity_scan before_install: + # When the build on this branch gets triggered by travis-cron, do a coverty scan. + - if [ "$TRAVIS_EVENT_TYPE" = "cron" ] ; then export COVERITY_SCAN_BRANCH=1 ; fi - source ${TRAVIS_BUILD_DIR}/scripts/${SUBSURFACE_PLATFORM}/before_install.sh script: From 18e4ecff902834fe1874162fffdf25b1fcd076f2 Mon Sep 17 00:00:00 2001 From: Anton Lundin Date: Thu, 30 Nov 2017 16:42:15 +0100 Subject: [PATCH 3/7] Add a coverity status badge to README.md Signed-off-by: Anton Lundin --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ba92e6326..e259e5901 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ -# Subsurface [![Build Status](https://travis-ci.org/Subsurface-divelog/subsurface.svg?branch=master)](https://travis-ci.org/Subsurface-divelog/subsurface) +# Subsurface [![Build Status](https://travis-ci.org/Subsurface-divelog/subsurface.svg?branch=master)](https://travis-ci.org/Subsurface-divelog/subsurface) [![Coverity Scan Build Status](https://scan.coverity.com/projects/14405/badge.svg)](https://scan.coverity.com/projects/subsurface-divelog-subsurface) + This is the README file for Subsurface 4.7.7 From c9c43ecb656b074d8f9c4818bbd3f087e740310f Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Tue, 26 Dec 2017 22:26:57 -0800 Subject: [PATCH 4/7] Travis Coverity: this should give us the correct token Signed-off-by: Dirk Hohndel --- .travis.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.travis.yml b/.travis.yml index b49df53e2..56313e338 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,9 @@ +env: + global: + # The next declaration is the encrypted COVERITY_SCAN_TOKEN, created + # via the "travis encrypt" command using the project repo's public key + - secure: "Cb8+XTvcKMccvabQXQR2F1F5PNl9dZoe98Q66awS2DEHQIisUllMwZnMXyGtb3sbzJcWkilTPamSc6WBXO748hjH1uHdu9yFo4oQKBtq73gx5sRX51XTZSO4OfJipRJxSVkShnEA+YklwQBugOEkxfeRafpM68tbz6pAMoR8eHDKLsNa0wHjRfh+BEUKxaNEPxhWg3+41FSvUUeBf3fbqa6PWK5UwKIFCFh419X4gDyxTOEtm5OiIwYokruRGHxG0rZaMDHFcgjHBZ47WUXR0xIejh5j+L/vNGkcEoG6+96Hh5TR0rg9PaKdcWOUMt8VIO1pBZ1IrfGVdqgM6Yypb6ZrbJi3EEnAM6AxbUyJRW6410ZwcU0yVuNKDe/fMvhAjVlhsd+xjXuk2jfYKdhs/A45LwyK1Qt1vCXL8gFn/Dzgq+NIw8YyX9vL70J0t2cGQEwGTFiuD+5KaO35hyQm740bdw3FUCmFpVOYtq4iJMBDa12F4S9IMI8OvAmCXh2Mg/u3XVx9imDyBjwS4UrX63ny6rMftajdzCFl3FUyAsKcYl54ve1jVQtpoiQdrYuzlbRYXH/MvQ84ZKNclsFt84XayuL+y6Ds8+lyuEPOnJhpmZS0pt54X4YQSK0Yw49poNYBQHGTRKqOWnWSFDeFRlqki6WFnzqDek3lKRIu8iw=" + matrix: include: - env: SUBSURFACE_PLATFORM='linux' From 55a3cd13cd6370eba84e96199201cdd8d73f3d22 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Tue, 26 Dec 2017 22:30:56 -0800 Subject: [PATCH 5/7] Travis/Coverity: for now just trigger on branch name Signed-off-by: Dirk Hohndel --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 56313e338..fc3b45558 100644 --- a/.travis.yml +++ b/.travis.yml @@ -49,11 +49,10 @@ matrix: before_install: # When the build on this branch gets triggered by travis-cron, do a coverty scan. - - if [ "$TRAVIS_EVENT_TYPE" = "cron" ] ; then export COVERITY_SCAN_BRANCH=1 ; fi - source ${TRAVIS_BUILD_DIR}/scripts/${SUBSURFACE_PLATFORM}/before_install.sh script: - - if [ "$COVERITY_SCAN_BRANCH" != "1" ] ; then source ${TRAVIS_BUILD_DIR}/scripts/${SUBSURFACE_PLATFORM}/travisbuild.sh ; fi + - source ${TRAVIS_BUILD_DIR}/scripts/${SUBSURFACE_PLATFORM}/travisbuild.sh after_success: - source ${TRAVIS_BUILD_DIR}/scripts/${SUBSURFACE_PLATFORM}/after_success.sh From 40c6d9521e4ed6c0b382d3f8ce7b9d85b96ff4a2 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Wed, 27 Dec 2017 08:35:13 -0800 Subject: [PATCH 6/7] build.sh: add flags to only build / not build dependencies This is mainly intended for use when creating Coverity builds. This commit is easier to understand with git show -w as almost all changes are whitespace. Signed-off-by: Dirk Hohndel --- scripts/build.sh | 258 +++++++++++++++++++++++++---------------------- 1 file changed, 140 insertions(+), 118 deletions(-) diff --git a/scripts/build.sh b/scripts/build.sh index 4cd28b8f2..8dd6f3b30 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -59,6 +59,16 @@ while [[ $# -gt 0 ]] ; do # hack for Travix Mac build SKIP_GOOGLEMAPS="1" ;; + -only-deps) + # for Coverity build we want a mode to just build Subsurface and libdivecomputer (those will be analyzed), + # and build the rest, first. + ONLY_DEPS="1" + ;; + -no-deps) + # for Coverity build we want a mode to just build Subsurface and libdivecomputer (those will be analyzed), + # and build the rest, first. + NO_DEPS="1" + ;; *) echo "Unknown command line argument $arg" ;; @@ -304,25 +314,27 @@ if [[ $PLATFORM = Darwin || "$LIBGIT" < "24" ]] ; then cd $SRC - if [ ! -d libgit2 ] ; then - if [[ $1 = local ]] ; then - git clone $SRC/../libgit2 libgit2 - else - git clone https://github.com/libgit2/libgit2.git + if [ -z "$NO_DEPS" ] ; then + if [ ! -d libgit2 ] ; then + if [[ $1 = local ]] ; then + git clone $SRC/../libgit2 libgit2 + else + git clone https://github.com/libgit2/libgit2.git + fi fi + cd libgit2 + # let's build with a recent enough version of master for the latest features + git fetch origin + if ! git checkout $CURRENT_LIBGIT2 ; then + echo "Can't find the right tag in libgit2 - giving up" + exit 1 + fi + mkdir -p build + cd build + cmake $OLDER_MAC_CMAKE -DCMAKE_INSTALL_PREFIX=$INSTALL_ROOT -DCMAKE_BUILD_TYPE=Release -DBUILD_CLAR=OFF .. + make -j4 + make install fi - cd libgit2 - # let's build with a recent enough version of master for the latest features - git fetch origin - if ! git checkout $CURRENT_LIBGIT2 ; then - echo "Can't find the right tag in libgit2 - giving up" - exit 1 - fi - mkdir -p build - cd build - cmake $OLDER_MAC_CMAKE -DCMAKE_INSTALL_PREFIX=$INSTALL_ROOT -DCMAKE_BUILD_TYPE=Release -DBUILD_CLAR=OFF .. - make -j4 - make install if [ $PLATFORM = Darwin ] ; then # in order for macdeployqt to do its job correctly, we need the full path in the dylib ID @@ -339,28 +351,30 @@ cd $SRC # build libdivecomputer -cd subsurface +if [ -z "$ONLY_DEPS" ] ; then + cd subsurface -if [ ! -d libdivecomputer/src ] ; then - git submodule init - git submodule update --recursive -fi + if [ ! -d libdivecomputer/src ] ; then + git submodule init + git submodule update --recursive + fi -cd libdivecomputer + cd libdivecomputer -mkdir -p build -cd build + mkdir -p build + cd build -if [ ! -f ../configure ] ; then - # this is not a typo - # in some scenarios it appears that autoreconf doesn't copy the - # ltmain.sh file; running it twice, however, fixes that problem - autoreconf --install .. - autoreconf --install .. + if [ ! -f ../configure ] ; then + # this is not a typo + # in some scenarios it appears that autoreconf doesn't copy the + # ltmain.sh file; running it twice, however, fixes that problem + autoreconf --install .. + autoreconf --install .. + fi + CFLAGS="$OLDER_MAC -I$INSTALL_ROOT/include $LIBDC_CFLAGS" ../configure --prefix=$INSTALL_ROOT --disable-examples + make -j4 + make install fi -CFLAGS="$OLDER_MAC -I$INSTALL_ROOT/include $LIBDC_CFLAGS" ../configure --prefix=$INSTALL_ROOT --disable-examples -make -j4 -make install if [ $PLATFORM = Darwin ] ; then if [ -z "$CMAKE_PREFIX_PATH" ] ; then @@ -401,28 +415,30 @@ if [ "$BUILDGRANTLEE" = "1" ] ; then # build grantlee PRINTING="-DNO_PRINTING=OFF" - cd $SRC + if [ -z "$NO_DEPS" ] ; then + cd $SRC - if [ ! -d grantlee ] ; then - if [[ $1 = local ]] ; then - git clone $SRC/../grantlee grantlee - else - git clone https://github.com/steveire/grantlee.git + if [ ! -d grantlee ] ; then + if [[ $1 = local ]] ; then + git clone $SRC/../grantlee grantlee + else + git clone https://github.com/steveire/grantlee.git + fi fi + cd grantlee + if ! git checkout v5.0.0 ; then + echo "can't check out v5.0.0 of grantlee -- giving up" + exit 1 + fi + mkdir -p build + cd build + cmake $OLDER_MAC_CMAKE -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=$INSTALL_ROOT \ + -DBUILD_TESTS=NO \ + $SRC/grantlee + make -j4 + make install fi - cd grantlee - if ! git checkout v5.0.0 ; then - echo "can't check out v5.0.0 of grantlee -- giving up" - exit 1 - fi - mkdir -p build - cd build - cmake $OLDER_MAC_CMAKE -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=$INSTALL_ROOT \ - -DBUILD_TESTS=NO \ - $SRC/grantlee - make -j4 - make install else PRINTING="-DNO_PRINTING=ON" fi @@ -430,78 +446,84 @@ fi if [ "$SKIP_GOOGLEMAPS" != "1" ] ; then # build the googlemaps map plugin - cd $SRC - if [ ! -d googlemaps ] ; then - if [[ $1 = local ]] ; then - git clone $SRC/../googlemaps googlemaps - else - git clone https://github.com/Subsurface-divelog/googlemaps.git + if [ -z "$NO_DEPS" ] ; then + cd $SRC + if [ ! -d googlemaps ] ; then + if [[ $1 = local ]] ; then + git clone $SRC/../googlemaps googlemaps + else + git clone https://github.com/Subsurface-divelog/googlemaps.git + fi fi - fi - cd googlemaps - git checkout master - git pull --rebase + cd googlemaps + git checkout master + git pull --rebase - mkdir -p build - cd build - $QMAKE -query - $QMAKE "INCLUDEPATH=$INSTALL_ROOT/include" ../googlemaps.pro - # on Travis the compiler doesn't support c++1z, yet qmake adds that flag; - # since things compile fine with c++11, let's just hack that away - # similarly, don't use -Wdata-time - mv Makefile Makefile.bak - cat Makefile.bak | sed -e 's/std=c++1z/std=c++11/g ; s/-Wdate-time//' > Makefile - make -j4 - make install + mkdir -p build + cd build + $QMAKE -query + $QMAKE "INCLUDEPATH=$INSTALL_ROOT/include" ../googlemaps.pro + # on Travis the compiler doesn't support c++1z, yet qmake adds that flag; + # since things compile fine with c++11, let's just hack that away + # similarly, don't use -Wdata-time + mv Makefile Makefile.bak + cat Makefile.bak | sed -e 's/std=c++1z/std=c++11/g ; s/-Wdate-time//' > Makefile + make -j4 + make install + fi fi # finally, build Subsurface set -x -cd $SRC/subsurface -for (( i=0 ; i < ${#BUILDS[@]} ; i++ )) ; do - SUBSURFACE_EXECUTABLE=${BUILDS[$i]} - BUILDDIR=${BUILDDIRS[$i]} - echo "build $SUBSURFACE_EXECUTABLE in $BUILDDIR" - - # pull the plasma-mobile components from upstream if building Subsurface-mobile - if [ "$SUBSURFACE_EXECUTABLE" = "MobileExecutable" ] ; then - cd $SRC/subsurface - bash ./scripts/mobilecomponents.sh - fi - - mkdir -p $SRC/subsurface/$BUILDDIR - cd $SRC/subsurface/$BUILDDIR - export CMAKE_PREFIX_PATH="$INSTALL_ROOT/lib/cmake;${CMAKE_PREFIX_PATH}" - cmake -DCMAKE_BUILD_TYPE=Debug .. \ - -DSUBSURFACE_TARGET_EXECUTABLE=$SUBSURFACE_EXECUTABLE \ - ${LIBGIT_ARGS} \ - -DLIBDIVECOMPUTER_INCLUDE_DIR=$INSTALL_ROOT/include \ - -DLIBDIVECOMPUTER_LIBRARIES=$INSTALL_ROOT/lib/libdivecomputer.a \ - -DCMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH \ - -DBTSUPPORT=${BTSUPPORT} \ - -DCMAKE_INSTALL_PREFIX=${INSTALL_ROOT} \ - -DLIBGIT2_FROM_PKGCONFIG=ON \ - -DFORCE_LIBSSH=OFF \ - $PRINTING $EXTRA_OPTS - - if [ $PLATFORM = Darwin ] ; then - rm -rf Subsurface.app - rm -rf Subsurface-mobile.app - fi +if [ -z "$ONLY_DEPS" ] ; then + cd $SRC/subsurface + for (( i=0 ; i < ${#BUILDS[@]} ; i++ )) ; do + SUBSURFACE_EXECUTABLE=${BUILDS[$i]} + BUILDDIR=${BUILDDIRS[$i]} + echo "build $SUBSURFACE_EXECUTABLE in $BUILDDIR" + + # pull the plasma-mobile components from upstream if building Subsurface-mobile + if [ "$SUBSURFACE_EXECUTABLE" = "MobileExecutable" ] ; then + cd $SRC/subsurface + bash ./scripts/mobilecomponents.sh + fi - LIBRARY_PATH=$INSTALL_ROOT/lib make -j4 - LIBRARY_PATH=$INSTALL_ROOT/lib make install + mkdir -p $SRC/subsurface/$BUILDDIR + cd $SRC/subsurface/$BUILDDIR + export CMAKE_PREFIX_PATH="$INSTALL_ROOT/lib/cmake;${CMAKE_PREFIX_PATH}" + cmake -DCMAKE_BUILD_TYPE=Debug .. \ + -DSUBSURFACE_TARGET_EXECUTABLE=$SUBSURFACE_EXECUTABLE \ + ${LIBGIT_ARGS} \ + -DLIBDIVECOMPUTER_INCLUDE_DIR=$INSTALL_ROOT/include \ + -DLIBDIVECOMPUTER_LIBRARIES=$INSTALL_ROOT/lib/libdivecomputer.a \ + -DCMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH \ + -DBTSUPPORT=${BTSUPPORT} \ + -DCMAKE_INSTALL_PREFIX=${INSTALL_ROOT} \ + -DLIBGIT2_FROM_PKGCONFIG=ON \ + -DFORCE_LIBSSH=OFF \ + $PRINTING $EXTRA_OPTS + + if [ $PLATFORM = Darwin ] ; then + rm -rf Subsurface.app + rm -rf Subsurface-mobile.app + fi - if [ "$CREATE_APPDIR" = "1" ] ; then - # if we create an AppImage this makes gives us a sane starting point - cd $SRC - mkdir -p ./appdir - mkdir -p appdir/usr/share/metainfo - mkdir -p appdir/usr/share/icons/hicolor/256x256/apps - cp -r ./install-root/* ./appdir/usr - cp subsurface/appdata/subsurface.appdata.xml appdir/usr/share/metainfo/ - cp subsurface/icons/subsurface-icon.png appdir/usr/share/icons/hicolor/256x256/apps/ - fi -done + LIBRARY_PATH=$INSTALL_ROOT/lib make -j4 + LIBRARY_PATH=$INSTALL_ROOT/lib make install + + if [ "$CREATE_APPDIR" = "1" ] ; then + # if we create an AppImage this makes gives us a sane starting point + cd $SRC + mkdir -p ./appdir + mkdir -p appdir/usr/share/metainfo + mkdir -p appdir/usr/share/icons/hicolor/256x256/apps + cp -r ./install-root/* ./appdir/usr + cp subsurface/appdata/subsurface.appdata.xml appdir/usr/share/metainfo/ + cp subsurface/icons/subsurface-icon.png appdir/usr/share/icons/hicolor/256x256/apps/ + fi + done +else + echo "Done building the dependencies, did not build libdivecomputer and Subsurface" +fi From 15efc4e2c7b87237667d12aa9413fd0df3dfdbd3 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Wed, 27 Dec 2017 08:41:37 -0800 Subject: [PATCH 7/7] Travis/Coverity: try to only scan libdivecomputer and Subsurface Build the dependencies outside the part that gets scanned. And remove all the commented out noise. Signed-off-by: Dirk Hohndel --- .travis.yml | 11 ++++--- scripts/build.sh | 8 +++++ scripts/linux/travisbuild.sh | 60 ++++-------------------------------- 3 files changed, 21 insertions(+), 58 deletions(-) diff --git a/.travis.yml b/.travis.yml index fc3b45558..98c95b11f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -43,19 +43,22 @@ matrix: project: name: "Subsurface-divelog/subsurface" description: "Build submitted via Travis CI" - notification_email: glance@acc.umu.se - build_command: bash ${TRAVIS_BUILD_DIR}/scripts/${SUBSURFACE_PLATFORM}/travisbuild.sh + notification_email: coverity@subsurface-divelog.org + build_command: bash ${TRAVIS_BUILD_DIR}/scripts/${SUBSURFACE_PLATFORM}/travisbuild.sh -no-deps branch_pattern: coverity_scan before_install: # When the build on this branch gets triggered by travis-cron, do a coverty scan. - source ${TRAVIS_BUILD_DIR}/scripts/${SUBSURFACE_PLATFORM}/before_install.sh + - source ${TRAVIS_BUILD_DIR}/scripts/${SUBSURFACE_PLATFORM}/travisbuild.sh -only-deps script: - - source ${TRAVIS_BUILD_DIR}/scripts/${SUBSURFACE_PLATFORM}/travisbuild.sh + echo "built in coverity_scan section" + # - source ${TRAVIS_BUILD_DIR}/scripts/${SUBSURFACE_PLATFORM}/travisbuild.sh after_success: - - source ${TRAVIS_BUILD_DIR}/scripts/${SUBSURFACE_PLATFORM}/after_success.sh + echo "don't post binaries" + # - source ${TRAVIS_BUILD_DIR}/scripts/${SUBSURFACE_PLATFORM}/after_success.sh branches: except: diff --git a/scripts/build.sh b/scripts/build.sh index 8dd6f3b30..ec9625648 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -14,6 +14,13 @@ # create a log file of the build exec 1> >(tee build.log) 2>&1 +CURRENTWD=$(pwd) + +# if someone starts this script inside the subsurface directory, just go up a level +if [ "$(basename $(pwd))" = "subsurface" ] ; then + cd .. +fi + SRC=$(pwd) PLATFORM=$(uname) @@ -527,3 +534,4 @@ if [ -z "$ONLY_DEPS" ] ; then else echo "Done building the dependencies, did not build libdivecomputer and Subsurface" fi +cd $CURRENTWD diff --git a/scripts/linux/travisbuild.sh b/scripts/linux/travisbuild.sh index f4bfaf63f..49a91ff61 100644 --- a/scripts/linux/travisbuild.sh +++ b/scripts/linux/travisbuild.sh @@ -13,60 +13,12 @@ export CMAKE_PREFIX_PATH=$QT_ROOT/lib/cmake # build both desktop and mobile - first desktop without BT support and without # webkit to make sure that still works, then with all components in order # to create an AppImage -cd .. -bash -e -x ./subsurface/scripts/build.sh -desktop -no-bt -rm -rf subsurface/build -bash -e -x ./subsurface/scripts/build.sh -both -create-appdir -build-with-webkit - -export QT_PLUGIN_PATH=$QT_ROOT/plugins -export QT_QPA_PLATFORM_PLUGIN_PATH=$QT_ROOT/plugins -export QT_DEBUG_PLUGINS=1 - -# for debugging: find $QT_ROOT/plugins - -env CTEST_OUTPUT_ON_FAILURE=1 make -C subsurface/build check - -# set up the appdir -mkdir -p appdir/usr/plugins/ - -# mv googlemaps and Grantlee plugins into place -mv appdir/usr/usr/local/Qt*/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 +bash -e -x ${TRAVIS_BUILD_DIR}/scripts/build.sh -desktop -no-bt $@ -# get the linuxdeployqt tool and run it to collect the libraries -wget -q -c "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 ./appdir/usr/share/applications/*.desktop -bundle-non-qt-libs -qmldir=./subsurface/map-widget/ -verbose=2 - -# create the AppImage -export VERSION=$(cd ${TRAVIS_BUILD_DIR}/scripts ; ./get-version linux) # linuxdeployqt uses this for naming the file -./linuxdeployqt*.AppImage ./appdir/usr/share/applications/*.desktop -appimage -qmldir=./subsurface/map-widget/ -verbose=2 -find ./appdir -executable -type f -exec ldd {} \; | grep " => /usr" | cut -d " " -f 2-3 | sort | uniq - -# SmartTrak import tool -bash -e -x ./subsurface/scripts/smtk2ssrf-build.sh - -# Create AppImage for smtk2ssrf -mkdir -p ./smtk2ssrf_appdir/usr/share -mkdir -p ./smtk2ssrf_appdir/usr/plugins -mkdir -p ./smtk2ssrf_appdir/usr/bin -mkdir -p ./smtk2ssrf_appdir/usr/lib -cp -f subsurface/icons/subsurface-icon.svg smtk2ssrf_appdir/ -cp -f subsurface/smtk-import/smtk2ssrf.desktop smtk2ssrf_appdir/ -cp -f install-root/bin/smtk2ssrf smtk2ssrf_appdir/usr/bin/ -cp -f install-root/lib/libdivecomputer.so.0 smtk2ssrf_appdir/usr/lib/ -cp -f install-root/lib/libgit2* smtk2ssrf_appdir/usr/lib/ -# Why is Grantlee needed? We have built subsurface without printing support!!! -cp -f install-root/lib/libGrantlee* smtk2ssrf_appdir/usr/lib/ -cp -rf appdir/usr/plugins/{bearer,iconengines,imageformats,platforms,xcbglintegrations} smtk2ssrf_appdir/usr/plugins - -./linuxdeployqt*.AppImage ./smtk2ssrf_appdir/smtk2ssrf.desktop -bundle-non-qt-libs -verbose=2 -./linuxdeployqt*.AppImage ./smtk2ssrf_appdir/smtk2ssrf.desktop -appimage -verbose=2 -find ./smtk2ssrf_appdir -executable -type f -exec ldd {} \; | grep " => /usr" | cut -d " " -f 2-3 | sort | uniq +if [ "$1" = "-onlydeps" ] ; then + exit 0 +fi +rm -rf subsurface/build +bash -e -x ${TRAVIS_BUILD_DIR}/scripts/build.sh -both -create-appdir -build-with-webkit $@