git: 8b14713874e9 - main - math/p5-PDL-Transform-Proj4: Add p5-PDL-Transform-Proj4 2.097

From: Po-Chuan Hsieh <sunpoet_at_FreeBSD.org>
Date: Tue, 28 Jan 2025 17:06:23 UTC
The branch main has been updated by sunpoet:

URL: https://cgit.FreeBSD.org/ports/commit/?id=8b14713874e99b2c6961235c50ec707fb9bfa98d

commit 8b14713874e99b2c6961235c50ec707fb9bfa98d
Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2025-01-28 17:04:34 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2025-01-28 17:04:34 +0000

    math/p5-PDL-Transform-Proj4: Add p5-PDL-Transform-Proj4 2.097
    
    PDL::Transform::Proj4 works like PDL::Transform::Cartography, but using the proj
    library in the background.
    
    The main object here is the PDL::Transform::Proj4 object, aliased to the
    t_proj() function.
    
    This object accepts all of the standard options described below, but mainly is
    there to be called with just the proj_params option defined.
    
    When options are used, they must be used with a '+' before them when placed in
    the proj_params string, but that is not required otherwise. See the SYNOPSIS
    above.
    
    Please note that unlike PROJ, all angles in these operations are in degrees.
    This is correctly (as of PDL 2.094) reflected in the PDL::Transform subclass
    objects.
    
    Other than t_proj(), all of the other transforms below have been autogenerated,
    and may not work properly. The main problem is determining the parameters a
    projection requires from the proj library itself.
    
    Due to the difficulties in doing this, there may be times when the proj docs
    specify a parameter for a projection that won't work using the anon-hash type
    specification. In that case, just throw that parameter in the proj_params
    string, and everything should work fine.
---
 math/Makefile                                      |  1 +
 math/p5-PDL-Transform-Proj4/Makefile               | 25 ++++++++
 math/p5-PDL-Transform-Proj4/distinfo               |  3 +
 math/p5-PDL-Transform-Proj4/files/patch-Alien-proj | 68 ++++++++++++++++++++++
 math/p5-PDL-Transform-Proj4/pkg-descr              | 25 ++++++++
 math/p5-PDL-Transform-Proj4/pkg-plist              |  3 +
 6 files changed, 125 insertions(+)

diff --git a/math/Makefile b/math/Makefile
index 31b3e079d0df..8ac7a195ca5d 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -833,6 +833,7 @@
     SUBDIR += p5-PDL-Minuit
     SUBDIR += p5-PDL-Opt-Simplex
     SUBDIR += p5-PDL-Perldl2
+    SUBDIR += p5-PDL-Transform-Proj4
     SUBDIR += p5-Parse-Range
     SUBDIR += p5-Roman
     SUBDIR += p5-Set-IntSpan
diff --git a/math/p5-PDL-Transform-Proj4/Makefile b/math/p5-PDL-Transform-Proj4/Makefile
new file mode 100644
index 000000000000..ebfbc97db08f
--- /dev/null
+++ b/math/p5-PDL-Transform-Proj4/Makefile
@@ -0,0 +1,25 @@
+PORTNAME=	PDL-Transform-Proj4
+PORTVERSION=	2.097
+CATEGORIES=	math perl5
+MASTER_SITES=	CPAN
+PKGNAMEPREFIX=	p5-
+
+MAINTAINER=	sunpoet@FreeBSD.org
+COMMENT=	PDL::Transform interface to the Proj4 projection library
+WWW=		https://metacpan.org/dist/PDL-Transform-Proj4
+
+LICENSE=	ART10 GPLv1+
+LICENSE_COMB=	dual
+
+BUILD_DEPENDS=	p5-Capture-Tiny>=0:devel/p5-Capture-Tiny \
+		${RUN_DEPENDS}
+LIB_DEPENDS=	libproj.so:graphics/proj
+RUN_DEPENDS=	p5-PDL>=2.096:math/p5-PDL
+
+USES=		localbase perl5
+USE_PERL5=	configure
+
+post-install:
+	${STRIP_CMD} ${STAGEDIR}${PREFIX}/${SITE_ARCH_REL}/auto/PDL/Transform/Proj4/Proj4.so
+
+.include <bsd.port.mk>
diff --git a/math/p5-PDL-Transform-Proj4/distinfo b/math/p5-PDL-Transform-Proj4/distinfo
new file mode 100644
index 000000000000..74fd89f6753c
--- /dev/null
+++ b/math/p5-PDL-Transform-Proj4/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1736671161
+SHA256 (PDL-Transform-Proj4-2.097.tar.gz) = 9d429c69d9ba20bad7373b08631f491eabec4fbb6461424884fd4ceb794cbf2d
+SIZE (PDL-Transform-Proj4-2.097.tar.gz) = 26981
diff --git a/math/p5-PDL-Transform-Proj4/files/patch-Alien-proj b/math/p5-PDL-Transform-Proj4/files/patch-Alien-proj
new file mode 100644
index 000000000000..1085dc4a0910
--- /dev/null
+++ b/math/p5-PDL-Transform-Proj4/files/patch-Alien-proj
@@ -0,0 +1,68 @@
+--- lib/PDL/Transform/Proj4.pd.orig	2025-01-03 22:39:08 UTC
++++ lib/PDL/Transform/Proj4.pd
+@@ -5,8 +5,8 @@ use warnings;
+ 
+ use strict;
+ use warnings;
++use Capture::Tiny ':all';
+ use File::Spec;
+-use Alien::proj;
+ 
+ our $VERSION = "2.097";
+ pp_setversion($VERSION);
+@@ -104,7 +104,7 @@ sub load_projection_information {
+   fixed Earth For CH1903
+ );
+ sub load_projection_information {
+-    my ($text, $stderr, $exit_code) = Alien::proj->run_utility ("proj", "-lP");
++    my ($text, $stderr, $exit_code) = capture{system "proj", "-lP"};
+     warn $stderr if $stderr;
+     die "proj -lP error $exit_code. See above for error text." if $exit_code;
+     my @chunks = $text =~ /(.+?)(?=(?:^\S|\z))/gms;
+@@ -175,7 +175,6 @@ use PDL::Transform;
+ use warnings;
+ use PDL::LiteF;
+ use PDL::Transform;
+-use Alien::proj;
+ 
+ =head1 NAME
+ 
+--- Makefile.PL.orig	2025-01-03 22:41:17 UTC
++++ Makefile.PL
+@@ -2,7 +2,6 @@ use PDL::Core::Dev;
+ use warnings;
+ use ExtUtils::MakeMaker;
+ use PDL::Core::Dev;
+-use Alien::proj;
+ 
+ my @pd_srcs;
+ undef &MY::init_PM; # suppress warning
+@@ -22,7 +21,6 @@ WriteMakefile(
+   CONFIGURE_REQUIRES => {
+     'ExtUtils::MakeMaker' => 0,
+     'PDL' => '2.096',
+-    'Alien::proj' => '1.29', # guarantee minimum PROJ 7.1 as need degree_output
+   },
+   PREREQ_PM => {
+     'PDL' => '2.096',
+@@ -30,8 +28,7 @@ WriteMakefile(
+   TEST_REQUIRES => {
+     'Test::More' => '0.88',
+   },
+-  INC => Alien::proj->cflags,
+-  LIBS => [Alien::proj->libs],
++  LIBS => ['-lproj'],
+   clean => { FILES => join ' ', qw(MANIFEST.bak) },
+   NO_MYMETA => 1,
+ );
+--- t/gis_proj.t.orig	2024-12-03 06:57:09 UTC
++++ t/gis_proj.t
+@@ -9,8 +9,6 @@ use PDL::Transform::Proj4;
+     LC_RUN_PATH);
+ }
+ use PDL::Transform::Proj4;
+-use Alien::proj;
+-diag "Alien::proj version $Alien::proj::VERSION";
+ 
+ my @version = eval { PDL::Transform::Proj4::proj_version() };
+ is $@, '', 'proj_version no die';
diff --git a/math/p5-PDL-Transform-Proj4/pkg-descr b/math/p5-PDL-Transform-Proj4/pkg-descr
new file mode 100644
index 000000000000..80bd1748d4a3
--- /dev/null
+++ b/math/p5-PDL-Transform-Proj4/pkg-descr
@@ -0,0 +1,25 @@
+PDL::Transform::Proj4 works like PDL::Transform::Cartography, but using the proj
+library in the background.
+
+The main object here is the PDL::Transform::Proj4 object, aliased to the
+t_proj() function.
+
+This object accepts all of the standard options described below, but mainly is
+there to be called with just the proj_params option defined.
+
+When options are used, they must be used with a '+' before them when placed in
+the proj_params string, but that is not required otherwise. See the SYNOPSIS
+above.
+
+Please note that unlike PROJ, all angles in these operations are in degrees.
+This is correctly (as of PDL 2.094) reflected in the PDL::Transform subclass
+objects.
+
+Other than t_proj(), all of the other transforms below have been autogenerated,
+and may not work properly. The main problem is determining the parameters a
+projection requires from the proj library itself.
+
+Due to the difficulties in doing this, there may be times when the proj docs
+specify a parameter for a projection that won't work using the anon-hash type
+specification. In that case, just throw that parameter in the proj_params
+string, and everything should work fine.
diff --git a/math/p5-PDL-Transform-Proj4/pkg-plist b/math/p5-PDL-Transform-Proj4/pkg-plist
new file mode 100644
index 000000000000..d4da04a38501
--- /dev/null
+++ b/math/p5-PDL-Transform-Proj4/pkg-plist
@@ -0,0 +1,3 @@
+%%SITE_ARCH%%/PDL/Demos/Proj4_demo.pm
+%%SITE_ARCH%%/PDL/Transform/Proj4.pm
+%%SITE_ARCH%%/auto/PDL/Transform/Proj4/Proj4.so