nixpkgs/pkgs/development/ocaml-modules/lwt/default.nix

57 lines
1.7 KiB
Nix
Raw Normal View History

{ stdenv, buildOcaml, fetchzip, which, cryptopp, ocaml, findlib, ocamlbuild, camlp4
2016-11-21 18:20:43 +00:00
, ocaml_react, ocaml_ssl, libev, pkgconfig, ncurses, ocaml_oasis, glib
2017-04-13 19:26:05 +00:00
, ppx_tools, result, cppo
2016-11-21 18:20:43 +00:00
, ppxSupport ? stdenv.lib.versionAtLeast ocaml.version "4.02"
2017-07-02 11:06:16 +00:00
, version ? if stdenv.lib.versionAtLeast ocaml.version "4.02" then "2.7.1" else "2.6.0"
2016-11-21 18:20:43 +00:00
}:
if !stdenv.lib.versionAtLeast ocaml.version "4"
then throw "lwt is not available for OCaml ${ocaml.version}"
else
2017-07-02 11:06:16 +00:00
let sha256 = {
"3.0.0" = "0wwhnl9hppixcsdisinj1wmffx0nv6hkpm01z9qvkngkrazi3i88";
"2.7.1" = "0w7f59havrl2fsnvs84lm7wlqpsrldg80gy5afpnpr21zkw22g8w";
"2.6.0" = "0f1h83zh60rspm4fxd96z9h5bkhq1n1q968hgq92sq4a6bfi1c2w";
}."${version}"; in
let optionals = stdenv.lib.optionals (!stdenv.lib.versionAtLeast version "3"); in
2017-04-13 19:26:05 +00:00
buildOcaml rec {
name = "lwt";
2017-07-02 11:06:16 +00:00
inherit version;
2015-02-16 10:23:43 +00:00
src = fetchzip {
url = "https://github.com/ocsigen/lwt/archive/${version}.tar.gz";
2017-07-02 11:06:16 +00:00
inherit sha256;
};
2017-04-13 19:26:05 +00:00
buildInputs = [ ocaml_oasis pkgconfig which cryptopp ocaml findlib ocamlbuild glib ncurses camlp4 cppo ]
2016-11-21 18:20:43 +00:00
++ stdenv.lib.optional ppxSupport ppx_tools;
2014-07-18 15:04:16 +00:00
2017-07-02 11:06:16 +00:00
propagatedBuildInputs = [ result ]
++ optionals [ ocaml_react ocaml_ssl ]
++ [ libev ];
2016-11-21 18:20:43 +00:00
configureScript = "ocaml setup.ml -configure";
prefixKey = "--prefix ";
2017-07-02 11:06:16 +00:00
configureFlags =
optionals [ "--enable-glib" "--enable-ssl" "--enable-react" ]
++ [ "--enable-camlp4" ]
2016-11-21 18:20:43 +00:00
++ [ (if ppxSupport then "--enable-ppx" else "--disable-ppx") ];
createFindlibDestdir = true;
hasSharedObjects = true;
meta = with stdenv.lib; {
homepage = http://ocsigen.org/lwt;
description = "Lightweight thread library for Objective Caml";
license = licenses.lgpl21;
platforms = ocaml.meta.platforms or [];
maintainers = with maintainers; [
z77z vbgl gal_bolle
];
};
}