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
osx_image : xcode7
2013-07-02 11:55:58 +08:00
env :
2015-03-13 15:01:20 +08:00
matrix :
2015-06-28 14:16:32 +08: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 10:14:39 +08:00
#- lt_branch=dist gui=true
#- lt_branch=dist gui=false
- lt_branch=RC_1_0 qt=5 gui=true
- lt_branch=RC_1_0 qt=5 gui=false
- lt_branch=RC_1_0 qt=4 gui=true
- lt_branch=RC_1_0 qt=4 gui=false
2015-03-13 15:01:20 +08:00
global :
2015-06-17 05:19:00 +08:00
- secure : "OI9CUjj4lTb0HwwIZU5PbECU3hLlAL6KC8KsbwohG8/O3j5fLcnmDsK4Ad9us5cC39sS11Jcd1kDP2qRcCuST/glVNhLkcjKkiQerOfd5nQ/qL4JYfz/1mfP5mdpz9jHKzpLUIG+TXkbSTjP6VVmsb5KPT+3pKEdRFZB+Pu9+J8="
2015-03-13 15:01:20 +08:00
- coverity_branch : coverity_scan
2013-07-27 16:30:13 +08:00
2015-10-09 07:26:53 +08:00
matrix :
exclude :
- os : linux
2015-12-07 10:14:39 +08:00
env : lt_branch=RC_1_0 qt=5 gui=true
2015-10-09 07:26:53 +08:00
- os : linux
2015-12-07 10:14:39 +08:00
env : lt_branch=RC_1_0 qt=5 gui=false
2015-10-09 07:26:53 +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
2015-07-29 12:23:12 +08:00
# container-based builds
sudo : false
2015-09-01 14:48:10 +08:00
# TODO: osx builder does not enable cache yet, see: https://github.com/travis-ci/travis-ci/issues/4011
2015-07-29 12:23:12 +08:00
cache :
directories :
- $HOME/.ccache
addons :
coverity_scan :
project :
name : "qbittorrent/qBittorrent"
description : "Build submitted via Travis CI"
2015-10-06 04:39:43 +08:00
build_command_prepend : "./bootstrap.sh && ./configure $qbtconf && echo QMAKE_CC=$CC >> conf.pri && echo QMAKE_CXX=$CXX >> conf.pri"
2015-07-29 12:23:12 +08:00
build_command : make
branch_pattern : $coverity_branch
notification_email : sledgehammer999@qbittorrent.org
apt :
2015-09-20 20:45:40 +08:00
sources :
# sources list: https://github.com/travis-ci/apt-source-whitelist/blob/master/ubuntu.json
- ubuntu-toolchain-r-test
- boost-latest
2015-07-29 12:23:12 +08:00
packages :
# packages list: https://github.com/travis-ci/apt-package-whitelist/blob/master/ubuntu-precise
- autoconf
- automake
- colormake
2015-09-20 20:45:40 +08:00
- g++-4.8
2015-07-29 12:23:12 +08:00
- libssl-dev
2015-09-20 20:45:40 +08:00
- libboost1.55-dev
- libboost-system1.55-dev
2015-07-29 12:23:12 +08:00
- libqt4-dev
# Uncomment when Travis upgraded "Ubuntu 12.04 LTS" to a newer version whose repo will have a more up-to-date libtorrent package
#- libtorrent-rasterbar6
2013-07-27 16:30:13 +08:00
before_install :
2015-06-28 14:16:32 +08:00
# Only allow specific build for coverity scan, others will stop
2015-09-01 14:48:10 +08:00
- if [ "$TRAVIS_BRANCH" = "$coverity_branch" ] && ! [ "$TRAVIS_OS_NAME" = "linux" -a "$lt_branch" = "RC_1_0" -a "$gui" = true ]; then exit ; fi
2015-03-13 15:01:20 +08:00
2013-07-27 16:30:13 +08:00
- shopt -s expand_aliases
2015-09-20 20:45:40 +08:00
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then export CC=gcc-4.8 CXX=g++-4.8 ; fi
2015-09-01 14:48:10 +08:00
- if [ "$TRAVIS_BRANCH" != "$coverity_branch" -a "$TRAVIS_OS_NAME" = "linux" ]; then dpkg-query -L ccache && export PATH="/usr/lib/ccache/:$PATH" ; fi
2015-07-29 12:23:12 +08:00
- alias make="colormake -j3" # Using nprocs/2 sometimes may fail (gcc is killed by system)
- libt_path="$HOME/libt_install"
- qbt_path="$HOME/qbt_install"
2015-07-31 04:45:35 +08:00
- ltconf="$ltconf --prefix="$libt_path" --disable-geoip"
2015-11-23 03:43:33 +08:00
- qbtconf="$qbtconf --prefix="$qbt_path" --with-qt4 PKG_CONFIG_PATH="$libt_path/lib/pkgconfig":$PKG_CONFIG_PATH"
2013-07-27 16:30:13 +08:00
2015-07-29 12:23:12 +08:00
# Options for specific branches
2013-07-27 16:30:13 +08:00
# Also setup a virtual display for after_success target when gui == true
2015-09-01 14:48:10 +08:00
- if [ "$gui" = false ]; then qbtconf="$qbtconf --disable-gui" ;
elif [ "$TRAVIS_OS_NAME" = "linux" ]; 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
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then qbtconf="$qbtconf --disable-qt-dbus" ; fi
2015-12-07 10:14:39 +08:00
- if [ "$TRAVIS_OS_NAME" = "osx" -a "$qt" = 4 ]; then brew install qt; fi
- if [ "$TRAVIS_OS_NAME" = "osx" -a "$qt" = 5 ]; then qbtconf="$qbtconf --with-qt4=no" ; fi
2013-07-27 16:30:13 +08:00
2015-06-28 14:16:32 +08:00
# Print settings
- echo $lt_branch
2013-07-27 16:30:13 +08:00
- echo $gui
2015-06-28 14:16:32 +08:00
- echo $ltconf
2015-07-29 12:23:12 +08:00
- echo $qbtconf
2015-09-01 14:48:10 +08:00
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then ccache -V && ccache --show-stats && ccache --zero-stats ; fi
2013-07-02 11:55:58 +08:00
install :
2015-09-01 14:48:10 +08:00
- if [ "$TRAVIS_OS_NAME" = "linux" -a "$lt_branch" != "dist" ]; then cd "$HOME" && pwd && git clone --depth 1 https://github.com/arvidn/libtorrent.git --branch $lt_branch ; fi
- if [ "$TRAVIS_OS_NAME" = "linux" -a "$lt_branch" != "dist" ]; then cd libtorrent && ./autotool.sh && ./configure $ltconf && make install && cd "$TRAVIS_BUILD_DIR" ; fi
2015-12-07 10:14:39 +08:00
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew update > /dev/null && brew install colormake libtorrent-rasterbar ; fi
- if [ "$TRAVIS_OS_NAME" = "osx" -a "$qt" = 5 ]; then brew install qt5 && brew link --force qt5 ; fi
2013-07-02 11:55:58 +08:00
script :
2015-06-28 14:16:32 +08:00
- if [ "$TRAVIS_BRANCH" = "$coverity_branch" ]; then exit ; fi # Skip usual build when running coverity scan
2015-03-13 15:01:20 +08:00
- ./bootstrap.sh && ./configure $qbtconf
2015-12-07 10:14:39 +08:00
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then echo "QMAKE_CC=$CC" >> conf.pri && echo "QMAKE_CXX=$CXX" >> conf.pri ; fi
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then sed -i "" -e 's/^\(CXXFLAGS.*\)$/\1 -Wno-unused-local-typedefs/' src/Makefile ; fi
2015-09-01 14:48:10 +08:00
- make && make install
2015-03-13 15:01:20 +08:00
2013-07-27 16:30:13 +08:00
after_success :
2015-09-01 14:48:10 +08:00
- if [ "$gui" = true ]; then qbt_exe="qbittorrent" ; else qbt_exe="qbittorrent-nox" ; fi
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then cd "$qbt_path/bin" && export LD_PRELOAD="$libt_path/lib/libtorrent-rasterbar.so:$LD_PRELOAD" ; fi
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then cd "src/$qbt_exe.app/Contents/MacOS" ; fi
- ./$qbt_exe --version
2015-03-13 15:01:20 +08:00
2015-07-29 12:23:12 +08:00
after_script :
2015-09-01 14:48:10 +08:00
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then ccache --show-stats ; fi