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
15 - libt_branch=RC_1_1 gui=true build_system=qmake
16 - libt_branch=RC_1_1 gui=false build_system=qmake
17 - libt_branch=RC_1_1 gui=true build_system=cmake
18 - libt_branch=RC_1_1 gui=false build_system=cmake
20 - secure: "OI9CUjj4lTb0HwwIZU5PbECU3hLlAL6KC8KsbwohG8/O3j5fLcnmDsK4Ad9us5cC39sS11Jcd1kDP2qRcCuST/glVNhLkcjKkiQerOfd5nQ/qL4JYfz/1mfP5mdpz9jHKzpLUIG+TXkbSTjP6VVmsb5KPT+3pKEdRFZB+Pu9+J8="
21 - coverity_branch: coverity_scan
25 - env: libt_branch=RC_1_2 gui=true build_system=cmake
26 - env: libt_branch=RC_1_2 gui=false build_system=cmake
27 - env: libt_branch=RC_1_1 gui=true build_system=cmake
28 - env: libt_branch=RC_1_1 gui=false build_system=cmake
32 - search_encoding_windows
49 name: "qbittorrent/qBittorrent"
50 description: "Build submitted via Travis CI"
51 build_command_prepend: "./bootstrap.sh && ./configure $qmake_conf"
52 build_command: "make -j2"
53 branch_pattern: $coverity_branch
54 notification_email: sledgehammer999@qbittorrent.org
57 # sources list: https://github.com/travis-ci/apt-source-safelist/blob/master/ubuntu.json
58 - sourceline: 'ppa:qbittorrent-team/qbittorrent-stable'
59 - sourceline: 'ppa:beineri/opt-qt59-xenial'
61 # packages list: https://github.com/travis-ci/apt-package-safelist/blob/master/ubuntu-trusty
62 - [autoconf, automake, colormake]
63 - [libboost-dev, libboost-system-dev]
65 - libtorrent-rasterbar-dev
66 - [qt59base, qt59svg, qt59tools]
68 # required for Qt 5.9 from 'beineri' PPA
72 # only allow specific build for coverity scan, others will stop
73 - 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
75 - shopt -s expand_aliases
76 - alias make="colormake -j2" # Using nprocs/2 sometimes may fail (gcc is killed by system)
77 - qbt_path="$HOME/qbt_install"
78 - qmake_conf="$qmake_conf --prefix=$qbt_path"
79 - cmake_conf="$cmake_conf -DCMAKE_INSTALL_PREFIX=$qbt_path"
81 # options for specific branches
83 if [ "$TRAVIS_OS_NAME" = "linux" ]; then
84 # setup virtual display for after_success target
85 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 ;
88 PATH=/opt/qt59/bin:${PATH}
89 qmake_conf="$qmake_conf PKG_CONFIG_PATH=/opt/qt59/lib/pkgconfig:$PKG_CONFIG_PATH"
90 cmake_conf="$cmake_conf PKG_CONFIG_PATH=/opt/qt59/lib/pkgconfig:$PKG_CONFIG_PATH"
93 if [ "$TRAVIS_OS_NAME" = "osx" ]; then
94 CXXFLAGS="$CXXFLAGS -Wno-unused-local-typedefs"
96 openssl_root_path="/usr/local/opt/openssl"
97 qmake_conf="$qmake_conf PKG_CONFIG_PATH=$openssl_root_path/lib/pkgconfig:$PKG_CONFIG_PATH"
98 cmake_conf="$cmake_conf -DOPENSSL_ROOT_DIR=$openssl_root_path"
101 if [ "$gui" = "false" ]; then
102 qmake_conf="$qmake_conf --disable-gui"
103 cmake_conf="$cmake_conf -DCMAKE_DISABLE_FIND_PACKAGE_Qt5Widgets=ON"
115 if [ "$TRAVIS_OS_NAME" = "osx" ]; then
117 PATH="/usr/local/opt/ccache/libexec:$PATH"
119 brew update > /dev/null
120 brew install ccache colormake boost openssl qt zlib
121 brew link --force qt zlib
123 if [ "$build_system" = "cmake" ]; then
124 sudo ln -s /usr/local/opt/qt/mkspecs /usr/local/mkspecs
125 sudo ln -s /usr/local/opt/qt/plugins /usr/local/plugins
129 if [ "$TRAVIS_BRANCH" != "$coverity_branch" ]; then
130 export use_ccache=true
132 ccache -V && ccache --show-stats && ccache --zero-stats
135 if [ "$libt_branch" = "RC_1_2" ] && [ "$TRAVIS_OS_NAME" = "linux" ]; then
136 wget https://builds.shiki.hu/travis/deb/version
137 if ! cmp --quiet "version" "$HOME/travis/deb/version" ; then
138 echo "Cached files are different from server. Downloading new ones."
139 # First delete old files
140 rm -r "$HOME/travis/deb"
141 mkdir "$HOME/travis/deb"
142 cp "version" $HOME/travis/deb
143 cd "$HOME/travis/deb"
144 wget https://builds.shiki.hu/travis/deb/libtorrent-rasterbar-dev_1.2.x_amd64.deb
145 wget https://builds.shiki.hu/travis/deb/libtorrent-rasterbar10_1.2.x_amd64.deb
148 sudo dpkg -i "$HOME/travis/deb/libtorrent-rasterbar-dev_1.2.x_amd64.deb" "$HOME/travis/deb/libtorrent-rasterbar10_1.2.x_amd64.deb"
151 if [ "$libt_branch" = "RC_1_1" ] && [ "$TRAVIS_OS_NAME" = "osx" ]; then
152 wget https://builds.shiki.hu/travis/brew/1_1/version
153 if ! cmp --quiet "version" "$HOME/travis/brew/1_1/version" ; then
154 echo "Cached files are different from server. Downloading new ones."
155 # First delete old files
156 rm -r "$HOME/travis/brew/1_1"
157 mkdir "$HOME/travis/brew/1_1"
158 cp "version" $HOME/travis/brew/1_1
159 cd "$HOME/travis/brew/1_1"
160 wget https://builds.shiki.hu/travis/brew/1_1/libtorrent-rasterbar.rb
161 wget https://builds.shiki.hu/travis/brew/1_1/bd36a4b440aa138a88e375c1a3b672f1a1bc6606e7866fc3415b6b98fa49e771--libtorrent-rasterbar-1.1.13.high_sierra.bottle.tar.gz
163 # Copy custom libtorrent bottle to homebrew's download cache so it can find and install it
164 # Also install our custom libtorrent formula by passing the local path to it
165 # These 2 files are restored from Travis' cache.
166 cp "$HOME/travis/brew/1_1/bd36a4b440aa138a88e375c1a3b672f1a1bc6606e7866fc3415b6b98fa49e771--libtorrent-rasterbar-1.1.13.high_sierra.bottle.tar.gz" "$(brew --cache)/downloads"
167 brew uninstall libtorrent-rasterbar
168 brew install "$HOME/travis/brew/1_1/libtorrent-rasterbar.rb"
170 # NOTE about the bottle name
171 # The part before the "--" characters is a sha256 hash of the string
172 # of the URL homebrew itself would use to download the bottle.
173 # In this case the URL is the following:
174 # http://127.0.0.1/libtorrent-rasterbar-1.1.13.high_sierra.bottle.tar.gz
177 if [ "$libt_branch" = "RC_1_2" ] && [ "$TRAVIS_OS_NAME" = "osx" ]; then
178 wget https://builds.shiki.hu/travis/brew/version
179 if ! cmp --quiet "version" "$HOME/travis/brew/version" ; then
180 echo "Cached files are different from server. Downloading new ones."
181 # First delete old files
182 rm -r "$HOME/travis/brew"
183 mkdir "$HOME/travis/brew"
184 cp "version" $HOME/travis/brew
185 cd "$HOME/travis/brew"
186 wget https://builds.shiki.hu/travis/brew/libtorrent-rasterbar.rb
187 wget https://builds.shiki.hu/travis/brew/6e4eb13f70df35e8fc7ff41883fef3e5c7b535dd55c78cd2ce1eae3fb4288e21--libtorrent-rasterbar-1.2.0.high_sierra.bottle.tar.gz
189 # Copy custom libtorrent bottle to homebrew's download cache so it can find and install it
190 # Also install our custom libtorrent formula by passing the local path to it
191 # These 2 files are restored from Travis' cache.
192 cp "$HOME/travis/brew/6e4eb13f70df35e8fc7ff41883fef3e5c7b535dd55c78cd2ce1eae3fb4288e21--libtorrent-rasterbar-1.2.0.high_sierra.bottle.tar.gz" "$(brew --cache)/downloads"
193 brew uninstall libtorrent-rasterbar
194 brew install "$HOME/travis/brew/libtorrent-rasterbar.rb"
196 # NOTE about the bottle name
197 # The part before the "--" characters is a sha256 hash of the string
198 # of the URL homebrew itself would use to download the bottle.
199 # In this case the URL is the following:
200 # http://127.0.0.1/libtorrent-rasterbar-1.2.0.high_sierra.bottle.tar.gz
204 - if [ "$TRAVIS_BRANCH" = "$coverity_branch" ]; then exit ; fi # skip usual build when running coverity scan
206 cd "$TRAVIS_BUILD_DIR"
207 if [ "$build_system" = "qmake" ]; then
209 ./configure $qmake_conf CXXFLAGS="$CXXFLAGS"
211 mkdir build && cd build
212 cmake $cmake_conf ../
214 - make && make install
217 - if [ "$gui" = "true" ]; then qbt_exe="qbittorrent" ; else qbt_exe="qbittorrent-nox" ; fi
218 - if [ "$TRAVIS_OS_NAME" = "linux" ]; then cd "$qbt_path/bin" ; fi
220 if [ "$TRAVIS_OS_NAME" = "osx" ]; then
221 if [ "$build_system" = "qmake" ]; then
222 macdeployqt "$TRAVIS_BUILD_DIR/src/$qbt_exe.app"
223 cd "$TRAVIS_BUILD_DIR/src/$qbt_exe.app/Contents/MacOS"
225 cd "$qbt_path/$qbt_exe.app/Contents/MacOS"
228 - ./$qbt_exe --version
231 - if [ "$use_ccache" = true ]; then ccache --show-stats ; fi