| # |
| # Copyright 2022 Google LLC |
| # |
| # This program is free software; you can redistribute it and/or |
| # modify it under the terms of the GNU General Public License |
| # version 2 as published by the Free Software Foundation. |
| # |
| # This program is distributed in the hope that it will be useful, |
| # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| # GNU General Public License for more details. |
| # |
| |
| EAPI=7 |
| |
| # Use emake instead of Ninja as MAKEFILE generator because Ninja will fail |
| # with the following error: |
| # ninja: error: build.ninja:67: bad $-escape (literal $ must be written as $$) |
| # FLAGS = -Wall -D__FILENAME__='"$(subst /tmp/fluent-bit/,,$(abspath $<)... |
| CMAKE_MAKEFILE_GENERATOR=emake |
| |
| inherit cmake toolchain-funcs systemd |
| |
| DESCRIPTION="Logging agent" |
| HOMEPAGE="https://fluentbit.io/" |
| SRC_URI="https://github.com/fluent/fluent-bit/archive/${PV}.tar.gz -> ${P}.tar.gz" |
| |
| |
| LICENSE="Apache-2.0" |
| IUSE="" |
| SLOT="0" |
| KEYWORDS="*" |
| |
| DEPEND="" |
| RDEPEND="${DEPEND} |
| dev-libs/libyaml |
| sys-apps/systemd |
| " |
| |
| S="${WORKDIR}"/"${P}" |
| BUILDDIR="${WORKDIR}"/"${P}"_build |
| |
| PATCHES=( |
| "${FILESDIR}/fluent-bit-3.0.6-cross-compile.patch" |
| ) |
| |
| src_prepare() { |
| cmake_src_prepare |
| } |
| |
| src_configure() { |
| local mycmakeargs=( |
| -DCMAKE_SYSTEM_NAME=Linux |
| -DGNU_HOST="${CHOST}" |
| -DFLB_WASM=Off |
| -DFLB_LUAJIT=Off |
| -DFLB_EXAMPLES=Off |
| ) |
| cmake_src_configure |
| } |
| |
| src_compile() { |
| cmake_src_compile |
| } |
| |
| src_install() { |
| dobin "${BUILDDIR}"/bin/fluent-bit |
| |
| # The default fluent-bit config for stackdriver logging. |
| insinto /etc/fluent-bit |
| doins "${FILESDIR}"/fluent-bit.conf |
| doins "${FILESDIR}"/parsers.conf |
| |
| systemd_dounit "${FILESDIR}"/fluent-bit.service |
| systemd_dounit "${FILESDIR}"/docker-events-collector-fluent-bit.service |
| systemd_dounit "${FILESDIR}"/logging-agent.target |
| } |