1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 fetchpatch,
6 lxml,
7 mixbox,
8 pytestCheckHook,
9 python-dateutil,
10 pythonOlder,
11 setuptools,
12}:
13
14buildPythonPackage rec {
15 pname = "cybox";
16 version = "2.1.0.21";
17 pyproject = true;
18
19 disabled = pythonOlder "3.9";
20
21 src = fetchFromGitHub {
22 owner = "CybOXProject";
23 repo = "python-cybox";
24 tag = "v${version}";
25 hash = "sha256-Gn/gH7pvvOqLIGExgCNa5KswPazIZUZXdQe3LRAUVjw=";
26 };
27
28 patches = [
29 # Import ABC from collections.abc for Python 3 compatibility, https://github.com/CybOXProject/python-cybox/pull/332
30 (fetchpatch {
31 name = "collections-abc.patch";
32 url = "https://github.com/CybOXProject/python-cybox/commit/fd4631dac12943d89e9ea2e94105cbc3b81d52f9.patch";
33 hash = "sha256-dXEsJujtbU/SuUBge8abWgMPeYO1ZR3c5758Bd0dnwE=";
34 })
35 ];
36
37 build-system = [ setuptools ];
38
39 dependencies = [
40 lxml
41 mixbox
42 python-dateutil
43 ];
44
45 nativeCheckInputs = [ pytestCheckHook ];
46
47 pythonImportsCheck = [ "cybox" ];
48
49 meta = {
50 description = "Library for parsing, manipulating, and generating CybOX content";
51 homepage = "https://github.com/CybOXProject/python-cybox/";
52 changelog = "https://github.com/CybOXProject/python-cybox/blob/${src.rev}/CHANGES.txt";
53 license = lib.licenses.bsd3;
54 maintainers = with lib.maintainers; [ fab ];
55 };
56}