From 608a24477d45304ef7c7cda0c1217767efdb137e Mon Sep 17 00:00:00 2001 From: Magnus Edenhill Date: Tue, 8 Nov 2016 22:03:51 +0100 Subject: [PATCH 1/2] Travis CI integration --- .travis.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..84c809f2b --- /dev/null +++ b/.travis.yml @@ -0,0 +1,11 @@ +language: python +python: + - "2.7" + - "3.4" +before_install: + - bash ./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 From d7aa1d929fd41c8e1e45369a96321946d2aefe99 Mon Sep 17 00:00:00 2001 From: Magnus Edenhill Date: Tue, 8 Nov 2016 22:07:06 +0100 Subject: [PATCH 2/2] Add simple librdkafka bootstrap script --- .gitignore | 2 ++ .travis.yml | 2 +- tools/bootstrap-librdkafka.sh | 36 +++++++++++++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 1 deletion(-) create mode 100755 tools/bootstrap-librdkafka.sh 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 index 84c809f2b..4b183364c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,7 @@ python: - "2.7" - "3.4" before_install: - - bash ./bootstrap-librdkafka.sh v0.9.2 tmp-build + - 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: 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 +