summary refs log tree commit diff
diff options
context:
space:
mode:
authorsternenseemann <git@lukasepple.de>2016-11-03 10:39:14 +0100
committersternenseemann <git@lukasepple.de>2016-11-03 14:39:26 +0100
commit9554143a9c7eee341788780ff8da591dfe3ddc12 (patch)
tree7abcf0dc776a1dd6fa2879bbb6feda1cb77450d6
parent02388e9ba55972f8af428a65d8eb9684ec586dde (diff)
downloadnixlib-9554143a9c7eee341788780ff8da591dfe3ddc12.tar
nixlib-9554143a9c7eee341788780ff8da591dfe3ddc12.tar.gz
nixlib-9554143a9c7eee341788780ff8da591dfe3ddc12.tar.bz2
nixlib-9554143a9c7eee341788780ff8da591dfe3ddc12.tar.lz
nixlib-9554143a9c7eee341788780ff8da591dfe3ddc12.tar.xz
nixlib-9554143a9c7eee341788780ff8da591dfe3ddc12.tar.zst
nixlib-9554143a9c7eee341788780ff8da591dfe3ddc12.zip
ocaml-otr: init at 0.3.3
-rw-r--r--pkgs/development/ocaml-modules/otr/default.nix43
-rw-r--r--pkgs/top-level/ocaml-packages.nix4
2 files changed, 46 insertions, 1 deletions
diff --git a/pkgs/development/ocaml-modules/otr/default.nix b/pkgs/development/ocaml-modules/otr/default.nix
new file mode 100644
index 000000000000..086207541284
--- /dev/null
+++ b/pkgs/development/ocaml-modules/otr/default.nix
@@ -0,0 +1,43 @@
+{stdenv, buildOcaml, fetchFromGitHub, ocamlbuild, findlib, topkg, ocaml, opam,
+ ppx_tools, ppx_sexp_conv, cstruct, sexplib_p4, result, nocrypto, astring}:
+
+let ocamlFlags = "-I ${findlib}/lib/ocaml/${ocaml.version}/site-lib/"; in
+
+buildOcaml rec {
+  name = "otr";
+  version = "0.3.3";
+
+  minimumSupportedOcamlVersion = "4.02.2";
+
+  src = fetchFromGitHub {
+    owner  = "hannesm";
+    repo   = "ocaml-otr";
+    rev    = "${version}";
+    sha256 = "07zzix5mfsasqpqdx811m0x04gp8mq1ayf4b64998k98027v01rr";
+  };
+
+  buildInputs = [ ocamlbuild findlib topkg ppx_tools ppx_sexp_conv opam ];
+  propagatedBuildInputs = [ cstruct sexplib_p4 result nocrypto astring ];
+
+  buildPhase = ''
+    ocaml ${ocamlFlags}  pkg/pkg.ml build \
+      --tests true
+  '';
+
+  installPhase = ''
+    opam-installer --prefix=$out --script | sh
+    ln -s $out/lib/otr $out/lib/ocaml/${ocaml.version}/site-lib
+  '';
+
+  doCheck = true;
+  checkPhase = "ocaml ${ocamlFlags} pkg/pkg.ml test";
+
+  createFindlibDestdir = true;
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/hannesm/ocaml-otr;
+    description = "Off-the-record (OTR) messaging protocol, purely in OCaml.";
+    license = licenses.bsd2;
+    maintainers = with maintainers; [ sternenseemann ];
+  };
+}
diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix
index 55a5cd7c8cf3..273e9d3d400d 100644
--- a/pkgs/top-level/ocaml-packages.nix
+++ b/pkgs/top-level/ocaml-packages.nix
@@ -343,6 +343,8 @@ let
 
     otfm = callPackage ../development/ocaml-modules/otfm { };
 
+    otr = callPackage ../development/ocaml-modules/otr { };
+
     ounit = callPackage ../development/ocaml-modules/ounit { };
 
     piqi = callPackage ../development/ocaml-modules/piqi { };
@@ -649,7 +651,7 @@ let
       then { tools = pkgs.pkgsi686Linux.stdenv.cc; }
       else {}
     );
-    
+
     glsurf = callPackage ../applications/science/math/glsurf {
       libpng = pkgs.libpng12;
       giflib = pkgs.giflib_4_1;