diff --git a/Basic/lib/PDL/Core/Dev.pm b/Basic/lib/PDL/Core/Dev.pm index 2828fbc17..be7838e51 100644 --- a/Basic/lib/PDL/Core/Dev.pm +++ b/Basic/lib/PDL/Core/Dev.pm @@ -186,6 +186,7 @@ sub pdlpp_eumm_update_deep { my $macro = $eumm->{macro} ||= {}; my $xsb = $eumm->{XSBUILD}{xs} ||= {}; $eumm->{clean}{FILES} ||= ''; + $eumm->{OBJECT} ||= ''; my $xs = $eumm->{XS} ||= {}; my $global_version = $eumm->parse_version($eumm->{VERSION_FROM}); my @pd_srcs; @@ -197,6 +198,7 @@ sub pdlpp_eumm_update_deep { $pm->{$pmfile} = "\$(INST_LIB)/$nolib.pm"; my @macro_vars = pdlpp_mod_vars(my $mod = join '::', split /\//, $nolib); @$macro{@macro_vars} = pdlpp_mod_values(1, $f, $base, 1, 1); + $eumm->{OBJECT} .= " $base\$(OBJ_EXT)"; $xsb->{$base}{OBJECT} = "\$($macro_vars[1])"; $xsb->{$base}{OBJECT} .= $EXTRAS{$f}{OBJECT} if $EXTRAS{$f}{OBJECT}; $eumm->{DEFINE} .= $EXTRAS{$f}{DEFINE} if $EXTRAS{$f}{DEFINE}; # global @@ -206,7 +208,7 @@ sub pdlpp_eumm_update_deep { print $fh "package $mod;\nour \$VER"."SION = '$global_version';\n1;\n"; # break is so cpanm doesn't try to parse as version close $fh; utime $mtime - 120, $mtime - 120, $pmfile; # so is out of date - push @pd_srcs, [$f, $base, $mod, '', 1]; + push @pd_srcs, [$f, $base, $mod, '', 1, 1]; $eumm->{clean}{FILES} .= join ' ', '', $pmfile, map "\$($_)", @macro_vars; $eumm->{clean}{FILES} .= $EXTRAS{$f}{OBJECT} if $EXTRAS{$f}{OBJECT}; } diff --git a/Libtmp/Transform-Proj4/.gitignore b/Libtmp/Transform-Proj4/.gitignore index 57f58d645..dcc20e7a1 100644 --- a/Libtmp/Transform-Proj4/.gitignore +++ b/Libtmp/Transform-Proj4/.gitignore @@ -1,3 +1,3 @@ -Proj4.c -Proj4.pm -Proj4.xs +lib/PDL/Transform/Proj4.c +lib/PDL/Transform/Proj4.pm +lib/PDL/Transform/Proj4.xs diff --git a/Libtmp/Transform-Proj4/Makefile.PL b/Libtmp/Transform-Proj4/Makefile.PL index ef5af95d2..fcaf2c400 100644 --- a/Libtmp/Transform-Proj4/Makefile.PL +++ b/Libtmp/Transform-Proj4/Makefile.PL @@ -1,26 +1,34 @@ use strict; use warnings; use ExtUtils::MakeMaker; - -my $package_name = "PDL::Transform::Proj4"; -my $lib_name = "Proj4"; +use PDL::Core::Dev; eval { require Alien::proj }; if ($@) { - write_dummy_make("Will skip build of $package_name on this system - no Alien::proj"); + write_dummy_make("Will skip build of PDL::Transform::Proj4 on this system - no Alien::proj"); return; } -my $ppfile = "proj4.pd"; -my $package = [$ppfile, 'Proj4', $package_name]; -my %hash = pdlpp_stdargs_int($package); -$hash{VERSION_FROM} = $ppfile; -$hash{LIBS}[0] .= ' ' . Alien::proj->libs; -$hash{INC} .= ' ' . Alien::proj->cflags; -$hash{realclean} ||= { FILES => '' }; -$hash{realclean}{FILES} .= ' _Inline'; -$hash{PM}{'Demo.pm'} = '$(INST_LIB)/PDL/Demos/Proj4_demo.pm'; +my @pd_srcs; +undef &MY::init_PM; # suppress warning +*MY::init_PM = sub { + package MY; # so that "SUPER" works right + my ($self) = @_; + $self->SUPER::init_PM; + @pd_srcs = ::pdlpp_eumm_update_deep($self); +}; undef &MY::postamble; # suppress warning -*MY::postamble = sub { pdlpp_postamble_int( $package ); }; -WriteMakefile(%hash); +*MY::postamble = sub { pdlpp_postamble_int(@pd_srcs); }; + +WriteMakefile( + NAME => 'PDL', + VERSION_FROM => 'lib/PDL/Transform/Proj4.pd', + MIN_PERL_VERSION => '5.014', + XSMULTI => 1, + INC => PDL::Core::Dev::PDL_INCLUDE() . ' ' . Alien::proj->cflags, + TYPEMAPS => [PDL::Core::Dev::PDL_TYPEMAP()], + LIBS => [Alien::proj->libs], + clean => { FILES => join ' ', qw(MANIFEST.bak) }, + NO_MYMETA => 1, +); diff --git a/Libtmp/Transform-Proj4/Demo.pm b/Libtmp/Transform-Proj4/lib/PDL/Demos/Proj4_demo.pm similarity index 100% rename from Libtmp/Transform-Proj4/Demo.pm rename to Libtmp/Transform-Proj4/lib/PDL/Demos/Proj4_demo.pm diff --git a/Libtmp/Transform-Proj4/proj4.pd b/Libtmp/Transform-Proj4/lib/PDL/Transform/Proj4.pd similarity index 100% rename from Libtmp/Transform-Proj4/proj4.pd rename to Libtmp/Transform-Proj4/lib/PDL/Transform/Proj4.pd diff --git a/MANIFEST b/MANIFEST index cba6d5e76..87375ef87 100644 --- a/MANIFEST +++ b/MANIFEST @@ -593,9 +593,9 @@ Libtmp/Slatec/t/lm.t Libtmp/Slatec/t/slatec-polyfit-weight.t Libtmp/Slatec/t/slatec.t Libtmp/t/func.t -Libtmp/Transform-Proj4/Demo.pm +Libtmp/Transform-Proj4/lib/PDL/Demos/Proj4_demo.pm +Libtmp/Transform-Proj4/lib/PDL/Transform/Proj4.pd Libtmp/Transform-Proj4/Makefile.PL -Libtmp/Transform-Proj4/proj4.pd Libtmp/Transform-Proj4/t/gis_proj.t Libtmp/Transform-Proj4/t/proj_transform.t Makefile.PL diff --git a/MANIFEST.SKIP b/MANIFEST.SKIP index 69faeca93..e2ce84237 100644 --- a/MANIFEST.SKIP +++ b/MANIFEST.SKIP @@ -83,6 +83,7 @@ RCS ^Libtmp/Slatec/Slatec..* ^Libtmp/Slatec/slatec/.*\.c$ ^Libtmp/Transform-Proj4/Proj4\..* +^Libtmp/Transform-Proj4/lib/PDL/Transform/Proj4(\.(pm|xs|c)$|-pp-) ^Perldl2/logo3d.pdl ^Perldl2/pdl2.pod$ ^Perldl2/tctrl-c.pl