1{
2 lib,
3 antlr4_9,
4 antlr4-python3-runtime,
5 buildPythonPackage,
6 fetchFromGitHub,
7 pytestCheckHook,
8 pythonOlder,
9 setuptools,
10 six,
11}:
12
13buildPythonPackage rec {
14 pname = "stix2-patterns";
15 version = "2.0.0";
16 pyproject = true;
17
18 disabled = pythonOlder "3.7";
19
20 src = fetchFromGitHub {
21 owner = "oasis-open";
22 repo = "cti-pattern-validator";
23 tag = "v${version}";
24 hash = "sha256-lFgnvI5a7U7/Qj4Pqjr3mx4TNDnC2/Ru7tVG7VggR7Y=";
25 };
26
27 build-system = [ setuptools ];
28
29 dependencies = [
30 (antlr4-python3-runtime.override { antlr4 = antlr4_9; })
31 six
32 ];
33
34 nativeCheckInputs = [ pytestCheckHook ];
35
36 pythonImportsCheck = [ "stix2patterns" ];
37
38 meta = with lib; {
39 description = "Validate patterns used to express cyber observable content in STIX Indicators";
40 mainProgram = "validate-patterns";
41 homepage = "https://github.com/oasis-open/cti-pattern-validator";
42 changelog = "https://github.com/oasis-open/cti-pattern-validator/blob/${version}/CHANGELOG.rst";
43 license = licenses.bsd3;
44 maintainers = with maintainers; [ fab ];
45 };
46}