pkgsrc-Bugs archive

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

Re: pkg/52624: Can't compile net/nmap from pkgsrc with lua support



The following reply was made to PR pkg/52624; it has been noted by GNATS.

From: Leonardo Taccari <leot%NetBSD.org@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: pkg/52624: Can't compile net/nmap from pkgsrc with lua support
Date: Thu, 19 Oct 2017 12:27:45 +0200

 Hello Patrick, Thomas and pkgsrc-bugs@ readers,
 
 Thomas Klausner writes:
 > This looks like it's building the included copy of lua. It should use
 > the installed one. Can you find out why it doesn't?
 
 Good observation!
 
 TLDR: setting LUA_VERSIONS_ACCEPTED to 53 should fix this problem,
 candidate patch here:
 
  https://NetBSD.org/~leot/pkgsrc-patches/nmap-use-pkgsrc-lua53-fix.patch
 
 Patrick, can you please apply it and let us known if it fixes the
 problem you're seeing?
 
 
 OK, here the long version (if you're interested)!
 
 If I'm not missing something if `LUA_VERSION_DEFAULT !=3D 53' (by default
 pkgsrc prefers Lua 5.2) nmap silently just use its internal Lua.
 To quickly checks that:
 
  % nm `which nmap`
 
 should reveal a `T lua_isyieldable' line (without the candidate patch
 not applied and with pkgsrc's LUA_VERSION_DEFAULT !=3D 53).
 
 This happened because in nmap configure.ac lua_isyieldable() is
 esplicitly checked:
 
    826    # If they didn't specify it, we try to find it
    827    if test $have_lua !=3D yes; then
    828      AC_CHECK_HEADERS([lua5.3/lua.h lua/5.3/lua.h lua.h lua/lua.h],
    829        AC_CHECK_LIB(lua5.3, lua_isyieldable, [have_lua=3Dyes; LIBLU=
 A_LIBS=3D"-llua5.3"; CPPFLAGS=3D"-I/usr/include/lua5.3 $CPPFLAGS"; break],=
 , [-lm])
    830        AC_CHECK_LIB(lua53, lua_isyieldable, [have_lua=3Dyes; LIBLUA=
 _LIBS=3D"-llua53"; CPPFLAGS=3D"-I/usr/include/lua53 $CPPFLAGS"; break],, [=
 -lm])
    831        AC_CHECK_LIB(lua, lua_isyieldable, [have_lua=3Dyes; LIBLUA_L=
 IBS=3D"-llua"; CPPFLAGS=3D"-I/usr/include/lua $CPPFLAGS"; break],, [-lm])
    832      )
 
 ...but if this test fail (for Lua 5.1 and 5.2) `have_lua' variable isn't
 set to `yes' and few lines later - due that - the internal version is
 used.
 
 Just setting LUA_VERSIONS_ACCEPTED to 53 in net/nmap/options.mk
 should fix this problem (a side-note, configure.ac:835 contains a
 `# We need Lua 5.2 exactly' comment but in reality the LUA_VERSION_NUM
 checked is 503, hence Lua 5.3).
 
 The following patch should address that:
 
  https://NetBSD.org/~leot/pkgsrc-patches/nmap-use-pkgsrc-lua53-fix.patch
 
 or, for completeness at the end of this email a version of it inline
 (without a candidate commit message).
 
 Patrick, can you please try that patch and let us know if it fixes the
 issue?
 
 
 Thank you!
 
 
 -------------------8<-------------------8<---------------------
 Index: Makefile
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
 RCS file: /cvsroot/pkgsrc/net/nmap/Makefile,v
 retrieving revision 1.136
 diff -u -p -r1.136 Makefile
 --- Makefile	3 Aug 2017 13:52:00 -0000	1.136
 +++ Makefile	19 Oct 2017 09:56:43 -0000
 @@ -1,6 +1,7 @@
  # $NetBSD: Makefile,v 1.136 2017/08/03 13:52:00 adam Exp $
  =
 
  DISTNAME=3D	nmap-7.60
 +PKGREVISION=3D	1
  CATEGORIES=3D	net security
  MASTER_SITES=3D	http://nmap.org/dist/
  EXTRACT_SUFX=3D	.tar.bz2
 Index: options.mk
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
 RCS file: /cvsroot/pkgsrc/net/nmap/options.mk,v
 retrieving revision 1.18
 diff -u -p -r1.18 options.mk
 --- options.mk	1 Jan 2017 14:43:50 -0000	1.18
 +++ options.mk	19 Oct 2017 09:56:43 -0000
 @@ -37,6 +37,7 @@ CONFIGURE_ARGS+=3D	--without-zenmap
  .endif
  =
 
  .if !empty(PKG_OPTIONS:Mlua)
 +LUA_VERSIONS_ACCEPTED=3D	53	# needs lua_isyieldable, introduced in Lua 5.=
 3
  .include "../../lang/lua/buildlink3.mk"
  CONFIGURE_ARGS+=3D	--with-liblua=3D${BUILDLINK_PREFIX.lua}
  PLIST.lua=3D		yes
 


Home | Main Index | Thread Index | Old Index