Files
nixpkgs/pkgs/development/python-modules/mitmproxy-rs/default.nix
T
Winter a19cd4ffb1 Revert "treewide: replace rev with tag"
This reverts commit 65a333600d.

This wasn't tested for correctness with something like fodwatch [0],
and should not have been (self-)merged so quickly, especially without
further review.

It also resulted in the breakage of at least one package [1] (and that's
the one we know of and was caught).

A few packages that were updated in between this commit and this revert
were not reverted back to using `rev`, but other than that, this is a
1:1 revert.

[0]: https://codeberg.org/raphaelr/fodwatch
[1]: https://github.com/NixOS/nixpkgs/pull/396904 / 758551e458
2025-04-08 02:57:25 -04:00

57 lines
1.3 KiB
Nix

{
lib,
stdenv,
buildPythonPackage,
fetchFromGitHub,
mitmproxy,
mitmproxy-linux,
mitmproxy-macos,
rustPlatform,
}:
buildPythonPackage rec {
pname = "mitmproxy-rs";
version = "0.11.5";
pyproject = true;
src = fetchFromGitHub {
owner = "mitmproxy";
repo = "mitmproxy_rs";
rev = "v${version}";
hash = "sha256-vC+Vsv7UWjkO+6lm7gAb91Ig04Y7r9gYQoz6R9xpxsA=";
};
buildAndTestSubdir = "mitmproxy-rs";
cargoDeps = rustPlatform.fetchCargoVendor {
inherit pname version src;
hash = "sha256-CFsefq1zQLIYjZcfoy3afYfP/0MlBoi9kVx7FVGEKr0=";
};
nativeBuildInputs = [
rustPlatform.cargoSetupHook
rustPlatform.maturinBuildHook
];
dependencies =
lib.optionals stdenv.hostPlatform.isLinux [ mitmproxy-linux ]
++ lib.optionals stdenv.hostPlatform.isDarwin [ mitmproxy-macos ];
# not packaged yet
# ++ lib.optionals stdenv.hostPlatform.isWindows [ mitmproxy-windows ]
# repo has no python tests
doCheck = false;
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;
};
}