2015-07-29 07:23:12 +03:00
language : cpp
2013-07-02 07:55:58 +04:00
2015-09-01 09:48:10 +03:00
os :
- linux
- osx
2018-12-13 11:01:44 +03:00
dist : xenial
2013-07-02 07:55:58 +04:00
env :
2015-03-13 10:01:20 +03:00
matrix :
2015-06-28 09:16:32 +03:00
# Uncomment when Travis upgraded "Ubuntu 12.04 LTS" to a newer version whose repo will have a more up-to-date libtorrent package
2015-12-07 05:14:39 +03:00
#- lt_branch=dist gui=true
#- lt_branch=dist gui=false
2017-03-20 16:50:28 +03:00
- lt_branch=RC_1_0 gui=true build_system=cmake
- lt_branch=RC_1_0 gui=false build_system=cmake
- lt_branch=RC_1_0 gui=true build_system=qmake
- lt_branch=RC_1_0 gui=false build_system=qmake
2017-01-20 17:11:18 +03:00
global :
- secure : "OI9CUjj4lTb0HwwIZU5PbECU3hLlAL6KC8KsbwohG8/O3j5fLcnmDsK4Ad9us5cC39sS11Jcd1kDP2qRcCuST/glVNhLkcjKkiQerOfd5nQ/qL4JYfz/1mfP5mdpz9jHKzpLUIG+TXkbSTjP6VVmsb5KPT+3pKEdRFZB+Pu9+J8="
- coverity_branch : coverity_scan
2013-07-27 12:30:13 +04:00
2017-03-20 16:50:28 +03:00
matrix :
allow_failures :
- env : lt_branch=RC_1_0 gui=true build_system=cmake
- env : lt_branch=RC_1_0 gui=false build_system=cmake
2013-07-27 12:30:13 +04:00
branches :
except :
- search_encoding_windows
- v2_9_x
notifications :
email :
on_success : change
2015-03-13 10:01:20 +03:00
on_failure : change
2013-07-27 12:30:13 +04:00
2016-11-11 18:54:54 +03:00
cache :
ccache : true
directories :
- $HOME/hombebrew_cache
2016-03-17 09:14:57 +03:00
2015-07-29 07:23:12 +03:00
addons :
coverity_scan :
project :
name : "qbittorrent/qBittorrent"
description : "Build submitted via Travis CI"
2016-03-17 09:14:57 +03:00
build_command_prepend : "./bootstrap.sh && ./configure $qbtconf"
2015-07-29 07:23:12 +03:00
build_command : make
branch_pattern : $coverity_branch
notification_email : sledgehammer999@qbittorrent.org
apt :
2017-03-20 16:24:05 +03:00
sources :
2018-12-13 11:01:44 +03:00
# sources list: https://github.com/travis-ci/apt-source-safelist/blob/master/ubuntu.json
2017-03-20 16:24:05 +03:00
- sourceline : 'ppa:qbittorrent-team/qbittorrent-stable'
2015-07-29 07:23:12 +03:00
packages :
2018-12-13 11:01:44 +03:00
# packages list: https://github.com/travis-ci/apt-package-safelist/blob/master/ubuntu-trusty
2017-05-31 17:35:40 +03:00
- [ autoconf, automake, colormake]
2018-12-13 11:01:44 +03:00
- [ ninja-build]
2017-03-20 16:24:05 +03:00
- libssl-dev
2017-05-31 17:35:40 +03:00
- [ libboost-dev, libboost-system-dev]
2017-03-20 16:24:05 +03:00
- libtorrent-rasterbar-dev
2018-12-13 11:01:44 +03:00
- [ qtbase5-dev, qttools5-dev-tools, libqt5svg5-dev]
2017-04-19 12:23:50 +03:00
2013-07-27 12:30:13 +04:00
before_install :
2016-03-17 09:14:57 +03:00
# only allow specific build for coverity scan, others will stop
2017-04-24 20:01:18 +03:00
- if [ "$TRAVIS_BRANCH" = "$coverity_branch" ] && ! [ "$TRAVIS_OS_NAME" = "linux" -a "$lt_branch" = "RC_1_0" -a "$gui" = true -a "$build_system" = "qmake" ]; then exit ; fi
2015-03-13 10:01:20 +03:00
2013-07-27 12:30:13 +04:00
- shopt -s expand_aliases
2018-12-08 07:35:23 +03:00
- alias make="colormake -j2" # Using nprocs/2 sometimes may fail (gcc is killed by system)
2015-07-29 07:23:12 +03:00
- qbt_path="$HOME/qbt_install"
2018-01-03 02:49:37 +03:00
- |
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
qbtconf="$qbtconf --prefix="$qbt_path" PKG_CONFIG_PATH=/opt/qt55/lib/pkgconfig:$PKG_CONFIG_PATH"
else
2018-11-21 16:29:10 +03:00
qbtconf="$qbtconf --prefix="$qbt_path" PKG_CONFIG_PATH=/usr/local/opt/openssl/lib/pkgconfig:$PKG_CONFIG_PATH"
2018-12-08 07:35:23 +03:00
CXXFLAGS="$CXXFLAGS -Wno-unused-local-typedefs -Wno-inconsistent-missing-override"
2018-01-03 02:49:37 +03:00
fi
2016-03-17 09:14:57 +03:00
# options for specific branches
- if [ "$gui" = false ]; then qbtconf="$qbtconf --disable-gui" ; fi
- |
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
# setup virtual display for after_success target
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 ;
fi
2013-07-27 12:30:13 +04:00
2016-03-17 09:14:57 +03:00
# print settings
2015-06-28 09:16:32 +03:00
- echo $lt_branch
2013-07-27 12:30:13 +04:00
- echo $gui
2017-03-20 16:50:28 +03:00
- echo $build_system
2015-06-28 09:16:32 +03:00
- echo $ltconf
2015-07-29 07:23:12 +03:00
- echo $qbtconf
2017-04-19 12:23:50 +03:00
2013-07-02 07:55:58 +04:00
install :
2017-04-19 12:23:50 +03:00
#- |
#if [ "$TRAVIS_OS_NAME" = "linux" ]; then
2016-03-17 09:14:57 +03:00
# build libtorrent from source
#if [ "$lt_branch" != "dist" ]; then
2017-04-19 12:23:50 +03:00
#cd "$HOME" && pwd && git clone --depth 1 https://github.com/arvidn/libtorrent.git --branch $lt_branch
#cd libtorrent && ./autotool.sh && ./configure $ltconf && make install
#fi
#fi
2016-03-17 09:14:57 +03:00
- |
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
2017-04-19 12:23:50 +03:00
# dependencies
brew update > /dev/null
brew outdated "pkg-config" || brew upgrade "pkg-config"
2018-11-21 16:29:10 +03:00
brew install colormake ccache zlib qt openssl libtorrent-rasterbar
2017-07-12 19:54:24 +03:00
PATH="/usr/local/opt/ccache/libexec:$PATH"
brew link --force zlib qt
2017-04-19 12:23:50 +03:00
2017-03-20 16:50:28 +03:00
if [ "$build_system" = "cmake" ]; then
2017-07-12 19:54:24 +03:00
brew outdated cmake || brew upgrade cmake
brew install ninja
2017-04-19 12:23:50 +03:00
2018-10-14 08:47:00 +03:00
sudo ln -s /usr/local/opt/qt/mkspecs /usr/local/mkspecs
sudo ln -s /usr/local/opt/qt/plugins /usr/local/plugins
2017-03-20 16:50:28 +03:00
2018-11-21 16:29:10 +03:00
MY_CMAKE_OPENSSL_HINT="-DOPENSSL_ROOT_DIR=/usr/local/opt/openssl/"
fi
2017-04-19 12:23:50 +03:00
fi
- |
if [ "$TRAVIS_BRANCH" != "$coverity_branch" ]; then
export use_ccache=true
2018-12-13 11:01:44 +03:00
ccache -M 512M
2017-04-19 12:23:50 +03:00
ccache -V && ccache --show-stats && ccache --zero-stats
2016-03-17 09:14:57 +03:00
fi
2013-07-02 07:55:58 +04:00
script :
2016-03-17 09:14:57 +03:00
- if [ "$TRAVIS_BRANCH" = "$coverity_branch" ]; then exit ; fi # skip usual build when running coverity scan
2016-05-03 21:14:31 +03:00
- |
2017-03-20 16:50:28 +03:00
cd "$TRAVIS_BUILD_DIR"
if [ "$build_system" = "cmake" ]; then
mkdir build
cd build
2018-06-05 04:03:38 +03:00
if [ "$gui" = "false" ]; then
DISABLE_GUI_OPTION="-DCMAKE_DISABLE_FIND_PACKAGE_Qt5Widgets=ON"
fi
cmake $DISABLE_GUI_OPTION -DCMAKE_INSTALL_PREFIX="$qbt_path" "$MY_CMAKE_OPENSSL_HINT" \
2017-05-31 16:06:53 +03:00
-G "Ninja" -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE ..
BUILD_TOOL="ninja"
2017-03-20 16:50:28 +03:00
fi
if [ "$build_system" = "qmake" ]; then
2018-12-08 07:35:23 +03:00
./bootstrap.sh && ./configure $qbtconf CXXFLAGS="$CXXFLAGS"
2017-05-31 16:06:53 +03:00
BUILD_TOOL="make"
2016-05-03 21:14:31 +03:00
fi
2017-05-31 16:06:53 +03:00
- $BUILD_TOOL && $BUILD_TOOL install
2015-03-13 10:01:20 +03:00
2013-07-27 12:30:13 +04:00
after_success :
2015-09-01 09:48:10 +03:00
- if [ "$gui" = true ]; then qbt_exe="qbittorrent" ; else qbt_exe="qbittorrent-nox" ; fi
2016-03-17 09:14:57 +03:00
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then cd "$qbt_path/bin" ; fi
2017-03-08 01:50:11 +03:00
- |
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
2017-07-12 19:54:24 +03: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 01:50:11 +03:00
fi
2015-09-01 09:48:10 +03:00
- ./$qbt_exe --version
2015-03-13 10:01:20 +03:00
2015-07-29 07:23:12 +03:00
after_script :
2016-03-17 09:14:57 +03:00
- if [ "$use_ccache" = true ]; then ccache --show-stats ; fi