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