1{ lib, fetchFromGitHub, buildDunePackage, ocaml, zed, lwt_log, lwt_react, mew_vi, uucp, logs }:
2
3let params =
4 if lib.versionAtLeast ocaml.version "4.08" then {
5 version = "3.3.1";
6 sha256 = "sha256-C124bhdrY+XzL93zzNEbCr+U+7CYBZDm0hlAw+iqat4=";
7 } else {
8 version = "3.1.0";
9 sha256 = "1k0ykiz0vhpyyj9fkss29ajas4fh1xh449j702xkvayqipzj1mkg";
10 }
11; in
12
13buildDunePackage rec {
14 pname = "lambda-term";
15 inherit (params) version;
16
17 duneVersion = if lib.versionAtLeast ocaml.version "4.08" then "3" else "2";
18
19 src = fetchFromGitHub {
20 owner = "ocaml-community";
21 repo = pname;
22 rev = version;
23 inherit (params) sha256;
24 };
25
26 propagatedBuildInputs = [ zed lwt_log lwt_react mew_vi ]
27 ++ lib.optionals (lib.versionAtLeast version "3.3.1") [ uucp logs ] ;
28
29 meta = {
30 description = "Terminal manipulation library for OCaml";
31 longDescription = ''
32 Lambda-term is a cross-platform library for
33 manipulating the terminal. It provides an abstraction for keys,
34 mouse events, colors, as well as a set of widgets to write
35 curses-like applications.
36
37 The main objective of lambda-term is to provide a higher level
38 functional interface to terminal manipulation than, for example,
39 ncurses, by providing a native OCaml interface instead of bindings to
40 a C library.
41
42 Lambda-term integrates with zed to provide text edition facilities in
43 console applications.
44 '';
45
46 inherit (src.meta) homepage;
47 license = lib.licenses.bsd3;
48 maintainers = [ lib.maintainers.gal_bolle ];
49 mainProgram = "lambda-term-actions";
50 };
51}