]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
travis: prepared for multi-os, clang
authorMarek Vavruša <marek.vavrusa@nic.cz>
Sun, 8 Feb 2015 12:51:55 +0000 (13:51 +0100)
committerMarek Vavruša <marek.vavrusa@nic.cz>
Mon, 9 Feb 2015 17:07:25 +0000 (18:07 +0100)
.travis.yml
scripts/bootstrap-depends.sh
scripts/update-project-files.py [deleted file]
tests/.gitignore

index 3f97982b5233ad1c6032c60ced6971d85d73dea1..85d2579bc8218b25e7fb3c65766a17963848da07 100644 (file)
@@ -1,20 +1,24 @@
 language: c
+os:
+    - linux
+    - osx
 compiler:
-    - gcc
+    - clang
 env:
     global:
         - PATH="${PATH}:${HOME}/.local/bin"
-        - PKG_CONFIG_PATH="${HOME}/fakeroot/lib/pkgconfig"
-        - LD_LIBRARY_PATH="${HOME}/fakeroot/lib"
+        - PKG_CONFIG_PATH="${HOME}/.local/lib/pkgconfig"
+        - LD_LIBRARY_PATH="${HOME}/.local/lib"
         - CFLAGS="${CFLAGS} -O0 -g -DNDEBUG"
+        - MAKEOPTS="-j2"
 before_script:
-    - ./scripts/bootstrap-depends.sh ${HOME}/fakeroot
+    - ./scripts/bootstrap-depends.sh ${HOME}/.local
     - pip install --user travis -r tests/pydnstest/requirements.txt cpp-coveralls
 script:
-    - make check COVERAGE=1 LDFLAGS="-L${HOME}/fakeroot/lib"
+    - make ${MAKEOPTS} check COVERAGE=1 LDFLAGS="-L${HOME}/.local/lib"
     - coveralls -i lib -x ".c" --gcov-options '\-lp'
 sudo: false
 cache:
     directories:
-    - ${HOME}/fakeroot
+    - ${HOME}/.local
     - ${HOME}/.cache/pip
index 6355bff5fccb265841f4e05d9cf6d3d7b21315e6..4114c02b7b8c4abca054cec1eff147e1f2a35983 100755 (executable)
@@ -1,68 +1,66 @@
-#!/bin/sh  
+#!/bin/bash  
 set -e
 
 CMOCKA_TAG="cmocka-0.4.1"
-PKG_CONFIG_PATH="${1}/lib/pkgconfig"
+URCU_TAG="v0.8.6"
+LIBUV_TAG="v1.3.0"
+KNOT_TAG="master"
 
-if [ -z ${1} ]; then
-       echo "$0 <fakeroot>"
-       exit 1
-fi
-
-install -d ${1}
+# prepare build env
+PREFIX=${1}; [ -z ${PREFIX} ] && PREFIX="${HOME}/.local"
+PKG_CONFIG_PATH="${PREFIX}/lib/pkgconfig"
+install -d ${PREFIX}/{lib,libexec,include,bin,sbin,man,share,etc,info,doc,var}
+[ ! -d .depend ] && mkdir .depend; cd .depend
 
 # lmdb
-if [ ! -e ${1}/include/lmdb.h ]; then
+if [ ! -e ${PREFIX}/include/lmdb.h ]; then
        git clone https://gitorious.org/mdb/mdb.git || true
        cd mdb/libraries/liblmdb
-       make
-       install -d ${1}/lib ${1}/include
-       install -t ${1}/lib liblmdb.so
-       install -t ${1}/include lmdb.h
+       install -d ${PREFIX}/man/man1
+       make ${MAKEOPTS} CC="${CC}" && make install DESTDIR=${PREFIX} prefix=
        cd ../../..
 fi
 
 # liburcu
-if [ ! -e ${1}/include/urcu.h ]; then
-       git clone git://git.urcu.so/userspace-rcu.git || true
+if [ ! -e ${PREFIX}/include/urcu.h ]; then
+       git clone -b ${URCU_TAG} git://git.urcu.so/userspace-rcu.git || true
        cd userspace-rcu
        ./bootstrap
-       ./configure --prefix=${1}
-       make
-       make install
+       ./configure --prefix=${PREFIX} --disable-dependency-tracking --disable-rpath
+       ( make ${MAKEOPTS} ; make install ) || true
        cd ..
 fi
 
 # libknot
-if [ ! -e ${1}/include/libknot ]; then
-       git clone https://github.com/CZNIC-Labs/knot.git || true
+if [ ! -e ${PREFIX}/include/libknot ]; then
+       git clone -b ${KNOT_TAG} https://github.com/CZNIC-Labs/knot.git || true
        cd knot
        autoreconf -i
-       ./configure --prefix=${1}
-       make
-       make install
+       if [ $(uname) == "Darwin" ]; then # Workaround for crypto version check on OS X
+               export libcrypto_CFLAGS="-I /usr/local/opt/openssl/include"
+               export libcrypto_LIBS="-L/usr/local/opt/openssl/lib -lcrypto"
+       fi
+       ./configure --prefix=${PREFIX} --disable-fastparser --disable-dependency-tracking
+       make ${MAKEOPTS} && make install
        cd ..
 fi
 
 # cmocka
-if [ ! -e ${1}/include/cmocka.h ]; then
-       wget http://git.cryptomilk.org/projects/cmocka.git/snapshot/${CMOCKA_TAG}.tar.gz
-       tar xvzf ${CMOCKA_TAG}.tar.gz
-       cd ${CMOCKA_TAG}
+if [ ! -e ${PREFIX}/include/cmocka.h ]; then
+       git clone -b ${CMOCKA_TAG} git://git.cryptomilk.org/projects/cmocka.git
+       cd cmocka
        mkdir build
        cd build
-       cmake -DCMAKE_INSTALL_PREFIX=${1} ..
-       make
-       make install
+       cmake -DCMAKE_INSTALL_PREFIX=${PREFIX} ..
+       make ${MAKEOPTS} && make install
        cd ../..
 fi
 
 # libuv
-if [ ! -e ${1}/include/uv.h ]; then
-       git clone -b v1.3.0 https://github.com/libuv/libuv.git || true
+if [ ! -e ${PREFIX}/include/uv.h ]; then
+       git clone -b ${LIBUV_TAG} https://github.com/libuv/libuv.git || true
        cd libuv
        sh autogen.sh
-       ./configure --prefix=${1}
-       make 
-       make install
+       ./configure --prefix=${PREFIX} --disable-dependency-tracking
+       make ${MAKEOPTS} && make install
 fi
diff --git a/scripts/update-project-files.py b/scripts/update-project-files.py
deleted file mode 100755 (executable)
index 81914cc..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/usr/bin/python -Es
-# vim: et:sw=4:ts=4:sts=4
-#
-# Script regenerates project file list from the list of files tracked by Git.
-#
-
-SOURCES = [
-    # documentation
-    "README", "KNOWN_ISSUES", 
-    "Doxyfile*", "Doxy.file.h", "doc/*.rst",
-
-    # build-system
-    "*.ac", "*.am",
-
-    # sources
-    "lib/*.c", "lib/*.h", "lib/layer/*.h", "lib/layer/*.c",
-    "tests/*.c", "tests/*.h", "tests/*.py",
-    "daemon/*.c", "daemon/*.h", "daemon/layer/*.c", "daemon/layer/*.h"
-]
-
-OUTPUT_FILE = "knot-resolver.files"
-
-# ----------------------------------------------------------------------------
-
-from subprocess import Popen, PIPE
-import os
-import sys
-
-def run(command):
-    p = Popen(command, stdout=PIPE, stderr=PIPE)
-    (out, errout) = p.communicate()
-    if p.returncode != 0:
-        raise Exception("Command %s failed.", command)
-    return out
-
-print >>sys.stderr, "Updating %s." % OUTPUT_FILE
-
-git_root = run(["git", "rev-parse", "--show-toplevel"]).strip()
-os.chdir(git_root)
-
-command = ["git", "ls-files"] + SOURCES
-files = run(command).splitlines()
-
-with open(OUTPUT_FILE, "w") as output:
-    output.write("\n".join(sorted(files)))
-    output.write("\n")
index 5aacb1141e26d29171239bdfa521e6cf4c39df8e..ee3d88ac35e42a2995fcbb8680e0faf3eea04872 100644 (file)
@@ -1,2 +1,6 @@
 *.pyc
 tmp*
+test_cache
+test_context
+test_resolve
+test_rplan