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