[packages/php/PHP_7_0] fix build with libxml2 >= 2.12

atler atler at pld-linux.org
Sat Jan 25 15:04:49 CET 2025


commit 5340bcec79d62044af7ae1877c4ee50072cdc7b0
Author: Jan Palus <atler at pld-linux.org>
Date:   Wed Jan 22 23:06:15 2025 +0100

    fix build with libxml2 >= 2.12

 libxml2-2.12.patch | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 php.spec           |  2 ++
 2 files changed, 66 insertions(+)
---
diff --git a/php.spec b/php.spec
index 7e184f6..0b75851 100644
--- a/php.spec
+++ b/php.spec
@@ -221,6 +221,7 @@ Patch74:	php-CVE-2019-11043.patch
 Patch75:	icu69.patch
 Patch76:	openssl.patch
 Patch77:	icu70.patch
+Patch78:	libxml2-2.12.patch
 URL:		https://www.php.net/
 %{?with_interbase:%{!?with_interbase_inst:BuildRequires:	Firebird-devel >= 1.0.2.908-2}}
 %{?with_pspell:BuildRequires:	aspell-devel >= 2:0.50.0}
@@ -2035,6 +2036,7 @@ cp -p php.ini-production php.ini
 %patch -P75 -p1
 %patch -P76 -p1
 %patch -P77 -p1
+%patch -P78 -p1
 
 sed -E -i -e '1s,#!\s*/usr/bin/env\s+(.*),#!%{__bindir}\1,' \
       run-tests.php
diff --git a/libxml2-2.12.patch b/libxml2-2.12.patch
new file mode 100644
index 0000000..f5e2f81
--- /dev/null
+++ b/libxml2-2.12.patch
@@ -0,0 +1,64 @@
+From 0a39890c967aa57225bb6bdf4821aff7a3a3c082 Mon Sep 17 00:00:00 2001
+From: Niels Dossche <7771979+nielsdos at users.noreply.github.com>
+Date: Fri, 1 Dec 2023 18:03:35 +0100
+Subject: [PATCH] Fix libxml2 2.12 build due to API breaks
+
+See https://github.com/php/php-src/actions/runs/7062192818/job/19225478601
+---
+ ext/libxml/libxml.c | 14 ++++++++++----
+ ext/soap/php_sdl.c  |  2 +-
+ 2 files changed, 11 insertions(+), 5 deletions(-)
+
+diff --git a/ext/libxml/libxml.c b/ext/libxml/libxml.c
+index 22eb1901b8909..1de693892b7aa 100644
+--- a/ext/libxml/libxml.c
++++ b/ext/libxml/libxml.c
+@@ -472,7 +472,11 @@ static void _php_libxml_free_error(void *ptr)
+ 	return 1;
+ }
+ 
+-static void _php_list_set_error_structure(xmlErrorPtr error, const char *msg)
++#if LIBXML_VERSION >= 21200
++static void _php_list_set_error_structure(const xmlError *error, const char *msg)
++#else
++static void _php_list_set_error_structure(xmlError *error, const char *msg)
++#endif
+ {
+ 	xmlError error_copy;
+ 	int ret;
+@@ -725,7 +729,11 @@ PHP_LIBXML_API void php_libxml_ctx_warning(void *ctx, const char *msg, ...)
+ 	va_end(args);
+ }
+ 
++#if LIBXML_VERSION >= 21200
++PHP_LIBXML_API void php_libxml_structured_error_handler(void *userData, const xmlError *error)
++#else
+ PHP_LIBXML_API void php_libxml_structured_error_handler(void *userData, xmlErrorPtr error)
++#endif
+ {
+ 	_php_list_set_error_structure(error, NULL);
+ 
+@@ -957,9 +965,7 @@ PHP_FUNCTION(libxml_use_internal_errors)
+    Retrieve last error from libxml */
+ static PHP_FUNCTION(libxml_get_last_error)
+ {
+-	xmlErrorPtr error;
+-
+-	error = xmlGetLastError();
++	const xmlError *error = xmlGetLastError();
+ 
+ 	if (error) {
+ 		object_init_ex(return_value, libxmlerror_class_entry);
+diff --git a/ext/soap/php_sdl.c b/ext/soap/php_sdl.c
+index 749f5a5685ec2..b731114775ad7 100644
+--- a/ext/soap/php_sdl.c
++++ b/ext/soap/php_sdl.c
+@@ -332,7 +332,7 @@ static void load_wsdl_ex(zval *this_ptr, char *struri, sdlCtx *ctx, int include)
+ 	sdl_restore_uri_credentials(ctx);
+ 
+ 	if (!wsdl) {
+-		xmlErrorPtr xmlErrorPtr = xmlGetLastError();
++		const xmlError *xmlErrorPtr = xmlGetLastError();
+ 
+ 		if (xmlErrorPtr) {
+ 			soap_error2(E_ERROR, "Parsing WSDL: Couldn't load from '%s' : %s", struri, xmlErrorPtr->message);
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/php.git/commitdiff/08c47c435bbc377aa1f55ad3740ea1393df474b4



More information about the pld-cvs-commit mailing list