-
Notifications
You must be signed in to change notification settings - Fork 121
/
.travis.yml
87 lines (78 loc) · 2.51 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
sudo: required
dist: xenial
language: cpp
addons:
apt:
sources:
- llvm-toolchain-trusty
packages:
- clang-format-9
matrix:
include:
- env: BUILD=1 CTEST_OUTPUT_ON_FAILURE=1 USE_GCC7=1
compiler: clang
- env: BUILD=1 CTEST_OUTPUT_ON_FAILURE=1 USE_GCC7=1
compiler: gcc
- env: BUILD=1 CTEST_OUTPUT_ON_FAILURE=1 USE_GCC7=0
compiler: gcc
- env: FORMAT=1
before_install:
- clang-format --version
install:
- |
if [ -n "$BUILD" ]; then
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
sudo apt-get update -qq
if [ "$USE_GCC7" = "1" ]; then sudo apt-get install -y -qq g++-7; export CXX="g++-7" CC="gcc-7"; fi
$CXX --version
# install json-c
sudo apt-get install -y build-essential
sudo apt-get install -y wget
sudo apt-get install -y libtool
git clone -b json-c-0.12 https://github.com/json-c/json-c
cd json-c
sh autogen.sh
./configure
make
sudo make install
cd ..
sudo apt-get install -y libcurl4-openssl-dev openssl libmicrohttpd-dev uuid-dev uuid-runtime libunistring-dev
# -- get libsml --
git clone https://github.com/volkszaehler/libsml.git # or github.com/TheCount/libsml.git # or https://github.com/dailab/libsml.git
cd libsml
# git checkout develop # only dev branch seems to work
make
# -- install libsml --
sudo cp sml/lib/libsml.* /usr/lib/.
sudo cp -R sml/include/* /usr/include/.
sudo cp sml.pc /usr/lib/pkgconfig/.
cd ..
# -- install leptonica
sudo apt-get install -y libpng-dev libtiff-dev
wget http://www.leptonica.org/source/leptonica-1.71.tar.gz
tar -zxvf leptonica-1.71.tar.gz
cd leptonica-1.71
./configure --disable-programs
make
sudo make install
sudo ldconfig
cd ..
# -- install libmbus
git clone https://github.com/rscada/libmbus
cd libmbus
./build.sh
sudo make install
cd ..
sudo apt-get install -y lcov
# -- install libmosquitto-dev
sudo add-apt-repository ppa:mosquitto-dev/mosquitto-ppa -y
sudo apt-get update -qq
sudo apt-get install -qq libmosquitto-dev
fi
script:
- if [ -n "$BUILD" ]; then cmake . -DMETEREXEC_ROOTACCESS=OFF -DENABLE_OCR=ON -DSML_HOME=/usr/local/src/libsml/sml && make && make test; fi
- |
if [ -n "$FORMAT" ]; then
clang-format -i include/**/*.{h,hpp} src/**/*.cpp tests/**/*.{cpp,hpp}
test -z "$(git status --porcelain)" || (git status; git diff; false)
fi