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