nixpkgs/pkgs/development/ocaml-modules/otr/default.nix

39 lines
1.1 KiB
Nix
Raw Normal View History

2017-12-29 20:08:40 +00:00
{ stdenv, fetchFromGitHub, ocaml, ocamlbuild, findlib, topkg
, ppx_tools, ppx_sexp_conv, cstruct, ppx_cstruct, sexplib, rresult, nocrypto
, astring
2017-12-14 07:36:29 +00:00
}:
2016-11-03 09:39:14 +00:00
2017-12-29 20:08:40 +00:00
if !stdenv.lib.versionAtLeast ocaml.version "4.03"
then throw "otr is not available for OCaml ${ocaml.version}"
else
2016-11-03 09:39:14 +00:00
2017-12-29 20:08:40 +00:00
stdenv.mkDerivation rec {
name = "ocaml${ocaml.version}-otr-${version}";
version = "0.3.4";
2016-11-03 09:39:14 +00:00
src = fetchFromGitHub {
owner = "hannesm";
repo = "ocaml-otr";
rev = "${version}";
2017-12-29 20:08:40 +00:00
sha256 = "0ixf0jvccmcbhk5mhzqakfzimvz200wkdkq3z2d0bdzyggslbdl4";
2016-11-03 09:39:14 +00:00
};
2017-12-29 20:08:40 +00:00
buildInputs = [ ocaml ocamlbuild findlib topkg ppx_tools ppx_sexp_conv ppx_cstruct ];
propagatedBuildInputs = [ cstruct sexplib rresult nocrypto astring ];
2016-11-03 09:39:14 +00:00
2017-12-14 07:36:29 +00:00
buildPhase = "${topkg.run} build --tests true";
2016-11-03 09:39:14 +00:00
2017-12-14 07:36:29 +00:00
inherit (topkg) installPhase;
2016-11-03 09:39:14 +00:00
doCheck = true;
2017-12-14 07:36:29 +00:00
checkPhase = "${topkg.run} test";
2016-11-03 09:39:14 +00:00
meta = with stdenv.lib; {
2017-12-29 20:08:40 +00:00
inherit (ocaml.meta) platforms;
2016-11-03 09:39:14 +00:00
homepage = https://github.com/hannesm/ocaml-otr;
description = "Off-the-record messaging protocol, purely in OCaml";
license = licenses.bsd2;
maintainers = with maintainers; [ sternenseemann ];
};
}