2017-12-14 07:36:29 +00:00
|
|
|
{ stdenv, fetchFromGitHub, ocaml, findlib, ocamlbuild, topkg
|
2017-03-22 22:53:28 +00:00
|
|
|
, cpuid, ocb-stubblr
|
2017-11-12 10:19:56 +00:00
|
|
|
, cstruct, zarith, ppx_sexp_conv, sexplib
|
2017-11-27 19:08:40 +00:00
|
|
|
, cstruct-lwt ? null
|
2017-03-22 22:53:28 +00:00
|
|
|
}:
|
2015-10-09 20:23:06 +01:00
|
|
|
|
2016-11-03 00:09:54 +00:00
|
|
|
with stdenv.lib;
|
2017-11-27 19:08:40 +00:00
|
|
|
let withLwt = cstruct-lwt != null; in
|
2015-10-09 20:23:06 +01:00
|
|
|
|
2017-03-22 22:53:28 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "ocaml${ocaml.version}-nocrypto-${version}";
|
|
|
|
version = "0.5.4";
|
2016-11-03 00:09:54 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mirleft";
|
|
|
|
repo = "ocaml-nocrypto";
|
|
|
|
rev = "v${version}";
|
2017-03-22 22:53:28 +00:00
|
|
|
sha256 = "0nhnlpbqh3mf9y2cxivlvfb70yfbdpvg6jslzq64xblpgjyg443p";
|
2015-10-09 20:23:06 +01:00
|
|
|
};
|
|
|
|
|
2017-12-14 07:36:29 +00:00
|
|
|
buildInputs = [ ocaml findlib ocamlbuild topkg cpuid ocb-stubblr
|
2017-03-22 22:53:28 +00:00
|
|
|
ppx_sexp_conv ];
|
2017-11-27 19:08:40 +00:00
|
|
|
propagatedBuildInputs = [ cstruct zarith sexplib ] ++ optional withLwt cstruct-lwt;
|
2016-11-03 00:09:54 +00:00
|
|
|
|
2017-03-22 22:53:28 +00:00
|
|
|
buildPhase = ''
|
|
|
|
LD_LIBRARY_PATH=${cpuid}/lib/ocaml/${ocaml.version}/site-lib/stubslibs/ \
|
2017-04-11 17:08:51 +01:00
|
|
|
${topkg.buildPhase} --with-lwt ${boolToString withLwt}
|
2017-03-22 22:53:28 +00:00
|
|
|
'';
|
|
|
|
inherit (topkg) installPhase;
|
2015-10-09 20:23:06 +01:00
|
|
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|