summary refs log tree commit diff
path: root/pkgs/development/tools/ocaml/ocp-indent/default.nix
blob: 2cffccdbfcdf63bf9528bbf8aa8c40995fbfae8b (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
{ stdenv, fetchzip, ocaml, findlib, dune, ocp-build, cmdliner }:

let inherit (stdenv.lib) getVersion versionAtLeast; in

assert versionAtLeast (getVersion ocaml) "3.12.1";
assert versionAtLeast (getVersion cmdliner) "1.0.0";
assert versionAtLeast (getVersion ocp-build) "1.99.6-beta";

stdenv.mkDerivation rec {

  name = "ocaml${ocaml.version}-ocp-indent-${version}";
  version = "1.6.1";

  src = fetchzip {
    url = "https://github.com/OCamlPro/ocp-indent/archive/${version}.tar.gz";
    sha256 = "0rcaa11mjqka032g94wgw9llqpflyk3ywr3lr6jyxbh1rjvnipnw";
  };

  nativeBuildInputs = [ ocp-build ];
  buildInputs = [ ocaml findlib cmdliner ];

  inherit (dune) installPhase;

  meta = with stdenv.lib; {
    homepage = http://typerex.ocamlpro.com/ocp-indent.html;
    description = "A customizable tool to indent OCaml code";
    license = licenses.gpl3;
    platforms = ocaml.meta.platforms or [];
    maintainers = [ maintainers.jirkamarsik ];
  };
}