From 3c998848b4c75601f8e55a886d79b4d51bb6f83f Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Sat, 13 Jul 2024 21:27:30 +0200 Subject: [PATCH] package/qt5/qt5webengine-chromium: fix build with recent libxml2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Backport upstream qtwebengine-chromium patch to fix: ./../../3rdparty/chromium/third_party/blink/renderer/core/xml/xslt_processor_libxslt.cc: In function ‘xmlDoc* blink::DocLoaderFunc(const xmlChar*, xmlDictPtr, int, void*, xsltLoadType)’: ./../../3rdparty/chromium/third_party/blink/renderer/core/xml/xslt_processor_libxslt.cc:127:32: error: invalid conversion from ‘void (*)(void*, xmlError*)’ {aka ‘void (*)(void*, _xmlError*)’} to ‘xmlStructuredErrorFunc’ {aka ‘void (*)(void*, const _xmlError*)’} [-fpermissive] 127 | xmlSetStructuredErrorFunc(console, XSLTProcessor::ParseErrorFunc); | ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | void (*)(void*, xmlError*) {aka void (*)(void*, _xmlError*)} Signed-off-by: Thomas Petazzoni --- ...010-Fix-building-with-system-libxml2.patch | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 package/qt5/qt5webengine-chromium/0010-Fix-building-with-system-libxml2.patch diff --git a/package/qt5/qt5webengine-chromium/0010-Fix-building-with-system-libxml2.patch b/package/qt5/qt5webengine-chromium/0010-Fix-building-with-system-libxml2.patch new file mode 100644 index 0000000000..4a4dade203 --- /dev/null +++ b/package/qt5/qt5webengine-chromium/0010-Fix-building-with-system-libxml2.patch @@ -0,0 +1,57 @@ +From 67ceca4b097a2d3de28020c9461641d9670009cc Mon Sep 17 00:00:00 2001 +From: Martin Negyokru +Date: Thu, 7 Dec 2023 15:37:53 +0100 +Subject: [PATCH] Fix building with system libxml2 + +Libxml2 2.12.0 has changed the const-ness of the +xmlError pointers, which results in a build error. + +Change-Id: Id86fcfbfe004f89109808b9bdb11c01133553884 +Reviewed-on: https://codereview.qt-project.org/c/qt/qtwebengine-chromium/+/523633 +Reviewed-by: Allan Sandfeld Jensen +(cherry picked from commit 159dff274a7f32f9b53711df6a5b6fbae8c64b4a) +Reviewed-on: https://codereview.qt-project.org/c/qt/qtwebengine-chromium/+/525714 +Reviewed-by: Qt Cherry-pick Bot +Upstream: https://github.com/qt/qtwebengine-chromium/commit/c98d28f2f0f23721 +Signed-off-by: Thomas Petazzoni +--- + .../third_party/blink/renderer/core/xml/xslt_processor.h | 5 +++++ + .../blink/renderer/core/xml/xslt_processor_libxslt.cc | 4 ++++ + 2 files changed, 9 insertions(+) + +diff --git a/chromium/third_party/blink/renderer/core/xml/xslt_processor.h b/chromium/third_party/blink/renderer/core/xml/xslt_processor.h +index e501cf17c37..e4550ec5009 100644 +--- a/chromium/third_party/blink/renderer/core/xml/xslt_processor.h ++++ b/chromium/third_party/blink/renderer/core/xml/xslt_processor.h +@@ -79,7 +79,12 @@ class XSLTProcessor final : public ScriptWrappable { + + void reset(); + ++#if LIBXML_VERSION >= 21200 ++ static void ParseErrorFunc(void* user_data, const xmlError*); ++#else + static void ParseErrorFunc(void* user_data, xmlError*); ++#endif ++ + static void GenericErrorFunc(void* user_data, const char* msg, ...); + + // Only for libXSLT callbacks +diff --git a/chromium/third_party/blink/renderer/core/xml/xslt_processor_libxslt.cc b/chromium/third_party/blink/renderer/core/xml/xslt_processor_libxslt.cc +index b3ce345f320..2174d1df1da 100644 +--- a/chromium/third_party/blink/renderer/core/xml/xslt_processor_libxslt.cc ++++ b/chromium/third_party/blink/renderer/core/xml/xslt_processor_libxslt.cc +@@ -60,7 +60,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* user_data, const xmlError* error) { ++#else + void XSLTProcessor::ParseErrorFunc(void* user_data, xmlError* error) { ++#endif + FrameConsole* console = static_cast(user_data); + if (!console) + return; +-- +2.25.1 +