5 use inc::Module::Install 1.06;
8 ## TEMPORARY (and non-portable)
14 [ 'Data-Query' => 'master' ],
15 [ 'SQL-Abstract' => 'dq' ],
17 my $tdir = '/tmp/dqlib_tmp_clone';
21 `GIT_SSH=maint/careless_ssh.bash git clone --quiet git://git.shadowcat.co.uk/dbsrgits/$_->[0] $tdir`;
22 printf "\nIncluding %s git rev %s\n",
24 scalar `GIT_DIR=$tdir/.git git rev-parse origin/$_->[1]`,
26 `git archive --format=tar --remote=file://$tdir origin/$_->[1] lib/ | tar --strip-components=1 -xC t/dqlib`;
30 `cpanm SQL::ReservedWords 2>&1`;
35 ## DO NOT USE THIS HACK IN YOUR DISTS!!! (it makes #toolchain sad)
37 # get cpanX --installdeps . to behave in a checkout (most users do not expect
38 # the deps for a full test suite run, and if they do - there's MI::AutoInstall
41 $Module::Install::AUTHOR = 0 if (grep { $ENV{"PERL5_${_}_IS_RUNNING"} } (qw/CPANM CPANPLUS CPAN/) );
42 makemaker_args( NORECURS => 1 );
45 homepage 'http://www.dbix-class.org/';
46 resources 'IRC' => 'irc://irc.perl.org/#dbix-class';
47 resources 'license' => 'http://dev.perl.org/licenses/';
48 resources 'repository' => 'https://github.com/dbsrgits/DBIx-Class';
49 resources 'MailingList' => 'http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class';
50 resources 'bugtracker' => 'http://rt.cpan.org/NoAuth/Bugs.html?Dist=DBIx-Class';
53 perl_version '5.008001';
54 all_from 'lib/DBIx/Class.pm';
55 Meta->{values}{x_authority} = 'cpan:RIBASUSHI';
66 ### DO NOT ADD OPTIONAL DEPENDENCIES HERE, EVEN AS recommends()
67 ### All of them *MUST* go to DBIx::Class::Optional::Dependencies
69 my $runtime_requires = {
70 # FIXME - temporary, needs throwing out for something more efficient
71 'Data::Compare' => '1.22',
73 # DBI itself should be capable of installation and execution in pure-perl
74 # mode. However it has never been tested yet, so consider XS for the time
77 ### IMPORTANT - do not raise this dependency
78 ### even though many bugfixes are present in newer versions, the general DBIC
79 ### rule is to bend over backwards for available DBI versions (given upgrading
80 ### them is often *not* easy or even possible)
84 # on older versions first() leaks
85 # for the time being make it a hard dep - when we get
86 # rid of Sub::Name will revisit this (possibility is
87 # to use Devel::HideXS to force the pure-perl version
88 # or something like that)
89 'List::Util' => '1.16',
91 # XS (or XS-dependent) libs
92 'Sub::Name' => '0.04',
94 # pure-perl (FatPack-able) libs
95 'Class::Accessor::Grouped' => '0.10010',
96 'Class::C3::Componentised' => '1.0009',
97 'Class::Inspector' => '1.24',
98 'Config::Any' => '0.20',
99 'Context::Preserve' => '0.01',
100 'Data::Dumper::Concise' => '2.020',
101 'Data::Page' => '2.00',
102 'Devel::GlobalDestruction' => '0.09',
103 'Hash::Merge' => '0.12',
105 'MRO::Compat' => '0.12',
106 'Module::Find' => '0.07',
107 'namespace::clean' => '0.24',
108 'Path::Class' => '0.18',
109 'Scope::Guard' => '0.03',
110 'SQL::Abstract' => '1.73',
111 'Try::Tiny' => '0.07',
113 # Technically this is not a core dependency - it is only required
114 # by the MySQL codepath. However this particular version is bundled
115 # since 5.10.0 and is a pure-perl module anyway - let it slide
116 'Text::Balanced' => '2.00',
119 my $build_requires = {
120 # needed for testing only, not for operation
121 # we will move away from this dep eventually, perhaps to DBD::CSV or something
123 ### IMPORTANT - do not raise this dependency
124 ### even though many bugfixes are present in newer versions, the general DBIC
125 ### rule is to bend over backwards for available DBDs (given upgrading them is
126 ### often *not* easy or even possible)
128 'DBD::SQLite' => '1.29',
131 my $test_requires = {
132 'File::Temp' => '0.22',
133 'Test::Deep' => '0.101',
134 'Test::Exception' => '0.31',
135 'Test::Warn' => '0.21',
136 'Test::More' => '0.94',
137 # not sure if this is necessary at all, ask schwern some day
138 'Test::Builder' => '0.94',
140 # this is already a dep of n::c, but just in case - used by t/55namespaces_cleaned.t
141 # remove and do a manual glob-collection if n::c is no longer a dep
142 'Package::Stash' => '0.28',
145 # if the user has this env var set and no SQLT installed, tests will fail
146 # same rationale for direct test_requires as the strictures stuff above
147 # (even though no dist will be created from this)
148 # we force this req regarless of author_deps, worst case scenario it will
150 if ($ENV{DBICTEST_SQLT_DEPLOY}) {
151 local @INC = ('lib', @INC);
152 require DBIx::Class::Optional::Dependencies;
153 my $dep_req = DBIx::Class::Optional::Dependencies->req_list_for('deploy');
154 for (keys %$dep_req) {
155 test_requires ($_ => $dep_req->{$_})
159 # this is so we can order requires alphabetically
160 # copies are needed for potential author requires injection
162 build_requires => { %$build_requires },
163 requires => { %$runtime_requires },
164 test_requires => { %$test_requires },
167 # only do author-includes if not part of a `make` run
168 if ($Module::Install::AUTHOR and ! $ENV{MAKELEVEL}) {
169 # get options here, make $args available to all snippets
170 require Getopt::Long;
171 my $getopt = Getopt::Long::Parser->new(
172 config => [qw/gnu_getopt bundling_override no_ignore_case pass_through/]
175 skip_author_deps => undef,
177 $getopt->getoptions($args, qw/
178 skip_author_deps|skip-author-deps
181 warn "\nIgnoring unrecognized option(s): @ARGV\n\n";
184 # We need the MM facilities to generate the pieces for the final MM run.
185 # Just instantiate a throaway object here
186 my $mm_proto = ExtUtils::MakeMaker->new({
188 NAME => Meta->name || die 'The Module::Install metadata must be available at this point but is not - did you rearrange the Makefile.PL...?',
191 # Crutch for DISTBUILDING_IN_HELL
192 # Spits back a working dos2unix snippet to be used on the supplied path(s)
193 # Ironically EUMM's dos2unix is broken on win32 itself - it does
194 # not take into account the CRLF layer present on win32
195 my $crlf_fixup = sub {
196 return '' unless ($^O eq 'MSWin32' or $^O eq 'cygwin');
197 my $targets = join ', ', map { "q($_)" } @_;
198 "\t" . $mm_proto->oneliner( qq(\$ENV{PERLIO}='unix' and system( \$^X, qw( -MExtUtils::Command -e dos2unix -- ), $targets ) ) );
201 # we are in the process of (re)writing the makefile - some things we
202 # call below very well may fail
203 local $ENV{DBICTEST_NO_MAKEFILE_VERIFICATION} = 1;
206 # string-eval, not do(), because we need to provide the
207 # $mm_proto, $reqs and $*_requires lexicals to the included file
208 # (some includes *do* modify $reqs above)
209 for my $inc (sort glob ( File::Spec->catfile('maint', 'Makefile.PL.inc', '*') ) ) {
210 my $src = do { local (@ARGV, $/) = $inc; <> } or die $!;
211 eval "use warnings; use strict; $src" or die sprintf
212 "Failed execution of %s: %s\n",
214 ($@ || $! || 'Unknown error'),
219 # make sure this Makefile can not be used to make a dist
220 # (without the author includes there are no meta cleanup, no sanity checks, etc)
222 create_distdir: nonauthor_stop_distdir_creation
223 nonauthor_stop_distdir_creation:
224 \t\$(NOECHO) \$(ECHO) Creation of dists in non-author mode is not allowed
225 \t\$(NOECHO) \$(FALSE)
229 # compose final req list, for alphabetical ordering
231 for my $rtype (keys %$reqs) {
232 for my $mod (keys %{$reqs->{$rtype}} ) {
234 # sanity check req duplications
235 if ($final_req{$mod}) {
236 die "$mod specified as both a '$rtype' and a '$final_req{$mod}[0]'\n";
239 $final_req{$mod} = [ $rtype, $reqs->{$rtype}{$mod}||0 ],
244 for my $mod (sort keys %final_req) {
245 my ($rtype, $ver) = @{$final_req{$mod}};
247 $rtype->($mod, $ver);
250 # author-mode or not - this is where we show a list of missing deps
251 # IFF we are running interactively