Commit | Line | Data |
6d71fae7 |
1 | use strict; |
2 | use warnings FATAL => 'all'; |
253d7c99 |
3 | use 5.008003; |
6d71fae7 |
4 | use ExtUtils::MakeMaker; |
253d7c99 |
5 | (do 'maint/Makefile.PL.include' or die $@) unless -f 'META.yml'; |
6d71fae7 |
6 | |
bb6d1b87 |
7 | unless (-e 'META.yml') { |
8 | warn "MYMETA.yml is going to be completely wrong. Sorry.\n"; |
9 | } |
10 | |
11 | my %BUILD_DEPS = ( |
12 | 'Test::More' => 0.96, |
13 | 'Test::Fatal' => 0.003, |
14 | ); |
15 | |
16 | my %RUN_DEPS = ( |
17 | 'Class::Method::Modifiers' => 1.05, |
18 | 'strictures' => 1, |
19 | ); |
20 | |
21 | # have to do this since old EUMM dev releases miss the eval $VERSION line |
22 | my $mymeta_works = do { no warnings; $ExtUtils::MakeMaker::VERSION >= 6.5707 }; |
23 | my $mymeta = do { no warnings; $ExtUtils::MakeMaker::VERSION >= 6.5702 }; |
24 | |
6d71fae7 |
25 | WriteMakefile( |
26 | NAME => 'Moo', |
27 | VERSION_FROM => 'lib/Moo.pm', |
bb6d1b87 |
28 | PREREQ_PM => { |
29 | %RUN_DEPS, |
30 | ($] >= 5.010 ? () : ('MRO::Compat' => 0)), |
31 | ($mymeta_works ? () : (%BUILD_DEPS)), |
32 | }, |
33 | ($mymeta_works |
34 | ? ( # BUILD_REQUIRES makes MYMETA right, requires stops META being wrong |
35 | BUILD_REQUIRES => \%BUILD_DEPS, |
36 | META_ADD => { requires => \%RUN_DEPS } |
37 | ) |
38 | : ( # META_ADD both to get META right - only Makefile written |
39 | META_ADD => { |
40 | requires => \%RUN_DEPS, |
41 | build_requires => \%BUILD_DEPS, |
42 | } |
43 | ) |
44 | ), |
45 | ($mymeta && !$mymeta_works ? (NO_MYMETA => 1) : ()), |
6d71fae7 |
46 | LICENSE => 'perl', |
47 | ); |