diff --git a/pkgs/development/python-modules/mitmproxy-macos/default.nix b/pkgs/development/python-modules/mitmproxy-macos/default.nix new file mode 100644 index 000000000000..39798d90b15d --- /dev/null +++ b/pkgs/development/python-modules/mitmproxy-macos/default.nix @@ -0,0 +1,33 @@ +{ 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; + }; +} diff --git a/pkgs/development/python-modules/mitmproxy-rs/default.nix b/pkgs/development/python-modules/mitmproxy-rs/default.nix index 15850ab7cd78..d90e1e0c2a96 100644 --- a/pkgs/development/python-modules/mitmproxy-rs/default.nix +++ b/pkgs/development/python-modules/mitmproxy-rs/default.nix @@ -4,6 +4,8 @@ , fetchFromGitHub , rustPlatform , darwin +, libiconv +, mitmproxy-macos }: buildPythonPackage rec { @@ -34,13 +36,15 @@ buildPythonPackage rec { buildInputs = lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Security + libiconv + mitmproxy-macos ]; pythonImportsCheck = [ "mitmproxy_rs" ]; meta = with lib; { description = "The Rust bits in mitmproxy"; - homepage = " https://github.com/mitmproxy/mitmproxy_rs"; + homepage = "https://github.com/mitmproxy/mitmproxy_rs"; changelog = "https://github.com/mitmproxy/mitmproxy_rs/blob/${src.rev}/CHANGELOG.md"; license = licenses.mit; maintainers = with maintainers; [ fab ]; diff --git a/pkgs/development/python-modules/mitmproxy/default.nix b/pkgs/development/python-modules/mitmproxy/default.nix index 1c57361a6406..566c1e0b3298 100644 --- a/pkgs/development/python-modules/mitmproxy/default.nix +++ b/pkgs/development/python-modules/mitmproxy/default.nix @@ -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 = [ diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index f0502b4eeb5e..78f2c18e582c 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6877,6 +6877,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 { };