@@ -1,57 +1,36 @@
1−{ stdenv, buildOcaml, fetchzip, which, cryptopp, ocaml, findlib, ocamlbuild, camlp4
2−, react, ssl, libev, pkgconfig, ncurses, glib
3−, ppx_tools, result, cppo
4−, ppxSupport ? stdenv.lib.versionAtLeast ocaml.version "4.02"
5−, version ? if stdenv.lib.versionAtLeast ocaml.version "4.02" then "2.7.1" else "2.6.0"
1+{ stdenv, fetchzip, pkgconfig, ncurses, libev, jbuilder
2+, ocaml, findlib, camlp4, cppo
3+, ocaml-migrate-parsetree, ppx_tools_versioned, result
64}:
75
8−if !stdenv.lib.versionAtLeast ocaml.version "4"
9−then throw "lwt is not available for OCaml ${ocaml.version}"
10−else
11−
12−let sha256 = {
13− "3.0.0" = "0wwhnl9hppixcsdisinj1wmffx0nv6hkpm01z9qvkngkrazi3i88";
14− "2.7.1" = "0w7f59havrl2fsnvs84lm7wlqpsrldg80gy5afpnpr21zkw22g8w";
15− "2.6.0" = "0f1h83zh60rspm4fxd96z9h5bkhq1n1q968hgq92sq4a6bfi1c2w";
16−}."${version}"; in
17−
18−let optionals = stdenv.lib.optionals (!stdenv.lib.versionAtLeast version "3"); in
19−
20−buildOcaml rec {
21− name = "lwt";
22− inherit version;
6+stdenv.mkDerivation rec {
7+ version = "3.3.0";
8+ name = "ocaml${ocaml.version}-lwt-${version}";
239
2410 src = fetchzip {
2511 url = "https://github.com/ocsigen/lwt/archive/${version}.tar.gz";
26− inherit sha256;
12+ sha256 = "0n87hcyl4svy0risj439wyfq6bl77qxq3nraqgdr1qbz5lskbq2j";
2713 };
2814
29− nativeBuildInputs = [ pkgconfig ];
30− buildInputs = [ which cryptopp ocaml findlib ocamlbuild glib ncurses camlp4 cppo ]
31− ++ stdenv.lib.optional ppxSupport ppx_tools;
32−
33− propagatedBuildInputs = [ result ]
34− ++ optionals [ react ssl ]
35− ++ [ libev ];
15+ preConfigure = ''
16+ ocaml src/util/configure.ml -use-libev true -use-camlp4 true
17+ '';
3618
37− configureScript = "ocaml setup.ml -configure";
38− prefixKey = "--prefix ";
39− configureFlags =
40− optionals [ "--enable-glib" "--enable-ssl" "--enable-react" ]
41− ++ [ "--enable-camlp4" ]
42− ++ [ (if ppxSupport then "--enable-ppx" else "--disable-ppx") ];
43−
44− createFindlibDestdir = true;
45−
46− hasSharedObjects = true;
47−
48− meta = with stdenv.lib; {
49− homepage = http://ocsigen.org/lwt;
50− description = "Lightweight thread library for Objective Caml";
51− license = licenses.lgpl21;
52− platforms = ocaml.meta.platforms or [];
53− maintainers = with maintainers; [
54− z77z vbgl gal_bolle
55− ];
19+ nativeBuildInputs = [ pkgconfig ];
20+ buildInputs = [ ncurses ocaml findlib jbuilder camlp4 cppo
21+ ocaml-migrate-parsetree ppx_tools_versioned ];
22+ propagatedBuildInputs = [ libev result ];
23+
24+ installPhase = ''
25+ ocaml src/util/install_filter.ml
26+ ${jbuilder.installPhase}
27+ '';
28+
29+ meta = {
30+ homepage = "https://ocsigen.org/lwt/";
31+ description = "A cooperative threads library for OCaml";
32+ maintainers = [ stdenv.lib.maintainers.vbgl ];
33+ license = stdenv.lib.licenses.lgpl21;
34+ inherit (ocaml.meta) platforms;
5635 };
5736}