11 - libt_branch=RC_1_2 gui=true build_system=qmake
12 - libt_branch=RC_1_2 gui=false build_system=qmake
13 - libt_branch=RC_1_2 gui=true build_system=cmake
14 - libt_branch=RC_1_2 gui=false build_system=cmake
16 - secure: "OI9CUjj4lTb0HwwIZU5PbECU3hLlAL6KC8KsbwohG8/O3j5fLcnmDsK4Ad9us5cC39sS11Jcd1kDP2qRcCuST/glVNhLkcjKkiQerOfd5nQ/qL4JYfz/1mfP5mdpz9jHKzpLUIG+TXkbSTjP6VVmsb5KPT+3pKEdRFZB+Pu9+J8="
17 - coverity_branch: coverity_scan
33 name: "qbittorrent/qBittorrent"
34 description: "Build submitted via Travis CI"
35 build_command_prepend: "./bootstrap.sh && ./configure $qmake_conf"
36 build_command: "make -j2"
37 branch_pattern: $coverity_branch
38 notification_email: sledgehammer999@qbittorrent.org
41 # sources list: https://github.com/travis-ci/apt-source-safelist/blob/master/ubuntu.json
42 - sourceline: 'ppa:qbittorrent-team/qbt-libtorrent-travisci'
43 - sourceline: 'deb https://apt.kitware.com/ubuntu/ bionic main'
44 key_url: 'https://apt.kitware.com/keys/kitware-archive-latest.asc'
46 # packages list: https://github.com/travis-ci/apt-package-safelist/blob/master/ubuntu-trusty
47 - [autoconf, automake, cmake, colormake]
48 - [libboost-dev, libboost-system-dev]
50 - [qtbase5-dev, libqt5svg5-dev, qttools5-dev]
54 # only allow specific build for coverity scan, others will stop
55 - if [ "$TRAVIS_BRANCH" = "$coverity_branch" ] && ! [ "$TRAVIS_OS_NAME" = "linux" -a "$libt_branch" = "RC_1_2" -a "$gui" = "true" -a "$build_system" = "qmake" ]; then exit ; fi
57 - shopt -s expand_aliases
58 - alias make="colormake -j2" # Using nprocs/2 sometimes may fail (gcc is killed by system)
59 - qbt_path="$HOME/qbt_install"
60 - qmake_conf="$qmake_conf --prefix=$qbt_path"
61 - cmake_conf="$cmake_conf -DCMAKE_INSTALL_PREFIX=$qbt_path"
63 # options for specific branches
65 if [ "$TRAVIS_OS_NAME" = "linux" ]; then
66 # setup virtual display for after_success target
67 if [ "$gui" = "true" ]; then export "DISPLAY=:99.0" && /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1280x1024x16 ; fi ;
68 # CMake from Kitware is installed in /usr/bin
69 # TravisCI installs its own cmake to another location which ovverides other installations
70 # if they don't call the new binary directly
71 alias cmake="/usr/bin/cmake"
74 if [ "$TRAVIS_OS_NAME" = "osx" ]; then
75 CXXFLAGS="$CXXFLAGS -Wno-unused-local-typedefs"
77 openssl_root_path="/usr/local/opt/openssl"
78 qmake_conf="$qmake_conf PKG_CONFIG_PATH=$openssl_root_path/lib/pkgconfig:$PKG_CONFIG_PATH"
79 cmake_conf="$cmake_conf -DOPENSSL_ROOT_DIR=$openssl_root_path"
82 if [ "$gui" = "false" ]; then
83 qmake_conf="$qmake_conf --disable-gui"
84 cmake_conf="$cmake_conf -DGUI=OFF"
96 if [ "$TRAVIS_OS_NAME" = "osx" ]; then
98 PATH="/usr/local/opt/ccache/libexec:$PATH"
100 brew update > /dev/null
102 brew install ccache colormake boost openssl qt zlib
103 brew link --force qt zlib
105 if [ "$build_system" = "cmake" ]; then
106 sudo ln -s /usr/local/opt/qt/mkspecs /usr/local/mkspecs
107 sudo ln -s /usr/local/opt/qt/plugins /usr/local/plugins
111 if [ "$TRAVIS_BRANCH" != "$coverity_branch" ]; then
112 export use_ccache=true
114 ccache -V && ccache --show-stats && ccache --zero-stats
117 if [ "$libt_branch" = "RC_1_2" ] && [ "$TRAVIS_OS_NAME" = "linux" ]; then
118 # Will install latest 1.2.x daily build from the PPA
119 sudo apt-get -y install libtorrent-rasterbar-dev
122 if [ "$libt_branch" = "RC_1_2" ] && [ "$TRAVIS_OS_NAME" = "osx" ]; then
123 # building libtorrent manually should be faster than using the official bottle
124 # because the bottle will also pull in a lot of updated dependencies and prolong the overall time
126 git clone --single-branch --branch RC_1_2 https://github.com/arvidn/libtorrent.git
128 git checkout tags/v1.2.10
130 cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=14 -Ddeprecated-functions=OFF -DOPENSSL_ROOT_DIR="$openssl_root_path" ./
137 - if [ "$TRAVIS_BRANCH" = "$coverity_branch" ]; then exit ; fi # skip usual build when running coverity scan
139 cd "$TRAVIS_BUILD_DIR"
140 if [ "$build_system" = "qmake" ]; then
141 # scan only as lupdate is prone to hang
142 lupdate -extensions c,cpp,h,hpp,ui ./
144 ./configure $qmake_conf CXXFLAGS="$CXXFLAGS"
146 mkdir build && cd build
147 cmake $cmake_conf ../
153 - if [ "$gui" = "true" ]; then qbt_exe="qbittorrent" ; else qbt_exe="qbittorrent-nox" ; fi
154 - if [ "$TRAVIS_OS_NAME" = "linux" ]; then cd "$qbt_path/bin" ; fi
156 if [ "$TRAVIS_OS_NAME" = "osx" ]; then
157 if [ "$build_system" = "qmake" ]; then
158 macdeployqt "$TRAVIS_BUILD_DIR/src/$qbt_exe.app"
159 cd "$TRAVIS_BUILD_DIR/src/$qbt_exe.app/Contents/MacOS"
161 cd "$qbt_path/$qbt_exe.app/Contents/MacOS"
164 - ./$qbt_exe --version
167 - if [ "$use_ccache" = true ]; then ccache --show-stats ; fi