about summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules/mirage-crypto/default.nix
blob: 2ca41800baf2bfdd990d2648d7ef2fad71e9e7aa (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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 ];
  };
}