1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
|
#!/bin/bash
#
#
# Build Python packages using cibuildwheel (and docker)
#
# Usage:
# tools/cibuildwheel-build.sh <output_dir> [<librdkafka-tag(def:master)>]
if [[ ! -f tools/$(basename $0) ]]; then
echo "$0: must be executed from the confluent-kafka-python root directory"
exit 1
fi
OUT_DIR=$1
if [[ -z $OUT_DIR ]]; then
echo "Usage: $0 <out_dir> [<librdkafka-tag>]"
exit 1
fi
LIBRDKAFKA_VERSION=$2
if [[ -z $LIBRDKAFKA_VERSION ]]; then
LIBRDKAFKA_VERSION=master
fi
set -e
_CIBW_ARGS=
case "$(uname -s)" in
Linux*)
export CIBW_BEFORE_BUILD="tools/prepare-cibuildwheel-linux.sh $LIBRDKAFKA_VERSION"
if [[ -z $TRAVIS_OS_NAME ]]; then
_CIBW_ARGS="--platform linux"
fi
;;
Darwin*)
export CIBW_BEFORE_BUILD="tools/bootstrap-librdkafka.sh --require-ssl $LIBRDKAFKA_VERSION librdkafka-tmp"
export CFLAGS="-Ilibrdkafka-tmp/include"
export LDFLAGS="-Llibrdkafka-tmp/lib"
if [[ -z $TRAVIS_OS_NAME ]]; then
_CIBW_ARGS="--platform macos"
fi
;;
*)
echo "$0: Unsupported platform: $(uname -s)"
exit 1
;;
esac
if ! which cibuildwheel 2>/dev/null ; then
pip install cibuildwheel==0.4.1
fi
cibuildwheel $_CIBW_ARGS --output-dir "$OUT_DIR"
echo "Packages in $OUT_DIR:"
(cd $OUT_DIR ; ls -la)
|