2013-06-25 08:56:38 +08:00
|
|
|
language: c
|
|
|
|
compiler:
|
|
|
|
- gcc
|
2013-07-18 06:19:41 +08:00
|
|
|
- clang
|
2013-06-25 08:56:38 +08:00
|
|
|
|
2016-07-06 16:47:13 +08:00
|
|
|
addons:
|
|
|
|
apt:
|
|
|
|
sources:
|
|
|
|
- avsm
|
|
|
|
packages:
|
|
|
|
- check
|
|
|
|
- libvpx-dev
|
|
|
|
- opam
|
|
|
|
|
|
|
|
cache:
|
|
|
|
directories:
|
|
|
|
- $HOME/cache
|
|
|
|
|
2013-07-13 04:27:19 +08:00
|
|
|
before_script:
|
2016-07-06 16:47:13 +08:00
|
|
|
- pushd ..
|
|
|
|
- CACHE_DIR=$HOME/cache
|
|
|
|
- export OPAMROOT=$CACHE_DIR/.opam
|
|
|
|
- export PKG_CONFIG_PATH=$CACHE_DIR/lib/pkgconfig
|
|
|
|
# Set up opam.
|
|
|
|
- opam init -y
|
2016-03-04 01:23:32 +08:00
|
|
|
- eval `opam config env`
|
2016-07-06 16:47:13 +08:00
|
|
|
# Install required opam packages.
|
|
|
|
- opam install -y ocamlfind ppx_deriving menhir
|
|
|
|
# Build apidsl.
|
|
|
|
- git clone --depth=1 https://github.com/iphydf/apidsl
|
|
|
|
- make -C apidsl
|
|
|
|
# Install cpp-coveralls to upload test coverage results.
|
|
|
|
- pip install --user cpp-coveralls
|
|
|
|
# Install astyle (version in ubuntu-precise too old).
|
|
|
|
- ASTYLE=$CACHE_DIR/astyle/build/gcc/bin/astyle
|
|
|
|
- >
|
|
|
|
[ -f $ASTYLE ] || {
|
|
|
|
wget -O astyle.tar.gz http://sourceforge.net/projects/astyle/files/astyle/astyle%202.05.1/astyle_2.05.1_linux.tar.gz/download
|
|
|
|
tar -xf astyle.tar.gz -C $CACHE_DIR
|
|
|
|
make -C $CACHE_DIR/astyle/build/gcc
|
|
|
|
}
|
|
|
|
# Install libsodium (not in ubuntu-precise).
|
|
|
|
- >
|
|
|
|
[ -f $CACHE_DIR/lib/libsodium.a ] || {
|
|
|
|
git clone --depth=1 --branch=stable https://github.com/jedisct1/libsodium
|
|
|
|
cd libsodium
|
|
|
|
./autogen.sh
|
|
|
|
./configure --prefix=$CACHE_DIR
|
|
|
|
make install -j3
|
|
|
|
cd ..
|
|
|
|
}
|
|
|
|
# Install libconfig (version in ubuntu-precise too old).
|
|
|
|
- >
|
|
|
|
[ -f $CACHE_DIR/lib/libconfig.a ] || {
|
|
|
|
git clone --depth=1 --branch=REL1_6_STABLE https://github.com/hyperrealm/libconfig
|
|
|
|
cd libconfig
|
|
|
|
autoreconf -fi
|
|
|
|
./configure --prefix=$CACHE_DIR
|
|
|
|
touch lib/scanner.l
|
|
|
|
make install -j3
|
|
|
|
cd ..
|
|
|
|
}
|
|
|
|
# Install libopus (not in ubuntu-precise).
|
|
|
|
- >
|
|
|
|
[ -f $CACHE_DIR/lib/libopus.a ] || {
|
|
|
|
git clone --depth=1 --branch=1.1.2 https://github.com/xiph/opus
|
|
|
|
cd opus
|
|
|
|
./autogen.sh
|
|
|
|
./configure --prefix=$CACHE_DIR
|
|
|
|
make install -j3
|
|
|
|
cd ..
|
|
|
|
}
|
|
|
|
- popd
|
2013-07-13 04:27:19 +08:00
|
|
|
|
2013-06-25 08:56:38 +08:00
|
|
|
script:
|
2016-07-06 16:47:13 +08:00
|
|
|
# Check if toxcore.h and toxav.h match apidsl tox.in.h and toxav.in.h.
|
|
|
|
- ../apidsl/_build/apigen.native ./other/apidsl/tox.in.h | $ASTYLE --options=./other/astyle/astylerc > toxcore/tox.h
|
|
|
|
- ../apidsl/_build/apigen.native ./other/apidsl/toxav.in.h | $ASTYLE --options=./other/astyle/astylerc > toxav/toxav.h
|
|
|
|
- git diff --exit-code
|
|
|
|
# Build toxcore and run tests.
|
2016-01-24 12:41:08 +08:00
|
|
|
- ./autogen.sh
|
2016-07-06 16:47:13 +08:00
|
|
|
- >
|
|
|
|
./configure \
|
|
|
|
--with-libsodium-libs=$CACHE_DIR/lib \
|
|
|
|
--with-libsodium-headers=$CACHE_DIR/include \
|
|
|
|
--enable-daemon \
|
2016-07-08 03:53:49 +08:00
|
|
|
--enable-logging \
|
2016-07-06 16:47:13 +08:00
|
|
|
--enable-ntox \
|
|
|
|
CFLAGS="-O0 -Wall -Wextra -fprofile-arcs -ftest-coverage"
|
2016-01-24 12:41:08 +08:00
|
|
|
- make
|
2016-07-06 16:47:13 +08:00
|
|
|
- make check || true
|
|
|
|
- if [ -f build/test-suite.log ]; then cat build/test-suite.log; fi
|
2013-08-30 07:24:14 +08:00
|
|
|
- make dist
|
2013-06-25 08:56:38 +08:00
|
|
|
|
2016-07-06 16:47:13 +08:00
|
|
|
after_script:
|
|
|
|
- coveralls --exclude auto_tests --exclude other --exclude testing --gcov-options '\-lp'
|
2013-07-13 06:31:57 +08:00
|
|
|
|
2016-07-06 16:47:13 +08:00
|
|
|
#notifications:
|
|
|
|
# email: false
|
|
|
|
#
|
|
|
|
# irc:
|
|
|
|
# channels:
|
|
|
|
# - "chat.freenode.net#tox-dev"
|
|
|
|
# on_success: always
|
|
|
|
# on_failure: always
|