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