commit:     e86f2d6edad50bc23e970dd413171d28ff54ba65
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Sep  4 23:55:46 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Sep  4 23:55:46 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e86f2d6e

net-analyzer/nmap: fix build with < OpenSSL 3; don't automagically detect 
python2

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

 net-analyzer/nmap/nmap-7.93.ebuild | 17 +++++++++++++++--
 net-analyzer/nmap/nmap-9999.ebuild | 17 +++++++++++++++--
 2 files changed, 30 insertions(+), 4 deletions(-)

diff --git a/net-analyzer/nmap/nmap-7.93.ebuild 
b/net-analyzer/nmap/nmap-7.93.ebuild
index 9470b5ddbf08..c65faf378336 100644
--- a/net-analyzer/nmap/nmap-7.93.ebuild
+++ b/net-analyzer/nmap/nmap-7.93.ebuild
@@ -5,7 +5,8 @@ EAPI=8
 
 LUA_COMPAT=( lua5-3 )
 LUA_REQ_USE="deprecated"
-inherit autotools lua-single toolchain-funcs
+PYTHON_COMPAT=( python3_{8..11} )
+inherit autotools flag-o-matic lua-single python-any-r1 toolchain-funcs
 
 DESCRIPTION="Network exploration tool and security / port scanner"
 HOMEPAGE="https://nmap.org/";
@@ -51,7 +52,10 @@ RDEPEND="
        system-lua? ( ${LUA_DEPS} )
 "
 DEPEND="${RDEPEND}"
-BDEPEND="virtual/pkgconfig"
+BDEPEND="
+       ${PYTHON_DEPS}
+       virtual/pkgconfig
+"
 
 if [[ ${PV} != *9999* ]] ; then
        BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-nmap )"
@@ -71,6 +75,8 @@ PATCHES=(
 )
 
 pkg_setup() {
+       python-any-r1_pkg_setup
+
        use system-lua && lua-single_pkg_setup
 }
 
@@ -96,6 +102,13 @@ src_prepare() {
 }
 
 src_configure() {
+       export ac_cv_path_PYTHON="${PYTHON}"
+       export am_cv_pathless_PYTHON="${EPYTHON}"
+
+       # Workaround for https://github.com/nmap/nmap/issues/2516
+       # bug #868483
+       append-cppflags -DOPENSSL_API_COMPAT=10101
+
        # The bundled libdnet is incompatible with the version available in the
        # tree, so we cannot use the system library here.
        econf \

diff --git a/net-analyzer/nmap/nmap-9999.ebuild 
b/net-analyzer/nmap/nmap-9999.ebuild
index 9470b5ddbf08..c65faf378336 100644
--- a/net-analyzer/nmap/nmap-9999.ebuild
+++ b/net-analyzer/nmap/nmap-9999.ebuild
@@ -5,7 +5,8 @@ EAPI=8
 
 LUA_COMPAT=( lua5-3 )
 LUA_REQ_USE="deprecated"
-inherit autotools lua-single toolchain-funcs
+PYTHON_COMPAT=( python3_{8..11} )
+inherit autotools flag-o-matic lua-single python-any-r1 toolchain-funcs
 
 DESCRIPTION="Network exploration tool and security / port scanner"
 HOMEPAGE="https://nmap.org/";
@@ -51,7 +52,10 @@ RDEPEND="
        system-lua? ( ${LUA_DEPS} )
 "
 DEPEND="${RDEPEND}"
-BDEPEND="virtual/pkgconfig"
+BDEPEND="
+       ${PYTHON_DEPS}
+       virtual/pkgconfig
+"
 
 if [[ ${PV} != *9999* ]] ; then
        BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-nmap )"
@@ -71,6 +75,8 @@ PATCHES=(
 )
 
 pkg_setup() {
+       python-any-r1_pkg_setup
+
        use system-lua && lua-single_pkg_setup
 }
 
@@ -96,6 +102,13 @@ src_prepare() {
 }
 
 src_configure() {
+       export ac_cv_path_PYTHON="${PYTHON}"
+       export am_cv_pathless_PYTHON="${EPYTHON}"
+
+       # Workaround for https://github.com/nmap/nmap/issues/2516
+       # bug #868483
+       append-cppflags -DOPENSSL_API_COMPAT=10101
+
        # The bundled libdnet is incompatible with the version available in the
        # tree, so we cannot use the system library here.
        econf \

Reply via email to