X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=Makefile.PL;h=be7b8e1c69b9c587a684e75ee1263a4aec8a28c5;hb=ddfac3c0bf9565664e5df2619c5b9a0feceb5706;hp=f87bd5a821b2e295b80654fd4d5f1a9dabd9ceec;hpb=53b93bb4485192528ba1b84285e3e1301d11fc27;p=gitmo%2FClass-MOP.git diff --git a/Makefile.PL b/Makefile.PL index f87bd5a..be7b8e1 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -1,6 +1,8 @@ use strict; use warnings; use inc::Module::Install; +use Module::Install::AuthorRequires; +use Module::Install::ExtraTests; use 5.008001; check_conflicts(); @@ -10,22 +12,74 @@ perl_version '5.008001'; all_from 'lib/Class/MOP.pm'; license 'perl'; +require Config; +my $ccflags = ( $Config::Config{ccflags} || '' ) . ' -I.'; -my $ccflags = -d '.svn' || -d '.git' || $ENV{MAINTAINER_MODE} ? '-Wall' : ''; +if ( -d '.git' || $ENV{MAINTAINER_MODE} ) { + $ccflags .= ' -Wall -Wdeclaration-after-statement'; +} requires 'Carp'; +requires 'Data::OptList'; requires 'Devel::GlobalDestruction'; -requires 'MRO::Compat' => '0.05'; -requires 'Scalar::Util' => '1.18'; -requires 'Sub::Name' => '0.04'; +requires 'List::MoreUtils' => '0.12'; +requires 'MRO::Compat' => '0.05'; +requires 'Package::DeprecationManager' => '0.10'; +requires 'Package::Stash' => '0.15'; +requires 'Package::Stash::XS' => '0.17'; +requires 'Scalar::Util' => '1.18'; +requires 'Sub::Name' => '0.05'; +requires 'Try::Tiny' => '0.02'; requires 'Task::Weaken'; test_requires 'File::Spec'; -test_requires 'Test::More' => '0.77'; -test_requires 'Test::Exception' => '0.21'; +test_requires 'Test::More' => '0.88'; +test_requires 'Test::Fatal' => '0.001'; +test_requires 'Test::Requires' => '0.05'; + +author_requires 'Algorithm::C3'; +author_requires 'Module::Info'; +author_requires 'Test::LeakTrace'; +author_requires 'Test::NoTabs'; +author_requires 'Test::Output'; +author_requires 'Test::Spelling'; + +repository 'git://git.moose.perl.org/Class-MOP.git'; +add_metadata(x_authority => 'cpan:STEVAN'); + +extra_tests(); makemaker_args( CCFLAGS => $ccflags ); +{ + my (@clean, @OBJECT, %XS); + + for my $xs () { + (my $c = $xs) =~ s/\.xs$/.c/i; + (my $o = $xs) =~ s/\.xs$/\$(OBJ_EXT)/i; + + $XS{$xs} = $c; + push @OBJECT, $o; + push @clean, $o; + } + + for my $c (<*.c>) { + (my $o = $c) =~ s/\.c$/\$(OBJ_EXT)/i; + push @OBJECT, $o; + push @clean, $o; + } + + makemaker_args( + clean => { FILES => join(q{ }, @clean) }, + OBJECT => join (q{ }, @OBJECT), + XS => \%XS, + ); +} + +postamble(<<'EOM'); +$(OBJECT) : mop.h +EOM + WriteAll(); # Use the cpan-smolder-stable script in the Moose svn root to figure @@ -33,7 +87,8 @@ WriteAll(); # before a release. sub check_conflicts { my %conflicts = ( - 'Moose' => '0.71', + 'Moose' => '1.14', + 'namespace::autoclean' => '0.08', ); my $found = 0; @@ -63,8 +118,27 @@ EOF return unless $found; # More or less copied from Module::Build - return if $ENV{PERL_MM_USE_DEFAULT}; - return unless -t STDIN && (-t STDOUT || !(-f STDOUT || -c STDOUT)); + return if $ENV{PERL_MM_USE_DEFAULT}; + return unless -t STDIN && ( -t STDOUT || !( -f STDOUT || -c STDOUT ) ); sleep 4; } + +package MY; + +use Config; + +sub const_cccmd { + my $ret = shift->SUPER::const_cccmd(@_); + return q{} unless $ret; + + if ($Config{cc} =~ /^cl\b/i) { + warn 'you are using MSVC... my condolences.'; + $ret .= ' /Fo$@'; + } + else { + $ret .= ' -o $@'; + } + + return $ret; +}