48 lines
1.0 KiB
Nix
48 lines
1.0 KiB
Nix
{
|
|
lib,
|
|
buildPythonPackage,
|
|
rustPlatform,
|
|
fetchFromGitHub,
|
|
pytestCheckHook,
|
|
pkgs,
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "yara-x";
|
|
version = "1.8.1";
|
|
pyproject = true;
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "VirusTotal";
|
|
repo = "yara-x";
|
|
tag = "v${version}";
|
|
hash = "sha256-dl2uxMo81K2ZEAfZk2OP0FXTY4lKGmzqZe0QQo/YIsA=";
|
|
};
|
|
|
|
buildAndTestSubdir = "py";
|
|
|
|
cargoDeps = rustPlatform.fetchCargoVendor {
|
|
inherit pname src version;
|
|
hash = "sha256-+Bva1uch6fd6gl2MH2ss3S6Ea1QkvgVePhdUVUDuIE8=";
|
|
};
|
|
|
|
nativeBuildInputs = [
|
|
rustPlatform.cargoSetupHook
|
|
rustPlatform.maturinBuildHook
|
|
];
|
|
|
|
buildInputs = [ pkgs.yara-x ];
|
|
|
|
pythonImportsCheck = [ "yara_x" ];
|
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
|
|
|
meta = {
|
|
description = "Official Python library for YARA-X";
|
|
homepage = "https://github.com/VirusTotal/yara-x/tree/main/py";
|
|
changelog = "https://github.com/VirusTotal/yara-x/tree/${src.tag}/py";
|
|
license = lib.licenses.bsd3;
|
|
maintainers = with lib.maintainers; [ ivyfanchiang ];
|
|
};
|
|
}
|