libreoffice: update to 7.6.4.1
[oi-userland.git] / components / desktop / libreoffice / patches / 24-xmlsec-with-libxml2-fixes.patch
blob97c8541631486d8519e24cb28d0bef73cf33eec3
1 diff -Naur libreoffice-7.6.4.1/external/xmlsec.old/libxml2.12.patch libreoffice-7.6.4.1/external/xmlsec/libxml2.12.patch
2 --- libreoffice-7.6.4.1/external/xmlsec.old/libxml2.12.patch.1 1969-12-31 19:00:00.000000000 -0500
3 +++ libreoffice-7.6.4.1/external/xmlsec/libxml2.12.patch.1 2023-12-08 00:03:45.535040810 -0500
4 @@ -0,0 +1,150 @@
5 +From 098a4d0219d3ed672bf8e5934ca7482dc739b103 Mon Sep 17 00:00:00 2001
6 +From: Aleksey Sanin <aleksey@aleksey.com>
7 +Date: Mon, 20 Nov 2023 09:27:33 -0500
8 +Subject: [PATCH 1/3] Fix libxml2 includes
10 +---
11 + include/xmlsec/xmlsec.h | 1 +
12 + 1 file changed, 1 insertion(+)
14 +diff --git a/include/xmlsec/xmlsec.h b/include/xmlsec/xmlsec.h
15 +index 5757fc57..6f910122 100644
16 +--- a/include/xmlsec/xmlsec.h
17 ++++ b/include/xmlsec/xmlsec.h
18 +@@ -12,6 +12,7 @@
19 + #define __XMLSEC_H__
21 + #include <libxml/tree.h>
22 ++#include <libxml/parser.h>
24 + #include <xmlsec/version.h>
25 + #include <xmlsec/exports.h>
27 +From bd909345a8dcf093ac7acb0bc2f415717dad77b4 Mon Sep 17 00:00:00 2001
28 +From: Aleksey Sanin <aleksey@aleksey.com>
29 +Date: Mon, 20 Nov 2023 09:36:38 -0500
30 +Subject: [PATCH 2/3] Fix libxml2 includes
32 +---
33 + apps/xmlsec.c | 3 ++-
34 + 1 file changed, 2 insertions(+), 1 deletion(-)
36 +diff --git a/apps/xmlsec.c b/apps/xmlsec.c
37 +index 7655c1db..4bedb16a 100644
38 +--- a/apps/xmlsec.c
39 ++++ b/apps/xmlsec.c
40 +@@ -22,6 +22,7 @@
41 + #include <libxml/xmlmemory.h>
42 + #include <libxml/parser.h>
43 + #include <libxml/xpath.h>
44 ++#include <libxml/xmlsave.h>
45 + #include <libxml/xpathInternals.h>
47 + #ifndef XMLSEC_NO_XSLT
48 +@@ -3030,7 +3031,7 @@ xmlSecAppInit(void) {
49 + /* Init libxml */
50 + xmlInitParser();
51 + LIBXML_TEST_VERSION
52 +- xmlTreeIndentString = "\t";
53 ++ xmlThrDefTreeIndentString("\t");
54 + #ifndef XMLSEC_NO_XSLT
55 + xmlIndentTreeOutput = 1;
56 + #endif /* XMLSEC_NO_XSLT */
58 +From c29133fbeea739640ad4aace67cb4242b16f7757 Mon Sep 17 00:00:00 2001
59 +From: Aleksey Sanin <aleksey@aleksey.com>
60 +Date: Mon, 20 Nov 2023 09:43:23 -0500
61 +Subject: [PATCH 3/3] Fix all warnings
63 +---
64 + apps/crypto.c | 1 +
65 + src/errors_helpers.h | 10 +++++-----
66 + src/mscrypto/certkeys.c | 1 +
67 + src/mscrypto/signatures.c | 1 +
68 + 4 files changed, 8 insertions(+), 5 deletions(-)
70 +diff --git a/apps/crypto.c b/apps/crypto.c
71 +index 8561dd65..4411233d 100644
72 +--- a/apps/crypto.c
73 ++++ b/apps/crypto.c
74 +@@ -12,6 +12,7 @@
75 + #endif
77 + #include <string.h>
78 ++#include <stdlib.h>
80 + #include <xmlsec/xmlsec.h>
81 + #include <xmlsec/keys.h>
82 +diff --git a/src/errors_helpers.h b/src/errors_helpers.h
83 +index 1a4f4183..470fdde6 100644
84 +--- a/src/errors_helpers.h
85 ++++ b/src/errors_helpers.h
86 +@@ -136,7 +136,7 @@ extern "C" {
87 + */
88 + #define xmlSecXmlError(errorFunction, errorObject) \
89 + { \
90 +- xmlErrorPtr error = xmlGetLastError(); \
91 ++ const xmlError * error = xmlGetLastError(); \
92 + int code = (error != NULL) ? error->code : 0; \
93 + const char* message = (error != NULL) ? error->message : NULL; \
94 + xmlSecError(XMLSEC_ERRORS_HERE, \
95 +@@ -159,7 +159,7 @@ extern "C" {
96 + */
97 + #define xmlSecXmlError2(errorFunction, errorObject, msg, param) \
98 + { \
99 +- xmlErrorPtr error = xmlGetLastError(); \
100 ++ const xmlError * error = xmlGetLastError(); \
101 + int code = (error != NULL) ? error->code : 0; \
102 + const char* message = (error != NULL) ? error->message : NULL; \
103 + xmlSecError(XMLSEC_ERRORS_HERE, \
104 +@@ -181,7 +181,7 @@ extern "C" {
105 + */
106 + #define xmlSecXmlParserError(errorFunction, ctxt, errorObject) \
107 + { \
108 +- xmlErrorPtr error = xmlCtxtGetLastError(ctxt);\
109 ++ const xmlError * error = xmlCtxtGetLastError(ctxt);\
110 + int code = (error != NULL) ? error->code : 0; \
111 + const char* message = (error != NULL) ? error->message : NULL; \
112 + xmlSecError(XMLSEC_ERRORS_HERE, \
113 +@@ -205,7 +205,7 @@ extern "C" {
114 + */
115 + #define xmlSecXmlParserError2(errorFunction, ctxt, errorObject, msg, param) \
116 + { \
117 +- xmlErrorPtr error = xmlCtxtGetLastError(ctxt);\
118 ++ const xmlError * error = xmlCtxtGetLastError(ctxt);\
119 + int code = (error != NULL) ? error->code : 0; \
120 + const char* message = (error != NULL) ? error->message : NULL; \
121 + xmlSecError(XMLSEC_ERRORS_HERE, \
122 +@@ -227,7 +227,7 @@ extern "C" {
123 + */
124 + #define xmlSecXsltError(errorFunction, ctxt, errorObject) \
125 + { \
126 +- xmlErrorPtr error = xmlGetLastError(); \
127 ++ const xmlError * error = xmlGetLastError(); \
128 + int code = (error != NULL) ? error->code : 0; \
129 + const char* message = (error != NULL) ? error->message : NULL; \
130 + xmlSecError(XMLSEC_ERRORS_HERE, \
131 +diff --git a/src/mscrypto/certkeys.c b/src/mscrypto/certkeys.c
132 +index db74517a..7e02a199 100644
133 +--- a/src/mscrypto/certkeys.c
134 ++++ b/src/mscrypto/certkeys.c
135 +@@ -18,6 +18,7 @@
136 + #include "globals.h"
138 + #include <string.h>
139 ++#include <stdlib.h>
141 + #ifndef XMLSEC_NO_GOST
142 + #include "csp_oid.h"
143 +diff --git a/src/mscrypto/signatures.c b/src/mscrypto/signatures.c
144 +index 61b95407..c5c62ced 100644
145 +--- a/src/mscrypto/signatures.c
146 ++++ b/src/mscrypto/signatures.c
147 +@@ -17,6 +17,7 @@
148 + #include "globals.h"
150 + #include <string.h>
151 ++#include <stdlib.h>
153 + #ifndef XMLSEC_NO_GOST
154 + #include "csp_calg.h"
155 diff -Naur libreoffice-7.6.4.1/external/xmlsec.old/UnpackedTarball_xmlsec.mk libreoffice-7.6.4.1/external/xmlsec/UnpackedTarball_xmlsec.mk
156 --- libreoffice-7.6.4.1/external/xmlsec.old/UnpackedTarball_xmlsec.mk 2023-12-08 00:07:27.100169778 -0500
157 +++ libreoffice-7.6.4.1/external/xmlsec/UnpackedTarball_xmlsec.mk 2023-12-08 00:08:42.771589023 -0500
158 @@ -9,7 +9,8 @@
160 xmlsec_patches :=
161 # Remove this when Ubuntu 20.04 is EOL in 2025.
162 -xmlsec_patches += old-nss.patch.1
163 +xmlsec_patches += old-nss.patch.1 \
164 + libxml2.12.patch.1
166 $(eval $(call gb_UnpackedTarball_UnpackedTarball,xmlsec))