NetBSD Problem Report #54496

From www@netbsd.org  Wed Aug 28 07:30:06 2019
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 9D1A27A1A1
	for <gnats-bugs@gnats.NetBSD.org>; Wed, 28 Aug 2019 07:30:06 +0000 (UTC)
Message-Id: <20190828073005.896107A1DD@mollari.NetBSD.org>
Date: Wed, 28 Aug 2019 07:30:05 +0000 (UTC)
From: clement.bouvier.europe@gmail.com
Reply-To: clement.bouvier.europe@gmail.com
To: gnats-bugs@NetBSD.org
Subject: databases/lua-sqlite3 relative library path, build tools missing
X-Send-Pr-Version: www-1.0

>Number:         54496
>Category:       pkg
>Synopsis:       databases/lua-sqlite3 relative library path, build tools missing
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Aug 28 07:35:00 +0000 2019
>Last-Modified:  Thu Aug 29 14:30:01 +0000 2019
>Originator:     clement bouvier
>Release:        current
>Organization:
>Environment:
macOS mojave 10.14.6
>Description:
databases/lua-sqlite3 cannot be installed on macOS without a relative library path error:
ERROR: lib/lua/5.1/libluasqlite3.so: relative library path: libluasqlite3.so
(The build log can be found here for instance:
http://us-east.manta.joyent.com/pkgsrc/public/reports/Darwin/trunk/x86_64/20190802.0934/lua51-sqlite3-0.4.1nb16/install.log)

The package makefile is gnu type  and it uses m4 to build some Lua files.
https://us-east.manta.joyent.com/pkgsrc/public/reports/Linux/ubuntu18.04/trunk/x86_64/20190825.0007/lua52-sqlite3-0.4.1nb16/build.log

>How-To-Repeat:
Install the package.
>Fix:
The following patch:
* Adapt the makefile provided by the package to build the module with libtool (avoid relative library path error).
* Install directly the lua files using configure_args (bindir overriding) instead of post-install rule.
* Add gmake and m4 in use_tools.
* Appease pkglint with comments in the patch files

Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/databases/lua-sqlite3/Makefile,v
retrieving revision 1.19
diff -u -r1.19 Makefile
--- Makefile	3 Apr 2019 00:32:30 -0000	1.19
+++ Makefile	28 Aug 2019 07:07:48 -0000
@@ -12,18 +12,17 @@
 COMMENT=	SQLite3 binding for LUA
 LICENSE=	mit

+USE_LIBTOOL=		yes
+USE_TOOLS+=		gmake m4
 GNU_CONFIGURE=		yes
 CONFIGURE_ARGS+=	--libdir=${PREFIX}/${LUA_CDIR}
+CONFIGURE_ARGS+=	--bindir=${PREFIX}/${LUA_LDIR}
 CONFIGURE_ARGS+=	--with-lua=${LUA_INTERPRETER:Q}

 CFLAGS+=		-fPIC

 INSTALLATION_DIRS+= 	${LUA_LDIR} ${LUA_CDIR}

-post-install:
-	mv ${DESTDIR}${PREFIX}/${LUA_CDIR}/*.lua \
-	   ${DESTDIR}${PREFIX}/${LUA_LDIR}
-
 .include "../../databases/sqlite3/buildlink3.mk"
 .include "../../lang/lua/module.mk"
 .include "../../mk/bsd.pkg.mk"
Index: PLIST
===================================================================
RCS file: /cvsroot/pkgsrc/databases/lua-sqlite3/PLIST,v
retrieving revision 1.2
diff -u -r1.2 PLIST
--- PLIST	3 May 2014 13:01:24 -0000	1.2
+++ PLIST	28 Aug 2019 07:07:48 -0000
@@ -1,5 +1,5 @@
 @comment $NetBSD: PLIST,v 1.2 2014/05/03 13:01:24 alnsn Exp $
-${LUA_CDIR}/libluasqlite3.so
+${LUA_CDIR}/libluasqlite3.la
 ${LUA_LDIR}/libluasqlite3-loader.lua
 ${LUA_LDIR}/luasql-sqlite3.lua
 ${LUA_LDIR}/sqlite3.lua
Index: distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/databases/lua-sqlite3/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 07:07:48 -0000
@@ -4,6 +4,6 @@
 RMD160 (lua-sqlite3-0.4.1.tar.bz2) = ab502207f8cdaaf7749500b2f02cf7990da1f87c
 SHA512 (lua-sqlite3-0.4.1.tar.bz2) = bd1b915e09f24926fa8cdb7b5e1e5ea9484d36d74402171c250a854428e4c6ebc883bfe9313fc7354f84bf85e97eaa0005839d55080bfbc8baace4f1a0e92802
 Size (lua-sqlite3-0.4.1.tar.bz2) = 54780 bytes
-SHA1 (patch-Makefile.in) = 6a1482242354c6b1b5c935695fd49154312a9a5d
+SHA1 (patch-Makefile.in) = e297df54d9f662a677423c0de4a822f684bff4ff
 SHA1 (patch-configure) = a9950af9c314bf3bc2ab813d3cc7d8e6c410b4dd
-SHA1 (patch-libluasqlite3.c) = 7eccef9ebdbc9e33b6bb52ce0b214a19786aa230
+SHA1 (patch-libluasqlite3.c) = 68e8c59c2d9523b7f3d809185fa8036ce1ff7cf9
Index: patches/patch-Makefile.in
===================================================================
RCS file: /cvsroot/pkgsrc/databases/lua-sqlite3/patches/patch-Makefile.in,v
retrieving revision 1.1
diff -u -r1.1 patch-Makefile.in
--- patches/patch-Makefile.in	3 May 2014 13:01:24 -0000	1.1
+++ patches/patch-Makefile.in	28 Aug 2019 07:07:48 -0000
@@ -1,5 +1,9 @@
 $NetBSD: patch-Makefile.in,v 1.1 2014/05/03 13:01:24 alnsn Exp $

+* Adapt luadir for installing the lua module
+* Use bindir for installing the lua script files
+* Build lua module with libtool
+
 --- Makefile.in.orig	2006-05-11 11:07:19.000000000 +0000
 +++ Makefile.in
 @@ -9,7 +9,7 @@ libdir			:= @libdir@
@@ -11,20 +15,28 @@

  install			:= install
  install-data		:= $(install) -p -m 644
-@@ -27,7 +27,6 @@ LIBS			:= @LIBS@
+@@ -58,8 +58,9 @@ all:			libluasqlite3.so libluasqlite3-lo

- COMPILE			= $(CC) -c $(CFLAGS) -o $@ $<
- LINK			= $(CC) $(LDFLAGS) -o $@ $+ $(LIBS)
--LINKSHARED		= $(CC) -shared  $(LDFLAGS) -o $@ $+ $(LIBS)
- 
- DESTDIR			=
- 
-@@ -127,7 +126,7 @@ libluasqlite3.o:	libluasqlite3.c
- 			$(COMPILE)
+ install:		all
+ 			$(install-dirs) $(DESTDIR)$(luadir)
+-			$(install-data) $(LUA_FILES) libluasqlite3.so $(DESTDIR)$(luadir)
+-			$(install-data) libluasqlite3-loader.lua.install $(DESTDIR)$(luadir)/libluasqlite3-loader.lua
++			${LIBTOOL} --mode=install $(install-data) libluasqlite3.la $(DESTDIR)$(luadir) 
++			$(install-data) $(LUA_FILES) $(DESTDIR)$(bindir)
++			$(install-data) libluasqlite3-loader.lua.install $(DESTDIR)$(bindir)/libluasqlite3-loader.lua
+ 
+ uninstall:
+ 			( cd $(DESTDIR)$(luadir); rm -f $(LUA_FILES) libluasqlite3-loader.lua libluasqlite3.so )
+@@ -124,10 +125,10 @@ documentation.html:	docs/doc.mrd makedoc
+ 			$(LUA) makedoc.lua >documentation.html
+ 
+ libluasqlite3.o:	libluasqlite3.c
+-			$(COMPILE)
++			${LIBTOOL} --tag=CC --mode=compile $(CC) $(CFLAGS) -c $< -o ${@:.o=.lo}

  libluasqlite3.so:	libluasqlite3.o
 -			$(LINKSHARED)
-+			$(CC) -shared  $(LDFLAGS) libluasqlite3.o -o $@ $(LIBS)
++			${LIBTOOL} --tag=CC --mode=link $(CC) $(LDFLAGS) -no-undefined -module -avoid-version -rpath $(luadir) -o ${@:.so=.la} ${<:.o=.lo} $(LIBS)

  libluasqlite3-loader.lua.install: libluasqlite3-loader.lua.in
  			m4 -DSHARED_LIB_PATH=$(luadir)				\
Index: patches/patch-libluasqlite3.c
===================================================================
RCS file: /cvsroot/pkgsrc/databases/lua-sqlite3/patches/patch-libluasqlite3.c,v
retrieving revision 1.1
diff -u -r1.1 patch-libluasqlite3.c
--- patches/patch-libluasqlite3.c	3 May 2014 13:01:24 -0000	1.1
+++ patches/patch-libluasqlite3.c	28 Aug 2019 07:07:48 -0000
@@ -1,5 +1,8 @@
 $NetBSD: patch-libluasqlite3.c,v 1.1 2014/05/03 13:01:24 alnsn Exp $

+* Adapt module to lua 5.2
+* luaL_typerror does not exist anymore with lua 5.2. Make an equivalent version
+
 --- libluasqlite3.c.orig	2006-05-11 11:06:16.000000000 +0000
 +++ libluasqlite3.c
 @@ -302,10 +302,28 @@ static void report_error(lua_State * L, 

>Release-Note:

>Audit-Trail:

From: =?utf-8?Q?cl=C3=A9ment_bouvier?= <clement.bouvier.europe@gmail.com>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/54496: databases/lua-qlite3 relative library path, build
 tools missing
Date: Thu, 29 Aug 2019 18:16:35 +0400

 --Apple-Mail=_4AC4F0FA-ED28-4933-92C1-264BD5C34475
 Content-Transfer-Encoding: quoted-printable
 Content-Type: text/plain;
 	charset=utf-8

 Hi,

 Finally, I obtain a better patch.
 I removed the dependency to lua core lib which is not useful for a =
 module.
 I added the test target.
 I limited lua version to 5.1 (apparently upstream support is 5.1 and the =
 test module, lunit shipped in the package can only run  with 5.1).

 Cheers,
 Cl=C3=A9ment


 --Apple-Mail=_4AC4F0FA-ED28-4933-92C1-264BD5C34475
 Content-Disposition: attachment;
 	filename=patch-lua-sqlite3.diff
 Content-Type: application/octet-stream;
 	x-unix-mode=0644;
 	name="patch-lua-sqlite3.diff"
 Content-Transfer-Encoding: 7bit

 Index: Makefile
 ===================================================================
 RCS file: /cvsroot/pkgsrc/databases/lua-sqlite3/Makefile,v
 retrieving revision 1.19
 diff -u -r1.19 Makefile
 --- Makefile	3 Apr 2019 00:32:30 -0000	1.19
 +++ Makefile	29 Aug 2019 14:10:16 -0000
 @@ -12,17 +12,20 @@
  COMMENT=	SQLite3 binding for LUA
  LICENSE=	mit

 +USE_LIBTOOL=		yes
 +USE_TOOLS+=		gmake m4
  GNU_CONFIGURE=		yes
  CONFIGURE_ARGS+=	--libdir=${PREFIX}/${LUA_CDIR}
 +CONFIGURE_ARGS+=	--bindir=${PREFIX}/${LUA_LDIR}
  CONFIGURE_ARGS+=	--with-lua=${LUA_INTERPRETER:Q}

  CFLAGS+=		-fPIC

 +LUA_VERSIONS_INCOMPATIBLE=      52 53
 +
  INSTALLATION_DIRS+= 	${LUA_LDIR} ${LUA_CDIR}

 -post-install:
 -	mv ${DESTDIR}${PREFIX}/${LUA_CDIR}/*.lua \
 -	   ${DESTDIR}${PREFIX}/${LUA_LDIR}
 +TEST_TARGET=            check

  .include "../../databases/sqlite3/buildlink3.mk"
  .include "../../lang/lua/module.mk"
 Index: PLIST
 ===================================================================
 RCS file: /cvsroot/pkgsrc/databases/lua-sqlite3/PLIST,v
 retrieving revision 1.2
 diff -u -r1.2 PLIST
 --- PLIST	3 May 2014 13:01:24 -0000	1.2
 +++ PLIST	29 Aug 2019 14:10:16 -0000
 @@ -1,5 +1,5 @@
  @comment $NetBSD: PLIST,v 1.2 2014/05/03 13:01:24 alnsn Exp $
 -${LUA_CDIR}/libluasqlite3.so
 +${LUA_CDIR}/libluasqlite3.la
  ${LUA_LDIR}/libluasqlite3-loader.lua
  ${LUA_LDIR}/luasql-sqlite3.lua
  ${LUA_LDIR}/sqlite3.lua
 Index: distinfo
 ===================================================================
 RCS file: /cvsroot/pkgsrc/databases/lua-sqlite3/distinfo,v
 retrieving revision 1.3
 diff -u -r1.3 distinfo
 --- distinfo	3 Nov 2015 01:56:14 -0000	1.3
 +++ distinfo	29 Aug 2019 14:10:16 -0000
 @@ -4,6 +4,6 @@
  RMD160 (lua-sqlite3-0.4.1.tar.bz2) = ab502207f8cdaaf7749500b2f02cf7990da1f87c
  SHA512 (lua-sqlite3-0.4.1.tar.bz2) = bd1b915e09f24926fa8cdb7b5e1e5ea9484d36d74402171c250a854428e4c6ebc883bfe9313fc7354f84bf85e97eaa0005839d55080bfbc8baace4f1a0e92802
  Size (lua-sqlite3-0.4.1.tar.bz2) = 54780 bytes
 -SHA1 (patch-Makefile.in) = 6a1482242354c6b1b5c935695fd49154312a9a5d
 -SHA1 (patch-configure) = a9950af9c314bf3bc2ab813d3cc7d8e6c410b4dd
 -SHA1 (patch-libluasqlite3.c) = 7eccef9ebdbc9e33b6bb52ce0b214a19786aa230
 +SHA1 (patch-Makefile.in) = caa22e101269ed3e686ca37e7da010b4f8cf51e3
 +SHA1 (patch-configure) = c60674ea3363881635e28307d8a9aa4d8edcee03
 +SHA1 (patch-libluasqlite3.c) = 68e8c59c2d9523b7f3d809185fa8036ce1ff7cf9
 Index: patches/patch-Makefile.in
 ===================================================================
 RCS file: /cvsroot/pkgsrc/databases/lua-sqlite3/patches/patch-Makefile.in,v
 retrieving revision 1.1
 diff -u -r1.1 patch-Makefile.in
 --- patches/patch-Makefile.in	3 May 2014 13:01:24 -0000	1.1
 +++ patches/patch-Makefile.in	29 Aug 2019 14:10:16 -0000
 @@ -1,5 +1,9 @@
  $NetBSD: patch-Makefile.in,v 1.1 2014/05/03 13:01:24 alnsn Exp $

 +* Adapt luadir for installing the lua module
 +* Use bindir for installing the lua script files
 +* Build lua module with libtool
 +
  --- Makefile.in.orig	2006-05-11 11:07:19.000000000 +0000
  +++ Makefile.in
  @@ -9,7 +9,7 @@ libdir			:= @libdir@
 @@ -11,20 +15,35 @@

   install			:= install
   install-data		:= $(install) -p -m 644
 -@@ -27,7 +27,6 @@ LIBS			:= @LIBS@
 +@@ -58,8 +58,9 @@ all:			libluasqlite3.so libluasqlite3-lo

 - COMPILE			= $(CC) -c $(CFLAGS) -o $@ $<
 - LINK			= $(CC) $(LDFLAGS) -o $@ $+ $(LIBS)
 --LINKSHARED		= $(CC) -shared  $(LDFLAGS) -o $@ $+ $(LIBS)
 - 
 - DESTDIR			=
 - 
 -@@ -127,7 +126,7 @@ libluasqlite3.o:	libluasqlite3.c
 - 			$(COMPILE)
 + install:		all
 + 			$(install-dirs) $(DESTDIR)$(luadir)
 +-			$(install-data) $(LUA_FILES) libluasqlite3.so $(DESTDIR)$(luadir)
 +-			$(install-data) libluasqlite3-loader.lua.install $(DESTDIR)$(luadir)/libluasqlite3-loader.lua
 ++			${LIBTOOL} --mode=install $(install-data) libluasqlite3.la $(DESTDIR)$(luadir) 
 ++			$(install-data) $(LUA_FILES) $(DESTDIR)$(bindir)
 ++			$(install-data) libluasqlite3-loader.lua.install $(DESTDIR)$(bindir)/libluasqlite3-loader.lua
 + 
 + uninstall:
 + 			( cd $(DESTDIR)$(luadir); rm -f $(LUA_FILES) libluasqlite3-loader.lua libluasqlite3.so )
 +@@ -118,16 +119,16 @@ docsclean:
 + 			rm -f documentation.html
 + 
 + check:			all
 +-			$(LUA) tests.lua
 ++			${LIBTOOL} --mode=execute -dlopen libluasqlite3.la $(LUA) tests.lua
 + 
 + documentation.html:	docs/doc.mrd makedoc.lua
 + 			$(LUA) makedoc.lua >documentation.html
 + 
 + libluasqlite3.o:	libluasqlite3.c
 +-			$(COMPILE)
 ++			${LIBTOOL} --tag=CC --mode=compile $(CC) $(CFLAGS) -c $< -o ${@:.o=.lo}

   libluasqlite3.so:	libluasqlite3.o
  -			$(LINKSHARED)
 -+			$(CC) -shared  $(LDFLAGS) libluasqlite3.o -o $@ $(LIBS)
 ++			${LIBTOOL} --tag=CC --mode=link $(CC) $(LDFLAGS) -export-dynamic -module -avoid-version -rpath $(luadir) -o ${@:.so=.la} ${<:.o=.lo} $(LIBS)

   libluasqlite3-loader.lua.install: libluasqlite3-loader.lua.in
   			m4 -DSHARED_LIB_PATH=$(luadir)				\
 Index: patches/patch-configure
 ===================================================================
 RCS file: /cvsroot/pkgsrc/databases/lua-sqlite3/patches/patch-configure,v
 retrieving revision 1.2
 diff -u -r1.2 patch-configure
 --- patches/patch-configure	3 May 2014 13:01:24 -0000	1.2
 +++ patches/patch-configure	29 Aug 2019 14:10:16 -0000
 @@ -1,14 +1,17 @@
  $NetBSD: patch-configure,v 1.2 2014/05/03 13:01:24 alnsn Exp $

  nm -D is not portable, but -llua is needed anyway.
 +Linking directly to lua is not useful for a module.  

  --- configure.orig	2006-05-11 11:23:29.000000000 +0000
  +++ configure
 -@@ -3513,7 +3513,6 @@ fi
 +@@ -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
 +-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
 Index: patches/patch-libluasqlite3.c
 ===================================================================
 RCS file: /cvsroot/pkgsrc/databases/lua-sqlite3/patches/patch-libluasqlite3.c,v
 retrieving revision 1.1
 diff -u -r1.1 patch-libluasqlite3.c
 --- patches/patch-libluasqlite3.c	3 May 2014 13:01:24 -0000	1.1
 +++ patches/patch-libluasqlite3.c	29 Aug 2019 14:10:16 -0000
 @@ -1,5 +1,8 @@
  $NetBSD: patch-libluasqlite3.c,v 1.1 2014/05/03 13:01:24 alnsn Exp $

 +* Adapt module to lua 5.2
 +* luaL_typerror does not exist anymore with lua 5.2. Make an equivalent version
 +
  --- libluasqlite3.c.orig	2006-05-11 11:06:16.000000000 +0000
  +++ libluasqlite3.c
  @@ -302,10 +302,28 @@ static void report_error(lua_State * L, 

 --Apple-Mail=_4AC4F0FA-ED28-4933-92C1-264BD5C34475
 Content-Transfer-Encoding: 7bit
 Content-Type: text/plain;
 	charset=us-ascii




 --Apple-Mail=_4AC4F0FA-ED28-4933-92C1-264BD5C34475--

From: =?utf-8?Q?cl=C3=A9ment_bouvier?= <clement.bouvier.europe@gmail.com>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/54496: databases/lua-qlite3 relative library path, build
 tools missing
Date: Thu, 29 Aug 2019 18:27:09 +0400

 --Apple-Mail=_5E1F1BAB-4E2E-4981-B915-4FFF38D8E26F
 Content-Transfer-Encoding: quoted-printable
 Content-Type: text/plain;
 	charset=utf-8

 Hi,

 Probably is better with shared option.
 I'm sorry...

 Cl=C3=A9ment.


 --Apple-Mail=_5E1F1BAB-4E2E-4981-B915-4FFF38D8E26F
 Content-Disposition: attachment;
 	filename=patch-lua-sqlite3.diff
 Content-Type: application/octet-stream;
 	x-unix-mode=0644;
 	name="patch-lua-sqlite3.diff"
 Content-Transfer-Encoding: 7bit

 Index: Makefile
 ===================================================================
 RCS file: /cvsroot/pkgsrc/databases/lua-sqlite3/Makefile,v
 retrieving revision 1.19
 diff -u -r1.19 Makefile
 --- Makefile	3 Apr 2019 00:32:30 -0000	1.19
 +++ Makefile	29 Aug 2019 14:24:53 -0000
 @@ -12,17 +12,20 @@
  COMMENT=	SQLite3 binding for LUA
  LICENSE=	mit

 +USE_LIBTOOL=		yes
 +USE_TOOLS+=		gmake m4
  GNU_CONFIGURE=		yes
  CONFIGURE_ARGS+=	--libdir=${PREFIX}/${LUA_CDIR}
 +CONFIGURE_ARGS+=	--bindir=${PREFIX}/${LUA_LDIR}
  CONFIGURE_ARGS+=	--with-lua=${LUA_INTERPRETER:Q}

  CFLAGS+=		-fPIC

 +LUA_VERSIONS_INCOMPATIBLE=      52 53
 +
  INSTALLATION_DIRS+= 	${LUA_LDIR} ${LUA_CDIR}

 -post-install:
 -	mv ${DESTDIR}${PREFIX}/${LUA_CDIR}/*.lua \
 -	   ${DESTDIR}${PREFIX}/${LUA_LDIR}
 +TEST_TARGET=            check

  .include "../../databases/sqlite3/buildlink3.mk"
  .include "../../lang/lua/module.mk"
 Index: PLIST
 ===================================================================
 RCS file: /cvsroot/pkgsrc/databases/lua-sqlite3/PLIST,v
 retrieving revision 1.2
 diff -u -r1.2 PLIST
 --- PLIST	3 May 2014 13:01:24 -0000	1.2
 +++ PLIST	29 Aug 2019 14:24:53 -0000
 @@ -1,5 +1,5 @@
  @comment $NetBSD: PLIST,v 1.2 2014/05/03 13:01:24 alnsn Exp $
 -${LUA_CDIR}/libluasqlite3.so
 +${LUA_CDIR}/libluasqlite3.la
  ${LUA_LDIR}/libluasqlite3-loader.lua
  ${LUA_LDIR}/luasql-sqlite3.lua
  ${LUA_LDIR}/sqlite3.lua
 Index: distinfo
 ===================================================================
 RCS file: /cvsroot/pkgsrc/databases/lua-sqlite3/distinfo,v
 retrieving revision 1.3
 diff -u -r1.3 distinfo
 --- distinfo	3 Nov 2015 01:56:14 -0000	1.3
 +++ distinfo	29 Aug 2019 14:24:53 -0000
 @@ -4,6 +4,6 @@
  RMD160 (lua-sqlite3-0.4.1.tar.bz2) = ab502207f8cdaaf7749500b2f02cf7990da1f87c
  SHA512 (lua-sqlite3-0.4.1.tar.bz2) = bd1b915e09f24926fa8cdb7b5e1e5ea9484d36d74402171c250a854428e4c6ebc883bfe9313fc7354f84bf85e97eaa0005839d55080bfbc8baace4f1a0e92802
  Size (lua-sqlite3-0.4.1.tar.bz2) = 54780 bytes
 -SHA1 (patch-Makefile.in) = 6a1482242354c6b1b5c935695fd49154312a9a5d
 -SHA1 (patch-configure) = a9950af9c314bf3bc2ab813d3cc7d8e6c410b4dd
 -SHA1 (patch-libluasqlite3.c) = 7eccef9ebdbc9e33b6bb52ce0b214a19786aa230
 +SHA1 (patch-Makefile.in) = 4241217722884c441e97f9ff59543c8bb5db836d
 +SHA1 (patch-configure) = c60674ea3363881635e28307d8a9aa4d8edcee03
 +SHA1 (patch-libluasqlite3.c) = 68e8c59c2d9523b7f3d809185fa8036ce1ff7cf9
 Index: patches/patch-Makefile.in
 ===================================================================
 RCS file: /cvsroot/pkgsrc/databases/lua-sqlite3/patches/patch-Makefile.in,v
 retrieving revision 1.1
 diff -u -r1.1 patch-Makefile.in
 --- patches/patch-Makefile.in	3 May 2014 13:01:24 -0000	1.1
 +++ patches/patch-Makefile.in	29 Aug 2019 14:24:53 -0000
 @@ -1,5 +1,9 @@
  $NetBSD: patch-Makefile.in,v 1.1 2014/05/03 13:01:24 alnsn Exp $

 +* Adapt luadir for installing the lua module
 +* Use bindir for installing the lua script files
 +* Build lua module with libtool
 +
  --- Makefile.in.orig	2006-05-11 11:07:19.000000000 +0000
  +++ Makefile.in
  @@ -9,7 +9,7 @@ libdir			:= @libdir@
 @@ -11,20 +15,35 @@

   install			:= install
   install-data		:= $(install) -p -m 644
 -@@ -27,7 +27,6 @@ LIBS			:= @LIBS@
 +@@ -58,8 +58,9 @@ all:			libluasqlite3.so libluasqlite3-lo

 - COMPILE			= $(CC) -c $(CFLAGS) -o $@ $<
 - LINK			= $(CC) $(LDFLAGS) -o $@ $+ $(LIBS)
 --LINKSHARED		= $(CC) -shared  $(LDFLAGS) -o $@ $+ $(LIBS)
 - 
 - DESTDIR			=
 - 
 -@@ -127,7 +126,7 @@ libluasqlite3.o:	libluasqlite3.c
 - 			$(COMPILE)
 + install:		all
 + 			$(install-dirs) $(DESTDIR)$(luadir)
 +-			$(install-data) $(LUA_FILES) libluasqlite3.so $(DESTDIR)$(luadir)
 +-			$(install-data) libluasqlite3-loader.lua.install $(DESTDIR)$(luadir)/libluasqlite3-loader.lua
 ++			${LIBTOOL} --mode=install $(install-data) libluasqlite3.la $(DESTDIR)$(luadir) 
 ++			$(install-data) $(LUA_FILES) $(DESTDIR)$(bindir)
 ++			$(install-data) libluasqlite3-loader.lua.install $(DESTDIR)$(bindir)/libluasqlite3-loader.lua
 + 
 + uninstall:
 + 			( cd $(DESTDIR)$(luadir); rm -f $(LUA_FILES) libluasqlite3-loader.lua libluasqlite3.so )
 +@@ -118,16 +119,16 @@ docsclean:
 + 			rm -f documentation.html
 + 
 + check:			all
 +-			$(LUA) tests.lua
 ++			${LIBTOOL} --mode=execute -dlopen libluasqlite3.la $(LUA) tests.lua
 + 
 + documentation.html:	docs/doc.mrd makedoc.lua
 + 			$(LUA) makedoc.lua >documentation.html
 + 
 + libluasqlite3.o:	libluasqlite3.c
 +-			$(COMPILE)
 ++			${LIBTOOL} --tag=CC --mode=compile $(CC) $(CFLAGS) -c $< -o ${@:.o=.lo}

   libluasqlite3.so:	libluasqlite3.o
  -			$(LINKSHARED)
 -+			$(CC) -shared  $(LDFLAGS) libluasqlite3.o -o $@ $(LIBS)
 ++			${LIBTOOL} --tag=CC --mode=link $(CC) $(LDFLAGS) -shared -module -avoid-version -export-dynamic -rpath $(luadir) -o ${@:.so=.la} ${<:.o=.lo} $(LIBS)

   libluasqlite3-loader.lua.install: libluasqlite3-loader.lua.in
   			m4 -DSHARED_LIB_PATH=$(luadir)				\
 Index: patches/patch-configure
 ===================================================================
 RCS file: /cvsroot/pkgsrc/databases/lua-sqlite3/patches/patch-configure,v
 retrieving revision 1.2
 diff -u -r1.2 patch-configure
 --- patches/patch-configure	3 May 2014 13:01:24 -0000	1.2
 +++ patches/patch-configure	29 Aug 2019 14:24:53 -0000
 @@ -1,14 +1,17 @@
  $NetBSD: patch-configure,v 1.2 2014/05/03 13:01:24 alnsn Exp $

  nm -D is not portable, but -llua is needed anyway.
 +Linking directly to lua is not useful for a module.  

  --- configure.orig	2006-05-11 11:23:29.000000000 +0000
  +++ configure
 -@@ -3513,7 +3513,6 @@ fi
 +@@ -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
 +-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
 Index: patches/patch-libluasqlite3.c
 ===================================================================
 RCS file: /cvsroot/pkgsrc/databases/lua-sqlite3/patches/patch-libluasqlite3.c,v
 retrieving revision 1.1
 diff -u -r1.1 patch-libluasqlite3.c
 --- patches/patch-libluasqlite3.c	3 May 2014 13:01:24 -0000	1.1
 +++ patches/patch-libluasqlite3.c	29 Aug 2019 14:24:53 -0000
 @@ -1,5 +1,8 @@
  $NetBSD: patch-libluasqlite3.c,v 1.1 2014/05/03 13:01:24 alnsn Exp $

 +* Adapt module to lua 5.2
 +* luaL_typerror does not exist anymore with lua 5.2. Make an equivalent version
 +
  --- libluasqlite3.c.orig	2006-05-11 11:06:16.000000000 +0000
  +++ libluasqlite3.c
  @@ -302,10 +302,28 @@ static void report_error(lua_State * L, 

 --Apple-Mail=_5E1F1BAB-4E2E-4981-B915-4FFF38D8E26F--

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.