From 1b1c20f82873aad61a3732f6bf973d5f44ec0855 Mon Sep 17 00:00:00 2001 From: Sergey Fedorov Date: Sun, 25 Aug 2024 11:18:08 +0800 Subject: [PATCH] p5-imager: fix build with Xcode gcc --- perl/p5-imager/Portfile | 6 +++++- perl/p5-imager/files/patch-c99.diff | 11 +++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 perl/p5-imager/files/patch-c99.diff diff --git a/perl/p5-imager/Portfile b/perl/p5-imager/Portfile index 6a36f90d48e8b..765097a217958 100644 --- a/perl/p5-imager/Portfile +++ b/perl/p5-imager/Portfile @@ -17,7 +17,11 @@ checksums rmd160 6f71b646918ec98be0d017df9463453b35231791 \ if {${perl5.major} != ""} { depends_build-append \ - port:pkgconfig + path:bin/pkg-config:pkgconfig + + # imtiff.c: error: ‘for’ loop initial declaration used outside C99 mode + patchfiles-append patch-c99.diff + compiler.c_standard 1999 depends_lib-append \ port:freetype \ diff --git a/perl/p5-imager/files/patch-c99.diff b/perl/p5-imager/files/patch-c99.diff new file mode 100644 index 0000000000000..2f99c55ba0ab8 --- /dev/null +++ b/perl/p5-imager/files/patch-c99.diff @@ -0,0 +1,11 @@ +--- TIFF/Makefile.PL 2024-04-06 10:10:48.000000000 +0800 ++++ TIFF/Makefile.PL 2024-08-25 11:14:57.000000000 +0800 +@@ -18,7 +18,7 @@ + my $define = ""; + my $fp_rep = unpack("H*", pack("f", 1.25)); + if ($fp_rep eq "0000a03f" || $fp_rep eq "3fa00000") { +- $define = "-DIEEEFP_TYPES"; ++ $define = "-DIEEEFP_TYPES -std=c99"; + } + + my %opts =