commit: 7e353ac7f6a5fe05f115320427be540f13cd07ad Author: Alexey Sokolov <alexey+gentoo <AT> asokolov <DOT> org> AuthorDate: Mon Feb 2 13:15:49 2026 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Wed Feb 11 04:29:46 2026 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7e353ac7
dev-cpp/cpp-httplib: add 0.31.0, switch to meson Signed-off-by: Alexey Sokolov <alexey+gentoo <AT> asokolov.org> Part-of: https://codeberg.org/gentoo/gentoo/pulls/28 Merges: https://codeberg.org/gentoo/gentoo/pulls/28 Signed-off-by: Sam James <sam <AT> gentoo.org> dev-cpp/cpp-httplib/Manifest | 1 + dev-cpp/cpp-httplib/cpp-httplib-0.31.0.ebuild | 98 ++++++++++++++++++++++ .../files/cpp-httplib-0.31.0-mbedtls-3.patch | 17 ++++ .../files/cpp-httplib-0.31.0-mbedtls.patch | 61 ++++++++++++++ dev-cpp/cpp-httplib/metadata.xml | 3 + 5 files changed, 180 insertions(+) diff --git a/dev-cpp/cpp-httplib/Manifest b/dev-cpp/cpp-httplib/Manifest index 2ba636110844..50c446f82d59 100644 --- a/dev-cpp/cpp-httplib/Manifest +++ b/dev-cpp/cpp-httplib/Manifest @@ -1,3 +1,4 @@ DIST cpp-httplib-0.26.0.tar.gz 1305573 BLAKE2B 4fcb11a4d3af71fa5b67f2dac7c0f3e0a5cae6ed2bf527686ca05dd03b4a91042dfdcfb068b5dc7dd58fd31a537a44ae6f38df7c5d87a1973e3ff738a51dd946 SHA512 b364500f76e2ecb0fe21b032d831272e3f1dfeea71af74e325f8fc4ce9dcdb3c941b97a5b422bdeafb9facd058597b90f8bfc284fb9afe3c33fefa15dd5a010b DIST cpp-httplib-0.27.0.tar.gz 1311061 BLAKE2B b273d9ac6a79d74b47d27b49357f0d9ae61501cecba21b61cd53a74d056b9acdaeba530cdfd02111debaadab15c9076e44727997be32de3947eaf16ecdc846c5 SHA512 884d6be8209d8128af2b11c35d7fc592d8a236a65cdcd9b123a77aa73fbd0dbd03c1cbe17cf4dd92797b06d312c9476d59646b9034d8e559095852b021138acc DIST cpp-httplib-0.28.0.tar.gz 1312543 BLAKE2B af3d76280bf7299575e04cafd058f7bc223481d5c0316cc8a5d87850de6243174e138be0625e5939ff1c815003ba45c556d14f04b20a26c67bdca313b75e133c SHA512 e7a8877d489c97669a8ee536e1498575be921e558ed947253013fe6b67a49d4569eedd01f543caa70183b92d8ac0e8687d662a70d880954412e387317008a239 +DIST cpp-httplib-0.31.0.tar.gz 1379520 BLAKE2B c1f2fd552f50d45b8fd6295f911ed0756c552e776c8b1c70f229a3cae83b3167a6dbaaf964ea766235c2522e508b63dd654cae8607184e0416ffe29bd566d01d SHA512 40c584693fa5a0e989fde84453a4914cc21d9630d6c43dc3565f3b2fadca8515ea820fc4a362c4f8799e79710292ae489787d279ddb317d197ee52f840249aea diff --git a/dev-cpp/cpp-httplib/cpp-httplib-0.31.0.ebuild b/dev-cpp/cpp-httplib/cpp-httplib-0.31.0.ebuild new file mode 100644 index 000000000000..ef33c789fd1b --- /dev/null +++ b/dev-cpp/cpp-httplib/cpp-httplib-0.31.0.ebuild @@ -0,0 +1,98 @@ +# Copyright 2022-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{11..14} ) + +inherit meson-multilib python-any-r1 + +DESCRIPTION="C++ HTTP/HTTPS server and client library" +HOMEPAGE="https://github.com/yhirose/cpp-httplib/" + +if [[ "${PV}" == *9999* ]] ; then + inherit git-r3 + + EGIT_REPO_URI="https://github.com/yhirose/${PN}.git" +else + SRC_URI="https://github.com/yhirose/${PN}/archive/v${PV}.tar.gz + -> ${P}.tar.gz" + + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" +fi + +LICENSE="MIT" +SLOT="0/$(ver_cut 0-2)" # soversion + +IUSE="brotli mbedtls ssl test zlib zstd" +REQUIRED_USE="test? ( ssl )" +RESTRICT="!test? ( test )" + +RDEPEND=" + brotli? ( + app-arch/brotli:=[${MULTILIB_USEDEP}] + ) + ssl? ( + mbedtls? ( net-libs/mbedtls:3=[${MULTILIB_USEDEP}] ) + !mbedtls? ( >=dev-libs/openssl-3.0.13:=[${MULTILIB_USEDEP}] ) + ) + zlib? ( + virtual/zlib:=[${MULTILIB_USEDEP}] + ) + zstd? ( + app-arch/zstd[${MULTILIB_USEDEP}] + ) +" +DEPEND=" + ${RDEPEND} + test? ( + dev-cpp/gtest + dev-libs/openssl + net-misc/curl + ) +" +BDEPEND="${PYTHON_DEPS}" + +PATCHES=( + "${FILESDIR}"/cpp-httplib-0.31.0-mbedtls.patch + "${FILESDIR}"/cpp-httplib-0.31.0-mbedtls-3.patch +) + +src_prepare() { + default + rm -r test/gtest || die +} + +src_configure() { + local emesonargs=( + -Dcompile=true + $(meson_feature zlib) + $(meson_feature zstd) + $(meson_feature brotli) + $(meson_feature ssl) + $(usex mbedtls -Dssl_backend=mbedtls -Dssl_backend=openssl) + $(meson_use test) + ) + meson-multilib_src_configure +} + +multilib_src_test() { + if [[ ${ABI} == x86 ]]; then + ewarn "Upstream no longer supports 32 bits:" + ewarn https://github.com/yhirose/cpp-httplib/issues/2148 + return + fi + + local -a failing_tests=( + # Disable all online tests. + "*.*_Online" + # https://github.com/yhirose/cpp-httplib/issues/2351 + SSLClientTest.UpdateCAStoreWithPem + ) + + # Little dance to please the GTEST filter (join array using ":"). + local failing_tests_str="${failing_tests[@]}" + local failing_tests_filter="${failing_tests_str// /:}" + + GTEST_FILTER="-${failing_tests_filter}" meson_src_test +} diff --git a/dev-cpp/cpp-httplib/files/cpp-httplib-0.31.0-mbedtls-3.patch b/dev-cpp/cpp-httplib/files/cpp-httplib-0.31.0-mbedtls-3.patch new file mode 100644 index 000000000000..51d1e0bc6cd2 --- /dev/null +++ b/dev-cpp/cpp-httplib/files/cpp-httplib-0.31.0-mbedtls-3.patch @@ -0,0 +1,17 @@ +Gentoo: use slotted mbedtls + +--- a/meson.build ++++ b/meson.build +@@ -49,9 +49,9 @@ if get_option('ssl').allowed() + ssl_found = true + endif + else +- mbedtls_dep = dependency('mbedtls', required: get_option('ssl')) +- mbedtlsx509_dep = dependency('mbedx509', required: get_option('ssl')) +- mbedtlscrypto_dep = dependency('mbedcrypto', required: get_option('ssl')) ++ mbedtls_dep = dependency('mbedtls-3', required: get_option('ssl')) ++ mbedtlsx509_dep = dependency('mbedx509-3', required: get_option('ssl')) ++ mbedtlscrypto_dep = dependency('mbedcrypto-3', required: get_option('ssl')) + if mbedtls_dep.found() and mbedtlsx509_dep.found() and mbedtlscrypto_dep.found() + deps += mbedtls_dep + deps += mbedtlsx509_dep diff --git a/dev-cpp/cpp-httplib/files/cpp-httplib-0.31.0-mbedtls.patch b/dev-cpp/cpp-httplib/files/cpp-httplib-0.31.0-mbedtls.patch new file mode 100644 index 000000000000..a113eb8ca8b9 --- /dev/null +++ b/dev-cpp/cpp-httplib/files/cpp-httplib-0.31.0-mbedtls.patch @@ -0,0 +1,61 @@ +https://github.com/yhirose/cpp-httplib/pull/2350 + +Add support for mbedtls to meson + +--- a/meson.build ++++ b/meson.build +@@ -39,11 +39,29 @@ endif + deps = [dependency('threads')] + args = [] + +-openssl_dep = dependency('openssl', version: '>=3.0.0', required: get_option('openssl')) +-if openssl_dep.found() +- deps += openssl_dep +- args += '-DCPPHTTPLIB_OPENSSL_SUPPORT' +- if host_machine.system() == 'darwin' ++if get_option('ssl').allowed() ++ ssl_found = false ++ if get_option('ssl_backend') == 'openssl' ++ openssl_dep = dependency('openssl', version: '>=3.0.0', required: get_option('ssl')) ++ if openssl_dep.found() ++ deps += openssl_dep ++ args += '-DCPPHTTPLIB_OPENSSL_SUPPORT' ++ ssl_found = true ++ endif ++ else ++ mbedtls_dep = dependency('mbedtls', required: get_option('ssl')) ++ mbedtlsx509_dep = dependency('mbedx509', required: get_option('ssl')) ++ mbedtlscrypto_dep = dependency('mbedcrypto', required: get_option('ssl')) ++ if mbedtls_dep.found() and mbedtlsx509_dep.found() and mbedtlscrypto_dep.found() ++ deps += mbedtls_dep ++ deps += mbedtlsx509_dep ++ deps += mbedtlscrypto_dep ++ args += '-DCPPHTTPLIB_MBEDTLS_SUPPORT' ++ ssl_found = true ++ endif ++ endif ++ ++ if ssl_found and host_machine.system() == 'darwin' + macosx_keychain_dep = dependency('appleframeworks', modules: ['CFNetwork', 'CoreFoundation', 'Security'], required: get_option('macosx_keychain')) + if macosx_keychain_dep.found() + deps += macosx_keychain_dep +--- a/meson_options.txt ++++ b/meson_options.txt +@@ -2,7 +2,8 @@ + # + # SPDX-License-Identifier: MIT + +-option('openssl', type: 'feature', value: 'auto', description: 'Enable OpenSSL support') ++option('ssl', type: 'feature', description: 'Enable SSL support') ++option('ssl_backend', type: 'combo', choices: ['openssl', 'mbedtls'], value: 'openssl', description: 'Which SSL library to use') + option('zlib', type: 'feature', value: 'auto', description: 'Enable zlib support') + option('brotli', type: 'feature', value: 'auto', description: 'Enable Brotli support') + option('zstd', type: 'feature', value: 'auto', description: 'Enable zstd support') +@@ -12,6 +13,7 @@ option('compile', type: 'boolean', value: false, description: 'Split the header + option('test', type: 'boolean', value: false, description: 'Build tests') + + # Old option names ++option('openssl', type: 'feature', deprecated: 'ssl') + option('cpp-httplib_openssl', type: 'feature', deprecated: 'openssl') + option('cpp-httplib_zlib', type: 'feature', deprecated: 'zlib') + option('cpp-httplib_brotli', type: 'feature', deprecated: 'brotli') diff --git a/dev-cpp/cpp-httplib/metadata.xml b/dev-cpp/cpp-httplib/metadata.xml index e8c1f646e6e8..cf346ba4d6d8 100644 --- a/dev-cpp/cpp-httplib/metadata.xml +++ b/dev-cpp/cpp-httplib/metadata.xml @@ -9,6 +9,9 @@ <email>[email protected]</email> <name>Proxy Maintainers</name> </maintainer> + <use> + <flag name="mbedtls">Use <pkg>net-libs/mbedtls</pkg> instead of <pkg>dev-libs/openssl</pkg>.</flag> + </use> <upstream> <remote-id type="github">yhirose/cpp-httplib</remote-id> <bugs-to>https://github.com/yhirose/cpp-httplib/issues</bugs-to>
