2 use warnings FATAL => 'all';
9 configure => { requires => {
10 'ExtUtils::MakeMaker' => 0,
11 'ExtUtils::CBuilder' => 0.27,
13 build => { requires => {
17 'Test::More' => '0.47',
22 'Algorithm::C3' => '0.07',
23 'Scalar::Util' => '0',
28 requires => { map { $_ => 0 } qw(
29 indirect multidimensional bareword::filehandles
30 Moose Mouse namespace::clean namespace::autoclean
31 MooseX::Types::Common::Numeric
38 url => 'git://git.shadowcat.co.uk/gitmo/Class-C3.git',
39 web => 'http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo/Class-C3.git',
43 web => 'https://rt.cpan.org/Public/Dist/Display.html?Name=Class-C3',
44 mailto => 'bug-Class-C3@rt.cpan.org',
46 homepage => 'https://metacpan.org/release/Class-C3',
47 license => [ 'http://dev.perl.org/licenses/' ],
50 directory => [ 't', 'xt', 'opt' ]
56 ( $] < 5.009_005 and is_smoker() )
57 ? ( 'Devel::Hide' => 0 ) : ()
60 ( $] < 5.009_005 and can_xs() )
61 ? ( 'Class::C3::XS' => '0.13' ) : ()
65 # Secondary compile testing via ExtUtils::CBuilder
67 # Do we have the configure_requires checker?
69 eval "require ExtUtils::CBuilder;";
71 # They don't obey configure_requires, so it is
72 # someone old and delicate. Try to avoid hurting
73 # them by falling back to an older simpler test.
77 return ExtUtils::CBuilder->new( quiet => 1 )->have_compiler;
80 # can we locate a (the) C compiler
82 my @chunks = split(/ /, $Config::Config{cc}) or return;
84 # $Config{cc} may contain args; try to find out the program part
86 return can_run("@chunks") || (pop(@chunks), next);
92 # check if we can run some command
96 return $cmd if -x $cmd;
97 if (my $found_cmd = MM->maybe_command($cmd)) {
101 for my $dir ((split /$Config::Config{path_sep}/, $ENV{PATH}), '.') {
103 my $abs = File::Spec->catfile($dir, $cmd);
104 return $abs if (-x $abs or $abs = MM->maybe_command($abs));
111 return ( $ENV{AUTOMATED_TESTING} && ! $ENV{PERL5_CPANM_IS_RUNNING} && ! $ENV{RELEASE_TESTING} )
114 ## BOILERPLATE ###############################################################
115 require ExtUtils::MakeMaker;
116 (do 'maint/Makefile.PL.include' or die $@) unless -f 'META.yml';
118 # have to do this since old EUMM dev releases miss the eval $VERSION line
119 my $eumm_version = eval $ExtUtils::MakeMaker::VERSION;
120 my $mymeta = $eumm_version >= 6.57_02;
121 my $mymeta_broken = $mymeta && $eumm_version < 6.57_07;
123 ($MM_ARGS{NAME} = $META{name}) =~ s/-/::/g;
124 ($MM_ARGS{VERSION_FROM} = "lib/$MM_ARGS{NAME}.pm") =~ s{::}{/}g;
125 $META{license} = [ $META{license} ]
126 if $META{license} && !ref $META{license};
127 $MM_ARGS{LICENSE} = $META{license}[0]
128 if $META{license} && $eumm_version >= 6.30;
129 $MM_ARGS{NO_MYMETA} = 1
131 $MM_ARGS{META_ADD} = { 'meta-spec' => { version => 2 }, %META }
132 unless -f 'META.yml';
134 for (qw(configure build test runtime)) {
135 my $key = $_ eq 'runtime' ? 'PREREQ_PM' : uc $_.'_REQUIRES';
136 my $r = $MM_ARGS{$key} = {
137 %{$META{prereqs}{$_}{requires} || {}},
138 %{delete $MM_ARGS{$key} || {}},
140 defined $r->{$_} or delete $r->{$_} for keys %$r;
143 $MM_ARGS{MIN_PERL_VERSION} = delete $MM_ARGS{PREREQ_PM}{perl} || 0;
145 delete $MM_ARGS{MIN_PERL_VERSION}
146 if $eumm_version < 6.47_01;
147 $MM_ARGS{BUILD_REQUIRES} = {%{$MM_ARGS{BUILD_REQUIRES}}, %{delete $MM_ARGS{TEST_REQUIRES}}}
148 if $eumm_version < 6.63_03;
149 $MM_ARGS{PREREQ_PM} = {%{$MM_ARGS{PREREQ_PM}}, %{delete $MM_ARGS{BUILD_REQUIRES}}}
150 if $eumm_version < 6.55_01;
151 delete $MM_ARGS{CONFIGURE_REQUIRES}
152 if $eumm_version < 6.51_03;
154 ExtUtils::MakeMaker::WriteMakefile(%MM_ARGS);
155 ## END BOILERPLATE ###########################################################