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