lol

perlPackages.XMLLibXML: 2.0209 -> 2.0210 and apply fix for tests

+150 -55
-47
pkgs/development/perl-modules/XML-LibXML-clang16.patch
··· 1 - From 8751785951fbde48ffa16a476da3e4adb2bbcde5 Mon Sep 17 00:00:00 2001 2 - From: Khem Raj <raj.khem@gmail.com> 3 - Date: Mon, 16 Jan 2023 18:50:10 -0800 4 - Subject: [PATCH] libxml-mm: Fix function prototypes in function pointers 5 - 6 - This is now detected with latest clang16+ 7 - 8 - Fixes 9 - 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] 10 - xmlHashScan(r, PmmRegistryDumpHashScanner, NULL); 11 - 12 - Signed-off-by: Khem Raj <raj.khem@gmail.com> 13 - --- 14 - perl-libxml-mm.c | 6 +++--- 15 - 1 file changed, 3 insertions(+), 3 deletions(-) 16 - 17 - diff --git a/perl-libxml-mm.c b/perl-libxml-mm.c 18 - index a3e78a2..ec2b5ea 100644 19 - --- a/perl-libxml-mm.c 20 - +++ b/perl-libxml-mm.c 21 - @@ -121,7 +121,7 @@ PmmFreeHashTable(xmlHashTablePtr table) 22 - extern SV* PROXY_NODE_REGISTRY_MUTEX; 23 - 24 - /* Utility method used by PmmDumpRegistry */ 25 - -void PmmRegistryDumpHashScanner(void * payload, void * data, xmlChar * name) 26 - +void PmmRegistryDumpHashScanner(void * payload, void * data, const xmlChar * name) 27 - { 28 - LocalProxyNodePtr lp = (LocalProxyNodePtr) payload; 29 - ProxyNodePtr node = (ProxyNodePtr) lp->proxy; 30 - @@ -215,7 +215,7 @@ PmmRegisterProxyNode(ProxyNodePtr proxy) 31 - /* PP: originally this was static inline void, but on AIX the compiler 32 - did not chew it, so I'm removing the inline */ 33 - static void 34 - -PmmRegistryHashDeallocator(void *payload, xmlChar *name) 35 - +PmmRegistryHashDeallocator(void *payload, const xmlChar *name) 36 - { 37 - Safefree((LocalProxyNodePtr) payload); 38 - } 39 - @@ -279,7 +279,7 @@ PmmRegistryREFCNT_dec(ProxyNodePtr proxy) 40 - * internal, used by PmmCloneProxyNodes 41 - */ 42 - void * 43 - -PmmRegistryHashCopier(void *payload, xmlChar *name) 44 - +PmmRegistryHashCopier(void *payload, const xmlChar *name) 45 - { 46 - ProxyNodePtr proxy = ((LocalProxyNodePtr) payload)->proxy; 47 - LocalProxyNodePtr lp;
+145
pkgs/development/perl-modules/XML-LibXML-fix-tests-libxml-2.13.0.patch
··· 1 + From bee8338fd1cbd7aad4bf60c2965833343b6ead6f Mon Sep 17 00:00:00 2001 2 + From: Nick Wellnhofer <wellnhofer@aevum.de> 3 + Date: Tue, 21 May 2024 15:17:30 +0200 4 + Subject: [PATCH] Fix test suite with libxml2 2.13.0 5 + 6 + --- 7 + t/02parse.t | 7 ++++++- 8 + t/08findnodes.t | 8 +++++++- 9 + t/19die_on_invalid_utf8_rt_58848.t | 2 +- 10 + t/25relaxng.t | 4 ++-- 11 + t/26schema.t | 4 ++-- 12 + t/60error_prev_chain.t | 8 ++++---- 13 + 6 files changed, 22 insertions(+), 11 deletions(-) 14 + 15 + diff --git a/t/02parse.t b/t/02parse.t 16 + index b111507b..40aa5f13 100644 17 + --- a/t/02parse.t 18 + +++ b/t/02parse.t 19 + @@ -884,7 +884,12 @@ EOXML 20 + eval { 21 + $doc2 = $parser->parse_string( $xmldoc ); 22 + }; 23 + - isnt($@, '', "error parsing $xmldoc"); 24 + + # https://gitlab.gnome.org/GNOME/libxml2/-/commit/b717abdd 25 + + if (XML::LibXML::LIBXML_RUNTIME_VERSION() < 21300) { 26 + + isnt($@, '', "error parsing $xmldoc"); 27 + + } else { 28 + + is( $doc2->documentElement()->firstChild()->nodeName(), "foo" ); 29 + + } 30 + 31 + $parser->validation(1); 32 + 33 + diff --git a/t/08findnodes.t b/t/08findnodes.t 34 + index 016c85a1..e9417bc5 100644 35 + --- a/t/08findnodes.t 36 + +++ b/t/08findnodes.t 37 + @@ -123,7 +123,13 @@ my $docstring = q{ 38 + my @ns = $root->findnodes('namespace::*'); 39 + # TEST 40 + 41 + -is(scalar(@ns), 2, ' TODO : Add test name' ); 42 + +# https://gitlab.gnome.org/GNOME/libxml2/-/commit/aca16fb3 43 + +# fixed xmlCopyNamespace with XML namespace. 44 + +if (XML::LibXML::LIBXML_RUNTIME_VERSION() < 21300) { 45 + + is(scalar(@ns), 2, ' TODO : Add test name' ); 46 + +} else { 47 + + is(scalar(@ns), 3, ' TODO : Add test name' ); 48 + +} 49 + 50 + # bad xpaths 51 + # TEST:$badxpath=4; 52 + diff --git a/t/19die_on_invalid_utf8_rt_58848.t b/t/19die_on_invalid_utf8_rt_58848.t 53 + index aa8ad105..4160cb27 100644 54 + --- a/t/19die_on_invalid_utf8_rt_58848.t 55 + +++ b/t/19die_on_invalid_utf8_rt_58848.t 56 + @@ -16,7 +16,7 @@ use XML::LibXML; 57 + my $err = $@; 58 + 59 + # TEST 60 + - like ("$err", qr{parser error : Input is not proper UTF-8}, 61 + + like ("$err", qr{not proper UTF-8|Invalid bytes in character encoding}, 62 + 'Parser error.', 63 + ); 64 + } 65 + diff --git a/t/25relaxng.t b/t/25relaxng.t 66 + index 93e61883..71383b2a 100644 67 + --- a/t/25relaxng.t 68 + +++ b/t/25relaxng.t 69 + @@ -132,7 +132,7 @@ print "# 6 check that no_network => 1 works\n"; 70 + { 71 + my $rng = eval { XML::LibXML::RelaxNG->new( location => $netfile, no_network => 1 ) }; 72 + # TEST 73 + - like( $@, qr{I/O error : Attempt to load network entity}, 'RNG from file location with external import and no_network => 1 throws an exception.' ); 74 + + like( $@, qr{Attempt to load network entity}, 'RNG from file location with external import and no_network => 1 throws an exception.' ); 75 + # TEST 76 + ok( !defined $rng, 'RNG from file location with external import and no_network => 1 is not loaded.' ); 77 + } 78 + @@ -152,7 +152,7 @@ print "# 6 check that no_network => 1 works\n"; 79 + </grammar> 80 + EOF 81 + # TEST 82 + - like( $@, qr{I/O error : Attempt to load network entity}, 'RNG from buffer with external import and no_network => 1 throws an exception.' ); 83 + + like( $@, qr{Attempt to load network entity}, 'RNG from buffer with external import and no_network => 1 throws an exception.' ); 84 + # TEST 85 + ok( !defined $rng, 'RNG from buffer with external import and no_network => 1 is not loaded.' ); 86 + } 87 + diff --git a/t/26schema.t b/t/26schema.t 88 + index 17f641e4..c404cedd 100644 89 + --- a/t/26schema.t 90 + +++ b/t/26schema.t 91 + @@ -117,7 +117,7 @@ EOF 92 + { 93 + my $schema = eval { XML::LibXML::Schema->new( location => $netfile, no_network => 1 ) }; 94 + # TEST 95 + - like( $@, qr{I/O error : Attempt to load network entity}, 'Schema from file location with external import and no_network => 1 throws an exception.' ); 96 + + like( $@, qr{Attempt to load network entity}, 'Schema from file location with external import and no_network => 1 throws an exception.' ); 97 + # TEST 98 + ok( !defined $schema, 'Schema from file location with external import and no_network => 1 is not loaded.' ); 99 + } 100 + @@ -129,7 +129,7 @@ EOF 101 + </xsd:schema> 102 + EOF 103 + # TEST 104 + - like( $@, qr{I/O error : Attempt to load network entity}, 'Schema from buffer with external import and no_network => 1 throws an exception.' ); 105 + + like( $@, qr{Attempt to load network entity}, 'Schema from buffer with external import and no_network => 1 throws an exception.' ); 106 + # TEST 107 + ok( !defined $schema, 'Schema from buffer with external import and no_network => 1 is not loaded.' ); 108 + } 109 + diff --git a/t/60error_prev_chain.t b/t/60error_prev_chain.t 110 + index e48215c4..55ac0b2e 100644 111 + --- a/t/60error_prev_chain.t 112 + +++ b/t/60error_prev_chain.t 113 + @@ -16,13 +16,11 @@ use XML::LibXML; 114 + 115 + { 116 + my $parser = XML::LibXML->new(); 117 + - $parser->validation(0); 118 + - $parser->load_ext_dtd(0); 119 + 120 + eval 121 + { 122 + local $^W = 0; 123 + - $parser->parse_file('example/JBR-ALLENtrees.htm'); 124 + + $parser->parse_string('<doc>&ldquo;&nbsp;&rdquo;</doc>'); 125 + }; 126 + 127 + my $err = $@; 128 + @@ -31,7 +29,7 @@ use XML::LibXML; 129 + if( $err && !ref($err) ) { 130 + plan skip_all => 'The local libxml library does not support errors as objects to $@'; 131 + } 132 + - plan tests => 1; 133 + + plan tests => 2; 134 + 135 + while (defined($err) && $count < 200) 136 + { 137 + @@ -44,6 +42,8 @@ use XML::LibXML; 138 + 139 + # TEST 140 + ok ((!$err), "Reached the end of the chain."); 141 + + # TEST 142 + + is ($count, 3, "Correct number of errors reported") 143 + } 144 + 145 + =head1 COPYRIGHT & LICENSE
+5 -8
pkgs/top-level/perl-packages.nix
··· 28572 28572 28573 28573 XMLLibXML = buildPerlPackage { 28574 28574 pname = "XML-LibXML"; 28575 - version = "2.0209"; 28575 + version = "2.0210"; 28576 28576 src = fetchurl { 28577 - url = "mirror://cpan/authors/id/S/SH/SHLOMIF/XML-LibXML-2.0209.tar.gz"; 28578 - hash = "sha256-tKWrvNaJqi+7yLe0UznpYcSYTkgQhJTrbCgrR0giJCU="; 28577 + url = "mirror://cpan/authors/id/S/SH/SHLOMIF/XML-LibXML-2.0210.tar.gz"; 28578 + hash = "sha256-opvz8Aq5ye4EIYFU4K/I95m/I2dOuZwantTeH0BZpI0="; 28579 28579 }; 28580 28580 SKIP_SAX_INSTALL = 1; 28581 28581 buildInputs = [ AlienBuild AlienLibxml2 ] 28582 28582 ++ lib.optionals stdenv.isDarwin (with pkgs; [ libiconv zlib ]); 28583 28583 patches = [ 28584 - ../development/perl-modules/XML-LibXML-clang16.patch 28584 + # https://github.com/shlomif/perl-XML-LibXML/pull/87 28585 + ../development/perl-modules/XML-LibXML-fix-tests-libxml-2.13.0.patch 28585 28586 ]; 28586 - # Remove test that fails after LibXML 2.11 upgrade 28587 - postPatch = '' 28588 - rm t/35huge_mode.t 28589 - ''; 28590 28587 propagatedBuildInputs = [ XMLSAX ]; 28591 28588 meta = { 28592 28589 description = "Perl Binding for libxml2";