diff --git a/community/wpewebkit/APKBUILD b/community/wpewebkit/APKBUILD
index e4a0adfc654b2df35b3d9cf6a5b0a8240ce557ba..29a51175c108eb81947b48d32f1156bae3cb41ba 100644
--- a/community/wpewebkit/APKBUILD
+++ b/community/wpewebkit/APKBUILD
@@ -46,6 +46,7 @@ subpackages="$pkgname-dev $pkgname-doc"
 source="https://wpewebkit.org/releases/wpewebkit-$pkgver.tar.xz
 	armv6kz.patch
 	initial-exec.patch
+	libxml2-2.12.patch
 	patch-gettext.patch
 	"
 options="!check"
@@ -112,5 +113,6 @@ sha512sums="
 5874eedb6c605ee0663bf70f75c35b7badb3330bcd1bd36671ac3be1beee1bf27f0cfc1875fa5c1841ceb0030c0e7bd278fae7877921c29f365a5c377d8f134d  wpewebkit-2.40.5.tar.xz
 8c89d4ac737a2bd6d970fec3ecb9d0b72d61ffb9a37d4b0b56bc0106914398a65319e940c593c0305fc40d6900aac2a8b4fc3bafc9a96062063d15abd1f5039d  armv6kz.patch
 26f3df81758068a83bf770e1f8b48546e9ec2428d23cbc4e1c5cc7851c91ad1dfeeac89aea73568a5f498cd6c053aaab7e1af67e59a471ad2d0375c1c64cbd8a  initial-exec.patch
+d583ddc3d99fe6231c7073c6c8961e7ec7c418464d512a31efaced4a9f686712b3b48536ab9703cf602874f8e0209102fe1d9100936b80fd216eb758aceea6a2  libxml2-2.12.patch
 4316330f0c42fcfe800210bdbeabbb6bdcf532b71e2761550b8a753499d801fd0405cc961a516dfddfc28c3a6cf0c17b6db461ff51158238b8d874bf75b799f2  patch-gettext.patch
 "
diff --git a/community/wpewebkit/libxml2-2.12.patch b/community/wpewebkit/libxml2-2.12.patch
new file mode 100644
index 0000000000000000000000000000000000000000..387e5392989614163d396f4540d00e92782dadff
--- /dev/null
+++ b/community/wpewebkit/libxml2-2.12.patch
@@ -0,0 +1,58 @@
+Patch-Source: https://github.com/WebPlatformForEmbedded/WPEWebKit/commit/2c9d24b8ef008a7319cd3901e82bfd44463f76d7.patch
+--
+From 2c9d24b8ef008a7319cd3901e82bfd44463f76d7 Mon Sep 17 00:00:00 2001
+From: Adrian Perez de Castro <aperez@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 80813f441ae11..1743411bb30bc 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 c4da91141be7d..5c7135027ea08 100644
+--- a/Source/WebCore/xml/XSLTProcessorLibxslt.cpp
++++ b/Source/WebCore/xml/XSLTProcessorLibxslt.cpp
+@@ -62,7 +62,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)