2019-02-13 11:06:57 +03:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Build librdkafka on Alpine.
|
|
|
|
#
|
|
|
|
|
|
|
|
set -x
|
|
|
|
|
|
|
|
if [ "$1" = "--in-docker" ]; then
|
|
|
|
# Runs in docker, performs the actual build.
|
2019-06-20 13:06:54 +03:00
|
|
|
shift
|
2019-02-13 11:06:57 +03:00
|
|
|
|
2022-06-27 14:45:34 +03:00
|
|
|
apk add bash curl gcc g++ make musl-dev linux-headers bsd-compat-headers git python3 perl patch
|
2019-02-13 11:06:57 +03:00
|
|
|
|
|
|
|
git clone /v /librdkafka
|
|
|
|
|
|
|
|
cd /librdkafka
|
2019-06-20 13:06:54 +03:00
|
|
|
./configure --install-deps --disable-gssapi --disable-lz4-ext --enable-static $*
|
2019-02-13 11:06:57 +03:00
|
|
|
make -j
|
|
|
|
examples/rdkafka_example -X builtin.features
|
2020-05-06 11:33:53 +03:00
|
|
|
CI=true make -C tests run_local_quick
|
2019-02-13 11:06:57 +03:00
|
|
|
|
|
|
|
# Create a tarball in artifacts/
|
|
|
|
cd src
|
|
|
|
ldd librdkafka.so.1
|
2020-12-23 11:54:04 +03:00
|
|
|
tar cvzf /v/artifacts/alpine-librdkafka.tgz librdkafka.so.1 librdkafka*.a rdkafka-static.pc
|
2019-02-13 11:06:57 +03:00
|
|
|
cd ../..
|
|
|
|
|
|
|
|
else
|
|
|
|
# Runs on the host, simply spins up the in-docker build.
|
|
|
|
if [ ! -f configure.self ]; then
|
|
|
|
echo "Must be run from the top-level librdkafka dir"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
mkdir -p artifacts
|
|
|
|
|
2021-03-10 10:35:59 +03:00
|
|
|
exec docker run -v $PWD:/v alpine:3.12 /v/packaging/alpine/$(basename $0) --in-docker $*
|
2019-02-13 11:06:57 +03:00
|
|
|
fi
|