diff options
-rw-r--r-- | dev-perl/XML-LibXML/XML-LibXML-2.20.800-r1.ebuild | 82 | ||||
-rw-r--r-- | dev-perl/XML-LibXML/files/XML-LibXML-2.20.800-modern-c.patch | 45 |
2 files changed, 127 insertions, 0 deletions
diff --git a/dev-perl/XML-LibXML/XML-LibXML-2.20.800-r1.ebuild b/dev-perl/XML-LibXML/XML-LibXML-2.20.800-r1.ebuild new file mode 100644 index 000000000000..bd3938b77c2c --- /dev/null +++ b/dev-perl/XML-LibXML/XML-LibXML-2.20.800-r1.ebuild @@ -0,0 +1,82 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DIST_AUTHOR=SHLOMIF +DIST_VERSION=2.0208 +DIST_EXAMPLES=("example/*") +inherit perl-module + +DESCRIPTION="Perl binding for libxml2" + +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-macos" +IUSE="minimal" + +# >= on XML-Sax needed to avoid "miscompilation" (essentially empty install), as newer XML-Sax +# has the ROOT check fixed. Didn't happen with XML-SAX-Expat, but best to be careful. +# bug #840053 +RDEPEND=" + virtual/perl-Carp + virtual/perl-Encode + >=virtual/perl-Exporter-5.570.0 + virtual/perl-IO + virtual/perl-Scalar-List-Utils + >=dev-perl/XML-NamespaceSupport-1.70.0 + >=dev-perl/XML-SAX-1.20.0-r1 + dev-perl/XML-SAX-Base + >=dev-libs/libxml2-2.6.21:2= + virtual/perl-parent +" +BDEPEND="${RDEPEND} + virtual/perl-ExtUtils-MakeMaker + dev-perl/Alien-Build + >=dev-perl/Alien-Libxml2-0.140.0 + test? ( + !minimal? ( + dev-perl/Test-LeakTrace + ) + ) +" +DEPEND=">=dev-libs/libxml2-2.6.21:2=" + +PATCHES=( + "${FILESDIR}"/${PN}-2.20.800-modern-c.patch +) + +PERL_RM_FILES=( + "t/cpan-changes.t" "t/pod-files-presence.t" "t/pod.t" + "t/release-kwalitee.t" "t/style-trailing-space.t" + "t/11memory.t" +) + +src_compile() { + export SKIP_SAX_INSTALL=1 + perl-module_src_compile +} + +pkg_postinst() { + pkg_update_parser add XML::LibXML::SAX::Parser + pkg_update_parser add XML::LibXML::SAX +} + +pkg_postrm() { + pkg_update_parser remove XML::LibXML::SAX::Parser + pkg_update_parser remove XML::LibXML::SAX +} + +pkg_update_parser() { + # pkg_update_parser [add|remove] $parser_module + local action=$1 + local parser_module=$2 + + if [[ -z "${ROOT}" ]] ; then + einfo "Update Parser: $1 $2" + perl -MXML::SAX -e "XML::SAX->${action}_parser(q(${parser_module}))->save_parsers()" \ + || ewarn "Update Parser: $1 $2 failed" + else + elog "To $1 $2 run:" + elog "perl -MXML::SAX -e 'XML::SAX->${action}_parser(q(${parser_module}))->save_parsers()'" + fi +} diff --git a/dev-perl/XML-LibXML/files/XML-LibXML-2.20.800-modern-c.patch b/dev-perl/XML-LibXML/files/XML-LibXML-2.20.800-modern-c.patch new file mode 100644 index 000000000000..609db4ac7123 --- /dev/null +++ b/dev-perl/XML-LibXML/files/XML-LibXML-2.20.800-modern-c.patch @@ -0,0 +1,45 @@ +https://bugs.gentoo.org/883711 +https://github.com/shlomif/perl-XML-LibXML/pull/75 + +From 25451c0a56ef8d3b32fd23847bef516486bd8ed4 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> +--- 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; + |