5 use inc::Module::Install 1.06;
6 BEGIN { makemaker_args( NORECURS => 1 ) } # needs to happen early for old EUMM
9 ## TEMPORARY (and non-portable)
14 $target_libdir = 'lib/DBIx/Class/_TempExtlib';
16 if ($Module::Install::AUTHOR) {
18 `rm -rf $target_libdir`;
19 `mkdir $target_libdir`;
21 [ 'Data-Query' => 'master' ],
22 [ 'SQL-Abstract' => 'dq' ],
24 my $tdir = "/tmp/dqlib/$_->[0]/";
28 `GIT_SSH=maint/careless_ssh.bash git clone --bare --quiet --branch=$_->[1] --depth=1 git://git.shadowcat.co.uk/dbsrgits/$_->[0] $tdir`;
29 printf "\nIncluding %s git rev %s\n",
31 scalar `GIT_DIR=$tdir git rev-parse $_->[1]`,
33 `git archive --format=tar --remote=file://$tdir $_->[1] lib/ | tar --strip-components=1 -xC $target_libdir`;
40 use lib $target_libdir;
43 ## DO NOT USE THIS HACK IN YOUR DISTS!!! (it makes #toolchain sad)
45 # get cpanX --installdeps . to behave in a checkout (most users do not expect
46 # the deps for a full test suite run, and if they do - there's MI::AutoInstall
49 $Module::Install::AUTHOR = 0 if (grep { $ENV{"PERL5_${_}_IS_RUNNING"} } (qw/CPANM CPANPLUS CPAN/) );
52 homepage 'http://www.dbix-class.org/';
53 resources 'IRC' => 'irc://irc.perl.org/#dbix-class';
54 resources 'license' => 'http://dev.perl.org/licenses/';
55 resources 'repository' => 'https://github.com/dbsrgits/DBIx-Class';
56 resources 'MailingList' => 'http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class';
57 resources 'bugtracker' => 'http://rt.cpan.org/NoAuth/Bugs.html?Dist=DBIx-Class';
60 perl_version '5.008001';
61 all_from 'lib/DBIx/Class.pm';
62 Meta->{values}{x_authority} = 'cpan:RIBASUSHI';
64 # nothing determined at runtime, except for possibly SQLT dep, see
65 # comment further down
77 ### DO NOT ADD OPTIONAL DEPENDENCIES HERE, EVEN AS recommends()
78 ### All of them *MUST* go to DBIx::Class::Optional::Dependencies
80 my $runtime_requires = {
81 # FIXME - temporary, needs throwing out for something more efficient
82 'Data::Compare' => '1.22',
84 # DBI itself should be capable of installation and execution in pure-perl
85 # mode. However it has never been tested yet, so consider XS for the time
88 ### IMPORTANT - do not raise this dependency
89 ### even though many bugfixes are present in newer versions, the general DBIC
90 ### rule is to bend over backwards for available DBI versions (given upgrading
91 ### them is often *not* easy or even possible)
95 # on older versions first() leaks
96 # for the time being make it a hard dep - when we get
97 # rid of Sub::Name will revisit this (possibility is
98 # to use Devel::HideXS to force the pure-perl version
99 # or something like that)
100 'List::Util' => '1.16',
102 # XS (or XS-dependent) libs
103 'Sub::Name' => '0.04',
105 # pure-perl (FatPack-able) libs
106 'Class::Accessor::Grouped' => '0.10010',
107 'Class::C3::Componentised' => '1.0009',
108 'Class::Inspector' => '1.24',
109 'Config::Any' => '0.20',
110 'Context::Preserve' => '0.01',
111 'Data::Dumper::Concise' => '2.020',
112 'Data::Page' => '2.00',
113 'Devel::GlobalDestruction' => '0.09',
114 'Hash::Merge' => '0.12',
116 'MRO::Compat' => '0.12',
117 'Module::Find' => '0.07',
118 'namespace::clean' => '0.24',
119 'Path::Class' => '0.18',
120 'Scope::Guard' => '0.03',
121 'SQL::Abstract' => '1.77',
122 'Try::Tiny' => '0.07',
124 # Technically this is not a core dependency - it is only required
125 # by the MySQL codepath. However this particular version is bundled
126 # since 5.10.0 and is a pure-perl module anyway - let it slide
127 'Text::Balanced' => '2.00',
129 # deps for Data::Query
130 'SQL::ReservedWords' => '0.8',
131 'Safe::Isa' => '1.000003',
134 my $build_requires = {
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',
144 # needed for testing only, not for operation
145 # we will move away from this dep eventually, perhaps to DBD::CSV or something
147 ### IMPORTANT - do not raise this dependency
148 ### even though many bugfixes are present in newer versions, the general DBIC
149 ### rule is to bend over backwards for available DBDs (given upgrading them is
150 ### often *not* easy or even possible)
152 'DBD::SQLite' => '1.29',
154 # this is already a dep of n::c, but just in case - used by t/55namespaces_cleaned.t
155 # remove and do a manual glob-collection if n::c is no longer a dep
156 'Package::Stash' => '0.28',
159 # if the user has this env var set and no SQLT installed, tests will fail
160 # Note - this is added as test_requires *directly*, so it gets properly
161 # excluded on META.yml cleansing (even though no dist can be created from this)
162 # we force this req regarless of author_deps, worst case scenario it will
165 # also note that we *do* set dynamic_config => 0, as this is the only thing
166 # that we determine dynamically, and in all fairness if someone sets the
167 # envvar *and* is not running a full Makefile/make/maketest cycle - they get
169 if ($ENV{DBICTEST_SQLT_DEPLOY}) {
170 local @INC = ('lib', @INC);
171 require DBIx::Class::Optional::Dependencies;
172 my $dep_req = DBIx::Class::Optional::Dependencies->req_list_for('deploy');
173 for (keys %$dep_req) {
174 test_requires ($_ => $dep_req->{$_})
178 # this is so we can order requires alphabetically
179 # copies are needed for potential author requires injection
181 build_requires => { %$build_requires },
182 requires => { %$runtime_requires },
183 test_requires => { %$test_requires },
186 # only do author-includes if not part of a `make` run
187 if ($Module::Install::AUTHOR and ! $ENV{MAKELEVEL}) {
191 # make sure this Makefile can not be used to make a dist
192 # (without the author includes there are no meta cleanup, no sanity checks, etc)
194 create_distdir: nonauthor_stop_distdir_creation
195 nonauthor_stop_distdir_creation:
196 \t\$(NOECHO) \$(ECHO) Creation of dists in non-author mode is not allowed
197 \t\$(NOECHO) \$(FALSE)
201 # compose final req list, for alphabetical ordering
203 for my $rtype (keys %$reqs) {
204 for my $mod (keys %{$reqs->{$rtype}} ) {
206 # sanity check req duplications
207 die "$mod specified as both a '$rtype' and a '$final_req{$mod}[0]'\n"
210 $final_req{$mod} = [ $rtype, $reqs->{$rtype}{$mod}||0 ],
215 for my $mod (sort keys %final_req) {
216 my ($rtype, $ver) = @{$final_req{$mod}};
218 $rtype->($mod, $ver);
221 # author-mode or not - this is where we show a list of missing deps
222 # IFF we are running interactively
229 # needs to be here to keep 5.8 string eval happy
230 # (the include of Makefile.PL.inc loop)
233 sub invoke_author_mode {
234 # get options here, make $args available to all snippets
235 require Getopt::Long;
236 my $getopt = Getopt::Long::Parser->new(
237 config => [qw/gnu_getopt bundling_override no_ignore_case pass_through/]
240 skip_author_deps => undef,
242 $getopt->getoptions($args, qw/
243 skip_author_deps|skip-author-deps
246 warn "\nIgnoring unrecognized option(s): @ARGV\n\n";
249 # We need the MM facilities to generate the pieces for the final MM run.
250 # Just instantiate a throaway object here
252 # Also EUMM and MI disagree on what is the format of Meta->name, just
253 # punt here until a new M::I is shipped (if at all)
254 my $name = Meta->name || die 'The Module::Install metadata must be available at this point but is not - did you rearrange the Makefile.PL...?';
256 $mm_proto = ExtUtils::MakeMaker->new({
261 # Crutch for DISTBUILDING_IN_HELL
262 # Spits back a working dos2unix snippet to be used on the supplied path(s)
263 # Ironically EUMM's dos2unix is broken on win32 itself - it does
264 # not take into account the CRLF layer present on win32
265 my $crlf_fixup = sub {
266 return '' unless ($^O eq 'MSWin32' or $^O eq 'cygwin');
267 my $targets = join ', ', map { "q($_)" } @_;
268 "\t" . $mm_proto->oneliner( qq(\$ENV{PERLIO}='unix' and system( \$^X, qw( -MExtUtils::Command -e dos2unix -- ), $targets ) ) );
271 # we are in the process of (re)writing the makefile - some things we
272 # call below very well may fail
273 local $ENV{DBICTEST_NO_MAKEFILE_VERIFICATION} = 1;
276 # string-eval, not do(), because we need to provide the
277 # $mm_proto, $reqs and $*_requires lexicals to the included file
278 # (some includes *do* modify $reqs above)
279 for my $inc (sort glob ( File::Spec->catfile('maint', 'Makefile.PL.inc', '*') ) ) {
280 my $src = do { local (@ARGV, $/) = $inc; <> } or die $!;
281 eval "use warnings; use strict; $src" or die sprintf
282 "Failed execution of %s: %s\n",
284 ($@ || $! || 'Unknown error'),