update warning category list for 5.39.8
[p5sagit/strictures.git] / Makefile.PL
CommitLineData
eae006ee 1use strict;
2use warnings FATAL => 'all';
2c87c763 3use 5.006;
b50be891 4use lib 'inc';
5use ExtUtils::HasCompiler 'can_compile_loadable_object';
394c3a46 6
20a395de 7my $want_pp = parse_args()->{PUREPERL_ONLY};
8my $should_xs
9 = defined $want_pp ? $want_pp : can_compile_loadable_object(quiet => 1);
eae006ee 10
27826cd1 11my %extra_prereqs = (
12 indirect => 0,
13 multidimensional => 0,
14 'bareword::filehandles' => 0,
15);
ae3262c9 16
2c87c763 17my %META = (
18 name => 'strictures',
51df8993 19 license => [ 'perl_5' ],
ed745a0b 20 dynamic_config => 1,
2c87c763 21 prereqs => {
22 configure => { requires => { } },
23 build => { requires => { } },
24 test => { requires => {
25 'Test::More' => 0,
26 } },
27 runtime => {
c4ddf87f 28 requires => {
29 perl => '5.006',
30 },
9098cf97 31 suggests => {
2c87c763 32 %extra_prereqs,
33 },
34 },
35 develop => { requires => {
2074d68b 36 'Test::Pod' => 0,
1fa757b7 37 'Test::Pod::Coverage::TrustMe' => 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',
7a0f2103 62 x_contributors => [ # manually added, from git shortlog -e -s -n
63 'Graham Knop <haarg@haarg.org>',
64 'Karen Etheridge <ether@cpan.org>',
65 'Matt S Trout <mst@shadowcat.co.uk>',
66 'Peter Rabbitson <ribasushi@cpan.org>',
67 'Christian Walde <walde.christian@googlemail.com>',
68 'Diab Jerius <djerius@cfa.harvard.edu>',
69 ],
2c87c763 70);
71
72my %MM_ARGS = (
73 PREREQ_PM => {
20a395de 74 ("$]" >= 5.008004 && $should_xs ? %extra_prereqs : () )
2c87c763 75 },
76);
77
ae3262c9 78sub parse_args {
79 # copied from EUMM
2c87c763 80 require ExtUtils::MakeMaker;
81 require Text::ParseWords;
ae3262c9 82 ExtUtils::MakeMaker::parse_args(
83 my $tmp = {},
84 Text::ParseWords::shellwords($ENV{PERL_MM_OPT} || ''),
85 @ARGV,
86 );
87 return $tmp->{ARGS} || {};
88}
89
18f7122e 90## BOILERPLATE ###############################################################
2c87c763 91require ExtUtils::MakeMaker;
0446b591 92(do './maint/Makefile.PL.include' or die $@) unless -f 'META.yml';
27826cd1 93
2c87c763 94# have to do this since old EUMM dev releases miss the eval $VERSION line
51df8993 95my $eumm_version = $ExtUtils::MakeMaker::VERSION;
96$eumm_version =~ tr/_//d;
2c87c763 97my $mymeta = $eumm_version >= 6.57_02;
98my $mymeta_broken = $mymeta && $eumm_version < 6.57_07;
de111885 99
51df8993 100( $MM_ARGS{NAME} = $META{name} ) =~ s/-/::/g
101 if !$MM_ARGS{NAME};
102( $MM_ARGS{VERSION_FROM} = "lib/$MM_ARGS{NAME}.pm" ) =~ s{::}{/}g
103 if !$MM_ARGS{VERSION} && $MM_ARGS{VERSION_FROM};
104$MM_ARGS{ABSTRACT_FROM} ||= $MM_ARGS{VERSION_FROM}
105 if !$MM_ARGS{ABSTRACT};
106$MM_ARGS{AUTHOR} ||= $META{author};
107$MM_ARGS{AUTHOR} = join ', ', @{ $MM_ARGS{AUTHOR} }
108 if $eumm_version < 6.5702 && $MM_ARGS{AUTHOR};
109$MM_ARGS{LICENSE} = $META{license}[0]
110 if $META{license} && $eumm_version >= 6.30;
18f7122e 111$MM_ARGS{LICENSE} = $META{license}[0]
112 if $META{license} && $eumm_version >= 6.30;
2c87c763 113$MM_ARGS{NO_MYMETA} = 1
114 if $mymeta_broken;
115$MM_ARGS{META_ADD} = { 'meta-spec' => { version => 2 }, %META }
116 unless -f 'META.yml';
51df8993 117$MM_ARGS{PL_FILES} ||= {};
118$MM_ARGS{NORECURS} = 1
119 if not exists $MM_ARGS{NORECURS};
77f9ff76 120
2c87c763 121for (qw(configure build test runtime)) {
51df8993 122 my $key = $_ eq 'runtime' ? 'PREREQ_PM' : uc $_ . '_REQUIRES';
2c87c763 123 my $r = $MM_ARGS{$key} = {
51df8993 124 %{ $META{prereqs}{$_}{requires} || {} },
125 %{ delete $MM_ARGS{$key} || {} },
2c87c763 126 };
127 defined $r->{$_} or delete $r->{$_} for keys %$r;
128}
dfdfcbae 129
2c87c763 130$MM_ARGS{MIN_PERL_VERSION} = delete $MM_ARGS{PREREQ_PM}{perl} || 0;
5468e090 131
2c87c763 132delete $MM_ARGS{MIN_PERL_VERSION}
133 if $eumm_version < 6.47_01;
51df8993 134$MM_ARGS{BUILD_REQUIRES} = { %{ $MM_ARGS{BUILD_REQUIRES} }, %{ delete $MM_ARGS{TEST_REQUIRES} } }
2c87c763 135 if $eumm_version < 6.63_03;
51df8993 136$MM_ARGS{PREREQ_PM} = { %{ $MM_ARGS{PREREQ_PM} }, %{ delete $MM_ARGS{BUILD_REQUIRES} } }
2c87c763 137 if $eumm_version < 6.55_01;
138delete $MM_ARGS{CONFIGURE_REQUIRES}
139 if $eumm_version < 6.51_03;
140
141ExtUtils::MakeMaker::WriteMakefile(%MM_ARGS);
18f7122e 142## END BOILERPLATE ###########################################################