1{ 2 lib, 3 stdenv, 4 buildPythonPackage, 5 fetchFromGitHub, 6 rustPlatform, 7 darwin, 8 libiconv, 9 mitmproxy-macos, 10}: 11 12buildPythonPackage rec { 13 pname = "mitmproxy-rs"; 14 version = "0.5.1"; 15 pyproject = true; 16 17 src = fetchFromGitHub { 18 owner = "mitmproxy"; 19 repo = "mitmproxy_rs"; 20 rev = version; 21 hash = "sha256-nrm1T2yaGVmYsubwNJHPnPDC/A/jYiKVzwBKmuc9MD4="; 22 }; 23 24 cargoDeps = rustPlatform.importCargoLock { lockFile = ./Cargo.lock; }; 25 26 buildAndTestSubdir = "mitmproxy-rs"; 27 28 nativeBuildInputs = [ 29 rustPlatform.cargoSetupHook 30 rustPlatform.maturinBuildHook 31 ]; 32 33 buildInputs = lib.optionals stdenv.isDarwin [ 34 darwin.apple_sdk.frameworks.Security 35 libiconv 36 mitmproxy-macos 37 ]; 38 39 pythonImportsCheck = [ "mitmproxy_rs" ]; 40 41 meta = with lib; { 42 description = "The Rust bits in mitmproxy"; 43 homepage = "https://github.com/mitmproxy/mitmproxy_rs"; 44 changelog = "https://github.com/mitmproxy/mitmproxy_rs/blob/${src.rev}/CHANGELOG.md"; 45 license = licenses.mit; 46 maintainers = with maintainers; [ fab ]; 47 }; 48}