depot/third_party/nixpkgs/pkgs/development/python-modules/mitmproxy-rs/default.nix
Default email 555cd8a8f9 Project import generated by Copybara.
GitOrigin-RevId: 5633bcff0c6162b9e4b5f1264264611e950c8ec7
2024-10-09 18:51:18 +02:00

56 lines
1.3 KiB
Nix

{
lib,
stdenv,
buildPythonPackage,
fetchFromGitHub,
rustPlatform,
darwin,
libiconv,
mitmproxy,
mitmproxy-macos,
}:
buildPythonPackage rec {
pname = "mitmproxy-rs";
version = "0.9.2";
pyproject = true;
src = fetchFromGitHub {
owner = "mitmproxy";
repo = "mitmproxy_rs";
rev = "v${version}";
hash = "sha256-Cp0AbwRNLuLzmF4EAK/2Fzq5I9Iq7gqg6OLbK1B8fGY=";
};
cargoDeps = rustPlatform.importCargoLock {
lockFile = ./Cargo.lock;
outputHashes = {
"boringtun-0.6.0" = "sha256-fx2lY6q1ZdO5STvf7xnbVG64tn0BC4yWPFy4ICPJgEg=";
"smoltcp-0.11.0" = "sha256-KC9nTKd2gfZ1ICjrkLK//M2bbqYlfcCK18gBdN0RqWQ=";
};
};
buildAndTestSubdir = "mitmproxy-rs";
nativeBuildInputs = [
rustPlatform.cargoSetupHook
rustPlatform.maturinBuildHook
];
buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [
darwin.apple_sdk.frameworks.Security
darwin.apple_sdk.frameworks.AppKit
libiconv
mitmproxy-macos
];
pythonImportsCheck = [ "mitmproxy_rs" ];
meta = with lib; {
description = "Rust bits in mitmproxy";
homepage = "https://github.com/mitmproxy/mitmproxy_rs";
changelog = "https://github.com/mitmproxy/mitmproxy_rs/blob/${src.rev}/CHANGELOG.md#${lib.replaceStrings ["."] [""] version}";
license = licenses.mit;
inherit (mitmproxy.meta) maintainers;
};
}