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-09-19 14:19:46 +00:00
|
|
|
version = "0.6.3";
|
2023-11-16 04:20:00 +00:00
|
|
|
pyproject = true;
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mitmproxy";
|
|
|
|
repo = "mitmproxy_rs";
|
|
|
|
rev = version;
|
2024-09-19 14:19:46 +00:00
|
|
|
hash = "sha256-rnM2MNJ9ZVmwFjhXU8kPEQjpqNIzVZ3bVtm43WvGj5E=";
|
2023-11-16 04:20:00 +00:00
|
|
|
};
|
|
|
|
|
2024-07-31 10:19:44 +00:00
|
|
|
cargoDeps = rustPlatform.importCargoLock {
|
|
|
|
outputHashes = {
|
|
|
|
"smoltcp-0.11.0" = "sha256-KC9nTKd2gfZ1ICjrkLK//M2bbqYlfcCK18gBdN0RqWQ=";
|
|
|
|
};
|
|
|
|
lockFile = ./Cargo.lock;
|
|
|
|
};
|
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-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
|
|
|
};
|
|
|
|
}
|