summaryrefslogtreecommitdiffstats
path: root/pkgs/development/ocaml-modules/bos/default.nix
blob: 491408108f5d99c3e2743d7d57a34055e1a77fab (plain)
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
{
  stdenv,
  lib,
  fetchurl,
  ocaml,
  findlib,
  ocamlbuild,
  topkg,
  astring,
  fmt,
  fpath,
  logs,
  rresult,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "ocaml${ocaml.version}-bos";
  version = if lib.versionAtLeast ocaml.version "4.14" then "0.3.0" else "0.2.1";

  src = fetchurl {
    url = "https://erratique.ch/software/bos/releases/bos-${finalAttrs.version}.tbz";
    hash =
      {
        "0.3.0" = "sha256-CJ82ntAJZ+kticxfzYSMVr2rXAJzfaTUg1UL9Wtaebw=";
        "0.2.1" = "sha256-2NYueGsQ1pfgRXIFqO7eqifrzJDxhV8Y3xkMrC49jzc=";
      }
      ."${finalAttrs.version}";
  };

  nativeBuildInputs = [
    ocaml
    findlib
    ocamlbuild
    topkg
  ];
  buildInputs = [ topkg ];
  propagatedBuildInputs = [
    astring
    fmt
    fpath
    logs
    rresult
  ];

  strictDeps = true;

  inherit (topkg) buildPhase installPhase;

  meta = {
    description = "Basic OS interaction for OCaml";
    homepage = "https://erratique.ch/software/bos";
    license = lib.licenses.isc;
    maintainers = [ lib.maintainers.vbgl ];
    inherit (ocaml.meta) platforms;
  };
})