pkgsrc-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: pkg/54492: databases/lua-sqlite multiples problems
The following reply was made to PR pkg/54492; it has been noted by GNATS.
From: =?utf-8?Q?cl=C3=A9ment_bouvier?= <clement.bouvier.europe%gmail.com@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc:
Subject: Re: pkg/54492: databases/lua-sqlite multiples problems
Date: Wed, 28 Aug 2019 09:41:26 +0400
--Apple-Mail=_1A750651-9167-4C49-B1DA-5CD1F8662D93
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
charset=utf-8
Hi all,
Errors from my side with the previous patch:
* change rpath ${PREFIX}/lib/${LUA_CDIR} into ${PREFIX}/${LUA_CDIR}
* increment PKG_REVISION.
Sorry.
Cl=C3=A9ment Bouvier.
--Apple-Mail=_1A750651-9167-4C49-B1DA-5CD1F8662D93
Content-Disposition: attachment;
filename=patch-lua-sqlite.diff
Content-Type: application/octet-stream;
x-unix-mode=0644;
name="patch-lua-sqlite.diff"
Content-Transfer-Encoding: 7bit
Index: MESSAGE
===================================================================
RCS file: /cvsroot/pkgsrc/databases/lua-sqlite/MESSAGE,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 MESSAGE
--- MESSAGE 5 Apr 2004 14:16:14 -0000 1.1.1.1
+++ MESSAGE 28 Aug 2019 05:35:02 -0000
@@ -4,6 +4,6 @@
To use luasqlite in your lua programs you must set this environment
variable:
- LUA_INIT = "loadlib('${PREFIX}/lib/libluasqlite.so','luaLM_import')();"
+LUA_INIT="package.loadlib('${PREFIX}/${LUA_CDIR}/libluasqlite.so','luaLM_import')();"
===========================================================================
Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/databases/lua-sqlite/Makefile,v
retrieving revision 1.20
diff -u -r1.20 Makefile
--- Makefile 20 Jan 2015 19:56:54 -0000 1.20
+++ Makefile 28 Aug 2019 05:35:02 -0000
@@ -3,7 +3,7 @@
DISTNAME= lsqlite_src
PKGNAME= ${LUA_PKGPREFIX}-sqlite-20030228
-PKGREVISION= 9
+PKGREVISION= 10
CATEGORIES= databases
MASTER_SITES= http://lua-users.org/files/wiki_insecure/binary_modules/luasqlite/
EXTRACT_SUFX= .zip
@@ -12,6 +12,10 @@
HOMEPAGE= http://lua-users.org/wiki/LuaSqlite
COMMENT= SQLite binding for LUA
+MESSAGE_SUBST+= LUA_CDIR="${LUA_CDIR}"
+
+USE_LIBTOOL= yes
+
WRKSRC= ${WRKDIR}
CFLAGS+= -fPIC
@@ -23,12 +27,14 @@
INSTALLATION_DIRS+= ${LUA_CDIR} ${LUA_DOCDIR} ${LUA_EXAMPLESDIR}
do-build:
- cd ${WRKSRC}; ${CC} -shared ${CFLAGS} ${LDFLAGS} lsqlite.c \
- -o libluasqlite.so ${LIBS}
+ cd ${WRKSRC}
+ ${LIBTOOL} --tag=CC --mode=compile ${CC} ${CFLAGS} -c ${WRKSRC}/lsqlite.c -o ${WRKDIR}/lsqlite.lo
+ ${LIBTOOL} --tag=CC --mode=link ${CC} ${LDFLAGS} -no-undefined -module -avoid-version -o ${WRKDIR}/libluasqlite.la \
+ ${WRKDIR}/lsqlite.lo -rpath ${PREFIX}/${LUA_CDIR} ${LIBS}
do-install:
- ${INSTALL_DATA} ${WRKSRC}/libluasqlite.so \
- ${DESTDIR}${PREFIX}/${LUA_CDIR}
+ ${LIBTOOL} --mode=install ${INSTALL_LIB} ${WRKDIR}/libluasqlite.la \
+ ${DESTDIR}${PREFIX}/${LUA_CDIR}
${INSTALL_DATA} ${WRKSRC}/readme.txt \
${DESTDIR}${PREFIX}/${LUA_DOCDIR}
${INSTALL_DATA} ${WRKSRC}/test.lua \
Index: PLIST
===================================================================
RCS file: /cvsroot/pkgsrc/databases/lua-sqlite/PLIST,v
retrieving revision 1.3
diff -u -r1.3 PLIST
--- PLIST 3 May 2014 13:01:24 -0000 1.3
+++ PLIST 28 Aug 2019 05:35:02 -0000
@@ -1,4 +1,4 @@
@comment $NetBSD: PLIST,v 1.3 2014/05/03 13:01:24 alnsn Exp $
-${LUA_CDIR}/libluasqlite.so
+${LUA_CDIR}/libluasqlite.la
${LUA_DOCDIR}/readme.txt
${LUA_EXAMPLESDIR}/test.lua
Index: distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/databases/lua-sqlite/distinfo,v
retrieving revision 1.3
diff -u -r1.3 distinfo
--- distinfo 3 Nov 2015 01:56:14 -0000 1.3
+++ distinfo 28 Aug 2019 05:35:02 -0000
@@ -4,3 +4,5 @@
RMD160 (lsqlite_src.zip) = 717771b68507c54c9b0b540ed2ab70adb53cd420
SHA512 (lsqlite_src.zip) = 7933a735559815a67d26225a69de72bea55ff529672820abfe10346b0194dff62a1bc4c6625a0a8621417d5b79a4035d21196f31a2beabb7a6f5e1703b6fb012
Size (lsqlite_src.zip) = 321990 bytes
+SHA1 (patch-lsqlite.c) = 6a05eb64bf873184eb121d9d04a977f934899574
+SHA1 (patch-test.lua) = 808850ff36d41dfbc20044f710a04abcbf9e369d
Index: patches/patch-lsqlite.c
===================================================================
RCS file: patches/patch-lsqlite.c
diff -N patches/patch-lsqlite.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-lsqlite.c 28 Aug 2019 05:35:02 -0000
@@ -0,0 +1,23 @@
+$NetBSD$
+* Keep the same logic as lsql_ on lsql_finalize
+* Avoid a segfault on test.lua sqlite.finalize part if no error
+
+--- lsqlite.c.orig 2003-02-28 09:00:22.000000000 +0000
++++ lsqlite.c
+@@ -327,14 +327,11 @@ int lsql_step(lua_State *L)
+ int lsql_finalize(lua_State *L)
+ {
+ dbud *ud = ls_checknargs_vm_getbdud(L,1,"sqlite.finalize(db)");
+- char *errmsg;
+ int err;
+ // do it
+- err = sqlite_finalize( ud->vm , &errmsg );
++ err = sqlite_finalize( ud->vm , NULL);
+ lua_pushnumber(L, (lua_Number )err);
+- lua_pushstring(L,errmsg);
+- if( errmsg != NULL ) sqlite_freemem( errmsg );
+- return 2;
++ return 1;
+ }
+
+ /*
Index: patches/patch-test.lua
===================================================================
RCS file: patches/patch-test.lua
diff -N patches/patch-test.lua
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-test.lua 28 Aug 2019 05:35:02 -0000
@@ -0,0 +1,16 @@
+$NetBSD$
+* Prefer require lua function for loading module.
+
+--- test.lua.orig 2003-02-28 09:00:00.000000000 +0000
++++ test.lua
+@@ -25,8 +25,8 @@ print(os.date"%Y-%b-%d %H:%M:%S")
+
+ -- open binary module
+
+-ok,str=module.load"sqlite"
+-if (not ok)
++sqlite = require("sqlite")
++if (not sqlite)
+ then do print ("Error on module.load: ", str) break end
+ end
+
--Apple-Mail=_1A750651-9167-4C49-B1DA-5CD1F8662D93--
Home |
Main Index |
Thread Index |
Old Index