summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-extended/fluentbit/fluentbit_4.2.0.bb
diff options
context:
space:
mode:
Diffstat (limited to 'meta-oe/recipes-extended/fluentbit/fluentbit_4.2.0.bb')
-rw-r--r--meta-oe/recipes-extended/fluentbit/fluentbit_4.2.0.bb150
1 files changed, 150 insertions, 0 deletions
diff --git a/meta-oe/recipes-extended/fluentbit/fluentbit_4.2.0.bb b/meta-oe/recipes-extended/fluentbit/fluentbit_4.2.0.bb
new file mode 100644
index 0000000000..279486eee3
--- /dev/null
+++ b/meta-oe/recipes-extended/fluentbit/fluentbit_4.2.0.bb
@@ -0,0 +1,150 @@
1SUMMARY = "Fast Log Processor and Forwarder"
2DESCRIPTION = "Fluent Bit allows to collect log events or metrics from \
3different sources, process them and deliver them to different backends \
4such as Fluentd, Elasticsearch, Splunk, DataDog, Kafka, New Relic, Azure \
5services, AWS services, Google services, NATS, InfluxDB or any custom \
6HTTP end-point."
7HOMEPAGE = "http://fluentbit.io"
8BUGTRACKER = "https://github.com/fluent/fluent-bit/issues"
9SECTION = "net"
10LICENSE = "Apache-2.0"
11LIC_FILES_CHKSUM = "file://LICENSE;md5=2ee41112a44fe7014dce33e26468ba93"
12DEPENDS = "\
13 bison-native \
14 flex-native \
15 openssl \
16 ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)} \
17"
18DEPENDS:append:libc-musl = " fts"
19
20SRCREV = "6bc014390c5485b96521c56b98369b44b9faa08b"
21SRC_URI = "\
22 git://github.com/fluent/fluent-bit.git;branch=master;protocol=https \
23 file://0001-lib-Do-not-use-private-makefile-targets-in-CMakelist.patch \
24 file://0002-flb_info.h.in-Do-not-hardcode-compilation-directorie.patch \
25 file://0003-CMakeLists.txt-Revise-init-manager-deduction.patch \
26"
27SRC_URI:append:libc-musl = "\
28 file://0004-chunkio-Link-with-fts-library-with-musl.patch \
29"
30
31# prefix tag with "v" to avoid upgrade to random tags like "20220215"
32UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>(\d+(\.\d+)+))"
33
34
35PACKAGECONFIG ??= "\
36 aws \
37 binary \
38 config-yaml \
39 custom-calyptia \
40 http-server \
41 inotify \
42 ipo \
43 metrics \
44 parser \
45 prefer-system-libs \
46 profiles \
47 proxy-go \
48 record-accessor \
49 regex \
50 signv4 \
51 sqldb \
52 stream-processor \
53 tls \
54 utf8-encoder \
55"
56# See https://github.com/fluent/fluent-bit/issues/7248#issuecomment-1631280496
57PACKAGECONFIG:remove:toolchain-clang = "ipo"
58
59# Use system libs
60PACKAGECONFIG[prefer-system-libs] = "-DFLB_PREFER_SYSTEM_LIBS=Yes,-DFLB_PREFER_SYSTEM_LIBS=No, nghttp2 c-ares"
61DEPENDS += " ${@bb.utils.contains('PACKAGECONFIG', 'prefer-system-libs backtrace', 'libbacktrace', '', d)}"
62DEPENDS += " ${@bb.utils.contains('PACKAGECONFIG', 'prefer-system-libs jemalloc', 'jemalloc', '', d)}"
63DEPENDS += " ${@bb.utils.contains('PACKAGECONFIG', 'prefer-system-libs luajit', 'luajit', '', d)}"
64
65PACKAGECONFIG[all] = "-DFLB_ALL=Yes,-DFLB_ALL=No"
66PACKAGECONFIG[arrow] = "-DFLB_ARROW=Yes,-DFLB_ARROW=No"
67PACKAGECONFIG[avro-encoder] = "-DFLB_AVRO_ENCODER=Yes,-DFLB_AVRO_ENCODER=No"
68PACKAGECONFIG[aws-error-reporter] = "-DFLB_AWS_ERROR_REPORTER=Yes,-DFLB_AWS_ERROR_REPORTER=No"
69PACKAGECONFIG[aws] = "-DFLB_AWS=Yes,-DFLB_AWS=No"
70PACKAGECONFIG[backtrace] = "-DFLB_BACKTRACE=Yes,-DFLB_BACKTRACE=No"
71PACKAGECONFIG[binary] = "-DFLB_BINARY=Yes,-DFLB_BINARY=No"
72PACKAGECONFIG[chunk-trace] = "-DFLB_CHUNK_TRACE=Yes,-DFLB_CHUNK_TRACE=No"
73PACKAGECONFIG[config-yaml] = "-DFLB_CONFIG_YAML=Yes,-DFLB_CONFIG_YAML=No,libyaml"
74PACKAGECONFIG[custom-calyptia] = "-DFLB_CUSTOM_CALYPTIA=Yes,-DFLB_CUSTOM_CALYPTIA=No"
75PACKAGECONFIG[enforce-alignment] = "-DFLB_ENFORCE_ALIGNMENT=Yes,-DFLB_ENFORCE_ALIGNMENT=No"
76PACKAGECONFIG[examples] = "-DFLB_EXAMPLES=Yes,-DFLB_EXAMPLES=No"
77PACKAGECONFIG[http-client-debug] = "-DFLB_HTTP_CLIENT_DEBUG=Yes,-DFLB_HTTP_CLIENT_DEBUG=No"
78PACKAGECONFIG[http-server] = "-DFLB_HTTP_SERVER=Yes,-DFLB_HTTP_SERVER=No"
79PACKAGECONFIG[inotify] = "-DFLB_INOTIFY=Yes,-DFLB_INOTIFY=No"
80PACKAGECONFIG[ipo] = "-DFLB_IPO=Yes,-DFLB_IPO=no"
81PACKAGECONFIG[jemalloc] = "-DFLB_JEMALLOC=Yes,-DFLB_JEMALLOC=No,jemalloc"
82PACKAGECONFIG[luajit] = "-DFLB_LUAJIT=Yes,-DFLB_LUAJIT=No"
83PACKAGECONFIG[metrics] = "-DFLB_METRICS=Yes,-DFLB_METRICS=No"
84PACKAGECONFIG[mtrace] = "-DFLB_MTRACE=Yes,-DFLB_MTRACE=No"
85PACKAGECONFIG[parser] = "-DFLB_PARSER=Yes,-DFLB_PARSER=No"
86PACKAGECONFIG[posix-tls] = "-DFLB_POSIX_TLS=Yes,-DFLB_POSIX_TLS=No"
87PACKAGECONFIG[profiles] = "-DFLB_PROFILES=Yes,-DFLB_PROFILES=No"
88PACKAGECONFIG[proxy-go] = "-DFLB_PROXY_GO=Yes,-DFLB_PROXY_GO=No"
89PACKAGECONFIG[record-accessor] = "-DFLB_RECORD_ACCESSOR=Yes,-DFLB_RECORD_ACCESSOR=No"
90PACKAGECONFIG[regex] = "-DFLB_REGEX=Yes,-DFLB_REGEX=No"
91PACKAGECONFIG[run-ldconfig] = "-DFLB_RUN_LDCONFIG=Yes,-DFLB_RUN_LDCONFIG=No"
92PACKAGECONFIG[shared-lib] = "-DFLB_SHARED_LIB=Yes,-DFLB_SHARED_LIB=No"
93PACKAGECONFIG[signv4] = "-DFLB_SIGNV4=Yes,-DFLB_SIGNV4=No"
94PACKAGECONFIG[sqldb] = "-DFLB_SQLDB=Yes,-DFLB_SQLDB=No"
95PACKAGECONFIG[stream-processor] = "-DFLB_STREAM_PROCESSOR=Yes,-DFLB_STREAM_PROCESSOR=No"
96PACKAGECONFIG[tests-runtime] = "-DFLB_TESTS_RUNTIME=Yes,-DFLB_TESTS_RUNTIME=No"
97PACKAGECONFIG[tls] = "-DFLB_TLS=Yes,-DFLB_TLS=No"
98PACKAGECONFIG[trace] = "-DFLB_TRACE=Yes,-DFLB_TRACE=No"
99PACKAGECONFIG[utf8-encoder] = "-DFLB_UTF8_ENCODER=Yes,-DFLB_UTF8_ENCODER=No"
100PACKAGECONFIG[valgrind] = "-DFLB_VALGRIND=Yes,-DFLB_VALGRIND=No,valgrind"
101PACKAGECONFIG[wamrc] = "-DFLB_WAMRC=Yes,-DFLB_WAMRC=No"
102PACKAGECONFIG[wasm-stack-protect] = "-DFLB_WASM_STACK_PROTECT=Yes,-DFLB_WASM_STACK_PROTECT=No"
103PACKAGECONFIG[wasm] = "-DFLB_WASM=Yes,-DFLB_WASM=No"
104PACKAGECONFIG[windows-defaults] = "-DFLB_WINDOWS_DEFAULTS=Yes,-DFLB_WINDOWS_DEFAULTS=No"
105
106# Option to disable all Fluent Bit plugins by default. See cmake/plugins_options.cmake which
107# individual plugins then to enable (e.g. using EXTRA_OECMAKE:append = " -DFLB_FOOBAR=ON")
108PACKAGECONFIG[minimal] = "-DFLB_MINIMAL=Yes,-DFLB_MINIMAL=No"
109
110PACKAGECONFIG[in-kafka] = "-DFLB_KAFKA=ON -DFLB_IN_KAFKA=ON,-DFLB_KAFKA=OFF -DFLB_IN_KAFKA=OFF,librdkafka curl"
111PACKAGECONFIG[out-kafka] = "-DFLB_KAFKA=ON -DFLB_OUT_KAFKA=ON,-DFLB_KAFKA=OFF -DFLB_OUT_KAFKA=OFF,librdkafka curl"
112
113SYSTEMD_SERVICE:${PN} = "fluent-bit.service"
114
115inherit cmake systemd pkgconfig
116
117# disable manipulation of compiler flags and CMAKE_BUILD_TYPE
118# release and coverage are off by default, disable also debug
119EXTRA_OECMAKE += "-DFLB_DEBUG=No"
120
121FULL_OPTIMIZATION:remove = "${@'-O2' if bb.data.inherits_class('clang', d) else ''}"
122TARGET_CC_ARCH += "${SELECTED_OPTIMIZATION}"
123TARGET_CC_ARCH:remove = "-D_FORTIFY_SOURCE=2"
124EXTRA_OECMAKE += "-DCMAKE_DEBUG_SRCDIR=${TARGET_DBGSRC_DIR}/"
125
126SECURITY_STRINGFORMAT:remove = "${@bb.utils.contains('PACKAGECONFIG', 'aws-error-reporter', '-Werror=format-security', '', d)}"
127
128# GCC-15 uses C23 std and it does not yet compile with C23
129CFLAGS += "-std=gnu17"
130# 64bit atomics builtins do not exist in compiler on these arches
131LDFLAGS:append:mips = " -latomic"
132LDFLAGS:append:powerpc = " -latomic"
133LDFLAGS:append:riscv32 = " -latomic"
134LDFLAGS:append:riscv64 = " -latomic"
135LDFLAGS:append:x86 = " -latomic"
136
137do_configure:prepend() {
138 sed -i \
139 -e 's#@INIT_MANAGER_IS_SYSTEMD@#'${@'TRUE' if d.getVar('INIT_MANAGER') == 'systemd' else 'FALSE'}'#' \
140 -e 's#@INIT_MANAGER_IS_UPSTART@#'${@'TRUE' if d.getVar('INIT_MANAGER') == 'upstart' else 'FALSE'}'#' \
141 ${S}/src/CMakeLists.txt
142}
143
144# flex hardcodes the input file in #line directives leading to TMPDIR contamination of debug sources.
145do_compile:append() {
146 find ${B} -name '*.c' -or -name '*.h' | xargs sed -i -e 's|${TMPDIR}|${TARGET_DBGSRC_DIR}/|g'
147}
148
149# needed for shared-lib package config
150FILES:${PN} += "${libdir}/fluent-bit"