1 use inc::Module::Install 0.67;
6 use 5.006001; # delete this line if you want to send patches for earlier.
9 perl_version '5.006001';
10 all_from 'lib/DBIx/Class.pm';
12 requires 'Data::Page' => 2.00;
13 requires 'Scalar::Util' => 0;
14 requires 'SQL::Abstract' => 1.51;
15 requires 'SQL::Abstract::Limit' => 0.13;
16 requires 'MRO::Compat' => 0;
17 requires 'Class::C3::Componentised' => 1.0004;
18 requires 'Storable' => 0;
19 requires 'Carp::Clan' => 0;
20 requires 'DBI' => 1.40;
21 requires 'Module::Find' => 0;
22 requires 'Class::Inspector' => 0;
23 requires 'Class::Accessor::Grouped' => 0.08003;
24 requires 'JSON::Any' => 1.17;
25 requires 'Scope::Guard' => 0.03;
26 requires 'Path::Class' => 0;
27 requires 'List::Util' => 1.19;
28 requires 'Sub::Name' => 0.04;
29 requires 'MRO::Compat' => 0.09;
31 # Perl 5.8.0 doesn't have utf8::is_utf8()
32 requires 'Encode' => 0 if ($] <= 5.008000);
34 # configure_requires so the sanity check below can run
35 configure_requires 'DBD::SQLite' => 1.14;
37 test_requires 'Test::Builder' => 0.33;
38 test_requires 'Test::Warn' => 0.11;
39 test_requires 'Test::Exception' => 0;
40 test_requires 'Test::Deep' => 0;
42 recommends 'SQL::Translator' => 0.09004;
44 install_script 'script/dbicadmin';
48 # re-build README and require extra modules for testing if we're in a checkout
50 my %force_requires_if_author = (
51 'Test::Pod::Coverage' => 1.04,
52 'SQL::Translator' => 0.09004,
55 'DBIx::ContextualFetch' => 0,
56 'Class::DBI::Plugin::DeepAbstractSearch' => 0,
57 'Class::Trigger' => 0,
62 'Test::Memory::Cycle' => 0,
65 'DateTime::Format::MySQL' => 0,
67 # t/93storage_replication.t
69 'MooseX::AttributeHelpers' => 0.12,
71 # t/96_is_deteministic_value.t
72 'DateTime::Format::Strptime' => 0,
75 if ($Module::Install::AUTHOR) {
77 foreach my $module (keys %force_requires_if_author) {
78 requires ($module => $force_requires_if_author{$module});
81 system('pod2text lib/DBIx/Class.pm > README');
86 if ($Module::Install::AUTHOR) {
88 ******************************************************************************
89 ******************************************************************************
91 *** AUTHOR MODE: all optional test dependencies converted to hard requires ***
93 ******************************************************************************
94 ******************************************************************************
100 # Have all prerequisites, check DBD::SQLite sanity
101 if (! $ENV{DBICTEST_NO_SQLITE_CHECK} ) {
104 if (not defined $pid) {
105 die "Unable to fork(): $!";
109 # Win32 does not have real fork()s so a segfault will bring
110 # everything down. Warn about it.
111 if ($^O eq 'MSWin32') {
114 ######################################################################
116 # A short stress-testing of DBD::SQLite will follow. If you have a #
117 # buggy library this might very well be the last text you will see #
118 # before the installation silently terminates. If this happens it #
119 # would mean that you are running a buggy version of DBD::SQLite #
120 # known to randomly segfault on errors. Even if you have the latest #
121 # CPAN module version, the system sqlite3 dynamic library might have #
122 # been compiled against an older buggy sqlite3 dev library (oddly #
123 # DBD::SQLite will prefer the system library against the one bundled #
124 # with it). You are strongly advised to resolve this issue before #
127 # If this happens to you (this text is the last thing you see), and #
128 # you just want to install this module without worrying about the #
129 # tests (which will almost certainly fail) - set the environment #
130 # variable DBICTEST_NO_SQLITE_CHECK to a true value and try again. #
132 ######################################################################
140 $dbh = DBI->connect ('dbi:SQLite::memory:', undef, undef, {
145 or die "Unable to connect to database: $@";
146 $dbh->do ('CREATE TABLE name_with_no_columns'); # a subtle syntax error
147 $dbh->do ('COMMIT'); # followed by commit
155 local $SIG{ALRM} = sub { die "timeout\n" };
164 # make sure process actually dies
165 $exception && kill POSIX::SIGKILL(), $pid;
167 if ($exception || $sig == POSIX::SIGSEGV() || $sig == POSIX::SIGABRT()
168 || $sig == 7) { # 7 == SIGBUS, haven't seen it but just in case
171 ############################### WARNING #################################
173 # You are running a buggy version of DBD::SQLite known to randomly #
174 # segfault on errors. Even if you have the latest CPAN module version, #
175 # the sqlite3 dynamic library on this system might have been compiled #
176 # against an older buggy sqlite3 dev library (oddly DBD::SQLite will #
177 # prefer the system library against the one bundled with it). You are #
178 # strongly advised to resolve this issue before proceeding. #
180 #########################################################################
184 "The test suite of this module is almost certain to fail.\n"
185 . 'Do you really want to continue?',
188 exit 0 unless ($ans =~ /^y(es)?$/i);
197 if ($Module::Install::AUTHOR) {
198 # Need to do this _after_ WriteAll else it looses track of them
199 Meta->{values}{build_requires} = [ grep {
201 foreach my $module (keys %force_requires_if_author) {
202 if ($_->[0] =~ /$module/) {
208 } @{Meta->{values}{build_requires}} ];
210 my @scalar_keys = Module::Install::Metadata::Meta_TupleKeys();
211 my $cr = Module::Install::Metadata->can("Meta_TupleKeys");
213 no warnings 'redefine';
214 *Module::Install::Metadata::Meta_TupleKeys = sub {
215 return $cr->(@_), 'resources';
218 Meta->{values}{resources} = [
219 [ 'MailingList', 'http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class' ],
220 [ 'IRC', 'irc://irc.perl.org/#dbix-class' ],
221 [ 'license', 'http://dev.perl.org/licenses/' ],
222 [ 'repository', 'http://dev.catalyst.perl.org/svnweb/bast/browse/DBIx-Class/' ],