X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=Makefile.PL;h=c6057cd114c2b8b28e20d39d1de0c76dd5408bf2;hb=8b280eeeb8816bdd5377efe9beec81312bd9b2e5;hp=e0d90c42d848113c43c48880bafc44023fd58479;hpb=4c4c6184f04bd8a38aa4396e054be1a6379fc936;p=dbsrgits%2FDBIx-Class.git diff --git a/Makefile.PL b/Makefile.PL index e0d90c4..c6057cd 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -1,132 +1,181 @@ -use inc::Module::Install 0.89; use strict; use warnings; -use POSIX (); -use 5.006001; # delete this line if you want to send patches for earlier. +use 5.008001; +use inc::Module::Install 1.00; + +## +## DO NOT USE THIS HACK IN YOUR DISTS!!! (it makes #toolchain sad) +## +# get cpanX --installdeps . to behave in a checkout (most users do not expect +# the deps for a full test suite run, and if they do - there's MI::AutoInstall +# for that) +BEGIN { + $Module::Install::AUTHOR = 0 if (grep { $ENV{"PERL5_${_}_IS_RUNNING"} } (qw/CPANM CPANPLUS CPAN/) ); +} name 'DBIx-Class'; -perl_version '5.006001'; +perl_version '5.008001'; all_from 'lib/DBIx/Class.pm'; -requires 'DBD::SQLite' => 1.25; -requires 'Data::Page' => 2.00; -requires 'SQL::Abstract' => 1.56; -requires 'SQL::Abstract::Limit' => 0.13; -requires 'Class::C3::Componentised' => 1.0005; -requires 'Carp::Clan' => 6.0; -requires 'DBI' => 1.605; -requires 'Module::Find' => 0.06; -requires 'Class::Inspector' => 1.24; -requires 'Class::Accessor::Grouped' => 0.08003; -requires 'JSON::Any' => 1.18; -requires 'Scope::Guard' => 0.03; -requires 'Path::Class' => 0.16; -requires 'Sub::Name' => 0.04; -requires 'MRO::Compat' => 0.09; - -# Core -requires 'List::Util' => 0; -requires 'Scalar::Util' => 0; -requires 'Storable' => 0; - -# Perl 5.8.0 doesn't have utf8::is_utf8() -requires 'Encode' => 0 if ($] <= 5.008000); - -test_requires 'Test::More' => 0.82; -test_requires 'Test::Builder' => 0.33; -test_requires 'Test::Warn' => 0.11; -test_requires 'Test::Exception' => 0; -test_requires 'Test::Deep' => 0; - -recommends 'SQL::Translator' => 0.09004; +tests_recursive (qw| + t +|); install_script (qw| script/dbicadmin |); -tests_recursive (qw| - t -|); - +homepage 'http://www.dbix-class.org/'; resources 'IRC' => 'irc://irc.perl.org/#dbix-class'; resources 'license' => 'http://dev.perl.org/licenses/'; -resources 'repository' => 'http://dev.catalyst.perl.org/svnweb/bast/browse/DBIx-Class/'; +resources 'repository' => 'git://git.shadowcat.co.uk/dbsrgits/DBIx-Class.git'; resources 'MailingList' => 'http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class'; +resources 'bugtracker' => 'http://rt.cpan.org/NoAuth/Bugs.html?Dist=DBIx-Class'; + +### +### DO NOT ADD OPTIONAL DEPENDENCIES HERE, EVEN AS recommends() +### All of them *MUST* go to DBIx::Class::Optional::Dependencies +### +my $runtime_requires = { + # FIXME - temporary, needs throwing out for something more efficient + 'Data::Compare' => '1.22', + + # DBI itself should be capable of installation and execution in pure-perl + # mode. However it has never been tested yet, so consider XS for the time + # being + 'DBI' => '1.57', + + # XS (or XS-dependent) libs + 'Sub::Name' => '0.04', + + # pure-perl (FatPack-able) libs + 'Class::Accessor::Grouped' => '0.10002', + 'Class::C3::Componentised' => '1.0009', + 'Class::Inspector' => '1.24', + 'Config::Any' => '0.20', + 'Context::Preserve' => '0.01', + 'Data::Dumper::Concise' => '2.020', + 'Data::Page' => '2.00', + 'Hash::Merge' => '0.12', + 'MRO::Compat' => '0.09', + 'Module::Find' => '0.06', + 'namespace::clean' => '0.20', + 'Path::Class' => '0.18', + 'Scope::Guard' => '0.03', + 'SQL::Abstract' => '1.72', + 'Try::Tiny' => '0.04', + + # dual-life corelibs needing a specific bugfixed version + 'File::Path' => '2.07', +}; + +my $build_requires = { + # needed for testing only, not for operation + # we will move away from this dep eventually, perhaps to DBD::CSV or something + 'DBD::SQLite' => '1.29', +}; + +my $test_requires = { + 'File::Temp' => '0.22', + 'Test::Exception' => '0.31', + 'Test::Warn' => '0.21', + 'Test::More' => '0.94', + # not sure if this is necessary at all, ask schwern some day + 'Test::Builder' => '0.94', + + # this is already a dep of n::c, but just in case - used by t/55namespaces_cleaned.t + # remove and do a manual glob-collection if n::c is no longer a dep + 'Package::Stash' => '0.28', +}; + +# Bail out on parallel testing +if ( + ($ENV{HARNESS_OPTIONS}||'') =~ / (?: ^ | \: ) j(\d+) /x + and + $1 > 1 +) { die < 1.04, - 'SQL::Translator' => 0.09004, - - # CDBI-compat related - 'DBIx::ContextualFetch' => 0, - 'Class::DBI::Plugin::DeepAbstractSearch' => 0, - 'Class::Trigger' => 0, - 'Time::Piece::MySQL' => 0, - 'Clone' => 0, - 'Date::Simple' => 0, - - # t/52cycle.t - 'Test::Memory::Cycle' => 0, - - # t/60core.t - 'DateTime::Format::MySQL' => 0, - - # t/89inflate_datetime.t - 'DateTime::Format::Pg' => 0, - - # t/72pg.t - $ENV{DBICTEST_PG_DSN} - ? ('Sys::SigAction'=> 0) - : () - , - - # t/93storage_replication.t - 'Moose', => 0.77, - 'MooseX::AttributeHelpers' => 0.12, - 'MooseX::Types', => 0.10, - 'namespace::clean' => 0.11, - 'Hash::Merge', => 0.11, - - # t/96_is_deteministic_value.t - 'DateTime::Format::Strptime' => 0, -); - -if ($Module::Install::AUTHOR) { - warn <<'EOW'; ****************************************************************************** ****************************************************************************** *** *** -*** AUTHOR MODE: all optional test dependencies converted to hard requires *** +*** PARALLEL TESTING DETECTED ( \$ENV{HARNESS_OPTIONS} = 'j$1' ) *** +*** *** +*** DBIC tests WILL FAIL. It is harder to make them parallel-friendly than *** +*** it should be (though work is underway). In the meantime you will have *** +*** to adjust your environment and re-run the installation. Sorry! *** *** *** ****************************************************************************** ****************************************************************************** -EOW +EOP - foreach my $module (keys %force_requires_if_author) { - build_requires ($module => $force_requires_if_author{$module}); +# this is so we can order requires alphabetically +# copies are needed for potential author requires injection +my $reqs = { + build_requires => { %$build_requires }, + requires => { %$runtime_requires }, + test_requires => { %$test_requires }, +}; + +if ($Module::Install::AUTHOR) { + # get options here, make $args available to all snippets + require Getopt::Long; + my $getopt = Getopt::Long::Parser->new( + config => [qw/gnu_getopt bundling_override no_ignore_case pass_through/] + ); + my $args = { + skip_author_deps => undef, + }; + $getopt->getoptions($args, 'skip_author_deps'); + if (@ARGV) { + warn "\nIgnoring unrecognized option(s): @ARGV\n\n"; } - system('pod2text lib/DBIx/Class.pm > README'); + require File::Spec; + # string-eval, not do(), because we need to provide the + # $reqs and $*_requires lexicals to the included file + # (some includes *do* modify $reqs above) + for (sort glob ( File::Spec->catfile('maint', 'Makefile.PL.inc', '*') ) ) { + eval scalar do { local (@ARGV, $/) = $_; <> } + or die ($@ || $!); + } +} +else { + # make sure this Makefile can not be used to make a dist + # (without the author includes there are no meta cleanup, no sanity checks, etc) + postamble <{$rtype}} ) { -auto_install; + # sanity check req duplications + if ($final_req{$mod}) { + die "$mod specified as both a '$rtype' and a '$final_req{$mod}[0]'\n"; + } -WriteAll(); + $final_req{$mod} = [ $rtype, $reqs->{$rtype}{$mod}||0 ], + } +} -# Re-write META.yml to _exclude_ all forced requires (we do not want to ship this) -if ($Module::Install::AUTHOR) { +# actual require +for my $mod (sort keys %final_req) { + my ($rtype, $ver) = @{$final_req{$mod}}; + no strict 'refs'; + $rtype->($mod, $ver); +} - Meta->{values}{build_requires} = [ grep - { not exists $force_requires_if_author{$_->[0]} } - ( @{Meta->{values}{build_requires}} ) - ]; +# author-mode or not - this is where we show a list of missing deps +# IFF we are running interactively +auto_install(); - Meta->write; -} +WriteAll();