qBittorrent/.travis.yml

208 lines
7.6 KiB
YAML
Raw Normal View History

language: cpp
2015-09-01 14:48:10 +08:00
os:
- linux
- osx
osx_image: xcode7.3
2015-09-01 14:48:10 +08:00
env:
2015-03-13 15:01:20 +08:00
matrix:
# Uncomment when Travis upgraded "Ubuntu 12.04 LTS" to a newer version whose repo will have a more up-to-date libtorrent package
#- lt_branch=dist gui=true
#- lt_branch=dist gui=false
2017-03-20 21:50:28 +08: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
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:
- 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 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
# container-based builds
#sudo: false
cache:
ccache: true
directories:
- $HOME/hombebrew_cache
# opt-in Ubuntu Trusty
sudo: required
dist: trusty
addons:
coverity_scan:
project:
name: "qbittorrent/qBittorrent"
description: "Build submitted via Travis CI"
build_command_prepend: "./bootstrap.sh && ./configure $qbtconf"
build_command: make
branch_pattern: $coverity_branch
notification_email: sledgehammer999@qbittorrent.org
apt:
sources:
# sources list: https://github.com/travis-ci/apt-source-whitelist/blob/master/ubuntu.json
#- ubuntu-toolchain-r-test
#- boost-latest
- sourceline: 'ppa:qbittorrent-team/qbittorrent-stable'
- sourceline: 'ppa:beineri/opt-qt551-trusty'
2017-03-20 21:50:28 +08:00
- sourceline: 'ppa:adrozdoff/cmake'
packages:
# packages list: https://github.com/travis-ci/apt-package-whitelist/blob/master/ubuntu-precise
- autoconf
- automake
2017-03-20 21:50:28 +08:00
- cmake
- colormake
- libssl-dev
- libboost-dev
- libboost-system-dev
- libtorrent-rasterbar-dev
# Qt 5.5.1
- qt55base
- qt55tools
2013-07-27 16:30:13 +08:00
before_install:
# 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
- alias make="colormake -j3" # Using nprocs/2 sometimes may fail (gcc is killed by system)
#- libt_path="$HOME/libt_install"
#- ltconf="$ltconf --prefix="$libt_path" --disable-geoip"
- qbt_path="$HOME/qbt_install"
2017-01-19 20:10:09 +08:00
- qbtconf="$qbtconf --prefix="$qbt_path" PKG_CONFIG_PATH="$libt_path/lib/pkgconfig":/opt/qt55/lib/pkgconfig:$PKG_CONFIG_PATH"
# 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 ;
2017-01-19 20:10:09 +08:00
# Qt 5
PATH=/opt/qt55/bin:${PATH}
fi
2013-07-27 16:30:13 +08:00
# print settings
- echo $lt_branch
2013-07-27 16:30:13 +08:00
- echo $gui
2017-03-20 21:50:28 +08:00
- echo $build_system
- echo $ltconf
- echo $qbtconf
install:
- |
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
# build libtorrent from source
#if [ "$lt_branch" != "dist" ]; then
#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 ;
# ccache
if [ "$TRAVIS_BRANCH" != "$coverity_branch" ]; then
dpkg-query -L ccache && export use_ccache=true ;
ccache -V && ccache --show-stats && ccache --zero-stats ;
fi ;
fi
- |
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
2016-11-30 13:17:45 +08:00
wget https://builds.shiki.hu/homebrew/version ;
if ! cmp --quiet "version" "$HOME/hombebrew_cache/version" ; then
echo "Cached files are different from server. Downloading new ones." ;
2017-01-12 08:39:44 +08:00
# First delete old files
rm -r "$HOME/hombebrew_cache" ;
mkdir "$HOME/hombebrew_cache";
cp "version" $HOME/hombebrew_cache ;
cd "$HOME/hombebrew_cache" ;
2016-11-30 13:17:45 +08:00
wget https://builds.shiki.hu/homebrew/libtorrent-rasterbar.rb ;
2016-12-03 05:11:05 +08:00
wget https://builds.shiki.hu/homebrew/libtorrent-rasterbar-1.0.10.el_capitan.bottle.tar.gz ;
wget https://builds.shiki.hu/homebrew/qt5.rb ;
2017-01-12 08:39:44 +08:00
wget https://builds.shiki.hu/homebrew/qt5-5.7.1_1.el_capitan.bottle.tar.gz ;
fi
2016-11-30 13:17:45 +08:00
# dependencies
brew update > /dev/null ;
brew install colormake ccache ;
2017-03-20 21:50:28 +08:00
if [ "$build_system" = "cmake" ]; then
brew unlink cmake
brew install cmake;
fi
brew outdated "pkg-config" || brew upgrade "pkg-config" ;
# Copy custom libtorrent bottle to homebrew's 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.
2016-12-03 05:11:05 +08:00
cp "$HOME/hombebrew_cache/libtorrent-rasterbar-1.0.10.el_capitan.bottle.tar.gz" "$(brew --cache)" ;
brew install "$HOME/hombebrew_cache/libtorrent-rasterbar.rb" ;
2017-03-20 21:50:28 +08:00
if [ "$build_system" = "cmake" ]; then
brew install qt5 ;
brew link --force qt5 ;
export HOMEBREW_QT5_VERSION=$(brew list --versions qt5 | rev | cut -d' ' -f1 | rev)
ln -s /usr/local/Cellar/qt5/$HOMEBREW_QT5_VERSION/mkspecs /usr/local/mkspecs
ln -s /usr/local/Cellar/qt5/$HOMEBREW_QT5_VERSION/plugins /usr/local/plugins
else
# Qt
# Copy custom qt5 bottle to homebrew's cache so it can find and install it
# Also install our custom qt5 formula by passing the local path to it
# These 2 files are restored from Travis' cache.
cp "$HOME/hombebrew_cache/qt5-5.7.1_1.el_capitan.bottle.tar.gz" "$(brew --cache)" ;
brew install "$HOME/hombebrew_cache/qt5.rb" ;
brew link --force qt5 ;
fi
MY_CMAKE_OPENSSL_HINT="-DOPENSSL_ROOT_DIR=/usr/local/opt/openssl/"
# ccache
if [ "$TRAVIS_BRANCH" != "$coverity_branch" ]; then
export PATH="/usr/local/opt/ccache/libexec:$PATH" && export use_ccache=true ;
ccache -V && ccache --show-stats && ccache --zero-stats ;
fi ;
fi
script:
- if [ "$TRAVIS_BRANCH" = "$coverity_branch" ]; then exit ; fi # skip usual build when running coverity scan
- |
2017-03-20 21:50:28 +08:00
cd "$TRAVIS_BUILD_DIR"
if [ "$build_system" = "cmake" ]; then
cd "$TRAVIS_BUILD_DIR"
mkdir build
cd build
cmake -DGUI=${gui} -DCMAKE_INSTALL_PREFIX="$qbt_path" "$MY_CMAKE_OPENSSL_HINT" \
-G "Unix Makefiles" -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE ..
fi
if [ "$build_system" = "qmake" ]; then
./bootstrap.sh && ./configure $qbtconf
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
sed -i "" -e "s/^\(CC.*&&\).*$/\1 $CC/" src/Makefile ; # workaround for Qt & ccache: https://bugreports.qt.io/browse/QTBUG-31034
sed -i "" -e "s/^\(CXX.*&&\).*$/\1 $CXX/" src/Makefile ;
sed -i "" -e 's/^\(CXXFLAGS.*\)$/\1 -Wno-unused-local-typedefs -Wno-inconsistent-missing-override/' src/Makefile ;
fi
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" ; fi
- |
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
macdeployqt "$TRAVIS_BUILD_DIR/src/$qbt_exe.app" ;
cd "$TRAVIS_BUILD_DIR/src/$qbt_exe.app/Contents/MacOS" ;
fi
2015-09-01 14:48:10 +08:00
- ./$qbt_exe --version
2015-03-13 15:01:20 +08:00
after_script:
- if [ "$use_ccache" = true ]; then ccache --show-stats ; fi