at master 969 B view raw
1{ 2 lib, 3 buildPythonPackage, 4 fetchFromGitHub, 5 replaceVars, 6 nmap, 7 python, 8}: 9 10buildPythonPackage rec { 11 pname = "netmap"; 12 version = "0.7.0.2"; 13 format = "setuptools"; 14 15 src = fetchFromGitHub { 16 owner = "home-assistant-libs"; 17 repo = "python-nmap"; 18 rev = version; 19 sha256 = "1a44zz9zsxy48ahlpjjrddpyfi7cnfknicfcp35hi588qm430mag"; 20 }; 21 22 patches = [ 23 (replaceVars ./nmap-path.patch { 24 nmap = "${lib.getBin nmap}/bin/nmap"; 25 }) 26 ]; 27 28 # upstream tests require sudo 29 # make sure nmap is found instead 30 checkPhase = '' 31 runHook preCheck 32 ${python.interpreter} -c 'import nmap; nmap.PortScanner()' 33 runHook postCheck 34 ''; 35 36 pythonImportsCheck = [ "nmap" ]; 37 38 meta = with lib; { 39 description = "Python class to use nmap and access scan results from python3"; 40 homepage = "https://github.com/home-assistant-libs/python-nmap"; 41 license = licenses.gpl3Plus; 42 maintainers = with maintainers; [ dotlambda ]; 43 }; 44}