From 9e1e8d908b2e693713638b920d8f745e29d4764e Mon Sep 17 00:00:00 2001 From: shawnlaffan Date: Tue, 11 Jun 2024 21:34:09 +1000 Subject: [PATCH] Makefile.PL: let Alien::gdal provide all the GDAL details --- Makefile.PL | 71 +++-------------------------------------------------- 1 file changed, 4 insertions(+), 67 deletions(-) diff --git a/Makefile.PL b/Makefile.PL index 7c98b82..a4fa697 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -1,70 +1,10 @@ use strict; use warnings; -my $have_alien; -BEGIN { - my $gdal = 'Alien::gdal'; - my @argv = (); - for (@ARGV) { - if (/GDAL=(.+)/) { - $gdal = $1; - } else { - push @argv, $_; - } - } - @ARGV = @argv; - eval "use Alien::gdal" if $gdal eq 'Alien::gdal'; - if ($gdal ne 'Alien::gdal' or $@) { - if ($gdal eq 'Alien::gdal') { - print "I can't find Alien::gdal.\n"; - $gdal = '/usr'; - } - print "Trying GDAL from '$gdal'.\n"; - $have_alien = 0; - my $version = `$gdal/bin/gdalinfo --version`; - unless ($version) { - print "I can't find gdal in '$gdal', I'm sorry.\n"; - exit(1); - } - $version = $1 if $version =~ /(\d+\.\d+\.\d+)/; - my @a = (grep {-l} glob("$gdal/lib/libgdal*")); - my $lib = $a[0]; - my $data = "$gdal/share/gdal"; - print "I'm creating Geo::GDAL::gdal as a wrapper to $lib, which I believe is GDAL $version.\n"; - my $fh = IO::File->new; - $fh->open("lib/Geo/GDAL/gdal.pm","w"); - print $fh <new; - $fh->open("lib/Geo/GDAL/gdal.pm","w"); - print $fh < ['Ari Jolma '], @@ -104,8 +44,5 @@ my %args = ( }, }, ); -if ($have_alien) { - %args = (%args, Alien::Base::Wrapper->mm_args); -} WriteMakefile(%args);