summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules/otr/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/ocaml-modules/otr/default.nix')
-rw-r--r--pkgs/development/ocaml-modules/otr/default.nix22
1 files changed, 13 insertions, 9 deletions
diff --git a/pkgs/development/ocaml-modules/otr/default.nix b/pkgs/development/ocaml-modules/otr/default.nix
index 189b3adf8739..ac853c94094b 100644
--- a/pkgs/development/ocaml-modules/otr/default.nix
+++ b/pkgs/development/ocaml-modules/otr/default.nix
@@ -1,22 +1,25 @@
-{ stdenv, buildOcaml, fetchFromGitHub, ocamlbuild, findlib, topkg, ocaml
-, ppx_tools, ppx_sexp_conv, cstruct, ppx_cstruct, sexplib, result, nocrypto, astring
+{ stdenv, fetchFromGitHub, ocaml, ocamlbuild, findlib, topkg
+, ppx_tools, ppx_sexp_conv, cstruct, ppx_cstruct, sexplib, rresult, nocrypto
+, astring
 }:
 
-buildOcaml rec {
-  name = "otr";
-  version = "0.3.3";
+if !stdenv.lib.versionAtLeast ocaml.version "4.03"
+then throw "otr is not available for OCaml ${ocaml.version}"
+else
 
-  minimumSupportedOcamlVersion = "4.02";
+stdenv.mkDerivation rec {
+  name = "ocaml${ocaml.version}-otr-${version}";
+  version = "0.3.4";
 
   src = fetchFromGitHub {
     owner  = "hannesm";
     repo   = "ocaml-otr";
     rev    = "${version}";
-    sha256 = "07zzix5mfsasqpqdx811m0x04gp8mq1ayf4b64998k98027v01rr";
+    sha256 = "0ixf0jvccmcbhk5mhzqakfzimvz200wkdkq3z2d0bdzyggslbdl4";
   };
 
-  buildInputs = [ ocamlbuild findlib topkg ppx_tools ppx_sexp_conv ppx_cstruct ];
-  propagatedBuildInputs = [ cstruct sexplib result nocrypto astring ];
+  buildInputs = [ ocaml ocamlbuild findlib topkg ppx_tools ppx_sexp_conv ppx_cstruct ];
+  propagatedBuildInputs = [ cstruct sexplib rresult nocrypto astring ];
 
   buildPhase = "${topkg.run} build --tests true";
 
@@ -26,6 +29,7 @@ buildOcaml rec {
   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;