summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules/mirage-crypto/default.nix
diff options
context:
space:
mode:
authorsternenseemann <git@lukasepple.de>2020-04-13 13:20:48 +0200
committerVincent Laporte <Vincent.Laporte@gmail.com>2020-04-14 18:06:16 +0200
commitc2db123b219931b3f9ae72003196fd66944a6466 (patch)
tree239c5325fd559254a247988881032cb93b842af2 /pkgs/development/ocaml-modules/mirage-crypto/default.nix
parent3dbfa915ab5df1041424e0a8b279daa59996b6eb (diff)
downloadnixpkgs-c2db123b219931b3f9ae72003196fd66944a6466.tar
nixpkgs-c2db123b219931b3f9ae72003196fd66944a6466.tar.gz
nixpkgs-c2db123b219931b3f9ae72003196fd66944a6466.tar.bz2
nixpkgs-c2db123b219931b3f9ae72003196fd66944a6466.tar.lz
nixpkgs-c2db123b219931b3f9ae72003196fd66944a6466.tar.xz
nixpkgs-c2db123b219931b3f9ae72003196fd66944a6466.tar.zst
nixpkgs-c2db123b219931b3f9ae72003196fd66944a6466.zip
mirage-crypto{,-rng,-pk}: init at 0.6.2
Diffstat (limited to 'pkgs/development/ocaml-modules/mirage-crypto/default.nix')
-rw-r--r--pkgs/development/ocaml-modules/mirage-crypto/default.nix33
1 files changed, 33 insertions, 0 deletions
diff --git a/pkgs/development/ocaml-modules/mirage-crypto/default.nix b/pkgs/development/ocaml-modules/mirage-crypto/default.nix
new file mode 100644
index 00000000000..2ca41800baf
--- /dev/null
+++ b/pkgs/development/ocaml-modules/mirage-crypto/default.nix
@@ -0,0 +1,33 @@
+{ lib, fetchurl, buildDunePackage, ounit, cstruct, ocplib-endian
+, cpuid, dune-configurator, cpuAcceleration ? false }:
+
+buildDunePackage rec {
+  minimumOCamlVersion = "4.07";
+
+  pname = "mirage-crypto";
+  version = "0.6.2";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/mirage-crypto/releases/download/v${version}/mirage-crypto-v${version}.tbz";
+    sha256 = "08xq49cxn66yi0gfajzi8czcxfx24rd191rvf7s10wfkz304sa72";
+  };
+
+  useDune2 = true;
+
+  preBuild = ''
+    MIRAGE_CRYPTO_ACCELERATE=${lib.boolToString cpuAcceleration}
+  '';
+
+  doCheck = true;
+  checkInputs = [ ounit ];
+
+  nativeBuildInputs = [ cpuid dune-configurator ];
+  propagatedBuildInputs = [ cstruct ocplib-endian ];
+
+  meta = with lib; {
+    homepage = "https://github.com/mirage/mirage-crypto";
+    description = "Simple symmetric cryptography for the modern age";
+    license = licenses.isc;
+    maintainers = with maintainers; [ sternenseemann ];
+  };
+}