git: 071398600dc2 - main - p5-*: fix PM_FILTER semantic changes

From: Mathieu Arnold <mat_at_FreeBSD.org>
Date: Sat, 26 Jul 2025 08:39:22 UTC
The branch main has been updated by mat:

URL: https://cgit.FreeBSD.org/ports/commit/?id=071398600dc2c4ddfe0f77ad3691c59eb1711ad6

commit 071398600dc2c4ddfe0f77ad3691c59eb1711ad6
Author:     Mathieu Arnold <mat@FreeBSD.org>
AuthorDate: 2025-07-13 09:14:11 +0000
Commit:     Mathieu Arnold <mat@FreeBSD.org>
CommitDate: 2025-07-26 08:36:46 +0000

    p5-*: fix PM_FILTER semantic changes
    
    PR:     288020
---
 databases/p5-POE-Component-RRDTool/Makefile             |  8 +++++++-
 .../files/extrapatch-Makefile.PL                        | 14 ++++++++++++++
 print/p5-PDF-Template/Makefile                          |  8 +++++++-
 print/p5-PDF-Template/files/extrapatch-Makefile.PL      | 15 +++++++++++++++
 sysutils/p5-BSD-Sysctl/Makefile                         |  8 +++++++-
 sysutils/p5-BSD-Sysctl/files/extrapatch-Makefile.PL     | 17 +++++++++++++++++
 6 files changed, 67 insertions(+), 3 deletions(-)

diff --git a/databases/p5-POE-Component-RRDTool/Makefile b/databases/p5-POE-Component-RRDTool/Makefile
index 907adc1166d8..e3b22a35fea8 100644
--- a/databases/p5-POE-Component-RRDTool/Makefile
+++ b/databases/p5-POE-Component-RRDTool/Makefile
@@ -24,4 +24,10 @@ CONFIGURE_ARGS=	</dev/null
 post-patch:
 	@${REINPLACE_CMD} -e 's|($$maj, $$min, $$sub)|&; &|' ${WRKSRC}/Makefile.PL
 
-.include <bsd.port.mk>
+.include <bsd.port.pre.mk>
+
+.if ${PERL_LEVEL} >= 504200
+EXTRA_PATCHES=	${PATCHDIR}/extrapatch-Makefile.PL
+.endif
+
+.include <bsd.port.post.mk>
diff --git a/databases/p5-POE-Component-RRDTool/files/extrapatch-Makefile.PL b/databases/p5-POE-Component-RRDTool/files/extrapatch-Makefile.PL
new file mode 100644
index 000000000000..f980543c8932
--- /dev/null
+++ b/databases/p5-POE-Component-RRDTool/files/extrapatch-Makefile.PL
@@ -0,0 +1,14 @@
+fix sh: Syntax error: Unterminated quoted string
+    Filter command '"sed" "-e" "s\"' failed
+
+--- Makefile.PL.orig	2025-07-13 08:56:55 UTC
++++ Makefile.PL
+@@ -21,7 +21,7 @@ WriteMakefile(
+     'PREREQ_PM'    => {
+         'POE' => '0.22',
+     },
+-    PM_FILTER => "sed -e s\\#__DEFAULT_RRDTOOL__\\#${DEFAULT_RRDTOOL}\\#g -e s\\#__RRDTOOL_VERSION__\\#${RRDTOOL_VERSION}\\#g",
++    PM_FILTER => "sed -e s=__DEFAULT_RRDTOOL__=${DEFAULT_RRDTOOL}=g -e s=__RRDTOOL_VERSION__=${RRDTOOL_VERSION}=g",
+     (($] ge '5.005') ? 
+         (   'AUTHOR'   => 'Todd Caine <todd@pobox.com>',
+             'ABSTRACT' => 'POE interface to Tobias Oetiker\'s RRDTool',
diff --git a/print/p5-PDF-Template/Makefile b/print/p5-PDF-Template/Makefile
index 25bc08939eba..b96dd7e452b8 100644
--- a/print/p5-PDF-Template/Makefile
+++ b/print/p5-PDF-Template/Makefile
@@ -16,4 +16,10 @@ RUN_DEPENDS=	pdflib-perl>=0:print/pdflib-perl \
 USES=		perl5
 USE_PERL5=	configure
 
-.include <bsd.port.mk>
+.include <bsd.port.pre.mk>
+
+.if ${PERL_LEVEL} >= 504200
+EXTRA_PATCHES=	${PATCHDIR}/extrapatch-Makefile.PL
+.endif
+
+.include <bsd.port.post.mk>
diff --git a/print/p5-PDF-Template/files/extrapatch-Makefile.PL b/print/p5-PDF-Template/files/extrapatch-Makefile.PL
new file mode 100644
index 000000000000..88447806c06a
--- /dev/null
+++ b/print/p5-PDF-Template/files/extrapatch-Makefile.PL
@@ -0,0 +1,15 @@
+fix sh: Syntax error: Unterminated quoted string
+
+--- Makefile.PL.orig	2025-07-13 09:16:55 UTC
++++ Makefile.PL
+@@ -28,8 +28,8 @@ my $pm_filter = $use_unicode
+ }
+ 
+ my $pm_filter = $use_unicode
+-    ? q{perl -pi -e "s!UNI_YES ! !g;s!UNI_NO  !\\#!g"}
+-    : q{perl -pi -e "s!UNI_NO  ! !g;s!UNI_YES !\\#!g"};
++    ? q{sed -e "s/UNI_YES//g;s/UNI_NO.*//g"}
++    : q{sed -e "s/UNI_NO//g;s/UNI_YES.*//g"};
+ 
+ WriteMakefile(
+     NAME         => 'PDF::Template',
diff --git a/sysutils/p5-BSD-Sysctl/Makefile b/sysutils/p5-BSD-Sysctl/Makefile
index 18bb5331a4ca..72915e00526f 100644
--- a/sysutils/p5-BSD-Sysctl/Makefile
+++ b/sysutils/p5-BSD-Sysctl/Makefile
@@ -20,4 +20,10 @@ GH_ACCOUNT=	glebius
 pre-install:
 	${STRIP_CMD} ${WRKSRC}/blib/arch/auto/BSD/Sysctl/Sysctl.so
 
-.include <bsd.port.mk>
+.include <bsd.port.pre.mk>
+
+.if ${PERL_LEVEL} >= 504200
+EXTRA_PATCHES=	${PATCHDIR}/extrapatch-Makefile.PL
+.endif
+
+.include <bsd.port.post.mk>
diff --git a/sysutils/p5-BSD-Sysctl/files/extrapatch-Makefile.PL b/sysutils/p5-BSD-Sysctl/files/extrapatch-Makefile.PL
new file mode 100644
index 000000000000..d1adb4f11a13
--- /dev/null
+++ b/sysutils/p5-BSD-Sysctl/files/extrapatch-Makefile.PL
@@ -0,0 +1,17 @@
+--- Makefile.PL.orig	2025-07-26 06:21:52 UTC
++++ Makefile.PL
+@@ -51,13 +51,7 @@ WriteMakefile(
+     PREREQ_PM     => {
+         'XSLoader' => 0
+     },
+-    PM_FILTER     => 'perl -pe "if (/^\#include (.+)$$/) {		\
+-					open FILE, \\$$1 or		\
+-					    die \"open \\$$1\";		\
+-					while (<FILE>) { print; };	\
+-					close FILE;			\
+-					next;				\
+-				};"',
++    PM_FILTER     => q{perl -pe 'if (/^#include (.+)$$/) { open FILE, \\$$1 or die; while (<FILE>) { print; }; close FILE; next; };'},
+     clean => {
+         FILES => 'bsd-sysctl.h bsd-sysctl.ph',
+     },