summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules/nocrypto/default.nix
blob: 6e68c87b5ff062e3def487eb891dd0a5decb2d19 (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
34
{ stdenv, fetchFromGitHub, ocaml, findlib, ocamlbuild, topkg
, cpuid, ocb-stubblr
, cstruct, zarith, ppx_sexp_conv, sexplib
, cstruct-lwt ? null
}:

with stdenv.lib;
let withLwt = cstruct-lwt != null; in

stdenv.mkDerivation rec {
  name = "ocaml${ocaml.version}-nocrypto-${version}";
  version = "0.5.4";

  src = fetchFromGitHub {
    owner  = "mirleft";
    repo   = "ocaml-nocrypto";
    rev    = "v${version}";
    sha256 = "0nhnlpbqh3mf9y2cxivlvfb70yfbdpvg6jslzq64xblpgjyg443p";
  };

  buildInputs = [ ocaml findlib ocamlbuild topkg cpuid ocb-stubblr
    ppx_sexp_conv ];
  propagatedBuildInputs = [ cstruct zarith sexplib ] ++ optional withLwt cstruct-lwt;

  buildPhase = "${topkg.buildPhase} --with-lwt ${boolToString withLwt}";
  inherit (topkg) installPhase;

  meta = {
    homepage = https://github.com/mirleft/ocaml-nocrypto;
    description = "Simplest possible crypto to support TLS";
    license = stdenv.lib.licenses.bsd2;
    maintainers = with stdenv.lib.maintainers; [ vbgl ];
  };
}