ports/110104: databases/sqlite3: create a slave port for threads-override-locks.

Thierry Thomas thierry at FreeBSD.org
Thu Mar 8 20:40:01 UTC 2007


>Number:         110104
>Category:       ports
>Synopsis:       databases/sqlite3: create a slave port for threads-override-locks.
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Mar 08 20:40:00 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator:     Thierry Thomas
>Release:        FreeBSD 6.2-STABLE i386
>Organization:
Kabbale Eros
>Environment:
System: FreeBSD graf.pompo.net 6.2-STABLE FreeBSD 6.2-STABLE #0: Sun Jan 28 10:29:56 CET 2007 thierry at graf.pompo.net:/usr/obj/usr/src/sys/GRAF060511 i386


	
>Description:
	Some ports / packages (e.g. deskutils/pinot) work better when
	threads-override-locks is enabled in sqlite3. For packaging reasons
	I'm proposing to create a slave port for this option.

	The attached patch and shar file do the following:

	- create sqlite3-threads as a slave port, which sets USE_THOL;
	- update sqlite3 to handle this variable;
	- define conflicts between sqlite3-threads & sqlite3;
	- sqlite3-threads will touch a dummy file
	  etc/sqlite3_installed_with_threads-override-locks to test which
	  package has been installed
	- the current option WITH_THREADS is only available in the master
	  port.

>How-To-Repeat:
	N/A

>Fix:
	Please accept the following patches:

--- sqlite3.diff begins here ---
diff -urN databases/sqlite3.orig/Makefile databases/sqlite3/Makefile
--- databases/sqlite3.orig/Makefile	Wed Feb 14 07:46:41 2007
+++ databases/sqlite3/Makefile	Wed Mar  7 23:47:58 2007
@@ -10,6 +10,9 @@
 PORTVERSION=	3.3.12
 CATEGORIES=	databases
 MASTER_SITES=	http://www.sqlite.org/
+.if defined(USE_THOL)
+PKGNAMESUFFIX=	-threads
+.endif
 
 MAINTAINER=	mnag at FreeBSD.org
 COMMENT=	An SQL database engine in a C library w/ Tcl wrapper
@@ -29,14 +32,25 @@
 OPTIONS=	DEBUG		"Enable debugging & verbose explain"	off \
 		DOCS		"Building docs (depends on TCL)"	on \
 		FTS1		"Enable FTS1 (Full Text Search) module"	off \
-		TCLWRAPPER	"TCL wrapper for SQLITE"		off \
-		THREADS		"Enable threads support"		off
+		TCLWRAPPER	"TCL wrapper for SQLITE"		off
 
 # Defaults, for building the docs:
 TCL_V?=		8.4
 MAKE_ARGS+=	TCLSH=tclsh${TCL_V}
 MAKE_ENV+=	TCL_VER=${TCL_V}
 
+.if !defined(USE_THOL)
+OPTIONS+=	THREADS		"Enable threads support"		off
+PLIST_SUB+=	THOL="@comment "
+CONFLICTS=	sqlite-threads-3*
+.else
+CONFIGURE_ARGS+=--enable-threadsafe --enable-threads-override-locks
+PLIST_SUB+=	THOL=""
+CONFLICTS=	sqlite-3*
+.endif
+
+SLAVEDIRS=	databases/sqlite3-threads
+
 .include <bsd.port.pre.mk>
 
 .if defined(WITH_DEBUG)
@@ -68,8 +82,8 @@
 CONFIGURE_ARGS+=	--enable-threadsafe
 .endif
 
-post-patch:
-.if defined(WITH_THREADS)
+pre-configure:
+.if defined(WITH_THREADS) || defined(USE_THOL)
 	@${REINPLACE_CMD} -e "s|-lpthread|${PTHREAD_LIBS}|g" \
 		${WRKSRC}/configure
 	@${REINPLACE_CMD} -E -e "s|(Libs:.*)|\1 ${PTHREAD_LIBS}|" \
@@ -99,5 +113,8 @@
 .endif
 	@${MKDIR} ${EXAMPLESDIR}
 	@${INSTALL_DATA} ${FILESDIR}/example.tcl ${EXAMPLESDIR}
+.if defined(USE_THOL)
+	${TOUCH} ${PREFIX}/etc/sqlite3_installed_with_threads-override-locks
+.endif
 
 .include <bsd.port.post.mk>
diff -urN databases/sqlite3.orig/pkg-plist databases/sqlite3/pkg-plist
--- databases/sqlite3.orig/pkg-plist	Wed Feb 14 07:46:41 2007
+++ databases/sqlite3/pkg-plist	Wed Mar  7 23:39:08 2007
@@ -1,5 +1,6 @@
 bin/sqlite3
 %%WITH_TCLWRAPPER%%bin/tclsqlite3
+%%THOL%%etc/sqlite3_installed_with_threads-override-locks
 include/sqlite3.h
 include/sqlite3ext.h
 lib/libsqlite3.a
--- sqlite3.diff ends here ---

--- sqlite3-threads.shar begins here ---
# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	databases/sqlite3-threads
#	databases/sqlite3-threads/Makefile
#
echo c - databases/sqlite3-threads
mkdir -p databases/sqlite3-threads > /dev/null 2>&1
echo x - databases/sqlite3-threads/Makefile
sed 's/^X//' >databases/sqlite3-threads/Makefile << 'END-of-databases/sqlite3-threads/Makefile'
X# New ports collection makefile for:	sqlite3-threads
X# Date created:		07 March 2007
X# Whom:			thierry at pompo.net
X#
X# $FreeBSD$
X#
X
XPORTNAME=	sqlite3
X
XCOMMENT=	SQLite 3 with threads overriding each others locks enabled
X
XMASTERDIR=	${.CURDIR}/../sqlite3
X
XUSE_THOL=	yes
X
X.include "${MASTERDIR}/Makefile"
END-of-databases/sqlite3-threads/Makefile
exit
--- sqlite3-threads.shar ends here ---

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list