Merge pull request #35514 from rnhmjoj/mitm

Fix mitmproxy

authored by Franz Pletz and committed by GitHub f4a0c577 0ac6d4ae

+22 -46
+22 -35
pkgs/tools/networking/mitmproxy/default.nix
··· 1 - { stdenv, fetchpatch, fetchFromGitHub, fetchurl, python3, glibcLocales }: 2 3 - let 4 - # When overrides are not needed, then only remove the contents of this set. 5 - packageOverrides = self: super: { 6 - ldap3 = super.ldap3.overridePythonAttrs (oldAttrs: rec { 7 - version = "2.3"; 8 - src = oldAttrs.src.override { 9 - inherit version; 10 - sha256 = "c056b3756076e15aa71c963c7c5a44d5d9bbd430263ee49598d4454223a766ac"; 11 - }; 12 - }); 13 - pyasn1 = super.pyasn1.overridePythonAttrs (oldAttrs: rec { 14 - version = "0.3.7"; 15 - src = oldAttrs.src.override { 16 - inherit version; 17 - sha256 = "187f2a66d617683f8e82d5c00033b7c8a0287e1da88a9d577aebec321cad4965"; 18 - }; 19 - }); 20 - }; 21 - 22 - pythonPackages = (python3.override {inherit packageOverrides; }).pkgs; 23 - in with pythonPackages; 24 25 buildPythonPackage rec { 26 - baseName = "mitmproxy"; 27 - name = "${baseName}-unstable-2017-10-31"; 28 29 src = fetchFromGitHub { 30 - owner = baseName; 31 - repo = baseName; 32 - rev = "80a8eaa708ea31dd9c5e7e1ab6b02c69079039c0"; 33 sha256 = "0rvwm11yryzlp3c1i42rk2iv1m38yn6r83k41jb51hwg6wzbwzvw"; 34 }; 35 36 checkPhase = '' 37 export HOME=$(mktemp -d) 38 # test_echo resolves hostnames 39 - LC_CTYPE=en_US.UTF-8 pytest -k 'not test_echo and not test_find_unclaimed_URLs ' 40 ''; 41 42 propagatedBuildInputs = [ 43 blinker click certifi cryptography 44 - h2 hyperframe 45 - kaitaistruct passlib pyasn1 pyopenssl 46 - pyparsing pyperclip requests ruamel_yaml tornado 47 - urwid brotlipy sortedcontainers ldap3 48 ]; 49 50 buildInputs = [ 51 - beautifulsoup4 flask pytest pytestrunner glibcLocales 52 ]; 53 54 meta = with stdenv.lib; { 55 description = "Man-in-the-middle proxy"; 56 - homepage = https://mitmproxy.org/; 57 - license = licenses.mit; 58 maintainers = with maintainers; [ fpletz kamilchm ]; 59 }; 60 }
··· 1 + { stdenv, fetchFromGitHub, python3Packages, glibcLocales }: 2 3 + with python3Packages; 4 5 buildPythonPackage rec { 6 + pname = "mitmproxy"; 7 + version = "3.0.2"; 8 9 src = fetchFromGitHub { 10 + owner = pname; 11 + repo = pname; 12 + rev = "v${version}"; 13 sha256 = "0rvwm11yryzlp3c1i42rk2iv1m38yn6r83k41jb51hwg6wzbwzvw"; 14 }; 15 16 + postPatch = '' 17 + # remove dependency constraints 18 + sed 's/>=\([0-9]\.\?\)\+\( \?, \?<\([0-9]\.\?\)\+\)\?//' -i setup.py 19 + ''; 20 + 21 checkPhase = '' 22 export HOME=$(mktemp -d) 23 + export LC_CTYPE=en_US.UTF-8 24 # test_echo resolves hostnames 25 + pytest -k 'not test_echo and not test_find_unclaimed_URLs ' 26 ''; 27 28 propagatedBuildInputs = [ 29 blinker click certifi cryptography 30 + h2 hyperframe kaitaistruct passlib 31 + pyasn1 pyopenssl pyparsing pyperclip 32 + requests ruamel_yaml tornado urwid 33 + brotlipy sortedcontainers ldap3 34 ]; 35 36 buildInputs = [ 37 + beautifulsoup4 flask pytest 38 + pytestrunner glibcLocales 39 ]; 40 41 meta = with stdenv.lib; { 42 description = "Man-in-the-middle proxy"; 43 + homepage = https://mitmproxy.org/; 44 + license = licenses.mit; 45 maintainers = with maintainers; [ fpletz kamilchm ]; 46 }; 47 }
-11
pkgs/tools/networking/mitmproxy/tornado-4.6.patch
··· 1 - --- mitmproxy-v2.0.2-src.org/setup.py 2017-08-28 07:31:51.727424688 +0100 2 - +++ mitmproxy-v2.0.2-src/setup.py 2017-08-28 07:35:55.608919302 +0100 3 - @@ -78,7 +78,7 @@ 4 - "pyperclip>=1.5.22, <1.6", 5 - "requests>=2.9.1, <3", 6 - "ruamel.yaml>=0.13.2, <0.14", 7 - - "tornado>=4.3, <4.5", 8 - + "tornado>=4.3, <4.6", 9 - "urwid>=1.3.1, <1.4", 10 - "watchdog>=0.8.3, <0.9", 11 - "brotlipy>=0.5.1, <0.7",
···