git: dedcd8bf50d5 - main - editors/openoffice-*: Build with libxml2 >= 2.12.0

From: Don Lewis <truckman_at_FreeBSD.org>
Date: Fri, 11 Apr 2025 06:06:54 UTC
The branch main has been updated by truckman:

URL: https://cgit.FreeBSD.org/ports/commit/?id=dedcd8bf50d56aa7f30fc034373de333c987f34f

commit dedcd8bf50d56aa7f30fc034373de333c987f34f
Author:     Don Lewis <truckman@FreeBSD.org>
AuthorDate: 2025-04-11 02:41:26 +0000
Commit:     Don Lewis <truckman@FreeBSD.org>
CommitDate: 2025-04-11 06:02:19 +0000

    editors/openoffice-*: Build with libxml2 >= 2.12.0
    
    libxml2 2.12.0 added const to one of the arguments of the error
    callback function, changing its signature.  Check the libxml2 version
    so the function definition uses the proper type to fix the build
    breakage.
    
    PR:             281612
    Reported by:    Daniel Engberg <diizzy@FreeBSD.org>
---
 .../files/patch-unoxml_source_xpath_xpathapi.cxx   | 28 ++++++++++++++++++++++
 .../files/patch-unoxml_source_xpath_xpathapi.cxx   | 28 ++++++++++++++++++++++
 2 files changed, 56 insertions(+)

diff --git a/editors/openoffice-4/files/patch-unoxml_source_xpath_xpathapi.cxx b/editors/openoffice-4/files/patch-unoxml_source_xpath_xpathapi.cxx
new file mode 100644
index 000000000000..e81aaf1c06f8
--- /dev/null
+++ b/editors/openoffice-4/files/patch-unoxml_source_xpath_xpathapi.cxx
@@ -0,0 +1,28 @@
+--- unoxml/source/xpath/xpathapi.cxx.orig	2020-10-06 14:16:35 UTC
++++ unoxml/source/xpath/xpathapi.cxx
+@@ -267,7 +267,11 @@ namespace XPath
+         return selectSingleNode(contextNode, expr);
+     }
+ 
+-    static OUString make_error_message(xmlErrorPtr pError)
++#if LIBXML_VERSION >= 21200
++    static OUString make_error_message(const xmlError *pError)
++#else
++    static OUString make_error_message(xmlError *pError)
++#endif
+     {
+         ::rtl::OUStringBuffer buf;
+         if (pError->message) {
+@@ -312,7 +316,11 @@ namespace XPath
+             OSL_ENSURE(sal_False, msg.getStr());
+         }
+ 
+-        static void structured_error_func(void * userData, xmlErrorPtr error)
++#if LIBXML_VERSION >= 21200
++        static void structured_error_func(void * userData, const xmlError *error)
++#else
++        static void structured_error_func(void * userData, xmlError *error)
++#endif
+         {
+             (void) userData;
+             ::rtl::OUStringBuffer buf(
diff --git a/editors/openoffice-devel/files/patch-unoxml_source_xpath_xpathapi.cxx b/editors/openoffice-devel/files/patch-unoxml_source_xpath_xpathapi.cxx
new file mode 100644
index 000000000000..9caab82e4df3
--- /dev/null
+++ b/editors/openoffice-devel/files/patch-unoxml_source_xpath_xpathapi.cxx
@@ -0,0 +1,28 @@
+--- unoxml/source/xpath/xpathapi.cxx.orig	2019-09-17 22:55:24 UTC
++++ unoxml/source/xpath/xpathapi.cxx
+@@ -267,7 +267,11 @@ namespace XPath
+         return selectSingleNode(contextNode, expr);
+     }
+ 
+-    static OUString make_error_message(xmlErrorPtr pError)
++#if LIBXML_VERSION >= 21200
++    static OUString make_error_message(const xmlError *pError)
++#else
++    static OUString make_error_message(xmlError *pError)
++#endif
+     {
+         ::rtl::OUStringBuffer buf;
+         if (pError->message) {
+@@ -312,7 +316,11 @@ namespace XPath
+             OSL_ENSURE(sal_False, msg.getStr());
+         }
+ 
+-        static void structured_error_func(void * userData, xmlErrorPtr error)
++#if LIBXML_VERSION >= 21200
++        static void structured_error_func(void * userData, const xmlError *error)
++#else
++        static void structured_error_func(void * userData, xmlError *error)
++#endif
+         {
+             (void) userData;
+             ::rtl::OUStringBuffer buf(