2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
chardet,
|
|
|
|
fetchFromGitHub,
|
2024-09-19 14:19:46 +00:00
|
|
|
setuptools,
|
2024-06-05 15:53:02 +00:00
|
|
|
karton-core,
|
|
|
|
pytestCheckHook,
|
|
|
|
python-magic,
|
|
|
|
pythonOlder,
|
2021-04-12 18:23:04 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "karton-classifier";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "2.0.0";
|
2024-09-19 14:19:46 +00:00
|
|
|
pyproject = true;
|
2021-10-01 09:20:50 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2021-04-12 18:23:04 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "CERT-Polska";
|
2024-09-19 14:19:46 +00:00
|
|
|
repo = "karton-classifier";
|
2023-02-16 17:41:37 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2023-07-15 17:15:38 +00:00
|
|
|
hash = "sha256-DH8I4Lbbs2TVMvYlvh/P2I/7O4+VechP2JDDVHNsTSg=";
|
2021-04-12 18:23:04 +00:00
|
|
|
};
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
pythonRelaxDeps = [
|
|
|
|
"chardet"
|
|
|
|
"python-magic"
|
|
|
|
];
|
|
|
|
|
|
|
|
build-system = [ setuptools ];
|
|
|
|
|
|
|
|
dependencies = [
|
2021-04-12 18:23:04 +00:00
|
|
|
chardet
|
|
|
|
karton-core
|
2022-05-18 14:49:53 +00:00
|
|
|
python-magic
|
2021-04-12 18:23:04 +00:00
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2022-08-12 12:06:08 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "karton.classifier" ];
|
2021-04-12 18:23:04 +00:00
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
disabledTests = [
|
|
|
|
# Tests expecting results from a different version of libmagic
|
|
|
|
"test_process_archive_ace"
|
|
|
|
"test_process_runnable_win32_lnk"
|
2023-10-09 19:29:22 +00:00
|
|
|
"test_process_misc_csv"
|
2022-08-12 12:06:08 +00:00
|
|
|
];
|
2021-04-12 18:23:04 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "File type classifier for the Karton framework";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "karton-classifier";
|
2021-04-12 18:23:04 +00:00
|
|
|
homepage = "https://github.com/CERT-Polska/karton-classifier";
|
2023-02-16 17:41:37 +00:00
|
|
|
changelog = "https://github.com/CERT-Polska/karton-classifier/releases/tag/v${version}";
|
2021-04-12 18:23:04 +00:00
|
|
|
license = with licenses; [ bsd3 ];
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|