2018-01-15 04:01:50 +00:00
|
|
|
{ stdenv, fetchFromGitHub, ocaml, findlib, ocamlbuild, topkg
|
2019-08-24 08:02:26 +01:00
|
|
|
, ppx_sexp_conv, result, x509, nocrypto, cstruct-sexp, ppx_cstruct, cstruct-unix, ounit
|
2016-11-03 00:23:53 +00:00
|
|
|
, lwt ? null}:
|
|
|
|
|
|
|
|
with stdenv.lib;
|
|
|
|
|
|
|
|
let withLwt = lwt != null; in
|
|
|
|
|
2018-07-05 20:40:30 +01:00
|
|
|
if !versionAtLeast ocaml.version "4.04"
|
|
|
|
then throw "tls is not available for OCaml ${ocaml.version}"
|
|
|
|
else
|
|
|
|
|
2018-01-15 04:01:50 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-24 08:02:26 +01:00
|
|
|
version = "0.10.4";
|
2018-01-15 04:01:50 +00:00
|
|
|
name = "ocaml${ocaml.version}-tls-${version}";
|
2016-11-03 00:23:53 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mirleft";
|
|
|
|
repo = "ocaml-tls";
|
2019-09-09 00:38:31 +01:00
|
|
|
rev = version;
|
2019-08-24 08:02:26 +01:00
|
|
|
sha256 = "02wv4lia583imn3sfci4nqv6ac5nzig5j3yfdnlqa0q8bp9rfc6g";
|
2016-11-03 00:23:53 +00:00
|
|
|
};
|
|
|
|
|
2019-10-31 10:16:15 +00:00
|
|
|
nativeBuildInputs = [ ocaml ocamlbuild findlib ];
|
|
|
|
buildInputs = [ findlib topkg ppx_sexp_conv ppx_cstruct ]
|
2019-08-24 08:02:26 +01:00
|
|
|
++ optionals doCheck [ ounit cstruct-unix ];
|
|
|
|
propagatedBuildInputs = [ cstruct-sexp nocrypto result x509 ] ++
|
2016-11-03 00:23:53 +00:00
|
|
|
optional withLwt lwt;
|
|
|
|
|
2019-08-24 08:02:26 +01:00
|
|
|
buildPhase = "${topkg.run} build --tests ${boolToString doCheck} --with-mirage false --with-lwt ${boolToString withLwt}";
|
2016-11-03 00:23:53 +00:00
|
|
|
|
2019-08-24 08:02:26 +01:00
|
|
|
doCheck = versionAtLeast ocaml.version "4.06";
|
2018-01-15 04:01:50 +00:00
|
|
|
checkPhase = "${topkg.run} test";
|
|
|
|
|
|
|
|
inherit (topkg) installPhase;
|
2016-11-03 00:23:53 +00:00
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
homepage = https://github.com/mirleft/ocaml-tls;
|
|
|
|
description = "TLS in pure OCaml";
|
|
|
|
license = licenses.bsd2;
|
|
|
|
maintainers = with maintainers; [ sternenseemann ];
|
|
|
|
};
|
|
|
|
}
|