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 ##############################################################################
66 require ExtUtils::MakeMaker;
67 (do 'maint/Makefile.PL.include' or die $@) unless -f 'META.yml';
69 # have to do this since old EUMM dev releases miss the eval $VERSION line
70 my $eumm_version = eval $ExtUtils::MakeMaker::VERSION;
71 my $mymeta = $eumm_version >= 6.57_02;
72 my $mymeta_broken = $mymeta && $eumm_version < 6.57_07;
74 ($MM_ARGS{NAME} = $META{name}) =~ s/-/::/g;
75 ($MM_ARGS{VERSION_FROM} = "lib/$MM_ARGS{NAME}.pm") =~ s{::}{/}g;
76 $MM_ARGS{LICENSE} = $META{license}
77 if $eumm_version >= 6.30;
78 $MM_ARGS{NO_MYMETA} = 1
80 $MM_ARGS{META_ADD} = { 'meta-spec' => { version => 2 }, %META }
83 for (qw(configure build test runtime)) {
84 my $key = $_ eq 'runtime' ? 'PREREQ_PM' : uc $_.'_REQUIRES';
85 my $r = $MM_ARGS{$key} = {
86 %{$META{prereqs}{$_}{requires} || {}},
87 %{delete $MM_ARGS{$key} || {}},
89 defined $r->{$_} or delete $r->{$_} for keys %$r;
92 $MM_ARGS{MIN_PERL_VERSION} = delete $MM_ARGS{PREREQ_PM}{perl} || 0;
94 delete $MM_ARGS{MIN_PERL_VERSION}
95 if $eumm_version < 6.47_01;
96 $MM_ARGS{BUILD_REQUIRES} = {%{$MM_ARGS{BUILD_REQUIRES}}, %{delete $MM_ARGS{TEST_REQUIRES}}}
97 if $eumm_version < 6.63_03;
98 $MM_ARGS{PREREQ_PM} = {%{$MM_ARGS{PREREQ_PM}}, %{delete $MM_ARGS{BUILD_REQUIRES}}}
99 if $eumm_version < 6.55_01;
100 delete $MM_ARGS{CONFIGURE_REQUIRES}
101 if $eumm_version < 6.51_03;
103 ExtUtils::MakeMaker::WriteMakefile(%MM_ARGS);
104 ##############################################################################
106 # Secondary compile testing via ExtUtils::CBuilder
108 # Do we have the configure_requires checker?
110 eval "require ExtUtils::CBuilder;";
112 # They don't obey configure_requires, so it is
113 # someone old and delicate. Try to avoid hurting
114 # them by falling back to an older simpler test.
118 return ExtUtils::CBuilder->new( quiet => 1 )->have_compiler;
121 # can we locate a (the) C compiler
123 my @chunks = split(/ /, $Config::Config{cc}) or return;
125 # $Config{cc} may contain args; try to find out the program part
127 return can_run("@chunks") || (pop(@chunks), next);
133 # check if we can run some command
137 return $cmd if -x $cmd;
138 if (my $found_cmd = MM->maybe_command($cmd)) {
142 for my $dir ((split /$Config::Config{path_sep}/, $ENV{PATH}), '.') {
144 my $abs = File::Spec->catfile($dir, $cmd);
145 return $abs if (-x $abs or $abs = MM->maybe_command($abs));
152 return ( $ENV{AUTOMATED_TESTING} && ! $ENV{PERL5_CPANM_IS_RUNNING} && ! $ENV{RELEASE_TESTING} )