nixpkgs/pkgs/development/ocaml-modules/lwt/default.nix
2015-10-20 21:53:12 +02:00

39 lines
1.3 KiB
Nix

{ stdenv, fetchzip, which, cryptopp, ocaml, findlib, ocaml_react, ocaml_ssl, libev, pkgconfig, ncurses, ocaml_oasis, ocaml_text, glib, camlp4, ppx_tools }:
let
version = "2.4.6";
inherit (stdenv.lib) optional getVersion versionAtLeast;
ocaml_version = getVersion ocaml;
in
stdenv.mkDerivation {
name = "ocaml-lwt-${version}";
src = fetchzip {
url = "https://github.com/ocsigen/lwt/archive/${version}.tar.gz";
sha256 = "0idci0zadpb8hmblszsrvg6yf36w5a9y6rsdwjc3jww71dgrw5d9";
};
buildInputs = [ ocaml_oasis pkgconfig which cryptopp ocaml findlib glib ncurses camlp4 ppx_tools ];
propagatedBuildInputs = [ ocaml_react ocaml_ssl ocaml_text libev ];
configureFlags = [ "--enable-react" "--enable-glib" "--enable-ssl" "--enable-text" ]
++ [ (if versionAtLeast ocaml_version "4.02" then "--enable-ppx" else "--disable-ppx") ]
++ optional (versionAtLeast ocaml_version "4.0" && ! versionAtLeast ocaml_version "4.02") "--enable-toplevel";
createFindlibDestdir = true;
meta = with stdenv.lib; {
homepage = http://ocsigen.org/lwt;
description = "Lightweight thread library for Objective Caml";
license = licenses.lgpl21;
platforms = ocaml.meta.platforms;
maintainers = with maintainers; [
z77z vbgl gal_bolle
];
};
}