1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 cmake,
6 setuptools,
7}:
8
9buildPythonPackage rec {
10 pname = "tlsh";
11 version = "4.12.0";
12 pyproject = true;
13
14 src = fetchFromGitHub {
15 owner = "trendmicro";
16 repo = "tlsh";
17 tag = version;
18 hash = "sha256-Ht4LkcNmxPEvzFHXeS/XhPt/xo+0sE4RBcLCn9N/zwE=";
19 };
20
21 patches = [
22 # https://github.com/trendmicro/tlsh/pull/152
23 ./cmake-4-compat.patch
24 ];
25
26 nativeBuildInputs = [ cmake ];
27
28 build-system = [ setuptools ];
29
30 # no test data
31 doCheck = false;
32
33 postConfigure = ''
34 cd ../py_ext
35 '';
36
37 pythonImportsCheck = [ "tlsh" ];
38
39 meta = with lib; {
40 description = "Trend Micro Locality Sensitive Hash";
41 homepage = "https://tlsh.org/";
42 changelog = "https://github.com/trendmicro/tlsh/releases/tag/${version}";
43 license = licenses.asl20;
44 };
45}