Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
andig committed Nov 17, 2019
1 parent f27adad commit 78a47fd
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 72 deletions.
6 changes: 6 additions & 0 deletions .clang-format
@@ -0,0 +1,6 @@
BasedOnStyle: LLVM
ColumnLimit: 100
IndentWidth: 4
TabWidth: 4
UseTab: ForContinuationAndIndentation
AlignTrailingComments: true
21 changes: 9 additions & 12 deletions .editorconfig
@@ -1,19 +1,16 @@
# This file is for unifying the coding style for different editors and IDEs
# editorconfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
charset = utf-8
trim_trailing_whitespace = true
end_of_line = lf
insert_final_newline = true

[**.cpp]
indent_style = tab
indent_size = 4

[**.hpp]
# Tab indentation (no size specified)
[Makefile]
indent_style = tab
indent_size = 4

[**.h]
indent_style = tab
indent_size = 4
[*.{c,h,cpp,hpp}]
indent_size = 4
135 changes: 75 additions & 60 deletions .travis.yml
@@ -1,72 +1,87 @@
sudo: required
dist: trusty
dist: xenial

language: cpp

compiler:
- clang
- gcc

env:
- CTEST_OUTPUT_ON_FAILURE=1 USE_GCC7=0
- CTEST_OUTPUT_ON_FAILURE=1 USE_GCC7=1
addons:
apt:
sources:
- llvm-toolchain-trusty
packages:
- clang-format-9

matrix:
exclude:
- compiler: clang
env: CTEST_OUTPUT_ON_FAILURE=1 USE_GCC7=1
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:
- sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
- sudo apt-get update -qq
# uncomment for ubuntu precise. not needed for >=trusty - if [ "$CXX" = "g++" ]; then sudo apt-get install -y -qq g++-4.8; export CXX="g++-4.8" CC="gcc-4.8"; else echo "yes" | sudo add-apt-repository 'deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu precise main'; echo "yes" | sudo add-apt-repository 'deb http://llvm.org/apt/precise/ llvm-toolchain-precise-3.6 main'; wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add -; sudo apt-get update; sudo apt-get install -qq --allow-unauthenticated llvm-3.6 llvm-3.6-dev clang-3.6 libstdc++-4.8-dev; export CXX="clang++-3.6" CC="clang-3.6"; fi
- 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 ..
- 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 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 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
# -- 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
script:
- cmake . -DMETEREXEC_ROOTACCESS=OFF -DENABLE_OCR=ON -DSML_HOME=/usr/local/src/libsml/sml && make && make test
- 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/* src/*
test -z "$(git status --porcelain)" || (git status; git diff; false)
fi

0 comments on commit 78a47fd

Please sign in to comment.