From 3bdce3069af2a9da1498fd0baec164890e041901 Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Thu, 22 Aug 2024 15:12:59 +0200 Subject: [PATCH] Patch libmicrohttpd's meson to correctly detect size of `timeval.tv_sec` --- kiwixbuild/dependencies/libmicrohttpd.py | 5 ++- ...bmicrohttpd_meson_timeval_tvsec_size.patch | 31 +++++++++++++++++++ kiwixbuild/versions.py | 2 +- 3 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 kiwixbuild/patches/libmicrohttpd_meson_timeval_tvsec_size.patch diff --git a/kiwixbuild/dependencies/libmicrohttpd.py b/kiwixbuild/dependencies/libmicrohttpd.py index 8702112f..d76c5214 100644 --- a/kiwixbuild/dependencies/libmicrohttpd.py +++ b/kiwixbuild/dependencies/libmicrohttpd.py @@ -18,7 +18,10 @@ class Source(ReleaseDownload): "https://wrapdb.mesonbuild.com/v2/libmicrohttpd_0.9.76-3/get_patch", ) archives = [src_archive, meson_archive] - patches = ["libmicrohttpd_meson_pkgconfig.patch"] + patches = [ + "libmicrohttpd_meson_pkgconfig.patch", + "libmicrohttpd_meson_timeval_tvsec_size.patch", + ] class Builder(MesonBuilder): configure_options = [ diff --git a/kiwixbuild/patches/libmicrohttpd_meson_timeval_tvsec_size.patch b/kiwixbuild/patches/libmicrohttpd_meson_timeval_tvsec_size.patch new file mode 100644 index 00000000..1b33ba32 --- /dev/null +++ b/kiwixbuild/patches/libmicrohttpd_meson_timeval_tvsec_size.patch @@ -0,0 +1,31 @@ +diff '--color=auto' -ur libmicrohttpd-0.9.76/meson.build libmicrohttpd-0.9.76_patched/meson.build +--- libmicrohttpd-0.9.76/meson.build 2024-08-22 15:17:59.217715872 +0200 ++++ libmicrohttpd-0.9.76_patched/meson.build 2024-08-22 15:20:23.755358647 +0200 +@@ -126,7 +126,26 @@ + foreach s : sizes + cdata.set('SIZEOF_@0@'.format(s.underscorify().to_upper()), cc.sizeof(s)) + endforeach +-cdata.set('SIZEOF_STRUCT_TIMEVAL_TV_SEC', cc.sizeof('time_t')) ++ ++cdata.set( ++ 'SIZEOF_STRUCT_TIMEVAL_TV_SEC', ++ cc.sizeof( ++ 'test_var.tv_sec', ++ prefix: '''#ifdef HAVE_SYS_TIME_H ++#include ++#endif /* HAVE_SYS_TIME_H */ ++#ifdef HAVE_TIME_H ++#include ++#endif /* HAVE_TIME_H */ ++#if HAVE_SYS_TYPES_H ++#include ++#endif /* HAVE_SYS_TYPES_H */ ++#ifdef _WIN32 ++#include ++#endif /* _WIN32 */ ++struct timeval test_var;''' ++ ) ++) + cdata.set('SIZEOF_UINT64_T', 8) + + cdata.set('HAVE_PIPE2_FUNC', cc.has_function('pipe2')) diff --git a/kiwixbuild/versions.py b/kiwixbuild/versions.py index 37394876..feabcc18 100644 --- a/kiwixbuild/versions.py +++ b/kiwixbuild/versions.py @@ -39,7 +39,7 @@ # This is the "version" of the whole base_deps_versions dict. # Change this when you change base_deps_versions. -base_deps_meta_version = "03" +base_deps_meta_version = "04" base_deps_versions = { "zlib": "1.2.12",