dev-cpp/cpp-httplib: fix build with zstd

Closes: https://bugs.gentoo.org/952844
Signed-off-by: Alexey Sokolov <alexey+gentoo@asokolov.org>
Closes: https://github.com/gentoo/gentoo/pull/41354
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Alexey Sokolov 2025-03-28 20:11:12 +00:00 committed by Sam James
parent 8e47ed1340
commit 4abc2fca7c
No known key found for this signature in database
GPG Key ID: 738409F520DF9190
2 changed files with 27 additions and 0 deletions

View File

@ -46,8 +46,13 @@ DEPEND="
"
BDEPEND="
${PYTHON_DEPS}
virtual/pkgconfig
"
PATCHES=(
"${FILESDIR}/${P}-zstd.patch"
)
src_configure() {
local -a mycmakeargs=(
-DHTTPLIB_COMPILE=yes

View File

@ -0,0 +1,22 @@
https://github.com/yhirose/cpp-httplib/pull/2121
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -159,10 +159,16 @@ elseif(HTTPLIB_USE_BROTLI_IF_AVAILABLE)
endif()
if(HTTPLIB_REQUIRE_ZSTD)
- find_package(zstd REQUIRED)
+ find_package(zstd)
+ if(NOT zstd_FOUND)
+ find_package(PkgConfig REQUIRED)
+ pkg_check_modules(zstd REQUIRED IMPORTED_TARGET libzstd)
+ add_library(zstd::libzstd ALIAS PkgConfig::zstd)
+ endif()
set(HTTPLIB_IS_USING_ZSTD TRUE)
elseif(HTTPLIB_USE_ZSTD_IF_AVAILABLE)
find_package(zstd QUIET)
+ # TODO: try to find it via pkg-config
set(HTTPLIB_IS_USING_ZSTD ${zstd_FOUND})
endif()