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

with stdenv.lib;

let withLwt = lwt != null; in

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

  minimumSupportedOcamlVersion = "4.02";

  src = fetchFromGitHub {
    owner  = "pqwy";
    repo   = "notty";
    rev    = "53f5946653490fce980dc5d8cadf8b122cff4f19";
    sha256 = "0qmwb1hrp04py2i5spy0yd6c5jqxyss3wzvlkgxyl9r07kvsx6xf";
  };

  patches = [ (fetchpatch {
    url = https://github.com/dbuenzli/notty/commit/b0e12930acc26d030a74d6d63d622ae220b12c92.patch;
    sha256 = "0pklplbnjbsjriqj73pc8fsadg404px534w7zknz2617zb44m6x6";
  })];

  buildInputs = [ findlib topkg ocb-stubblr ];
  propagatedBuildInputs = [ result uucp uuseg uutf ] ++
                          optional withLwt lwt;

  buildPhase = topkg.buildPhase
  + " --with-lwt ${boolToString withLwt}";

  inherit (topkg) installPhase;

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