git.iko.soy/typeable/nixpkgs
on master help sign in
ocamlPackages.lwt3: 3.0.0 -> 3.3.0
commit0b53d63dad1ea50512dde126c3c3b46de59c4cce authorVincent Laporte <Vincent.Laporte@gmail.com> dateSun 25 Mar 2018, 18:26 (9 years ago) parent73a7d67
3 files changed+88−52
pkgs/development/ocaml-modules/lwt/default.nix+26−47 pkgs/development/ocaml-modules/lwt/legacy.nix+57 pkgs/top-level/ocaml-packages.nix+5−5
pkgs/development/ocaml-modules/lwt/default.nix+26−47
@@ -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}
pkgs/development/ocaml-modules/lwt/legacy.nixnew file+57
@@ -0,0 +1,57 @@
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"
6+}:
7+
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;
23+
24+ src = fetchzip {
25+ url = "https://github.com/ocsigen/lwt/archive/${version}.tar.gz";
26+ inherit sha256;
27+ };
28+
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 ];
36+
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+ ];
56+ };
57+}
pkgs/top-level/ocaml-packages.nix+5−5
@@ -366,12 +366,10 @@ let
366366
367367 lru = callPackage ../development/ocaml-modules/lru { };
368368
369− lwt2 = callPackage ../development/ocaml-modules/lwt { };
369+ lwt2 = callPackage ../development/ocaml-modules/lwt/legacy.nix { };
370370
371371 lwt3 = if lib.versionOlder "4.02" ocaml.version
372− then callPackage ../development/ocaml-modules/lwt {
373− version = "3.0.0";
374− }
372+ then callPackage ../development/ocaml-modules/lwt { }
375373 else throw "lwt3 is not available for OCaml ${ocaml.version}";
376374
377375 ocaml_lwt = if lib.versionOlder "4.02" ocaml.version then lwt3 else lwt2;
@@ -650,7 +648,9 @@ let
650648
651649 ssl = callPackage ../development/ocaml-modules/ssl { };
652650
653− stog = callPackage ../applications/misc/stog { };
651+ stog = callPackage ../applications/misc/stog {
652+ ocaml_lwt = lwt2;
653+ };
654654
655655 stringext = callPackage ../development/ocaml-modules/stringext { };
656656