- Add patches to build with new TCL and fix tests (#491726) thanks to D.

Marlin.
This commit is contained in:
alexlan 2009-03-24 04:14:46 +00:00
parent a147a19ddf
commit 3bd7a42137
3 changed files with 61 additions and 1 deletions

28
sqlite-2.8.17-tcl.patch Normal file
View File

@ -0,0 +1,28 @@
Address problem using sqlite2 with Tcl-8.5
Based on sqlite2-tcl.diff from OpenSuSE sqlite2-2.8.17-166.3.src.rpm
diff -up sqlite-2.8.17/configure.ac.orig sqlite-2.8.17/configure.ac
--- sqlite-2.8.17/configure.ac.orig
+++ sqlite-2.8.17/configure.ac
@@ -432,7 +432,7 @@
else
LIBS=""
AC_SEARCH_LIBS(Tcl_Init, dnl
- tcl8.4 tcl8.3 tcl84 tcl83 tcl,,,$otherlibs)
+ tcl8.5 tcl8.4 tcl8.3 tcl84 tcl83 tcl,,,$otherlibs)
fi
TARGET_TCL_LIBS="$LIBS $otherlibs"
fi
diff -up sqlite-2.8.17/src/tclsqlite.c.orig sqlite-2.8.17/src/tclsqlite.c
--- sqlite-2.8.17/src/tclsqlite.c.orig
+++ sqlite-2.8.17/src/tclsqlite.c
@@ -1231,6 +1231,10 @@
Tcl_Interp *interp;
Tcl_FindExecutable(argv[0]);
interp = Tcl_CreateInterp();
+ if (Tcl_Init(interp) == TCL_ERROR) {
+ fprintf(stderr,"%s\n",
+ Tcl_GetVar(interp, "errorInfo", TCL_GLOBAL_ONLY));
+ }
Libsqlite_Init(interp);
if( argc>=2 ){
int i;

22
sqlite-2.8.17-test.patch Normal file
View File

@ -0,0 +1,22 @@
diff -up sqlite-2.8.17/test/tclsqlite.test.orig sqlite-2.8.17/test/tclsqlite.test
--- sqlite-2.8.17/test/tclsqlite.test.orig 2005-04-23 17:43:22.000000000 -0500
+++ sqlite-2.8.17/test/tclsqlite.test 2009-03-20 10:36:39.235100000 -0500
@@ -61,16 +61,15 @@ do_test tcl-1.5 {
} msg]
lappend v $msg
} {0 {}}
+catch {expr x*} msg
do_test tcl-1.6 {
set v [catch {
db eval {SELECT * FROM t1} data {
expr x*
}
} msg]
- regsub {:.*$} $msg {} msg
lappend v $msg
-} {1 {syntax error in expression "x*"}}
-
+} [list 1 $msg]
if {[sqlite -encoding]=="UTF-8" && [sqlite -tcl-uses-utf]} {
catch {unset ::result}
do_test tcl-2.1 {

View File

@ -1,6 +1,6 @@
Name: sqlite2
Version: 2.8.17
Release: 2%{?dist}
Release: 3%{?dist}
Summary: Embeddable SQL engine in a C library
Group: System Environment/Libraries
@ -12,6 +12,8 @@ Patch2: sqlite-2.8.15-makefile.patch
Patch3: sqlite-2.8.3.test.rh9.patch
Patch4: sqlite-64bit-fixes.patch
Patch5: sqlite-2.8.15-arch-double-differences.patch
Patch6: sqlite-2.8.17-test.patch
Patch7: sqlite-2.8.17-tcl.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: ncurses-devel readline-devel %{_includedir}/tcl.h
@ -58,6 +60,8 @@ This package contains tcl bindings for sqlite.
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
sed -i.rpath 's!__VERSION__!%{version}!g' Makefile.in
# Patch additional /usr/lib locations where we don't have $(libdir)
# to substitute with.
@ -68,6 +72,8 @@ CFLAGS="$RPM_OPT_FLAGS -DNDEBUG=1"
%configure --enable-utf8 --disable-static
make
make tclsqlite libtclsqlite.la doc
%check
#obs. make test doesn't like root
make test
@ -108,6 +114,10 @@ rm -rf $RPM_BUILD_ROOT
%{_libdir}/sqlite-%version
%changelog
* Mon Mar 23 2009 Alex Lancaster <alexlan[AT]fedoraproject org> - 2.8.17-3
- Add patches to build with new TCL and fix tests (#491726)
thanks to D. Marlin.
* Wed Oct 03 2007 Alex Lancaster <alexl@users.sourceforge.net> 2.8.17-2
- Rebuild for merged Fedora