22756512 Update DBD::SQLite to 1.50
authorVladimir Marek <Vladimir.Marek@oracle.com>
Tue, 03 May 2016 15:43:41 +0200
changeset 5927 0b2f72b7196c
parent 5926 ce9323f2bb9c
child 5928 f0b68e20e980
22756512 Update DBD::SQLite to 1.50
components/perl_modules/dbd-sqlite/Makefile
components/perl_modules/dbd-sqlite/TESTING
components/perl_modules/dbd-sqlite/patches/03_do_not_use_local_header.patch
components/perl_modules/dbd-sqlite/patches/03_fix_test.patch
components/perl_modules/dbd-sqlite/test/results-all.master
--- a/components/perl_modules/dbd-sqlite/Makefile	Mon May 02 14:39:28 2016 -0700
+++ b/components/perl_modules/dbd-sqlite/Makefile	Tue May 03 15:43:41 2016 +0200
@@ -18,25 +18,33 @@
 #
 # CDDL HEADER END
 #
+
+#
 # Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
 #
+
+# This variable has no impact on perl build, it is here merely to satisfy
+# "modernized" gate infrastructure. The bitness of the module is driven by the
+# bitness of perl interpreter itself. That is hardcoded in
+# $(WS_MAKE_RULES)/makemaker.mk
+BUILD_BITS = 64
+
 include ../../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		DBD-SQLite
-COMPONENT_VERSION=	1.48
-COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
-COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
+COMPONENT_VERSION=	1.50
 COMPONENT_ARCHIVE_HASH=	\
-	sha256:b397230f5d4cdc9923f91c62da9e535234f3055c528ede75afd7d24698030ea6
+	sha256:3ac513ab73944fd7d4b672e1fe885dc522b6369d38f46a68e67e0045bf159ce1
 COMPONENT_ARCHIVE_URL=	http://backpan.perl.org/authors/id/I/IS/ISHIGAKI/$(COMPONENT_ARCHIVE)
 COMPONENT_PROJECT_URL=	https://github.com/DBD-SQLite/DBD-SQLite
 COMPONENT_BUGDB=	perl-mod/dbd-sqlite
 
-TPNO=			24450
+TPNO=			26789
 
-include $(WS_MAKE_RULES)/prep.mk
-include $(WS_MAKE_RULES)/ips.mk
-include $(WS_MAKE_RULES)/makemaker.mk
+BUILD_STYLE= makemaker
+LICENSE=DBD-SQLite.license
+BUILD_TARGET= $(BUILD_$(MK_BITS)) $(LICENSE)
+include $(WS_MAKE_RULES)/common.mk
 
 COMPONENT_TEST_TARGETS = test
 COMPONENT_TEST_MASTER = $(COMPONENT_TEST_RESULTS_DIR)/results-all.master
@@ -48,10 +56,20 @@
 	'-e "s/^\(\# \$$DBI::VERSION=\)[0-9][0-9.]*/\1<REPORTED DBI VERSION REMOVED>/" ' \
 	'-e "/^chmod/d" '
 
+# DBD::Sqlite ships custom sqlite3 sources. We remove the sources to make sure
+# that we do not build/link against it. However just removing the files would
+# break the build process. The next best thing is to make the files empty. The
+# macro $(RM) is intentionaly not used here, as it contains '-f' parameter.
+# Using plain 'rm' makes the action fail if the files are not found.
+COMPONENT_PRE_CONFIGURE_ACTION= ( \
+	cd $(SOURCE_DIR) && \
+	rm sqlite3.h sqlite3.c && \
+	$(TOUCH) sqlite3.h sqlite3.c; \
+)
+
 # This makes the configuration process a bit more chatty
 COMPONENT_CONFIGURE_ENV += AUTOMATED_TESTING=1
 
-LICENSE=DBD-SQLite.license
 CLEAN_PATHS += $(LICENSE)
 
 ASLR_MODE = $(ASLR_NOT_APPLICABLE)
@@ -59,16 +77,5 @@
 $(LICENSE): $(LICENSE).template
 	$(PERL) -pe 's/COMPONENT_VERSION/$(COMPONENT_VERSION)/g' "$<" > "[email protected]"
 
-# DBI must be installed to build
-build:		$(BUILD_64) \
-		$(LICENSE)
-
-install:	$(INSTALL_64)
-
-test:		$(TEST_64)
-
-system-test:    $(SYSTEM_TESTS_NOT_IMPLEMENTED)
-
 REQUIRED_PACKAGES += database/sqlite-3
 REQUIRED_PACKAGES += library/perl-5/database
-REQUIRED_PACKAGES += system/library
--- a/components/perl_modules/dbd-sqlite/TESTING	Mon May 02 14:39:28 2016 -0700
+++ b/components/perl_modules/dbd-sqlite/TESTING	Tue May 03 15:43:41 2016 +0200
@@ -7,6 +7,8 @@
 C="\$dbh=DBI->connect('dbi:SQLite:$DB');"
 FILE=/usr/bin/ls
 
+$P -e 'print $DBD::SQLite::VERSION, "\n"'
+
 rm -f "$DB"
 $P -e "$C"
 if [ ! -e "$DB" ]; then
@@ -42,6 +44,7 @@
 
 
 It should print
+ - correct DBD::SQLite version printed
  - two equal MD5 hashes
  - database description (mytable and trigger insert_blob_date)
  - current date and time
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/perl_modules/dbd-sqlite/patches/03_do_not_use_local_header.patch	Tue May 03 15:43:41 2016 +0200
@@ -0,0 +1,54 @@
+Filed at https://rt.cpan.org/Public/Bug/Display.html?id=114138
+
+--- DBD-SQLite-1.50/Makefile.PL	2016-05-02 13:32:35.562004677 -0700
++++ DBD-SQLite-1.50/Makefile.PL	2016-05-02 13:31:31.215124807 -0700
[email protected]@ -170,6 +170,7 @@ if ( 0 ) {
+ 				while ( defined($_ = <$fh>) ) {
+ 					if (/\#define\s+SQLITE_VERSION_NUMBER\s+(\d+)/) {
+ 						$version = $1;
++						$sqlite_inc = File::Spec->catdir( '', @$dir );
+ 						last;
+ 					}
+ 				}
[email protected]@ -216,7 +217,7 @@ my @CC_INC = (
+ 	'-I$(DBI_INSTARCH_DIR)',
+ );
+ if ( $sqlite_inc ) {
+-	push @CC_INC, "-I$sqlite_inc";
++	unshift @CC_INC, "-I$sqlite_inc";
+ }
+ 
+ my @CC_DEFINE = (
+--- DBD-SQLite-1.50/sqlite3ext.h	2016-05-02 13:40:28.734661242 -0700
++++ DBD-SQLite-1.50/sqlite3ext.h	2016-05-02 13:39:16.724889276 -0700
[email protected]@ -17,7 +17,7 @@
+ */
+ #ifndef _SQLITE3EXT_H_
+ #define _SQLITE3EXT_H_
+-#include "sqlite3.h"
++#include <sqlite3.h>
+ 
+ typedef struct sqlite3_api_routines sqlite3_api_routines;
+ 
+--- DBD-SQLite-1.50/dbdimp.h	2016-05-02 13:40:28.956772954 -0700
++++ DBD-SQLite-1.50/dbdimp.h	2016-05-02 13:39:23.563370124 -0700
[email protected]@ -3,7 +3,7 @@
+ #define _DBDIMP_H   1
+ 
+ #include "SQLiteXS.h"
+-#include "sqlite3.h"
++#include <sqlite3.h>
+ 
+ #define MY_CXT_KEY "DBD::SQLite::_guts" XS_VERSION
+ 
+--- DBD-SQLite-1.50/SQLiteXS.h	2016-05-02 13:40:29.181387425 -0700
++++ DBD-SQLite-1.50/SQLiteXS.h	2016-05-02 13:39:36.956291908 -0700
[email protected]@ -18,7 +18,7 @@
+ #include "dbivport.h"
+ #include <dbd_xsh.h>
+ 
+-#include "sqlite3.h"
++#include <sqlite3.h>
+ #include "fts3_tokenizer.h"
+ 
+ #endif
--- a/components/perl_modules/dbd-sqlite/patches/03_fix_test.patch	Mon May 02 14:39:28 2016 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-This contains fixes for two issues
-
-a)
-https://rt.cpan.org/Public/Bug/Display.html?id=111558
-https://github.com/DBD-SQLite/DBD-SQLite/commit/008e1291d5b3a8d1787433e33e6ebd13ed63af05
-
-and partially
-
-b)
-https://rt.cpan.org/Public/Bug/Display.html?id=111942
-https://github.com/DBD-SQLite/DBD-SQLite/commit/3eb1a184200be3868a58d1586cf49b8f81a22648
-https://github.com/DBD-SQLite/DBD-SQLite/commit/f679a6caf73c5cbc3a189acd754b660e55662e45
-
-Both fixed in 1.50
-
-diff --git a/t/virtual_table/11_filecontent_fulltext.t b/t/virtual_table/11_filecontent_fulltext.t
-index f1c5f64..804fafc 100644
---- a/t/virtual_table/11_filecontent_fulltext.t
-+++ b/t/virtual_table/11_filecontent_fulltext.t
[email protected]@ -31,13 +31,21 @@ my @tests = (
-                           lib/DBD/SQLite/VirtualTable/FileContent.pm
-                           lib/DBD/SQLite/VirtualTable/PerlData.pm
-                           t/lib/Test.pm]],
-+);
-+
-+# The last set of tests tries to use enhanced query syntax. But when
-+# SQLite is compiled without it's support, the word 'AND' is taken
-+# literally.
-+if (grep /ENABLE_FTS3_PARENTHESIS/, DBD::SQLite::compile_options()) {
-+  push @tests, (
-   ['"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
-                                            ]],
--);
-+  );
-+}
- 
- plan tests => 3 + 3 * @tests;
- 
---- DBD-SQLite-1.48/t/51_table_column_metadata.t	2016-02-12 10:12:28.334212852 +0100
-+++ DBD-SQLite-1.48/t/51_table_column_metadata.t	2016-02-12 10:11:48.355066773 +0100
[email protected]@ -6,8 +6,16 @@ BEGIN {
- 	$^W = 1;
- }
- 
--use t::lib::Test qw/connect_ok @CALL_FUNCS/;
-+use DBD::SQLite;
- use Test::More;
-+
-+BEGIN {
-+	if (!grep /^ENABLE_COLUMN_METADATA/, DBD::SQLite::compile_options()) {
-+		plan skip_all => "Column metadata is disabled for this DBD::SQLite";
-+	}
-+}
-+
-+use t::lib::Test qw/connect_ok @CALL_FUNCS/;
- use Test::NoWarnings;
- 
- plan tests => 16 * @CALL_FUNCS + 1;
--- a/components/perl_modules/dbd-sqlite/test/results-all.master	Mon May 02 14:39:28 2016 -0700
+++ b/components/perl_modules/dbd-sqlite/test/results-all.master	Tue May 03 15:43:41 2016 +0200
@@ -66,7 +66,11 @@
 t/57_uri_filename.t ................................... ok
 t/58_see_if_its_a_number_and_explicit_binding.t ....... ok
 t/59_extended_result_codes.t .......................... skipped: this test is for Win32 only
+t/60_readonly.t ....................................... ok
+t/61_strlike.t ........................................ skipped: this test requires SQLite 3.10.0 and newer
 t/cookbook_variance.t ................................. ok
+t/rt_106151_outermost_savepoint.t ..................... ok
+t/rt_106950_extra_warnings_with_savepoints.t .......... ok
 t/rt_15186_prepcached.t ............................... ok
 t/rt_21406_auto_finish.t .............................. ok
 t/rt_25371_asymmetric_unicode.t ....................... ok
@@ -109,6 +113,6 @@
 t/virtual_table/21_perldata_charinfo.t ................ ok
 t/virtual_table/rt_99748.t ............................ ok
 All tests successful.
-Files=99, Tests=3476, <TIMINGS REMOVED>
+Files=103, Tests=3505, <TIMINGS REMOVED>
 Result: PASS
 make[1]: Leaving directory '$(@D)'