1{
2 lib,
3 buildPythonPackage,
4 rustPlatform,
5 fetchFromGitHub,
6 pythonOlder,
7 pytestCheckHook,
8 pkgs,
9}:
10buildPythonPackage rec {
11 pname = "yara-x";
12 version = "0.14.0";
13 pyproject = true;
14
15 disabled = pythonOlder "3.9";
16
17 src = fetchFromGitHub {
18 owner = "VirusTotal";
19 repo = "yara-x";
20 tag = "v${version}";
21 hash = "sha256-C8wBGmilouNcNN3HkwvSTWcZY1fe0jVc2TeWDN4w5xA=";
22 };
23
24 buildAndTestSubdir = "py";
25
26 cargoDeps = rustPlatform.fetchCargoVendor {
27 inherit pname src version;
28 hash = "sha256-afCBuWr12trjEIDvE0qnGFxTXU7LKZCzZB8RqgqperY=";
29 };
30
31 nativeBuildInputs = [
32 rustPlatform.cargoSetupHook
33 rustPlatform.maturinBuildHook
34 ];
35
36 buildInputs = [ pkgs.yara-x ];
37
38 pythonImportsCheck = [ "yara_x" ];
39
40 nativeCheckInputs = [ pytestCheckHook ];
41
42 meta = {
43 description = "The official Python library for YARA-X";
44 homepage = "https://github.com/VirusTotal/yara-x/tree/main/py";
45 changelog = "https://github.com/VirusTotal/yara-x/tree/v${version}/py";
46 license = lib.licenses.bsd3;
47 maintainers = with lib.maintainers; [ ivyfanchiang ];
48 };
49}