From fbfcaf8c6d1ca5c8c98c795f6439afd5c214252b Mon Sep 17 00:00:00 2001 From: Ivy Fan-Chiang Date: Thu, 13 Mar 2025 00:36:43 -0400 Subject: [PATCH] pythonPackages.yara-x: init at 0.13.0 --- .../python-modules/yara-x/default.nix | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 pkgs/development/python-modules/yara-x/default.nix diff --git a/pkgs/development/python-modules/yara-x/default.nix b/pkgs/development/python-modules/yara-x/default.nix new file mode 100644 index 000000000000..ce7b079d00f2 --- /dev/null +++ b/pkgs/development/python-modules/yara-x/default.nix @@ -0,0 +1,49 @@ +{ + lib, + buildPythonPackage, + rustPlatform, + fetchFromGitHub, + pythonOlder, + pytestCheckHook, + yara-x, +}: +buildPythonPackage rec { + pname = "yara-x"; + version = "0.13.0"; + pyproject = true; + + disabled = pythonOlder "3.9"; + + src = fetchFromGitHub { + owner = "VirusTotal"; + repo = "yara-x"; + tag = "v${version}"; + hash = "sha256-ZSJHvpRZO6Tbw7Ct4oD6QmuV4mJ4RGW5gnT6PTX+nC8="; + }; + + buildAndTestSubdir = "py"; + + cargoDeps = rustPlatform.fetchCargoTarball { + inherit pname src version; + hash = "sha256-8s8IUblGJGob/y8x8BoPcXJe83zRmqIZHMxs0iQD7R0="; + }; + + nativeBuildInputs = [ + rustPlatform.cargoSetupHook + rustPlatform.maturinBuildHook + ]; + + buildInputs = [ yara-x ]; + + pythonImportsCheck = [ "yara_x" ]; + + nativeCheckInputs = [ pytestCheckHook ]; + + meta = { + description = "The official Python library for YARA-X"; + homepage = "https://github.com/VirusTotal/yara-x/tree/main/py"; + changelog = "https://github.com/VirusTotal/yara-x/tree/v${version}/py"; + license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ ivyfanchiang ]; + }; +}