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 strictDeps = true; 20 21 src = fetchFromGitHub { 22 owner = "ocaml-community"; 23 repo = pname; 24 rev = version; 25 inherit (params) sha256; 26 }; 27 28 propagatedBuildInputs = [ zed lwt_log lwt_react mew_vi ] 29 ++ lib.optional (lib.versionAtLeast version "3.3.1") [ uucp logs ] ; 30 31 meta = { 32 description = "Terminal manipulation library for OCaml"; 33 longDescription = '' 34 Lambda-term is a cross-platform library for 35 manipulating the terminal. It provides an abstraction for keys, 36 mouse events, colors, as well as a set of widgets to write 37 curses-like applications. 38 39 The main objective of lambda-term is to provide a higher level 40 functional interface to terminal manipulation than, for example, 41 ncurses, by providing a native OCaml interface instead of bindings to 42 a C library. 43 44 Lambda-term integrates with zed to provide text edition facilities in 45 console applications. 46 ''; 47 48 inherit (src.meta) homepage; 49 license = lib.licenses.bsd3; 50 maintainers = [ lib.maintainers.gal_bolle ]; 51 mainProgram = "lambda-term-actions"; 52 }; 53}