1{
2 lib,
3 buildPythonPackage,
4 chardet,
5 fetchFromGitHub,
6 setuptools,
7 karton-core,
8 pytestCheckHook,
9 python-magic,
10 yara-python,
11 pythonOlder,
12}:
13
14buildPythonPackage rec {
15 pname = "karton-classifier";
16 version = "2.1.0";
17 pyproject = true;
18
19 disabled = pythonOlder "3.7";
20
21 src = fetchFromGitHub {
22 owner = "CERT-Polska";
23 repo = "karton-classifier";
24 tag = "v${version}";
25 hash = "sha256-YqxRiQ/kJheEJpYDqRNu9FydfnNX3OlGjgfX9Hwv+dM=";
26 };
27
28 pythonRelaxDeps = [
29 "chardet"
30 "python-magic"
31 ];
32
33 build-system = [ setuptools ];
34
35 dependencies = [
36 chardet
37 karton-core
38 python-magic
39 yara-python
40 ];
41
42 nativeCheckInputs = [ pytestCheckHook ];
43
44 pythonImportsCheck = [ "karton.classifier" ];
45
46 disabledTests = [
47 # Tests expecting results from a different version of libmagic
48 "test_process_archive"
49 "test_process_misc_csv"
50 "test_process_runnable_win32_jar"
51 "test_process_runnable_win32_lnk"
52 ];
53
54 meta = with lib; {
55 description = "File type classifier for the Karton framework";
56 homepage = "https://github.com/CERT-Polska/karton-classifier";
57 changelog = "https://github.com/CERT-Polska/karton-classifier/releases/tag/v${version}";
58 license = licenses.bsd3;
59 maintainers = with maintainers; [ fab ];
60 mainProgram = "karton-classifier";
61 };
62}