forked from KDAB/hotspot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
78 lines (74 loc) · 3.63 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
language: cpp
compiler: gcc
sudo: require
dist: trusty
before_install:
- sudo add-apt-repository ppa:beineri/opt-qt-5.10.1-trusty -y
- sudo apt-get update -qq
- sudo apt-get -y install qt510base qt510svg qt510x11extras
install:
- source /opt/qt*/bin/qt*-env.sh
- # zstd
- wget -nv -c "https://github.com/facebook/zstd/archive/v1.4.5.tar.gz" -O zstd.tar.gz
- tar xf zstd.tar.gz
- cd zstd-1.4.5
- make -j$(nproc)
- sudo make install
- cd ..
- # Precompiled KF5
- wget -c "https://github.com/chigraph/precompiled-kf5-linux/releases/download/precompiled/kf5-gcc6-linux64-release.tar.xz"
- tar xf kf5-gcc6-linux64-release.tar.xz
- sudo cp -Rf root/kf5-release/* /opt/qt*/
- # Precompiled version of elfutils in newer version (0.179)
- wget -c "https://owncloud.kdab.com/index.php/s/COLPY0LO4XhMtOx/download" -O elfutils.tar.bz2
- sudo tar -xf elfutils.tar.bz2 -C /
- # Precompiled version of rustc_demangle
- wget -c "https://owncloud.kdab.com/index.php/s/EBj3jFT7HIqCrtL/download" -O rustc_demangle.tar.bz2
- sudo tar -xf rustc_demangle.tar.bz2 -C /
- wget -c "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage"
- chmod a+x linuxdeployqt*.AppImage
- sudo mv linuxdeployqt*.AppImage /usr/bin/linuxdeployqt
- wget -c "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage"
- chmod a+x appimagetool-*.AppImage
- sudo mv appimagetool-*.AppImage /usr/bin/appimagetool
- wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh
- chmod a+x upload.sh
- sudo mv upload.sh /usr/bin/github-upload
script:
- set -e # Exit immediately if anything fails
- mkdir build
- cd build
- cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DAPPIMAGE_BUILD=ON
- make -j$(nproc)
- make DESTDIR=appdir install ; find appdir/
- mkdir -p appdir/usr/share/applications/ # FIXME: Do in CMakeLists.txt
- cp ../hotspot.desktop appdir/usr/share/applications/ # FIXME: Do in CMakeLists.txt
- unset QTDIR; unset QT_PLUGIN_PATH ; unset LD_LIBRARY_PATH
- export LD_LIBRARY_PATH=/opt/lib:/opt/qt510/lib/x86_64-linux-gnu # make sure these paths are known so all libs are found
- linuxdeployqt ./appdir/usr/share/applications/*.desktop -bundle-non-qt-libs
- # workaround for https://github.com/KDAB/hotspot/issues/87
- linuxdeployqt ./appdir/usr/lib/x86_64-linux-gnu/libexec/hotspot-perfparser -bundle-non-qt-libs -no-plugins
- unset LD_LIBRARY_PATH
- # Share libraries to reduce image size
- mv ./appdir/usr/lib/x86_64-linux-gnu/libexec/lib/* ./appdir/usr/lib/
- rmdir ./appdir/usr/lib/x86_64-linux-gnu/libexec/lib
- ln -sr ./appdir/usr/lib/ ./appdir/usr/lib/x86_64-linux-gnu/libexec/lib
- # include breeze icons
- cp -a /opt/qt*/share/icons/breeze ./appdir/usr/share/icons/
- # Ensure we prefer the bundled libs also when calling dlopen, cf.: https://github.com/KDAB/hotspot/issues/89
- rm ./appdir/AppRun
- echo -e '#!/bin/bash\nd="$(dirname "$(readlink -f "${0}")")"\nLD_LIBRARY_PATH="$d/usr/lib":$LD_LIBRARY_PATH "$d/usr/bin/hotspot" $@' > ./appdir/AppRun
- chmod +x ./appdir/AppRun
- # Actually create the final image
- appimagetool ./appdir/
- # upload the appimage to GitHub
- mv Hotspot-*.AppImage Hotspot-git.$(git rev-parse --short HEAD)-x86_64.AppImage
- github-upload ./Hotspot-git.*-x86_64.AppImage
- # finally run unit tests (we may want to get access to the app image independently from test failures)
- set +e
- source /opt/qt*/bin/qt*-env.sh
- ctest -VV .
branches:
except:
- # Do not build tags that we create when we upload to GitHub Releases
- /^(?i:continuous)$/