diff --git a/Makefile.PL b/Makefile.PL index 3860eda..aca8187 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -129,7 +129,7 @@ SCOPE: { # a system sqlite is also sophisticated enough to have a patching system # that can change the if ( 0 ) to if ( 1 ) my ($sqlite_local, $sqlite_base, $sqlite_lib, $sqlite_inc); -if ( 1 ) { +if ( 0 ) { require File::Spec; if ( $sqlite_base = (grep(/SQLITE_LOCATION=.*/, @ARGV))[0] ) { $sqlite_base =~ /=(.*)/; @@ -330,7 +330,8 @@ WriteMakefile( 'Tie::Hash' => 0, 'File::Spec' => (WINLIKE ? '3.27' : '0.82'), 'DBI' => $DBI_required, - 'Test::More' => 0, + 'Test::More' => '0.47', # Test::NoWarnings + 'Test::Builder' => '0.86', # Test::NoWarnings ( WINLIKE ? ( 'Win32' => '0.30', ) : () ), @@ -362,7 +363,8 @@ WriteMakefile( build_requires => { 'File::Spec' => (WINLIKE ? '3.27' : '0.82'), 'Test::More' => '0.42', - 'Test::NoWarnings' => '0.081', + # Bundled in /inc + # 'Test::NoWarnings' => '0.081', }, requires => { 'Tie::Hash' => 0, diff --git a/README b/README index f4d69b2..9047989 100644 --- a/README +++ b/README @@ -1222,6 +1222,36 @@ R* TREE SUPPORT using callbacks, as mentioned in the prior link, have not been implemented yet. +FOR DBD::SQLITE EXTENSION AUTHORS + Since 1.30_01, you can retrieve the bundled sqlite C source and/or + header like this: + + use File::ShareDir 'dist_dir'; + use File::Spec::Functions 'catfile'; + + # the whole sqlite3.h header + my $sqlite3_h = catfile(dist_dir('DBD-SQLite'), 'sqlite3.h'); + + # or only a particular header, amalgamated in sqlite3.c + my $what_i_want = 'parse.h'; + my $sqlite3_c = catfile(dist_dir('DBD-SQLite'), 'sqlite3.c'); + open my $fh, '<', $sqlite3_c or die $!; + my $code = do { local $/; <$fh> }; + my ($parse_h) = $code =~ m{( + /\*+[ ]Begin[ ]file[ ]$what_i_want[ ]\*+ + .+? + /\*+[ ]End[ ]of[ ]$what_i_want[ ]\*+/ + )}sx; + open my $out, '>', $what_i_want or die $!; + print $out $parse_h; + close $out; + + You usually want to use this in your extension's "Makefile.PL", and you + may want to add DBD::SQLite to your extension's "CONFIGURE_REQUIRES" to + ensure your extension users use the same C source/header they use to + build DBD::SQLite itself (instead of the ones installed in their + system). + TO DO The following items remain to be done. diff --git a/lib/DBD/SQLite.pm b/lib/DBD/SQLite.pm index b99cacf..a719c10 100644 --- a/lib/DBD/SQLite.pm +++ b/lib/DBD/SQLite.pm @@ -2499,6 +2499,37 @@ sources, etc. Other Perl virtual tables may also be published separately on CPAN. +=head1 FOR DBD::SQLITE EXTENSION AUTHORS + +Since 1.30_01, you can retrieve the bundled SQLite C source and/or +header like this: + + use File::ShareDir 'dist_dir'; + use File::Spec::Functions 'catfile'; + + # the whole sqlite3.h header + my $sqlite3_h = catfile(dist_dir('DBD-SQLite'), 'sqlite3.h'); + + # or only a particular header, amalgamated in sqlite3.c + my $what_i_want = 'parse.h'; + my $sqlite3_c = catfile(dist_dir('DBD-SQLite'), 'sqlite3.c'); + open my $fh, '<', $sqlite3_c or die $!; + my $code = do { local $/; <$fh> }; + my ($parse_h) = $code =~ m{( + /\*+[ ]Begin[ ]file[ ]$what_i_want[ ]\*+ + .+? + /\*+[ ]End[ ]of[ ]$what_i_want[ ]\*+/ + )}sx; + open my $out, '>', $what_i_want or die $!; + print $out $parse_h; + close $out; + +You usually want to use this in your extension's C, +and you may want to add DBD::SQLite to your extension's C +to ensure your extension users use the same C source/header they use +to build DBD::SQLite itself (instead of the ones installed in their +system). + =head1 TO DO The following items remain to be done. diff --git a/t/virtual_table/11_filecontent_fulltext.t b/t/virtual_table/11_filecontent_fulltext.t index 7e805f1..b95b115 100644 --- a/t/virtual_table/11_filecontent_fulltext.t +++ b/t/virtual_table/11_filecontent_fulltext.t @@ -27,7 +27,9 @@ my @tests = ( lib/DBD/SQLite/VirtualTable/FileContent.pm lib/DBD/SQLite/VirtualTable/PerlData.pm]], ["install_method" => qw[lib/DBD/SQLite.pm]], - ['"use strict"' => qw[lib/DBD/SQLite.pm + ['"use strict"' => qw[inc/Test/NoWarnings.pm + inc/Test/NoWarnings/Warning.pm + lib/DBD/SQLite.pm lib/DBD/SQLite/Constants.pm lib/DBD/SQLite/VirtualTable.pm lib/DBD/SQLite/VirtualTable/FileContent.pm @@ -40,7 +42,8 @@ my @tests = ( # literally. if (grep /ENABLE_FTS3_PARENTHESIS/, DBD::SQLite::compile_options()) { push @tests, ( - ['"use strict" AND "use warnings"' => qw[lib/DBD/SQLite/Constants.pm + ['"use strict" AND "use warnings"' => qw[inc/Test/NoWarnings.pm + lib/DBD/SQLite/Constants.pm lib/DBD/SQLite/VirtualTable.pm lib/DBD/SQLite/VirtualTable/FileContent.pm lib/DBD/SQLite/VirtualTable/PerlData.pm