commit:     b232fb8264c2dd29bb1a8987451dee8d078cc58a
Author:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
AuthorDate: Sat Feb  7 01:41:16 2026 +0000
Commit:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
CommitDate: Sat Feb  7 02:03:53 2026 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b232fb82

net-libs/webkit-gtk: fix the build on riscv and re-keyword

It still doesn't build with ~arch clang, but ~arch gcc works this time
around. I've also enabled ruby40 sans testing for the r600 because it's
only a build dep.

Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org>

 .../2.50.4-disable-native-simd-on-riscv.patch      | 20 ++++++++++++++++++
 .../files/2.50.4-fix-angle-include.patch           | 21 +++++++++++++++++++
 .../webkit-gtk/files/2.50.4-prefer-pthread.patch   | 23 +++++++++++++++++++++
 net-libs/webkit-gtk/webkit-gtk-2.50.4-r410.ebuild  | 22 ++++++++++++--------
 net-libs/webkit-gtk/webkit-gtk-2.50.4-r600.ebuild  | 24 +++++++++++++---------
 5 files changed, 91 insertions(+), 19 deletions(-)

diff --git 
a/net-libs/webkit-gtk/files/2.50.4-disable-native-simd-on-riscv.patch 
b/net-libs/webkit-gtk/files/2.50.4-disable-native-simd-on-riscv.patch
new file mode 100644
index 000000000000..69265cd77d21
--- /dev/null
+++ b/net-libs/webkit-gtk/files/2.50.4-disable-native-simd-on-riscv.patch
@@ -0,0 +1,20 @@
+Description: Fix FTBFS on RISC-V by manually disabling native SIMD
+ Manually disable native SIMD on riscv64 to prevent FTBFS
+Author: Valentin Haudiquet <[email protected]>
+Last-Update: 2025-09-09
+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/webkit2gtk/+bug/2121516
+---
+
+--- webkit2gtk-2.48.6.orig/Source/WTF/wtf/simde/arm/neon.h
++++ webkit2gtk-2.48.6/Source/WTF/wtf/simde/arm/neon.h
+@@ -31,6 +31,10 @@
+ #if !defined(SIMDE_ARM_NEON_H)
+ #define SIMDE_ARM_NEON_H
+ 
++#ifndef SIMDE_RISCV_V_NO_NATIVE
++#define SIMDE_RISCV_V_NO_NATIVE 1
++#endif
++
+ /* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */
+ /* b8e468a68a879f51c694791e17a4bff175d7cd5e */
+ /* :: Begin simde/arm/neon/types.h :: */

diff --git a/net-libs/webkit-gtk/files/2.50.4-fix-angle-include.patch 
b/net-libs/webkit-gtk/files/2.50.4-fix-angle-include.patch
new file mode 100644
index 000000000000..434da49d2928
--- /dev/null
+++ b/net-libs/webkit-gtk/files/2.50.4-fix-angle-include.patch
@@ -0,0 +1,21 @@
+--- 
a/Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentGtk.cpp
++++ 
b/Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentGtk.cpp
+@@ -54,6 +54,7 @@
+ #include "WebKitDOMXPathResultPrivate.h"
+ #include <WebCore/CSSImportRule.h>
+ #include <WebCore/CSSStyleProperties.h>
++#include <WebCore/CustomElementRegistry.h>
+ #include <WebCore/DOMException.h>
+ #include <WebCore/DocumentFullscreen.h>
+ #include <WebCore/DocumentInlines.h>
+--- 
a/Source/WebKit/WebProcess/GPU/graphics/RemoteDisplayListRecorderIdentifier.h
++++ 
b/Source/WebKit/WebProcess/GPU/graphics/RemoteDisplayListRecorderIdentifier.h
+@@ -25,7 +25,7 @@
+ 
+ #pragma once
+ 
+-#if ENABLE(GPU_PROCESS) && ENABLE(WEBGL)
++#if ENABLE(GPU_PROCESS)
+ 
+ #include <wtf/ObjectIdentifier.h>
+ 

diff --git a/net-libs/webkit-gtk/files/2.50.4-prefer-pthread.patch 
b/net-libs/webkit-gtk/files/2.50.4-prefer-pthread.patch
new file mode 100644
index 000000000000..2f8f0b2efbe2
--- /dev/null
+++ b/net-libs/webkit-gtk/files/2.50.4-prefer-pthread.patch
@@ -0,0 +1,23 @@
+From: Alberto Garcia <[email protected]>
+Description: Enable THREADS_PREFER_PTHREAD_FLAG
+ This fixes a FTBFS in riscv64
+Bug: https://bugs.webkit.org/show_bug.cgi?id=182622
+Bug-Debian: https://bugs.debian.org/895969
+Origin: https://trac.webkit.org/changeset/231843
+--- a/Source/cmake/OptionsGTK.cmake
++++ b/Source/cmake/OptionsGTK.cmake
+@@ -6,6 +6,7 @@ WEBKIT_OPTION_BEGIN()
+ SET_PROJECT_VERSION(2 50 4)
+ 
+ set(USER_AGENT_BRANDING "" CACHE STRING "Branding to add to user agent 
string")
++set(THREADS_PREFER_PTHREAD_FLAG ON)
+ 
+ # Update Source/WTF/wtf/Platform.h to match required GLib versions.
+ find_package(GLIB 2.70.0 REQUIRED COMPONENTS gio gio-unix gobject gthread 
gmodule)
+--- a/Source/cmake/OptionsJSCOnly.cmake
++++ b/Source/cmake/OptionsJSCOnly.cmake
+@@ -1,3 +1,4 @@
++set(THREADS_PREFER_PTHREAD_FLAG ON)
+ find_package(Threads REQUIRED)
+ 
+ if (MSVC)

diff --git a/net-libs/webkit-gtk/webkit-gtk-2.50.4-r410.ebuild 
b/net-libs/webkit-gtk/webkit-gtk-2.50.4-r410.ebuild
index 1e5ec602d2b9..fe0ee8cb100f 100644
--- a/net-libs/webkit-gtk/webkit-gtk-2.50.4-r410.ebuild
+++ b/net-libs/webkit-gtk/webkit-gtk-2.50.4-r410.ebuild
@@ -17,7 +17,7 @@ S="${WORKDIR}/${MY_P}"
 
 LICENSE="LGPL-2+ BSD"
 SLOT="4.1/0" # soname version of libwebkit2gtk-4.1
-KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~sparc ~x86"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86"
 
 IUSE="aqua avif examples gamepad keyring +gstreamer +introspection pdf jpegxl 
+jumbo-build lcms seccomp spell systemd wayland X"
 REQUIRED_USE="|| ( aqua wayland X )"
@@ -146,6 +146,9 @@ src_prepare() {
 
        # https://bugs.gentoo.org/938162, see also mycmakeargs
        eapply "${FILESDIR}"/2.48.3-fix-ftbfs-riscv64.patch
+       eapply "${FILESDIR}"/2.50.4-disable-native-simd-on-riscv.patch
+       eapply "${FILESDIR}"/2.50.4-prefer-pthread.patch
+       eapply "${FILESDIR}"/2.50.4-fix-angle-include.patch
 
        # We don't want -Werror for gobject-introspection (bug #947761)
        sed -i -e "s:--warn-error::" Source/cmake/FindGI.cmake || die
@@ -238,14 +241,15 @@ src_configure() {
                -DUSE_WOFF2=ON
        )
 
-       # Temporary workaround for bug 938162 (upstream bug 271371)
-       # in concert with our Debian patch. The idea to enable C_LOOP
-       # is also stolen from Debian's build.
-       use riscv && mycmakeargs+=(
-               -DENABLE_WEBASSEMBLY=OFF
-               -DENABLE_JIT=OFF
-               -DENABLE_C_LOOP=ON
-       )
+       if use riscv; then
+               # https://bugs.webkit.org/show_bug.cgi?id=305745
+               append-cppflags -DSKCMS_HAS_MUSTTAIL=0
+
+               # Workaround for bug 938162 (upstream bug 271371).
+               mycmakeargs+=(
+                       -DENABLE_WEBASSEMBLY=OFF
+               )
+       fi
 
        # https://bugs.gentoo.org/761238
        append-cppflags -DNDEBUG

diff --git a/net-libs/webkit-gtk/webkit-gtk-2.50.4-r600.ebuild 
b/net-libs/webkit-gtk/webkit-gtk-2.50.4-r600.ebuild
index 56cf9830ea3c..883316c7bcb1 100644
--- a/net-libs/webkit-gtk/webkit-gtk-2.50.4-r600.ebuild
+++ b/net-libs/webkit-gtk/webkit-gtk-2.50.4-r600.ebuild
@@ -4,7 +4,7 @@
 EAPI=8
 PYTHON_REQ_USE="xml(+)"
 PYTHON_COMPAT=( python3_{11..14} )
-USE_RUBY="ruby31 ruby32 ruby33 ruby34"
+USE_RUBY="ruby31 ruby32 ruby33 ruby34 ruby40"
 
 inherit check-reqs flag-o-matic gnome2 optfeature python-any-r1 ruby-single 
toolchain-funcs cmake
 
@@ -17,7 +17,7 @@ S="${WORKDIR}/${MY_P}"
 
 LICENSE="LGPL-2+ BSD"
 SLOT="6/0" # soname version of libwebkit2gtk-6.0
-KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~sparc ~x86"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86"
 
 IUSE="aqua avif examples gamepad keyring +gstreamer +introspection pdf jpegxl 
+jumbo-build lcms seccomp spell systemd wayland X"
 REQUIRED_USE="|| ( aqua wayland X )"
@@ -155,6 +155,9 @@ src_prepare() {
 
        # https://bugs.gentoo.org/938162, see also mycmakeargs
        eapply "${FILESDIR}"/2.48.3-fix-ftbfs-riscv64.patch
+       eapply "${FILESDIR}"/2.50.4-disable-native-simd-on-riscv.patch
+       eapply "${FILESDIR}"/2.50.4-prefer-pthread.patch
+       eapply "${FILESDIR}"/2.50.4-fix-angle-include.patch
 
        # We don't want -Werror for gobject-introspection (bug #947761)
        sed -i -e "s:--warn-error::" Source/cmake/FindGI.cmake || die
@@ -247,14 +250,15 @@ src_configure() {
                -DUSE_WOFF2=ON
        )
 
-       # Temporary workaround for bug 938162 (upstream bug 271371)
-       # in concert with our Debian patch. The idea to enable C_LOOP
-       # is also stolen from Debian's build.
-       use riscv && mycmakeargs+=(
-               -DENABLE_WEBASSEMBLY=OFF
-               -DENABLE_JIT=OFF
-               -DENABLE_C_LOOP=ON
-       )
+       if use riscv; then
+               # https://bugs.webkit.org/show_bug.cgi?id=305745
+               append-cppflags -DSKCMS_HAS_MUSTTAIL=0
+
+               # Workaround for bug 938162 (upstream bug 271371).
+               mycmakeargs+=(
+                       -DENABLE_WEBASSEMBLY=OFF
+               )
+       fi
 
        # https://bugs.gentoo.org/761238
        append-cppflags -DNDEBUG

Reply via email to