anki-bin: 24.06.3 -> 24.11 (#360722)
[NixPkgs.git] / pkgs / development / python-modules / yara-python / default.nix
blobfb894f05c22aff07d6c1576e2e2a9c9bb360d18f
2   lib,
3   buildPythonPackage,
4   fetchFromGitHub,
5   setuptools,
6   pytestCheckHook,
7   pythonOlder,
8   yara,
9 }:
11 buildPythonPackage rec {
12   pname = "yara-python";
13   version = "4.5.1";
14   pyproject = true;
16   disabled = pythonOlder "3.7";
18   src = fetchFromGitHub {
19     owner = "VirusTotal";
20     repo = "yara-python";
21     rev = "refs/tags/v${version}";
22     hash = "sha256-P+OQljzp+ZwVOXAgJqK7GNrqBep40MyVtMKDtT4ZUr8=";
23   };
25   # undefined symbol: yr_finalize
26   # https://github.com/VirusTotal/yara-python/issues/7
27   postPatch = ''
28     substituteInPlace setup.py \
29       --replace-fail "include_dirs=['yara/libyara/include', 'yara/libyara/', '.']" "libraries = ['yara']"
30   '';
32   build-system = [ setuptools ];
34   buildInputs = [ yara ];
36   nativeCheckInputs = [ pytestCheckHook ];
38   setupPyBuildFlags = [ "--dynamic-linking" ];
40   pytestFlagsArray = [ "tests.py" ];
42   pythonImportsCheck = [ "yara" ];
44   meta = with lib; {
45     description = "Python interface for YARA";
46     homepage = "https://github.com/VirusTotal/yara-python";
47     changelog = "https://github.com/VirusTotal/yara-python/releases/tag/v${version}";
48     license = licenses.asl20;
49     maintainers = with maintainers; [ fab ];
50   };