about summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/ocaml-modules')
-rw-r--r--pkgs/development/ocaml-modules/fiat-p256/default.nix26
-rw-r--r--pkgs/development/ocaml-modules/hacl_x25519/default.nix23
-rw-r--r--pkgs/development/ocaml-modules/hkdf/default.nix26
-rw-r--r--pkgs/development/ocaml-modules/janestreet/re2.nix20
-rw-r--r--pkgs/development/ocaml-modules/mdx/default.nix9
-rw-r--r--pkgs/development/ocaml-modules/re2/Makefile.patch17
-rw-r--r--pkgs/development/ocaml-modules/re2/default.nix29
-rw-r--r--pkgs/development/ocaml-modules/re2/myocamlbuild.patch24
-rw-r--r--pkgs/development/ocaml-modules/tls/default.nix16
-rw-r--r--pkgs/development/ocaml-modules/wasm/default.nix6
10 files changed, 92 insertions, 104 deletions
diff --git a/pkgs/development/ocaml-modules/fiat-p256/default.nix b/pkgs/development/ocaml-modules/fiat-p256/default.nix
new file mode 100644
index 000000000000..ac7e6640eeab
--- /dev/null
+++ b/pkgs/development/ocaml-modules/fiat-p256/default.nix
@@ -0,0 +1,26 @@
+{ lib, buildDunePackage, fetchurl, alcotest, asn1-combinators, benchmark
+, bigarray-compat, cstruct, eqaf, hex, ppx_deriving_yojson, rresult
+, stdlib-shims, yojson, dune-configurator }:
+
+buildDunePackage rec {
+  pname = "fiat-p256";
+  version = "0.2.1";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/fiat/releases/download/v${version}/${pname}-v${version}.tbz";
+    sha256 = "0086h9qkvnqfm8acrxqbki54z619nj73x7f0d01v5vg2naznx7w9";
+  };
+
+  buildInputs = [ dune-configurator ];
+  propagatedBuildInputs = [ bigarray-compat cstruct eqaf hex ];
+  checkInputs = [ alcotest asn1-combinators benchmark
+                  ppx_deriving_yojson rresult stdlib-shims yojson ];
+  doCheck = true;
+
+  meta = with lib; {
+    description = "Primitives for Elliptic Curve Cryptography taken from Fiat";
+    homepage = "https://github.com/mirage/fiat";
+    license = licenses.mit;
+    maintainers = with maintainers; [ sternenseemann ];
+  };
+}
diff --git a/pkgs/development/ocaml-modules/hacl_x25519/default.nix b/pkgs/development/ocaml-modules/hacl_x25519/default.nix
new file mode 100644
index 000000000000..a741f5b66819
--- /dev/null
+++ b/pkgs/development/ocaml-modules/hacl_x25519/default.nix
@@ -0,0 +1,23 @@
+{ lib, buildDunePackage, fetchurl, benchmark, cstruct
+, eqaf, hex, ppx_blob, ppx_deriving_yojson, stdlib-shims, yojson }:
+
+buildDunePackage rec {
+  pname = "hacl_x25519";
+  version = "0.1.1";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/hacl/releases/download/v${version}/${pname}-v${version}.tbz";
+    sha256 = "187khbx1myh942c2v5f7wbms2hmhmgn57ik25djhnryln32c0874";
+  };
+
+  propagatedBuildInputs = [ eqaf cstruct ];
+  checkInputs = [ benchmark hex ppx_blob ppx_deriving_yojson stdlib-shims yojson ];
+  doCheck = true;
+
+  meta = with lib; {
+    description = "Primitives for Elliptic Curve Cryptography taken from Project Everest";
+    homepage = "https://github.com/mirage/hacl";
+    license = licenses.mit;
+    maintainers = with maintainers; [ sternenseemann ];
+  };
+}
diff --git a/pkgs/development/ocaml-modules/hkdf/default.nix b/pkgs/development/ocaml-modules/hkdf/default.nix
new file mode 100644
index 000000000000..9832a5f4c41b
--- /dev/null
+++ b/pkgs/development/ocaml-modules/hkdf/default.nix
@@ -0,0 +1,26 @@
+{ lib, buildDunePackage, fetchurl, cstruct, mirage-crypto, alcotest }:
+
+buildDunePackage rec {
+  pname = "hkdf";
+  version = "1.0.4";
+
+  minimumOCamlVersion = "4.07";
+
+  src = fetchurl {
+    url = "https://github.com/hannesm/ocaml-${pname}/releases/download/v${version}/${pname}-v${version}.tbz";
+    sha256 = "0nzx6vzbc1hh6vx1ly8df4b16lgps6zjpp9mjycsnnn49bddc9mr";
+  };
+
+  useDune2 = true;
+
+  propagatedBuildInputs = [ cstruct mirage-crypto ];
+  checkInputs = [ alcotest ];
+  doCheck = true;
+
+  meta = with lib; {
+    description = "HMAC-based Extract-and-Expand Key Derivation Function (RFC 5869)";
+    homepage = "https://github.com/hannesm/ocaml-hkdf";
+    license = licenses.mit;
+    maintainers = with maintainers; [ sternenseemann ];
+  };
+}
diff --git a/pkgs/development/ocaml-modules/janestreet/re2.nix b/pkgs/development/ocaml-modules/janestreet/re2.nix
deleted file mode 100644
index 1157c398080b..000000000000
--- a/pkgs/development/ocaml-modules/janestreet/re2.nix
+++ /dev/null
@@ -1,20 +0,0 @@
-{stdenv, buildOcamlJane,
- bin_prot, core_kernel, fieldslib, sexplib, typerep, variantslib,
- ppx_assert, ppx_bench, ppx_driver, ppx_expect, ppx_inline_test, ppx_jane,
- rsync}:
-
-buildOcamlJane {
-  name = "re2";
-  hash = "0fw5jscb1i17aw8v4l965zw20kyimhfnmf4w83wqaaxkqy3l6fqw";
-  buildInputs = [ rsync ];
-  propagatedBuildInputs =
-    [ bin_prot core_kernel fieldslib sexplib typerep variantslib
-      ppx_assert ppx_bench ppx_driver ppx_expect ppx_inline_test ppx_jane ];
-
-  meta = with stdenv.lib; {
-    homepage = "https://github.com/janestreet/re2";
-    description = "OCaml bindings for RE2";
-    maintainers = [ maintainers.maurer ];
-    license = licenses.asl20;
-  };
-}
diff --git a/pkgs/development/ocaml-modules/mdx/default.nix b/pkgs/development/ocaml-modules/mdx/default.nix
index 261374115ffa..1331c10d426b 100644
--- a/pkgs/development/ocaml-modules/mdx/default.nix
+++ b/pkgs/development/ocaml-modules/mdx/default.nix
@@ -1,19 +1,20 @@
 { lib, fetchurl, buildDunePackage, opaline, ocaml
+, alcotest
 , astring, cmdliner, cppo, fmt, logs, ocaml-migrate-parsetree, ocaml-version, ocaml_lwt, pandoc, re }:
 
 buildDunePackage rec {
   pname = "mdx";
-  version = "1.5.0";
+  version = "1.6.0";
 
   src = fetchurl {
-    url = "https://github.com/realworldocaml/mdx/releases/download/1.5.0/mdx-1.5.0.tbz";
-    sha256 = "0g45plf4z7d178gp0bx7842fwbd3m19679yfph3s95da6mrfm3xn";
+    url = "https://github.com/realworldocaml/mdx/releases/download/${version}/mdx-${version}.tbz";
+    sha256 = "18m4ay226dwbgnwp3ia6bfcm033dvp9yby0lbddqn8ak374m2k3b";
   };
 
   nativeBuildInputs = [ cppo ];
   buildInputs = [ cmdliner ];
   propagatedBuildInputs = [ astring fmt logs ocaml-migrate-parsetree ocaml-version re ];
-  checkInputs = lib.optionals doCheck [ ocaml_lwt pandoc ];
+  checkInputs = [ alcotest ocaml_lwt pandoc ];
 
   doCheck = true;
 
diff --git a/pkgs/development/ocaml-modules/re2/Makefile.patch b/pkgs/development/ocaml-modules/re2/Makefile.patch
deleted file mode 100644
index fcb6eefe62b2..000000000000
--- a/pkgs/development/ocaml-modules/re2/Makefile.patch
+++ /dev/null
@@ -1,17 +0,0 @@
---- ./lib/Makefile	2014-11-18 08:16:19.000000000 -0800
-+++ ./lib/Makefile	2015-05-23 14:48:31.000000000 -0700
-@@ -6,12 +6,12 @@
- all: libre2_stubs.a dllre2_stubs.so
- 
- dllre2_stubs.so libre2_stubs.a: stubs.o $(LIBRE2)
--	ocamlmklib -oc re2_stubs stubs.o $(LIBRE2) -lstdc++
-+	ocamlmklib -oc re2_stubs stubs.o $(LIBRE2) -lc++
- 	rm libre2_stubs.a # ocamlmklib just includes $(LIBRE2) inside the stubs archive
- 	cp $(LIBRE2) libre2_stubs.a && ar r libre2_stubs.a stubs.o
- 
- stubs.o: stubs.cpp stubs.h util.h enum_x_macro.h
--	g++ -O2 -DPIC -fPIC -g -pipe -DCAML_NAME_SPACE -Wall -I. -I../../../include \
-+	$(CXX) -O2 -DPIC -fPIC -g -pipe -DCAML_NAME_SPACE -Wall -I. -I../../../include \
- 	-I$(RE2_HOME) -I$(ocaml-version-selected-include-path) -c stubs.cpp
- 
- #stubs.o: %.o: %.cpp %.h
diff --git a/pkgs/development/ocaml-modules/re2/default.nix b/pkgs/development/ocaml-modules/re2/default.nix
deleted file mode 100644
index 1132d97f74a5..000000000000
--- a/pkgs/development/ocaml-modules/re2/default.nix
+++ /dev/null
@@ -1,29 +0,0 @@
-{stdenv, buildOcaml, fetchurl, core_p4, pa_ounit, pa_test,
- bin_prot_p4, comparelib, sexplib_p4, rsync}:
-
-buildOcaml rec {
-  name = "re2";
-  version = "112.06.00";
-
-  minimumSupportedOcamlVersion = "4.00";
-
-  src = fetchurl {
-    url = "https://github.com/janestreet/re2/archive/${version}.tar.gz";
-    sha256 = "a538765872363fcb67f12b95c07455a0afd68f5ae9008b59bb85a996d97cc752";
-  };
-  patches = if stdenv.isDarwin
-            then [./Makefile.patch ./myocamlbuild.patch]
-            else null;
-
-  buildInputs = [ pa_ounit pa_test rsync ];
-  propagatedBuildInputs = [ core_p4 bin_prot_p4 comparelib sexplib_p4 ];
-
-  hasSharedObjects = true;
-
-  meta = with stdenv.lib; {
-    homepage = "https://github.com/janestreet/re2";
-    description = "OCaml bindings for RE2";
-    license = stdenv.lib.licenses.asl20;
-    maintainers = [ maintainers.ericbmerritt ];
-  };
-}
diff --git a/pkgs/development/ocaml-modules/re2/myocamlbuild.patch b/pkgs/development/ocaml-modules/re2/myocamlbuild.patch
deleted file mode 100644
index 46ad6fa801b8..000000000000
--- a/pkgs/development/ocaml-modules/re2/myocamlbuild.patch
+++ /dev/null
@@ -1,24 +0,0 @@
---- ./myocamlbuild.ml	2015-05-23 14:35:18.000000000 -0700
-+++ ./myocamlbuild.ml	2015-05-23 15:05:24.000000000 -0700
-@@ -626,16 +626,18 @@
-     rule "Generate lib/options.ml"
-       ~prod:"lib/options.ml"
-       ~deps:["lib/options.mlp"; "lib/enum_x_macro.h"]
--      (fun _ _ -> Cmd (S[A"gcc"; A"-E"; A"-P"; A"-x"; A"c";
-+      (fun _ _ -> Cmd (S[A"cc"; A"-E"; A"-P"; A"-x"; A"c";
-                          P"lib/options.mlp"; A"-o"; P"lib/options.ml"]));
- 
-     flag ["ocaml"; "link"; "library"; "native"] (S[A"-cclib"; A"-Llib";
-                                                    A"-cclib"; A"-lre2_stubs";
--                                                   A"-cclib"; A"-lstdc++"]);
-+                                                   A"-ccopt"; A"--stdlib=libc++";
-+                                                   A"-cclib"; A"-lc++"]);
-     flag ["ocaml"; "link"; "library"; "byte"]   (S[A"-dllib"; A"dllre2_stubs.so";
-                                                    A"-cclib"; A"-Llib";
-                                                    A"-cclib"; A"-lre2_stubs";
--                                                   A"-cclib"; A"-lstdc++"]);
-+                                                   A"-ccopt"; A"--stdlib=libc++";                                                   
-+                                                   A"-cclib"; A"-lc++"]);
-   | _ ->
-     ()
- 
diff --git a/pkgs/development/ocaml-modules/tls/default.nix b/pkgs/development/ocaml-modules/tls/default.nix
index e425e2a3b7e4..dea03f2b38a7 100644
--- a/pkgs/development/ocaml-modules/tls/default.nix
+++ b/pkgs/development/ocaml-modules/tls/default.nix
@@ -1,28 +1,30 @@
-{ stdenv, fetchurl, buildDunePackage, ppx_sexp_conv, ppx_cstruct, cstruct
+{ lib, fetchurl, buildDunePackage, ppx_sexp_conv, ppx_cstruct, cstruct
 , cstruct-sexp, sexplib, mirage-crypto, mirage-crypto-pk, mirage-crypto-rng
-, x509, domain-name, fmt, cstruct-unix, ounit2, ocaml_lwt, ptime }:
+, x509, domain-name, fmt, cstruct-unix, ounit2, ocaml_lwt, ptime
+, hacl_x25519, fiat-p256, hkdf, logs, alcotest }:
 
 buildDunePackage rec {
   minimumOCamlVersion = "4.07";
 
-  version = "0.11.1";
+  version = "0.12.0";
   pname = "tls";
 
   src = fetchurl {
     url = "https://github.com/mirleft/ocaml-tls/releases/download/v${version}/tls-v${version}.tbz";
-    sha256 = "0ms13fbaxgmpbviazlfa4hb7nmi7s22nklc7ns926b0rr1aq1069";
+    sha256 = "0fy38qmy7rcld1b4qzz4ycl1fr0v1wa7qd24125lpd6hly86fn57";
   };
 
   useDune2 = true;
 
   doCheck = true;
-  buildInputs = [ cstruct-unix ounit2 ];
+  checkInputs = [ cstruct-unix ounit2 alcotest ];
 
   propagatedBuildInputs = [ ppx_sexp_conv ppx_cstruct cstruct cstruct-sexp
                             sexplib mirage-crypto mirage-crypto-pk mirage-crypto-rng
-                            x509 domain-name fmt ocaml_lwt ptime ];
+                            x509 domain-name fmt ocaml_lwt ptime hacl_x25519 fiat-p256
+                            hkdf logs ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/mirleft/ocaml-tls";
     description = "TLS in pure OCaml";
     license = licenses.bsd2;
diff --git a/pkgs/development/ocaml-modules/wasm/default.nix b/pkgs/development/ocaml-modules/wasm/default.nix
index a76fa5eeebe0..06c84531482e 100644
--- a/pkgs/development/ocaml-modules/wasm/default.nix
+++ b/pkgs/development/ocaml-modules/wasm/default.nix
@@ -6,13 +6,13 @@ else
 
 stdenv.mkDerivation rec {
   name = "ocaml${ocaml.version}-wasm-${version}";
-  version = "1.1";
+  version = "1.1.1";
 
   src = fetchFromGitHub {
     owner = "WebAssembly";
     repo = "spec";
-    rev = "v${version}";
-    sha256 = "1jsgrjqzsdmm6f5pgd947nikj7pnxx1mqdnz16j7s62rg8x06h7d";
+    rev = "opam-${version}";
+    sha256 = "1kp72yv4k176i94np0m09g10cviqp2pnpm7jmiq6ik7fmmbknk7c";
   };
 
   buildInputs = [ ocaml findlib ocamlbuild ];