NetBSD Problem Report #54797

From www@netbsd.org  Wed Dec 25 02:14:28 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 8021E7A182
	for <gnats-bugs@gnats.NetBSD.org>; Wed, 25 Dec 2019 02:14:28 +0000 (UTC)
Message-Id: <20191225021427.7AB1B7A18E@mollari.NetBSD.org>
Date: Wed, 25 Dec 2019 02:14:27 +0000 (UTC)
From: jonthn+pkgsrc@pinacea.com
Reply-To: jonthn+pkgsrc@pinacea.com
To: gnats-bugs@NetBSD.org
Subject: devel/lua-filesystem fails to buid due to missing lua link information
X-Send-Pr-Version: www-1.0

>Number:         54797
>Category:       pkg
>Synopsis:       devel/lua-filesystem fails to buid due to missing lua link information
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Wed Dec 25 02:15:00 +0000 2019
>Last-Modified:  Wed May 27 19:40:52 +0000 2020
>Originator:     Jonathan Buschmann
>Release:        pkgsrc current tree 20191224
>Organization:
>Environment:
>Description:
Currently it fails to link as the patch for the config file contains a small mistake see the diff below that would fix it.

I did not check the commit made earlier this year otherwise I would have provided the patch earlier.

This contains some changes that may not be required, I'm talking about the usage of _LUA_DOT_VERSION
>How-To-Repeat:
Try to build devel/lua-filesystem
>Fix:
diff --git i/devel/lua-filesystem/Makefile w/devel/lua-filesystem/Makefile
index 32a735eac30..ab59c9282d8 100644
--- i/devel/lua-filesystem/Makefile
+++ w/devel/lua-filesystem/Makefile
@@ -21,7 +21,7 @@ BUILD_TARGET=         lib
 TEST_TARGET=           test

 MAKE_ENV+=             LUA_CDIR=${LUA_CDIR}
-MAKE_ENV+=             LUA_VERS=${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}
+MAKE_ENV+=             LUA_VERS=${_LUA_DOT_VERSION}

 .include "../../lang/lua/module.mk"
 .include "../../mk/bsd.pkg.mk"
diff --git i/devel/lua-filesystem/distinfo w/devel/lua-filesystem/distinfo
index fc084f89e6b..8c7ad24663c 100644
--- i/devel/lua-filesystem/distinfo
+++ w/devel/lua-filesystem/distinfo
@@ -5,4 +5,4 @@ RMD160 (luafilesystem-1.7.0.tar.gz) = 6770d25f1d0928c347560425d7c5758788038fd9
 SHA512 (luafilesystem-1.7.0.tar.gz) = a1d4d077776e57cd878dbcd21656da141ea3686c587b5420a2b039aeaf086b7e7d05d531ee1cc2bbd7d06660d1315b09593e52143f6711f033ce8eecdc550511
 Size (luafilesystem-1.7.0.tar.gz) = 30877 bytes
 SHA1 (patch-Makefile) = 1fd838ba0f5a716ed1f8f7b7ed4fda816e702806
-SHA1 (patch-config) = 5d459797960118aa387f1f5cfb8bc6d7923965c8
+SHA1 (patch-config) = d2b9aabe1196b100edbd7521517d49b5281d69cb
diff --git i/devel/lua-filesystem/patches/patch-config w/devel/lua-filesystem/patches/patch-config
index ed6a3a90ea6..1d7cbaef600 100644
--- i/devel/lua-filesystem/patches/patch-config
+++ w/devel/lua-filesystem/patches/patch-config
@@ -15,7 +15,7 @@ Try to find lua libs from pkgconfig, so we get RPATH specified.

  # System's libraries directory (where binary libraries are installed)
 -LUA_LIBDIR= $(PREFIX)/lib/lua/5.1
-+LUA_LIBS= $(pkg-config --libs lua-$(LUA_VERS))
++LUA_LIBS= $(shell pkg-config --libs lua-$(LUA_VERS))
 +LUA_LIBDIR= $(DESTDIR)$(PREFIX)/$(LUA_CDIR)

  # Lua includes directory

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: pkg-manager->fhajny
Responsible-Changed-By: leot@NetBSD.org
Responsible-Changed-When: Wed, 25 Dec 2019 08:34:50 +0000
Responsible-Changed-Why:
Filip, can you please give it a look?
(over to MAINTAINER)


From: Jonathan Buschmann <jonthn+pkgsrc@pinacea.com>
To: gnats-bugs@netbsd.org
Cc: fhajny@netbsd.org,
 pkg-manager@netbsd.org,
 pkgsrc-bugs@netbsd.org,
 gnats-admin@netbsd.org,
 "leot@netbsd.org" <leot@NetBSD.org>
Subject: Re: pkg/54797 (devel/lua-filesystem fails to buid due to missing lua
 link information)
Date: Tue, 31 Dec 2019 21:56:51 +0800

 Hello,

 Not sure if it=E2=80=99s the proper way to reply/follow-up on this =
 issue.
 But I found that in order to be able to use a Lua module such as this =
 one, it=E2=80=99s better not to link directly with the Lua library.
 Consequently if you can take into consideration this diff=20

 --- i/devel/lua-filesystem/patches/patch-config
 +++ w/devel/lua-filesystem/patches/patch-config
 @@ -15,7 +15,7 @@ Try to find lua libs from pkgconfig, so we get RPATH =
 specified.
  =20
   # System's libraries directory (where binary libraries are installed)
  -LUA_LIBDIR=3D $(PREFIX)/lib/lua/5.1
 -+LUA_LIBS=3D $(pkg-config --libs lua-$(LUA_VERS))
 ++LUA_LIBS=3D $(shell pkg-config --libs lua-$(LUA_VERS))
  +LUA_LIBDIR=3D $(DESTDIR)$(PREFIX)/$(LUA_CDIR)
  =20
   # Lua includes directory
 @@ -26,7 +26,7 @@ Try to find lua libs from pkgconfig, so we get RPATH =
 specified.
  -#LIB_OPTION=3D -bundle -undefined dynamic_lookup #for MacOS X
  +ifeq ($(shell uname -s 2>/dev/null), Darwin)
  +# for macOS
 -+LIB_OPTION+=3D -L$(PREFIX)/lib $(LUA_LIBS) -shared -install_name =
 $(PREFIX)/$(LUA_CDIR)/$(notdir $@)
 ++LIB_OPTION=3D -install_name $(PREFIX)/$(LUA_CDIR)/$(notdir $@) -shared =
 -undefined dynamic_lookup
  +else
  +# for Linux & other unix
  +LIB_OPTION+=3D -L$(PREFIX)/lib $(LUA_LIBS) -shared

 I suspect the LIB_OPTION for Unix (*BSD, Linux, ..) should not include =
 $(LUA_LIBS) but I don=E2=80=99t have a system to try this :(

 Basically in order to be sure that a module works it would be to do =
 something like this :

 luajit -e 'require =E2=80=9Clfs"';  lua5.1  -e 'require =E2=80=9Clfs=E2=80=
 =9D'

 If no output then it works.

 Thank you for your time

 > On 25 Dec 2019, at 16:34, leot@netbsd.org <leot@NetBSD.org> wrote:
 >=20
 > Synopsis: devel/lua-filesystem fails to buid due to missing lua link =
 information
 >=20
 > Responsible-Changed-From-To: pkg-manager->fhajny
 > Responsible-Changed-By: leot@NetBSD.org
 > Responsible-Changed-When: Wed, 25 Dec 2019 08:34:50 +0000
 > Responsible-Changed-Why:
 > Filip, can you please give it a look?
 > (over to MAINTAINER)
 >=20
 >=20
 >=20

Responsible-Changed-From-To: fhajny->pkg-manager
Responsible-Changed-By: wiz@NetBSD.org
Responsible-Changed-When: Wed, 27 May 2020 19:40:52 +0000
Responsible-Changed-Why:
Maintainer was reset


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.