Skip to content

Commit

Permalink
Update to luasqlite3-0.4.1, okay sturm@
Browse files Browse the repository at this point in the history
  • Loading branch information
Pedro Martelletto committed Jul 30, 2006
1 parent d0894c2 commit d6f1032
Show file tree
Hide file tree
Showing 18 changed files with 170 additions and 83 deletions.
29 changes: 16 additions & 13 deletions databases/luasqlite3/Makefile
Original file line number Diff line number Diff line change
@@ -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}

Expand All @@ -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>
8 changes: 4 additions & 4 deletions databases/luasqlite3/distinfo
Original file line number Diff line number Diff line change
@@ -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
21 changes: 0 additions & 21 deletions databases/luasqlite3/patches/patch-Makefile

This file was deleted.

25 changes: 0 additions & 25 deletions databases/luasqlite3/patches/patch-Makefile_cfg

This file was deleted.

21 changes: 21 additions & 0 deletions databases/luasqlite3/patches/patch-Makefile_in
Original file line number Diff line number Diff line change
@@ -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)
13 changes: 13 additions & 0 deletions databases/luasqlite3/patches/patch-configure
Original file line number Diff line number Diff line change
@@ -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
9 changes: 9 additions & 0 deletions databases/luasqlite3/patches/patch-examples_aggregate_lua
Original file line number Diff line number Diff line change
@@ -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"


9 changes: 9 additions & 0 deletions databases/luasqlite3/patches/patch-examples_function_lua
Original file line number Diff line number Diff line change
@@ -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"


9 changes: 9 additions & 0 deletions databases/luasqlite3/patches/patch-examples_order_lua
Original file line number Diff line number Diff line change
@@ -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"


9 changes: 9 additions & 0 deletions databases/luasqlite3/patches/patch-examples_simple_lua
Original file line number Diff line number Diff line change
@@ -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"


9 changes: 9 additions & 0 deletions databases/luasqlite3/patches/patch-examples_smart_lua
Original file line number Diff line number Diff line change
@@ -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"


9 changes: 9 additions & 0 deletions databases/luasqlite3/patches/patch-examples_statement_lua
Original file line number Diff line number Diff line change
@@ -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"


8 changes: 8 additions & 0 deletions databases/luasqlite3/patches/patch-examples_tracing_lua
Original file line number Diff line number Diff line change
@@ -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"


32 changes: 32 additions & 0 deletions databases/luasqlite3/patches/patch-libluasqlite3_c
Original file line number Diff line number Diff line change
@@ -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 */
+}
14 changes: 9 additions & 5 deletions databases/luasqlite3/patches/patch-luasql-sqlite3_lua
Original file line number Diff line number Diff line change
@@ -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 )
13 changes: 7 additions & 6 deletions databases/luasqlite3/patches/patch-sqlite3_lua
Original file line number Diff line number Diff line change
@@ -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 = { }
5 changes: 3 additions & 2 deletions databases/luasqlite3/pkg/PFRAG.shared
Original file line number Diff line number Diff line change
@@ -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
10 changes: 3 additions & 7 deletions databases/luasqlite3/pkg/PLIST
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
@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/
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

0 comments on commit d6f1032

Please sign in to comment.