about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/ocaml-modules/eio/default.nix
blob: 0eafead13cf102ce1ed30ad60f1de3ebdcbee164 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
{ lib
, ocaml
, version ? if lib.versionAtLeast ocaml.version "5.1" then "1.0" else "0.12"
, buildDunePackage
, bigstringaf
, cstruct
, domain-local-await
, dune-configurator
, fetchurl
, fmt
, hmap
, lwt-dllist
, mtime
, optint
, psq
, alcotest
, crowbar
, mdx
}:

let
  param = {
    "0.12" = {
      minimalOCamlVersion = "5.0";
      hash = "sha256-2EhHzoX/t4ZBSWrSS+PGq1zCxohc7a1q4lfsrFnZJqA=";
    };
    "1.0" = {
      minimalOCamlVersion = "5.1";
      hash = "sha256-2iYNnaOLPd6fMWZSogsTomHPkLhaJJisZpt9Vk5hlC0=";
    };
  }."${version}";
in
buildDunePackage rec {
  pname = "eio";
  inherit version;
  inherit (param) minimalOCamlVersion;

  src = fetchurl {
    url = "https://github.com/ocaml-multicore/${pname}/releases/download/v${version}/${pname}-${version}.tbz";
    inherit (param) hash;
  };

  propagatedBuildInputs = [
    bigstringaf
    cstruct
    domain-local-await
    fmt
    hmap
    lwt-dllist
    mtime
    optint
    psq
  ];

  checkInputs = [
    alcotest
    crowbar
    mdx
  ];

  nativeCheckInputs = [
    mdx.bin
  ];

  meta = {
    homepage = "https://github.com/ocaml-multicore/ocaml-${pname}";
    changelog = "https://github.com/ocaml-multicore/ocaml-${pname}/raw/v${version}/CHANGES.md";
    description = "Effects-Based Parallel IO for OCaml";
    license = with lib.licenses; [ isc ];
    maintainers = with lib.maintainers; [ toastal ];
  };
}