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

with lib;

if versionOlder ocaml.version "4.05"
then throw "notty is not available for OCaml ${ocaml.version}"
else

let withLwt = lwt != null; in

stdenv.mkDerivation rec {
  version = "0.2.2";
  pname = "ocaml${ocaml.version}-notty";

  src = fetchurl {
    url = "https://github.com/pqwy/notty/releases/download/v${version}/notty-${version}.tbz";
    sha256 = "1y3hx8zjri3x50nyiqal5gak1sw54gw3xssrqbj7srinvkdmrz1q";
  };

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

  strictDeps = true;

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

  inherit (topkg) installPhase;

  meta = {
    homepage = "https://github.com/pqwy/notty";
    inherit (ocaml.meta) platforms;
    description = "Declarative terminal graphics for OCaml";
    license = licenses.isc;
    maintainers = with maintainers; [ sternenseemann ];
  };
}