{ lib, buildPythonPackage, fetchFromGitHub, pytestCheckHook, rustPlatform, nix-update-script, }: buildPythonPackage rec { pname = "unicode-segmentation-rs"; version = "0.2.1"; pyproject = true; src = fetchFromGitHub { owner = "WeblateOrg"; repo = "unicode-segmentation-rs"; tag = "v${version}"; hash = "sha256-PquKaJlo7h8TOR4iq2GrV/oz1NXmalhFR59Duvk4yoU="; }; postPatch = '' ln -s '${./Cargo.lock}' Cargo.lock ''; cargoDeps = rustPlatform.importCargoLock { lockFile = ./Cargo.lock; }; nativeBuildInputs = [ rustPlatform.cargoSetupHook rustPlatform.maturinBuildHook ]; nativeCheckInputs = [ pytestCheckHook ]; pythonImportsCheck = [ "unicode_segmentation_rs" ]; passthru.updateScript = nix-update-script { extraArgs = [ "--generate-lockfile" ]; }; meta = { description = "Python bindings for the Rust unicode-segmentation and unicode-width crates"; homepage = "https://github.com/WeblateOrg/unicode-segmentation-rs/"; changelog = "https://github.com/WeblateOrg/unicode-segmentation-rs/releases/tag/${src.tag}"; license = [ lib.licenses.mit ]; maintainers = with lib.maintainers; [ erictapen ]; }; }