2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
rustPlatform,
|
|
|
|
darwin,
|
|
|
|
libiconv,
|
2024-07-31 10:19:44 +00:00
|
|
|
mitmproxy,
|
2024-06-05 15:53:02 +00:00
|
|
|
mitmproxy-macos,
|
2023-11-16 04:20:00 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "mitmproxy-rs";
|
2024-10-09 16:51:18 +00:00
|
|
|
version = "0.9.2";
|
2023-11-16 04:20:00 +00:00
|
|
|
pyproject = true;
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mitmproxy";
|
|
|
|
repo = "mitmproxy_rs";
|
2024-10-09 16:51:18 +00:00
|
|
|
rev = "v${version}";
|
|
|
|
hash = "sha256-Cp0AbwRNLuLzmF4EAK/2Fzq5I9Iq7gqg6OLbK1B8fGY=";
|
2023-11-16 04:20:00 +00:00
|
|
|
};
|
|
|
|
|
2024-07-31 10:19:44 +00:00
|
|
|
cargoDeps = rustPlatform.importCargoLock {
|
2024-10-09 16:51:18 +00:00
|
|
|
lockFile = ./Cargo.lock;
|
2024-07-31 10:19:44 +00:00
|
|
|
outputHashes = {
|
2024-10-09 16:51:18 +00:00
|
|
|
"boringtun-0.6.0" = "sha256-fx2lY6q1ZdO5STvf7xnbVG64tn0BC4yWPFy4ICPJgEg=";
|
2024-07-31 10:19:44 +00:00
|
|
|
"smoltcp-0.11.0" = "sha256-KC9nTKd2gfZ1ICjrkLK//M2bbqYlfcCK18gBdN0RqWQ=";
|
|
|
|
};
|
|
|
|
};
|
2023-11-16 04:20:00 +00:00
|
|
|
|
|
|
|
buildAndTestSubdir = "mitmproxy-rs";
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
rustPlatform.cargoSetupHook
|
|
|
|
rustPlatform.maturinBuildHook
|
|
|
|
];
|
|
|
|
|
2024-09-26 11:04:55 +00:00
|
|
|
buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [
|
2023-11-16 04:20:00 +00:00
|
|
|
darwin.apple_sdk.frameworks.Security
|
2024-10-09 16:51:18 +00:00
|
|
|
darwin.apple_sdk.frameworks.AppKit
|
2024-01-02 11:29:13 +00:00
|
|
|
libiconv
|
|
|
|
mitmproxy-macos
|
2023-11-16 04:20:00 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "mitmproxy_rs" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Rust bits in mitmproxy";
|
2024-01-02 11:29:13 +00:00
|
|
|
homepage = "https://github.com/mitmproxy/mitmproxy_rs";
|
2024-09-19 14:19:46 +00:00
|
|
|
changelog = "https://github.com/mitmproxy/mitmproxy_rs/blob/${src.rev}/CHANGELOG.md#${lib.replaceStrings ["."] [""] version}";
|
2023-11-16 04:20:00 +00:00
|
|
|
license = licenses.mit;
|
2024-07-31 10:19:44 +00:00
|
|
|
inherit (mitmproxy.meta) maintainers;
|
2023-11-16 04:20:00 +00:00
|
|
|
};
|
|
|
|
}
|