2021-03-09 03:18:52 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2020-09-25 04:45:31 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, buildPythonPackage
|
2021-03-09 03:18:52 +00:00
|
|
|
, pythonOlder
|
|
|
|
# Mitmproxy requirements
|
|
|
|
, asgiref
|
2020-09-25 04:45:31 +00:00
|
|
|
, blinker
|
|
|
|
, brotli
|
|
|
|
, certifi
|
|
|
|
, click
|
|
|
|
, cryptography
|
|
|
|
, flask
|
2021-03-09 03:18:52 +00:00
|
|
|
, h11
|
2020-09-25 04:45:31 +00:00
|
|
|
, h2
|
|
|
|
, hyperframe
|
|
|
|
, kaitaistruct
|
|
|
|
, ldap3
|
2021-03-09 03:18:52 +00:00
|
|
|
, msgpack
|
2020-09-25 04:45:31 +00:00
|
|
|
, passlib
|
|
|
|
, protobuf
|
2021-03-09 03:18:52 +00:00
|
|
|
, publicsuffix2
|
2020-09-25 04:45:31 +00:00
|
|
|
, pyasn1
|
|
|
|
, pyopenssl
|
|
|
|
, pyparsing
|
|
|
|
, pyperclip
|
2021-12-06 16:07:01 +00:00
|
|
|
, ruamel-yaml
|
2020-09-25 04:45:31 +00:00
|
|
|
, setuptools
|
|
|
|
, sortedcontainers
|
|
|
|
, tornado
|
|
|
|
, urwid
|
|
|
|
, wsproto
|
|
|
|
, zstandard
|
2021-03-09 03:18:52 +00:00
|
|
|
# Additional check requirements
|
2020-09-25 04:45:31 +00:00
|
|
|
, beautifulsoup4
|
|
|
|
, glibcLocales
|
2021-03-09 03:18:52 +00:00
|
|
|
, hypothesis
|
2020-09-25 04:45:31 +00:00
|
|
|
, parver
|
|
|
|
, pytest-asyncio
|
2021-03-09 03:18:52 +00:00
|
|
|
, pytest-timeout
|
|
|
|
, pytest-xdist
|
|
|
|
, pytestCheckHook
|
|
|
|
, requests
|
2020-09-25 04:45:31 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "mitmproxy";
|
2022-07-18 16:21:45 +00:00
|
|
|
version = "8.1.1";
|
2021-03-09 03:18:52 +00:00
|
|
|
disabled = pythonOlder "3.8";
|
2020-09-25 04:45:31 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2021-03-09 03:18:52 +00:00
|
|
|
owner = pname;
|
|
|
|
repo = pname;
|
2022-08-12 12:06:08 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2022-07-18 16:21:45 +00:00
|
|
|
sha256 = "sha256-nW/WfiY6uF67qNa95tvNvSv/alP2WmzTk34LEBma/04=";
|
2020-09-25 04:45:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
setuptools
|
|
|
|
# setup.py
|
2020-11-21 19:51:51 +00:00
|
|
|
asgiref
|
2020-09-25 04:45:31 +00:00
|
|
|
blinker
|
|
|
|
brotli
|
|
|
|
certifi
|
|
|
|
click
|
|
|
|
cryptography
|
|
|
|
flask
|
2021-03-09 03:18:52 +00:00
|
|
|
h11
|
2020-09-25 04:45:31 +00:00
|
|
|
h2
|
|
|
|
hyperframe
|
|
|
|
kaitaistruct
|
|
|
|
ldap3
|
2020-11-21 19:51:51 +00:00
|
|
|
msgpack
|
2020-09-25 04:45:31 +00:00
|
|
|
passlib
|
|
|
|
protobuf
|
|
|
|
publicsuffix2
|
|
|
|
pyopenssl
|
|
|
|
pyparsing
|
|
|
|
pyperclip
|
2021-12-06 16:07:01 +00:00
|
|
|
ruamel-yaml
|
2020-09-25 04:45:31 +00:00
|
|
|
sortedcontainers
|
|
|
|
tornado
|
|
|
|
urwid
|
|
|
|
wsproto
|
|
|
|
zstandard
|
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
hypothesis
|
|
|
|
parver
|
|
|
|
pytest-asyncio
|
2021-03-09 03:18:52 +00:00
|
|
|
pytest-timeout
|
|
|
|
pytest-xdist
|
|
|
|
pytestCheckHook
|
2020-09-25 04:45:31 +00:00
|
|
|
requests
|
|
|
|
];
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
postPatch = ''
|
|
|
|
# remove dependency constraints
|
|
|
|
sed 's/>=\([0-9]\.\?\)\+\( \?, \?<\([0-9]\.\?\)\+\)\?\( \?, \?!=\([0-9]\.\?\)\+\)\?//' -i setup.py
|
|
|
|
'';
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
export HOME=$(mktemp -d)
|
|
|
|
'';
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# Tests require a git repository
|
|
|
|
"test_get_version"
|
2021-09-18 10:52:07 +00:00
|
|
|
# https://github.com/mitmproxy/mitmproxy/commit/36ebf11916704b3cdaf4be840eaafa66a115ac03
|
|
|
|
# Tests require terminal
|
|
|
|
"test_integration"
|
2022-07-18 16:21:45 +00:00
|
|
|
"test_contentview_flowview"
|
|
|
|
"test_flowview"
|
2021-03-09 03:18:52 +00:00
|
|
|
];
|
2022-04-27 09:35:20 +00:00
|
|
|
dontUsePytestXdist = true;
|
2021-03-09 03:18:52 +00:00
|
|
|
|
|
|
|
pythonImportsCheck = [ "mitmproxy" ];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-09-25 04:45:31 +00:00
|
|
|
description = "Man-in-the-middle proxy";
|
2021-03-09 03:18:52 +00:00
|
|
|
homepage = "https://mitmproxy.org/";
|
|
|
|
license = licenses.mit;
|
2022-08-12 12:06:08 +00:00
|
|
|
maintainers = with maintainers; [ kamilchm SuperSandro2000 ];
|
2020-09-25 04:45:31 +00:00
|
|
|
};
|
|
|
|
}
|