pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/54496: databases/lua-qlite3 relative library path, build tools missing



>Number:         54496
>Category:       pkg
>Synopsis:       databases/lua-qlite3 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
>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, 



Home | Main Index | Thread Index | Old Index