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