summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-extended/fluentbit/fluentbit_4.0.1.bb
diff options
context:
space:
mode:
Diffstat (limited to 'meta-oe/recipes-extended/fluentbit/fluentbit_4.0.1.bb')
-rw-r--r--meta-oe/recipes-extended/fluentbit/fluentbit_4.0.1.bb151
1 files changed, 151 insertions, 0 deletions
diff --git a/meta-oe/recipes-extended/fluentbit/fluentbit_4.0.1.bb b/meta-oe/recipes-extended/fluentbit/fluentbit_4.0.1.bb
new file mode 100644
index 0000000000..05e4fd937f
--- /dev/null
+++ b/meta-oe/recipes-extended/fluentbit/fluentbit_4.0.1.bb
@@ -0,0 +1,151 @@
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 = "b12e507090273576d1156342780c7c6d358fa579"
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 file://0005-Use-posix-strerror_r-with-musl.patch \
30"
31
32# prefix tag with "v" to avoid upgrade to random tags like "20220215"
33UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>(\d+(\.\d+)+))"
34
35
36PACKAGECONFIG ??= "\
37 aws \
38 binary \
39 config-yaml \
40 custom-calyptia \
41 http-server \
42 inotify \
43 ipo \
44 metrics \
45 parser \
46 prefer-system-libs \
47 profiles \
48 proxy-go \
49 record-accessor \
50 regex \
51 signv4 \
52 sqldb \
53 stream-processor \
54 tls \
55 utf8-encoder \
56"
57# See https://github.com/fluent/fluent-bit/issues/7248#issuecomment-1631280496
58PACKAGECONFIG:remove:toolchain-clang = "ipo"
59
60# Use system libs
61PACKAGECONFIG[prefer-system-libs] = "-DFLB_PREFER_SYSTEM_LIBS=Yes,-DFLB_PREFER_SYSTEM_LIBS=No, nghttp2 c-ares"
62DEPENDS += " ${@bb.utils.contains('PACKAGECONFIG', 'prefer-system-libs backtrace', 'libbacktrace', '', d)}"
63DEPENDS += " ${@bb.utils.contains('PACKAGECONFIG', 'prefer-system-libs jemalloc', 'jemalloc', '', d)}"
64DEPENDS += " ${@bb.utils.contains('PACKAGECONFIG', 'prefer-system-libs luajit', 'luajit', '', d)}"
65
66PACKAGECONFIG[all] = "-DFLB_ALL=Yes,-DFLB_ALL=No"
67PACKAGECONFIG[arrow] = "-DFLB_ARROW=Yes,-DFLB_ARROW=No"
68PACKAGECONFIG[avro-encoder] = "-DFLB_AVRO_ENCODER=Yes,-DFLB_AVRO_ENCODER=No"
69PACKAGECONFIG[aws-error-reporter] = "-DFLB_AWS_ERROR_REPORTER=Yes,-DFLB_AWS_ERROR_REPORTER=No"
70PACKAGECONFIG[aws] = "-DFLB_AWS=Yes,-DFLB_AWS=No"
71PACKAGECONFIG[backtrace] = "-DFLB_BACKTRACE=Yes,-DFLB_BACKTRACE=No"
72PACKAGECONFIG[binary] = "-DFLB_BINARY=Yes,-DFLB_BINARY=No"
73PACKAGECONFIG[chunk-trace] = "-DFLB_CHUNK_TRACE=Yes,-DFLB_CHUNK_TRACE=No"
74PACKAGECONFIG[config-yaml] = "-DFLB_CONFIG_YAML=Yes,-DFLB_CONFIG_YAML=No,libyaml"
75PACKAGECONFIG[custom-calyptia] = "-DFLB_CUSTOM_CALYPTIA=Yes,-DFLB_CUSTOM_CALYPTIA=No"
76PACKAGECONFIG[enforce-alignment] = "-DFLB_ENFORCE_ALIGNMENT=Yes,-DFLB_ENFORCE_ALIGNMENT=No"
77PACKAGECONFIG[examples] = "-DFLB_EXAMPLES=Yes,-DFLB_EXAMPLES=No"
78PACKAGECONFIG[http-client-debug] = "-DFLB_HTTP_CLIENT_DEBUG=Yes,-DFLB_HTTP_CLIENT_DEBUG=No"
79PACKAGECONFIG[http-server] = "-DFLB_HTTP_SERVER=Yes,-DFLB_HTTP_SERVER=No"
80PACKAGECONFIG[inotify] = "-DFLB_INOTIFY=Yes,-DFLB_INOTIFY=No"
81PACKAGECONFIG[ipo] = "-DFLB_IPO=Yes,-DFLB_IPO=no"
82PACKAGECONFIG[jemalloc] = "-DFLB_JEMALLOC=Yes,-DFLB_JEMALLOC=No,jemalloc"
83PACKAGECONFIG[luajit] = "-DFLB_LUAJIT=Yes,-DFLB_LUAJIT=No"
84PACKAGECONFIG[metrics] = "-DFLB_METRICS=Yes,-DFLB_METRICS=No"
85PACKAGECONFIG[mtrace] = "-DFLB_MTRACE=Yes,-DFLB_MTRACE=No"
86PACKAGECONFIG[parser] = "-DFLB_PARSER=Yes,-DFLB_PARSER=No"
87PACKAGECONFIG[posix-tls] = "-DFLB_POSIX_TLS=Yes,-DFLB_POSIX_TLS=No"
88PACKAGECONFIG[profiles] = "-DFLB_PROFILES=Yes,-DFLB_PROFILES=No"
89PACKAGECONFIG[proxy-go] = "-DFLB_PROXY_GO=Yes,-DFLB_PROXY_GO=No"
90PACKAGECONFIG[record-accessor] = "-DFLB_RECORD_ACCESSOR=Yes,-DFLB_RECORD_ACCESSOR=No"
91PACKAGECONFIG[regex] = "-DFLB_REGEX=Yes,-DFLB_REGEX=No"
92PACKAGECONFIG[run-ldconfig] = "-DFLB_RUN_LDCONFIG=Yes,-DFLB_RUN_LDCONFIG=No"
93PACKAGECONFIG[shared-lib] = "-DFLB_SHARED_LIB=Yes,-DFLB_SHARED_LIB=No"
94PACKAGECONFIG[signv4] = "-DFLB_SIGNV4=Yes,-DFLB_SIGNV4=No"
95PACKAGECONFIG[sqldb] = "-DFLB_SQLDB=Yes,-DFLB_SQLDB=No"
96PACKAGECONFIG[stream-processor] = "-DFLB_STREAM_PROCESSOR=Yes,-DFLB_STREAM_PROCESSOR=No"
97PACKAGECONFIG[tests-runtime] = "-DFLB_TESTS_RUNTIME=Yes,-DFLB_TESTS_RUNTIME=No"
98PACKAGECONFIG[tls] = "-DFLB_TLS=Yes,-DFLB_TLS=No"
99PACKAGECONFIG[trace] = "-DFLB_TRACE=Yes,-DFLB_TRACE=No"
100PACKAGECONFIG[utf8-encoder] = "-DFLB_UTF8_ENCODER=Yes,-DFLB_UTF8_ENCODER=No"
101PACKAGECONFIG[valgrind] = "-DFLB_VALGRIND=Yes,-DFLB_VALGRIND=No,valgrind"
102PACKAGECONFIG[wamrc] = "-DFLB_WAMRC=Yes,-DFLB_WAMRC=No"
103PACKAGECONFIG[wasm-stack-protect] = "-DFLB_WASM_STACK_PROTECT=Yes,-DFLB_WASM_STACK_PROTECT=No"
104PACKAGECONFIG[wasm] = "-DFLB_WASM=Yes,-DFLB_WASM=No"
105PACKAGECONFIG[windows-defaults] = "-DFLB_WINDOWS_DEFAULTS=Yes,-DFLB_WINDOWS_DEFAULTS=No"
106
107# Option to disable all Fluent Bit plugins by default. See cmake/plugins_options.cmake which
108# individual plugins then to enable (e.g. using EXTRA_OECMAKE:append = " -DFLB_FOOBAR=ON")
109PACKAGECONFIG[minimal] = "-DFLB_MINIMAL=Yes,-DFLB_MINIMAL=No"
110
111PACKAGECONFIG[in-kafka] = "-DFLB_KAFKA=ON -DFLB_IN_KAFKA=ON,-DFLB_KAFKA=OFF -DFLB_IN_KAFKA=OFF,librdkafka curl"
112PACKAGECONFIG[out-kafka] = "-DFLB_KAFKA=ON -DFLB_OUT_KAFKA=ON,-DFLB_KAFKA=OFF -DFLB_OUT_KAFKA=OFF,librdkafka curl"
113
114SYSTEMD_SERVICE:${PN} = "fluent-bit.service"
115
116inherit cmake systemd pkgconfig
117
118# disable manipulation of compiler flags and CMAKE_BUILD_TYPE
119# release and coverage are off by default, disable also debug
120EXTRA_OECMAKE += "-DFLB_DEBUG=No"
121
122FULL_OPTIMIZATION:remove = "${@'-O2' if bb.data.inherits_class('clang', d) else ''}"
123TARGET_CC_ARCH += "${SELECTED_OPTIMIZATION}"
124TARGET_CC_ARCH:remove = "-D_FORTIFY_SOURCE=2"
125EXTRA_OECMAKE += "-DCMAKE_DEBUG_SRCDIR=${TARGET_DBGSRC_DIR}/"
126
127SECURITY_STRINGFORMAT:remove = "${@bb.utils.contains('PACKAGECONFIG', 'aws-error-reporter', '-Werror=format-security', '', d)}"
128
129# GCC-15 uses C23 std and it does not yet compile with C23
130CFLAGS += "-std=gnu17"
131# 64bit atomics builtins do not exist in compiler on these arches
132LDFLAGS:append:mips = " -latomic"
133LDFLAGS:append:powerpc = " -latomic"
134LDFLAGS:append:riscv32 = " -latomic"
135LDFLAGS:append:riscv64 = " -latomic"
136LDFLAGS:append:x86 = " -latomic"
137
138do_configure:prepend() {
139 sed -i \
140 -e 's#@INIT_MANAGER_IS_SYSTEMD@#'${@'TRUE' if d.getVar('INIT_MANAGER') == 'systemd' else 'FALSE'}'#' \
141 -e 's#@INIT_MANAGER_IS_UPSTART@#'${@'TRUE' if d.getVar('INIT_MANAGER') == 'upstart' else 'FALSE'}'#' \
142 ${S}/src/CMakeLists.txt
143}
144
145# flex hardcodes the input file in #line directives leading to TMPDIR contamination of debug sources.
146do_compile:append() {
147 find ${B} -name '*.c' -or -name '*.h' | xargs sed -i -e 's|${TMPDIR}|${TARGET_DBGSRC_DIR}/|g'
148}
149
150# needed for shared-lib package config
151FILES:${PN} += "${libdir}/fluent-bit"