Unverified Commit 10db73fe authored by Sandro Jäckel's avatar Sandro Jäckel
Browse files

python313Packages.mitmproxy-linux: 0.11.5 -> 0.12.3, remove things duplicated...

python313Packages.mitmproxy-linux: 0.11.5 -> 0.12.3, remove things duplicated and in sync with mitmproxy-rs

Changelog: https://github.com/mitmproxy/mitmproxy_rs/blob/v0.12.3/CHANGELOG.md
parent edbc7b28
Loading
Loading
Loading
Loading
+12 −25
Original line number Diff line number Diff line
@@ -2,23 +2,15 @@
  lib,
  buildPythonPackage,
  bpf-linker,
  fetchFromGitHub,
  rustPlatform,
  mitmproxy,
  mitmproxy-rs,
}:

buildPythonPackage rec {
buildPythonPackage {
  pname = "mitmproxy-linux";
  version = "0.11.5";
  inherit (mitmproxy-rs) version src cargoDeps;
  pyproject = true;

  src = fetchFromGitHub {
    owner = "mitmproxy";
    repo = "mitmproxy_rs";
    tag = "v${version}";
    hash = "sha256-vC+Vsv7UWjkO+6lm7gAb91Ig04Y7r9gYQoz6R9xpxsA=";
  };

  postPatch = ''
    substituteInPlace mitmproxy-linux/build.rs \
      --replace-fail '"-Z",' "" \
@@ -28,11 +20,6 @@ buildPythonPackage rec {
      --replace-fail 'build-std = ["core"]' ""
  '';

  cargoDeps = rustPlatform.fetchCargoVendor {
    inherit pname version src;
    hash = "sha256-CFsefq1zQLIYjZcfoy3afYfP/0MlBoi9kVx7FVGEKr0=";
  };

  RUSTFLAGS = "-C target-feature=";
  RUSTC_BOOTSTRAP = 1;

@@ -49,13 +36,13 @@ buildPythonPackage rec {

  pythonImportsCheck = [ "mitmproxy_linux" ];

  meta = {
    description = "Rust bits in mitmproxy";
  meta =
    {
      inherit (mitmproxy-rs.meta) changelog license maintainers;
    }
    // {
      description = "Linux Rust bits in mitmproxy";
      homepage = "https://github.com/mitmproxy/mitmproxy_rs/tree/main/mitmproxy-linux";
    changelog = "https://github.com/mitmproxy/mitmproxy_rs/blob/${src.rev}/CHANGELOG.md#${
      lib.replaceStrings [ "." ] [ "" ] version
    }";
    license = lib.licenses.mit;
    inherit (mitmproxy.meta) maintainers;
      platforms = lib.platforms.linux;
    };
}