From: Karen Etheridge Date: Wed, 23 Apr 2014 06:13:50 +0000 (-0700) Subject: move prereq data to the right place depending on EUMM; add a minimum perl version X-Git-Tag: v1.002000~2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=81b819d6c9d47468e430a404c16e562bc7db3eff;p=p5sagit%2FJSON-MaybeXS.git move prereq data to the right place depending on EUMM; add a minimum perl version --- diff --git a/Makefile.PL b/Makefile.PL index ec50783..958be3d 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -4,16 +4,11 @@ use 5.008001; use ExtUtils::MakeMaker; (do 'maint/Makefile.PL.include' or die $@) unless -f 'META.yml'; -my %BUILD_DEPS = ( - 'Test::Without::Module' => '0.17', - 'Test::More' => '0.88' -); - # we require Cpanel::JSON::XS, except if JSON::XS is already installed we only # reocmmend it. my $require_cpanel_json_xs = can_xs() && !eval { require JSON::XS; 1; }; -WriteMakefile( +my %WriteMakefileArgs = ( NAME => 'JSON::MaybeXS', VERSION_FROM => 'lib/JSON/MaybeXS.pm', PREREQ_PM => { @@ -21,9 +16,13 @@ WriteMakefile( ($require_cpanel_json_xs ? ('Cpanel::JSON::XS' => '2.3310') : ()), - %BUILD_DEPS, + perl => '5.006', + }, + TEST_REQUIRES => { + 'Test::Without::Module' => '0.17', + 'Test::More' => '0.88' }, - BUILD_REQUIRES => \%BUILD_DEPS, + META_MERGE => { 'meta-spec' => { version => 2 }, dynamic_config => 1, @@ -47,6 +46,19 @@ WriteMakefile( realclean => { FILES => 'Distar/' }, ); +my $eumm_version = eval $ExtUtils::MakeMaker::VERSION; +$WriteMakefileArgs{MIN_PERL_VERSION} = delete $WriteMakefileArgs{PREREQ_PM}{perl} || 0; +$WriteMakefileArgs{BUILD_REQUIRES} = { + %{$WriteMakefileArgs{BUILD_REQUIRES}}, + %{delete $WriteMakefileArgs{TEST_REQUIRES}} +} if $eumm_version < 6.63_03; +$WriteMakefileArgs{PREREQ_PM} = { + %{$WriteMakefileArgs{PREREQ_PM}}, + %{delete $WriteMakefileArgs{BUILD_REQUIRES}} +} if $eumm_version < 6.55_01; + +WriteMakefile(%WriteMakefileArgs); + # can we locate a (the) C compiler sub can_cc { my @chunks = split(/ /, $Config::Config{cc}) or return;