1{
2 lib,
3 stdenv,
4 fetchurl,
5 ocaml,
6 findlib,
7}:
8
9let
10 param =
11 if lib.versionAtLeast ocaml.version "4.02" then
12 {
13 version = "0.6";
14 sha256 = "18wpyxblz9jh5bfp0hpffnd0q8cq1b0dqp0f36vhqydfknlnpx8y";
15 }
16 else
17 {
18 version = "0.5";
19 sha256 = "1j17rhifdjv1z262dma148ywg34x0zjn8vczdrnkwajsm4qg1hw3";
20 };
21in
22
23lib.throwIf (lib.versionAtLeast ocaml.version "5.0")
24 "functory is not available for OCaml ${ocaml.version}"
25
26 stdenv.mkDerivation
27 {
28 pname = "ocaml${ocaml.version}-functory";
29 inherit (param) version;
30
31 src = fetchurl {
32 url = "https://www.lri.fr/~filliatr/functory/download/functory-${param.version}.tar.gz";
33 inherit (param) sha256;
34 };
35
36 nativeBuildInputs = [
37 ocaml
38 findlib
39 ];
40
41 strictDeps = true;
42
43 installTargets = [ "ocamlfind-install" ];
44
45 createFindlibDestdir = true;
46
47 meta = with lib; {
48 homepage = "https://www.lri.fr/~filliatr/functory/";
49 description = "Distributed computing library for Objective Caml which facilitates distributed execution of parallelizable computations in a seamless fashion";
50 license = licenses.lgpl21;
51 maintainers = [ maintainers.vbgl ];
52 inherit (ocaml.meta) platforms;
53 };
54 }