fluent-bit: use upstream patches

Follow up to 09a54b14cd1 (fluent-bit: fix build on darwin, 2021-11-20),
now with upstream patches.
This commit is contained in:
Sebastián Mancilla 2021-11-22 20:28:20 -03:00
parent fbd3124b92
commit e40ebf0bf7
2 changed files with 16 additions and 25 deletions

@ -1,4 +1,4 @@
{ lib, stdenv, fetchFromGitHub, cmake, flex, bison, systemd }:
{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake, flex, bison, systemd }:
stdenv.mkDerivation rec {
pname = "fluent-bit";
@ -12,7 +12,21 @@ stdenv.mkDerivation rec {
};
patches = lib.optionals stdenv.isDarwin [
./fix-cmetrics-darwin.patch
# Fix compilations errors on darwin
(fetchpatch {
url = "https://github.com/calyptia/cmetrics/commit/4f0f7ae2eeec148a69156f9fcc05d64bf249d11e.patch";
sha256 = "sha256-M1+28mHxpMvcFkOoKxkMMo1VCQsG33ncFZkFalOq2FQ=";
stripLen = 1;
extraPrefix = "lib/cmetrics/";
})
(fetchpatch {
url = "https://github.com/calyptia/cmetrics/commit/a97999cb6d7299ef230d216b7a1c584b43c64de9.patch";
sha256 = "sha256-RuyPEeILc86n/klPIb334XpX0F71nskQ8s/ya0rE2zI=";
stripLen = 1;
extraPrefix = "lib/cmetrics/";
})
# Fix bundled luajit compilation args
./fix-luajit-darwin.patch
];

@ -1,23 +0,0 @@
diff --git i/lib/cmetrics/src/cmt_time.c w/lib/cmetrics/src/cmt_time.c
--- i/lib/cmetrics/src/cmt_time.c
+++ w/lib/cmetrics/src/cmt_time.c
@@ -20,7 +20,7 @@
#include <cmetrics/cmt_info.h>
/* MacOS */
-#ifdef FLB_HAVE_CLOCK_GET_TIME
+#ifdef CMT_HAVE_CLOCK_GET_TIME
#include <mach/clock.h>
#include <mach/mach.h>
#endif
@@ -41,8 +41,8 @@
mach_timespec_t mts;
host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &cclock);
clock_get_time(cclock, &mts);
- tm->tv_sec = mts.tv_sec;
- tm->tv_nsec = mts.tv_nsec;
+ tm.tv_sec = mts.tv_sec;
+ tm.tv_nsec = mts.tv_nsec;
mach_port_deallocate(mach_task_self(), cclock);
#else /* __STDC_VERSION__ */
clock_gettime(CLOCK_REALTIME, &tm);