correct captures assignment in quote_sub
[gitmo/Moo.git] / Makefile.PL
CommitLineData
6d71fae7 1use strict;
2use warnings FATAL => 'all';
2215d4b9 3use 5.008001;
6d71fae7 4use ExtUtils::MakeMaker;
4b46a4be 5
6check_conflicts();
253d7c99 7(do 'maint/Makefile.PL.include' or die $@) unless -f 'META.yml';
6d71fae7 8
e3b0d764 9my %CONFIGURE_DEPS = (
0fac3e23 10 'ExtUtils::MakeMaker' => 0,
11 'Dist::CheckConflicts' => '0.02',
e3b0d764 12);
e3aa160d 13my %BUILD_DEPS = ();
14
15my %TEST_DEPS = (
0fac3e23 16 'Test::More' => 0.94,
bb6d1b87 17 'Test::Fatal' => 0.003,
18);
19
20my %RUN_DEPS = (
0fac3e23 21 'Class::Method::Modifiers' => 1.10, # for RT#80194
22 'strictures' => 1.004003,
23 'Module::Runtime' => 0.012, # for RT#74789
24 'Role::Tiny' => 1.003002,
25 'Devel::GlobalDestruction' => 0.11, # for RT#78617
26 'Dist::CheckConflicts' => 0.02,
e3b0d764 27);
28
29my %extra_info = (
30 'meta-spec' => { version => 2 },
31 resources => {
7aaf7e26 32 # r/w: gitmo@git.shadowcat.co.uk:Moo.git
e3b0d764 33 repository => {
34 url => 'git://git.shadowcat.co.uk/gitmo/Moo.git',
35 web => 'http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo/Moo.git',
36 type => 'git',
37 },
38 x_IRC => 'irc://irc.perl.org/#moose',
39 bugtracker => {
7aaf7e26 40 web => 'https://rt.cpan.org/Public/Dist/Display.html?Name=Moo',
41 mailto => 'bug-Moo@rt.cpan.org',
e3b0d764 42 },
43 license => [ 'http://dev.perl.org/licenses/' ],
44 },
45 prereqs => {
46 configure => { requires => { %CONFIGURE_DEPS } },
47 build => { requires => { %BUILD_DEPS } },
48 test => { requires => { %TEST_DEPS } },
49 runtime => { requires => { %RUN_DEPS, perl => '5.8.1' } },
bf0f29b2 50 develop => { requires => { map { $_ => 0 } qw(
51 Class::XSAccessor
52 indirect multidimensional bareword::filehandles
53 Moose Mouse namespace::clean namespace::autoclean
54 MooseX::Types::Common::Numeric
55 ) } },
e3b0d764 56 },
bb6d1b87 57);
58
59# have to do this since old EUMM dev releases miss the eval $VERSION line
e3b0d764 60my $mymeta_works = do { no warnings; $ExtUtils::MakeMaker::VERSION >= 6.57_07 };
61my $mymeta = do { no warnings; $ExtUtils::MakeMaker::VERSION >= 6.57_02 };
bb6d1b87 62
e3aa160d 63my $has_test_requires = do { no warnings; $ExtUtils::MakeMaker::VERSION >= 6.63_03 };
64
e3b0d764 65my $has_meta_v2 = do { no warnings; $ExtUtils::MakeMaker::VERSION >= 6.57_10 };
e3aa160d 66
e3b0d764 67if (! $has_meta_v2) {
68 %extra_info = ();
69}
70if (not $has_test_requires) {
71 %BUILD_DEPS = (%BUILD_DEPS, %TEST_DEPS);
72 %TEST_DEPS = ();
73}
74if (not $mymeta_works) {
75 %RUN_DEPS = (%RUN_DEPS, %BUILD_DEPS);
76 %BUILD_DEPS = ();
77}
627063f7 78
6d71fae7 79WriteMakefile(
80 NAME => 'Moo',
81 VERSION_FROM => 'lib/Moo.pm',
e3b0d764 82 CONFIGURE_REQUIRES => \%CONFIGURE_DEPS,
bb6d1b87 83 PREREQ_PM => {
84 %RUN_DEPS,
85 ($] >= 5.010 ? () : ('MRO::Compat' => 0)),
bb6d1b87 86 },
e3b0d764 87 keys %BUILD_DEPS ? ( BUILD_REQUIRES => \%BUILD_DEPS ) : (),
88 keys %TEST_DEPS ? ( TEST_REQUIRES => \%TEST_DEPS ) : (),
89 META_ADD => \%extra_info,
eb6fa3d7 90 META_MERGE => {
91 no_index => {
92 directory => [ 'xt' ]
97e41aa9 93 },
df9d7431 94 Moo::Conflicts->can('conflicts') ? (
95 x_breaks => { Moo::Conflicts->conflicts }
96 ) : (),
eb6fa3d7 97 },
bb6d1b87 98 ($mymeta && !$mymeta_works ? (NO_MYMETA => 1) : ()),
6d71fae7 99 LICENSE => 'perl',
e3b0d764 100 EXE_FILES => [
4b46a4be 101 'bin/moo-outdated',
102 ],
6d71fae7 103);
e3aa160d 104
4b46a4be 105
106# copied from Moose-2.0801/Makefile.PL
107sub check_conflicts {
108 if ( eval { require 'lib/Moo/Conflicts.pm'; 1; } ) {
109 if ( eval { Moo::Conflicts->check_conflicts; 1 } ) {
110 return;
111 }
112 else {
113 my $err = $@;
114 $err =~ s/^/ /mg;
115 warn "***\n$err***\n";
116 }
117 }
118 else {
119 print <<'EOF';
120***
121 Your toolchain doesn't support configure_requires, so
122 Dist::CheckConflicts hasn't been installed yet. You should check for
123 conflicting modules manually using the 'moo-outdated' script that is
124 installed with this distribution once the installation finishes.
125***
126EOF
127 }
128
27073f7c 129 return if $ENV{AUTOMATED_TESTING} || $ENV{NONINTERACTIVE_TESTING};
130
4b46a4be 131 # More or less copied from Module::Build
132 return if $ENV{PERL_MM_USE_DEFAULT};
133 return unless -t STDIN && ( -t STDOUT || !( -f STDOUT || -c STDOUT ) );
134
135 sleep 4;
136}
137