[packages/gtk-webkit5] add patch for libxml2 >= 2.12

atler atler at pld-linux.org
Sat Jan 18 19:42:34 CET 2025


commit bef4af411e9bc4996753c75102e68aa6f734884e
Author: Jan Palus <atler at pld-linux.org>
Date:   Sat Jan 18 19:23:32 2025 +0100

    add patch for libxml2 >= 2.12

 gtk-webkit5.spec  |  2 ++
 libxml-2.12.patch | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 58 insertions(+)
---
diff --git a/gtk-webkit5.spec b/gtk-webkit5.spec
index bf4ca37..f33a1b0 100644
--- a/gtk-webkit5.spec
+++ b/gtk-webkit5.spec
@@ -33,6 +33,7 @@ Patch3:		%{name}-driver-version-suffix.patch
 Patch4:		%{name}-gcc13.patch
 Patch5:		icu76.patch
 Patch6:		glib-api-closure.patch
+Patch7:		libxml-2.12.patch
 URL:		https://webkitgtk.org/
 BuildRequires:	/usr/bin/ld.gold
 BuildRequires:	EGL-devel
@@ -182,6 +183,7 @@ Dokumentacja API portu WebKitu do GTK 4.
 %patch -P 4 -p1
 %patch -P 5 -p1
 %patch -P 6 -p1
+%patch -P 7 -p1
 
 %build
 %if %{with lowmem}
diff --git a/libxml-2.12.patch b/libxml-2.12.patch
new file mode 100644
index 0000000..1b13d43
--- /dev/null
+++ b/libxml-2.12.patch
@@ -0,0 +1,56 @@
+From 1bad176b2496579d760852c80cff3ad9fb7c3a4b Mon Sep 17 00:00:00 2001
+From: Adrian Perez de Castro <aperez at igalia.com>
+Date: Mon, 20 Nov 2023 07:42:30 -0800
+Subject: [PATCH] Build fails with libxml2 version 2.12.0 due to API change
+ https://bugs.webkit.org/show_bug.cgi?id=265128
+
+Reviewed by Philippe Normand.
+
+Starting with libxml2 2.12.0, the API has changed the const-ness of the
+xmlError pointers, which results in a build error due to a mismatched
+type in the parsing error callback. This papers over the difference by
+using preprocessor conditionals.
+
+* Source/WebCore/xml/XSLTProcessor.h: Use const when building against
+  libxml2 2.12.0 or newer.
+* Source/WebCore/xml/XSLTProcessorLibxslt.cpp:
+(WebCore::XSLTProcessor::parseErrorFunc): Ditto.
+
+Canonical link: https://commits.webkit.org/270977@main
+---
+ Source/WebCore/xml/XSLTProcessor.h          | 4 ++++
+ Source/WebCore/xml/XSLTProcessorLibxslt.cpp | 4 ++++
+ 2 files changed, 8 insertions(+)
+
+diff --git a/Source/WebCore/xml/XSLTProcessor.h b/Source/WebCore/xml/XSLTProcessor.h
+index 21bb45b5cbe16..5cf20557918fa 100644
+--- a/Source/WebCore/xml/XSLTProcessor.h
++++ b/Source/WebCore/xml/XSLTProcessor.h
+@@ -61,7 +61,11 @@ class XSLTProcessor : public RefCounted<XSLTProcessor> {
+ 
+     void reset();
+ 
++#if LIBXML_VERSION >= 21200
++    static void parseErrorFunc(void* userData, const xmlError*);
++#else
+     static void parseErrorFunc(void* userData, xmlError*);
++#endif
+     static void genericErrorFunc(void* userData, const char* msg, ...);
+     
+     // Only for libXSLT callbacks
+diff --git a/Source/WebCore/xml/XSLTProcessorLibxslt.cpp b/Source/WebCore/xml/XSLTProcessorLibxslt.cpp
+index a65691087e3c5..9f6b363dfc6c9 100644
+--- a/Source/WebCore/xml/XSLTProcessorLibxslt.cpp
++++ b/Source/WebCore/xml/XSLTProcessorLibxslt.cpp
+@@ -59,7 +59,11 @@ void XSLTProcessor::genericErrorFunc(void*, const char*, ...)
+     // It would be nice to do something with this error message.
+ }
+ 
++#if LIBXML_VERSION >= 21200
++void XSLTProcessor::parseErrorFunc(void* userData, const xmlError* error)
++#else
+ void XSLTProcessor::parseErrorFunc(void* userData, xmlError* error)
++#endif
+ {
+     PageConsoleClient* console = static_cast<PageConsoleClient*>(userData);
+     if (!console)
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/gtk-webkit5.git/commitdiff/bef4af411e9bc4996753c75102e68aa6f734884e



More information about the pld-cvs-commit mailing list