about summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules
diff options
context:
space:
mode:
authorMihai Fufezan <fufexan@pm.me>2021-08-27 10:33:19 +0300
committerVincent Laporte <vbgl@users.noreply.github.com>2021-08-27 12:00:16 +0200
commitdd37bf5d75fd1fbfc7e71d46c9db926909198eef (patch)
tree3cdaa59da96ce60727c7fe5dc92ee72fd8ded38c /pkgs/development/ocaml-modules
parent38927fac53a02f233f294265e48cc2bcbd7b2667 (diff)
downloadnixlib-dd37bf5d75fd1fbfc7e71d46c9db926909198eef.tar
nixlib-dd37bf5d75fd1fbfc7e71d46c9db926909198eef.tar.gz
nixlib-dd37bf5d75fd1fbfc7e71d46c9db926909198eef.tar.bz2
nixlib-dd37bf5d75fd1fbfc7e71d46c9db926909198eef.tar.lz
nixlib-dd37bf5d75fd1fbfc7e71d46c9db926909198eef.tar.xz
nixlib-dd37bf5d75fd1fbfc7e71d46c9db926909198eef.tar.zst
nixlib-dd37bf5d75fd1fbfc7e71d46c9db926909198eef.zip
ocamlPackages.chacha: init at 1.0.0
Diffstat (limited to 'pkgs/development/ocaml-modules')
-rw-r--r--pkgs/development/ocaml-modules/chacha/default.nix41
1 files changed, 41 insertions, 0 deletions
diff --git a/pkgs/development/ocaml-modules/chacha/default.nix b/pkgs/development/ocaml-modules/chacha/default.nix
new file mode 100644
index 000000000000..21bae79ab5f8
--- /dev/null
+++ b/pkgs/development/ocaml-modules/chacha/default.nix
@@ -0,0 +1,41 @@
+{ lib
+, buildDunePackage
+, fetchurl
+, ocaml
+
+, alcotest
+, cstruct
+, mirage-crypto
+}:
+
+buildDunePackage rec {
+  pname = "chacha";
+  version = "1.0.0";
+
+  src = fetchurl {
+    url = "https://github.com/abeaumont/ocaml-chacha/releases/download/${version}/${pname}-${version}.tbz";
+    sha256 = "sha256-t8dOMQQDpje0QbuOhjSIa3xnXuXcxMVTLENa/rwdgA4=";
+  };
+
+  useDune2 = true;
+
+  minimumOCamlVersion = "4.02";
+
+  propagatedBuildInputs = [ cstruct mirage-crypto ];
+
+  # alcotest isn't available for OCaml < 4.05 due to fmt
+  doCheck = lib.versionAtLeast ocaml.version "4.05";
+  checkInputs = [ alcotest ];
+
+  meta = {
+    homepage = "https://github.com/abeaumont/ocaml-chacha";
+    description = "ChaCha20, ChaCha12 and ChaCha8 encryption functions, in OCaml";
+    longDescription = ''
+      An OCaml implementation of ChaCha functions, both ChaCha20 and the reduced
+      ChaCha8 and ChaCha12 functions. The hot loop is implemented in C for efficiency
+      reasons.
+    '';
+    license = lib.licenses.bsd2;
+    maintainers = with lib.maintainers; [ fufexan ];
+  };
+}