1{ 2 lib, 3 buildPythonPackage, 4 fetchFromGitHub, 5 capstone, 6 packaging, 7 pyelftools, 8 tlsh, 9 nose, 10}: 11buildPythonPackage rec { 12 pname = "telfhash"; 13 version = "0.9.8"; 14 format = "setuptools"; 15 16 src = fetchFromGitHub { 17 owner = "trendmicro"; 18 repo = "telfhash"; 19 rev = "v${version}"; 20 sha256 = "124zajv43wx9l8rvdvmzcnbh0xpzmbn253pznpbjwvygfx16gq02"; 21 }; 22 23 # The tlsh library's name is just "tlsh" 24 postPatch = '' 25 substituteInPlace requirements.txt \ 26 --replace "python-tlsh" "tlsh" \ 27 --replace "py-tlsh" "tlsh" 28 ''; 29 30 propagatedBuildInputs = [ 31 capstone 32 pyelftools 33 tlsh 34 packaging 35 ]; 36 37 nativeCheckInputs = [ nose ]; 38 39 checkPhase = '' 40 nosetests 41 ''; 42 43 pythonImportsCheck = [ "telfhash" ]; 44 45 meta = with lib; { 46 description = "Symbol hash for ELF files"; 47 mainProgram = "telfhash"; 48 homepage = "https://github.com/trendmicro/telfhash"; 49 license = licenses.asl20; 50 maintainers = [ ]; 51 }; 52}