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