2015-07-29 12:23:12 +08:00
language : cpp
2013-07-02 11:55:58 +08:00
2015-09-01 14:48:10 +08:00
os :
- linux
- osx
2020-04-28 08:26:47 +08:00
dist : bionic
2018-12-13 16:01:44 +08:00
2013-07-02 11:55:58 +08:00
env :
2015-03-13 15:01:20 +08:00
matrix :
2019-03-19 14:20:21 +08:00
- libt_branch=RC_1_2 gui=true build_system=qmake
- libt_branch=RC_1_2 gui=false build_system=qmake
- libt_branch=RC_1_2 gui=true build_system=cmake
- libt_branch=RC_1_2 gui=false build_system=cmake
2019-02-13 12:51:06 +08:00
- libt_branch=RC_1_1 gui=true build_system=qmake
- libt_branch=RC_1_1 gui=false build_system=qmake
- libt_branch=RC_1_1 gui=true build_system=cmake
- libt_branch=RC_1_1 gui=false build_system=cmake
2017-01-20 22:11:18 +08:00
global :
- secure : "OI9CUjj4lTb0HwwIZU5PbECU3hLlAL6KC8KsbwohG8/O3j5fLcnmDsK4Ad9us5cC39sS11Jcd1kDP2qRcCuST/glVNhLkcjKkiQerOfd5nQ/qL4JYfz/1mfP5mdpz9jHKzpLUIG+TXkbSTjP6VVmsb5KPT+3pKEdRFZB+Pu9+J8="
- coverity_branch : coverity_scan
2013-07-27 16:30:13 +08:00
2017-03-20 21:50:28 +08:00
matrix :
allow_failures :
2019-03-19 14:20:21 +08:00
- env : libt_branch=RC_1_2 gui=true build_system=cmake
- env : libt_branch=RC_1_2 gui=false build_system=cmake
2019-02-13 12:51:06 +08:00
- env : libt_branch=RC_1_1 gui=true build_system=cmake
- env : libt_branch=RC_1_1 gui=false build_system=cmake
2017-03-20 21:50:28 +08:00
2013-07-27 16:30:13 +08:00
branches :
except :
- search_encoding_windows
- v2_9_x
notifications :
email :
on_success : change
2015-03-13 15:01:20 +08:00
on_failure : change
2013-07-27 16:30:13 +08:00
2016-11-11 23:54:54 +08:00
cache :
ccache : true
directories :
2019-02-24 02:30:42 +08:00
- $HOME/travis/deb
- $HOME/travis/brew
2016-03-17 14:14:57 +08:00
2015-07-29 12:23:12 +08:00
addons :
coverity_scan :
project :
name : "qbittorrent/qBittorrent"
description : "Build submitted via Travis CI"
2019-02-13 12:51:06 +08:00
build_command_prepend : "./bootstrap.sh && ./configure $qmake_conf"
2019-07-18 14:26:12 +08:00
build_command : "make -j2"
2015-07-29 12:23:12 +08:00
branch_pattern : $coverity_branch
notification_email : sledgehammer999@qbittorrent.org
apt :
2017-03-20 21:24:05 +08:00
sources :
2018-12-13 16:01:44 +08:00
# sources list: https://github.com/travis-ci/apt-source-safelist/blob/master/ubuntu.json
2020-04-18 07:58:08 +08:00
- sourceline : 'ppa:qbittorrent-team/qbt-libtorrent-travisci'
2020-04-28 21:02:55 +08:00
- sourceline : 'deb https://apt.kitware.com/ubuntu/ bionic main'
key_url : 'https://apt.kitware.com/keys/kitware-archive-latest.asc'
2015-07-29 12:23:12 +08:00
packages :
2018-12-13 16:01:44 +08:00
# packages list: https://github.com/travis-ci/apt-package-safelist/blob/master/ubuntu-trusty
2020-04-28 21:02:55 +08:00
- [ autoconf, automake, cmake, colormake]
2017-05-31 22:35:40 +08:00
- [ libboost-dev, libboost-system-dev]
2019-02-13 12:51:06 +08:00
- libssl-dev
2020-04-28 08:26:47 +08:00
- [ qtbase5-dev, libqt5svg5-dev, qttools5-dev]
2019-02-13 12:51:06 +08:00
- zlib1g-dev
2017-04-19 17:23:50 +08:00
2013-07-27 16:30:13 +08:00
before_install :
2016-03-17 14:14:57 +08:00
# only allow specific build for coverity scan, others will stop
2019-03-19 14:20:21 +08:00
- 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
2015-03-13 15:01:20 +08:00
2013-07-27 16:30:13 +08:00
- shopt -s expand_aliases
2018-12-08 12:35:23 +08:00
- alias make="colormake -j2" # Using nprocs/2 sometimes may fail (gcc is killed by system)
2015-07-29 12:23:12 +08:00
- qbt_path="$HOME/qbt_install"
2019-02-13 12:51:06 +08:00
- qmake_conf="$qmake_conf --prefix=$qbt_path"
- cmake_conf="$cmake_conf -DCMAKE_INSTALL_PREFIX=$qbt_path"
2016-03-17 14:14:57 +08:00
# options for specific branches
- |
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
# setup virtual display for after_success target
2019-02-13 12:51:06 +08:00
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 ;
2019-03-19 14:20:21 +08:00
2019-02-13 12:51:06 +08:00
fi
- |
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
2019-07-18 15:10:14 +08:00
CXXFLAGS="$CXXFLAGS -Wno-unused-local-typedefs"
2019-02-13 12:51:06 +08:00
openssl_root_path="/usr/local/opt/openssl"
qmake_conf="$qmake_conf PKG_CONFIG_PATH=$openssl_root_path/lib/pkgconfig:$PKG_CONFIG_PATH"
cmake_conf="$cmake_conf -DOPENSSL_ROOT_DIR=$openssl_root_path"
fi
- |
if [ "$gui" = "false" ]; then
qmake_conf="$qmake_conf --disable-gui"
cmake_conf="$cmake_conf -DCMAKE_DISABLE_FIND_PACKAGE_Qt5Widgets=ON"
2016-03-17 14:14:57 +08:00
fi
2013-07-27 16:30:13 +08:00
2016-03-17 14:14:57 +08:00
# print settings
2019-02-13 12:51:06 +08:00
- echo $libt_branch
2013-07-27 16:30:13 +08:00
- echo $gui
2017-03-20 21:50:28 +08:00
- echo $build_system
2019-02-13 12:51:06 +08:00
- echo $qmake_conf
- echo $cmake_conf
2017-04-19 17:23:50 +08:00
2013-07-02 11:55:58 +08:00
install :
2016-03-17 14:14:57 +08:00
- |
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
2017-04-19 17:23:50 +08:00
# dependencies
2017-07-13 00:54:24 +08:00
PATH="/usr/local/opt/ccache/libexec:$PATH"
2017-04-19 17:23:50 +08:00
2019-04-09 15:38:46 +08:00
brew update > /dev/null
2019-05-13 07:29:39 +08:00
brew install ccache colormake boost openssl qt zlib
2019-02-13 12:51:06 +08:00
brew link --force qt zlib
2017-04-19 17:23:50 +08:00
2019-02-13 12:51:06 +08:00
if [ "$build_system" = "cmake" ]; then
2018-10-14 13:47:00 +08:00
sudo ln -s /usr/local/opt/qt/mkspecs /usr/local/mkspecs
sudo ln -s /usr/local/opt/qt/plugins /usr/local/plugins
2018-11-21 21:29:10 +08:00
fi
2017-04-19 17:23:50 +08:00
fi
- |
if [ "$TRAVIS_BRANCH" != "$coverity_branch" ]; then
export use_ccache=true
2018-12-13 16:01:44 +08:00
ccache -M 512M
2017-04-19 17:23:50 +08:00
ccache -V && ccache --show-stats && ccache --zero-stats
2016-03-17 14:14:57 +08:00
fi
2019-02-13 12:51:06 +08:00
- |
2020-04-18 07:58:08 +08:00
if [ "$libt_branch" = "RC_1_1" ] && [ "$TRAVIS_OS_NAME" = "linux" ]; then
2019-02-24 02:30:42 +08:00
wget https://builds.shiki.hu/travis/deb/version
if ! cmp --quiet "version" "$HOME/travis/deb/version" ; then
echo "Cached files are different from server. Downloading new ones."
# First delete old files
rm -r "$HOME/travis/deb"
mkdir "$HOME/travis/deb"
cp "version" $HOME/travis/deb
cd "$HOME/travis/deb"
2020-04-18 07:58:08 +08:00
wget https://builds.shiki.hu/travis/deb/libtorrent-rasterbar-dev_1.1.x_amd64.deb
wget https://builds.shiki.hu/travis/deb/libtorrent-rasterbar9_1.1.x_amd64.deb
2019-02-24 02:30:42 +08:00
fi
2019-03-19 14:20:21 +08:00
2020-04-18 07:58:08 +08:00
sudo dpkg -i "$HOME/travis/deb/libtorrent-rasterbar-dev_1.1.x_amd64.deb" "$HOME/travis/deb/libtorrent-rasterbar9_1.1.x_amd64.deb"
fi
- |
if [ "$libt_branch" = "RC_1_2" ] && [ "$TRAVIS_OS_NAME" = "linux" ]; then
# Will install latest 1.2.x daily build from the PPA
sudo apt-get -y install libtorrent-rasterbar-dev
2019-02-24 02:30:42 +08:00
fi
2019-06-07 14:11:09 +08:00
- |
2019-05-13 07:29:39 +08:00
if [ "$libt_branch" = "RC_1_1" ] && [ "$TRAVIS_OS_NAME" = "osx" ]; then
wget https://builds.shiki.hu/travis/brew/1_1/version
if ! cmp --quiet "version" "$HOME/travis/brew/1_1/version" ; then
echo "Cached files are different from server. Downloading new ones."
# First delete old files
rm -r "$HOME/travis/brew/1_1"
mkdir "$HOME/travis/brew/1_1"
cp "version" $HOME/travis/brew/1_1
cd "$HOME/travis/brew/1_1"
wget https://builds.shiki.hu/travis/brew/1_1/libtorrent-rasterbar.rb
wget https://builds.shiki.hu/travis/brew/1_1/bd36a4b440aa138a88e375c1a3b672f1a1bc6606e7866fc3415b6b98fa49e771--libtorrent-rasterbar-1.1.13.high_sierra.bottle.tar.gz
fi
# Copy custom libtorrent bottle to homebrew's download cache so it can find and install it
# Also install our custom libtorrent formula by passing the local path to it
# These 2 files are restored from Travis' cache.
cp "$HOME/travis/brew/1_1/bd36a4b440aa138a88e375c1a3b672f1a1bc6606e7866fc3415b6b98fa49e771--libtorrent-rasterbar-1.1.13.high_sierra.bottle.tar.gz" "$(brew --cache)/downloads"
brew uninstall libtorrent-rasterbar
brew install "$HOME/travis/brew/1_1/libtorrent-rasterbar.rb"
# NOTE about the bottle name
# The part before the "--" characters is a sha256 hash of the string
# of the URL homebrew itself would use to download the bottle.
# In this case the URL is the following:
# http://127.0.0.1/libtorrent-rasterbar-1.1.13.high_sierra.bottle.tar.gz
fi
2019-02-24 02:30:42 +08:00
- |
if [ "$libt_branch" = "RC_1_2" ] && [ "$TRAVIS_OS_NAME" = "osx" ]; then
wget https://builds.shiki.hu/travis/brew/version
if ! cmp --quiet "version" "$HOME/travis/brew/version" ; then
echo "Cached files are different from server. Downloading new ones."
# First delete old files
rm -r "$HOME/travis/brew"
mkdir "$HOME/travis/brew"
cp "version" $HOME/travis/brew
cd "$HOME/travis/brew"
wget https://builds.shiki.hu/travis/brew/libtorrent-rasterbar.rb
2020-04-25 10:41:19 +08:00
wget https://builds.shiki.hu/travis/brew/f01f8d840b6eaf05df8df811815128ae6e7227977b1cba4825f0a1fb73a4d9f0--libtorrent-rasterbar-1.2.6.high_sierra.bottle.tar.gz
2019-02-24 02:30:42 +08:00
fi
# Copy custom libtorrent bottle to homebrew's download cache so it can find and install it
# Also install our custom libtorrent formula by passing the local path to it
# These 2 files are restored from Travis' cache.
2020-04-25 10:41:19 +08:00
cp "$HOME/travis/brew/f01f8d840b6eaf05df8df811815128ae6e7227977b1cba4825f0a1fb73a4d9f0--libtorrent-rasterbar-1.2.6.high_sierra.bottle.tar.gz" "$(brew --cache)/downloads"
2019-02-24 02:30:42 +08:00
brew uninstall libtorrent-rasterbar
brew install "$HOME/travis/brew/libtorrent-rasterbar.rb"
2019-03-19 14:20:21 +08:00
2019-02-24 02:30:42 +08:00
# NOTE about the bottle name
# The part before the "--" characters is a sha256 hash of the string
# of the URL homebrew itself would use to download the bottle.
# In this case the URL is the following:
2020-04-25 10:41:19 +08:00
# http://127.0.0.1/libtorrent-rasterbar-1.2.6.high_sierra.bottle.tar.gz
2019-02-13 12:51:06 +08:00
fi
2013-07-02 11:55:58 +08:00
script :
2016-03-17 14:14:57 +08:00
- if [ "$TRAVIS_BRANCH" = "$coverity_branch" ]; then exit ; fi # skip usual build when running coverity scan
2016-05-04 02:14:31 +08:00
- |
2017-03-20 21:50:28 +08:00
cd "$TRAVIS_BUILD_DIR"
if [ "$build_system" = "qmake" ]; then
2019-11-11 13:24:33 +08:00
# scan only as lupdate is prone to hang
lupdate -extensions c,cpp,h,hpp,ui ./
2019-02-13 12:51:06 +08:00
./bootstrap.sh
./configure $qmake_conf CXXFLAGS="$CXXFLAGS"
else
mkdir build && cd build
cmake $cmake_conf ../
2016-05-04 02:14:31 +08:00
fi
2019-02-13 12:51:06 +08:00
- make && make install
2015-03-13 15:01:20 +08:00
2013-07-27 16:30:13 +08:00
after_success :
2019-02-13 12:51:06 +08:00
- if [ "$gui" = "true" ]; then qbt_exe="qbittorrent" ; else qbt_exe="qbittorrent-nox" ; fi
2016-03-17 14:14:57 +08:00
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then cd "$qbt_path/bin" ; fi
2017-03-08 06:50:11 +08:00
- |
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
2017-07-13 00:54:24 +08:00
if [ "$build_system" = "qmake" ]; then
macdeployqt "$TRAVIS_BUILD_DIR/src/$qbt_exe.app"
cd "$TRAVIS_BUILD_DIR/src/$qbt_exe.app/Contents/MacOS"
else
cd "$qbt_path/$qbt_exe.app/Contents/MacOS"
fi
2017-03-08 06:50:11 +08:00
fi
2015-09-01 14:48:10 +08:00
- ./$qbt_exe --version
2015-03-13 15:01:20 +08:00
2015-07-29 12:23:12 +08:00
after_script :
2016-03-17 14:14:57 +08:00
- if [ "$use_ccache" = true ]; then ccache --show-stats ; fi