Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 1 | SUMMARY = "Fast Log processor and Forwarder" |
| 2 | DESCRIPTION = "Fluent Bit is a data collector, processor and \ |
| 3 | forwarder for Linux. It supports several input sources and \ |
| 4 | backends (destinations) for your data. \ |
| 5 | " |
| 6 | |
| 7 | HOMEPAGE = "http://fluentbit.io" |
| 8 | BUGTRACKER = "https://github.com/fluent/fluent-bit/issues" |
| 9 | |
| 10 | LICENSE = "Apache-2.0" |
| 11 | LIC_FILES_CHKSUM = "file://LICENSE;md5=2ee41112a44fe7014dce33e26468ba93" |
| 12 | SECTION = "net" |
| 13 | |
| 14 | SRC_URI = "https://releases.fluentbit.io/1.9/source-${PV}.tar.gz;subdir=fluent-bit-${PV} \ |
| 15 | file://0001-CMakeLists.txt-Do-not-use-private-makefile-target.patch \ |
| 16 | file://0002-flb_info.h.in-Do-not-hardcode-compilation-directorie.patch \ |
| 17 | file://0003-mbedtls-Do-not-overwrite-CFLAGS.patch \ |
| 18 | file://0004-build-Make-systemd-init-systemd-detection-contingent.patch \ |
| 19 | file://0001-monkey-Define-_GNU_SOURCE-for-memmem-API-check.patch \ |
| 20 | file://0002-mbedtls-Remove-unused-variable.patch \ |
| 21 | file://0003-mbedtls-Disable-documentation-warning-as-error-with-.patch \ |
| 22 | file://0004-Use-correct-type-to-store-return-from-flb_kv_item_cr.patch \ |
| 23 | file://0005-stackdriver-Fix-return-type-mismatch.patch \ |
| 24 | file://0006-monkey-Fix-TLS-detection-testcase.patch \ |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 25 | " |
Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 26 | SRC_URI:remove:x86 = "file://0002-mbedtls-Remove-unused-variable.patch" |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 27 | SRC_URI:append:libc-musl = "\ |
| 28 | file://0001-Use-posix-strerror_r-with-musl.patch \ |
| 29 | file://0002-chunkio-Link-with-fts-library-with-musl.patch \ |
| 30 | " |
| 31 | SRC_URI[sha256sum] = "8ca2ac081d7eee717483c06608adcb5e3d5373e182ad87dba21a23f8278c6540" |
| 32 | S = "${WORKDIR}/fluent-bit-${PV}" |
| 33 | |
| 34 | DEPENDS = "zlib bison-native flex-native openssl" |
| 35 | DEPENDS += "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}" |
| 36 | |
| 37 | PACKAGECONFIG[yaml] = "-DFLB_CONFIG_YAML=On,-DFLB_CONFIG_YAML=Off,libyaml" |
| 38 | PACKAGECONFIG[kafka] = "-DFLB_OUT_KAFKA=On,-DFLB_OUT_KAFKA=Off,librdkafka" |
| 39 | PACKAGECONFIG[examples] = "-DFLB_EXAMPLES=On,-DFLB_EXAMPLES=Off" |
| 40 | PACKAGECONFIG[jemalloc] = "-DFLB_JEMALLOC=On,-DFLB_JEMALLOC=Off,jemalloc" |
| 41 | #TODO add more fluentbit options to PACKAGECONFIG[] |
| 42 | |
| 43 | DEPENDS:append:libc-musl = " fts " |
| 44 | |
| 45 | # flex hardcodes the input file in #line directives leading to TMPDIR contamination of debug sources. |
| 46 | do_compile:append() { |
| 47 | find ${B} -name '*.c' -or -name '*.h' | xargs sed -i -e 's|${TMPDIR}|/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}/|g' |
| 48 | } |
| 49 | |
| 50 | PACKAGECONFIG ?= "yaml" |
| 51 | |
| 52 | LTO = "" |
| 53 | |
| 54 | # Use CMake 'Unix Makefiles' generator |
| 55 | OECMAKE_GENERATOR ?= "Unix Makefiles" |
| 56 | |
| 57 | # Fluent Bit build options |
| 58 | # ======================== |
| 59 | |
| 60 | # Host related setup |
| 61 | EXTRA_OECMAKE += "-DGNU_HOST=${HOST_SYS} -DFLB_TD=1" |
| 62 | |
| 63 | # Disable LuaJIT and filter_lua support |
| 64 | EXTRA_OECMAKE += "-DFLB_LUAJIT=Off -DFLB_FILTER_LUA=Off " |
| 65 | |
| 66 | # Disable Library and examples |
| 67 | EXTRA_OECMAKE += "-DFLB_SHARED_LIB=Off" |
| 68 | |
| 69 | # Enable systemd iff systemd is in DISTRO_FEATURES |
| 70 | EXTRA_OECMAKE += "${@bb.utils.contains('DISTRO_FEATURES','systemd','-DFLB_SYSTEMD=On','-DFLB_SYSTEMD=Off',d)}" |
| 71 | |
| 72 | # Enable release builds |
| 73 | EXTRA_OECMAKE += "-DFLB_RELEASE=On" |
| 74 | |
| 75 | # musl needs these options |
| 76 | EXTRA_OECMAKE:append:libc-musl = ' -DFLB_JEMALLOC_OPTIONS="--with-jemalloc-prefix=je_ --with-lg-quantum=3" -DFLB_CORO_STACK_SIZE=24576' |
| 77 | |
| 78 | EXTRA_OECMAKE:append:riscv64 = " -DCMAKE_C_STANDARD_LIBRARIES=-latomic" |
| 79 | EXTRA_OECMAKE:append:riscv32 = " -DCMAKE_C_STANDARD_LIBRARIES=-latomic" |
| 80 | EXTRA_OECMAKE:append:mips = " -DCMAKE_C_STANDARD_LIBRARIES=-latomic" |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 81 | EXTRA_OECMAKE:append:powerpc = " -DCMAKE_C_STANDARD_LIBRARIES=-latomic" |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 82 | EXTRA_OECMAKE:append:x86 = " -DCMAKE_C_STANDARD_LIBRARIES=-latomic" |
| 83 | |
| 84 | CFLAGS:append:x86 = " -DMBEDTLS_HAVE_SSE2" |
| 85 | |
| 86 | inherit cmake systemd pkgconfig |
| 87 | |
| 88 | SYSTEMD_SERVICE:${PN} = "td-agent-bit.service" |
| 89 | |
| 90 | EXTRA_OECMAKE += "-DCMAKE_DEBUG_SRCDIR=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}/" |
| 91 | TARGET_CC_ARCH += " ${SELECTED_OPTIMIZATION}" |