X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=Makefile.PL;h=0c1d029a2b572370d257c97e5823140c3137e8e2;hb=e029c65666417046fefe06ad3caf04f489fe31d1;hp=caafb55f6d379bc1b49b995aca8e6ce7ee8e3891;hpb=9aaf36461a79c118c35f3bf546933fefbd9bfd35;p=p5sagit%2FDevel-GlobalDestruction.git diff --git a/Makefile.PL b/Makefile.PL index caafb55..0c1d029 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -1,7 +1,7 @@ use strict; use warnings; -require 5.006000; +require 5.006; use ExtUtils::MakeMaker; BEGIN { if ( $^O eq 'cygwin' ) { @@ -19,13 +19,29 @@ BEGIN { if ( $^O eq 'cygwin' ) { } }} +use Text::ParseWords; + +sub parse_args { + # copied from EUMM + ExtUtils::MakeMaker::parse_args( + my $tmp = {}, + Text::ParseWords::shellwords($ENV{PERL_MM_OPT} || ''), + @ARGV, + ); + return $tmp->{ARGS} || {}; +} + my $mymeta_works = eval { ExtUtils::MakeMaker->VERSION('6.5707'); 1 }; my $mymeta = $mymeta_works || eval { ExtUtils::MakeMaker->VERSION('6.5702'); 1 }; my %META_BITS = ( ); my %RUN_DEPS = ( - 'Sub::Exporter' => 0, + 'Sub::Exporter::Progressive' => '0.001011', + ( (defined ${^GLOBAL_PHASE} or parse_args()->{PUREPERL_ONLY} or !can_xs() ) + ? () + : ('Devel::GlobalDestruction::XS' => 0) + ), ); my %WriteMakefileArgs = ( @@ -34,22 +50,18 @@ my %WriteMakefileArgs = ( LICENSE => 'perl', INSTALLDIRS => 'site', PL_FILES => { }, - MIN_PERL_VERSION => '5.006000', + MIN_PERL_VERSION => '5.006', PREREQ_PM => \%RUN_DEPS, CONFIGURE_REQUIRES => { 'ExtUtils::CBuilder' => 0.27 }, META_ADD => { resources => { - homepage => 'http://search.cpan.org/dist/Devel-Globaldestruction', - repository => 'git://git.shadowcat.co.uk/p5sagit/Devel-Globaldestruction.git', - bugtracker => 'http://rt.cpan.org/Public/Dist/Display.html?Name=Devel-Globaldestruction', + homepage => 'http://search.cpan.org/dist/Devel-GlobalDestruction', + repository => 'git://git.shadowcat.co.uk/p5sagit/Devel-GlobalDestruction.git', + bugtracker => 'http://rt.cpan.org/Public/Dist/Display.html?Name=Devel-GlobalDestruction', }, requires => \%RUN_DEPS, }, ($mymeta and !$mymeta_works) ? ( 'NO_MYMETA' => 1 ) : (), - ( (defined ${^GLOBAL_PHASE} or !can_xs() ) - ? (XS => {}, C => []) - : () - ), ); unless ( eval { ExtUtils::MakeMaker->VERSION('6.56') } ) { @@ -65,6 +77,21 @@ unless ( eval { ExtUtils::MakeMaker->VERSION('6.56') } ) { } } +if (eval { require Devel::GlobalDestruction } + && Devel::GlobalDestruction->VERSION < 0.10) { + package MY; + no warnings 'once'; + + *install = sub { + my $self = shift; + return ' +pure_site_install :: + $(NOECHO) $(RM_F) ' . $self->quote_literal( + $self->catfile('$(DESTINSTALLSITEARCH)', 'Devel', 'GlobalDestruction.pm') + ) . "\n" . $self->SUPER::install; + }; +} + delete $WriteMakefileArgs{CONFIGURE_REQUIRES} unless eval { ExtUtils::MakeMaker->VERSION('6.52') };