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'
50 - sourceline: 'ppa:beineri/opt-qt-5.14.2-focal'
52 # packages list: https://github.com/travis-ci/apt-package-safelist/blob/master/ubuntu-trusty
53 - [autoconf, automake, cmake, colormake]
54 - [libboost-dev, libboost-system-dev]
56 - [qt514base, qt514svg, qt514tools]
60 # only allow specific build for coverity scan, others will stop
61 - 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
63 - shopt -s expand_aliases
64 - alias make="colormake -j2" # Using nprocs/2 sometimes may fail (gcc is killed by system)
65 - qbt_path="$HOME/qbt_install"
66 - qmake_conf="$qmake_conf --prefix=$qbt_path"
67 - cmake_conf="$cmake_conf -DCMAKE_INSTALL_PREFIX=$qbt_path"
69 # options for specific branches
71 if [ "$TRAVIS_OS_NAME" = "linux" ]; then
72 # setup virtual display for after_success target
73 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 ;
74 # CMake from Kitware is installed in /usr/bin
75 # TravisCI installs its own cmake to another location which ovverides other installations
76 # if they don't call the new binary directly
77 alias cmake="/usr/bin/cmake"
80 PATH="/opt/qt514/bin:$PATH"
81 qmake_conf="$qmake_conf PKG_CONFIG_PATH=/opt/qt514/lib/pkgconfig:$PKG_CONFIG_PATH"
82 cmake_conf="$cmake_conf PKG_CONFIG_PATH=/opt/qt514/lib/pkgconfig:$PKG_CONFIG_PATH"
84 export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib"
87 if [ "$TRAVIS_OS_NAME" = "osx" ]; then
88 CXXFLAGS="$CXXFLAGS -Wno-unused-local-typedefs"
90 openssl_root_path="/usr/local/opt/openssl"
91 qmake_conf="$qmake_conf PKG_CONFIG_PATH=$openssl_root_path/lib/pkgconfig:$PKG_CONFIG_PATH"
92 cmake_conf="$cmake_conf -DOPENSSL_ROOT_DIR=$openssl_root_path"
95 if [ "$gui" = "false" ]; then
96 qmake_conf="$qmake_conf --disable-gui"
97 cmake_conf="$cmake_conf -DGUI=OFF"
109 if [ "$TRAVIS_OS_NAME" = "osx" ]; then
111 PATH="/usr/local/opt/ccache/libexec:$PATH"
113 brew update > /dev/null
115 brew install ccache colormake boost openssl qt@5 zlib
116 brew link --force qt@5 zlib
118 if [ "$build_system" = "cmake" ]; then
119 sudo ln -s /usr/local/opt/qt/mkspecs /usr/local/mkspecs
120 sudo ln -s /usr/local/opt/qt/plugins /usr/local/plugins
124 if [ "$TRAVIS_BRANCH" != "$coverity_branch" ]; then
125 export use_ccache=true
127 ccache -V && ccache --show-stats && ccache --zero-stats
130 if [ "$libt_branch" = "RC_1_2" ]; then
132 git clone --single-branch --branch RC_1_2 https://github.com/arvidn/libtorrent.git
134 git checkout tags/v1.2.13
137 -DCMAKE_BUILD_TYPE=Release \
138 -DCMAKE_CXX_STANDARD=17 \
139 -Ddeprecated-functions=OFF \
140 -DOPENSSL_ROOT_DIR="$openssl_root_path" \
145 elif [ "$libt_branch" = "RC_2_0" ]; then
147 git clone --single-branch --branch RC_2_0 https://github.com/arvidn/libtorrent.git
149 git checkout tags/v2.0.3
150 git submodule update --init --recursive
153 -DCMAKE_BUILD_TYPE=Release \
154 -DCMAKE_CXX_STANDARD=17 \
155 -Ddeprecated-functions=OFF \
156 -DOPENSSL_ROOT_DIR="$openssl_root_path" \
164 - if [ "$TRAVIS_BRANCH" = "$coverity_branch" ]; then exit ; fi # skip usual build when running coverity scan
166 cd "$TRAVIS_BUILD_DIR"
167 if [ "$build_system" = "qmake" ]; then
168 # scan only as lupdate is prone to hang
169 lupdate -extensions c,cpp,h,hpp,ui ./
171 ./configure $qmake_conf CXXFLAGS="$CXXFLAGS"
173 mkdir build && cd build
174 cmake $cmake_conf ../
180 - if [ "$gui" = "true" ]; then qbt_exe="qbittorrent" ; else qbt_exe="qbittorrent-nox" ; fi
181 - if [ "$TRAVIS_OS_NAME" = "linux" ]; then cd "$qbt_path/bin" ; fi
183 if [ "$TRAVIS_OS_NAME" = "osx" ]; then
184 if [ "$build_system" = "qmake" ]; then
185 macdeployqt "$TRAVIS_BUILD_DIR/src/$qbt_exe.app"
186 cd "$TRAVIS_BUILD_DIR/src/$qbt_exe.app/Contents/MacOS"
188 cd "$qbt_path/$qbt_exe.app/Contents/MacOS"
191 - ./$qbt_exe --version
194 - if [ "$use_ccache" = true ]; then ccache --show-stats ; fi