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