2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
click,
|
|
|
|
cve,
|
|
|
|
fetchFromGitHub,
|
|
|
|
jsonschema,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
|
|
|
requests,
|
|
|
|
setuptools,
|
|
|
|
testers,
|
2022-10-21 18:38:19 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "cvelib";
|
2024-07-27 06:49:29 +00:00
|
|
|
version = "1.5.0";
|
2024-06-05 15:53:02 +00:00
|
|
|
pyproject = true;
|
2022-12-17 10:02:37 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2022-10-21 18:38:19 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "RedHatProductSecurity";
|
|
|
|
repo = "cvelib";
|
2024-06-05 15:53:02 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2024-07-27 06:49:29 +00:00
|
|
|
hash = "sha256-me61A1SyktPTd9u0t51kF4237/t9wiHqz+IVoyojMXY=";
|
2022-10-21 18:38:19 +00:00
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
postPatch = ''
|
|
|
|
# collective.checkdocs is unmaintained for over 10 years
|
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace-fail '"collective.checkdocs",' ""
|
|
|
|
'';
|
|
|
|
|
|
|
|
build-system = [ setuptools ];
|
|
|
|
|
|
|
|
dependencies = [
|
2022-12-17 10:02:37 +00:00
|
|
|
click
|
|
|
|
jsonschema
|
|
|
|
requests
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2022-10-21 18:38:19 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "cvelib" ];
|
2022-10-21 18:38:19 +00:00
|
|
|
|
2023-01-11 07:51:40 +00:00
|
|
|
passthru.tests.version = testers.testVersion { package = cve; };
|
|
|
|
|
2022-10-21 18:38:19 +00:00
|
|
|
meta = with lib; {
|
2022-12-17 10:02:37 +00:00
|
|
|
description = "Library and a command line interface for the CVE Services API";
|
2022-10-21 18:38:19 +00:00
|
|
|
homepage = "https://github.com/RedHatProductSecurity/cvelib";
|
2024-06-05 15:53:02 +00:00
|
|
|
changelog = "https://github.com/RedHatProductSecurity/cvelib/blob/${version}/CHANGELOG.md";
|
2022-10-21 18:38:19 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ raboof ];
|
2023-01-11 07:51:40 +00:00
|
|
|
mainProgram = "cve";
|
2022-10-21 18:38:19 +00:00
|
|
|
};
|
|
|
|
}
|