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 | |
e3aa160d |
9 | my %BUILD_DEPS = (); |
10 | |
11 | my %TEST_DEPS = ( |
bb6d1b87 |
12 | 'Test::More' => 0.96, |
13 | 'Test::Fatal' => 0.003, |
14 | ); |
15 | |
16 | my %RUN_DEPS = ( |
cc1d7a92 |
17 | 'Class::Method::Modifiers' => 1.10, |
4a7640d1 |
18 | 'strictures' => 1.004003, |
8f7cf9cf |
19 | 'Module::Runtime' => 0.012, |
1159c8c2 |
20 | 'Role::Tiny' => 1.002004, |
c3e9ea21 |
21 | 'Devel::GlobalDestruction' => 0.11, |
bb6d1b87 |
22 | ); |
23 | |
24 | # have to do this since old EUMM dev releases miss the eval $VERSION line |
25 | my $mymeta_works = do { no warnings; $ExtUtils::MakeMaker::VERSION >= 6.5707 }; |
26 | my $mymeta = do { no warnings; $ExtUtils::MakeMaker::VERSION >= 6.5702 }; |
27 | |
e3aa160d |
28 | my $has_test_requires = do { no warnings; $ExtUtils::MakeMaker::VERSION >= 6.63_03 }; |
29 | |
30 | if (not $has_test_requires) |
31 | { |
32 | %BUILD_DEPS = (%BUILD_DEPS, %TEST_DEPS); |
33 | %TEST_DEPS = (); |
34 | } |
35 | |
627063f7 |
36 | my %extra_info = ( |
37 | resources => { |
072d158f |
38 | repository => 'git://git.shadowcat.co.uk/gitmo/Moo.git', |
39 | IRC => 'irc://irc.perl.org/#moose', |
40 | bugtracker => 'http://rt.cpan.org/NoAuth/Bugs.html?Dist=Moo', |
41 | license => 'http://dev.perl.org/licenses/', |
627063f7 |
42 | } |
43 | ); |
44 | |
6d71fae7 |
45 | WriteMakefile( |
46 | NAME => 'Moo', |
47 | VERSION_FROM => 'lib/Moo.pm', |
4b46a4be |
48 | CONFIGURE_REQUIRES => { |
49 | 'Dist::CheckConflicts' => '0.02', |
50 | }, |
bb6d1b87 |
51 | PREREQ_PM => { |
52 | %RUN_DEPS, |
53 | ($] >= 5.010 ? () : ('MRO::Compat' => 0)), |
54 | ($mymeta_works ? () : (%BUILD_DEPS)), |
4b46a4be |
55 | 'Dist::CheckConflicts' => '0.02', |
bb6d1b87 |
56 | }, |
57 | ($mymeta_works |
58 | ? ( # BUILD_REQUIRES makes MYMETA right, requires stops META being wrong |
59 | BUILD_REQUIRES => \%BUILD_DEPS, |
e3aa160d |
60 | $has_test_requires ? ( TEST_REQUIRES => \%TEST_DEPS ) : (), |
627063f7 |
61 | META_ADD => { requires => \%RUN_DEPS, %extra_info } |
bb6d1b87 |
62 | ) |
63 | : ( # META_ADD both to get META right - only Makefile written |
64 | META_ADD => { |
65 | requires => \%RUN_DEPS, |
66 | build_requires => \%BUILD_DEPS, |
e3aa160d |
67 | test_requires => \%TEST_DEPS, |
627063f7 |
68 | %extra_info, |
bb6d1b87 |
69 | } |
70 | ) |
71 | ), |
eb6fa3d7 |
72 | META_MERGE => { |
73 | no_index => { |
74 | directory => [ 'xt' ] |
97e41aa9 |
75 | }, |
76 | x_breaks => { |
77 | # enter conflicting data here, *and* in Moo::Conflicts |
040b2738 |
78 | 'HTML::Restrict' => '2.1.5', |
97e41aa9 |
79 | }, |
eb6fa3d7 |
80 | }, |
bb6d1b87 |
81 | ($mymeta && !$mymeta_works ? (NO_MYMETA => 1) : ()), |
6d71fae7 |
82 | LICENSE => 'perl', |
4b46a4be |
83 | 'EXE_FILES' => [ |
84 | 'bin/moo-outdated', |
85 | ], |
6d71fae7 |
86 | ); |
e3aa160d |
87 | |
4b46a4be |
88 | |
89 | # copied from Moose-2.0801/Makefile.PL |
90 | sub check_conflicts { |
91 | if ( eval { require 'lib/Moo/Conflicts.pm'; 1; } ) { |
92 | if ( eval { Moo::Conflicts->check_conflicts; 1 } ) { |
93 | return; |
94 | } |
95 | else { |
96 | my $err = $@; |
97 | $err =~ s/^/ /mg; |
98 | warn "***\n$err***\n"; |
99 | } |
100 | } |
101 | else { |
102 | print <<'EOF'; |
103 | *** |
104 | Your toolchain doesn't support configure_requires, so |
105 | Dist::CheckConflicts hasn't been installed yet. You should check for |
106 | conflicting modules manually using the 'moo-outdated' script that is |
107 | installed with this distribution once the installation finishes. |
108 | *** |
109 | EOF |
110 | } |
111 | |
27073f7c |
112 | return if $ENV{AUTOMATED_TESTING} || $ENV{NONINTERACTIVE_TESTING}; |
113 | |
4b46a4be |
114 | # More or less copied from Module::Build |
115 | return if $ENV{PERL_MM_USE_DEFAULT}; |
116 | return unless -t STDIN && ( -t STDOUT || !( -f STDOUT || -c STDOUT ) ); |
117 | |
118 | sleep 4; |
119 | } |
120 | |