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 [ 43 zed 44 lwt_log 45 lwt_react 46 mew_vi 47 ] 48 ++ lib.optionals (lib.versionAtLeast version "3.3.1") [ 49 uucp 50 logs 51 ]; 52 53 meta = { 54 description = "Terminal manipulation library for OCaml"; 55 longDescription = '' 56 Lambda-term is a cross-platform library for 57 manipulating the terminal. It provides an abstraction for keys, 58 mouse events, colors, as well as a set of widgets to write 59 curses-like applications. 60 61 The main objective of lambda-term is to provide a higher level 62 functional interface to terminal manipulation than, for example, 63 ncurses, by providing a native OCaml interface instead of bindings to 64 a C library. 65 66 Lambda-term integrates with zed to provide text edition facilities in 67 console applications. 68 ''; 69 70 inherit (src.meta) homepage; 71 license = lib.licenses.bsd3; 72 maintainers = [ lib.maintainers.gal_bolle ]; 73 mainProgram = "lambda-term-actions"; 74 }; 75}