10 # Uncomment when Travis upgraded "Ubuntu 12.04 LTS" to a newer version whose repo will have a more up-to-date libtorrent package
11 #- lt_branch=dist gui=true
12 #- lt_branch=dist gui=false
13 - lt_branch=RC_1_0 qt=5 gui=true
14 - lt_branch=RC_1_0 qt=5 gui=false
15 - lt_branch=RC_1_0 qt=4 gui=true
16 - lt_branch=RC_1_0 qt=4 gui=false
18 - secure: "OI9CUjj4lTb0HwwIZU5PbECU3hLlAL6KC8KsbwohG8/O3j5fLcnmDsK4Ad9us5cC39sS11Jcd1kDP2qRcCuST/glVNhLkcjKkiQerOfd5nQ/qL4JYfz/1mfP5mdpz9jHKzpLUIG+TXkbSTjP6VVmsb5KPT+3pKEdRFZB+Pu9+J8="
19 - coverity_branch: coverity_scan
23 - search_encoding_windows
31 # container-based builds
35 # opt-in Ubuntu Trusty
42 name: "qbittorrent/qBittorrent"
43 description: "Build submitted via Travis CI"
44 build_command_prepend: "./bootstrap.sh && ./configure $qbtconf"
46 branch_pattern: $coverity_branch
47 notification_email: sledgehammer999@qbittorrent.org
50 # sources list: https://github.com/travis-ci/apt-source-whitelist/blob/master/ubuntu.json
51 #- ubuntu-toolchain-r-test
54 # packages list: https://github.com/travis-ci/apt-package-whitelist/blob/master/ubuntu-precise
61 # uncomment when Travis upgraded "Ubuntu 12.04 LTS" to a newer version whose repo will have a more up-to-date libtorrent package
62 #- libtorrent-rasterbar6
65 # only allow specific build for coverity scan, others will stop
66 - if [ "$TRAVIS_BRANCH" = "$coverity_branch" ] && ! [ "$TRAVIS_OS_NAME" = "linux" -a "$lt_branch" = "RC_1_0" -a "$gui" = true ]; then exit ; fi
68 - shopt -s expand_aliases
69 - alias make="colormake -j3" # Using nprocs/2 sometimes may fail (gcc is killed by system)
70 #- libt_path="$HOME/libt_install"
71 #- ltconf="$ltconf --prefix="$libt_path" --disable-geoip"
72 - qbt_path="$HOME/qbt_install"
73 - qbtconf="$qbtconf --prefix="$qbt_path" PKG_CONFIG_PATH="$libt_path/lib/pkgconfig":$PKG_CONFIG_PATH"
75 # options for specific branches
76 - if [ "$qt" = 4 ]; then qbtconf="$qbtconf --with-qt4" ; fi
77 - if [ "$gui" = false ]; then qbtconf="$qbtconf --disable-gui" ; fi
79 if [ "$TRAVIS_OS_NAME" = "linux" ]; then
80 # setup virtual display for after_success target
81 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 ;
84 if [ "$TRAVIS_OS_NAME" = "osx" ]; then
85 qbtconf="$qbtconf --disable-qt-dbus" ;
96 if [ "$TRAVIS_OS_NAME" = "linux" ]; then
98 sudo add-apt-repository --yes ppa:qbittorrent-team/qbittorrent-stable ;
99 sudo apt-get update -qq ;
100 sudo apt-get install -qq libtorrent-rasterbar-dev ;
102 # build libtorrent from source
103 #if [ "$lt_branch" != "dist" ]; then
104 #cd "$HOME" && pwd && git clone --depth 1 https://github.com/arvidn/libtorrent.git --branch $lt_branch ;
105 #cd libtorrent && ./autotool.sh && ./configure $ltconf && make install ;
109 if [ "$qt" = 4 ]; then sudo apt-get -qq install qt4-default libqt4-dev ; fi ;
110 if [ "$qt" = 5 ]; then sudo apt-get -qq install qt5-default qtbase5-dev qttools5-dev-tools ; fi ;
113 if [ "$TRAVIS_BRANCH" != "$coverity_branch" ]; then
114 dpkg-query -L ccache && export use_ccache=true ;
115 ccache -V && ccache --show-stats && ccache --zero-stats ;
119 if [ "$TRAVIS_OS_NAME" = "osx" ]; then
121 brew update > /dev/null ;
122 brew install colormake ccache ;
123 brew outdated "pkg-config" || brew upgrade "pkg-config" ;
124 brew outdated "zlib" || brew upgrade "zlib" ;
125 # libtorrent-rasterbar 1.0.9
126 brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/477d5060fa093883204d70323965375353e03084/Formula/libtorrent-rasterbar.rb ;
129 if [ "$qt" = 4 ]; then brew install qt && ln -s /usr/local/Cellar/qt/4.8.7_2/plugins /usr/local ; fi ;
130 if [ "$qt" = 5 ]; then brew install qt5 && brew link --force qt5 && ln -s /usr/local/Cellar/qt5/5.6.0/plugins /usr/local ; fi ;
133 if [ "$TRAVIS_BRANCH" != "$coverity_branch" ]; then
134 export PATH="/usr/local/opt/ccache/libexec:$PATH" && export use_ccache=true ;
135 ccache -V && ccache --show-stats && ccache --zero-stats ;
140 - if [ "$TRAVIS_BRANCH" = "$coverity_branch" ]; then exit ; fi # skip usual build when running coverity scan
141 - cd "$TRAVIS_BUILD_DIR" && ./bootstrap.sh && ./configure $qbtconf
143 if [ "$TRAVIS_OS_NAME" = "osx" ]; then
144 sed -i "" -e "s/^\(CC.*&&\).*$/\1 $CC/" src/Makefile ; # workaround for Qt & ccache: https://bugreports.qt.io/browse/QTBUG-31034
145 sed -i "" -e "s/^\(CXX.*&&\).*$/\1 $CXX/" src/Makefile ;
146 sed -i "" -e 's/^\(CXXFLAGS.*\)$/\1 -Wno-unused-local-typedefs -Wno-inconsistent-missing-override/' src/Makefile ;
148 - make && make install
151 - if [ "$gui" = true ]; then qbt_exe="qbittorrent" ; else qbt_exe="qbittorrent-nox" ; fi
152 - if [ "$TRAVIS_OS_NAME" = "linux" ]; then cd "$qbt_path/bin" ; fi
153 - if [ "$TRAVIS_OS_NAME" = "osx" ]; then cd "$TRAVIS_BUILD_DIR/src/" && macdeployqt "$qbt_exe.app" && cd "$qbt_exe.app/Contents/MacOS" ; fi
154 - ./$qbt_exe --version
157 - if [ "$use_ccache" = true ]; then ccache --show-stats ; fi