gnu: perl-xml-libxml: Fix build with clang 16+.

* gnu/packages/patches/perl-xml-libxml-fix-function-prototypes.patch:
New file.
* gnu/local.mk (dist_patch_DATA): Register patch.
* gnu/packages/xml.scm (perl-xml-libxml)[origin]: Apply patch.

Change-Id: Ib0be83bbf149af6c3f8a477c24159fbd975fc06b
Signed-off-by: Andreas Enge <andreas@enge.fr>
This commit is contained in:
Greg Hogan 2025-07-17 17:17:59 +00:00 committed by Andreas Enge
parent 0c8ef1e38f
commit 3ec3199fbb
No known key found for this signature in database
GPG key ID: F7D5C9BF765C61E3
3 changed files with 53 additions and 1 deletions

View file

@ -2106,6 +2106,7 @@ dist_patch_DATA = \
%D%/packages/patches/perl-reproducible-build-date.patch \
%D%/packages/patches/perl-www-curl-fix-struct-void.patch \
%D%/packages/patches/perl-www-curl-remove-symbol.patch \
%D%/packages/patches/perl-xml-libxml-fix-function-prototypes.patch \
%D%/packages/patches/phoronix-test-suite-fsdg.patch \
%D%/packages/patches/picprog-non-intel-support.patch \
%D%/packages/patches/pidgin-add-search-path.patch \

View file

@ -0,0 +1,49 @@
Patch from https://github.com/shlomif/perl-XML-LibXML/commit/87517859
From 8751785951fbde48ffa16a476da3e4adb2bbcde5 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Mon, 16 Jan 2023 18:50:10 -0800
Subject: [PATCH] libxml-mm: Fix function prototypes in function pointers
This is now detected with latest clang16+
Fixes
error: incompatible function pointer types passing 'void (void *, void *, xmlChar *)' (aka 'void (void *, void *, unsigned char *)') to parameter of type 'xmlHashScanner' (aka 'void (*)(void *, void *, const unsigned char *)') [-Wincompatible-function-pointer-types]
xmlHashScan(r, PmmRegistryDumpHashScanner, NULL);
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
perl-libxml-mm.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/perl-libxml-mm.c b/perl-libxml-mm.c
index a3e78a2..ec2b5ea 100644
--- a/perl-libxml-mm.c
+++ b/perl-libxml-mm.c
@@ -121,7 +121,7 @@ PmmFreeHashTable(xmlHashTablePtr table)
extern SV* PROXY_NODE_REGISTRY_MUTEX;
/* Utility method used by PmmDumpRegistry */
-void PmmRegistryDumpHashScanner(void * payload, void * data, xmlChar * name)
+void PmmRegistryDumpHashScanner(void * payload, void * data, const xmlChar * name)
{
LocalProxyNodePtr lp = (LocalProxyNodePtr) payload;
ProxyNodePtr node = (ProxyNodePtr) lp->proxy;
@@ -215,7 +215,7 @@ PmmRegisterProxyNode(ProxyNodePtr proxy)
/* PP: originally this was static inline void, but on AIX the compiler
did not chew it, so I'm removing the inline */
static void
-PmmRegistryHashDeallocator(void *payload, xmlChar *name)
+PmmRegistryHashDeallocator(void *payload, const xmlChar *name)
{
Safefree((LocalProxyNodePtr) payload);
}
@@ -279,7 +279,7 @@ PmmRegistryREFCNT_dec(ProxyNodePtr proxy)
* internal, used by PmmCloneProxyNodes
*/
void *
-PmmRegistryHashCopier(void *payload, xmlChar *name)
+PmmRegistryHashCopier(void *payload, const xmlChar *name)
{
ProxyNodePtr proxy = ((LocalProxyNodePtr) payload)->proxy;
LocalProxyNodePtr lp;

View file

@ -655,7 +655,9 @@ with XML in Perl. libxml-perl software works in combination with
"XML-LibXML-" version ".tar.gz"))
(sha256
(base32
"1ks69xymv6zkj7hvaymjvb78ch81abri7kg4zrwxhdfsqb8a9g7h"))))
"1ks69xymv6zkj7hvaymjvb78ch81abri7kg4zrwxhdfsqb8a9g7h"))
;; Remove patch with update to version 2.0210.
(patches (search-patches "perl-xml-libxml-fix-function-prototypes.patch"))))
(build-system perl-build-system)
(propagated-inputs
(list perl-xml-namespacesupport perl-xml-sax))