summaryrefslogtreecommitdiff
path: root/math/p5-PDL-Transform-Proj4/files/patch-Alien-proj
diff options
context:
space:
mode:
authorPo-Chuan Hsieh <sunpoet@FreeBSD.org>2025-01-29 01:04:34 +0800
committerPo-Chuan Hsieh <sunpoet@FreeBSD.org>2025-01-29 01:04:34 +0800
commit8b14713874e99b2c6961235c50ec707fb9bfa98d (patch)
tree45c6634e40136b5b2e29617a36944e2605743636 /math/p5-PDL-Transform-Proj4/files/patch-Alien-proj
parentmath/p5-PDL-Perldl2: Add p5-PDL-Perldl2 2.002 (diff)
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.
Diffstat (limited to 'math/p5-PDL-Transform-Proj4/files/patch-Alien-proj')
-rw-r--r--math/p5-PDL-Transform-Proj4/files/patch-Alien-proj68
1 files changed, 68 insertions, 0 deletions
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';