ocamlPackages.lwt: 2.7.1 -> 3.0.0

This commit is contained in:
Vincent Laporte 2017-07-02 11:06:16 +00:00
parent e8c0e8a04b
commit d3a29b393a
2 changed files with 22 additions and 14 deletions

View File

@ -2,36 +2,38 @@
, ocaml_react, ocaml_ssl, libev, pkgconfig, ncurses, ocaml_oasis, glib , ocaml_react, ocaml_ssl, libev, pkgconfig, ncurses, ocaml_oasis, glib
, ppx_tools, result, cppo , ppx_tools, result, cppo
, ppxSupport ? stdenv.lib.versionAtLeast ocaml.version "4.02" , ppxSupport ? stdenv.lib.versionAtLeast ocaml.version "4.02"
, version ? if stdenv.lib.versionAtLeast ocaml.version "4.02" then "2.7.1" else "2.6.0"
}: }:
let param = let sha256 = {
if stdenv.lib.versionAtLeast ocaml.version "4.02" "3.0.0" = "0wwhnl9hppixcsdisinj1wmffx0nv6hkpm01z9qvkngkrazi3i88";
then { "2.7.1" = "0w7f59havrl2fsnvs84lm7wlqpsrldg80gy5afpnpr21zkw22g8w";
version = "2.7.1"; "2.6.0" = "0f1h83zh60rspm4fxd96z9h5bkhq1n1q968hgq92sq4a6bfi1c2w";
sha256 = "0w7f59havrl2fsnvs84lm7wlqpsrldg80gy5afpnpr21zkw22g8w"; }."${version}"; in
} else {
version = "2.6.0"; let optionals = stdenv.lib.optionals (!stdenv.lib.versionAtLeast version "3"); in
sha256 = "0f1h83zh60rspm4fxd96z9h5bkhq1n1q968hgq92sq4a6bfi1c2w";
};
in
buildOcaml rec { buildOcaml rec {
name = "lwt"; name = "lwt";
inherit (param) version; inherit version;
src = fetchzip { src = fetchzip {
url = "https://github.com/ocsigen/lwt/archive/${version}.tar.gz"; url = "https://github.com/ocsigen/lwt/archive/${version}.tar.gz";
inherit (param) sha256; inherit sha256;
}; };
buildInputs = [ ocaml_oasis pkgconfig which cryptopp ocaml findlib ocamlbuild glib ncurses camlp4 cppo ] buildInputs = [ ocaml_oasis pkgconfig which cryptopp ocaml findlib ocamlbuild glib ncurses camlp4 cppo ]
++ stdenv.lib.optional ppxSupport ppx_tools; ++ stdenv.lib.optional ppxSupport ppx_tools;
propagatedBuildInputs = [ result ocaml_react ocaml_ssl libev ]; propagatedBuildInputs = [ result ]
++ optionals [ ocaml_react ocaml_ssl ]
++ [ libev ];
configureScript = "ocaml setup.ml -configure"; configureScript = "ocaml setup.ml -configure";
prefixKey = "--prefix "; prefixKey = "--prefix ";
configureFlags = [ "--enable-glib" "--enable-ssl" "--enable-react" "--enable-camlp4" ] configureFlags =
optionals [ "--enable-glib" "--enable-ssl" "--enable-react" ]
++ [ "--enable-camlp4" ]
++ [ (if ppxSupport then "--enable-ppx" else "--disable-ppx") ]; ++ [ (if ppxSupport then "--enable-ppx" else "--disable-ppx") ];
createFindlibDestdir = true; createFindlibDestdir = true;

View File

@ -302,6 +302,12 @@ let
lwt = ocaml_lwt; lwt = ocaml_lwt;
}; };
lwt3 = if lib.versionOlder "4.02" ocaml.version
then callPackage ../development/ocaml-modules/lwt {
version = "3.0.0";
}
else throw "lwt3 is not available for OCaml ${ocaml.version}";
macaque = callPackage ../development/ocaml-modules/macaque { }; macaque = callPackage ../development/ocaml-modules/macaque { };
magic-mime = callPackage ../development/ocaml-modules/magic-mime { }; magic-mime = callPackage ../development/ocaml-modules/magic-mime { };