Commit | Line | Data |
eae006ee |
1 | use strict; |
2 | use warnings FATAL => 'all'; |
2c87c763 |
3 | use 5.006; |
b50be891 |
4 | use lib 'inc'; |
5 | use ExtUtils::HasCompiler 'can_compile_loadable_object'; |
394c3a46 |
6 | |
2c87c763 |
7 | my $have_compiler |
8 | = ! parse_args()->{PUREPERL_ONLY} |
b50be891 |
9 | && can_compile_loadable_object(quiet => 1); |
eae006ee |
10 | |
27826cd1 |
11 | my %extra_prereqs = ( |
12 | indirect => 0, |
13 | multidimensional => 0, |
14 | 'bareword::filehandles' => 0, |
15 | ); |
ae3262c9 |
16 | |
2c87c763 |
17 | my %META = ( |
18 | name => 'strictures', |
19 | license => 'perl_5', |
20 | prereqs => { |
21 | configure => { requires => { } }, |
22 | build => { requires => { } }, |
23 | test => { requires => { |
24 | 'Test::More' => 0, |
25 | } }, |
26 | runtime => { |
c4ddf87f |
27 | requires => { |
28 | perl => '5.006', |
29 | }, |
9098cf97 |
30 | suggests => { |
2c87c763 |
31 | %extra_prereqs, |
32 | }, |
33 | }, |
34 | develop => { requires => { |
2074d68b |
35 | 'Test::Pod' => 0, |
36 | 'Test::Pod::Coverage' => 0, |
37 | 'Pod::Coverage::CountParents' => 0, |
2c87c763 |
38 | %extra_prereqs, |
39 | } }, |
40 | }, |
41 | resources => { |
6dfac855 |
42 | # GitHub mirrors from Shadowcat. We list it so we can get pull requests. |
43 | # The canonical repo is: |
44 | # r/o: git://git.shadowcat.co.uk/p5sagit/strictures.git |
2c87c763 |
45 | # r/w: p5sagit@git.shadowcat.co.uk:strictures.git |
6dfac855 |
46 | # web: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit/strictures.git |
2c87c763 |
47 | repository => { |
6dfac855 |
48 | url => 'https://github.com/p5sagit/strictures.git', |
49 | web => 'https://github.com/p5sagit/strictures', |
2c87c763 |
50 | type => 'git', |
51 | }, |
52 | bugtracker => { |
53 | mailto => 'bug-strictures@rt.cpan.org', |
54 | web => 'https://rt.cpan.org/Public/Dist/Display.html?Name=strictures', |
55 | }, |
56 | license => [ 'http://dev.perl.org/licenses/' ], |
57 | }, |
58 | no_index => { |
8b35a6f8 |
59 | directory => [ 't', 'xt', 'inc' ] |
2c87c763 |
60 | }, |
f00a8587 |
61 | x_authority => 'cpan:MSTROUT', |
2c87c763 |
62 | ); |
63 | |
64 | my %MM_ARGS = ( |
65 | PREREQ_PM => { |
e12af862 |
66 | ("$]" >= 5.008004 && $have_compiler ? %extra_prereqs : () ) |
2c87c763 |
67 | }, |
68 | ); |
69 | |
ae3262c9 |
70 | sub parse_args { |
71 | # copied from EUMM |
2c87c763 |
72 | require ExtUtils::MakeMaker; |
73 | require Text::ParseWords; |
ae3262c9 |
74 | ExtUtils::MakeMaker::parse_args( |
75 | my $tmp = {}, |
76 | Text::ParseWords::shellwords($ENV{PERL_MM_OPT} || ''), |
77 | @ARGV, |
78 | ); |
79 | return $tmp->{ARGS} || {}; |
80 | } |
81 | |
18f7122e |
82 | ## BOILERPLATE ############################################################### |
2c87c763 |
83 | require ExtUtils::MakeMaker; |
0446b591 |
84 | (do './maint/Makefile.PL.include' or die $@) unless -f 'META.yml'; |
27826cd1 |
85 | |
2c87c763 |
86 | # have to do this since old EUMM dev releases miss the eval $VERSION line |
87 | my $eumm_version = eval $ExtUtils::MakeMaker::VERSION; |
88 | my $mymeta = $eumm_version >= 6.57_02; |
89 | my $mymeta_broken = $mymeta && $eumm_version < 6.57_07; |
de111885 |
90 | |
2c87c763 |
91 | ($MM_ARGS{NAME} = $META{name}) =~ s/-/::/g; |
92 | ($MM_ARGS{VERSION_FROM} = "lib/$MM_ARGS{NAME}.pm") =~ s{::}{/}g; |
18f7122e |
93 | $META{license} = [ $META{license} ] |
94 | if $META{license} && !ref $META{license}; |
95 | $MM_ARGS{LICENSE} = $META{license}[0] |
96 | if $META{license} && $eumm_version >= 6.30; |
2c87c763 |
97 | $MM_ARGS{NO_MYMETA} = 1 |
98 | if $mymeta_broken; |
99 | $MM_ARGS{META_ADD} = { 'meta-spec' => { version => 2 }, %META } |
100 | unless -f 'META.yml'; |
77f9ff76 |
101 | |
2c87c763 |
102 | for (qw(configure build test runtime)) { |
103 | my $key = $_ eq 'runtime' ? 'PREREQ_PM' : uc $_.'_REQUIRES'; |
104 | my $r = $MM_ARGS{$key} = { |
2ef98edd |
105 | %{$META{prereqs}{$_}{requires} || {}}, |
2c87c763 |
106 | %{delete $MM_ARGS{$key} || {}}, |
107 | }; |
108 | defined $r->{$_} or delete $r->{$_} for keys %$r; |
109 | } |
dfdfcbae |
110 | |
2c87c763 |
111 | $MM_ARGS{MIN_PERL_VERSION} = delete $MM_ARGS{PREREQ_PM}{perl} || 0; |
5468e090 |
112 | |
2c87c763 |
113 | delete $MM_ARGS{MIN_PERL_VERSION} |
114 | if $eumm_version < 6.47_01; |
115 | $MM_ARGS{BUILD_REQUIRES} = {%{$MM_ARGS{BUILD_REQUIRES}}, %{delete $MM_ARGS{TEST_REQUIRES}}} |
116 | if $eumm_version < 6.63_03; |
117 | $MM_ARGS{PREREQ_PM} = {%{$MM_ARGS{PREREQ_PM}}, %{delete $MM_ARGS{BUILD_REQUIRES}}} |
118 | if $eumm_version < 6.55_01; |
119 | delete $MM_ARGS{CONFIGURE_REQUIRES} |
120 | if $eumm_version < 6.51_03; |
121 | |
122 | ExtUtils::MakeMaker::WriteMakefile(%MM_ARGS); |
18f7122e |
123 | ## END BOILERPLATE ########################################################### |