git: 5375f280f288 - main - textproc/p5-XML-Parser: Update to 2.46

From: Po-Chuan Hsieh <sunpoet_at_FreeBSD.org>
Date: Wed, 29 Jun 2022 16:36:49 UTC
The branch main has been updated by sunpoet:

URL: https://cgit.FreeBSD.org/ports/commit/?id=5375f280f28885308f25f830d610f9c6e25ee827

commit 5375f280f28885308f25f830d610f9c6e25ee827
Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2022-06-29 16:29:34 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2022-06-29 16:32:54 +0000

    textproc/p5-XML-Parser: Update to 2.46
    
    - Silence patch message
    - Strip shared library
    - Use MAKE_CMD instead of MAKE
    - Sort PLIST
    - Add comment about maintainer section
    - Merge extract-encodings: into build-encodings:
    - Fix build-encodings:
    
    Changes:        https://metacpan.org/dist/XML-Parser/changes
---
 textproc/p5-XML-Parser/Makefile                    | 38 +++++++++++-----------
 textproc/p5-XML-Parser/distinfo                    |  5 +--
 textproc/p5-XML-Parser/files/patch-CheckLib.pm     | 20 ------------
 .../files/patch-inc-Devel-CheckLib.pm              | 20 ++++++++++++
 textproc/p5-XML-Parser/pkg-plist                   | 10 +++---
 5 files changed, 47 insertions(+), 46 deletions(-)

diff --git a/textproc/p5-XML-Parser/Makefile b/textproc/p5-XML-Parser/Makefile
index 6721f0f4c810..93e197978f94 100644
--- a/textproc/p5-XML-Parser/Makefile
+++ b/textproc/p5-XML-Parser/Makefile
@@ -1,5 +1,5 @@
 PORTNAME=	XML-Parser
-PORTVERSION=	2.44
+PORTVERSION=	2.46
 CATEGORIES=	textproc perl5
 MASTER_SITES=	CPAN
 PKGNAMEPREFIX=	p5-
@@ -14,13 +14,15 @@ LIB_DEPENDS=	libexpat.so:textproc/expat2
 
 USES=		perl5
 USE_PERL5=	configure
-CONFIGURE_ARGS=	EXPATLIBPATH=${LOCALBASE}/lib EXPATINCPATH=${LOCALBASE}/include
+
+CONFIGURE_ARGS=	EXPATINCPATH=${LOCALBASE}/include EXPATLIBPATH=${LOCALBASE}/lib
 
 PLIST_SUB=	EUCJP=${EUCJP} SJIS=${SJIS}
 
+CONV_ENC=	${PERL} -e '$$e=shift @ARGV; undef $$/; $$_=<>; substr($$_,4,40)=pack("a40","$$e"); print'
+
 # XMLPARSER_EUCJP=	x-euc-jp-(jisx0221|unicode)
 # XMLPARSER_SJIS=	x-sjis-(cp932|jdk117|jisx0221|unicode)
-CONV_ENC=	${PERL} -e '$$e=shift @ARGV; undef $$/; $$_=<>; substr($$_,4,40)=pack("a40","$$e"); print'
 .if !defined(XMLPARSER_EUCJP)
 EUCJP=		"@comment "
 .endif
@@ -33,14 +35,12 @@ USE_PERL5+=	patch
 
 post-patch:
 .if defined(XMLPARSER_EUCJP)
-	cd ${WRKSRC}/Parser/Encodings; \
-		${CONV_ENC} euc-jp ${XMLPARSER_EUCJP}.enc > euc-jp.enc
-	${ECHO_CMD} Parser/Encodings/euc-jp.enc >> ${WRKSRC}/MANIFEST
+	@cd ${WRKSRC}/Parser/Encodings && ${CONV_ENC} euc-jp ${XMLPARSER_EUCJP}.enc > euc-jp.enc
+	@${ECHO_CMD} Parser/Encodings/euc-jp.enc >> ${WRKSRC}/MANIFEST
 .endif
 .if defined(XMLPARSER_SJIS)
-	cd ${WRKSRC}/Parser/Encodings; \
-		${CONV_ENC} shift_jis ${XMLPARSER_SJIS}.enc > shift_jis.enc
-	${ECHO_CMD} Parser/Encodings/Shift_JIS.enc >> ${WRKSRC}/MANIFEST
+	@cd ${WRKSRC}/Parser/Encodings && ${CONV_ENC} shift_jis ${XMLPARSER_SJIS}.enc > shift_jis.enc
+	@${ECHO_CMD} Parser/Encodings/shift_jis.enc >> ${WRKSRC}/MANIFEST
 .endif
 	@${CP} ${FILESDIR}/*.enc ${WRKSRC}/Parser/Encodings/
 .for e in 1 6 10 11 13 14 15
@@ -48,22 +48,22 @@ post-patch:
 .endfor
 
 post-configure:
-	@${PERL} -i -pe 's|^(CC = ).*|$$1 ${CC}|;' \
-		-e 's|^(CCFLAGS = ).*|$$1 ${CFLAGS}|' ${WRKSRC}/Expat/Makefile
+	@${PERL} -i -pe 's|^(CC = ).*|$$1 ${CC}|;' -e 's|^(CCFLAGS = ).*|$$1 ${CFLAGS}|' ${WRKSRC}/Expat/Makefile
 
 pre-build:
-	@cd ${WRKDIR} && ${PERL} ${FILESDIR}/check_nfs.pl 2>/dev/null || \
-	(${ECHO_MSG} "===>  lockf in \$$TMPDIR required"; ${FALSE})
+	@cd ${WRKDIR} && ${PERL} ${FILESDIR}/check_nfs.pl 2>/dev/null || (${ECHO_MSG} "===>  lockf in \$$TMPDIR required"; ${FALSE})
+
+post-install:
+	${STRIP_CMD} ${STAGEDIR}${PREFIX}/${SITE_ARCH_REL}/auto/XML/Parser/Expat/Expat.so
 
-XE=	${.CURDIR}/../p5-XML-Encoding
-extract-encodings:
-	@cd ${XE}; \
-	${MAKE} patch
+# maintainer section:
+# require: p5-XML-Encoding
 
 build-encodings:
 .for e in 1 6 10 11 13 14 15
-	@cd `cd ${XE}; ${MAKE} -VWRKSRC`; \
-	compile_encoding -o ${FILESDIR}/iso-8859-${e}.enc maps/iso-8859-${e}.xml
+	${MAKE_CMD} -C ${.CURDIR}/../p5-XML-Encoding patch
+	cd `${MAKE_CMD} -C ${.CURDIR}/../p5-XML-Encoding -V WRKSRC` && ${PERL} bin/compile_encoding -o ${FILESDIR}/iso-8859-${e}.enc maps/iso-8859-${e}.xml
+	${MAKE_CMD} -C ${.CURDIR}/../p5-XML-Encoding do-clean
 .endfor
 
 .include <bsd.port.mk>
diff --git a/textproc/p5-XML-Parser/distinfo b/textproc/p5-XML-Parser/distinfo
index 6c793ada0a60..c57eae04e58e 100644
--- a/textproc/p5-XML-Parser/distinfo
+++ b/textproc/p5-XML-Parser/distinfo
@@ -1,2 +1,3 @@
-SHA256 (XML-Parser-2.44.tar.gz) = 1ae9d07ee9c35326b3d9aad56eae71a6730a73a116b9fe9e8a4758b7cc033216
-SIZE (XML-Parser-2.44.tar.gz) = 237377
+TIMESTAMP = 1656093028
+SHA256 (XML-Parser-2.46.tar.gz) = d331332491c51cccfb4cb94ffc44f9cd73378e618498d4a37df9e043661c515d
+SIZE (XML-Parser-2.46.tar.gz) = 254763
diff --git a/textproc/p5-XML-Parser/files/patch-CheckLib.pm b/textproc/p5-XML-Parser/files/patch-CheckLib.pm
deleted file mode 100644
index 1da73f667b6c..000000000000
--- a/textproc/p5-XML-Parser/files/patch-CheckLib.pm
+++ /dev/null
@@ -1,20 +0,0 @@
---- inc/Devel/CheckLib.pm.orig	2013-01-11 11:43:02.293444337 +0900
-+++ inc/Devel/CheckLib.pm	2013-01-11 11:48:47.556449831 +0900
-@@ -222,7 +222,7 @@
-     for my $header (@headers) {
-         push @use_headers, $header;
-         my($ch, $cfile) = File::Temp::tempfile(
--            'assertlibXXXXXXXX', SUFFIX => '.c'
-+            'assertlibXXXXXXXX', SUFFIX => '.c', TMPDIR => 1,
-         );
-         print $ch qq{#include <$_>\n} for @use_headers;
-         print $ch qq{int main(void) { return 0; }\n};
-@@ -262,7 +262,7 @@
- 
-     # now do each library in turn with headers
-     my($ch, $cfile) = File::Temp::tempfile(
--        'assertlibXXXXXXXX', SUFFIX => '.c'
-+        'assertlibXXXXXXXX', SUFFIX => '.c', TMPDIR => 1,
-     );
-     print $ch qq{#include <$_>\n} foreach (@headers);
-     print $ch "int main(void) { ".($args{function} || 'return 0;')." }\n";
diff --git a/textproc/p5-XML-Parser/files/patch-inc-Devel-CheckLib.pm b/textproc/p5-XML-Parser/files/patch-inc-Devel-CheckLib.pm
new file mode 100644
index 000000000000..0ee7399fde32
--- /dev/null
+++ b/textproc/p5-XML-Parser/files/patch-inc-Devel-CheckLib.pm
@@ -0,0 +1,20 @@
+--- inc/Devel/CheckLib.pm.orig	2016-04-13 04:38:16 UTC
++++ inc/Devel/CheckLib.pm
+@@ -227,7 +227,7 @@ sub assert_lib {
+     # first figure out which headers we can't find ...
+     for my $header (@headers) {
+         push @use_headers, $header;
+-        my ( $ch, $cfile ) = File::Temp::tempfile( 'assertlibXXXXXXXX', SUFFIX => '.c' );
++        my ( $ch, $cfile ) = File::Temp::tempfile( 'assertlibXXXXXXXX', SUFFIX => '.c', TMPDIR => 1 );
+         my $ofile = $cfile;
+         $ofile =~ s/\.c$/$Config{_o}/;
+         print $ch qq{#include <$_>\n} for @use_headers;
+@@ -275,7 +275,7 @@ sub assert_lib {
+     }
+ 
+     # now do each library in turn with headers
+-    my ( $ch, $cfile ) = File::Temp::tempfile( 'assertlibXXXXXXXX', SUFFIX => '.c' );
++    my ( $ch, $cfile ) = File::Temp::tempfile( 'assertlibXXXXXXXX', SUFFIX => '.c', TMPDIR => 1 );
+     my $ofile = $cfile;
+     $ofile =~ s/\.c$/$Config{_o}/;
+     print $ch qq{#include <$_>\n} foreach (@headers);
diff --git a/textproc/p5-XML-Parser/pkg-plist b/textproc/p5-XML-Parser/pkg-plist
index 9782bea14662..92559b641384 100644
--- a/textproc/p5-XML-Parser/pkg-plist
+++ b/textproc/p5-XML-Parser/pkg-plist
@@ -1,7 +1,6 @@
-%%SITE_ARCH%%/auto/XML/Parser/Expat/Expat.so
+%%SITE_ARCH%%/XML/Parser.pm
 %%SITE_ARCH%%/XML/Parser/Encodings/Japanese_Encodings.msg
 %%SITE_ARCH%%/XML/Parser/Encodings/README
-%%SJIS%%%%SITE_ARCH%%/XML/Parser/Encodings/shift_jis.enc
 %%SITE_ARCH%%/XML/Parser/Encodings/big5.enc
 %%SITE_ARCH%%/XML/Parser/Encodings/euc-kr.enc
 %%EUCJP%%%%SITE_ARCH%%/XML/Parser/Encodings/euc-jp.enc
@@ -21,6 +20,7 @@
 %%SITE_ARCH%%/XML/Parser/Encodings/iso-8859-8.enc
 %%SITE_ARCH%%/XML/Parser/Encodings/iso-8859-9.enc
 %%SITE_ARCH%%/XML/Parser/Encodings/koi8-r.enc
+%%SJIS%%%%SITE_ARCH%%/XML/Parser/Encodings/shift_jis.enc
 %%SITE_ARCH%%/XML/Parser/Encodings/windows-1250.enc
 %%SITE_ARCH%%/XML/Parser/Encodings/windows-1251.enc
 %%SITE_ARCH%%/XML/Parser/Encodings/windows-1252.enc
@@ -31,14 +31,14 @@
 %%SITE_ARCH%%/XML/Parser/Encodings/x-sjis-jdk117.enc
 %%SITE_ARCH%%/XML/Parser/Encodings/x-sjis-jisx0221.enc
 %%SITE_ARCH%%/XML/Parser/Encodings/x-sjis-unicode.enc
+%%SITE_ARCH%%/XML/Parser/Expat.pm
+%%SITE_ARCH%%/XML/Parser/LWPExternEnt.pl
 %%SITE_ARCH%%/XML/Parser/Style/Debug.pm
 %%SITE_ARCH%%/XML/Parser/Style/Objects.pm
 %%SITE_ARCH%%/XML/Parser/Style/Stream.pm
 %%SITE_ARCH%%/XML/Parser/Style/Subs.pm
 %%SITE_ARCH%%/XML/Parser/Style/Tree.pm
-%%SITE_ARCH%%/XML/Parser.pm
-%%SITE_ARCH%%/XML/Parser/Expat.pm
-%%SITE_ARCH%%/XML/Parser/LWPExternEnt.pl
+%%SITE_ARCH%%/auto/XML/Parser/Expat/Expat.so
 %%PERL5_MAN3%%/XML::Parser.3.gz
 %%PERL5_MAN3%%/XML::Parser::Expat.3.gz
 %%PERL5_MAN3%%/XML::Parser::Style::Debug.3.gz