depot/third_party/nixpkgs/pkgs/development/python-modules/netmap/default.nix
Default email fa5436e0a7 Project import generated by Copybara.
GitOrigin-RevId: e8057b67ebf307f01bdcc8fba94d94f75039d1f6
2024-06-05 17:53:02 +02:00

45 lines
986 B
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
substituteAll,
nmap,
python,
}:
buildPythonPackage rec {
pname = "netmap";
version = "0.7.0.2";
format = "setuptools";
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 ];
};
}