From 6c8a9540bd6047be4929b18245ee79a07b143491 Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Sun, 18 Aug 2024 12:03:37 +0200 Subject: [PATCH] Build libmicrohttpd with meson --- kiwixbuild/dependencies/aria2.py | 2 +- kiwixbuild/dependencies/libmicrohttpd.py | 22 +++++++++----- .../libmicrohttpd_meson_pkgconfig.patch | 29 +++++++++++++++++++ 3 files changed, 44 insertions(+), 9 deletions(-) create mode 100644 kiwixbuild/patches/libmicrohttpd_meson_pkgconfig.patch diff --git a/kiwixbuild/dependencies/aria2.py b/kiwixbuild/dependencies/aria2.py index b2b8ee735..08c8759a6 100644 --- a/kiwixbuild/dependencies/aria2.py +++ b/kiwixbuild/dependencies/aria2.py @@ -1,4 +1,4 @@ -from .base import Dependency, ReleaseDownload, MakeBuilder +from .base import Dependency, ReleaseDownload, MakeBuilder, NoopBuilder from kiwixbuild.utils import Remotefile, run_command diff --git a/kiwixbuild/dependencies/libmicrohttpd.py b/kiwixbuild/dependencies/libmicrohttpd.py index ddc017861..8702112f5 100644 --- a/kiwixbuild/dependencies/libmicrohttpd.py +++ b/kiwixbuild/dependencies/libmicrohttpd.py @@ -1,4 +1,4 @@ -from .base import Dependency, ReleaseDownload, MakeBuilder +from .base import Dependency, ReleaseDownload, MesonBuilder from kiwixbuild.utils import Remotefile @@ -7,17 +7,23 @@ class MicroHttpd(Dependency): name = "libmicrohttpd" class Source(ReleaseDownload): - archive = Remotefile( + src_archive = Remotefile( "libmicrohttpd-0.9.76.tar.gz", "f0b1547b5a42a6c0f724e8e1c1cb5ce9c4c35fb495e7d780b9930d35011ceb4c", "https://ftp.gnu.org/gnu/libmicrohttpd/libmicrohttpd-0.9.76.tar.gz", ) + meson_archive = Remotefile( + "libmicrohttpd_0.9.16-3_patch.zip", + "0954c094a0d4cfe0dd799d8df8a04face6669f7b4d51a7386a9c3e2d37b9c3b3", + "https://wrapdb.mesonbuild.com/v2/libmicrohttpd_0.9.76-3/get_patch", + ) + archives = [src_archive, meson_archive] + patches = ["libmicrohttpd_meson_pkgconfig.patch"] - class Builder(MakeBuilder): + class Builder(MesonBuilder): configure_options = [ - "--disable-https", - "--without-libgcrypt", - "--without-libcurl", - "--disable-doc", - "--disable-examples", + "-Dgnutls=disabled", + "-Dgcrypt=disabled", + "-Dcurl=disabled", + "-Dexpat=disabled", ] diff --git a/kiwixbuild/patches/libmicrohttpd_meson_pkgconfig.patch b/kiwixbuild/patches/libmicrohttpd_meson_pkgconfig.patch new file mode 100644 index 000000000..cf0a53be6 --- /dev/null +++ b/kiwixbuild/patches/libmicrohttpd_meson_pkgconfig.patch @@ -0,0 +1,29 @@ +diff '--color=auto' -ur libmicrohttpd-0.9.76_orig/meson.build libmicrohttpd-0.9.76/meson.build +--- libmicrohttpd-0.9.76_orig/meson.build 2024-08-18 14:55:29.372805433 +0200 ++++ libmicrohttpd-0.9.76/meson.build 2024-08-18 17:19:44.087444728 +0200 +@@ -6,6 +6,8 @@ + default_options: ['warning_level=1'], + ) + ++pkg = import('pkgconfig') ++ + add_project_arguments('-D_GNU_SOURCE', language: 'c') + + incdirs = include_directories('src/include') +@@ -267,6 +269,16 @@ + install: true, + ) + ++install_headers( ++ 'src/include/microhttpd.h', ++) ++ ++pkg.generate( ++ libmicrohttpd, ++ description: 'Libmicrohttpd', ++ name: 'libmicrohttpd', ++) ++ + depinc = include_directories('.', 'src/include') + libmicrohttpd_dep = declare_dependency( + include_directories: depinc,