1{ 2 lib, 3 stdenv, 4 fetchPypi, 5 buildPythonPackage, 6 rustPlatform, 7 libiconv, 8}: 9 10buildPythonPackage rec { 11 pname = "regress"; 12 version = "0.4.5"; 13 14 format = "pyproject"; 15 16 src = fetchPypi { 17 inherit pname version; 18 hash = "sha256-tCrFBjkK6obzaYkYiJ3WQ5yi3KkC86/cbXCSnRRGZu8="; 19 }; 20 21 nativeBuildInputs = with rustPlatform; [ 22 cargoSetupHook 23 maturinBuildHook 24 ]; 25 26 buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ]; 27 28 cargoDeps = rustPlatform.fetchCargoTarball { 29 inherit src; 30 name = "${pname}-${version}"; 31 hash = "sha256-wHObfXWgcbSYxk5d17s44+1qIGYD/Ygefxp+el0fsEc="; 32 }; 33 34 meta = with lib; { 35 description = "Python bindings to the Rust regress crate, exposing ECMA regular expressions."; 36 homepage = "https://github.com/Julian/regress"; 37 license = licenses.mit; 38 maintainers = [ maintainers.matthiasbeyer ]; 39 }; 40}