python3Packages.netmap: init at 0.7.0.2

This commit is contained in:
Robert Schütz 2021-06-30 09:16:13 +02:00
parent 4ba0ccc59e
commit e0d776fab3
3 changed files with 62 additions and 0 deletions

View File

@ -0,0 +1,43 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, substituteAll
, nmap
, python
}:
buildPythonPackage rec {
pname = "netmap";
version = "0.7.0.2";
src = fetchFromGitHub {
owner = "home-assistant-libs";
repo = "python-nmap";
rev = version;
sha256 = "1a44zz9zsxy48ahlpjjrddpyfi7cnfknicfcp35hi588qm430mag";
};
patches = [
(substituteAll {
src = ./nmap-path.patch;
nmap = "${lib.getBin nmap}/bin/nmap";
})
];
# upstream tests require sudo
# make sure nmap is found instead
checkPhase = ''
runHook preCheck
${python.interpreter} -c 'import nmap; nmap.PortScanner()'
runHook postCheck
'';
pythonImportsCheck = [ "nmap" ];
meta = with lib; {
description = "Python class to use nmap and access scan results from python3";
homepage = "https://github.com/home-assistant-libs/python-nmap";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ dotlambda ];
};
}

View File

@ -0,0 +1,17 @@
diff --git a/nmap/nmap.py b/nmap/nmap.py
index 91c460d..8c5ff0a 100755
--- a/nmap/nmap.py
+++ b/nmap/nmap.py
@@ -77,11 +77,7 @@ class PortScanner(object):
def __init__(
self,
nmap_search_path=(
- "nmap",
- "/usr/bin/nmap",
- "/usr/local/bin/nmap",
- "/sw/bin/nmap",
- "/opt/local/bin/nmap",
+ "@nmap@",
),
):
"""

View File

@ -5233,6 +5233,8 @@ in {
phonenumbers = callPackage ../development/python-modules/phonenumbers { };
netmap = callPackage ../development/python-modules/netmap { };
openapi-core = callPackage ../development/python-modules/openapi-core { };
pdunehd = callPackage ../development/python-modules/pdunehd { };