nixpkgs/pkgs/development/ocaml-modules/notty/default.nix
Vincent Laporte 83110ac0be ocamlPackages.notty: 0.1.1a -> 0.2.1
jackline: 2017-08-17 -> 2017-12-24
2018-01-04 17:52:56 +01:00

40 lines
1.1 KiB
Nix

{ stdenv, fetchurl, ocaml, findlib, ocamlbuild, topkg, ocb-stubblr
, result, uucp, uuseg, uutf
, lwt ? null }:
with stdenv.lib;
if !versionAtLeast ocaml.version "4.03"
then throw "notty is not available for OCaml ${ocaml.version}"
else
let withLwt = lwt != null; in
stdenv.mkDerivation rec {
version = "0.2.1";
name = "ocaml${ocaml.version}-notty-${version}";
src = fetchurl {
url = "https://github.com/pqwy/notty/releases/download/v${version}/notty-${version}.tbz";
sha256 = "0wdfmgx1mz77s7m451vy8r9i4iqwn7s7b39kpbpckf3w9417riq0";
};
unpackCmd = "tar -xjf $curSrc";
buildInputs = [ ocaml findlib ocamlbuild topkg ocb-stubblr ];
propagatedBuildInputs = [ result uucp uuseg uutf ] ++
optional withLwt lwt;
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 ];
};
}