diff options
Diffstat (limited to 'fluent-bit/lib/librdkafka-2.1.0/packaging/mingw-w64')
5 files changed, 137 insertions, 0 deletions
diff --git a/fluent-bit/lib/librdkafka-2.1.0/packaging/mingw-w64/configure-build-msys2-mingw-static.sh b/fluent-bit/lib/librdkafka-2.1.0/packaging/mingw-w64/configure-build-msys2-mingw-static.sh new file mode 100644 index 000000000..a5162caad --- /dev/null +++ b/fluent-bit/lib/librdkafka-2.1.0/packaging/mingw-w64/configure-build-msys2-mingw-static.sh @@ -0,0 +1,52 @@ +#!/bin/bash + +set -e + +cmake \ + -G "MinGW Makefiles" \ + -D CMAKE_INSTALL_PREFIX="$PWD/dest/" \ + -D RDKAFKA_BUILD_STATIC=ON \ + . + +$mingw64 mingw32-make +$mingw64 mingw32-make install + +# Bundle all the static dependencies with the static lib we just built +mkdir mergescratch +pushd mergescratch +cp /C/msys64/mingw64/lib/libzstd.a ./ +cp /C/msys64/mingw64/lib/libcrypto.a ./ +cp /C/msys64/mingw64/lib/liblz4.a ./ +cp /C/msys64/mingw64/lib/libssl.a ./ +cp /C/msys64/mingw64/lib/libz.a ./ +cp ../src/librdkafka.a ./ + +# Have to rename because ar won't work with + in the name +cp ../src-cpp/librdkafka++.a ./librdkafkacpp.a +ar -M << EOF +create librdkafka-static.a +addlib librdkafka.a +addlib libzstd.a +addlib libcrypto.a +addlib liblz4.a +addlib libssl.a +addlib libz.a +save +end +EOF + +ar -M << EOF +create librdkafkacpp-static.a +addlib librdkafka-static.a +addlib librdkafkacpp.a +save +end +EOF + +strip -g ./librdkafka-static.a +strip -g ./librdkafkacpp-static.a +cp ./librdkafka-static.a ../dest/lib/ +cp ./librdkafkacpp-static.a ../dest/lib/librdkafka++-static.a +popd +rm -rf ./mergescratch + diff --git a/fluent-bit/lib/librdkafka-2.1.0/packaging/mingw-w64/configure-build-msys2-mingw.sh b/fluent-bit/lib/librdkafka-2.1.0/packaging/mingw-w64/configure-build-msys2-mingw.sh new file mode 100644 index 000000000..b0b81fe0a --- /dev/null +++ b/fluent-bit/lib/librdkafka-2.1.0/packaging/mingw-w64/configure-build-msys2-mingw.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +set -e + +cmake \ + -G "MinGW Makefiles" \ + -D CMAKE_INSTALL_PREFIX="$PWD/dest/" \ + -D WITHOUT_WIN32_CONFIG=ON \ + -D RDKAFKA_BUILD_EXAMPLES=ON \ + -D RDKAFKA_BUILD_TESTS=ON \ + -D RDKAFKA_BUILD_STATIC=OFF \ + -D CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=TRUE . + +$mingw64 mingw32-make +$mingw64 mingw32-make install + +cd tests +cp ../dest/bin/librdkafka.dll ./ +cp ../dest/bin/librdkafka++.dll ./ +CI=true ./test-runner.exe -l -Q +cd .. diff --git a/fluent-bit/lib/librdkafka-2.1.0/packaging/mingw-w64/run-tests.sh b/fluent-bit/lib/librdkafka-2.1.0/packaging/mingw-w64/run-tests.sh new file mode 100644 index 000000000..6749add5d --- /dev/null +++ b/fluent-bit/lib/librdkafka-2.1.0/packaging/mingw-w64/run-tests.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +set -e + +cd tests +./test-runner.exe -l -Q -p1 0000 diff --git a/fluent-bit/lib/librdkafka-2.1.0/packaging/mingw-w64/semaphoreci-build.sh b/fluent-bit/lib/librdkafka-2.1.0/packaging/mingw-w64/semaphoreci-build.sh new file mode 100644 index 000000000..378545b44 --- /dev/null +++ b/fluent-bit/lib/librdkafka-2.1.0/packaging/mingw-w64/semaphoreci-build.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# + +set -ex + +if [[ $1 == "--static" ]]; then + linkage="static" + shift +else +linkage="dynamic" +fi + +if [[ -z $1 ]]; then + echo "Usage: $0 [--static] <relative-path-to-output-librdkafka.tgz>" + exit 1 +fi + +archive="${PWD}/$1" + +source ./packaging/mingw-w64/travis-before-install.sh + +if [[ $linkage == "static" ]]; then + ./packaging/mingw-w64/configure-build-msys2-mingw-static.sh +else + ./packaging/mingw-w64/configure-build-msys2-mingw.sh +fi + + +./packaging/mingw-w64/run-tests.sh + +pushd dest +tar cvzf $archive . +sha256sum $archive +popd + + + + diff --git a/fluent-bit/lib/librdkafka-2.1.0/packaging/mingw-w64/travis-before-install.sh b/fluent-bit/lib/librdkafka-2.1.0/packaging/mingw-w64/travis-before-install.sh new file mode 100644 index 000000000..e75507f93 --- /dev/null +++ b/fluent-bit/lib/librdkafka-2.1.0/packaging/mingw-w64/travis-before-install.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +set -e + +export msys2='cmd //C RefreshEnv.cmd ' +export msys2+='& set MSYS=winsymlinks:nativestrict ' +export msys2+='& C:\\msys64\\msys2_shell.cmd -defterm -no-start' +export mingw64="$msys2 -mingw64 -full-path -here -c "\"\$@"\" --" +export msys2+=" -msys2 -c "\"\$@"\" --" + +# Have to update pacman first or choco upgrade will failure due to migration +# to zstd instead of xz compression +$msys2 pacman -Sy --noconfirm pacman + +## Install more MSYS2 packages from https://packages.msys2.org/base here +$msys2 pacman --sync --noconfirm --needed mingw-w64-x86_64-gcc mingw-w64-x86_64-make mingw-w64-x86_64-cmake mingw-w64-x86_64-openssl mingw-w64-x86_64-lz4 mingw-w64-x86_64-zstd + +taskkill //IM gpg-agent.exe //F || true # https://travis-ci.community/t/4967 +export PATH=/C/msys64/mingw64/bin:$PATH +export MAKE=mingw32-make # so that Autotools can find it |