1{ buildDunePackage
2, lib
3, fetchFromGitHub
4, ocaml
5, hpack
6, angstrom
7, faraday
8, base64
9, psq
10, httpaf
11, alcotest
12, yojson
13, hex
14}:
15
16let
17 http2-frame-test-case = fetchFromGitHub {
18 owner = "http2jp";
19 repo = "http2-frame-test-case";
20 rev = "5c67db0d4d68e1fb7d3a241d6e01fc04d981f465";
21 sha256 = "16yyb37f8mk9saw7ndjs5is67yq7qa6b6y7k0c75ibxi4n9aw1r3";
22 };
23in
24
25buildDunePackage rec {
26 pname = "h2";
27
28 inherit (hpack)
29 version
30 src
31 ;
32
33 duneVersion = "3";
34 minimalOCamlVersion = "4.06";
35
36 propagatedBuildInputs = [
37 angstrom
38 faraday
39 base64
40 psq
41 hpack
42 httpaf
43 ];
44
45 # Tests fail with ≤ 4.07
46 doCheck = lib.versionAtLeast ocaml.version "4.08";
47 preCheck = ''
48 ln -s "${http2-frame-test-case}" lib_test/http2-frame-test-case
49 '';
50 checkInputs = [
51 alcotest
52 yojson
53 hex
54 ];
55
56 meta = hpack.meta // {
57 description = "A high-performance, memory-efficient, and scalable HTTP/2 library for OCaml";
58 };
59}