X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=Makefile.PL;h=c6057cd114c2b8b28e20d39d1de0c76dd5408bf2;hb=8b280eeeb8816bdd5377efe9beec81312bd9b2e5;hp=f96742bb0d8a0dff2702d862d8184cc2694d5a8f;hpb=55087b9990ac4c004f1e6b9742f73d89274cf7f2;p=dbsrgits%2FDBIx-Class.git diff --git a/Makefile.PL b/Makefile.PL index f96742b..c6057cd 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -1,194 +1,181 @@ -use inc::Module::Install 0.89; use strict; use warnings; -use POSIX (); use 5.008001; - -# ****** DO NOT ADD OPTIONAL DEPENDENCIES. EVER. --mst ****** +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.008001'; all_from 'lib/DBIx/Class.pm'; - -test_requires 'Test::Builder' => '0.33'; -test_requires 'Test::Deep' => '0'; -test_requires 'Test::Exception' => '0'; -test_requires 'Test::More' => '0.92'; -test_requires 'Test::Warn' => '0.21'; - -test_requires 'File::Temp' => '0.22'; - - -# Core -requires 'List::Util' => '0'; -requires 'Scalar::Util' => '0'; -requires 'Storable' => '0'; - -# Dependencies (keep in alphabetical order) -requires 'Carp::Clan' => '6.0'; -requires 'Class::Accessor::Grouped' => '0.09002'; -requires 'Class::C3::Componentised' => '1.0005'; -requires 'Class::Inspector' => '1.24'; -requires 'Data::Page' => '2.00'; -requires 'DBD::SQLite' => '1.25'; -requires 'DBI' => '1.609'; -requires 'JSON::Any' => '1.18'; -requires 'MRO::Compat' => '0.09'; -requires 'Module::Find' => '0.06'; -requires 'Path::Class' => '0.16'; -requires 'Scope::Guard' => '0.03'; -requires 'SQL::Abstract' => '1.60'; -requires 'SQL::Abstract::Limit' => '0.13'; -requires 'Sub::Name' => '0.04'; -requires 'Data::Dumper::Concise' => '1.000'; - -my %replication_requires = ( - 'Moose', => '0.90', - 'MooseX::Types', => '0.16', - 'namespace::clean' => '0.11', - 'Hash::Merge', => '0.11', -); - -#************************************************************************# -# Make *ABSOLUTELY SURE* that nothing on this list is a real require, # -# since every module listed in %force_requires_if_author is deleted # -# from the final META.yml (thus will never make it as a CPAN dependency) # -#************************************************************************# -my %force_requires_if_author = ( - %replication_requires, - - # when changing also adjust $DBIx::Class::Storage::DBI::minimum_sqlt_version - 'SQL::Translator' => '0.11002', - -# 'Module::Install::Pod::Inherit' => '0.01', - - # when changing also adjust version in t/02pod.t - 'Test::Pod' => '1.26', - - # when changing also adjust version in t/03podcoverage.t - 'Test::Pod::Coverage' => '1.08', - 'Pod::Coverage' => '0.20', - - # CDBI-compat related - 'DBIx::ContextualFetch' => '0', - 'Class::DBI::Plugin::DeepAbstractSearch' => '0', - 'Class::Trigger' => '0', - 'Time::Piece::MySQL' => '0', - 'Clone' => '0', - 'Date::Simple' => '3.03', - - # t/52cycle.t - 'Test::Memory::Cycle' => '0', - 'Devel::Cycle' => '1.10', - - # t/36datetime.t - # t/60core.t - 'DateTime::Format::SQLite' => '0', - - # t/96_is_deteministic_value.t - 'DateTime::Format::Strptime'=> '0', - - # database-dependent reqs - # - $ENV{DBICTEST_PG_DSN} - ? ( - 'Sys::SigAction' => '0', - 'DBD::Pg' => '2.009002', - 'DateTime::Format::Pg' => '0', - ) : () - , - - $ENV{DBICTEST_MYSQL_DSN} - ? ( - 'DateTime::Format::MySQL' => '0', - ) : () - , - - $ENV{DBICTEST_ORA_DSN} - ? ( - 'DateTime::Format::Oracle' => '0', - ) : () - , - - $ENV{DBICTEST_SYBASE_DSN} - ? ( - 'DateTime::Format::Sybase' => 0, - ) : () - , -); -#************************************************************************# -# Make ABSOLUTELY SURE that nothing on the list above is a real require, # -# since every module listed in %force_requires_if_author is deleted # -# from the final META.yml (thus will never make it as a CPAN dependency) # -#************************************************************************# - +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/repos/bast/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 < $_ for (qw| - lib/DBIx/Class/SQLAHacks - lib/DBIx/Class/PK/Auto -|); -no_index package => $_ for (qw/ - DBIx::Class::Storage::DBI::AmbiguousGlob - DBIx::Class::SQLAHacks DBIx::Class::Storage::DBIHacks -/); - -# re-build README and require extra modules for testing if we're in a checkout - -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 + +# 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 }, +}; - foreach my $module (sort keys %force_requires_if_author) { - build_requires ($module => $force_requires_if_author{$module}); +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"; } - print "Regenerating README\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}} ) { - if (-f 'MANIFEST') { - print "Removing MANIFEST\n"; - unlink 'MANIFEST'; + # sanity check req duplications + if ($final_req{$mod}) { + die "$mod specified as both a '$rtype' and a '$final_req{$mod}[0]'\n"; + } + + $final_req{$mod} = [ $rtype, $reqs->{$rtype}{$mod}||0 ], } +} -# require Module::Install::Pod::Inherit; -# PodInherit(); +# actual require +for my $mod (sort keys %final_req) { + my ($rtype, $ver) = @{$final_req{$mod}}; + no strict 'refs'; + $rtype->($mod, $ver); } +# author-mode or not - this is where we show a list of missing deps +# IFF we are running interactively auto_install(); WriteAll(); - -# Re-write META.yml to _exclude_ all forced requires (we do not want to ship this) -if ($Module::Install::AUTHOR) { - - Meta->{values}{build_requires} = [ grep - { not exists $force_requires_if_author{$_->[0]} } - ( @{Meta->{values}{build_requires}} ) - ]; - - Meta->write; -}