commit:     af5b3aac77700faed6857138121804d8f457d04d
Author:     Alfred Wingate <parona <AT> protonmail <DOT> com>
AuthorDate: Sun Jun  8 17:10:57 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Jun  8 19:42:28 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=af5b3aac

dev-perl/XML-LibXML: fix tests w/ >=libxml2-2.14.0

Signed-off-by: Alfred Wingate <parona <AT> protonmail.com>
Part-of: https://github.com/gentoo/gentoo/pull/42503
Closes: https://github.com/gentoo/gentoo/pull/42503
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-perl/XML-LibXML/XML-LibXML-2.21.0.ebuild       |  3 +-
 .../files/XML-LibXML-2.21.0-libxml2-2.14.patch     | 40 ++++++++++++++++++++++
 2 files changed, 42 insertions(+), 1 deletion(-)

diff --git a/dev-perl/XML-LibXML/XML-LibXML-2.21.0.ebuild 
b/dev-perl/XML-LibXML/XML-LibXML-2.21.0.ebuild
index 1e29dc86274a..8332462bdc04 100644
--- a/dev-perl/XML-LibXML/XML-LibXML-2.21.0.ebuild
+++ b/dev-perl/XML-LibXML/XML-LibXML-2.21.0.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2024 Gentoo Authors
+# Copyright 1999-2025 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -49,6 +49,7 @@ PERL_RM_FILES=(
 
 PATCHES=(
        "${FILESDIR}"/${PN}-2.21.0-libxml2-2.13.patch
+       "${FILESDIR}"/${PN}-2.21.0-libxml2-2.14.patch
 )
 
 src_compile() {

diff --git a/dev-perl/XML-LibXML/files/XML-LibXML-2.21.0-libxml2-2.14.patch 
b/dev-perl/XML-LibXML/files/XML-LibXML-2.21.0-libxml2-2.14.patch
new file mode 100644
index 000000000000..395f3f028bca
--- /dev/null
+++ b/dev-perl/XML-LibXML/files/XML-LibXML-2.21.0-libxml2-2.14.patch
@@ -0,0 +1,40 @@
+https://github.com/shlomif/perl-XML-LibXML/pull/87
+
+From c9f9c2fe51173b0a00969f01b577399f1098aa47 Mon Sep 17 00:00:00 2001
+From: Nick Wellnhofer <[email protected]>
+Date: Thu, 13 Feb 2025 19:50:35 +0100
+Subject: [PATCH] Fix test suite with libxml2 2.14.0
+
+--- a/t/16docnodes.t
++++ b/t/16docnodes.t
+@@ -60,7 +60,12 @@ for my $time (0 .. 2) {
+     $doc->setDocumentElement($node);
+ 
+     # TEST
+-    is( $node->serialize(), '<test contents="&#xE4;"/>', 'Node serialise 
works.' );
++    # libxml2 2.14 avoids unnecessary escaping of attribute values.
++    if (XML::LibXML::LIBXML_VERSION() >= 21400) {
++        is( $node->serialize(), "<test contents=\"\xE4\"/>", 'Node serialise 
works.' );
++    } else {
++        is( $node->serialize(), '<test contents="&#xE4;"/>', 'Node serialise 
works.' );
++    }
+ 
+     $doc->setEncoding('utf-8');
+     # Second output
+--- a/t/49_load_html.t
++++ b/t/49_load_html.t
+@@ -52,7 +52,13 @@ use XML::LibXML;
+ </div>
+ EOS
+ 
+-    {
++    SKIP: {
++        # libxml2 2.14 tokenizes HTML according to HTML5 where
++        # this isn't an error, see "13.2.5.73 Named character
++        # reference state".
++        skip("libxml2 version >= 21400", 1)
++            if XML::LibXML::LIBXML_VERSION >= 21400;
++
+         my $buf = '';
+         open my $fh, '>', \$buf;
+         # redirect STDERR there

Reply via email to