git: 071594503c8d - main - databases/p5-DBI: fix runtime warning with recent Perl

From: Mathieu Arnold <mat_at_FreeBSD.org>
Date: Fri, 15 Aug 2025 14:16:51 UTC
The branch main has been updated by mat:

URL: https://cgit.FreeBSD.org/ports/commit/?id=071594503c8d7fa192a40e3faa3dd85465d409c5

commit 071594503c8d7fa192a40e3faa3dd85465d409c5
Author:     Mathieu Arnold <mat@FreeBSD.org>
AuthorDate: 2025-08-15 14:11:04 +0000
Commit:     Mathieu Arnold <mat@FreeBSD.org>
CommitDate: 2025-08-15 14:11:04 +0000

    databases/p5-DBI: fix runtime warning with recent Perl
    
    PR:     287743
---
 databases/p5-DBI/Makefile                |  1 +
 databases/p5-DBI/files/patch-Makefile.PL | 29 +++++++++++++++++++++++++++++
 2 files changed, 30 insertions(+)

diff --git a/databases/p5-DBI/Makefile b/databases/p5-DBI/Makefile
index adcc584ca808..78acccac7c19 100644
--- a/databases/p5-DBI/Makefile
+++ b/databases/p5-DBI/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	DBI
 PORTVERSION=	1.647
+PORTREVISION=	1
 CATEGORIES=	databases perl5
 MASTER_SITES=	CPAN
 PKGNAMEPREFIX=	p5-
diff --git a/databases/p5-DBI/files/patch-Makefile.PL b/databases/p5-DBI/files/patch-Makefile.PL
new file mode 100644
index 000000000000..e44afc728f64
--- /dev/null
+++ b/databases/p5-DBI/files/patch-Makefile.PL
@@ -0,0 +1,29 @@
+Concatenate CFLAGS passed as argument and the one from Perl
+
+--- Makefile.PL.orig	2025-01-20 08:10:33 UTC
++++ Makefile.PL
+@@ -237,6 +237,24 @@ package MY;
+ 
+ package MY;
+ 
++use Config;
++
++sub cflags {
++    my $self = shift;
++
++    my $default = $Config::Config{ccflags} // '';
++    my $user    = $self->{CCFLAGS}         // '';
++
++    # Merge defaults + user flags, dedupe tokens, keep order so user flags come last
++    my %seen;
++    my @merged = grep { length && !$seen{$_}++ }
++                 split(/\s+/, "$default $user");
++
++    local $self->{CCFLAGS} = join ' ', @merged;
++
++    return $self->SUPER::cflags(@_);
++}
++
+ sub postamble {
+ warn <<EOT;
+