1{ lib
2, ocaml
3, version ? if lib.versionAtLeast ocaml.version "5.1" then "0.13" else "0.12"
4, buildDunePackage
5, bigstringaf
6, cstruct
7, domain-local-await
8, dune-configurator
9, fetchurl
10, fmt
11, hmap
12, lwt-dllist
13, mtime
14, optint
15, psq
16, alcotest
17, crowbar
18, mdx
19}:
20
21let
22 param = {
23 "0.12" = {
24 minimalOCamlVersion = "5.0";
25 hash = "sha256-2EhHzoX/t4ZBSWrSS+PGq1zCxohc7a1q4lfsrFnZJqA=";
26 };
27 "0.13" = {
28 minimalOCamlVersion = "5.1";
29 hash = "sha256-glN+4cWxgp/eggdhSk459WC9WCMyhBKQ7V73ZpHzr3A=";
30 };
31 }."${version}";
32in
33buildDunePackage rec {
34 pname = "eio";
35 inherit version;
36 inherit (param) minimalOCamlVersion;
37
38 src = fetchurl {
39 url = "https://github.com/ocaml-multicore/${pname}/releases/download/v${version}/${pname}-${version}.tbz";
40 inherit (param) hash;
41 };
42
43 propagatedBuildInputs = [
44 bigstringaf
45 cstruct
46 domain-local-await
47 fmt
48 hmap
49 lwt-dllist
50 mtime
51 optint
52 psq
53 ];
54
55 checkInputs = [
56 alcotest
57 crowbar
58 mdx
59 ];
60
61 nativeCheckInputs = [
62 mdx.bin
63 ];
64
65 meta = {
66 homepage = "https://github.com/ocaml-multicore/ocaml-${pname}";
67 changelog = "https://github.com/ocaml-multicore/ocaml-${pname}/raw/v${version}/CHANGES.md";
68 description = "Effects-Based Parallel IO for OCaml";
69 license = with lib.licenses; [ isc ];
70 maintainers = with lib.maintainers; [ toastal ];
71 };
72}