2021-01-11 13:49:15 +01:00
|
|
|
{ stdenv, lib, fetchurl, ocaml, findlib, ocamlbuild, topkg, ocb-stubblr
|
2016-11-03 03:06:14 +01:00
|
|
|
, result, uucp, uuseg, uutf
|
|
|
|
, lwt ? null }:
|
|
|
|
|
2021-01-11 13:49:15 +01:00
|
|
|
with lib;
|
2016-11-03 03:06:14 +01:00
|
|
|
|
2020-04-14 11:16:53 +02:00
|
|
|
if !versionAtLeast ocaml.version "4.05"
|
2017-12-28 09:01:03 +01:00
|
|
|
then throw "notty is not available for OCaml ${ocaml.version}"
|
|
|
|
else
|
2016-11-03 03:06:14 +01:00
|
|
|
|
2017-12-28 09:01:03 +01:00
|
|
|
let withLwt = lwt != null; in
|
2016-11-03 03:06:14 +01:00
|
|
|
|
2017-12-28 09:01:03 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2020-04-14 11:16:53 +02:00
|
|
|
version = "0.2.2";
|
2017-12-28 09:01:03 +01:00
|
|
|
name = "ocaml${ocaml.version}-notty-${version}";
|
2016-11-03 03:06:14 +01:00
|
|
|
|
2017-12-28 09:01:03 +01:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/pqwy/notty/releases/download/v${version}/notty-${version}.tbz";
|
2020-04-14 11:16:53 +02:00
|
|
|
sha256 = "1y3hx8zjri3x50nyiqal5gak1sw54gw3xssrqbj7srinvkdmrz1q";
|
2016-11-03 03:06:14 +01:00
|
|
|
};
|
|
|
|
|
2017-12-28 09:01:03 +01:00
|
|
|
buildInputs = [ ocaml findlib ocamlbuild topkg ocb-stubblr ];
|
2016-11-03 03:06:14 +01:00
|
|
|
propagatedBuildInputs = [ result uucp uuseg uutf ] ++
|
2016-12-04 11:55:13 +01:00
|
|
|
optional withLwt lwt;
|
2016-11-03 03:06:14 +01:00
|
|
|
|
2016-12-04 11:55:13 +01:00
|
|
|
buildPhase = topkg.buildPhase
|
2017-04-11 18:08:51 +02:00
|
|
|
+ " --with-lwt ${boolToString withLwt}";
|
2016-11-03 03:06:14 +01:00
|
|
|
|
2016-12-04 11:55:13 +01:00
|
|
|
inherit (topkg) installPhase;
|
2016-11-03 03:06:14 +01:00
|
|
|
|
|
|
|
meta = {
|
2017-12-28 09:01:03 +01:00
|
|
|
homepage = "https://github.com/pqwy/notty";
|
|
|
|
inherit (ocaml.meta) platforms;
|
2016-11-03 03:06:14 +01:00
|
|
|
description = "Declarative terminal graphics for OCaml";
|
|
|
|
license = licenses.isc;
|
|
|
|
maintainers = with maintainers; [ sternenseemann ];
|
|
|
|
};
|
|
|
|
}
|