diff --git a/app-text/podofo/files/podofo-0.10.3-libcxx-20-from_chars.patch b/app-text/podofo/files/podofo-0.10.3-libcxx-20-from_chars.patch new file mode 100644 index 0000000000000..ddd047ab141e3 --- /dev/null +++ b/app-text/podofo/files/podofo-0.10.3-libcxx-20-from_chars.patch @@ -0,0 +1,23 @@ +From https://github.com/podofo/podofo/commit/aa9267229b40b49e5927f286841be4cbe81d05d5.patch Mon Sep 17 00:00:00 2001 +From: Yao Zi +Date: Sun, 22 Jun 2025 07:02:49 +0000 +Subject: [PATCH] private: charconv: Don't define from_chars for libc++ 20 or + later + +LLVM libc++ starts to provide a float-point-capable std::from_chars() +since LLVM 20 release[1]. Unconditionally defining from_chars() when +using Clang will cause ambiguous references and fails the build. + +Link: https://github.com/llvm/llvm-project/pull/91651 # [1] +Signed-off-by: Yao Zi +--- a/src/podofo/private/charconv_compat.h ++++ b/src/podofo/private/charconv_compat.h +@@ -7,7 +7,7 @@ + #if defined(__GNUC__) && !defined(__clang__) && __GNUC__ < 10 + #define WANT_CHARS_FORMAT + #endif +-#if (defined(__GNUC__) && __GNUC__ < 11) || defined(__clang__) ++#if (defined(__GNUC__) && !defined(__clang__) && __GNUC__ < 11) || (defined(__clang__) && defined(_LIBCPP_VERSION) && (_LIBCPP_VERSION < 200000)) + #define WANT_FROM_CHARS + #endif + #if (defined(__GNUC__) && !defined(__clang__) && !defined(__MINGW32__) && __GNUC__ < 11) || (defined(__MINGW32__) && __GNUC__ < 12) || (defined(__clang__) && ((defined(__apple_build_version__) && __apple_build_version__ < 15000000) || __clang_major__ < 14)) diff --git a/app-text/podofo/podofo-0.10.3-r1.ebuild b/app-text/podofo/podofo-0.10.3-r1.ebuild index 0ddfff4f73b4c..0093d62004a54 100644 --- a/app-text/podofo/podofo-0.10.3-r1.ebuild +++ b/app-text/podofo/podofo-0.10.3-r1.ebuild @@ -37,6 +37,11 @@ BDEPEND=" test? ( fontconfig? ( media-fonts/liberation-fonts ) ) " +PATCHES=( + # backport of https://github.com/podofo/podofo/commit/aa9267229b40b49e5927f286841be4cbe81d05d5 + "${FILESDIR}/${P}-libcxx-20-from_chars.patch" +) + src_prepare() { cmake_src_prepare if use test; then