* [Buildroot] [PATCH v1 1/3] package/librdkafka: add new package
@ 2026-02-19 22:12 Thomas Devoogdt
2026-02-19 22:12 ` [Buildroot] [PATCH v1 2/3] package/fluent-bit: link against the new librdkafka package Thomas Devoogdt
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Thomas Devoogdt @ 2026-02-19 22:12 UTC (permalink / raw)
To: buildroot; +Cc: Thomas Devoogdt
Will be a dependency of fluent-bit.
Signed-off-by: Thomas Devoogdt <thomas@devoogdt.com>
---
$ ./utils/test-pkg -p librdkafka -a
arm-aarch64 [ 1/32]: OK
bootlin-aarch64-glibc [ 2/32]: OK
bootlin-aarch64-glibc-old [ 3/32]: OK
bootlin-arcle-hs38-uclibc [ 4/32]: OK
bootlin-armv5-uclibc [ 5/32]: OK
bootlin-armv7-glibc [ 6/32]: OK
bootlin-armv7m-uclibc [ 7/32]: OK
bootlin-armv7-musl [ 8/32]: OK
bootlin-m68k-5208-uclibc [ 9/32]: SKIPPED
bootlin-m68k-68040-uclibc [10/32]: OK
bootlin-microblazeel-uclibc [11/32]: OK
bootlin-mips64el-glibc [12/32]: OK
bootlin-mipsel32r6-glibc [13/32]: OK
bootlin-mipsel-uclibc [14/32]: OK
bootlin-openrisc-uclibc [15/32]: OK
bootlin-powerpc64le-power8-glibc [16/32]: OK
bootlin-powerpc-e500mc-uclibc [17/32]: OK
bootlin-riscv32-glibc [18/32]: OK
bootlin-riscv64-glibc [19/32]: OK
bootlin-riscv64-musl [20/32]: OK
bootlin-s390x-z13-glibc [21/32]: OK
bootlin-sh4-uclibc [22/32]: OK
bootlin-sparc64-glibc [23/32]: OK
bootlin-sparc-uclibc [24/32]: OK
bootlin-x86-64-glibc [25/32]: OK
bootlin-x86-64-musl [26/32]: OK
bootlin-x86-64-uclibc [27/32]: OK
bootlin-x86-i686-musl [28/32]: OK
bootlin-xtensa-uclibc [29/32]: OK
br-arm-basic [30/32]: OK
br-arm-full-nothread [31/32]: SKIPPED
br-arm-full-static [32/32]: OK
32 builds, 2 skipped, 0 build failed, 0 legal-info failed, 0 show-info failed
---
$ ./utils/test-pkg -p librdkafka -c librdkafka.config -a
arm-aarch64 [ 1/32]: OK
bootlin-aarch64-glibc [ 2/32]: OK
bootlin-aarch64-glibc-old [ 3/32]: OK
bootlin-arcle-hs38-uclibc [ 4/32]: OK
bootlin-armv5-uclibc [ 5/32]: OK
bootlin-armv7-glibc [ 6/32]: OK
bootlin-armv7m-uclibc [ 7/32]: OK
bootlin-armv7-musl [ 8/32]: OK
bootlin-m68k-5208-uclibc [ 9/32]: SKIPPED
bootlin-m68k-68040-uclibc [10/32]: OK
bootlin-microblazeel-uclibc [11/32]: OK
bootlin-mips64el-glibc [12/32]: OK
bootlin-mipsel32r6-glibc [13/32]: OK
bootlin-mipsel-uclibc [14/32]: OK
bootlin-openrisc-uclibc [15/32]: OK
bootlin-powerpc64le-power8-glibc [16/32]: OK
bootlin-powerpc-e500mc-uclibc [17/32]: OK
bootlin-riscv32-glibc [18/32]: OK
bootlin-riscv64-glibc [19/32]: OK
bootlin-riscv64-musl [20/32]: OK
bootlin-s390x-z13-glibc [21/32]: OK
bootlin-sh4-uclibc [22/32]: OK
bootlin-sparc64-glibc [23/32]: OK
bootlin-sparc-uclibc [24/32]: OK
bootlin-x86-64-glibc [25/32]: OK
bootlin-x86-64-musl [26/32]: OK
bootlin-x86-64-uclibc [27/32]: OK
bootlin-x86-i686-musl [28/32]: OK
bootlin-xtensa-uclibc [29/32]: OK
br-arm-basic [30/32]: OK
br-arm-full-nothread [31/32]: SKIPPED
br-arm-full-static [32/32]: OK
32 builds, 2 skipped, 0 build failed, 0 legal-info failed, 0 show-info failed
$ cat librdkafka.config
BR2_PACKAGE_ZLIB=y
BR2_PACKAGE_LIBCURL=y
BR2_PACKAGE_ZSTD=y
BR2_PACKAGE_OPENSSL=y
BR2_PACKAGE_LIBRDKAFKA=y
---
DEVELOPERS | 1 +
package/Config.in | 1 +
...-allow-compilation-without-C-support.patch | 127 ++++++++++++++++++
....c-fix-curl-curl.h-include-when-WITH.patch | 32 +++++
...d.c-add-proper-HAVE_GETENTROPY-check.patch | 37 +++++
package/librdkafka/Config.in | 14 ++
package/librdkafka/librdkafka.hash | 4 +
package/librdkafka/librdkafka.mk | 51 +++++++
8 files changed, 267 insertions(+)
create mode 100644 package/librdkafka/0001-CMakeLists.txt-allow-compilation-without-C-support.patch
create mode 100644 package/librdkafka/0002-src-rdkafka_conf.c-fix-curl-curl.h-include-when-WITH.patch
create mode 100644 package/librdkafka/0003-src-rdrand.c-add-proper-HAVE_GETENTROPY-check.patch
create mode 100644 package/librdkafka/Config.in
create mode 100644 package/librdkafka/librdkafka.hash
create mode 100644 package/librdkafka/librdkafka.mk
diff --git a/DEVELOPERS b/DEVELOPERS
index 87854f3760c..61c455fb638 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -3191,6 +3191,7 @@ F: package/fcgiwrap/
N: Thomas Devoogdt <thomas@devoogdt.com>
F: package/fluent-bit/
+F: package/librdkafka/
F: package/libsoup3/
F: package/yq/
diff --git a/package/Config.in b/package/Config.in
index 371a1c33e1f..ef1746f80a7 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -2498,6 +2498,7 @@ endif
source "package/leafnode2/Config.in"
source "package/lft/Config.in"
source "package/lftp/Config.in"
+ source "package/librdkafka/Config.in"
source "package/lighttpd/Config.in"
source "package/linknx/Config.in"
source "package/links/Config.in"
diff --git a/package/librdkafka/0001-CMakeLists.txt-allow-compilation-without-C-support.patch b/package/librdkafka/0001-CMakeLists.txt-allow-compilation-without-C-support.patch
new file mode 100644
index 00000000000..9615aef408c
--- /dev/null
+++ b/package/librdkafka/0001-CMakeLists.txt-allow-compilation-without-C-support.patch
@@ -0,0 +1,127 @@
+From 4584734fc039e06dea71c94045283f3108c7fae8 Mon Sep 17 00:00:00 2001
+From: Thomas Devoogdt <thomas@devoogdt.com>
+Date: Sun, 15 Feb 2026 20:41:10 +0100
+Subject: [PATCH] CMakeLists.txt: allow compilation without C++ support
+
+$ CXX=/bin/false cmake . && make
+
+Upstream: https://github.com/confluentinc/librdkafka/pull/5311
+Signed-off-by: Thomas Devoogdt <thomas@devoogdt.com>
+---
+ CMakeLists.txt | 25 ++++++++++++++++++++-----
+ examples/CMakeLists.txt | 30 ++++++++++++++++++++----------
+ 2 files changed, 40 insertions(+), 15 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index f3d05bad..7676f897 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -3,7 +3,15 @@ cmake_minimum_required(VERSION 3.5)
+ include("packaging/cmake/parseversion.cmake")
+ parseversion("src/rdkafka.h")
+
+-project(RdKafka VERSION ${RDKAFKA_VERSION})
++project(RdKafka VERSION ${RDKAFKA_VERSION} LANGUAGES C)
++
++include(CheckLanguage)
++check_language(CXX)
++if(CMAKE_CXX_COMPILER)
++ enable_language(CXX)
++else()
++ message(STATUS "C++ compiler not found, skipping C++ support")
++endif()
+
+ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/packaging/cmake/Modules/")
+
+@@ -181,7 +189,7 @@ endif()
+
+ option(RDKAFKA_BUILD_STATIC "Build static rdkafka library" OFF)
+ option(RDKAFKA_BUILD_EXAMPLES "Build examples" ON)
+-option(RDKAFKA_BUILD_TESTS "Build tests" ON)
++option(RDKAFKA_BUILD_TESTS "Build tests" CMAKE_CXX_COMPILER)
+ if(WIN32)
+ option(WITHOUT_WIN32_CONFIG "Avoid including win32_config.h on cmake builds" ON)
+ endif(WIN32)
+@@ -279,13 +287,20 @@ install(
+ )
+
+ add_subdirectory(src)
+-add_subdirectory(src-cpp)
++
++if(CMAKE_CXX_COMPILER)
++ add_subdirectory(src-cpp)
++endif()
+
+ if(RDKAFKA_BUILD_EXAMPLES)
+ add_subdirectory(examples)
+ endif()
+
+ if(RDKAFKA_BUILD_TESTS)
+- enable_testing()
+- add_subdirectory(tests)
++ if(CMAKE_CXX_COMPILER)
++ enable_testing()
++ add_subdirectory(tests)
++ else()
++ message(FATAL_ERROR "Building tests needs C++ suport")
++ endif()
+ endif()
+diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
+index 91851d2c..28ce6e79 100644
+--- a/examples/CMakeLists.txt
++++ b/examples/CMakeLists.txt
+@@ -5,8 +5,10 @@ endif(WIN32)
+ add_executable(producer producer.c ${win32_sources})
+ target_link_libraries(producer PUBLIC rdkafka)
+
+-add_executable(producer_cpp producer.cpp ${win32_sources})
+-target_link_libraries(producer_cpp PUBLIC rdkafka++)
++if(CMAKE_CXX_COMPILER)
++ add_executable(producer_cpp producer.cpp ${win32_sources})
++ target_link_libraries(producer_cpp PUBLIC rdkafka++)
++endif(CMAKE_CXX_COMPILER)
+
+ add_executable(consumer consumer.c ${win32_sources})
+ target_link_libraries(consumer PUBLIC rdkafka)
+@@ -14,14 +16,20 @@ target_link_libraries(consumer PUBLIC rdkafka)
+ add_executable(rdkafka_performance rdkafka_performance.c ${win32_sources})
+ target_link_libraries(rdkafka_performance PUBLIC rdkafka)
+
+-add_executable(rdkafka_example_cpp rdkafka_example.cpp ${win32_sources})
+-target_link_libraries(rdkafka_example_cpp PUBLIC rdkafka++)
++if(CMAKE_CXX_COMPILER)
++ add_executable(rdkafka_example_cpp rdkafka_example.cpp ${win32_sources})
++ target_link_libraries(rdkafka_example_cpp PUBLIC rdkafka++)
++endif(CMAKE_CXX_COMPILER)
+
+-add_executable(rdkafka_complex_consumer_example_cpp rdkafka_complex_consumer_example.cpp ${win32_sources})
+-target_link_libraries(rdkafka_complex_consumer_example_cpp PUBLIC rdkafka++)
++if(CMAKE_CXX_COMPILER)
++ add_executable(rdkafka_complex_consumer_example_cpp rdkafka_complex_consumer_example.cpp ${win32_sources})
++ target_link_libraries(rdkafka_complex_consumer_example_cpp PUBLIC rdkafka++)
++endif(CMAKE_CXX_COMPILER)
+
+-add_executable(openssl_engine_example_cpp openssl_engine_example.cpp ${win32_sources})
+-target_link_libraries(openssl_engine_example_cpp PUBLIC rdkafka++)
++if(CMAKE_CXX_COMPILER)
++ add_executable(openssl_engine_example_cpp openssl_engine_example.cpp ${win32_sources})
++ target_link_libraries(openssl_engine_example_cpp PUBLIC rdkafka++)
++endif(CMAKE_CXX_COMPILER)
+
+ add_executable(misc misc.c ${win32_sources})
+ target_link_libraries(misc PUBLIC rdkafka)
+@@ -73,7 +81,9 @@ if(NOT WIN32)
+ add_executable(rdkafka_complex_consumer_example rdkafka_complex_consumer_example.c)
+ target_link_libraries(rdkafka_complex_consumer_example PUBLIC rdkafka)
+
+- add_executable(kafkatest_verifiable_client kafkatest_verifiable_client.cpp)
+- target_link_libraries(kafkatest_verifiable_client PUBLIC rdkafka++)
++ if(CMAKE_CXX_COMPILER)
++ add_executable(kafkatest_verifiable_client kafkatest_verifiable_client.cpp)
++ target_link_libraries(kafkatest_verifiable_client PUBLIC rdkafka++)
++ endif(CMAKE_CXX_COMPILER)
+
+ endif(NOT WIN32)
+--
+2.43.0
+
diff --git a/package/librdkafka/0002-src-rdkafka_conf.c-fix-curl-curl.h-include-when-WITH.patch b/package/librdkafka/0002-src-rdkafka_conf.c-fix-curl-curl.h-include-when-WITH.patch
new file mode 100644
index 00000000000..dec80d538c9
--- /dev/null
+++ b/package/librdkafka/0002-src-rdkafka_conf.c-fix-curl-curl.h-include-when-WITH.patch
@@ -0,0 +1,32 @@
+From 5061a5b33dce11ada740e2a34137dce6934b731a Mon Sep 17 00:00:00 2001
+From: Thomas Devoogdt <thomas@devoogdt.com>
+Date: Sun, 15 Feb 2026 18:37:16 +0100
+Subject: [PATCH] src/rdkafka_conf.c: fix curl/curl.h include when
+ WITH_CURL=OFF
+
+Change #ifdef to #if for WITH_OAUTHBEARER_OIDC preprocessor check.
+When using CMake's cmakedefine01, the macro is always defined (as 0 or 1),
+so #ifdef always evaluates to true. Using #if correctly checks the value.
+
+Upstream: https://github.com/confluentinc/librdkafka/pull/5309
+Signed-off-by: Thomas Devoogdt <thomas@devoogdt.com>
+---
+ src/rdkafka_conf.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/rdkafka_conf.c b/src/rdkafka_conf.c
+index 0e346e74..f8f0d0ca 100644
+--- a/src/rdkafka_conf.c
++++ b/src/rdkafka_conf.c
+@@ -56,7 +56,7 @@
+ #include <windows.h>
+ #endif
+
+-#ifdef WITH_OAUTHBEARER_OIDC
++#if WITH_OAUTHBEARER_OIDC
+ #include <curl/curl.h>
+ #endif
+
+--
+2.43.0
+
diff --git a/package/librdkafka/0003-src-rdrand.c-add-proper-HAVE_GETENTROPY-check.patch b/package/librdkafka/0003-src-rdrand.c-add-proper-HAVE_GETENTROPY-check.patch
new file mode 100644
index 00000000000..fc946958910
--- /dev/null
+++ b/package/librdkafka/0003-src-rdrand.c-add-proper-HAVE_GETENTROPY-check.patch
@@ -0,0 +1,37 @@
+From 692d1dc27b58231af9f0b96816f3445a66bfdbf3 Mon Sep 17 00:00:00 2001
+From: Thomas Devoogdt <thomas@devoogdt.com>
+Date: Sun, 15 Feb 2026 19:08:27 +0100
+Subject: [PATCH] src/rdrand.c: add proper HAVE_GETENTROPY check
+
+/home/thomas/br-test-pkg/bootlin-aarch64-glibc-old/build/librdkafka-2.13.0/src/rdrand.c:37:24: fatal error: sys/random.h: No such file or directory
+ #include <sys/random.h>
+ ^
+
+This should be covered by packaging/cmake/try_compile/getentropy_test.c.
+
+Upstream: https://github.com/confluentinc/librdkafka/pull/5310
+Signed-off-by: Thomas Devoogdt <thomas@devoogdt.com>
+---
+ src/rdrand.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/src/rdrand.c b/src/rdrand.c
+index 77d02cfc..4bdc7885 100644
+--- a/src/rdrand.c
++++ b/src/rdrand.c
+@@ -32,10 +32,12 @@
+ #include "tinycthread.h"
+ #include "rdmurmur2.h"
+ #ifndef _WIN32
++#if HAVE_GETENTROPY
+ /* getentropy() can be present in one of these two */
+ #include <unistd.h>
+ #include <sys/random.h>
+ #endif
++#endif
+
+ #ifdef HAVE_OSSL_SECURE_RAND_BYTES
+ #include <openssl/rand.h>
+--
+2.43.0
+
diff --git a/package/librdkafka/Config.in b/package/librdkafka/Config.in
new file mode 100644
index 00000000000..54380e2d6e0
--- /dev/null
+++ b/package/librdkafka/Config.in
@@ -0,0 +1,14 @@
+config BR2_PACKAGE_LIBRDKAFKA
+ bool "librdkafka"
+ depends on !BR2_m68k_cf # assembler "out of range" error
+ depends on BR2_TOOLCHAIN_HAS_THREADS
+ select BR2_PACKAGE_LZ4
+ help
+ librdkafka is a C library implementation of the
+ Apache Kafka protocol, providing Producer, Consumer
+ and Admin clients.
+
+ https://github.com/confluentinc/librdkafka
+
+comment "librdkafka needs a toolchain w/ threads"
+ depends on !BR2_TOOLCHAIN_HAS_THREADS
diff --git a/package/librdkafka/librdkafka.hash b/package/librdkafka/librdkafka.hash
new file mode 100644
index 00000000000..b0975b8481a
--- /dev/null
+++ b/package/librdkafka/librdkafka.hash
@@ -0,0 +1,4 @@
+# From https://github.com/confluentinc/librdkafka/releases/tag/v2.13.0
+sha256 3bd351601d8ebcbc99b9a1316cae1b83b00edbcf9411c34287edf1791c507600 librdkafka-2.13.0.tar.gz
+# Locally computed
+sha256 b9e4616bb9dd0c9ce3fa52e81c7bfc596e60b8855a1df5dce5fa50732b1ccdec LICENSES.txt
diff --git a/package/librdkafka/librdkafka.mk b/package/librdkafka/librdkafka.mk
new file mode 100644
index 00000000000..348562b0f32
--- /dev/null
+++ b/package/librdkafka/librdkafka.mk
@@ -0,0 +1,51 @@
+################################################################################
+#
+# librdkafka
+#
+################################################################################
+
+LIBRDKAFKA_VERSION = 2.13.0
+LIBRDKAFKA_SITE = $(call github,confluentinc,librdkafka,v$(LIBRDKAFKA_VERSION))
+LIBRDKAFKA_LICENSE = BSD-2-Clause
+LIBRDKAFKA_LICENSE_FILES = LICENSES.txt
+LIBRDKAFKA_INSTALL_STAGING = YES
+LIBRDKAFKA_DEPENDENCIES = lz4
+LIBRDKAFKA_CONF_OPTS = \
+ -DRDKAFKA_BUILD_EXAMPLES=OFF \
+ -DRDKAFKA_BUILD_TESTS=OFF
+
+ifeq ($(BR2_STATIC_LIBS),y)
+LIBRDKAFKA_CONF_OPTS += -DRDKAFKA_BUILD_STATIC=ON
+else
+LIBRDKAFKA_CONF_OPTS += -DRDKAFKA_BUILD_STATIC=OFF
+endif
+
+ifeq ($(BR2_PACKAGE_ZLIB),y)
+LIBRDKAFKA_CONF_OPTS += -DWITH_ZLIB=ON
+LIBRDKAFKA_DEPENDENCIES += zlib
+else
+LIBRDKAFKA_CONF_OPTS += -DWITH_ZLIB=OFF
+endif
+
+ifeq ($(BR2_PACKAGE_LIBCURL),y)
+LIBRDKAFKA_CONF_OPTS += -DWITH_CURL=ON
+LIBRDKAFKA_DEPENDENCIES += libcurl
+else
+LIBRDKAFKA_CONF_OPTS += -DWITH_CURL=OFF
+endif
+
+ifeq ($(BR2_PACKAGE_ZSTD),y)
+LIBRDKAFKA_CONF_OPTS += -DWITH_ZSTD=ON
+LIBRDKAFKA_DEPENDENCIES += zstd
+else
+LIBRDKAFKA_CONF_OPTS += -DWITH_ZSTD=OFF
+endif
+
+ifeq ($(BR2_PACKAGE_OPENSSL),y)
+LIBRDKAFKA_CONF_OPTS += -DWITH_SSL=ON
+LIBRDKAFKA_DEPENDENCIES += openssl
+else
+LIBRDKAFKA_CONF_OPTS += -DWITH_SSL=OFF
+endif
+
+$(eval $(cmake-package))
--
2.43.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH v1 2/3] package/fluent-bit: link against the new librdkafka package
2026-02-19 22:12 [Buildroot] [PATCH v1 1/3] package/librdkafka: add new package Thomas Devoogdt
@ 2026-02-19 22:12 ` Thomas Devoogdt
2026-02-19 22:12 ` [Buildroot] [PATCH v1 3/3] support/testing/tests/package/test_fluent_bit.py: new runtime test Thomas Devoogdt
2026-03-08 8:12 ` [Buildroot] [PATCH v2 1/3] package/librdkafka: add new package Thomas Devoogdt
2 siblings, 0 replies; 6+ messages in thread
From: Thomas Devoogdt @ 2026-02-19 22:12 UTC (permalink / raw)
To: buildroot; +Cc: Thomas Devoogdt
By this, we can drop 0001-lib-librdkafka-only-require-a-C-compiler.patch.
Signed-off-by: Thomas Devoogdt <thomas@devoogdt.com>
---
...librdkafka-only-require-a-C-compiler.patch | 118 ------------------
package/fluent-bit/Config.in | 2 +-
package/fluent-bit/fluent-bit.mk | 5 +-
3 files changed, 4 insertions(+), 121 deletions(-)
delete mode 100644 package/fluent-bit/0001-lib-librdkafka-only-require-a-C-compiler.patch
diff --git a/package/fluent-bit/0001-lib-librdkafka-only-require-a-C-compiler.patch b/package/fluent-bit/0001-lib-librdkafka-only-require-a-C-compiler.patch
deleted file mode 100644
index 660ed7bed49..00000000000
--- a/package/fluent-bit/0001-lib-librdkafka-only-require-a-C-compiler.patch
+++ /dev/null
@@ -1,118 +0,0 @@
-From 7329316bdcc72aceb6bbbdf8711f5bf8894c2a15 Mon Sep 17 00:00:00 2001
-From: Thomas Devoogdt <thomas.devoogdt@barco.com>
-Date: Tue, 25 Jul 2023 09:10:41 +0200
-Subject: [PATCH] lib: librdkafka: only require a C compiler
-
-Upstream: https://github.com/confluentinc/librdkafka/pull/4366
-Signed-off-by: Thomas Devoogdt <thomas.devoogdt@barco.com>
----
- lib/librdkafka-2.10.1/CMakeLists.txt | 22 +++++++++++--
- lib/librdkafka-2.10.1/examples/CMakeLists.txt | 31 ++++++++++++-------
- 2 files changed, 39 insertions(+), 14 deletions(-)
-
-diff --git a/lib/librdkafka-2.10.1/CMakeLists.txt b/lib/librdkafka-2.10.1/CMakeLists.txt
-index f3d05bad7..8ef47053a 100644
---- a/lib/librdkafka-2.10.1/CMakeLists.txt
-+++ b/lib/librdkafka-2.10.1/CMakeLists.txt
-@@ -3,7 +3,16 @@ cmake_minimum_required(VERSION 3.5)
- include("packaging/cmake/parseversion.cmake")
- parseversion("src/rdkafka.h")
-
--project(RdKafka VERSION ${RDKAFKA_VERSION})
-+project(RdKafka VERSION ${RDKAFKA_VERSION} LANGUAGES C)
-+
-+# Check for CXX support
-+include(CheckLanguage)
-+check_language(CXX)
-+if(CMAKE_CXX_COMPILER)
-+ enable_language(CXX)
-+else()
-+ message(STATUS "C++ compiler not found, skipping C++ support")
-+endif()
-
- set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/packaging/cmake/Modules/")
-
-@@ -181,7 +190,11 @@ endif()
-
- option(RDKAFKA_BUILD_STATIC "Build static rdkafka library" OFF)
- option(RDKAFKA_BUILD_EXAMPLES "Build examples" ON)
--option(RDKAFKA_BUILD_TESTS "Build tests" ON)
-+
-+if(CMAKE_CXX_COMPILER)
-+ option(RDKAFKA_BUILD_TESTS "Build tests" ON)
-+endif()
-+
- if(WIN32)
- option(WITHOUT_WIN32_CONFIG "Avoid including win32_config.h on cmake builds" ON)
- endif(WIN32)
-@@ -279,7 +292,10 @@ install(
- )
-
- add_subdirectory(src)
--add_subdirectory(src-cpp)
-+
-+if(CMAKE_CXX_COMPILER)
-+ add_subdirectory(src-cpp)
-+endif()
-
- if(RDKAFKA_BUILD_EXAMPLES)
- add_subdirectory(examples)
-diff --git a/lib/librdkafka-2.10.1/examples/CMakeLists.txt b/lib/librdkafka-2.10.1/examples/CMakeLists.txt
-index 91851d2cb..6874195ce 100644
---- a/lib/librdkafka-2.10.1/examples/CMakeLists.txt
-+++ b/lib/librdkafka-2.10.1/examples/CMakeLists.txt
-@@ -5,8 +5,10 @@ endif(WIN32)
- add_executable(producer producer.c ${win32_sources})
- target_link_libraries(producer PUBLIC rdkafka)
-
--add_executable(producer_cpp producer.cpp ${win32_sources})
--target_link_libraries(producer_cpp PUBLIC rdkafka++)
-+if(CMAKE_CXX_COMPILER)
-+ add_executable(producer_cpp producer.cpp ${win32_sources})
-+ target_link_libraries(producer_cpp PUBLIC rdkafka++)
-+endif()
-
- add_executable(consumer consumer.c ${win32_sources})
- target_link_libraries(consumer PUBLIC rdkafka)
-@@ -14,14 +16,20 @@ target_link_libraries(consumer PUBLIC rdkafka)
- add_executable(rdkafka_performance rdkafka_performance.c ${win32_sources})
- target_link_libraries(rdkafka_performance PUBLIC rdkafka)
-
--add_executable(rdkafka_example_cpp rdkafka_example.cpp ${win32_sources})
--target_link_libraries(rdkafka_example_cpp PUBLIC rdkafka++)
-+if(CMAKE_CXX_COMPILER)
-+ add_executable(rdkafka_example_cpp rdkafka_example.cpp ${win32_sources})
-+ target_link_libraries(rdkafka_example_cpp PUBLIC rdkafka++)
-+endif()
-
--add_executable(rdkafka_complex_consumer_example_cpp rdkafka_complex_consumer_example.cpp ${win32_sources})
--target_link_libraries(rdkafka_complex_consumer_example_cpp PUBLIC rdkafka++)
-+if(CMAKE_CXX_COMPILER)
-+ add_executable(rdkafka_complex_consumer_example_cpp rdkafka_complex_consumer_example.cpp ${win32_sources})
-+ target_link_libraries(rdkafka_complex_consumer_example_cpp PUBLIC rdkafka++)
-+endif()
-
--add_executable(openssl_engine_example_cpp openssl_engine_example.cpp ${win32_sources})
--target_link_libraries(openssl_engine_example_cpp PUBLIC rdkafka++)
-+if(CMAKE_CXX_COMPILER)
-+ add_executable(openssl_engine_example_cpp openssl_engine_example.cpp ${win32_sources})
-+ target_link_libraries(openssl_engine_example_cpp PUBLIC rdkafka++)
-+endif()
-
- add_executable(misc misc.c ${win32_sources})
- target_link_libraries(misc PUBLIC rdkafka)
-@@ -73,7 +81,8 @@ if(NOT WIN32)
- add_executable(rdkafka_complex_consumer_example rdkafka_complex_consumer_example.c)
- target_link_libraries(rdkafka_complex_consumer_example PUBLIC rdkafka)
-
-- add_executable(kafkatest_verifiable_client kafkatest_verifiable_client.cpp)
-- target_link_libraries(kafkatest_verifiable_client PUBLIC rdkafka++)
--
-+ if(CMAKE_CXX_COMPILER)
-+ add_executable(kafkatest_verifiable_client kafkatest_verifiable_client.cpp)
-+ target_link_libraries(kafkatest_verifiable_client PUBLIC rdkafka++)
-+ endif()
- endif(NOT WIN32)
---
-2.43.0
-
diff --git a/package/fluent-bit/Config.in b/package/fluent-bit/Config.in
index 2af62797447..f8494064acc 100644
--- a/package/fluent-bit/Config.in
+++ b/package/fluent-bit/Config.in
@@ -4,7 +4,7 @@ config BR2_PACKAGE_FLUENT_BIT
depends on BR2_TOOLCHAIN_HAS_SYNC_4
depends on !BR2_STATIC_LIBS # dlfcn.h
select BR2_PACKAGE_C_ARES
- select BR2_PACKAGE_LIBOPENSSL_ENGINES # needed by bundled librdkafka
+ select BR2_PACKAGE_LIBRDKAFKA
select BR2_PACKAGE_LIBYAML
select BR2_PACKAGE_MSGPACK_C
select BR2_PACKAGE_MUSL_FTS if !BR2_TOOLCHAIN_USES_GLIBC
diff --git a/package/fluent-bit/fluent-bit.mk b/package/fluent-bit/fluent-bit.mk
index f571896797c..a3a44b8dbe7 100644
--- a/package/fluent-bit/fluent-bit.mk
+++ b/package/fluent-bit/fluent-bit.mk
@@ -10,8 +10,8 @@ FLUENT_BIT_LICENSE = Apache-2.0
FLUENT_BIT_LICENSE_FILES = LICENSE
FLUENT_BIT_CPE_ID_VENDOR = treasuredata
FLUENT_BIT_CPE_ID_PRODUCT = fluent_bit
-FLUENT_BIT_DEPENDENCIES = c-ares host-bison host-flex libyaml msgpack-c \
- nghttp2 openssl sqlite zstd
+FLUENT_BIT_DEPENDENCIES = c-ares host-bison host-flex librdkafka libyaml \
+ msgpack-c nghttp2 openssl sqlite zstd
FLUENT_BIT_CMAKE_BACKEND = ninja
@@ -22,6 +22,7 @@ FLUENT_BIT_CONF_OPTS += \
-DFLB_EXAMPLES=No \
-DFLB_CHUNK_TRACE=No \
-DFLB_PREFER_SYSTEM_LIB_CARES=Yes \
+ -DFLB_PREFER_SYSTEM_LIB_KAFKA=Yes \
-DFLB_PREFER_SYSTEM_LIB_MSGPACK=Yes \
-DFLB_PREFER_SYSTEM_LIB_NGHTTP2=Yes \
-DFLB_PREFER_SYSTEM_LIB_SQLITE=Yes \
--
2.43.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH v1 3/3] support/testing/tests/package/test_fluent_bit.py: new runtime test
2026-02-19 22:12 [Buildroot] [PATCH v1 1/3] package/librdkafka: add new package Thomas Devoogdt
2026-02-19 22:12 ` [Buildroot] [PATCH v1 2/3] package/fluent-bit: link against the new librdkafka package Thomas Devoogdt
@ 2026-02-19 22:12 ` Thomas Devoogdt
2026-03-08 8:12 ` [Buildroot] [PATCH v2 1/3] package/librdkafka: add new package Thomas Devoogdt
2 siblings, 0 replies; 6+ messages in thread
From: Thomas Devoogdt @ 2026-02-19 22:12 UTC (permalink / raw)
To: buildroot; +Cc: Thomas Devoogdt
Signed-off-by: Thomas Devoogdt <thomas@devoogdt.com>
---
DEVELOPERS | 1 +
.../testing/tests/package/test_fluent_bit.py | 46 +++++++++++++++++++
2 files changed, 47 insertions(+)
create mode 100644 support/testing/tests/package/test_fluent_bit.py
diff --git a/DEVELOPERS b/DEVELOPERS
index 61c455fb638..c0735c44bb7 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -3194,6 +3194,7 @@ F: package/fluent-bit/
F: package/librdkafka/
F: package/libsoup3/
F: package/yq/
+F: support/testing/tests/package/test_fluent_bit.py
N: Thomas Huth <th.huth+br@posteo.eu>
F: package/ascii-invaders/
diff --git a/support/testing/tests/package/test_fluent_bit.py b/support/testing/tests/package/test_fluent_bit.py
new file mode 100644
index 00000000000..825e4ec6d2d
--- /dev/null
+++ b/support/testing/tests/package/test_fluent_bit.py
@@ -0,0 +1,46 @@
+import os
+import json
+import time
+
+import infra.basetest
+
+
+class TestFluentBit(infra.basetest.BRTest):
+ config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
+ """
+ BR2_TARGET_ROOTFS_CPIO=y
+ # BR2_TARGET_ROOTFS_TAR is not set
+ BR2_PACKAGE_FLUENT_BIT=y
+ """
+
+ def test_run(self):
+ cpio_file = os.path.join(self.builddir, "images", "rootfs.cpio")
+ self.emulator.boot(arch="armv5",
+ kernel="builtin",
+ options=["-initrd", cpio_file])
+ self.emulator.login()
+
+ # Enable the http server
+ cmd = ("sed -i 's/http_server Off/http_server On/g' "
+ "/etc/fluent-bit/fluent-bit.conf && "
+ "/etc/init.d/S99fluent-bit restart")
+ _, exit_code = self.emulator.run(cmd)
+ self.assertEqual(exit_code, 0)
+
+ # Give some runtime
+ time.sleep(5)
+
+ # Check the uptime
+ cmd = "wget -qO- http://127.0.0.1:2020/api/v1/uptime"
+ output, exit_code = self.emulator.run(cmd)
+ self.assertEqual(exit_code, 0)
+ uptime = json.loads(output[0])
+ self.assertGreater(uptime["uptime_sec"], 3)
+
+ # Check the metrics
+ cmd = "wget -qO- http://127.0.0.1:2020/api/v1/metrics"
+ output, exit_code = self.emulator.run(cmd)
+ self.assertEqual(exit_code, 0)
+ metrics = json.loads(output[0])
+ self.assertGreater(metrics["input"]["cpu.0"]["records"], 0)
+ self.assertGreater(metrics["output"]["stdout.0"]["proc_records"], 0)
--
2.43.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH v2 1/3] package/librdkafka: add new package
2026-02-19 22:12 [Buildroot] [PATCH v1 1/3] package/librdkafka: add new package Thomas Devoogdt
2026-02-19 22:12 ` [Buildroot] [PATCH v1 2/3] package/fluent-bit: link against the new librdkafka package Thomas Devoogdt
2026-02-19 22:12 ` [Buildroot] [PATCH v1 3/3] support/testing/tests/package/test_fluent_bit.py: new runtime test Thomas Devoogdt
@ 2026-03-08 8:12 ` Thomas Devoogdt
2026-03-08 8:12 ` [Buildroot] [PATCH v2 2/3] package/fluent-bit: link against the new librdkafka package Thomas Devoogdt
2026-03-08 8:12 ` [Buildroot] [PATCH v2 3/3] support/testing/tests/package/test_fluent_bit.py: new runtime test Thomas Devoogdt
2 siblings, 2 replies; 6+ messages in thread
From: Thomas Devoogdt @ 2026-03-08 8:12 UTC (permalink / raw)
To: thomas; +Cc: buildroot
Will be a dependency of fluent-bit.
Signed-off-by: Thomas Devoogdt <thomas@devoogdt.com>
---
v2: bump to 2.13.2
---
$ ./utils/test-pkg -p librdkafka -a
arm-aarch64 [ 1/32]: OK
bootlin-aarch64-glibc [ 2/32]: OK
bootlin-aarch64-glibc-old [ 3/32]: OK
bootlin-arcle-hs38-uclibc [ 4/32]: OK
bootlin-armv5-uclibc [ 5/32]: OK
bootlin-armv7-glibc [ 6/32]: OK
bootlin-armv7m-uclibc [ 7/32]: OK
bootlin-armv7-musl [ 8/32]: OK
bootlin-m68k-5208-uclibc [ 9/32]: SKIPPED
bootlin-m68k-68040-uclibc [10/32]: OK
bootlin-microblazeel-uclibc [11/32]: OK
bootlin-mips64el-glibc [12/32]: OK
bootlin-mipsel32r6-glibc [13/32]: OK
bootlin-mipsel-uclibc [14/32]: OK
bootlin-openrisc-uclibc [15/32]: OK
bootlin-powerpc64le-power8-glibc [16/32]: OK
bootlin-powerpc-e500mc-uclibc [17/32]: OK
bootlin-riscv32-glibc [18/32]: OK
bootlin-riscv64-glibc [19/32]: OK
bootlin-riscv64-musl [20/32]: OK
bootlin-s390x-z13-glibc [21/32]: OK
bootlin-sh4-uclibc [22/32]: OK
bootlin-sparc64-glibc [23/32]: OK
bootlin-sparc-uclibc [24/32]: OK
bootlin-x86-64-glibc [25/32]: OK
bootlin-x86-64-musl [26/32]: OK
bootlin-x86-64-uclibc [27/32]: OK
bootlin-x86-i686-musl [28/32]: OK
bootlin-xtensa-uclibc [29/32]: OK
br-arm-basic [30/32]: OK
br-arm-full-nothread [31/32]: SKIPPED
br-arm-full-static [32/32]: OK
32 builds, 2 skipped, 0 build failed, 0 legal-info failed, 0 show-info failed
---
$ ./utils/test-pkg -p librdkafka -c librdkafka.config -a
arm-aarch64 [ 1/32]: OK
bootlin-aarch64-glibc [ 2/32]: OK
bootlin-aarch64-glibc-old [ 3/32]: OK
bootlin-arcle-hs38-uclibc [ 4/32]: OK
bootlin-armv5-uclibc [ 5/32]: OK
bootlin-armv7-glibc [ 6/32]: OK
bootlin-armv7m-uclibc [ 7/32]: OK
bootlin-armv7-musl [ 8/32]: OK
bootlin-m68k-5208-uclibc [ 9/32]: SKIPPED
bootlin-m68k-68040-uclibc [10/32]: OK
bootlin-microblazeel-uclibc [11/32]: OK
bootlin-mips64el-glibc [12/32]: OK
bootlin-mipsel32r6-glibc [13/32]: OK
bootlin-mipsel-uclibc [14/32]: OK
bootlin-openrisc-uclibc [15/32]: OK
bootlin-powerpc64le-power8-glibc [16/32]: OK
bootlin-powerpc-e500mc-uclibc [17/32]: OK
bootlin-riscv32-glibc [18/32]: OK
bootlin-riscv64-glibc [19/32]: OK
bootlin-riscv64-musl [20/32]: OK
bootlin-s390x-z13-glibc [21/32]: OK
bootlin-sh4-uclibc [22/32]: OK
bootlin-sparc64-glibc [23/32]: OK
bootlin-sparc-uclibc [24/32]: OK
bootlin-x86-64-glibc [25/32]: OK
bootlin-x86-64-musl [26/32]: OK
bootlin-x86-64-uclibc [27/32]: OK
bootlin-x86-i686-musl [28/32]: OK
bootlin-xtensa-uclibc [29/32]: OK
br-arm-basic [30/32]: OK
br-arm-full-nothread [31/32]: SKIPPED
br-arm-full-static [32/32]: OK
32 builds, 2 skipped, 0 build failed, 0 legal-info failed, 0 show-info failed
$ cat librdkafka.config
BR2_PACKAGE_ZLIB=y
BR2_PACKAGE_LIBCURL=y
BR2_PACKAGE_ZSTD=y
BR2_PACKAGE_OPENSSL=y
BR2_PACKAGE_LIBRDKAFKA=y
---
DEVELOPERS | 1 +
package/Config.in | 1 +
...-allow-compilation-without-C-support.patch | 127 ++++++++++++++++++
....c-fix-curl-curl.h-include-when-WITH.patch | 32 +++++
package/librdkafka/Config.in | 14 ++
package/librdkafka/librdkafka.hash | 4 +
package/librdkafka/librdkafka.mk | 51 +++++++
7 files changed, 230 insertions(+)
create mode 100644 package/librdkafka/0001-CMakeLists.txt-allow-compilation-without-C-support.patch
create mode 100644 package/librdkafka/0002-src-rdkafka_conf.c-fix-curl-curl.h-include-when-WITH.patch
create mode 100644 package/librdkafka/Config.in
create mode 100644 package/librdkafka/librdkafka.hash
create mode 100644 package/librdkafka/librdkafka.mk
diff --git a/DEVELOPERS b/DEVELOPERS
index 6bd420ae31e..f7c5b077067 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -3194,6 +3194,7 @@ F: package/fcgiwrap/
N: Thomas Devoogdt <thomas@devoogdt.com>
F: package/fluent-bit/
+F: package/librdkafka/
F: package/libsoup3/
F: package/yq/
diff --git a/package/Config.in b/package/Config.in
index 5c7ab571014..07d7e49ae7b 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -2499,6 +2499,7 @@ endif
source "package/leafnode2/Config.in"
source "package/lft/Config.in"
source "package/lftp/Config.in"
+ source "package/librdkafka/Config.in"
source "package/lighttpd/Config.in"
source "package/linknx/Config.in"
source "package/links/Config.in"
diff --git a/package/librdkafka/0001-CMakeLists.txt-allow-compilation-without-C-support.patch b/package/librdkafka/0001-CMakeLists.txt-allow-compilation-without-C-support.patch
new file mode 100644
index 00000000000..9615aef408c
--- /dev/null
+++ b/package/librdkafka/0001-CMakeLists.txt-allow-compilation-without-C-support.patch
@@ -0,0 +1,127 @@
+From 4584734fc039e06dea71c94045283f3108c7fae8 Mon Sep 17 00:00:00 2001
+From: Thomas Devoogdt <thomas@devoogdt.com>
+Date: Sun, 15 Feb 2026 20:41:10 +0100
+Subject: [PATCH] CMakeLists.txt: allow compilation without C++ support
+
+$ CXX=/bin/false cmake . && make
+
+Upstream: https://github.com/confluentinc/librdkafka/pull/5311
+Signed-off-by: Thomas Devoogdt <thomas@devoogdt.com>
+---
+ CMakeLists.txt | 25 ++++++++++++++++++++-----
+ examples/CMakeLists.txt | 30 ++++++++++++++++++++----------
+ 2 files changed, 40 insertions(+), 15 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index f3d05bad..7676f897 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -3,7 +3,15 @@ cmake_minimum_required(VERSION 3.5)
+ include("packaging/cmake/parseversion.cmake")
+ parseversion("src/rdkafka.h")
+
+-project(RdKafka VERSION ${RDKAFKA_VERSION})
++project(RdKafka VERSION ${RDKAFKA_VERSION} LANGUAGES C)
++
++include(CheckLanguage)
++check_language(CXX)
++if(CMAKE_CXX_COMPILER)
++ enable_language(CXX)
++else()
++ message(STATUS "C++ compiler not found, skipping C++ support")
++endif()
+
+ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/packaging/cmake/Modules/")
+
+@@ -181,7 +189,7 @@ endif()
+
+ option(RDKAFKA_BUILD_STATIC "Build static rdkafka library" OFF)
+ option(RDKAFKA_BUILD_EXAMPLES "Build examples" ON)
+-option(RDKAFKA_BUILD_TESTS "Build tests" ON)
++option(RDKAFKA_BUILD_TESTS "Build tests" CMAKE_CXX_COMPILER)
+ if(WIN32)
+ option(WITHOUT_WIN32_CONFIG "Avoid including win32_config.h on cmake builds" ON)
+ endif(WIN32)
+@@ -279,13 +287,20 @@ install(
+ )
+
+ add_subdirectory(src)
+-add_subdirectory(src-cpp)
++
++if(CMAKE_CXX_COMPILER)
++ add_subdirectory(src-cpp)
++endif()
+
+ if(RDKAFKA_BUILD_EXAMPLES)
+ add_subdirectory(examples)
+ endif()
+
+ if(RDKAFKA_BUILD_TESTS)
+- enable_testing()
+- add_subdirectory(tests)
++ if(CMAKE_CXX_COMPILER)
++ enable_testing()
++ add_subdirectory(tests)
++ else()
++ message(FATAL_ERROR "Building tests needs C++ suport")
++ endif()
+ endif()
+diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
+index 91851d2c..28ce6e79 100644
+--- a/examples/CMakeLists.txt
++++ b/examples/CMakeLists.txt
+@@ -5,8 +5,10 @@ endif(WIN32)
+ add_executable(producer producer.c ${win32_sources})
+ target_link_libraries(producer PUBLIC rdkafka)
+
+-add_executable(producer_cpp producer.cpp ${win32_sources})
+-target_link_libraries(producer_cpp PUBLIC rdkafka++)
++if(CMAKE_CXX_COMPILER)
++ add_executable(producer_cpp producer.cpp ${win32_sources})
++ target_link_libraries(producer_cpp PUBLIC rdkafka++)
++endif(CMAKE_CXX_COMPILER)
+
+ add_executable(consumer consumer.c ${win32_sources})
+ target_link_libraries(consumer PUBLIC rdkafka)
+@@ -14,14 +16,20 @@ target_link_libraries(consumer PUBLIC rdkafka)
+ add_executable(rdkafka_performance rdkafka_performance.c ${win32_sources})
+ target_link_libraries(rdkafka_performance PUBLIC rdkafka)
+
+-add_executable(rdkafka_example_cpp rdkafka_example.cpp ${win32_sources})
+-target_link_libraries(rdkafka_example_cpp PUBLIC rdkafka++)
++if(CMAKE_CXX_COMPILER)
++ add_executable(rdkafka_example_cpp rdkafka_example.cpp ${win32_sources})
++ target_link_libraries(rdkafka_example_cpp PUBLIC rdkafka++)
++endif(CMAKE_CXX_COMPILER)
+
+-add_executable(rdkafka_complex_consumer_example_cpp rdkafka_complex_consumer_example.cpp ${win32_sources})
+-target_link_libraries(rdkafka_complex_consumer_example_cpp PUBLIC rdkafka++)
++if(CMAKE_CXX_COMPILER)
++ add_executable(rdkafka_complex_consumer_example_cpp rdkafka_complex_consumer_example.cpp ${win32_sources})
++ target_link_libraries(rdkafka_complex_consumer_example_cpp PUBLIC rdkafka++)
++endif(CMAKE_CXX_COMPILER)
+
+-add_executable(openssl_engine_example_cpp openssl_engine_example.cpp ${win32_sources})
+-target_link_libraries(openssl_engine_example_cpp PUBLIC rdkafka++)
++if(CMAKE_CXX_COMPILER)
++ add_executable(openssl_engine_example_cpp openssl_engine_example.cpp ${win32_sources})
++ target_link_libraries(openssl_engine_example_cpp PUBLIC rdkafka++)
++endif(CMAKE_CXX_COMPILER)
+
+ add_executable(misc misc.c ${win32_sources})
+ target_link_libraries(misc PUBLIC rdkafka)
+@@ -73,7 +81,9 @@ if(NOT WIN32)
+ add_executable(rdkafka_complex_consumer_example rdkafka_complex_consumer_example.c)
+ target_link_libraries(rdkafka_complex_consumer_example PUBLIC rdkafka)
+
+- add_executable(kafkatest_verifiable_client kafkatest_verifiable_client.cpp)
+- target_link_libraries(kafkatest_verifiable_client PUBLIC rdkafka++)
++ if(CMAKE_CXX_COMPILER)
++ add_executable(kafkatest_verifiable_client kafkatest_verifiable_client.cpp)
++ target_link_libraries(kafkatest_verifiable_client PUBLIC rdkafka++)
++ endif(CMAKE_CXX_COMPILER)
+
+ endif(NOT WIN32)
+--
+2.43.0
+
diff --git a/package/librdkafka/0002-src-rdkafka_conf.c-fix-curl-curl.h-include-when-WITH.patch b/package/librdkafka/0002-src-rdkafka_conf.c-fix-curl-curl.h-include-when-WITH.patch
new file mode 100644
index 00000000000..dec80d538c9
--- /dev/null
+++ b/package/librdkafka/0002-src-rdkafka_conf.c-fix-curl-curl.h-include-when-WITH.patch
@@ -0,0 +1,32 @@
+From 5061a5b33dce11ada740e2a34137dce6934b731a Mon Sep 17 00:00:00 2001
+From: Thomas Devoogdt <thomas@devoogdt.com>
+Date: Sun, 15 Feb 2026 18:37:16 +0100
+Subject: [PATCH] src/rdkafka_conf.c: fix curl/curl.h include when
+ WITH_CURL=OFF
+
+Change #ifdef to #if for WITH_OAUTHBEARER_OIDC preprocessor check.
+When using CMake's cmakedefine01, the macro is always defined (as 0 or 1),
+so #ifdef always evaluates to true. Using #if correctly checks the value.
+
+Upstream: https://github.com/confluentinc/librdkafka/pull/5309
+Signed-off-by: Thomas Devoogdt <thomas@devoogdt.com>
+---
+ src/rdkafka_conf.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/rdkafka_conf.c b/src/rdkafka_conf.c
+index 0e346e74..f8f0d0ca 100644
+--- a/src/rdkafka_conf.c
++++ b/src/rdkafka_conf.c
+@@ -56,7 +56,7 @@
+ #include <windows.h>
+ #endif
+
+-#ifdef WITH_OAUTHBEARER_OIDC
++#if WITH_OAUTHBEARER_OIDC
+ #include <curl/curl.h>
+ #endif
+
+--
+2.43.0
+
diff --git a/package/librdkafka/Config.in b/package/librdkafka/Config.in
new file mode 100644
index 00000000000..54380e2d6e0
--- /dev/null
+++ b/package/librdkafka/Config.in
@@ -0,0 +1,14 @@
+config BR2_PACKAGE_LIBRDKAFKA
+ bool "librdkafka"
+ depends on !BR2_m68k_cf # assembler "out of range" error
+ depends on BR2_TOOLCHAIN_HAS_THREADS
+ select BR2_PACKAGE_LZ4
+ help
+ librdkafka is a C library implementation of the
+ Apache Kafka protocol, providing Producer, Consumer
+ and Admin clients.
+
+ https://github.com/confluentinc/librdkafka
+
+comment "librdkafka needs a toolchain w/ threads"
+ depends on !BR2_TOOLCHAIN_HAS_THREADS
diff --git a/package/librdkafka/librdkafka.hash b/package/librdkafka/librdkafka.hash
new file mode 100644
index 00000000000..f745e55b819
--- /dev/null
+++ b/package/librdkafka/librdkafka.hash
@@ -0,0 +1,4 @@
+# From https://github.com/confluentinc/librdkafka/releases/tag/v2.13.2
+sha256 14972092e4115f6e99f798a7cb420cbf6daa0c73502b3c52ae42fb5b418eea8f librdkafka-2.13.2.tar.gz
+# Locally computed
+sha256 b9e4616bb9dd0c9ce3fa52e81c7bfc596e60b8855a1df5dce5fa50732b1ccdec LICENSES.txt
diff --git a/package/librdkafka/librdkafka.mk b/package/librdkafka/librdkafka.mk
new file mode 100644
index 00000000000..0cbab11d496
--- /dev/null
+++ b/package/librdkafka/librdkafka.mk
@@ -0,0 +1,51 @@
+################################################################################
+#
+# librdkafka
+#
+################################################################################
+
+LIBRDKAFKA_VERSION = 2.13.2
+LIBRDKAFKA_SITE = $(call github,confluentinc,librdkafka,v$(LIBRDKAFKA_VERSION))
+LIBRDKAFKA_LICENSE = BSD-2-Clause
+LIBRDKAFKA_LICENSE_FILES = LICENSES.txt
+LIBRDKAFKA_INSTALL_STAGING = YES
+LIBRDKAFKA_DEPENDENCIES = lz4
+LIBRDKAFKA_CONF_OPTS = \
+ -DRDKAFKA_BUILD_EXAMPLES=OFF \
+ -DRDKAFKA_BUILD_TESTS=OFF
+
+ifeq ($(BR2_STATIC_LIBS),y)
+LIBRDKAFKA_CONF_OPTS += -DRDKAFKA_BUILD_STATIC=ON
+else
+LIBRDKAFKA_CONF_OPTS += -DRDKAFKA_BUILD_STATIC=OFF
+endif
+
+ifeq ($(BR2_PACKAGE_ZLIB),y)
+LIBRDKAFKA_CONF_OPTS += -DWITH_ZLIB=ON
+LIBRDKAFKA_DEPENDENCIES += zlib
+else
+LIBRDKAFKA_CONF_OPTS += -DWITH_ZLIB=OFF
+endif
+
+ifeq ($(BR2_PACKAGE_LIBCURL),y)
+LIBRDKAFKA_CONF_OPTS += -DWITH_CURL=ON
+LIBRDKAFKA_DEPENDENCIES += libcurl
+else
+LIBRDKAFKA_CONF_OPTS += -DWITH_CURL=OFF
+endif
+
+ifeq ($(BR2_PACKAGE_ZSTD),y)
+LIBRDKAFKA_CONF_OPTS += -DWITH_ZSTD=ON
+LIBRDKAFKA_DEPENDENCIES += zstd
+else
+LIBRDKAFKA_CONF_OPTS += -DWITH_ZSTD=OFF
+endif
+
+ifeq ($(BR2_PACKAGE_OPENSSL),y)
+LIBRDKAFKA_CONF_OPTS += -DWITH_SSL=ON
+LIBRDKAFKA_DEPENDENCIES += openssl
+else
+LIBRDKAFKA_CONF_OPTS += -DWITH_SSL=OFF
+endif
+
+$(eval $(cmake-package))
--
2.43.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH v2 2/3] package/fluent-bit: link against the new librdkafka package
2026-03-08 8:12 ` [Buildroot] [PATCH v2 1/3] package/librdkafka: add new package Thomas Devoogdt
@ 2026-03-08 8:12 ` Thomas Devoogdt
2026-03-08 8:12 ` [Buildroot] [PATCH v2 3/3] support/testing/tests/package/test_fluent_bit.py: new runtime test Thomas Devoogdt
1 sibling, 0 replies; 6+ messages in thread
From: Thomas Devoogdt @ 2026-03-08 8:12 UTC (permalink / raw)
To: thomas; +Cc: buildroot
By this, we can drop 0001-lib-librdkafka-only-require-a-C-compiler.patch.
Signed-off-by: Thomas Devoogdt <thomas@devoogdt.com>
---
v2: no change
---
...librdkafka-only-require-a-C-compiler.patch | 118 ------------------
package/fluent-bit/Config.in | 2 +-
package/fluent-bit/fluent-bit.mk | 5 +-
3 files changed, 4 insertions(+), 121 deletions(-)
delete mode 100644 package/fluent-bit/0001-lib-librdkafka-only-require-a-C-compiler.patch
diff --git a/package/fluent-bit/0001-lib-librdkafka-only-require-a-C-compiler.patch b/package/fluent-bit/0001-lib-librdkafka-only-require-a-C-compiler.patch
deleted file mode 100644
index 660ed7bed49..00000000000
--- a/package/fluent-bit/0001-lib-librdkafka-only-require-a-C-compiler.patch
+++ /dev/null
@@ -1,118 +0,0 @@
-From 7329316bdcc72aceb6bbbdf8711f5bf8894c2a15 Mon Sep 17 00:00:00 2001
-From: Thomas Devoogdt <thomas.devoogdt@barco.com>
-Date: Tue, 25 Jul 2023 09:10:41 +0200
-Subject: [PATCH] lib: librdkafka: only require a C compiler
-
-Upstream: https://github.com/confluentinc/librdkafka/pull/4366
-Signed-off-by: Thomas Devoogdt <thomas.devoogdt@barco.com>
----
- lib/librdkafka-2.10.1/CMakeLists.txt | 22 +++++++++++--
- lib/librdkafka-2.10.1/examples/CMakeLists.txt | 31 ++++++++++++-------
- 2 files changed, 39 insertions(+), 14 deletions(-)
-
-diff --git a/lib/librdkafka-2.10.1/CMakeLists.txt b/lib/librdkafka-2.10.1/CMakeLists.txt
-index f3d05bad7..8ef47053a 100644
---- a/lib/librdkafka-2.10.1/CMakeLists.txt
-+++ b/lib/librdkafka-2.10.1/CMakeLists.txt
-@@ -3,7 +3,16 @@ cmake_minimum_required(VERSION 3.5)
- include("packaging/cmake/parseversion.cmake")
- parseversion("src/rdkafka.h")
-
--project(RdKafka VERSION ${RDKAFKA_VERSION})
-+project(RdKafka VERSION ${RDKAFKA_VERSION} LANGUAGES C)
-+
-+# Check for CXX support
-+include(CheckLanguage)
-+check_language(CXX)
-+if(CMAKE_CXX_COMPILER)
-+ enable_language(CXX)
-+else()
-+ message(STATUS "C++ compiler not found, skipping C++ support")
-+endif()
-
- set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/packaging/cmake/Modules/")
-
-@@ -181,7 +190,11 @@ endif()
-
- option(RDKAFKA_BUILD_STATIC "Build static rdkafka library" OFF)
- option(RDKAFKA_BUILD_EXAMPLES "Build examples" ON)
--option(RDKAFKA_BUILD_TESTS "Build tests" ON)
-+
-+if(CMAKE_CXX_COMPILER)
-+ option(RDKAFKA_BUILD_TESTS "Build tests" ON)
-+endif()
-+
- if(WIN32)
- option(WITHOUT_WIN32_CONFIG "Avoid including win32_config.h on cmake builds" ON)
- endif(WIN32)
-@@ -279,7 +292,10 @@ install(
- )
-
- add_subdirectory(src)
--add_subdirectory(src-cpp)
-+
-+if(CMAKE_CXX_COMPILER)
-+ add_subdirectory(src-cpp)
-+endif()
-
- if(RDKAFKA_BUILD_EXAMPLES)
- add_subdirectory(examples)
-diff --git a/lib/librdkafka-2.10.1/examples/CMakeLists.txt b/lib/librdkafka-2.10.1/examples/CMakeLists.txt
-index 91851d2cb..6874195ce 100644
---- a/lib/librdkafka-2.10.1/examples/CMakeLists.txt
-+++ b/lib/librdkafka-2.10.1/examples/CMakeLists.txt
-@@ -5,8 +5,10 @@ endif(WIN32)
- add_executable(producer producer.c ${win32_sources})
- target_link_libraries(producer PUBLIC rdkafka)
-
--add_executable(producer_cpp producer.cpp ${win32_sources})
--target_link_libraries(producer_cpp PUBLIC rdkafka++)
-+if(CMAKE_CXX_COMPILER)
-+ add_executable(producer_cpp producer.cpp ${win32_sources})
-+ target_link_libraries(producer_cpp PUBLIC rdkafka++)
-+endif()
-
- add_executable(consumer consumer.c ${win32_sources})
- target_link_libraries(consumer PUBLIC rdkafka)
-@@ -14,14 +16,20 @@ target_link_libraries(consumer PUBLIC rdkafka)
- add_executable(rdkafka_performance rdkafka_performance.c ${win32_sources})
- target_link_libraries(rdkafka_performance PUBLIC rdkafka)
-
--add_executable(rdkafka_example_cpp rdkafka_example.cpp ${win32_sources})
--target_link_libraries(rdkafka_example_cpp PUBLIC rdkafka++)
-+if(CMAKE_CXX_COMPILER)
-+ add_executable(rdkafka_example_cpp rdkafka_example.cpp ${win32_sources})
-+ target_link_libraries(rdkafka_example_cpp PUBLIC rdkafka++)
-+endif()
-
--add_executable(rdkafka_complex_consumer_example_cpp rdkafka_complex_consumer_example.cpp ${win32_sources})
--target_link_libraries(rdkafka_complex_consumer_example_cpp PUBLIC rdkafka++)
-+if(CMAKE_CXX_COMPILER)
-+ add_executable(rdkafka_complex_consumer_example_cpp rdkafka_complex_consumer_example.cpp ${win32_sources})
-+ target_link_libraries(rdkafka_complex_consumer_example_cpp PUBLIC rdkafka++)
-+endif()
-
--add_executable(openssl_engine_example_cpp openssl_engine_example.cpp ${win32_sources})
--target_link_libraries(openssl_engine_example_cpp PUBLIC rdkafka++)
-+if(CMAKE_CXX_COMPILER)
-+ add_executable(openssl_engine_example_cpp openssl_engine_example.cpp ${win32_sources})
-+ target_link_libraries(openssl_engine_example_cpp PUBLIC rdkafka++)
-+endif()
-
- add_executable(misc misc.c ${win32_sources})
- target_link_libraries(misc PUBLIC rdkafka)
-@@ -73,7 +81,8 @@ if(NOT WIN32)
- add_executable(rdkafka_complex_consumer_example rdkafka_complex_consumer_example.c)
- target_link_libraries(rdkafka_complex_consumer_example PUBLIC rdkafka)
-
-- add_executable(kafkatest_verifiable_client kafkatest_verifiable_client.cpp)
-- target_link_libraries(kafkatest_verifiable_client PUBLIC rdkafka++)
--
-+ if(CMAKE_CXX_COMPILER)
-+ add_executable(kafkatest_verifiable_client kafkatest_verifiable_client.cpp)
-+ target_link_libraries(kafkatest_verifiable_client PUBLIC rdkafka++)
-+ endif()
- endif(NOT WIN32)
---
-2.43.0
-
diff --git a/package/fluent-bit/Config.in b/package/fluent-bit/Config.in
index 2af62797447..f8494064acc 100644
--- a/package/fluent-bit/Config.in
+++ b/package/fluent-bit/Config.in
@@ -4,7 +4,7 @@ config BR2_PACKAGE_FLUENT_BIT
depends on BR2_TOOLCHAIN_HAS_SYNC_4
depends on !BR2_STATIC_LIBS # dlfcn.h
select BR2_PACKAGE_C_ARES
- select BR2_PACKAGE_LIBOPENSSL_ENGINES # needed by bundled librdkafka
+ select BR2_PACKAGE_LIBRDKAFKA
select BR2_PACKAGE_LIBYAML
select BR2_PACKAGE_MSGPACK_C
select BR2_PACKAGE_MUSL_FTS if !BR2_TOOLCHAIN_USES_GLIBC
diff --git a/package/fluent-bit/fluent-bit.mk b/package/fluent-bit/fluent-bit.mk
index f571896797c..a3a44b8dbe7 100644
--- a/package/fluent-bit/fluent-bit.mk
+++ b/package/fluent-bit/fluent-bit.mk
@@ -10,8 +10,8 @@ FLUENT_BIT_LICENSE = Apache-2.0
FLUENT_BIT_LICENSE_FILES = LICENSE
FLUENT_BIT_CPE_ID_VENDOR = treasuredata
FLUENT_BIT_CPE_ID_PRODUCT = fluent_bit
-FLUENT_BIT_DEPENDENCIES = c-ares host-bison host-flex libyaml msgpack-c \
- nghttp2 openssl sqlite zstd
+FLUENT_BIT_DEPENDENCIES = c-ares host-bison host-flex librdkafka libyaml \
+ msgpack-c nghttp2 openssl sqlite zstd
FLUENT_BIT_CMAKE_BACKEND = ninja
@@ -22,6 +22,7 @@ FLUENT_BIT_CONF_OPTS += \
-DFLB_EXAMPLES=No \
-DFLB_CHUNK_TRACE=No \
-DFLB_PREFER_SYSTEM_LIB_CARES=Yes \
+ -DFLB_PREFER_SYSTEM_LIB_KAFKA=Yes \
-DFLB_PREFER_SYSTEM_LIB_MSGPACK=Yes \
-DFLB_PREFER_SYSTEM_LIB_NGHTTP2=Yes \
-DFLB_PREFER_SYSTEM_LIB_SQLITE=Yes \
--
2.43.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH v2 3/3] support/testing/tests/package/test_fluent_bit.py: new runtime test
2026-03-08 8:12 ` [Buildroot] [PATCH v2 1/3] package/librdkafka: add new package Thomas Devoogdt
2026-03-08 8:12 ` [Buildroot] [PATCH v2 2/3] package/fluent-bit: link against the new librdkafka package Thomas Devoogdt
@ 2026-03-08 8:12 ` Thomas Devoogdt
1 sibling, 0 replies; 6+ messages in thread
From: Thomas Devoogdt @ 2026-03-08 8:12 UTC (permalink / raw)
To: thomas; +Cc: buildroot
Signed-off-by: Thomas Devoogdt <thomas@devoogdt.com>
---
v2: no change
---
DEVELOPERS | 1 +
.../testing/tests/package/test_fluent_bit.py | 46 +++++++++++++++++++
2 files changed, 47 insertions(+)
create mode 100644 support/testing/tests/package/test_fluent_bit.py
diff --git a/DEVELOPERS b/DEVELOPERS
index f7c5b077067..dcd25eba388 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -3197,6 +3197,7 @@ F: package/fluent-bit/
F: package/librdkafka/
F: package/libsoup3/
F: package/yq/
+F: support/testing/tests/package/test_fluent_bit.py
N: Thomas Huth <th.huth+br@posteo.eu>
F: package/ascii-invaders/
diff --git a/support/testing/tests/package/test_fluent_bit.py b/support/testing/tests/package/test_fluent_bit.py
new file mode 100644
index 00000000000..825e4ec6d2d
--- /dev/null
+++ b/support/testing/tests/package/test_fluent_bit.py
@@ -0,0 +1,46 @@
+import os
+import json
+import time
+
+import infra.basetest
+
+
+class TestFluentBit(infra.basetest.BRTest):
+ config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
+ """
+ BR2_TARGET_ROOTFS_CPIO=y
+ # BR2_TARGET_ROOTFS_TAR is not set
+ BR2_PACKAGE_FLUENT_BIT=y
+ """
+
+ def test_run(self):
+ cpio_file = os.path.join(self.builddir, "images", "rootfs.cpio")
+ self.emulator.boot(arch="armv5",
+ kernel="builtin",
+ options=["-initrd", cpio_file])
+ self.emulator.login()
+
+ # Enable the http server
+ cmd = ("sed -i 's/http_server Off/http_server On/g' "
+ "/etc/fluent-bit/fluent-bit.conf && "
+ "/etc/init.d/S99fluent-bit restart")
+ _, exit_code = self.emulator.run(cmd)
+ self.assertEqual(exit_code, 0)
+
+ # Give some runtime
+ time.sleep(5)
+
+ # Check the uptime
+ cmd = "wget -qO- http://127.0.0.1:2020/api/v1/uptime"
+ output, exit_code = self.emulator.run(cmd)
+ self.assertEqual(exit_code, 0)
+ uptime = json.loads(output[0])
+ self.assertGreater(uptime["uptime_sec"], 3)
+
+ # Check the metrics
+ cmd = "wget -qO- http://127.0.0.1:2020/api/v1/metrics"
+ output, exit_code = self.emulator.run(cmd)
+ self.assertEqual(exit_code, 0)
+ metrics = json.loads(output[0])
+ self.assertGreater(metrics["input"]["cpu.0"]["records"], 0)
+ self.assertGreater(metrics["output"]["stdout.0"]["proc_records"], 0)
--
2.43.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-03-08 8:12 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-19 22:12 [Buildroot] [PATCH v1 1/3] package/librdkafka: add new package Thomas Devoogdt
2026-02-19 22:12 ` [Buildroot] [PATCH v1 2/3] package/fluent-bit: link against the new librdkafka package Thomas Devoogdt
2026-02-19 22:12 ` [Buildroot] [PATCH v1 3/3] support/testing/tests/package/test_fluent_bit.py: new runtime test Thomas Devoogdt
2026-03-08 8:12 ` [Buildroot] [PATCH v2 1/3] package/librdkafka: add new package Thomas Devoogdt
2026-03-08 8:12 ` [Buildroot] [PATCH v2 2/3] package/fluent-bit: link against the new librdkafka package Thomas Devoogdt
2026-03-08 8:12 ` [Buildroot] [PATCH v2 3/3] support/testing/tests/package/test_fluent_bit.py: new runtime test Thomas Devoogdt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox