summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules/twt/default.nix
blob: 069cacb34079add899c80f91ef5ec347fbe74ca6 (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
{ lib, stdenv, fetchFromGitHub, ocaml, findlib }:

lib.throwIf (lib.versionAtLeast ocaml.version "5.0")
  "twt is not available for OCaml ${ocaml.version}"

stdenv.mkDerivation rec {
  pname = "ocaml${ocaml.version}-twt";
  version = "0.94.0";

  src = fetchFromGitHub {
    owner = "mlin";
    repo = "twt";
    rev = "v${version}";
    sha256 = "sha256-xbjLPd7P1KyuC3i6WHLBcdLwd14atcBsd5ER+l97KAk=";
  };

  nativeBuildInputs = [ ocaml findlib ];

  strictDeps = true;

  preInstall = ''
    mkdir -p $out/bin
    mkdir -p $OCAMLFIND_DESTDIR
  '';

  dontBuild = true;

  installFlags = [ "PREFIX=$(out)" ];

  dontStrip = true;

  meta = with lib; {
    description = "“The Whitespace Thing” for OCaml";
    homepage = "http://people.csail.mit.edu/mikelin/ocaml+twt/";
    license = licenses.mit;
    maintainers = [ maintainers.vbgl ];
    mainProgram = "ocaml+twt";
    inherit (ocaml.meta) platforms;
  };
}