about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/ocaml-modules/ocsigen-deriving/default.nix
blob: 0263d3284ffacbedb02e0a49bec6f9a8841ab768 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
{ stdenv, fetchzip, ocaml, findlib, ocamlbuild, oasis, ocaml_optcomp, camlp4
, num
}:

let param =
  if stdenv.lib.versionAtLeast ocaml.version "4.03"
  then {
    version = "0.8.1";
    sha256 = "03vzrybdpjydbpil97zmir71kpsn2yxkjnzysma7fvybk8ll4zh9";
    buildInputs = [ num ];
  } else {
    version = "0.7.1";
    sha256 = "0gg3nr3iic4rwqrcc0qvfm9x0x57zclvdsnpy0z8rv2fl5isbzms";
  };
in

let inherit (param) version; in

stdenv.mkDerivation {
  pname = "ocsigen-deriving";
  inherit version;
  src = fetchzip {
    url = "https://github.com/ocsigen/deriving/archive/${version}.tar.gz";
    inherit (param) sha256;
  };

  buildInputs = [ ocaml findlib ocamlbuild oasis ocaml_optcomp camlp4 ]
  ++ (param.buildInputs or []);

  createFindlibDestdir = true;

  meta =  {
    homepage = https://github.com/ocsigen/deriving;
    description = "Extension to OCaml for deriving functions from type declarations";
    license = stdenv.lib.licenses.mit;
    platforms = ocaml.meta.platforms or [];
    maintainers = with stdenv.lib.maintainers; [
      gal_bolle vbgl
    ];
  };


}