1{
2 lib,
3 buildPythonPackage,
4 cargo,
5 fetchFromGitHub,
6 hypothesis,
7 pytestCheckHook,
8 pythonOlder,
9 rustc,
10 rustPlatform,
11}:
12
13buildPythonPackage rec {
14 pname = "jh2";
15 version = "5.0.9";
16 pyproject = true;
17
18 disabled = pythonOlder "3.10";
19
20 src = fetchFromGitHub {
21 owner = "jawah";
22 repo = "h2";
23 tag = "v${version}";
24 hash = "sha256-PA2hv+PIqcsvAIh8yIoQjol+Iaa3qsNRE8rBnR4UOzY=";
25 fetchSubmodules = true;
26 };
27
28 cargoDeps = rustPlatform.fetchCargoVendor {
29 inherit pname version src;
30 hash = "sha256-CW95omstpWm76TTSKsb04iChU0EW1Vl+OA3QXxfZAX0=";
31 };
32
33 build-system = [
34 cargo
35 rustPlatform.cargoSetupHook
36 rustPlatform.maturinBuildHook
37 rustc
38 ];
39
40 nativeCheckInputs = [
41 hypothesis
42 pytestCheckHook
43 ];
44
45 pythonImportsCheck = [ "jh2" ];
46
47 meta = {
48 description = "HTTP/2 State-Machine based protocol implementation";
49 homepage = "https://github.com/jawah/h2";
50 changelog = "https://github.com/jawah/h2/blob/${src.rev}/CHANGELOG.rst";
51 license = lib.licenses.mit;
52 maintainers = with lib.maintainers; [
53 fab
54 techknowlogick
55 ];
56 };
57}