Skip to content

Commit

Permalink
Build libmicrohttpd with meson
Browse files Browse the repository at this point in the history
  • Loading branch information
mgautierfr committed Aug 21, 2024
1 parent 23a6b93 commit 6c8a954
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 9 deletions.
2 changes: 1 addition & 1 deletion kiwixbuild/dependencies/aria2.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .base import Dependency, ReleaseDownload, MakeBuilder
from .base import Dependency, ReleaseDownload, MakeBuilder, NoopBuilder

from kiwixbuild.utils import Remotefile, run_command

Expand Down
22 changes: 14 additions & 8 deletions kiwixbuild/dependencies/libmicrohttpd.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .base import Dependency, ReleaseDownload, MakeBuilder
from .base import Dependency, ReleaseDownload, MesonBuilder

from kiwixbuild.utils import Remotefile

Expand All @@ -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",
]
29 changes: 29 additions & 0 deletions kiwixbuild/patches/libmicrohttpd_meson_pkgconfig.patch
Original file line number Diff line number Diff line change
@@ -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,

0 comments on commit 6c8a954

Please sign in to comment.