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