Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add simple librdkafka bootstrap script
  • Loading branch information
edenhill committed Nov 8, 2016
commit d7aa1d929fd41c8e1e45369a96321946d2aefe99
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ confluent?kafka.egg-info
.cache
*.log
confluent-kafka-0.*.*
tmp-build
.tox
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
36 changes: 36 additions & 0 deletions tools/bootstrap-librdkafka.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash
#
#
# Downloads, builds and installs librdkafka into <install-dir>
#

set -e

VERSION=$1
PREFIXDIR=$2

if [[ -z "$VERSION" ]]; then
echo "Usage: $0 <librdkafka-version> [<install-dir>]" 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