about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/ocaml-modules/otr/default.nix
blob: ac853c94094b88640db8e51b229d35314a491570 (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
{ stdenv, fetchFromGitHub, ocaml, ocamlbuild, findlib, topkg
, ppx_tools, ppx_sexp_conv, cstruct, ppx_cstruct, sexplib, rresult, nocrypto
, astring
}:

if !stdenv.lib.versionAtLeast ocaml.version "4.03"
then throw "otr is not available for OCaml ${ocaml.version}"
else

stdenv.mkDerivation rec {
  name = "ocaml${ocaml.version}-otr-${version}";
  version = "0.3.4";

  src = fetchFromGitHub {
    owner  = "hannesm";
    repo   = "ocaml-otr";
    rev    = "${version}";
    sha256 = "0ixf0jvccmcbhk5mhzqakfzimvz200wkdkq3z2d0bdzyggslbdl4";
  };

  buildInputs = [ ocaml ocamlbuild findlib topkg ppx_tools ppx_sexp_conv ppx_cstruct ];
  propagatedBuildInputs = [ cstruct sexplib rresult nocrypto astring ];

  buildPhase = "${topkg.run} build --tests true";

  inherit (topkg) installPhase;

  doCheck = true;
  checkPhase = "${topkg.run} test";

  meta = with stdenv.lib; {
    inherit (ocaml.meta) platforms;
    homepage = https://github.com/hannesm/ocaml-otr;
    description = "Off-the-record messaging protocol, purely in OCaml";
    license = licenses.bsd2;
    maintainers = with maintainers; [ sternenseemann ];
  };
}