2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
capstone,
|
|
|
|
packaging,
|
|
|
|
pyelftools,
|
|
|
|
tlsh,
|
2024-07-27 06:49:29 +00:00
|
|
|
setuptools,
|
2021-04-25 03:57:28 +00:00
|
|
|
}:
|
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";
|
2024-07-27 06:49:29 +00:00
|
|
|
pyproject = true;
|
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 \
|
2024-07-27 06:49:29 +00:00
|
|
|
--replace-fail "python-tlsh" "tlsh" \
|
|
|
|
--replace-fail "py-tlsh" "tlsh" \
|
|
|
|
--replace-fail "nose>=1.3.7" ""
|
2021-04-25 03:57:28 +00:00
|
|
|
'';
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
build-system = [ setuptools ];
|
|
|
|
|
|
|
|
dependencies = [
|
2021-04-25 03:57:28 +00:00
|
|
|
capstone
|
|
|
|
pyelftools
|
|
|
|
tlsh
|
2021-09-18 10:52:07 +00:00
|
|
|
packaging
|
2021-04-25 03:57:28 +00:00
|
|
|
];
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
doCheck = false; # no tests
|
2021-04-25 03:57:28 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "telfhash" ];
|
2021-04-25 03:57:28 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Symbol hash for ELF files";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "telfhash";
|
2021-04-25 03:57:28 +00:00
|
|
|
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
|
|
|
};
|
|
|
|
}
|