1{
2 lib,
3 antlr4-python3-runtime,
4 buildPythonPackage,
5 fetchFromGitHub,
6 pytestCheckHook,
7 pythonOlder,
8 setuptools,
9 six,
10}:
11
12buildPythonPackage rec {
13 pname = "stix2-patterns";
14 version = "2.0.0";
15 pyproject = true;
16
17 disabled = pythonOlder "3.7";
18
19 src = fetchFromGitHub {
20 owner = "oasis-open";
21 repo = "cti-pattern-validator";
22 tag = "v${version}";
23 hash = "sha256-lFgnvI5a7U7/Qj4Pqjr3mx4TNDnC2/Ru7tVG7VggR7Y=";
24 };
25
26 build-system = [ setuptools ];
27
28 dependencies = [
29 antlr4-python3-runtime
30 six
31 ];
32
33 nativeCheckInputs = [ pytestCheckHook ];
34
35 pythonImportsCheck = [ "stix2patterns" ];
36
37 meta = with lib; {
38 broken = lib.versionAtLeast antlr4-python3-runtime.version "4.10";
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}