1{ lib, stdenv, fetchFromGitHub, ocaml, findlib }:
2
3lib.throwIf (lib.versionAtLeast ocaml.version "5.0")
4 "twt is not available for OCaml ${ocaml.version}"
5
6stdenv.mkDerivation rec {
7 pname = "ocaml${ocaml.version}-twt";
8 version = "0.94.0";
9
10 src = fetchFromGitHub {
11 owner = "mlin";
12 repo = "twt";
13 rev = "v${version}";
14 sha256 = "sha256-xbjLPd7P1KyuC3i6WHLBcdLwd14atcBsd5ER+l97KAk=";
15 };
16
17 nativeBuildInputs = [ ocaml findlib ];
18
19 strictDeps = true;
20
21 preInstall = ''
22 mkdir -p $out/bin
23 mkdir -p $OCAMLFIND_DESTDIR
24 '';
25
26 dontBuild = true;
27
28 installFlags = [ "PREFIX=$(out)" ];
29
30 dontStrip = true;
31
32 meta = with lib; {
33 description = "“The Whitespace Thing” for OCaml";
34 homepage = "http://people.csail.mit.edu/mikelin/ocaml+twt/";
35 license = licenses.mit;
36 maintainers = [ maintainers.vbgl ];
37 mainProgram = "ocaml+twt";
38 inherit (ocaml.meta) platforms;
39 };
40}