2023-08-04 22:07:22 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, flex
|
|
|
|
, bison
|
|
|
|
, systemd
|
|
|
|
, postgresql
|
|
|
|
, openssl
|
|
|
|
, libyaml
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "fluent-bit";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "3.0.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "fluent";
|
|
|
|
repo = "fluent-bit";
|
2023-08-04 22:07:22 +00:00
|
|
|
rev = "v${finalAttrs.version}";
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-4LYIQ1WIt9btQI255nnTnGjz/GSUl/5mI6TEq99zNCM=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake flex bison ];
|
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
buildInputs = [ openssl libyaml postgresql ]
|
2022-01-26 04:04:25 +00:00
|
|
|
++ lib.optionals stdenv.isLinux [ systemd ];
|
2021-07-14 22:03:04 +00:00
|
|
|
|
2023-10-19 13:55:26 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DFLB_RELEASE=ON"
|
|
|
|
"-DFLB_METRICS=ON"
|
|
|
|
"-DFLB_HTTP_SERVER=ON"
|
|
|
|
"-DFLB_OUT_PGSQL=ON"
|
|
|
|
];
|
|
|
|
|
|
|
|
env.NIX_CFLAGS_COMPILE = toString (
|
|
|
|
# Used by the embedded luajit, but is not predefined on older mac SDKs.
|
|
|
|
lib.optionals stdenv.isDarwin [ "-DTARGET_OS_IPHONE=0" ]
|
|
|
|
# Assumes GNU version of strerror_r, and the posix version has an
|
|
|
|
# incompatible return type.
|
|
|
|
++ lib.optionals (!stdenv.hostPlatform.isGnu) [ "-Wno-int-conversion" ]
|
|
|
|
);
|
2020-11-09 15:59:12 +00:00
|
|
|
|
2021-07-14 22:03:04 +00:00
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace src/CMakeLists.txt \
|
|
|
|
--replace /lib/systemd $out/lib/systemd
|
|
|
|
'';
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
meta = {
|
|
|
|
changelog = "https://github.com/fluent/fluent-bit/releases/tag/v${finalAttrs.version}";
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Log forwarder and processor, part of Fluentd ecosystem";
|
|
|
|
homepage = "https://fluentbit.io";
|
2023-08-04 22:07:22 +00:00
|
|
|
license = lib.licenses.asl20;
|
|
|
|
maintainers = [ lib.maintainers.samrose lib.maintainers.fpletz ];
|
2023-10-19 13:55:26 +00:00
|
|
|
platforms = lib.platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2023-08-04 22:07:22 +00:00
|
|
|
})
|