remove dead code from _extract_order_criteria
[dbsrgits/DBIx-Class.git] / Makefile.PL
CommitLineData
fe650234 1use strict;
2use warnings;
3
55087b99 4use 5.008001;
6c96d73f 5use inc::Module::Install 1.06;
ce4c07df 6
d1dc7a98 7##
c5ffac15 8## TEMPORARY (and non-portable)
9## Get the dq stuff
10##
11`rm -rf t/dqlib`;
12`mkdir t/dqlib`;
13for (
14 [ 'Data-Query' => 'master' ],
15 [ 'SQL-Abstract' => 'dq' ],
16) {
17 my $tdir = '/tmp/dqlib_tmp_clone';
18
19 `rm -rf $tdir`;
20
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",
23 $_->[0],
24 scalar `GIT_DIR=$tdir/.git git rev-parse origin/$_->[1]`,
25 ;
26 `git archive --format=tar --remote=file://$tdir origin/$_->[1] lib/ | tar --strip-components=1 -xC t/dqlib`;
27
28 `rm -rf $tdir`;
29}
30`cpanm SQL::ReservedWords 2>&1`;
31use lib 't/dqlib';
32
33
34##
d1dc7a98 35## DO NOT USE THIS HACK IN YOUR DISTS!!! (it makes #toolchain sad)
36##
fc4b0448 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
39# for that)
40BEGIN {
41 $Module::Install::AUTHOR = 0 if (grep { $ENV{"PERL5_${_}_IS_RUNNING"} } (qw/CPANM CPANPLUS CPAN/) );
3054407e 42 makemaker_args( NORECURS => 1 );
fc4b0448 43}
4b5544ad 44
47589465 45homepage 'http://www.dbix-class.org/';
46resources 'IRC' => 'irc://irc.perl.org/#dbix-class';
47resources 'license' => 'http://dev.perl.org/licenses/';
48resources 'repository' => 'https://github.com/dbsrgits/DBIx-Class';
49resources 'MailingList' => 'http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class';
50resources 'bugtracker' => 'http://rt.cpan.org/NoAuth/Bugs.html?Dist=DBIx-Class';
51
ce4c07df 52name 'DBIx-Class';
b50d0dd3 53perl_version '5.008001';
8e0f16f1 54all_from 'lib/DBIx/Class.pm';
294c1f51 55Meta->{values}{x_authority} = 'cpan:RIBASUSHI';
ce4c07df 56
fc4b0448 57tests_recursive (qw|
58 t
59|);
8057ed01 60
fc4b0448 61install_script (qw|
62 script/dbicadmin
63|);
90cfe42b 64
fc4b0448 65###
66### DO NOT ADD OPTIONAL DEPENDENCIES HERE, EVEN AS recommends()
67### All of them *MUST* go to DBIx::Class::Optional::Dependencies
68###
8057ed01 69my $runtime_requires = {
fc4b0448 70 # FIXME - temporary, needs throwing out for something more efficient
71 'Data::Compare' => '1.22',
72
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
75 # being
76 'DBI' => '1.57',
77
a08e7b00 78 # on older versions first() leaks
79 # for the time being make it a hard dep - when we get
80 # rid of Sub::Name will revisit this (possibility is
81 # to use Devel::HideXS to force the pure-perl version
82 # or something like that)
83 'List::Util' => '1.16',
84
fc4b0448 85 # XS (or XS-dependent) libs
86 'Sub::Name' => '0.04',
87
88 # pure-perl (FatPack-able) libs
f390d66d 89 'Class::Accessor::Grouped' => '0.10010',
9c1700e3 90 'Class::C3::Componentised' => '1.0009',
8057ed01 91 'Class::Inspector' => '1.24',
79680fc0 92 'Config::Any' => '0.20',
93 'Context::Preserve' => '0.01',
2b8cc2f2 94 'Data::Dumper::Concise' => '2.020',
8057ed01 95 'Data::Page' => '2.00',
90fb8e19 96 'Devel::GlobalDestruction' => '0.09',
b8d22f13 97 'Hash::Merge' => '0.12',
dfd722ef 98 'Moo' => '1.000006',
90fb8e19 99 'MRO::Compat' => '0.12',
100 'Module::Find' => '0.07',
101 'namespace::clean' => '0.24',
f4d7449c 102 'Path::Class' => '0.18',
b7b18f32 103 'Scope::Guard' => '0.03',
6612e610 104 'SQL::Abstract' => '1.73',
90fb8e19 105 'Try::Tiny' => '0.07',
45150bc4 106
107 # Technically this is not a core dependency - it is only required
108 # by the MySQL codepath. However this particular version is bundled
109 # since 5.10.0 and is a pure-perl module anyway - let it slide
110 'Text::Balanced' => '2.00',
fc4b0448 111};
cd122820 112
fc4b0448 113my $build_requires = {
114 # needed for testing only, not for operation
115 # we will move away from this dep eventually, perhaps to DBD::CSV or something
116 'DBD::SQLite' => '1.29',
8057ed01 117};
118
fc4b0448 119my $test_requires = {
120 'File::Temp' => '0.22',
52864fbd 121 'Test::Deep' => '0.101',
fc4b0448 122 'Test::Exception' => '0.31',
123 'Test::Warn' => '0.21',
124 'Test::More' => '0.94',
125 # not sure if this is necessary at all, ask schwern some day
126 'Test::Builder' => '0.94',
127
128 # this is already a dep of n::c, but just in case - used by t/55namespaces_cleaned.t
129 # remove and do a manual glob-collection if n::c is no longer a dep
130 'Package::Stash' => '0.28',
131};
bb7950c0 132
20beaf5f 133# if the user has this env var set and no SQLT installed, tests will fail
134# same rationale for direct test_requires as the strictures stuff above
135# (even though no dist will be created from this)
136# we force this req regarless of author_deps, worst case scenario it will
137# be specified twice
138if ($ENV{DBICTEST_SQLT_DEPLOY}) {
139 local @INC = ('lib', @INC);
140 require DBIx::Class::Optional::Dependencies;
141 my $dep_req = DBIx::Class::Optional::Dependencies->req_list_for('deploy');
142 for (keys %$dep_req) {
143 test_requires ($_ => $dep_req->{$_})
144 }
145}
146
8057ed01 147# this is so we can order requires alphabetically
fc4b0448 148# copies are needed for potential author requires injection
8057ed01 149my $reqs = {
150 build_requires => { %$build_requires },
151 requires => { %$runtime_requires },
152 test_requires => { %$test_requires },
153};
3a4251e2 154
c78f9f5b 155# only do author-includes if not part of a `make` run
156if ($Module::Install::AUTHOR and ! $ENV{MAKELEVEL}) {
fc4b0448 157 # get options here, make $args available to all snippets
158 require Getopt::Long;
159 my $getopt = Getopt::Long::Parser->new(
160 config => [qw/gnu_getopt bundling_override no_ignore_case pass_through/]
161 );
162 my $args = {
163 skip_author_deps => undef,
164 };
df65d4da 165 $getopt->getoptions($args, qw/
166 skip_author_deps|skip-author-deps
167 /);
fc4b0448 168 if (@ARGV) {
169 warn "\nIgnoring unrecognized option(s): @ARGV\n\n";
0424d17a 170 }
8057ed01 171
3ba58fe4 172 # We need the MM facilities to generate the pieces for the final MM run.
173 # Just instantiate a throaway object here
174 my $mm_proto = ExtUtils::MakeMaker->new({
3054407e 175 NORECURS => 1,
3ba58fe4 176 NAME => Meta->name || die 'The Module::Install metadata must be available at this point but is not - did you rearrange the Makefile.PL...?',
177 });
178
ffce4b65 179 # Crutch for DISTBUILDING_IN_HELL
180 # Spits back a working dos2unix snippet to be used on the supplied path(s)
181 # Ironically EUMM's dos2unix is broken on win32 itself - it does
182 # not take into account the CRLF layer present on win32
183 my $crlf_fixup = sub {
184 return '' unless ($^O eq 'MSWin32' or $^O eq 'cygwin');
185 my $targets = join ', ', map { "q($_)" } @_;
186 "\t" . $mm_proto->oneliner( qq(\$ENV{PERLIO}='unix' and system( \$^X, qw( -MExtUtils::Command -e dos2unix -- ), $targets ) ) );
187 };
188
e01862e4 189 # we are in the process of (re)writing the makefile - some things we
190 # call below very well may fail
191 local $ENV{DBICTEST_NO_MAKEFILE_VERIFICATION} = 1;
192
fc4b0448 193 require File::Spec;
194 # string-eval, not do(), because we need to provide the
3ba58fe4 195 # $mm_proto, $reqs and $*_requires lexicals to the included file
fc4b0448 196 # (some includes *do* modify $reqs above)
8baa2122 197 for my $inc (sort glob ( File::Spec->catfile('maint', 'Makefile.PL.inc', '*') ) ) {
198 my $src = do { local (@ARGV, $/) = $inc; <> } or die $!;
199 eval "use warnings; use strict; $src" or die sprintf
200 "Failed execution of %s: %s\n",
201 $inc,
202 ($@ || $! || 'Unknown error'),
203 ;
0424d17a 204 }
8057ed01 205}
fc4b0448 206else {
207 # make sure this Makefile can not be used to make a dist
0e016219 208 # (without the author includes there are no meta cleanup, no sanity checks, etc)
fc4b0448 209 postamble <<EOP;
fc4b0448 210create_distdir: nonauthor_stop_distdir_creation
211nonauthor_stop_distdir_creation:
212\t\$(NOECHO) \$(ECHO) Creation of dists in non-author mode is not allowed
213\t\$(NOECHO) \$(FALSE)
214EOP
215}
8057ed01 216
217# compose final req list, for alphabetical ordering
218my %final_req;
219for my $rtype (keys %$reqs) {
220 for my $mod (keys %{$reqs->{$rtype}} ) {
221
222 # sanity check req duplications
223 if ($final_req{$mod}) {
b718fd0a 224 die "$mod specified as both a '$rtype' and a '$final_req{$mod}[0]'\n";
8057ed01 225 }
226
227 $final_req{$mod} = [ $rtype, $reqs->{$rtype}{$mod}||0 ],
228 }
229}
230
231# actual require
232for my $mod (sort keys %final_req) {
233 my ($rtype, $ver) = @{$final_req{$mod}};
234 no strict 'refs';
235 $rtype->($mod, $ver);
236}
a410299d 237
fc4b0448 238# author-mode or not - this is where we show a list of missing deps
239# IFF we are running interactively
92f8f62a 240auto_install();
a410299d 241
713cc98e 242WriteAll();