diff options
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.bb | 151 |
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 @@ | |||
1 | SUMMARY = "Fast Log Processor and Forwarder" | ||
2 | DESCRIPTION = "Fluent Bit allows to collect log events or metrics from \ | ||
3 | different sources, process them and deliver them to different backends \ | ||
4 | such as Fluentd, Elasticsearch, Splunk, DataDog, Kafka, New Relic, Azure \ | ||
5 | services, AWS services, Google services, NATS, InfluxDB or any custom \ | ||
6 | HTTP end-point." | ||
7 | HOMEPAGE = "http://fluentbit.io" | ||
8 | BUGTRACKER = "https://github.com/fluent/fluent-bit/issues" | ||
9 | SECTION = "net" | ||
10 | LICENSE = "Apache-2.0" | ||
11 | LIC_FILES_CHKSUM = "file://LICENSE;md5=2ee41112a44fe7014dce33e26468ba93" | ||
12 | DEPENDS = "\ | ||
13 | bison-native \ | ||
14 | flex-native \ | ||
15 | openssl \ | ||
16 | ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)} \ | ||
17 | " | ||
18 | DEPENDS:append:libc-musl = " fts" | ||
19 | |||
20 | SRCREV = "b12e507090273576d1156342780c7c6d358fa579" | ||
21 | SRC_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 | " | ||
27 | SRC_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" | ||
33 | UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>(\d+(\.\d+)+))" | ||
34 | |||
35 | |||
36 | PACKAGECONFIG ??= "\ | ||
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 | ||
58 | PACKAGECONFIG:remove:toolchain-clang = "ipo" | ||
59 | |||
60 | # Use system libs | ||
61 | PACKAGECONFIG[prefer-system-libs] = "-DFLB_PREFER_SYSTEM_LIBS=Yes,-DFLB_PREFER_SYSTEM_LIBS=No, nghttp2 c-ares" | ||
62 | DEPENDS += " ${@bb.utils.contains('PACKAGECONFIG', 'prefer-system-libs backtrace', 'libbacktrace', '', d)}" | ||
63 | DEPENDS += " ${@bb.utils.contains('PACKAGECONFIG', 'prefer-system-libs jemalloc', 'jemalloc', '', d)}" | ||
64 | DEPENDS += " ${@bb.utils.contains('PACKAGECONFIG', 'prefer-system-libs luajit', 'luajit', '', d)}" | ||
65 | |||
66 | PACKAGECONFIG[all] = "-DFLB_ALL=Yes,-DFLB_ALL=No" | ||
67 | PACKAGECONFIG[arrow] = "-DFLB_ARROW=Yes,-DFLB_ARROW=No" | ||
68 | PACKAGECONFIG[avro-encoder] = "-DFLB_AVRO_ENCODER=Yes,-DFLB_AVRO_ENCODER=No" | ||
69 | PACKAGECONFIG[aws-error-reporter] = "-DFLB_AWS_ERROR_REPORTER=Yes,-DFLB_AWS_ERROR_REPORTER=No" | ||
70 | PACKAGECONFIG[aws] = "-DFLB_AWS=Yes,-DFLB_AWS=No" | ||
71 | PACKAGECONFIG[backtrace] = "-DFLB_BACKTRACE=Yes,-DFLB_BACKTRACE=No" | ||
72 | PACKAGECONFIG[binary] = "-DFLB_BINARY=Yes,-DFLB_BINARY=No" | ||
73 | PACKAGECONFIG[chunk-trace] = "-DFLB_CHUNK_TRACE=Yes,-DFLB_CHUNK_TRACE=No" | ||
74 | PACKAGECONFIG[config-yaml] = "-DFLB_CONFIG_YAML=Yes,-DFLB_CONFIG_YAML=No,libyaml" | ||
75 | PACKAGECONFIG[custom-calyptia] = "-DFLB_CUSTOM_CALYPTIA=Yes,-DFLB_CUSTOM_CALYPTIA=No" | ||
76 | PACKAGECONFIG[enforce-alignment] = "-DFLB_ENFORCE_ALIGNMENT=Yes,-DFLB_ENFORCE_ALIGNMENT=No" | ||
77 | PACKAGECONFIG[examples] = "-DFLB_EXAMPLES=Yes,-DFLB_EXAMPLES=No" | ||
78 | PACKAGECONFIG[http-client-debug] = "-DFLB_HTTP_CLIENT_DEBUG=Yes,-DFLB_HTTP_CLIENT_DEBUG=No" | ||
79 | PACKAGECONFIG[http-server] = "-DFLB_HTTP_SERVER=Yes,-DFLB_HTTP_SERVER=No" | ||
80 | PACKAGECONFIG[inotify] = "-DFLB_INOTIFY=Yes,-DFLB_INOTIFY=No" | ||
81 | PACKAGECONFIG[ipo] = "-DFLB_IPO=Yes,-DFLB_IPO=no" | ||
82 | PACKAGECONFIG[jemalloc] = "-DFLB_JEMALLOC=Yes,-DFLB_JEMALLOC=No,jemalloc" | ||
83 | PACKAGECONFIG[luajit] = "-DFLB_LUAJIT=Yes,-DFLB_LUAJIT=No" | ||
84 | PACKAGECONFIG[metrics] = "-DFLB_METRICS=Yes,-DFLB_METRICS=No" | ||
85 | PACKAGECONFIG[mtrace] = "-DFLB_MTRACE=Yes,-DFLB_MTRACE=No" | ||
86 | PACKAGECONFIG[parser] = "-DFLB_PARSER=Yes,-DFLB_PARSER=No" | ||
87 | PACKAGECONFIG[posix-tls] = "-DFLB_POSIX_TLS=Yes,-DFLB_POSIX_TLS=No" | ||
88 | PACKAGECONFIG[profiles] = "-DFLB_PROFILES=Yes,-DFLB_PROFILES=No" | ||
89 | PACKAGECONFIG[proxy-go] = "-DFLB_PROXY_GO=Yes,-DFLB_PROXY_GO=No" | ||
90 | PACKAGECONFIG[record-accessor] = "-DFLB_RECORD_ACCESSOR=Yes,-DFLB_RECORD_ACCESSOR=No" | ||
91 | PACKAGECONFIG[regex] = "-DFLB_REGEX=Yes,-DFLB_REGEX=No" | ||
92 | PACKAGECONFIG[run-ldconfig] = "-DFLB_RUN_LDCONFIG=Yes,-DFLB_RUN_LDCONFIG=No" | ||
93 | PACKAGECONFIG[shared-lib] = "-DFLB_SHARED_LIB=Yes,-DFLB_SHARED_LIB=No" | ||
94 | PACKAGECONFIG[signv4] = "-DFLB_SIGNV4=Yes,-DFLB_SIGNV4=No" | ||
95 | PACKAGECONFIG[sqldb] = "-DFLB_SQLDB=Yes,-DFLB_SQLDB=No" | ||
96 | PACKAGECONFIG[stream-processor] = "-DFLB_STREAM_PROCESSOR=Yes,-DFLB_STREAM_PROCESSOR=No" | ||
97 | PACKAGECONFIG[tests-runtime] = "-DFLB_TESTS_RUNTIME=Yes,-DFLB_TESTS_RUNTIME=No" | ||
98 | PACKAGECONFIG[tls] = "-DFLB_TLS=Yes,-DFLB_TLS=No" | ||
99 | PACKAGECONFIG[trace] = "-DFLB_TRACE=Yes,-DFLB_TRACE=No" | ||
100 | PACKAGECONFIG[utf8-encoder] = "-DFLB_UTF8_ENCODER=Yes,-DFLB_UTF8_ENCODER=No" | ||
101 | PACKAGECONFIG[valgrind] = "-DFLB_VALGRIND=Yes,-DFLB_VALGRIND=No,valgrind" | ||
102 | PACKAGECONFIG[wamrc] = "-DFLB_WAMRC=Yes,-DFLB_WAMRC=No" | ||
103 | PACKAGECONFIG[wasm-stack-protect] = "-DFLB_WASM_STACK_PROTECT=Yes,-DFLB_WASM_STACK_PROTECT=No" | ||
104 | PACKAGECONFIG[wasm] = "-DFLB_WASM=Yes,-DFLB_WASM=No" | ||
105 | PACKAGECONFIG[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") | ||
109 | PACKAGECONFIG[minimal] = "-DFLB_MINIMAL=Yes,-DFLB_MINIMAL=No" | ||
110 | |||
111 | PACKAGECONFIG[in-kafka] = "-DFLB_KAFKA=ON -DFLB_IN_KAFKA=ON,-DFLB_KAFKA=OFF -DFLB_IN_KAFKA=OFF,librdkafka curl" | ||
112 | PACKAGECONFIG[out-kafka] = "-DFLB_KAFKA=ON -DFLB_OUT_KAFKA=ON,-DFLB_KAFKA=OFF -DFLB_OUT_KAFKA=OFF,librdkafka curl" | ||
113 | |||
114 | SYSTEMD_SERVICE:${PN} = "fluent-bit.service" | ||
115 | |||
116 | inherit 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 | ||
120 | EXTRA_OECMAKE += "-DFLB_DEBUG=No" | ||
121 | |||
122 | FULL_OPTIMIZATION:remove = "${@'-O2' if bb.data.inherits_class('clang', d) else ''}" | ||
123 | TARGET_CC_ARCH += "${SELECTED_OPTIMIZATION}" | ||
124 | TARGET_CC_ARCH:remove = "-D_FORTIFY_SOURCE=2" | ||
125 | EXTRA_OECMAKE += "-DCMAKE_DEBUG_SRCDIR=${TARGET_DBGSRC_DIR}/" | ||
126 | |||
127 | SECURITY_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 | ||
130 | CFLAGS += "-std=gnu17" | ||
131 | # 64bit atomics builtins do not exist in compiler on these arches | ||
132 | LDFLAGS:append:mips = " -latomic" | ||
133 | LDFLAGS:append:powerpc = " -latomic" | ||
134 | LDFLAGS:append:riscv32 = " -latomic" | ||
135 | LDFLAGS:append:riscv64 = " -latomic" | ||
136 | LDFLAGS:append:x86 = " -latomic" | ||
137 | |||
138 | do_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. | ||
146 | do_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 | ||
151 | FILES:${PN} += "${libdir}/fluent-bit" | ||