Unverified Commit a45221f8 authored by Weijia Wang's avatar Weijia Wang Committed by GitHub
Browse files

Merge pull request #267280 from boltzmannrain/mitmproxy_macos

mitmproxy: fix macos build
parents cfd4e30f 0dd2238a
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -2477,6 +2477,12 @@
    githubId = 50839;
    name = "Brian Jones";
  };
  boltzmannrain = {
    email = "boltzmannrain@gmail.com";
    github = "boltzmannrain";
    githubId = 150560585;
    name = "Dmitry Ivankov";
  };
  booklearner = {
    name = "booklearner";
    email = "booklearner@proton.me";
+33 −0
Original line number Diff line number Diff line
{ lib
, buildPythonPackage
, fetchFromGitHub
, hatchling
}:

buildPythonPackage rec {
  pname = "mitmproxy-macos";
  version = "0.3.11";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "mitmproxy";
    repo = "mitmproxy_rs";
    rev = version;
    hash = "sha256-V6LUr1jJiTo0+53jipkTyzG5JSw6uHaS6ziyBaFbETw=";
  };

  sourceRoot = "${src.name}/mitmproxy-macos";
  pythonImportsCheck = [ "mitmproxy_macos" ];
  nativeBuildInputs = [
    hatchling
  ];

  meta = with lib; {
    description = "The MacOS Rust bits in mitmproxy";
    homepage = "https://github.com/mitmproxy/mitmproxy_rs/tree/main/mitmproxy-macos";
    changelog = "https://github.com/mitmproxy/mitmproxy_rs/blob/${src.rev}/CHANGELOG.md";
    license = licenses.mit;
    maintainers = with maintainers; [ boltzmannrain ];
    platforms = platforms.darwin;
  };
}
+5 −1
Original line number Diff line number Diff line
@@ -4,6 +4,8 @@
, fetchFromGitHub
, rustPlatform
, darwin
, libiconv
, mitmproxy-macos
}:

buildPythonPackage rec {
@@ -34,6 +36,8 @@ buildPythonPackage rec {

  buildInputs = lib.optionals stdenv.isDarwin [
    darwin.apple_sdk.frameworks.Security
    libiconv
    mitmproxy-macos
  ];

  pythonImportsCheck = [ "mitmproxy_rs" ];
+4 −0
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@
, fetchFromGitHub
, buildPythonPackage
, pythonOlder
, stdenv
  # Mitmproxy requirements
, aioquic
, asgiref
@@ -15,6 +16,7 @@
, hyperframe
, kaitaistruct
, ldap3
, mitmproxy-macos
, mitmproxy-rs
, msgpack
, passlib
@@ -81,6 +83,8 @@ buildPythonPackage rec {
    urwid
    wsproto
    zstandard
  ] ++ lib.optionals stdenv.isDarwin [
    mitmproxy-macos
  ];

  nativeCheckInputs = [
+2 −0
Original line number Diff line number Diff line
@@ -6887,6 +6887,8 @@ self: super: with self; {
  mitmproxy = callPackage ../development/python-modules/mitmproxy { };
  mitmproxy-macos = callPackage ../development/python-modules/mitmproxy-macos { };
  mitmproxy-rs = callPackage ../development/python-modules/mitmproxy-rs { };
  mitmproxy-wireguard = callPackage ../development/python-modules/mitmproxy-wireguard { };