Skip to content

Commit cfc973d

Browse files
authored
Merge pull request confluentinc#11 from confluentinc/travis
Travis CI integration
2 parents 0c7d258 + b8ad162 commit cfc973d

File tree

4 files changed

+57
-1
lines changed

4 files changed

+57
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
*~
22
\#*
33
*.prof
4+
tmp-build

.travis.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
language: go
2+
go:
3+
- 1.6
4+
- 1.7
5+
before_install:
6+
- bash mk/bootstrap-librdkafka.sh v0.9.2 tmp-build
7+
env:
8+
global:
9+
- PKG_CONFIG_PATH="$HOME/gopath/src/github.com/confluentinc/confluent-kafka-go/tmp-build/lib/pkgconfig"
10+
- PATH="$PATH:$GOPATH/bin"
11+
install:
12+
- go get -tags static ./...
13+
- go install -tags static ./...
14+
- cd examples/go-kafkacat && go install -tags static
15+
16+
script:
17+
- go test -v -tags static ./...
18+
- go-kafkacat --help

kafka/go_rdkafka_generr/go_rdkafka_generr.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ import (
2525
)
2626

2727
/*
28+
#cgo pkg-config: --static rdkafka
29+
#cgo LDFLAGS: -Wl,-Bstatic -lrdkafka -Wl,-Bdynamic
2830
#include <librdkafka/rdkafka.h>
29-
#cgo LDFLAGS: -lrdkafka
3031
3132
static const char *errdesc_to_string (const struct rd_kafka_err_desc *ed, int idx) {
3233
return ed[idx].name;

mk/bootstrap-librdkafka.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/bash
2+
#
3+
#
4+
# Downloads, builds and installs librdkafka into <install-dir>
5+
#
6+
7+
set -e
8+
9+
VERSION=$1
10+
PREFIXDIR=$2
11+
12+
if [[ -z "$VERSION" ]]; then
13+
echo "Usage: $0 <librdkafka-version> [<install-dir>]" 1>&2
14+
exit 1
15+
fi
16+
17+
if [[ -z "$PREFIXDIR" ]]; then
18+
PREFIXDIR=tmp-build
19+
fi
20+
21+
if [[ $PREFIXDIR != /* ]]; then
22+
PREFIXDIR="$PWD/$PREFIXDIR"
23+
fi
24+
25+
mkdir -p "$PREFIXDIR/librdkafka"
26+
pushd "$PREFIXDIR/librdkafka"
27+
28+
test -f configure ||
29+
curl -sL "https://github.com/edenhill/librdkafka/archive/${VERSION}.tar.gz" | \
30+
tar -xz --strip-components=1 -f -
31+
32+
./configure --prefix="$PREFIXDIR"
33+
make -j
34+
make install
35+
popd
36+

0 commit comments

Comments
 (0)