From 02c4578adeeed9363b45d9b4c4e47aa773173e35 Mon Sep 17 00:00:00 2001 From: BtbN Date: Sat, 10 Aug 2024 00:02:38 +0200 Subject: [PATCH] Add libzmq --- scripts.d/50-libzmq.sh | 48 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100755 scripts.d/50-libzmq.sh diff --git a/scripts.d/50-libzmq.sh b/scripts.d/50-libzmq.sh new file mode 100755 index 000000000..aa526a6ea --- /dev/null +++ b/scripts.d/50-libzmq.sh @@ -0,0 +1,48 @@ +#!/bin/bash + +SCRIPT_REPO="https://github.com/zeromq/libzmq.git" +SCRIPT_COMMIT="b95d94935ed107679fd0ad9efd2f3d47309b6fd3" + +ffbuild_enabled() { + return 0 +} + +ffbuild_dockerbuild() { + mkdir build && cd build + + local myconf=( + -DCMAKE_TOOLCHAIN_FILE="$FFBUILD_CMAKE_TOOLCHAIN" + -DCMAKE_BUILD_TYPE=Release + -DCMAKE_INSTALL_PREFIX="$FFBUILD_PREFIX" + -DBUILD_SHARED=OFF + -DBUILD_STATIC=ON + -DBUILD_TESTS=OFF + -DENABLE_INTRINSICS=ON + -DENABLE_DRAFTS=OFF + -DWITH_TLS=OFF + -DWITH_DOCS=OFF + -DENABLE_CPACK=OFF + -DENABLE_NO_EXPORT=ON + ) + + if [[ $TARGET == win* ]]; then + myconf+=( -DPOLLER="epoll" ) + fi + + cmake "${myconf[@]}" .. + make -j$(nproc) + make install + + { + echo "Cflags.private: -DZMQ_NO_EXPORT -DZMQ_STATIC" + echo "Libs.private: -lws2_32 -liphlpapi" + } >> "$FFBUILD_PREFIX"/lib/pkgconfig/libzmq.pc +} + +ffbuild_configure() { + echo --enable-libzmq +} + +ffbuild_unconfigure() { + echo --disable-libzmq +}