commit:     605ec04b0dffa45fe90f9a10146f5a68207f4e9a
Author:     Jernej Jakob <jernej.jakob <AT> gmail <DOT> com>
AuthorDate: Sat Jul  5 00:59:18 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Jul  5 04:45:23 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=605ec04b

net-libs/webkit-gtk: fix build with clang 20 for 2.46.5

upstream https://bugs.webkit.org/show_bug.cgi?id=295472

Closes: https://bugs.gentoo.org/959511
Signed-off-by: Jernej Jakob <jernej.jakob <AT> gmail.com>
Part-of: https://github.com/gentoo/gentoo/pull/42875
Closes: https://github.com/gentoo/gentoo/pull/42875
Signed-off-by: Sam James <sam <AT> gentoo.org>

 ...h-error-no-matching-function-for-call-to-.patch | 51 ++++++++++++++++++++++
 net-libs/webkit-gtk/webkit-gtk-2.46.5-r1.ebuild    |  3 ++
 net-libs/webkit-gtk/webkit-gtk-2.46.5-r411.ebuild  |  3 ++
 net-libs/webkit-gtk/webkit-gtk-2.46.5-r601.ebuild  |  3 ++
 4 files changed, 60 insertions(+)

diff --git 
a/net-libs/webkit-gtk/files/2.46.5-EnumTraits.h-error-no-matching-function-for-call-to-.patch
 
b/net-libs/webkit-gtk/files/2.46.5-EnumTraits.h-error-no-matching-function-for-call-to-.patch
new file mode 100644
index 000000000000..a5f0e2675cc9
--- /dev/null
+++ 
b/net-libs/webkit-gtk/files/2.46.5-EnumTraits.h-error-no-matching-function-for-call-to-.patch
@@ -0,0 +1,51 @@
+Modified patch from upstream commit 
+https://github.com/WebKit/WebKit/commit/654f0c3
+to apply on 2.46.5
+
+Original author fujii (Fujii Hironori)
+
+--- a/Source/WTF/wtf/EnumTraits.h      2025-07-04 00:55:33.552603416 +0200
++++ b/Source/WTF/wtf/EnumTraits.h      2025-07-04 01:08:04.845970071 +0200
+@@ -161,6 +161,16 @@
+ #pragma clang diagnostic ignored "-Wenum-constexpr-conversion"
+ #endif
+ 
++#if COMPILER(CLANG) && __clang_major__ >= 16
++template <typename E, auto V, typename = void>
++inline constexpr bool isEnumConstexprStaticCastValid = false;
++template <typename E, auto V>
++inline constexpr bool isEnumConstexprStaticCastValid<E, V, 
std::void_t<std::integral_constant<E, static_cast<E>(V)>>> = true;
++#else
++template <typename, auto>
++inline constexpr bool isEnumConstexprStaticCastValid = true;
++#endif
++
+ template<typename E>
+ constexpr std::span<const char> enumTypeNameImpl()
+ {
+@@ -224,6 +234,16 @@
+     return result;
+ }
+ 
++template<typename E, auto V>
++constexpr std::span<const char> enumName()
++{
++    if constexpr (isEnumConstexprStaticCastValid<E, V>)
++        return enumName<static_cast<E>(V)>();
++    else
++        return { };
++}
++
++
+ namespace detail {
+ 
+ template<size_t i, size_t end>
+@@ -243,7 +263,7 @@
+     std::array<std::span<const char>, limit> names;
+ 
+     detail::forConstexpr<0, limit>([&] (auto i) {
+-        names[i] = enumName<static_cast<E>(static_cast<unsigned>(i))>();
++        names[i] = enumName<E, static_cast<unsigned>(i)>();
+     });
+     return names;
+ }

diff --git a/net-libs/webkit-gtk/webkit-gtk-2.46.5-r1.ebuild 
b/net-libs/webkit-gtk/webkit-gtk-2.46.5-r1.ebuild
index 72b1c0b6926b..e33758e3dd7f 100644
--- a/net-libs/webkit-gtk/webkit-gtk-2.46.5-r1.ebuild
+++ b/net-libs/webkit-gtk/webkit-gtk-2.46.5-r1.ebuild
@@ -149,6 +149,9 @@ src_prepare() {
        # https://bugs.gentoo.org/943213
        eapply "${FILESDIR}"/2.44.4-fix-icu76.1.patch
 
+       # bug #959511 upstream https://bugs.webkit.org/show_bug.cgi?id=295472
+       eapply 
"${FILESDIR}"/2.46.5-EnumTraits.h-error-no-matching-function-for-call-to-.patch
+
        # We don't want -Werror for gobject-introspection (bug #947761)
        sed -i -e "s:--warn-error::" Source/cmake/FindGI.cmake || die
 }

diff --git a/net-libs/webkit-gtk/webkit-gtk-2.46.5-r411.ebuild 
b/net-libs/webkit-gtk/webkit-gtk-2.46.5-r411.ebuild
index 36a862d7577a..d1cd746c56a9 100644
--- a/net-libs/webkit-gtk/webkit-gtk-2.46.5-r411.ebuild
+++ b/net-libs/webkit-gtk/webkit-gtk-2.46.5-r411.ebuild
@@ -149,6 +149,9 @@ src_prepare() {
        # https://bugs.gentoo.org/943213
        eapply "${FILESDIR}"/2.44.4-fix-icu76.1.patch
 
+       # bug #959511 upstream https://bugs.webkit.org/show_bug.cgi?id=295472
+       eapply 
"${FILESDIR}"/2.46.5-EnumTraits.h-error-no-matching-function-for-call-to-.patch
+
        # We don't want -Werror for gobject-introspection (bug #947761)
        sed -i -e "s:--warn-error::" Source/cmake/FindGI.cmake || die
 }

diff --git a/net-libs/webkit-gtk/webkit-gtk-2.46.5-r601.ebuild 
b/net-libs/webkit-gtk/webkit-gtk-2.46.5-r601.ebuild
index b0a039003bd9..36b648b26489 100644
--- a/net-libs/webkit-gtk/webkit-gtk-2.46.5-r601.ebuild
+++ b/net-libs/webkit-gtk/webkit-gtk-2.46.5-r601.ebuild
@@ -160,6 +160,9 @@ src_prepare() {
        # https://bugs.gentoo.org/943213
        eapply "${FILESDIR}"/2.44.4-fix-icu76.1.patch
 
+       # bug #959511 upstream https://bugs.webkit.org/show_bug.cgi?id=295472
+       eapply 
"${FILESDIR}"/2.46.5-EnumTraits.h-error-no-matching-function-for-call-to-.patch
+
        # We don't want -Werror for gobject-introspection (bug #947761)
        sed -i -e "s:--warn-error::" Source/cmake/FindGI.cmake || die
 }

Reply via email to