fluent-bit: re-enable on darwin

This commit is contained in:
Tobias Mayer 2023-10-12 13:45:20 +02:00
parent 98156cb838
commit 3b1c0d6ecc

View File

@ -26,16 +26,20 @@ stdenv.mkDerivation (finalAttrs: {
buildInputs = [ openssl libyaml postgresql ]
++ lib.optionals stdenv.isLinux [ systemd ];
cmakeFlags = [ "-DFLB_METRICS=ON" "-DFLB_HTTP_SERVER=ON" "-DFLB_OUT_PGSQL=ON" ];
cmakeFlags = [
"-DFLB_RELEASE=ON"
"-DFLB_METRICS=ON"
"-DFLB_HTTP_SERVER=ON"
"-DFLB_OUT_PGSQL=ON"
];
# _FORTIFY_SOURCE requires compiling with optimization (-O)
env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.cc.isGNU [ "-O" ]
# Workaround build failure on -fno-common toolchains:
# ld: /monkey/mk_tls.h:81: multiple definition of `mk_tls_server_timeout';
# flb_config.c.o:include/monkey/mk_tls.h:81: first defined here
# TODO: drop when upstream gets a fix for it:
# https://github.com/fluent/fluent-bit/issues/5537
++ lib.optionals stdenv.isDarwin [ "-fcommon" ]);
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" ]
);
outputs = [ "out" "dev" ];
@ -50,6 +54,6 @@ stdenv.mkDerivation (finalAttrs: {
homepage = "https://fluentbit.io";
license = lib.licenses.asl20;
maintainers = [ lib.maintainers.samrose lib.maintainers.fpletz ];
platforms = lib.platforms.linux;
platforms = lib.platforms.unix;
};
})