mirror of
https://github.com/CHN-beta/nixpkgs.git
synced 2026-01-13 19:43:02 +08:00
This commit was created by a combination of scripts and tools: - an ast-grep script to prefix things in meta with `lib.`, - a modified nixf-diagnose / nixf combination to remove unused `with lib;`, and - regular nixfmt. Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
52 lines
1.2 KiB
Nix
52 lines
1.2 KiB
Nix
{
|
|
lib,
|
|
buildPythonPackage,
|
|
fetchFromGitHub,
|
|
setuptools,
|
|
pytestCheckHook,
|
|
pythonOlder,
|
|
yara,
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "yara-python";
|
|
version = "4.5.4";
|
|
pyproject = true;
|
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "VirusTotal";
|
|
repo = "yara-python";
|
|
tag = "v${version}";
|
|
hash = "sha256-2ZwLpkT46KNTQ1ymvMGjnrfHQaIy/rXid0kXoCBixXA=";
|
|
};
|
|
|
|
# undefined symbol: yr_finalize
|
|
# https://github.com/VirusTotal/yara-python/issues/7
|
|
postPatch = ''
|
|
substituteInPlace setup.py \
|
|
--replace-fail "include_dirs=['yara/libyara/include', 'yara/libyara/', '.']" "libraries = ['yara']"
|
|
'';
|
|
|
|
build-system = [ setuptools ];
|
|
|
|
buildInputs = [ yara ];
|
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
|
|
|
setupPyBuildFlags = [ "--dynamic-linking" ];
|
|
|
|
enabledTestPaths = [ "tests.py" ];
|
|
|
|
pythonImportsCheck = [ "yara" ];
|
|
|
|
meta = {
|
|
description = "Python interface for YARA";
|
|
homepage = "https://github.com/VirusTotal/yara-python";
|
|
changelog = "https://github.com/VirusTotal/yara-python/releases/tag/v${version}";
|
|
license = lib.licenses.asl20;
|
|
maintainers = with lib.maintainers; [ fab ];
|
|
};
|
|
}
|