Merge pull request #307098 from r-ryantm/auto-update/cilium-cli
[NixPkgs.git] / pkgs / development / python-modules / yara-python / default.nix
blobc386e5a5651175e8ca6cf92c790139da67449e9e
1 { lib
2 , buildPythonPackage
3 , fetchFromGitHub
4 , setuptools
5 , pytestCheckHook
6 , pythonOlder
7 , yara
8 }:
10 buildPythonPackage rec {
11   pname = "yara-python";
12   version = "4.5.0";
13   pyproject = true;
15   disabled = pythonOlder "3.7";
17   src = fetchFromGitHub {
18     owner = "VirusTotal";
19     repo = "yara-python";
20     rev = "v${version}";
21     hash = "sha256-RcrzzJQdzn+BXEp5M3ziGL6qSgfUN3wJ3JxwgjzVeuk=";
22   };
24   # undefined symbol: yr_finalize
25   # https://github.com/VirusTotal/yara-python/issues/7
26   postPatch = ''
27     substituteInPlace setup.py \
28       --replace "include_dirs=['yara/libyara/include', 'yara/libyara/', '.']" "libraries = ['yara']"
29   '';
31   nativeBuildInputs = [
32     setuptools
33   ];
35   buildInputs = [
36     yara
37   ];
39   nativeCheckInputs = [
40     pytestCheckHook
41   ];
43   setupPyBuildFlags = [
44     "--dynamic-linking"
45   ];
47   pytestFlagsArray = [
48     "tests.py"
49   ];
51   pythonImportsCheck = [
52     "yara"
53   ];
55   meta = with lib; {
56     description = "Python interface for YARA";
57     homepage = "https://github.com/VirusTotal/yara-python";
58     license = with licenses; [ asl20 ];
59     maintainers = with maintainers; [ fab ];
60   };