Update to luasqlite3-0.4.1, okay sturm@

This commit is contained in:
pedro 2006-07-30 04:51:39 +00:00
parent b5392766b2
commit c0485370be
18 changed files with 170 additions and 83 deletions

View File

@ -1,9 +1,9 @@
# $OpenBSD: Makefile,v 1.2 2005/06/17 00:01:58 jolan Exp $
# $OpenBSD: Makefile,v 1.3 2006/07/30 04:51:39 pedro Exp $
SHARED_ONLY= Yes
COMMENT= "binding of sqlite3 for lua"
PKGNAME= luasqlite3-0.3
DISTNAME= lua-sqlite3-0.3
PKGNAME= luasqlite3-0.4.1
DISTNAME= lua-sqlite3-0.4.1
CATEGORIES= databases lang/lua
MASTER_SITES= ${HOMEPAGE}
@ -16,29 +16,32 @@ PERMIT_PACKAGE_CDROM= Yes
PERMIT_PACKAGE_FTP= Yes
USE_GMAKE= Yes
CONFIGURE_STYLE=gnu
CONFIGURE_ARGS+=--with-lua-dir=${PREFIX}
CFLAGS+= -fPIC -DPIC
LIB_DEPENDS= sqlite3.8::databases/sqlite3
BUILD_DEPENDS= ::lang/lua
BUILD_DEPENDS= :lua->=5.1:lang/lua
RUN_DEPENDS= ${BUILD_DEPENDS}
REGRESS_DEPENDS=::databases/luasqlite3
REGRESS_TARGET= check
post-extract:
@sed -e "s:@sqlite3path@:${PREFIX}/lua/luasqlite3/?.lua:g" \
${FILESDIR}/init.lua > ${WRKSRC}/init.lua
@perl -pi -e s,'^LUA_PATH.*',,g ${WRKSRC}/examples/*.lua
pre-install:
@rm -f ${WRKSRC}/examples/path.lua
do-install:
${INSTALL_DATA_DIR} ${PREFIX}/lua/luasqlite3
${INSTALL_DATA_DIR} ${PREFIX}/share/lua/5.1
${INSTALL_DATA_DIR} ${PREFIX}/lib/lua/5.1/sqlite3
${INSTALL_DATA_DIR} ${PREFIX}/share/doc/luasqlite3
${INSTALL_DATA_DIR} ${PREFIX}/share/examples/luasqlite3
${INSTALL_DATA} ${WRKSRC}/luasqlite3.so ${PREFIX}/lib
${INSTALL_DATA} ${WRKSRC}/sqlite3.lua ${PREFIX}/lua/luasqlite3
${INSTALL_DATA} ${WRKSRC}/init.lua ${PREFIX}/lua/luasqlite3
${INSTALL_DATA} ${WRKSRC}/sqlite3.lua ${PREFIX}/share/lua/5.1
${INSTALL_DATA} ${WRKSRC}/libluasqlite3.so \
${PREFIX}/lib/lua/5.1/sqlite3/core.so
${INSTALL_DATA} ${WRKSRC}/documentation.html \
${PREFIX}/share/doc/luasqlite3
${INSTALL_DATA} ${WRKSRC}/examples/* ${PREFIX}/share/examples/luasqlite3
${INSTALL_DATA} ${WRKSRC}/examples/*.lua \
${PREFIX}/share/examples/luasqlite3
.include <bsd.port.mk>

View File

@ -1,4 +1,4 @@
MD5 (lua-sqlite3-0.3.tar.gz) = cc059f848f1432ab4749bda03eff49ac
RMD160 (lua-sqlite3-0.3.tar.gz) = 8052acc2cc1ecbffed029b092b2f4e2a9c51c59b
SHA1 (lua-sqlite3-0.3.tar.gz) = 9a82084327a6dc77f7d52dca0f840aaa423dae11
SIZE (lua-sqlite3-0.3.tar.gz) = 32243
MD5 (lua-sqlite3-0.4.1.tar.gz) = 66db31f6f9744b1976f656b39d6949df
RMD160 (lua-sqlite3-0.4.1.tar.gz) = c63b6bdef5825792dd3a2ecd720217a4038f247e
SHA1 (lua-sqlite3-0.4.1.tar.gz) = e69ad345c60e7e73b150f08e05208bc69d90e3bd
SIZE (lua-sqlite3-0.4.1.tar.gz) = 62234

View File

@ -1,21 +0,0 @@
$OpenBSD: patch-Makefile,v 1.1.1.1 2005/04/27 04:33:53 jolan Exp $
--- Makefile.orig Tue Apr 26 10:09:24 2005
+++ Makefile Tue Apr 26 10:10:51 2005
@@ -29,7 +29,7 @@ DEPS := Makefile Makefile.cfg
DESTDIR :=
-all: libluasqlite3.so libluasqlite3-loader.lua libluasqlite3-loader.lua.install
+all: luasqlite3.so # libluasqlite3-loader.lua libluasqlite3-loader.lua.install
install: all
$(install-dirs) $(DESTDIR)$(luadir)
@@ -96,7 +96,7 @@ documentation.html: docs/doc.mrd
libluasqlite3.o: libluasqlite3.c $(DEPS)
$(COMPILE) $(LUA_CFLAGS) $(SQLITE3_CFLAGS) -o $@ $<
-libluasqlite3.so: libluasqlite3.o $(DEPS)
+luasqlite3.so: libluasqlite3.o $(DEPS)
$(LINKSHARED) $(LUA_LDFLAGS) $(SQLITE3_LDFLAGS) -o $@ $< $(LUA_LIBS) $(SQLITE3_LIBS)
libluasqlite3-loader.lua.install: libluasqlite3-loader.lua.in $(DEPS)

View File

@ -1,25 +0,0 @@
$OpenBSD: patch-Makefile_cfg,v 1.1.1.1 2005/04/27 04:33:53 jolan Exp $
--- Makefile.cfg.orig Thu Oct 7 14:25:27 2004
+++ Makefile.cfg Tue Apr 26 16:09:19 2005
@@ -1,5 +1,5 @@
-prefix := /usr/local
+prefix := $(LOCALBASE)
bindir := $(prefix)/bin
sbindir := $(prefix)/sbin
@@ -13,11 +13,11 @@ mandir := $(prefix)/man
luadir := $(libdir)/lua
-CC := gcc
+CC := $(CC)
LD := $(CC)
-CFLAGS := -g -Wall -I$(includedir)
-LDFLAGS := -L$(libdir) -Wl,-rpath,$(libdir)
+CFLAGS += -fPIC -I$(includedir)
+LDFLAGS := -L$(libdir) -fPIC -Wl,-rpath,$(libdir)
COMPILE := $(CC) $(CFLAGS) -c
LINK := $(LD) $(LDFLAGS)

View File

@ -0,0 +1,21 @@
$OpenBSD: patch-Makefile_in,v 1.1 2006/07/30 04:51:39 pedro Exp $
--- Makefile.in.orig Thu May 11 08:07:19 2006
+++ Makefile.in Fri Jul 28 19:53:51 2006
@@ -27,7 +27,7 @@ LIBS := @LIBS@
COMPILE = $(CC) -c $(CFLAGS) -o $@ $<
LINK = $(CC) $(LDFLAGS) -o $@ $+ $(LIBS)
-LINKSHARED = $(CC) -shared $(LDFLAGS) -o $@ $+ $(LIBS)
+LINKSHARED = $(CC) -shared -fPIC $(LDFLAGS) -o $@ $+ $(LIBS)
DESTDIR =
@@ -54,7 +54,7 @@ CLEAN_FILES := libluasqlite3.o libluasq
DESTDIR :=
-all: libluasqlite3.so libluasqlite3-loader.lua libluasqlite3-loader.lua.install
+all: libluasqlite3.so
install: all
$(install-dirs) $(DESTDIR)$(luadir)

View File

@ -0,0 +1,13 @@
$OpenBSD: patch-configure,v 1.1 2006/07/30 04:51:39 pedro Exp $
--- configure.orig Fri Jul 28 20:45:18 2006
+++ configure Fri Jul 28 20:45:26 2006
@@ -3512,8 +3512,7 @@ fi
echo "$as_me:$LINENO: checking if we need -llua" >&5
echo $ECHO_N "checking if we need -llua... $ECHO_C" >&6
-need_llua=yes
-nm -D "$LUA" | $EGREP "T lua_open$" >/dev/null && need_llua=no
+need_llua=no
echo "$as_me:$LINENO: result: $need_llua" >&5
echo "${ECHO_T}$need_llua" >&6
if test $need_llua = yes; then

View File

@ -0,0 +1,9 @@
$OpenBSD: patch-examples_aggregate_lua,v 1.1 2006/07/30 04:51:39 pedro Exp $
--- examples/aggregate.lua.orig Fri Jul 28 21:58:46 2006
+++ examples/aggregate.lua Fri Jul 28 21:59:30 2006
@@ -1,5 +1,4 @@
-require "path"
require "sqlite3"

View File

@ -0,0 +1,9 @@
$OpenBSD: patch-examples_function_lua,v 1.1 2006/07/30 04:51:39 pedro Exp $
--- examples/function.lua.orig Fri Jul 28 21:58:56 2006
+++ examples/function.lua Fri Jul 28 21:59:32 2006
@@ -1,5 +1,4 @@
-require "path"
require "sqlite3"

View File

@ -0,0 +1,9 @@
$OpenBSD: patch-examples_order_lua,v 1.1 2006/07/30 04:51:39 pedro Exp $
--- examples/order.lua.orig Fri Jul 28 21:58:59 2006
+++ examples/order.lua Fri Jul 28 21:59:34 2006
@@ -1,5 +1,4 @@
-require "path"
require "sqlite3"

View File

@ -0,0 +1,9 @@
$OpenBSD: patch-examples_simple_lua,v 1.1 2006/07/30 04:51:39 pedro Exp $
--- examples/simple.lua.orig Fri Jul 28 21:59:02 2006
+++ examples/simple.lua Fri Jul 28 21:59:37 2006
@@ -1,5 +1,4 @@
-require "path"
require "sqlite3"

View File

@ -0,0 +1,9 @@
$OpenBSD: patch-examples_smart_lua,v 1.1 2006/07/30 04:51:39 pedro Exp $
--- examples/smart.lua.orig Fri Jul 28 21:59:05 2006
+++ examples/smart.lua Fri Jul 28 21:59:38 2006
@@ -1,5 +1,4 @@
-require "path"
require "sqlite3"

View File

@ -0,0 +1,9 @@
$OpenBSD: patch-examples_statement_lua,v 1.1 2006/07/30 04:51:39 pedro Exp $
--- examples/statement.lua.orig Fri Jul 28 21:59:16 2006
+++ examples/statement.lua Fri Jul 28 21:59:40 2006
@@ -1,5 +1,4 @@
-require "path"
require "sqlite3"

View File

@ -0,0 +1,8 @@
$OpenBSD: patch-examples_tracing_lua,v 1.1 2006/07/30 04:51:39 pedro Exp $
--- examples/tracing.lua.orig Fri Jul 28 21:59:20 2006
+++ examples/tracing.lua Fri Jul 28 21:59:43 2006
@@ -1,4 +1,3 @@
-require "path"
require "sqlite3"

View File

@ -0,0 +1,32 @@
$OpenBSD: patch-libluasqlite3_c,v 1.1 2006/07/30 04:51:39 pedro Exp $
--- libluasqlite3.c.orig Thu May 11 08:06:16 2006
+++ libluasqlite3.c Fri Jul 28 21:48:41 2006
@@ -1627,15 +1627,25 @@ d_entry auth_entries[] = {
-int luaopen_sqlite3(lua_State * L)
+
+FUNC( init_api_entries )
{
f(L, api_entries);
d(L, error_entries);
d(L, type_entries);
d(L, auth_entries);
-
- return 4; /* api, error codes, type codes, auth requests */
+
+ return 4; /* four objects placed on stack */
}
+f_entry init_entries[] = {
+ { "init", init_api_entries },
+ { 0, 0 }
+};
+int luaopen_sqlite3_core(lua_State * L)
+{
+ f(L, init_entries);
+ return 1; /* one object placed on stack */
+}

View File

@ -1,12 +1,16 @@
$OpenBSD: patch-luasql-sqlite3_lua,v 1.1.1.1 2005/04/27 04:33:53 jolan Exp $
--- luasql-sqlite3.lua.orig Mon Oct 4 11:06:02 2004
+++ luasql-sqlite3.lua Tue Apr 26 16:02:07 2005
@@ -58,7 +58,7 @@ local function isref(t) return t.ref_co
$OpenBSD: patch-luasql-sqlite3_lua,v 1.2 2006/07/30 04:51:39 pedro Exp $
--- luasql-sqlite3.lua.orig Thu Jun 2 15:43:29 2005
+++ luasql-sqlite3.lua Sat Jul 29 17:46:49 2006
@@ -57,8 +57,11 @@ local function isref(t) return t.ref_co
function luasql.sqlite3()
+ local f = assert(package.loadlib("./libluasqlite3.so",
+ "luaopen_sqlite3_core"))
+ f = f()
if not api then
- api, ERR, TYPE, AUTH = load_libluasqlite3()
+ api, ERR, TYPE, AUTH = loadlib("luasqlite3.so", "luaopen_sqlite3")()
+ api, ERR, TYPE, AUTH = f.init()
end
local env = setmetatable( {}, env_class_mt )

View File

@ -1,15 +1,16 @@
$OpenBSD: patch-sqlite3_lua,v 1.2 2005/06/17 00:01:58 jolan Exp $
--- sqlite3.lua.orig Wed Jun 15 16:33:54 2005
+++ sqlite3.lua Thu Jun 16 12:08:07 2005
@@ -44,9 +44,8 @@ TODO:
$OpenBSD: patch-sqlite3_lua,v 1.3 2006/07/30 04:51:39 pedro Exp $
--- sqlite3.lua.orig Wed Sep 14 20:22:59 2005
+++ sqlite3.lua Fri Jul 28 21:51:06 2006
@@ -44,9 +44,9 @@ TODO:
-require "libluasqlite3-loader"
-
-local api, ERR, TYPE, AUTH = load_libluasqlite3()
+local api, ERR, TYPE, AUTH =
+ assert(loadlib("luasqlite3.so", "luaopen_sqlite3"))()
+local f = assert(require("sqlite3.core"))
+local api, ERR, TYPE, AUTH = f.init()
+f = nil
local db_class = { }
local stmt_class = { }

View File

@ -1,2 +1,3 @@
@comment $OpenBSD: PFRAG.shared,v 1.1.1.1 2005/04/27 04:33:53 jolan Exp $
lib/luasqlite3.so
@comment $OpenBSD: PFRAG.shared,v 1.2 2006/07/30 04:51:39 pedro Exp $
lib/lua/5.1/sqlite3/
lib/lua/5.1/sqlite3/core.so

View File

@ -1,11 +1,5 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2005/04/27 04:33:53 jolan Exp $
@unexec lua ${SYSCONFDIR}/lua/luapkg.lua del luasqlite3
@exec lua ${SYSCONFDIR}/lua/luapkg.lua add luasqlite3 ${PREFIX}/lua/luasqlite3/init.lua
@comment $OpenBSD: PLIST,v 1.2 2006/07/30 04:51:39 pedro Exp $
%%SHARED%%
lua/
lua/luasqlite3/
lua/luasqlite3/init.lua
lua/luasqlite3/sqlite3.lua
share/doc/luasqlite3/
share/doc/luasqlite3/documentation.html
share/examples/luasqlite3/
@ -13,5 +7,7 @@ share/examples/luasqlite3/aggregate.lua
share/examples/luasqlite3/function.lua
share/examples/luasqlite3/order.lua
share/examples/luasqlite3/simple.lua
share/examples/luasqlite3/smart.lua
share/examples/luasqlite3/statement.lua
share/examples/luasqlite3/tracing.lua
share/lua/5.1/sqlite3.lua