Skip site navigation (1)Skip section navigation (2)
Date:      Fri,  8 Jun 2007 12:45:13 +0200 (CEST)
From:      Anton Berezin <tobez@FreeBSD.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/113477: [PATCH] add support for FTS2 in sqlite3 3.3.17
Message-ID:  <20070608104513.E2BD112542E@heechee.tobez.org>
Resent-Message-ID: <200706081110.l58BA1sp078623@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         113477
>Category:       ports
>Synopsis:       [PATCH] add support for FTS2 in sqlite3 3.3.17
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jun 08 11:10:01 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator:     Anton Berezin
>Release:        FreeBSD 6.2-STABLE amd64
>Organization:
>Environment:

	
>Description:
While FTS2 is marked as subject to change in sqlite3, FTS1 is marked "experimental".
Yet FTS1 is available in the FreeBSD port, and FTS2 is not.

This PR is here to fix this horrible injustice.  :-P
>How-To-Repeat:
	
>Fix:

*** Please note new files ***

files/fts12_patch-Makefile.in
files/fts2_patch-Makefile.in
files/patch-ext__fts2__fts2.c
files/patch-ext__fts2__fts2_porter.c
files/patch-ext__fts2__fts2_tokenizer1.c

Here's the diff.

diff -u --show-c-function -ruN ../sqlite3/Makefile ./Makefile
--- ../sqlite3/Makefile	Mon May 28 20:21:27 2007
+++ ./Makefile	Fri Jun  8 12:39:35 2007
@@ -7,6 +7,7 @@
 
 PORTNAME=	sqlite3
 PORTVERSION=	3.3.17
+PORTREVISION=	1
 CATEGORIES=	databases
 MASTER_SITES=	http://www.sqlite.org/
 .if defined(USE_THOL)
@@ -31,6 +32,7 @@ CONFIGURE_TARGET=	--build=${MACHINE_ARCH
 OPTIONS=	DEBUG		"Enable debugging & verbose explain"	off \
 		DOCS		"Building docs (depends on TCL)"	on \
 		FTS1		"Enable FTS1 (Full Text Search) module"	off \
+		FTS2		"Enable FTS2 (Full Text Search) module"	off \
 		TCLWRAPPER	"TCL wrapper for SQLITE"		off
 
 # Defaults, for building the docs:
@@ -62,7 +64,19 @@ PORTDOCS=		*
 
 .if defined(WITH_FTS1)
 CFLAGS+=		-DSQLITE_ENABLE_FTS1
+.if defined(WITH_FTS2)
+EXTRA_PATCHES=		${FILESDIR}/fts12_patch-Makefile.in
+.else
 EXTRA_PATCHES=		${FILESDIR}/fts1_patch-Makefile.in
+.endif
+.else
+.if defined(WITH_FTS2)
+EXTRA_PATCHES=		${FILESDIR}/fts2_patch-Makefile.in
+.endif
+.endif
+
+.if defined(WITH_FTS2)
+CFLAGS+=		-DSQLITE_ENABLE_FTS2
 .endif
 
 .if defined(WITH_TCLWRAPPER)
diff -u --show-c-function -ruN ../sqlite3/files/fts12_patch-Makefile.in ./files/fts12_patch-Makefile.in
--- ../sqlite3/files/fts12_patch-Makefile.in	Thu Jan  1 01:00:00 1970
+++ ./files/fts12_patch-Makefile.in	Fri Jun  8 12:37:57 2007
@@ -0,0 +1,71 @@
+--- Makefile.in	Fri Jun  8 12:21:29 2007
++++ /tmp/Makefile.in	Fri Jun  8 12:19:53 2007
+@@ -128,7 +128,9 @@ LIBOBJ = alter.lo analyze.lo attach.lo a
+          select.lo table.lo tokenize.lo trigger.lo update.lo \
+          util.lo vacuum.lo \
+          vdbe.lo vdbeapi.lo vdbeaux.lo vdbefifo.lo vdbemem.lo \
+-         where.lo utf.lo legacy.lo vtab.lo
++         where.lo utf.lo legacy.lo vtab.lo \
++         fts1.lo fts1_hash.lo fts1_porter.lo fts1_tokenizer1.lo \
++         fts2.lo fts2_hash.lo fts2_porter.lo fts2_tokenizer1.lo
+ 
+ # All of the source code files.
+ #
+@@ -196,6 +198,14 @@ SRC += \
+   $(TOP)/ext/fts1/fts1_tokenizer.h \
+   $(TOP)/ext/fts1/fts1_tokenizer1.c
+ 
++SRC += \
++  $(TOP)/ext/fts2/fts2.c \
++  $(TOP)/ext/fts2/fts2.h \
++  $(TOP)/ext/fts2/fts2_hash.c \
++  $(TOP)/ext/fts2/fts2_hash.h \
++  $(TOP)/ext/fts2/fts2_porter.c \
++  $(TOP)/ext/fts2/fts2_tokenizer.h \
++  $(TOP)/ext/fts2/fts2_tokenizer1.c
+ 
+ # Source code to the test files.
+ #
+@@ -254,6 +264,11 @@ HDR += \
+   $(TOP)/ext/fts1/fts1_hash.h \
+   $(TOP)/ext/fts1/fts1_tokenizer.h
+ 
++HDR += \
++  $(TOP)/ext/fts2/fts2.h \
++  $(TOP)/ext/fts2/fts2_hash.h \
++  $(TOP)/ext/fts2/fts2_tokenizer.h
++
+ # Header files used by the VDBE submodule
+ #
+ VDBEHDR = \
+@@ -468,6 +483,30 @@ vtab.lo:	$(TOP)/src/vtab.c $(VDBEHDR)
+ 
+ where.lo:	$(TOP)/src/where.c $(HDR)
+ 	$(LTCOMPILE) -c $(TOP)/src/where.c
++
++fts1.lo:	$(TOP)/ext/fts1/fts1.c $(HDR)
++	$(LTCOMPILE) -c $(TOP)/ext/fts1/fts1.c
++
++fts1_hash.lo:	$(TOP)/ext/fts1/fts1_hash.c $(HDR)
++	$(LTCOMPILE) -c $(TOP)/ext/fts1/fts1_hash.c
++
++fts1_porter.lo:	$(TOP)/ext/fts1/fts1_porter.c $(HDR)
++	$(LTCOMPILE) -c $(TOP)/ext/fts1/fts1_porter.c
++
++fts1_tokenizer1.lo:	$(TOP)/ext/fts1/fts1_tokenizer1.c $(HDR)
++	$(LTCOMPILE) -c $(TOP)/ext/fts1/fts1_tokenizer1.c
++
++fts2.lo:	$(TOP)/ext/fts2/fts2.c $(HDR)
++	$(LTCOMPILE) -c $(TOP)/ext/fts2/fts2.c
++
++fts2_hash.lo:	$(TOP)/ext/fts2/fts2_hash.c $(HDR)
++	$(LTCOMPILE) -c $(TOP)/ext/fts2/fts2_hash.c
++
++fts2_porter.lo:	$(TOP)/ext/fts2/fts2_porter.c $(HDR)
++	$(LTCOMPILE) -c $(TOP)/ext/fts2/fts2_porter.c
++
++fts2_tokenizer1.lo:	$(TOP)/ext/fts2/fts2_tokenizer1.c $(HDR)
++	$(LTCOMPILE) -c $(TOP)/ext/fts2/fts2_tokenizer1.c
+ 
+ tclsqlite-shell.lo:	$(TOP)/src/tclsqlite.c $(HDR)
+ 	$(LTCOMPILE) -DTCLSH=1 -o $@ -c $(TOP)/src/tclsqlite.c
diff -u --show-c-function -ruN ../sqlite3/files/fts2_patch-Makefile.in ./files/fts2_patch-Makefile.in
--- ../sqlite3/files/fts2_patch-Makefile.in	Thu Jan  1 01:00:00 1970
+++ ./files/fts2_patch-Makefile.in	Fri Jun  8 12:37:57 2007
@@ -0,0 +1,58 @@
+--- Makefile.in.x	Fri Jun  8 12:22:54 2007
++++ Makefile.in	Fri Jun  8 12:24:03 2007
+@@ -128,7 +128,8 @@ LIBOBJ = alter.lo analyze.lo attach.lo a
+          select.lo table.lo tokenize.lo trigger.lo update.lo \
+          util.lo vacuum.lo \
+          vdbe.lo vdbeapi.lo vdbeaux.lo vdbefifo.lo vdbemem.lo \
+-         where.lo utf.lo legacy.lo vtab.lo
++         where.lo utf.lo legacy.lo vtab.lo \
++         fts2.lo fts2_hash.lo fts2_porter.lo fts2_tokenizer1.lo
+ 
+ # All of the source code files.
+ #
+@@ -196,6 +197,14 @@ SRC += \
+   $(TOP)/ext/fts1/fts1_tokenizer.h \
+   $(TOP)/ext/fts1/fts1_tokenizer1.c
+ 
++SRC += \
++  $(TOP)/ext/fts2/fts2.c \
++  $(TOP)/ext/fts2/fts2.h \
++  $(TOP)/ext/fts2/fts2_hash.c \
++  $(TOP)/ext/fts2/fts2_hash.h \
++  $(TOP)/ext/fts2/fts2_porter.c \
++  $(TOP)/ext/fts2/fts2_tokenizer.h \
++  $(TOP)/ext/fts2/fts2_tokenizer1.c
+ 
+ # Source code to the test files.
+ #
+@@ -254,6 +263,11 @@ HDR += \
+   $(TOP)/ext/fts1/fts1_hash.h \
+   $(TOP)/ext/fts1/fts1_tokenizer.h
+ 
++HDR += \
++  $(TOP)/ext/fts2/fts2.h \
++  $(TOP)/ext/fts2/fts2_hash.h \
++  $(TOP)/ext/fts2/fts2_tokenizer.h
++
+ # Header files used by the VDBE submodule
+ #
+ VDBEHDR = \
+@@ -468,6 +482,18 @@ vtab.lo:	$(TOP)/src/vtab.c $(VDBEHDR)
+ 
+ where.lo:	$(TOP)/src/where.c $(HDR)
+ 	$(LTCOMPILE) -c $(TOP)/src/where.c
++
++fts2.lo:	$(TOP)/ext/fts2/fts2.c $(HDR)
++	$(LTCOMPILE) -c $(TOP)/ext/fts2/fts2.c
++
++fts2_hash.lo:	$(TOP)/ext/fts2/fts2_hash.c $(HDR)
++	$(LTCOMPILE) -c $(TOP)/ext/fts2/fts2_hash.c
++
++fts2_porter.lo:	$(TOP)/ext/fts2/fts2_porter.c $(HDR)
++	$(LTCOMPILE) -c $(TOP)/ext/fts2/fts2_porter.c
++
++fts2_tokenizer1.lo:	$(TOP)/ext/fts2/fts2_tokenizer1.c $(HDR)
++	$(LTCOMPILE) -c $(TOP)/ext/fts2/fts2_tokenizer1.c
+ 
+ tclsqlite-shell.lo:	$(TOP)/src/tclsqlite.c $(HDR)
+ 	$(LTCOMPILE) -DTCLSH=1 -o $@ -c $(TOP)/src/tclsqlite.c
diff -u --show-c-function -ruN ../sqlite3/files/patch-ext__fts2__fts2.c ./files/patch-ext__fts2__fts2.c
--- ../sqlite3/files/patch-ext__fts2__fts2.c	Thu Jan  1 01:00:00 1970
+++ ./files/patch-ext__fts2__fts2.c	Fri Jun  8 12:37:57 2007
@@ -0,0 +1,12 @@
+--- ext/fts2/fts2.c.orig	Fri Jun  8 12:31:37 2007
++++ ext/fts2/fts2.c	Fri Jun  8 12:32:16 2007
+@@ -269,9 +269,6 @@
+ #endif
+ 
+ #include <assert.h>
+-#if !defined(__APPLE__)
+-#include <malloc.h>
+-#endif
+ #include <stdlib.h>
+ #include <stdio.h>
+ #include <string.h>
diff -u --show-c-function -ruN ../sqlite3/files/patch-ext__fts2__fts2_porter.c ./files/patch-ext__fts2__fts2_porter.c
--- ../sqlite3/files/patch-ext__fts2__fts2_porter.c	Thu Jan  1 01:00:00 1970
+++ ./files/patch-ext__fts2__fts2_porter.c	Fri Jun  8 12:37:57 2007
@@ -0,0 +1,14 @@
+--- ext/fts2/fts2_porter.c.orig	Fri Jun  8 12:31:44 2007
++++ ext/fts2/fts2_porter.c	Fri Jun  8 12:32:21 2007
+@@ -26,11 +26,7 @@
+ 
+ 
+ #include <assert.h>
+-#if !defined(__APPLE__)
+-#include <malloc.h>
+-#else
+ #include <stdlib.h>
+-#endif
+ #include <stdio.h>
+ #include <string.h>
+ #include <ctype.h>
diff -u --show-c-function -ruN ../sqlite3/files/patch-ext__fts2__fts2_tokenizer1.c ./files/patch-ext__fts2__fts2_tokenizer1.c
--- ../sqlite3/files/patch-ext__fts2__fts2_tokenizer1.c	Thu Jan  1 01:00:00 1970
+++ ./files/patch-ext__fts2__fts2_tokenizer1.c	Fri Jun  8 12:37:57 2007
@@ -0,0 +1,14 @@
+--- ext/fts2/fts2_tokenizer1.c.orig	Fri Jun  8 12:31:51 2007
++++ ext/fts2/fts2_tokenizer1.c	Fri Jun  8 12:32:26 2007
+@@ -18,11 +18,7 @@
+ 
+ 
+ #include <assert.h>
+-#if !defined(__APPLE__)
+-#include <malloc.h>
+-#else
+ #include <stdlib.h>
+-#endif
+ #include <stdio.h>
+ #include <string.h>
+ #include <ctype.h>
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070608104513.E2BD112542E>