Initial Commit
- initial default booting image
This commit is contained in:
@@ -0,0 +1,118 @@
|
||||
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
|
||||
|
||||
54
package/fluent-bit/Config.in
Normal file
54
package/fluent-bit/Config.in
Normal file
@@ -0,0 +1,54 @@
|
||||
config BR2_PACKAGE_FLUENT_BIT
|
||||
bool "fluent-bit"
|
||||
depends on BR2_TOOLCHAIN_HAS_THREADS
|
||||
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_LIBYAML
|
||||
select BR2_PACKAGE_MSGPACK_C
|
||||
select BR2_PACKAGE_MUSL_FTS if !BR2_TOOLCHAIN_USES_GLIBC
|
||||
select BR2_PACKAGE_NGHTTP2
|
||||
select BR2_PACKAGE_OPENSSL
|
||||
select BR2_PACKAGE_OPENSSL_FORCE_LIBOPENSSL
|
||||
select BR2_PACKAGE_SQLITE
|
||||
select BR2_PACKAGE_ZSTD
|
||||
help
|
||||
Fast and Lightweight Logs and Metrics processor.
|
||||
|
||||
https://github.com/fluent/fluent-bit
|
||||
|
||||
if BR2_PACKAGE_FLUENT_BIT
|
||||
|
||||
config BR2_PACKAGE_FLUENT_BIT_WASM_ARCH
|
||||
string
|
||||
default "AARCH64" if BR2_aarch64 || BR2_aarch64_be
|
||||
default "ARC" if BR2_arcle
|
||||
default "ARM" if BR2_arm || BR2_armeb
|
||||
default "MIPS" if BR2_mips || BR2_mipsel || BR2_mips64 || BR2_mips64el
|
||||
default "RISCV32" if BR2_riscv && BR2_RISCV_32
|
||||
default "RISCV64" if BR2_riscv && BR2_RISCV_64
|
||||
default "X86_32" if BR2_i386
|
||||
default "X86_64" if BR2_x86_64
|
||||
default "XTENSA" if BR2_xtensa
|
||||
|
||||
config BR2_PACKAGE_FLUENT_BIT_WASM_ARCH_SUPPORTS
|
||||
bool
|
||||
default y if BR2_PACKAGE_FLUENT_BIT_WASM_ARCH != ""
|
||||
|
||||
config BR2_PACKAGE_FLUENT_BIT_WASM
|
||||
bool "wasm runtime support"
|
||||
depends on BR2_INSTALL_LIBSTDCPP
|
||||
depends on BR2_PACKAGE_FLUENT_BIT_WASM_ARCH_SUPPORTS
|
||||
help
|
||||
Support for WASM-based plugins.
|
||||
|
||||
comment "wasm runtime support needs a toolchain w/ C++"
|
||||
depends on BR2_PACKAGE_FLUENT_BIT_WASM_ARCH_SUPPORTS
|
||||
depends on !BR2_INSTALL_LIBSTDCPP
|
||||
|
||||
endif
|
||||
|
||||
comment "fluent-bit needs a toolchain w/ threads, dynamic library"
|
||||
depends on BR2_TOOLCHAIN_HAS_SYNC_4
|
||||
depends on !BR2_TOOLCHAIN_HAS_THREADS || BR2_STATIC_LIBS
|
||||
72
package/fluent-bit/S99fluent-bit
Normal file
72
package/fluent-bit/S99fluent-bit
Normal file
@@ -0,0 +1,72 @@
|
||||
#!/bin/sh
|
||||
|
||||
DAEMON="fluent-bit"
|
||||
PID_FILE="/var/run/$DAEMON.pid"
|
||||
CONF_FILE="/etc/$DAEMON/$DAEMON.conf"
|
||||
|
||||
FLUENT_BIT_ARGS=""
|
||||
|
||||
# shellcheck source=/dev/null
|
||||
[ -r "/etc/default/$DAEMON" ] && . "/etc/default/$DAEMON"
|
||||
|
||||
start() {
|
||||
printf 'Starting %s: ' "$DAEMON"
|
||||
# shellcheck disable=SC2086 # we need the word splitting
|
||||
start-stop-daemon -S -q -b -m -p "$PID_FILE" --exec "/usr/bin/$DAEMON" \
|
||||
-- -c "$CONF_FILE" $FLUENT_BIT_ARGS
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
echo "OK"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
return "$status"
|
||||
}
|
||||
|
||||
stop() {
|
||||
printf 'Stopping %s: ' "$DAEMON"
|
||||
start-stop-daemon -K -q -p "$PID_FILE"
|
||||
status=$?
|
||||
|
||||
if [ -f "$PID_FILE" ]; then
|
||||
pid=$(cat "$PID_FILE")
|
||||
rm -f "$PID_FILE"
|
||||
|
||||
# https://docs.fluentbit.io/manual/administration/configuring-fluent-bit/yaml/configuration-file#config_section
|
||||
# The default grace time is set to 5 seconds, so use 6 seconds to have some margin.
|
||||
timeout=6
|
||||
while kill -0 "$pid" 2>/dev/null; do
|
||||
[ $timeout -eq 0 ] && status=1 && break
|
||||
timeout=$((timeout - 1))
|
||||
sleep 1
|
||||
done
|
||||
fi
|
||||
|
||||
if [ "$status" -eq 0 ]; then
|
||||
echo "OK"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
return "$status"
|
||||
}
|
||||
|
||||
restart() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
start
|
||||
;;
|
||||
stop)
|
||||
stop
|
||||
;;
|
||||
restart | reload)
|
||||
restart
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
3
package/fluent-bit/fluent-bit.hash
Normal file
3
package/fluent-bit/fluent-bit.hash
Normal file
@@ -0,0 +1,3 @@
|
||||
# Locally computed
|
||||
sha256 44fe0f52e89a63b213695748f99691d0a6247a4bd05065f1b517c798d9f89bcc fluent-bit-4.2.0.tar.gz
|
||||
sha256 0d542e0c8804e39aa7f37eb00da5a762149dc682d7829451287e11b938e94594 LICENSE
|
||||
110
package/fluent-bit/fluent-bit.mk
Normal file
110
package/fluent-bit/fluent-bit.mk
Normal file
@@ -0,0 +1,110 @@
|
||||
################################################################################
|
||||
#
|
||||
# fluent-bit
|
||||
#
|
||||
################################################################################
|
||||
|
||||
FLUENT_BIT_VERSION = 4.2.0
|
||||
FLUENT_BIT_SITE = $(call github,fluent,fluent-bit,v$(FLUENT_BIT_VERSION))
|
||||
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_CMAKE_BACKEND = ninja
|
||||
|
||||
FLUENT_BIT_CONF_OPTS += \
|
||||
-DFLB_DEBUG=No \
|
||||
-DFLB_RELEASE=Yes \
|
||||
-DFLB_SECURITY=No \
|
||||
-DFLB_EXAMPLES=No \
|
||||
-DFLB_CHUNK_TRACE=No \
|
||||
-DFLB_PREFER_SYSTEM_LIB_CARES=Yes \
|
||||
-DFLB_PREFER_SYSTEM_LIB_MSGPACK=Yes \
|
||||
-DFLB_PREFER_SYSTEM_LIB_NGHTTP2=Yes \
|
||||
-DFLB_PREFER_SYSTEM_LIB_SQLITE=Yes \
|
||||
-DFLB_PREFER_SYSTEM_LIB_ZSTD=Yes
|
||||
|
||||
ifeq ($(BR2_PACKAGE_FLUENT_BIT_WASM),y)
|
||||
FLUENT_BIT_WAMR_ARCH = $(call qstrip,$(BR2_PACKAGE_FLUENT_BIT_WASM_ARCH))
|
||||
|
||||
# https://github.com/bytecodealliance/wasm-micro-runtime/issues/625
|
||||
# Fix unknown opcode 'ldc1', seen on mips32r2 and mips64r2.
|
||||
ifeq ($(FLUENT_BIT_WAMR_ARCH),MIPS)
|
||||
FLUENT_BIT_CONF_OPTS += \
|
||||
-DWAMR_BUILD_INVOKE_NATIVE_GENERAL=1
|
||||
endif
|
||||
|
||||
FLUENT_BIT_CONF_OPTS += -DFLB_WASM=Yes \
|
||||
-DWAMR_BUILD_TARGET=$(FLUENT_BIT_WAMR_ARCH)
|
||||
else
|
||||
FLUENT_BIT_CONF_OPTS += -DFLB_WASM=No
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_LIBBACKTRACE),y)
|
||||
FLUENT_BIT_CONF_OPTS += -DFLB_BACKTRACE=Yes \
|
||||
-DFLB_PREFER_SYSTEM_LIB_BACKTRACE=Yes
|
||||
FLUENT_BIT_DEPENDENCIES += libbacktrace
|
||||
else
|
||||
FLUENT_BIT_CONF_OPTS += -DFLB_BACKTRACE=No
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_JEMALLOC),y)
|
||||
FLUENT_BIT_CONF_OPTS += -DFLB_JEMALLOC=Yes \
|
||||
-DFLB_PREFER_SYSTEM_LIB_JEMALLOC=Yes
|
||||
FLUENT_BIT_DEPENDENCIES += jemalloc
|
||||
else
|
||||
FLUENT_BIT_CONF_OPTS += -DFLB_JEMALLOC=No
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_LUAJIT),y)
|
||||
FLUENT_BIT_CONF_OPTS += -DFLB_LUAJIT=Yes \
|
||||
-DFLB_PREFER_SYSTEM_LIB_LUAJIT=Yes
|
||||
FLUENT_BIT_DEPENDENCIES += luajit
|
||||
else
|
||||
FLUENT_BIT_CONF_OPTS += -DFLB_LUAJIT=No
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_POSTGRESQL),y)
|
||||
FLUENT_BIT_CONF_OPTS += -DFLB_OUT_PGSQL=Yes
|
||||
FLUENT_BIT_DEPENDENCIES += postgresql
|
||||
else
|
||||
FLUENT_BIT_CONF_OPTS += -DFLB_OUT_PGSQL=No
|
||||
endif
|
||||
|
||||
# Force bundled miniz to be linked statically.
|
||||
# https://github.com/fluent/fluent-bit/issues/6711
|
||||
FLUENT_BIT_CONF_OPTS += \
|
||||
-DBUILD_SHARED_LIBS=OFF
|
||||
|
||||
# Move the config files from /usr/etc/ to /etc/.
|
||||
# https://github.com/fluent/fluent-bit/issues/6619
|
||||
FLUENT_BIT_CONF_OPTS += \
|
||||
-DCMAKE_INSTALL_SYSCONFDIR="/etc/"
|
||||
|
||||
ifeq ($(BR2_PACKAGE_LIBEXECINFO),y)
|
||||
FLUENT_BIT_DEPENDENCIES += libexecinfo
|
||||
FLUENT_BIT_LDFLAGS += -lexecinfo
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_TOOLCHAIN_USES_GLIBC),)
|
||||
FLUENT_BIT_DEPENDENCIES += musl-fts
|
||||
FLUENT_BIT_LDFLAGS += -lfts
|
||||
endif
|
||||
|
||||
# Uses __atomic_compare_exchange_8
|
||||
ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
|
||||
FLUENT_BIT_LDFLAGS += -latomic
|
||||
endif
|
||||
|
||||
FLUENT_BIT_CONF_OPTS += \
|
||||
-DCMAKE_EXE_LINKER_FLAGS="$(FLUENT_BIT_LDFLAGS)"
|
||||
|
||||
define FLUENT_BIT_INSTALL_INIT_SYSV
|
||||
$(INSTALL) -D -m 0755 package/fluent-bit/S99fluent-bit \
|
||||
$(TARGET_DIR)/etc/init.d/S99fluent-bit
|
||||
endef
|
||||
|
||||
$(eval $(cmake-package))
|
||||
Reference in New Issue
Block a user