1{ lib
2, stdenv
3, async-timeout
4, attrs
5, buildPythonPackage
6, cryptography
7, fetchFromGitHub
8, pytest-aiohttp
9, pytestCheckHook
10, pythonAtLeast
11, pythonOlder
12}:
13
14buildPythonPackage rec {
15 pname = "snitun";
16 version = "0.35.0";
17 format = "setuptools";
18
19 disabled = pythonOlder "3.7";
20
21 src = fetchFromGitHub {
22 owner = "NabuCasa";
23 repo = pname;
24 rev = "refs/tags/${version}";
25 hash = "sha256-sZMmou9uHThl7AIMnuBxABnWTF1CCFsDj1I7FYxgJ3Y=";
26 };
27
28 propagatedBuildInputs = [
29 async-timeout
30 attrs
31 cryptography
32 ];
33
34 nativeCheckInputs = [
35 pytest-aiohttp
36 pytestCheckHook
37 ];
38
39 disabledTests = lib.optionals stdenv.isDarwin [
40 "test_multiplexer_data_channel_abort_full" # https://github.com/NabuCasa/snitun/issues/61
41 # port binding conflicts
42 "test_snitun_single_runner_timeout"
43 "test_snitun_single_runner_throttling"
44 # ConnectionResetError: [Errno 54] Connection reset by peer
45 "test_peer_listener_timeout"
46 ] ++ lib.optionals (pythonAtLeast "3.11") [
47 # TypeError: Passing coroutines is forbidden, use tasks explicitly.
48 "test_snitun_runner_updown"
49 ];
50
51 pythonImportsCheck = [ "snitun" ];
52
53 meta = with lib; {
54 changelog = "https://github.com/NabuCasa/snitun/releases/tag/${version}";
55 homepage = "https://github.com/nabucasa/snitun";
56 description = "SNI proxy with TCP multiplexer";
57 license = licenses.gpl3Only;
58 maintainers = with maintainers; [ Scriptkiddi ];
59 platforms = platforms.linux;
60 };
61}