2021-04-25 03:57:28 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, capstone
|
2021-09-18 10:52:07 +00:00
|
|
|
, packaging
|
2021-04-25 03:57:28 +00:00
|
|
|
, pyelftools
|
|
|
|
, tlsh
|
|
|
|
, nose
|
|
|
|
}:
|
2021-09-18 10:52:07 +00:00
|
|
|
buildPythonPackage rec {
|
2021-04-25 03:57:28 +00:00
|
|
|
pname = "telfhash";
|
2021-09-18 10:52:07 +00:00
|
|
|
version = "0.9.8";
|
2021-04-25 03:57:28 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "trendmicro";
|
|
|
|
repo = "telfhash";
|
2021-09-18 10:52:07 +00:00
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "124zajv43wx9l8rvdvmzcnbh0xpzmbn253pznpbjwvygfx16gq02";
|
2021-04-25 03:57:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# The tlsh library's name is just "tlsh"
|
|
|
|
postPatch = ''
|
2021-09-18 10:52:07 +00:00
|
|
|
substituteInPlace requirements.txt \
|
|
|
|
--replace "python-tlsh" "tlsh" \
|
|
|
|
--replace "py-tlsh" "tlsh"
|
2021-04-25 03:57:28 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
capstone
|
|
|
|
pyelftools
|
|
|
|
tlsh
|
2021-09-18 10:52:07 +00:00
|
|
|
packaging
|
2021-04-25 03:57:28 +00:00
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-04-25 03:57:28 +00:00
|
|
|
nose
|
|
|
|
];
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
nosetests
|
|
|
|
'';
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"telfhash"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Symbol hash for ELF files";
|
|
|
|
homepage = "https://github.com/trendmicro/telfhash";
|
|
|
|
license = licenses.asl20;
|
2023-03-24 00:07:29 +00:00
|
|
|
maintainers = [ ];
|
2021-04-25 03:57:28 +00:00
|
|
|
};
|
|
|
|
}
|