1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchFromGitHub,
6 rustPlatform,
7 libiconv,
8}:
9
10buildPythonPackage rec {
11 pname = "python-flirt";
12 version = "0.8.6";
13
14 src = fetchFromGitHub {
15 owner = "williballenthin";
16 repo = "lancelot";
17 rev = "v${version}";
18 hash = "sha256-J48tRgJw6JjUrcAQdRELFE50pyDptbmbgYbr+rAK/PA=";
19 };
20
21 postPatch = ''
22 cp ${./Cargo.lock} Cargo.lock
23 '';
24
25 format = "pyproject";
26
27 nativeBuildInputs = with rustPlatform; [
28 cargoSetupHook
29 maturinBuildHook
30 ];
31
32 buildInputs = lib.optionals stdenv.isDarwin [ libiconv ];
33
34 buildAndTestSubdir = "pyflirt";
35
36 cargoDeps = rustPlatform.importCargoLock {
37 lockFile = ./Cargo.lock;
38 outputHashes = {
39 "zydis-3.1.3" = "sha256-X+aURjNfXGXO4eh6RJ3bi8Eb2kvF09I34ZHffvYjt9I=";
40 };
41 };
42
43 pythonImportsCheck = [ "flirt" ];
44
45 meta = with lib; {
46 description = "Python library for parsing, compiling, and matching Fast Library Identification and Recognition Technology (FLIRT) signatures";
47 homepage = "https://github.com/williballenthin/lancelot/tree/master/pyflirt";
48 license = licenses.asl20;
49 maintainers = with maintainers; [ sbruder ];
50 };
51}