public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-perl/XML-LibXML/files/, dev-perl/XML-LibXML/
Date: Fri, 12 May 2023 23:50:53 +0000 (UTC)	[thread overview]
Message-ID: <1683934936.23ea36dfba863f53e66a3a9f73aeec9124dd9aa5.sam@gentoo> (raw)

commit:     23ea36dfba863f53e66a3a9f73aeec9124dd9aa5
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri May 12 23:42:16 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri May 12 23:42:16 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=23ea36df

dev-perl/XML-LibXML: fix modern C issues

Closes: https://bugs.gentoo.org/883711
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-perl/XML-LibXML/XML-LibXML-2.20.800-r1.ebuild  | 82 ++++++++++++++++++++++
 .../files/XML-LibXML-2.20.800-modern-c.patch       | 45 ++++++++++++
 2 files changed, 127 insertions(+)

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;
+


             reply	other threads:[~2023-05-12 23:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-12 23:50 Sam James [this message]
  -- strict thread matches above, loose matches on Subject: below --
2016-12-30 16:41 [gentoo-commits] repo/gentoo:master commit in: dev-perl/XML-LibXML/files/, dev-perl/XML-LibXML/ Andreas Hüttel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1683934936.23ea36dfba863f53e66a3a9f73aeec9124dd9aa5.sam@gentoo \
    --to=sam@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox