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@gentoo.org>
This commit is contained in:
Michael Orlitzky
2026-02-06 21:03:53 -05:00
parent c602b2a76c
commit b232fb8264
5 changed files with 91 additions and 19 deletions
@@ -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 <valentin.haudiquet@canonical.com>
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 :: */
@@ -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>
@@ -0,0 +1,23 @@
From: Alberto Garcia <berto@igalia.com>
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)
@@ -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
@@ -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