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