12 - libt_branch=RC_1_2 gui=true build_system=qmake
13 - libt_branch=RC_1_2 gui=false build_system=qmake
14 - libt_branch=RC_1_2 gui=true build_system=cmake
15 - libt_branch=RC_1_2 gui=false build_system=cmake
17 - secure: "OI9CUjj4lTb0HwwIZU5PbECU3hLlAL6KC8KsbwohG8/O3j5fLcnmDsK4Ad9us5cC39sS11Jcd1kDP2qRcCuST/glVNhLkcjKkiQerOfd5nQ/qL4JYfz/1mfP5mdpz9jHKzpLUIG+TXkbSTjP6VVmsb5KPT+3pKEdRFZB+Pu9+J8="
18 - coverity_branch: coverity_scan
22 - env: libt_branch=RC_2_0 gui=true build_system=qmake
39 name: "qbittorrent/qBittorrent"
40 description: "Build submitted via Travis CI"
41 build_command_prepend: "./bootstrap.sh && ./configure $qmake_conf"
42 build_command: "make -j2"
43 branch_pattern: $coverity_branch
44 notification_email: sledgehammer999@qbittorrent.org
47 # sources list: https://github.com/travis-ci/apt-source-safelist/blob/master/ubuntu.json
48 - sourceline: 'deb https://apt.kitware.com/ubuntu/ focal main'
49 key_url: 'https://apt.kitware.com/keys/kitware-archive-latest.asc'
51 # packages list: https://github.com/travis-ci/apt-package-safelist/blob/master/ubuntu-trusty
52 - [autoconf, automake, cmake, colormake]
53 - [libboost-dev, libboost-system-dev]
55 - [qtbase5-dev, libqt5svg5-dev, qttools5-dev]
59 # only allow specific build for coverity scan, others will stop
60 - 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
62 - shopt -s expand_aliases
63 - alias make="colormake -j2" # Using nprocs/2 sometimes may fail (gcc is killed by system)
64 - qbt_path="$HOME/qbt_install"
65 - qmake_conf="$qmake_conf --prefix=$qbt_path"
66 - cmake_conf="$cmake_conf -DCMAKE_INSTALL_PREFIX=$qbt_path"
68 # options for specific branches
70 if [ "$TRAVIS_OS_NAME" = "linux" ]; then
71 # setup virtual display for after_success target
72 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 ;
73 # CMake from Kitware is installed in /usr/bin
74 # TravisCI installs its own cmake to another location which ovverides other installations
75 # if they don't call the new binary directly
76 alias cmake="/usr/bin/cmake"
78 export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib"
81 if [ "$TRAVIS_OS_NAME" = "osx" ]; then
82 CXXFLAGS="$CXXFLAGS -Wno-unused-local-typedefs"
84 openssl_root_path="/usr/local/opt/openssl"
85 qmake_conf="$qmake_conf PKG_CONFIG_PATH=$openssl_root_path/lib/pkgconfig:$PKG_CONFIG_PATH"
86 cmake_conf="$cmake_conf -DOPENSSL_ROOT_DIR=$openssl_root_path"
89 if [ "$gui" = "false" ]; then
90 qmake_conf="$qmake_conf --disable-gui"
91 cmake_conf="$cmake_conf -DGUI=OFF"
103 if [ "$TRAVIS_OS_NAME" = "osx" ]; then
105 PATH="/usr/local/opt/ccache/libexec:$PATH"
107 brew update > /dev/null
109 brew install ccache colormake boost openssl qt@5 zlib
110 brew link --force qt@5 zlib
112 if [ "$build_system" = "cmake" ]; then
113 sudo ln -s /usr/local/opt/qt/mkspecs /usr/local/mkspecs
114 sudo ln -s /usr/local/opt/qt/plugins /usr/local/plugins
118 if [ "$TRAVIS_BRANCH" != "$coverity_branch" ]; then
119 export use_ccache=true
121 ccache -V && ccache --show-stats && ccache --zero-stats
124 if [ "$libt_branch" = "RC_1_2" ]; then
126 git clone --single-branch --branch RC_1_2 https://github.com/arvidn/libtorrent.git
128 git checkout tags/v1.2.12
131 -DCMAKE_BUILD_TYPE=Release \
132 -DCMAKE_CXX_STANDARD=17 \
133 -Ddeprecated-functions=OFF \
134 -DOPENSSL_ROOT_DIR="$openssl_root_path" \
139 elif [ "$libt_branch" = "RC_2_0" ]; then
141 git clone --single-branch --branch RC_2_0 https://github.com/arvidn/libtorrent.git
143 git checkout tags/v2.0.2
144 git submodule update --init --recursive
147 -DCMAKE_BUILD_TYPE=Release \
148 -DCMAKE_CXX_STANDARD=17 \
149 -Ddeprecated-functions=OFF \
150 -DOPENSSL_ROOT_DIR="$openssl_root_path" \
158 - if [ "$TRAVIS_BRANCH" = "$coverity_branch" ]; then exit ; fi # skip usual build when running coverity scan
160 cd "$TRAVIS_BUILD_DIR"
161 if [ "$build_system" = "qmake" ]; then
162 # scan only as lupdate is prone to hang
163 lupdate -extensions c,cpp,h,hpp,ui ./
165 ./configure $qmake_conf CXXFLAGS="$CXXFLAGS"
167 mkdir build && cd build
168 cmake $cmake_conf ../
174 - if [ "$gui" = "true" ]; then qbt_exe="qbittorrent" ; else qbt_exe="qbittorrent-nox" ; fi
175 - if [ "$TRAVIS_OS_NAME" = "linux" ]; then cd "$qbt_path/bin" ; fi
177 if [ "$TRAVIS_OS_NAME" = "osx" ]; then
178 if [ "$build_system" = "qmake" ]; then
179 macdeployqt "$TRAVIS_BUILD_DIR/src/$qbt_exe.app"
180 cd "$TRAVIS_BUILD_DIR/src/$qbt_exe.app/Contents/MacOS"
182 cd "$qbt_path/$qbt_exe.app/Contents/MacOS"
185 - ./$qbt_exe --version
188 - if [ "$use_ccache" = true ]; then ccache --show-stats ; fi