@@ -1,4 +1,4 @@
1−{ stdenv, buildOcaml, fetchFromGitHub, findlib, ocamlbuild, ocaml_oasis
1+{ stdenv, fetchFromGitHub, ocaml, findlib, ocamlbuild, topkg
22, ppx_tools, ppx_sexp_conv, result, x509, nocrypto, cstruct, ppx_cstruct, cstruct-unix, ounit
33, lwt ? null}:
44
@@ -6,31 +6,27 @@ with stdenv.lib;
66
77let withLwt = lwt != null; in
88
9−buildOcaml rec {
10− version = "0.7.1";
11− name = "tls";
12−
13− minimunSupportedOcamlVersion = "4.02";
9+stdenv.mkDerivation rec {
10+ version = "0.9.0";
11+ name = "ocaml${ocaml.version}-tls-${version}";
1412
1513 src = fetchFromGitHub {
1614 owner = "mirleft";
1715 repo = "ocaml-tls";
1816 rev = "${version}";
19− sha256 = "19q2hzxiasz9pzczgb63kikg0mc9mw98dfvch5falf2rincycj24";
17+ sha256 = "0qgw8lq8pk9hss7b5i6fr08pi711i0zqx7yyjgcil47ipjig6c31";
2018 };
2119
22− buildInputs = [ ocamlbuild findlib ocaml_oasis ppx_sexp_conv ounit ppx_cstruct cstruct-unix ];
20+ buildInputs = [ ocaml ocamlbuild findlib topkg ppx_sexp_conv ounit ppx_cstruct cstruct-unix ];
2321 propagatedBuildInputs = [ cstruct nocrypto result x509 ] ++
2422 optional withLwt lwt;
2523
26− configureFlags = [ "--disable-mirage" "--enable-tests" ] ++
27− optional withLwt ["--enable-lwt"];
28−
29− configurePhase = "./configure --prefix $out $configureFlags";
24+ buildPhase = "${topkg.run} build --tests true --with-mirage false --with-lwt ${if withLwt then "true" else "false"}";
3025
3126 doCheck = true;
32− checkTarget = "test";
33− createFindlibDestdir = true;
27+ checkPhase = "${topkg.run} test";
28+
29+ inherit (topkg) installPhase;
3430
3531 meta = with stdenv.lib; {
3632 homepage = https://github.com/mirleft/ocaml-tls;