From 737533635e8cc8065dddf86a496ffa776ef4dde4 Mon Sep 17 00:00:00 2001 From: Celeste <20312-Celeste@users.gitlab.alpinelinux.org> Date: Sat, 25 May 2024 15:26:41 +0000 Subject: [PATCH] testing/perl-xml-bare: apply debian patches to include `stdlib.h` and fix pointer from integer without cast --- testing/perl-xml-bare/APKBUILD | 7 +- .../implicit_declaration_of_free.patch | 18 +++++ .../perl-xml-bare/pointer_from_integer.patch | 66 +++++++++++++++++++ 3 files changed, 90 insertions(+), 1 deletion(-) create mode 100644 testing/perl-xml-bare/implicit_declaration_of_free.patch create mode 100644 testing/perl-xml-bare/pointer_from_integer.patch diff --git a/testing/perl-xml-bare/APKBUILD b/testing/perl-xml-bare/APKBUILD index 9b4eaf55681..425d4b6e78c 100644 --- a/testing/perl-xml-bare/APKBUILD +++ b/testing/perl-xml-bare/APKBUILD @@ -12,7 +12,10 @@ license="GPL-2.0-or-later OR Artistic-1.0-Perl" depends="perl" makedepends="perl-dev" subpackages="$pkgname-doc" -source="https://cpan.metacpan.org/authors/id/C/CO/CODECHILD/XML-Bare-$pkgver.tar.gz" +source="https://cpan.metacpan.org/authors/id/C/CO/CODECHILD/XML-Bare-$pkgver.tar.gz + implicit_declaration_of_free.patch + pointer_from_integer.patch + " builddir="$srcdir/$_pkgreal-$pkgver" build() { @@ -35,4 +38,6 @@ package() { sha512sums=" e765206e5c98ed3a0c29be3a323e25beaa712489d0461e2e7269f5f3383fa805ba3829a9ed4d31cd86f35400c321f8cf519162cc41f52f8ba6992c7016f63520 XML-Bare-0.53.tar.gz +7804264042f40fcbb95f485c9b6f73a2be49ed1935a94603ca50b04e76ad4ad5b16b0a500ef0de2d1ceb4a5686080ad5c1bae10275757c2e7e84bac102f4a94d implicit_declaration_of_free.patch +7de75f3d7622507dc30c5d9b8af7bae67ba4f87bb44c0ff1ac02d206508e1a8bf84e81e10b3beef42d4ddfb4d3c5ba84d2638709160770cd186bea900cd3d64f pointer_from_integer.patch " diff --git a/testing/perl-xml-bare/implicit_declaration_of_free.patch b/testing/perl-xml-bare/implicit_declaration_of_free.patch new file mode 100644 index 00000000000..10096a3e1e7 --- /dev/null +++ b/testing/perl-xml-bare/implicit_declaration_of_free.patch @@ -0,0 +1,18 @@ +Patch-Source: https://sources.debian.org/data/main/libx/libxml-bare-perl/0.53-4/debian/patches/implicit_declaration_of_free.patch +-- +Description: fix warning "incompatible implicit declaration of built-in function 'free'" + by unconditionally including stdlib.h (required on Linux) +Author: Florian Schlichting + +--- a/parser.c ++++ b/parser.c +@@ -1,8 +1,6 @@ + #include "parser.h" + #include +-#ifdef DARWIN +- #include "stdlib.h" +-#endif ++#include "stdlib.h" + #ifdef NOSTRING + void memset(char *s, int c, int n) { + char *se = s + n; diff --git a/testing/perl-xml-bare/pointer_from_integer.patch b/testing/perl-xml-bare/pointer_from_integer.patch new file mode 100644 index 00000000000..3ca1ea9ca71 --- /dev/null +++ b/testing/perl-xml-bare/pointer_from_integer.patch @@ -0,0 +1,66 @@ +Patch-Source: https://sources.debian.org/data/main/libx/libxml-bare-perl/0.53-4/debian/patches/pointer_from_integer.patch +-- +Description: fix use of pointer as int + fixes "warning: comparison between pointer and integer" and + "warning: assignment makes pointer from integer without a cast" + compiler warnings +Author: Florian Schlichting + +--- a/Bare.xs ++++ b/Bare.xs +@@ -144,7 +144,7 @@ + SV *atthref = newRV_noinc( (SV *) atth ); + hv_store( output, curatt->name, curatt->namelen, atthref, 0 ); + +- if( curatt->value == -1 ) attval = newSVpvn( "1", 1 ); ++ if( curatt->value == NULL ) attval = newSVpvn( "1", 1 ); + else attval = newSVpvn( curatt->value, curatt->vallen ); + SvUTF8_on(attval); + hv_store( atth, "value", 5, attval, vhash ); +@@ -272,7 +272,7 @@ + if( numatts ) { + curatt = curnode->firstatt; + for( i = 0; i < numatts; i++ ) { +- if( curatt->value == -1 ) attval = newSVpvn( "1", 1 ); ++ if( curatt->value == NULL ) attval = newSVpvn( "1", 1 ); + else attval = newSVpvn( curatt->value, curatt->vallen ); + SvUTF8_on(attval); + hv_store( output, curatt->name, curatt->namelen, attval, 0 ); +--- a/parser.c ++++ b/parser.c +@@ -417,7 +417,7 @@ + case 0: last_state = ST_att_name; goto done; + case '/': // self closing !! /> is assumed !! + curatt = nodec_addattr( curnode, attname, attname_len ); +- if( !att_has_val ) { curatt->value = -1; curatt->vallen = 0; } ++ if( !att_has_val ) { curatt->value = NULL; curatt->vallen = 0; } + attname_len = 0; + + curnode->z = cpos+1-xmlin; +@@ -436,7 +436,7 @@ + goto att_space; + case '>': + curatt = nodec_addattr( curnode, attname, attname_len ); +- if( !att_has_val ) { curatt->value = -1; curatt->vallen = 0; } ++ if( !att_has_val ) { curatt->value = NULL; curatt->vallen = 0; } + attname_len = 0; + cpos++; + goto val_1; +@@ -832,7 +832,7 @@ + switch( let ) { + case '/': // self closing !! /> is assumed !! + curatt = nodec_addattr( curnode, attname, attname_len ); +- if( !att_has_val ) { curatt->value = -1; curatt->vallen = 0; } ++ if( !att_has_val ) { curatt->value = NULL; curatt->vallen = 0; } + attname_len = 0; + + curnode = curnode->parent; +@@ -850,7 +850,7 @@ + goto u_att_space; + case '>': + curatt = nodec_addattr( curnode, attname, attname_len ); +- if( !att_has_val ) { curatt->value = -1; curatt->vallen = 0; } ++ if( !att_has_val ) { curatt->value = NULL; curatt->vallen = 0; } + attname_len = 0; + cpos++; + goto u_val_1;