nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at 19.03 41 lines 1.2 kB view raw
1{ stdenv, fetchFromGitHub, ocaml, findlib, ocamlbuild, topkg 2, ppx_sexp_conv, result, x509, nocrypto, cstruct, ppx_cstruct, cstruct-unix, ounit 3, lwt ? null}: 4 5with stdenv.lib; 6 7let withLwt = lwt != null; in 8 9if !versionAtLeast ocaml.version "4.04" 10then throw "tls is not available for OCaml ${ocaml.version}" 11else 12 13stdenv.mkDerivation rec { 14 version = "0.9.0"; 15 name = "ocaml${ocaml.version}-tls-${version}"; 16 17 src = fetchFromGitHub { 18 owner = "mirleft"; 19 repo = "ocaml-tls"; 20 rev = "${version}"; 21 sha256 = "0qgw8lq8pk9hss7b5i6fr08pi711i0zqx7yyjgcil47ipjig6c31"; 22 }; 23 24 buildInputs = [ ocaml ocamlbuild findlib topkg ppx_sexp_conv ounit ppx_cstruct cstruct-unix ]; 25 propagatedBuildInputs = [ cstruct nocrypto result x509 ] ++ 26 optional withLwt lwt; 27 28 buildPhase = "${topkg.run} build --tests true --with-mirage false --with-lwt ${if withLwt then "true" else "false"}"; 29 30 doCheck = true; 31 checkPhase = "${topkg.run} test"; 32 33 inherit (topkg) installPhase; 34 35 meta = with stdenv.lib; { 36 homepage = https://github.com/mirleft/ocaml-tls; 37 description = "TLS in pure OCaml"; 38 license = licenses.bsd2; 39 maintainers = with maintainers; [ sternenseemann ]; 40 }; 41}