about summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules/notty/default.nix
blob: 3178789c3993a8da4f9bc57ea1c1306f82de1532 (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
{ stdenv, buildOcaml, fetchFromGitHub, findlib
, result, uucp, uuseg, uutf
, lwt     ? null }:

with stdenv.lib;

let withLwt = lwt != null; in

buildOcaml rec {
  version = "0.1.1";
  name = "notty";

  minimumSupportedOcamlVersion = "4.02";

  src = fetchFromGitHub {
    owner  = "pqwy";
    repo   = "notty";
    rev    = "v${version}";
    sha256 = "0bw3bq8z2y1rhc20zn13s78sazywyzpg8nmyjch33p7ypxfglf01";
  };

  buildInputs = [ findlib ];
  propagatedBuildInputs = [ result uucp uuseg uutf ] ++
                          optional withLwt [ lwt ];

  configureFlags = [ "--enable-unix" ] ++
                   (if withLwt then ["--enable-lwt"] else ["--disable-lwt"]);

  configurePhase = "./configure --prefix $out $configureFlags";

  meta = {
    inherit (src.meta) homepage;
    description = "Declarative terminal graphics for OCaml";
    license = licenses.isc;
    maintainers = with maintainers; [ sternenseemann ];
  };
}