at 24.11-pre 50 lines 1.1 kB view raw
1{ 2 lib, 3 buildPythonPackage, 4 fetchFromGitHub, 5 setuptools, 6 pytestCheckHook, 7 pythonOlder, 8 yara, 9}: 10 11buildPythonPackage rec { 12 pname = "yara-python"; 13 version = "4.5.0"; 14 pyproject = true; 15 16 disabled = pythonOlder "3.7"; 17 18 src = fetchFromGitHub { 19 owner = "VirusTotal"; 20 repo = "yara-python"; 21 rev = "v${version}"; 22 hash = "sha256-RcrzzJQdzn+BXEp5M3ziGL6qSgfUN3wJ3JxwgjzVeuk="; 23 }; 24 25 # undefined symbol: yr_finalize 26 # https://github.com/VirusTotal/yara-python/issues/7 27 postPatch = '' 28 substituteInPlace setup.py \ 29 --replace "include_dirs=['yara/libyara/include', 'yara/libyara/', '.']" "libraries = ['yara']" 30 ''; 31 32 nativeBuildInputs = [ setuptools ]; 33 34 buildInputs = [ yara ]; 35 36 nativeCheckInputs = [ pytestCheckHook ]; 37 38 setupPyBuildFlags = [ "--dynamic-linking" ]; 39 40 pytestFlagsArray = [ "tests.py" ]; 41 42 pythonImportsCheck = [ "yara" ]; 43 44 meta = with lib; { 45 description = "Python interface for YARA"; 46 homepage = "https://github.com/VirusTotal/yara-python"; 47 license = with licenses; [ asl20 ]; 48 maintainers = with maintainers; [ fab ]; 49 }; 50}