diff --git a/.gitignore b/.gitignore index ffd2bab41..7b588f3a3 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,5 @@ confluent?kafka.egg-info .cache *.log confluent-kafka-0.*.* +tmp-build +.tox diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..4b183364c --- /dev/null +++ b/.travis.yml @@ -0,0 +1,11 @@ +language: python +python: + - "2.7" + - "3.4" +before_install: + - bash tools/bootstrap-librdkafka.sh v0.9.2 tmp-build +install: + - pip install -v --global-option=build_ext --global-option="-Itmp-build/include/" --global-option="-Ltmp-build/lib" . +env: + - LD_LIBRARY_PATH=$PWD/tmp-build/lib +script: py.test --ignore=tmp-build diff --git a/tools/bootstrap-librdkafka.sh b/tools/bootstrap-librdkafka.sh new file mode 100755 index 000000000..97f9787c1 --- /dev/null +++ b/tools/bootstrap-librdkafka.sh @@ -0,0 +1,36 @@ +#!/bin/bash +# +# +# Downloads, builds and installs librdkafka into +# + +set -e + +VERSION=$1 +PREFIXDIR=$2 + +if [[ -z "$VERSION" ]]; then + echo "Usage: $0 []" 1>&2 + exit 1 +fi + +if [[ -z "$PREFIXDIR" ]]; then + PREFIXDIR=tmp-build +fi + +if [[ $PREFIXDIR != /* ]]; then + PREFIXDIR="$PWD/$PREFIXDIR" +fi + +mkdir -p "$PREFIXDIR/librdkafka" +pushd "$PREFIXDIR/librdkafka" + +test -f configure || +curl -sL "https://github.com/edenhill/librdkafka/archive/${VERSION}.tar.gz" | \ + tar -xz --strip-components=1 -f - + +./configure --prefix="$PREFIXDIR" +make -j +make install +popd +