Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ alcotest-lwt
2, buildDunePackage
3, ocaml
4, dune-site
5, fetchurl
6, gluten-lwt-unix
7, lib
8, logs
9, lwt_ssl
10, magic-mime
11, mrmime
12, pecu
13, psq
14, ssl
15, uri
16}:
17
18lib.throwIf (lib.versionAtLeast ocaml.version "5.0")
19 "piaf is not available for OCaml ${ocaml.version}"
20
21buildDunePackage rec {
22 pname = "piaf";
23 version = "0.1.0";
24
25 duneVersion = "3";
26
27 src = fetchurl {
28 url = "https://github.com/anmonteiro/piaf/releases/download/${version}/piaf-${version}.tbz";
29 hash = "sha256-AMO+ptGox33Bi7u/H0SaeCU88XORrRU3UbLof3EwcmU=";
30 };
31
32 postPatch = ''
33 substituteInPlace ./vendor/dune --replace "mrmime.prettym" "prettym"
34 '';
35
36 propagatedBuildInputs = [
37 logs
38 magic-mime
39 mrmime
40 psq
41 uri
42 gluten-lwt-unix
43 ];
44
45 nativeCheckInputs = [
46 alcotest-lwt
47 dune-site
48 ];
49 # Check fails with OpenSSL 3
50 doCheck = false;
51
52 meta = {
53 description = "An HTTP library with HTTP/2 support written entirely in OCaml";
54 homepage = "https://github.com/anmonteiro/piaf";
55 license = lib.licenses.bsd3;
56 maintainers = with lib.maintainers; [ anmonteiro ];
57 };
58}