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
2017-03-04 15:28:52 +08:00
osx_image : xcode7.3
2015-09-01 14:48:10 +08:00
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
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
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 :
- 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
2016-11-11 23:54:54 +08:00
cache :
ccache : true
directories :
- $HOME/hombebrew_cache
2016-03-17 14:14:57 +08:00
# opt-in Ubuntu Trusty
dist : trusty
2017-04-19 17:23:50 +08:00
# container-based builds
sudo : false
2015-07-29 12:23:12 +08:00
addons :
coverity_scan :
project :
name : "qbittorrent/qBittorrent"
description : "Build submitted via Travis CI"
2016-03-17 14:14:57 +08:00
build_command_prepend : "./bootstrap.sh && ./configure $qbtconf"
2015-07-29 12:23:12 +08:00
build_command : make
branch_pattern : $coverity_branch
notification_email : sledgehammer999@qbittorrent.org
apt :
2017-03-20 21:24:05 +08:00
sources :
# sources list: https://github.com/travis-ci/apt-source-whitelist/blob/master/ubuntu.json
2017-05-31 21:42:24 +08:00
- ubuntu-toolchain-r-test
2017-03-20 21:24:05 +08:00
#- 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'
2015-07-29 12:23:12 +08:00
packages :
2017-04-19 17:23:50 +08:00
# packages list: https://github.com/travis-ci/apt-package-whitelist/blob/master/ubuntu-precise
2017-05-31 22:35:40 +08:00
- [ autoconf, automake, colormake]
- [ cmake, ninja-build]
2017-03-20 21:24:05 +08:00
- libssl-dev
2017-05-31 22:35:40 +08:00
- [ libboost-dev, libboost-system-dev]
2017-03-20 21:24:05 +08:00
- libtorrent-rasterbar-dev
2017-07-14 15:45:57 +08:00
- [ qt55base, qt55svg, qt55tools]
2017-05-31 21:42:24 +08:00
- [ gcc-6, g++-6]
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
2017-04-25 01:01:18 +08: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 15:01:20 +08:00
2013-07-27 16:30:13 +08:00
- shopt -s expand_aliases
2015-07-29 12:23:12 +08:00
- alias make="colormake -j3" # Using nprocs/2 sometimes may fail (gcc is killed by system)
- qbt_path="$HOME/qbt_install"
2018-01-03 07:49:37 +08:00
- |
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
qbtconf="$qbtconf --prefix="$qbt_path" PKG_CONFIG_PATH=/opt/qt55/lib/pkgconfig:$PKG_CONFIG_PATH"
else
qbtconf="$qbtconf --prefix="$qbt_path""
fi
2016-03-17 14:14:57 +08: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 ;
2017-01-19 20:10:09 +08:00
# Qt 5
PATH=/opt/qt55/bin:${PATH}
2017-05-31 21:42:24 +08:00
if [ "$build_system" = "cmake" ]; then
COMPILER_VERSION=6
export CXX="${CXX}-${COMPILER_VERSION}" CC="${CC}-${COMPILER_VERSION}"
fi
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
2015-06-28 14:16:32 +08:00
- echo $lt_branch
2013-07-27 16:30:13 +08:00
- echo $gui
2017-03-20 21:50:28 +08:00
- echo $build_system
2015-06-28 14:16:32 +08:00
- echo $ltconf
2015-07-29 12:23:12 +08:00
- echo $qbtconf
2017-04-19 17:23:50 +08:00
2013-07-02 11:55:58 +08:00
install :
2017-04-19 17:23:50 +08:00
#- |
#if [ "$TRAVIS_OS_NAME" = "linux" ]; then
2016-03-17 14:14:57 +08:00
# build libtorrent from source
#if [ "$lt_branch" != "dist" ]; then
2017-04-19 17:23:50 +08: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 14:14:57 +08:00
- |
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
2017-04-19 17:23:50 +08:00
# dependencies
brew update > /dev/null
brew outdated "pkg-config" || brew upgrade "pkg-config"
2017-07-13 00:54:24 +08:00
brew install colormake ccache zlib qt
PATH="/usr/local/opt/ccache/libexec:$PATH"
brew link --force zlib qt
2017-04-19 17:23:50 +08:00
wget https://builds.shiki.hu/homebrew/version
2016-11-11 23:54:54 +08:00
if ! cmp --quiet "version" "$HOME/hombebrew_cache/version" ; then
2017-04-19 17:23:50 +08:00
echo "Cached files are different from server. Downloading new ones."
2017-01-12 08:39:44 +08:00
# First delete old files
2017-04-19 17:23:50 +08:00
rm -r "$HOME/hombebrew_cache"
mkdir "$HOME/hombebrew_cache"
cp "version" $HOME/hombebrew_cache
cd "$HOME/hombebrew_cache"
wget https://builds.shiki.hu/homebrew/libtorrent-rasterbar.rb
2018-04-23 03:42:23 +08:00
wget https://builds.shiki.hu/homebrew/libtorrent-rasterbar-1.1.7+git20180422.3ede0b9c20+patched-configure.el_capitan.bottle.tar.gz
2016-11-11 23:54:54 +08:00
fi
2016-11-30 13:17:45 +08:00
2016-11-11 23:54:54 +08:00
# 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.
2018-04-23 03:42:23 +08:00
cp "$HOME/hombebrew_cache/libtorrent-rasterbar-1.1.7+git20180422.3ede0b9c20+patched-configure.el_capitan.bottle.tar.gz" "$(brew --cache)"
2017-04-19 17:23:50 +08:00
brew install "$HOME/hombebrew_cache/libtorrent-rasterbar.rb"
2016-03-17 14:14:57 +08:00
2017-03-20 21:50:28 +08:00
if [ "$build_system" = "cmake" ]; then
2017-07-13 00:54:24 +08:00
brew outdated cmake || brew upgrade cmake
brew install ninja
2017-04-19 17:23:50 +08:00
2017-04-11 19:24:38 +08:00
ln -s /usr/local/opt/qt/mkspecs /usr/local/mkspecs
ln -s /usr/local/opt/qt/plugins /usr/local/plugins
2017-03-20 21:50:28 +08:00
fi
MY_CMAKE_OPENSSL_HINT="-DOPENSSL_ROOT_DIR=/usr/local/opt/openssl/"
2017-04-19 17:23:50 +08:00
fi
- |
if [ "$TRAVIS_BRANCH" != "$coverity_branch" ]; then
export use_ccache=true
ccache -V && ccache --show-stats && ccache --zero-stats
2016-03-17 14:14:57 +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" = "cmake" ]; then
mkdir build
cd build
2018-06-05 09:03:38 +08: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 21:06:53 +08:00
-G "Ninja" -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE ..
BUILD_TOOL="ninja"
2017-03-20 21:50:28 +08:00
fi
if [ "$build_system" = "qmake" ]; then
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
2018-01-03 07:49:37 +08:00
# For some reason for RC_1_1 we need to also specify the OpenSSL compiler/linker flags
# Homebrew doesn't symlink OpenSSL for security reasons
./bootstrap.sh && ./configure $qbtconf CXXFLAGS="$(PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig:$PKG_CONFIG_PATH" pkg-config --cflags openssl)" LDFLAGS="$(PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig:$PKG_CONFIG_PATH" pkg-config --libs openssl)"
2017-04-19 17:23:50 +08:00
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
2018-01-03 07:49:37 +08:00
else
./bootstrap.sh && ./configure $qbtconf
2017-03-20 21:50:28 +08:00
fi
2017-05-31 21:06:53 +08:00
BUILD_TOOL="make"
2016-05-04 02:14:31 +08:00
fi
2017-05-31 21:06:53 +08:00
- $BUILD_TOOL && $BUILD_TOOL 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
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