2021-01-15 22:18:51 +00:00
|
|
|
{ stdenv, lib, fetchurl, ocaml, findlib, ocamlbuild, topkg, ocb-stubblr
|
2020-04-24 23:36:52 +00:00
|
|
|
, result, uucp, uuseg, uutf
|
|
|
|
, lwt ? null }:
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
with lib;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
if versionOlder ocaml.version "4.05"
|
2022-08-21 13:32:41 +00:00
|
|
|
|| versionAtLeast ocaml.version "4.14"
|
2020-04-24 23:36:52 +00:00
|
|
|
then throw "notty is not available for OCaml ${ocaml.version}"
|
|
|
|
else
|
|
|
|
|
|
|
|
let withLwt = lwt != null; in
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
version = "0.2.2";
|
2022-02-10 20:34:41 +00:00
|
|
|
pname = "ocaml${ocaml.version}-notty";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/pqwy/notty/releases/download/v${version}/notty-${version}.tbz";
|
|
|
|
sha256 = "1y3hx8zjri3x50nyiqal5gak1sw54gw3xssrqbj7srinvkdmrz1q";
|
|
|
|
};
|
|
|
|
|
2022-03-05 16:20:37 +00:00
|
|
|
nativeBuildInputs = [ ocaml findlib ocamlbuild ];
|
|
|
|
buildInputs = [ ocb-stubblr topkg ocamlbuild ];
|
2020-04-24 23:36:52 +00:00
|
|
|
propagatedBuildInputs = [ result uucp uuseg uutf ] ++
|
|
|
|
optional withLwt lwt;
|
|
|
|
|
2022-03-05 16:20:37 +00:00
|
|
|
strictDeps = true;
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|