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 'Class::C3::Componentised' => 1.0004;
17 requires 'Storable' => 0;
18 requires 'Carp::Clan' => 0;
19 requires 'DBI' => 1.40;
20 requires 'Module::Find' => 0;
21 requires 'Class::Inspector' => 0;
22 requires 'Class::Accessor::Grouped' => 0.08003;
23 requires 'JSON::Any' => 1.17;
24 requires 'Scope::Guard' => 0.03;
25 requires 'Path::Class' => 0;
26 requires 'List::Util' => 1.19;
27 requires 'Sub::Name' => 0.04;
28 requires 'MRO::Compat' => 0.09;
30 # Perl 5.8.0 doesn't have utf8::is_utf8()
31 requires 'Encode' => 0 if ($] <= 5.008000);
33 # configure_requires so the sanity check below can run
34 configure_requires 'DBD::SQLite' => 1.21;
36 test_requires 'Test::Builder' => 0.33;
37 test_requires 'Test::Warn' => 0.11;
38 test_requires 'Test::Exception' => 0;
39 test_requires 'Test::Deep' => 0;
41 recommends 'SQL::Translator' => 0.09004;
43 install_script 'script/dbicadmin';
47 # re-build README and require extra modules for testing if we're in a checkout
49 my %force_requires_if_author = (
50 'Test::Pod::Coverage' => 1.04,
51 'SQL::Translator' => 0.09004,
54 'DBIx::ContextualFetch' => 0,
55 'Class::DBI::Plugin::DeepAbstractSearch' => 0,
56 'Class::Trigger' => 0,
61 'Test::Memory::Cycle' => 0,
64 'DateTime::Format::MySQL' => 0,
66 # t/93storage_replication.t
68 'MooseX::AttributeHelpers' => 0.12,
70 # t/96_is_deteministic_value.t
71 'DateTime::Format::Strptime' => 0,
74 if ($Module::Install::AUTHOR) {
76 foreach my $module (keys %force_requires_if_author) {
77 build_requires ($module => $force_requires_if_author{$module});
80 system('pod2text lib/DBIx/Class.pm > README');
85 if ($Module::Install::AUTHOR) {
87 ******************************************************************************
88 ******************************************************************************
90 *** AUTHOR MODE: all optional test dependencies converted to hard requires ***
92 ******************************************************************************
93 ******************************************************************************
99 # Have all prerequisites, check DBD::SQLite sanity
100 if (! $ENV{DBICTEST_NO_SQLITE_CHECK} ) {
103 if (not defined $pid) {
104 die "Unable to fork(): $!";
108 # Win32 does not have real fork()s so a segfault will bring
109 # everything down. Warn about it.
110 if ($^O eq 'MSWin32') {
113 ######################################################################
115 # A short stress-testing of DBD::SQLite will follow. If you have a #
116 # buggy library this might very well be the last text you will see #
117 # before the installation silently terminates. If this happens it #
118 # would mean that you are running a buggy version of DBD::SQLite #
119 # known to randomly segfault on errors. Even if you have the latest #
120 # CPAN module version, the system sqlite3 dynamic library might have #
121 # been compiled against an older buggy sqlite3 dev library (oddly #
122 # DBD::SQLite will prefer the system library against the one bundled #
123 # with it). You are strongly advised to resolve this issue before #
126 # If this happens to you (this text is the last thing you see), and #
127 # you just want to install this module without worrying about the #
128 # tests (which will almost certainly fail) - set the environment #
129 # variable DBICTEST_NO_SQLITE_CHECK to a true value and try again. #
131 ######################################################################
139 $dbh = DBI->connect ('dbi:SQLite::memory:', undef, undef, {
144 or die "Unable to connect to database: $@";
145 $dbh->do ('CREATE TABLE name_with_no_columns'); # a subtle syntax error
146 $dbh->do ('COMMIT'); # followed by commit
154 local $SIG{ALRM} = sub { die "timeout\n" };
163 # make sure process actually dies
164 $exception && kill POSIX::SIGKILL(), $pid;
166 if ($exception || $sig == POSIX::SIGSEGV() || $sig == POSIX::SIGABRT()
167 || $sig == 7) { # 7 == SIGBUS, haven't seen it but just in case
170 ############################### WARNING #################################
172 # You are running a buggy version of DBD::SQLite known to randomly #
173 # segfault on errors. Even if you have the latest CPAN module version, #
174 # the sqlite3 dynamic library on this system might have been compiled #
175 # against an older buggy sqlite3 dev library (oddly DBD::SQLite will #
176 # prefer the system library against the one bundled with it). You are #
177 # strongly advised to resolve this issue before proceeding. #
179 #########################################################################
183 "The test suite of this module is almost certain to fail.\n"
184 . 'Do you really want to continue?',
187 exit 0 unless ($ans =~ /^y(es)?$/i);
196 if ($Module::Install::AUTHOR) {
197 # Need to do this _after_ WriteAll else it loses track of them
198 Meta->{values}{build_requires} = [ grep {
200 foreach my $module (keys %force_requires_if_author) {
201 if ($_->[0] =~ /$module/) {
207 } @{Meta->{values}{build_requires}} ];
209 my @scalar_keys = Module::Install::Metadata::Meta_TupleKeys();
210 my $cr = Module::Install::Metadata->can("Meta_TupleKeys");
212 no warnings 'redefine';
213 *Module::Install::Metadata::Meta_TupleKeys = sub {
214 return $cr->(@_), 'resources';
217 Meta->{values}{resources} = [
218 [ 'MailingList', 'http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class' ],
219 [ 'IRC', 'irc://irc.perl.org/#dbix-class' ],
220 [ 'license', 'http://dev.perl.org/licenses/' ],
221 [ 'repository', 'http://dev.catalyst.perl.org/svnweb/bast/browse/DBIx-Class/' ],