commit:     54c3961cd8fd050411752bc036f2e6d24b1aa075
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Apr  2 21:54:10 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Apr  2 21:56:57 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=54c3961c

net-analyzer/nmap: tidy up system-lua logic

In 5bb392d690d47baf051b7efaea990a0afda25618, we unmasked system-lua, but iamben
points out the REQUIRED_USE logic was backwards here where system-lua needed
nse on rather than the other way around.

Fix that by just dropping system-lua as a flag, so we now always use the
system Lua if we need it (i.e. if we're building nse).

Bug: https://bugs.gentoo.org/253269
Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-analyzer/nmap/metadata.xml                            |  1 -
 .../nmap/{nmap-7.92-r2.ebuild => nmap-7.92-r3.ebuild}     | 14 ++++++++------
 .../nmap/{nmap-7.93-r2.ebuild => nmap-7.93-r3.ebuild}     | 14 ++++++++------
 net-analyzer/nmap/nmap-9999.ebuild                        | 15 +++++++++------
 4 files changed, 25 insertions(+), 19 deletions(-)

diff --git a/net-analyzer/nmap/metadata.xml b/net-analyzer/nmap/metadata.xml
index e31f57e3f592..c93c9fdc4493 100644
--- a/net-analyzer/nmap/metadata.xml
+++ b/net-analyzer/nmap/metadata.xml
@@ -16,7 +16,6 @@
                <flag name="nping">Install the nping utility</flag>
                <flag name="nse">Include support for the Nmap Scripting Engine 
(NSE)</flag>
                <flag name="symlink">Install symlink to nc</flag>
-               <flag name="system-lua">Use <pkg>dev-lang/lua</pkg> instead of 
the bundled liblua</flag>
                <flag name="zenmap">Install the GTK+ based nmap GUI, 
zenmap</flag>
        </use>
        <upstream>

diff --git a/net-analyzer/nmap/nmap-7.92-r2.ebuild 
b/net-analyzer/nmap/nmap-7.92-r3.ebuild
similarity index 91%
rename from net-analyzer/nmap/nmap-7.92-r2.ebuild
rename to net-analyzer/nmap/nmap-7.92-r3.ebuild
index 2c418afbe2a5..62e1a494d022 100644
--- a/net-analyzer/nmap/nmap-7.92-r2.ebuild
+++ b/net-analyzer/nmap/nmap-7.92-r3.ebuild
@@ -26,9 +26,9 @@ else
 fi
 
 SLOT="0"
-IUSE="ipv6 libssh2 ncat nping +nse ssl symlink +system-lua"
+IUSE="ipv6 libssh2 ncat nping +nse ssl symlink"
 REQUIRED_USE="
-       system-lua? ( nse ${LUA_REQUIRED_USE} )
+       nse? ( ${LUA_REQUIRED_USE} )
        symlink? ( ncat )
 "
 
@@ -40,13 +40,15 @@ RDEPEND="
                net-libs/libssh2[zlib]
                sys-libs/zlib
        )
-       nse? ( sys-libs/zlib )
+       nse? (
+               ${LUA_DEPS}
+               sys-libs/zlib
+       )
        ssl? ( dev-libs/openssl:0= )
        symlink? (
                !net-analyzer/netcat
                !net-analyzer/openbsd-netcat
        )
-       system-lua? ( ${LUA_DEPS} )
 "
 DEPEND="${RDEPEND}"
 
@@ -67,7 +69,7 @@ PATCHES=(
 )
 
 pkg_setup() {
-       use system-lua && lua-single_pkg_setup
+       use nse && lua-single_pkg_setup
 }
 
 src_prepare() {
@@ -99,9 +101,9 @@ src_configure() {
                $(use_with libssh2) \
                $(use_with ncat) \
                $(use_with nping) \
+               $(use_with nse liblua) \
                $(use_with ssl openssl) \
                $(usex libssh2 --with-zlib) \
-               $(usex nse --with-liblua=$(usex system-lua yes included '' '') 
--without-liblua) \
                $(usex nse --with-zlib) \
                --cache-file="${S}"/config.cache \
                --with-libdnet=included \

diff --git a/net-analyzer/nmap/nmap-7.93-r2.ebuild 
b/net-analyzer/nmap/nmap-7.93-r3.ebuild
similarity index 92%
rename from net-analyzer/nmap/nmap-7.93-r2.ebuild
rename to net-analyzer/nmap/nmap-7.93-r3.ebuild
index 0b02e213c5e4..d2a477897b76 100644
--- a/net-analyzer/nmap/nmap-7.93-r2.ebuild
+++ b/net-analyzer/nmap/nmap-7.93-r3.ebuild
@@ -28,9 +28,9 @@ fi
 # https://github.com/nmap/nmap/issues/2199
 LICENSE="|| ( NPSL-0.94 NPSL-0.95 )"
 SLOT="0"
-IUSE="ipv6 libssh2 ncat nping +nse ssl symlink +system-lua"
+IUSE="ipv6 libssh2 ncat nping +nse ssl symlink"
 REQUIRED_USE="
-       system-lua? ( nse ${LUA_REQUIRED_USE} )
+       nse? ( ${LUA_REQUIRED_USE} )
        symlink? ( ncat )
 "
 
@@ -42,7 +42,10 @@ RDEPEND="
                net-libs/libssh2[zlib]
                sys-libs/zlib
        )
-       nse? ( sys-libs/zlib )
+       nse? (
+               ${LUA_DEPS}
+               sys-libs/zlib
+       )
        ssl? ( dev-libs/openssl:0= )
        symlink? (
                ncat? (
@@ -50,7 +53,6 @@ RDEPEND="
                        !net-analyzer/openbsd-netcat
                )
        )
-       system-lua? ( ${LUA_DEPS} )
 "
 DEPEND="${RDEPEND}"
 BDEPEND="
@@ -79,7 +81,7 @@ PATCHES=(
 pkg_setup() {
        python-any-r1_pkg_setup
 
-       use system-lua && lua-single_pkg_setup
+       use nse && lua-single_pkg_setup
 }
 
 src_prepare() {
@@ -114,9 +116,9 @@ src_configure() {
                $(use_with libssh2) \
                $(use_with ncat) \
                $(use_with nping) \
+               $(use_with nse liblua) \
                $(use_with ssl openssl) \
                $(usex libssh2 --with-zlib) \
-               $(usex nse --with-liblua=$(usex system-lua yes included '' '') 
--without-liblua) \
                $(usex nse --with-zlib) \
                --cache-file="${S}"/config.cache \
                --with-libdnet=included \

diff --git a/net-analyzer/nmap/nmap-9999.ebuild 
b/net-analyzer/nmap/nmap-9999.ebuild
index 8617f57210bf..f18840ef8839 100644
--- a/net-analyzer/nmap/nmap-9999.ebuild
+++ b/net-analyzer/nmap/nmap-9999.ebuild
@@ -30,10 +30,10 @@ fi
 # https://github.com/nmap/nmap/issues/2199
 LICENSE="NPSL-0.95"
 SLOT="0"
-IUSE="ipv6 libssh2 ncat ndiff nping nls +nse ssl symlink +system-lua zenmap"
+IUSE="ipv6 libssh2 ncat ndiff nping nls +nse ssl symlink zenmap"
 REQUIRED_USE="
        ${PYTHON_REQUIRED_USE}
-       system-lua? ( nse ${LUA_REQUIRED_USE} )
+       nse? ( ${LUA_REQUIRED_USE} )
        symlink? ( ncat )
 "
 
@@ -47,7 +47,10 @@ RDEPEND="
                sys-libs/zlib
        )
        nls? ( virtual/libintl )
-       nse? ( sys-libs/zlib )
+       nse? (
+               ${LUA_DEPS}
+               sys-libs/zlib
+       )
        ssl? ( dev-libs/openssl:= )
        symlink? (
                ncat? (
@@ -55,7 +58,6 @@ RDEPEND="
                        !net-analyzer/openbsd-netcat
                )
        )
-       system-lua? ( ${LUA_DEPS} )
        zenmap? (
                ${PYTHON_DEPS}
                $(python_gen_cond_dep '
@@ -64,6 +66,7 @@ RDEPEND="
        )
 "
 DEPEND="${RDEPEND}"
+# Python is always needed at build time for some scripts
 BDEPEND="
        ${PYTHON_DEPS}
        virtual/pkgconfig
@@ -90,7 +93,7 @@ PATCHES=(
 pkg_setup() {
        python-single-r1_pkg_setup
 
-       use system-lua && lua-single_pkg_setup
+       use nse && lua-single_pkg_setup
 }
 
 src_prepare() {
@@ -134,10 +137,10 @@ src_configure() {
                $(use_with ncat)
                $(use_with ndiff)
                $(use_with nping)
+               $(use_with nse liblua)
                $(use_with ssl openssl)
                $(use_with zenmap)
                $(usex libssh2 --with-zlib)
-               $(usex nse --with-liblua=$(usex system-lua yes included '' '') 
--without-liblua)
                $(usex nse --with-zlib)
                --cache-file="${S}"/config.cache
                # The bundled libdnet is incompatible with the version 
available in the

Reply via email to