Merge pull request #260669 from tobim/pkgs/fluent-bit-darwin

fluent-bit: re-enable on darwin
This commit is contained in:
Weijia Wang 2023-10-13 04:27:58 +02:00 committed by GitHub
commit 7ab327f730
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 11 deletions

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;
};
})

View File

@ -8157,7 +8157,7 @@ with pkgs;
icu = icu63;
};
fluent-bit = callPackage ../tools/misc/fluent-bit { };
fluent-bit = darwin.apple_sdk_11_0.callPackage ../tools/misc/fluent-bit { };
fluent-reader = callPackage ../applications/networking/feedreaders/fluent-reader { };