2021-01-15 22:18:51 +00:00
|
|
|
|
{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
|
assert lib.versionAtLeast (lib.getVersion ocaml) "3.12";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
|
|
let param =
|
2021-01-15 22:18:51 +00:00
|
|
|
|
if lib.versionAtLeast ocaml.version "4.02"
|
2020-04-24 23:36:52 +00:00
|
|
|
|
then {
|
|
|
|
|
version = "20171003";
|
|
|
|
|
sha256 = "06zwsskri8kaqjdszj9360nf36zvwh886xwf033aija8c9k4w6cx";
|
|
|
|
|
} else {
|
|
|
|
|
version = "20140424";
|
|
|
|
|
sha256 = "0sc9q89dnyarcg24czyhr6ams0ylqvia3745s6rfwd2nldpygsdk";
|
|
|
|
|
}; in
|
|
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
2022-02-10 20:34:41 +00:00
|
|
|
|
inherit (param) version;
|
|
|
|
|
pname = "ocaml${ocaml.version}-pprint";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
|
url = "http://gallium.inria.fr/~fpottier/pprint/pprint-${param.version}.tar.gz";
|
|
|
|
|
inherit (param) sha256;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
buildInputs = [ ocaml findlib ocamlbuild ];
|
|
|
|
|
|
|
|
|
|
createFindlibDestdir = true;
|
|
|
|
|
|
|
|
|
|
dontBuild = true;
|
|
|
|
|
installFlags = [ "-C" "src" ];
|
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
|
homepage = "http://gallium.inria.fr/~fpottier/pprint/";
|
|
|
|
|
description = "An OCaml adaptation of Wadler’s and Leijen’s prettier printer";
|
|
|
|
|
license = licenses.cecill-c;
|
|
|
|
|
maintainers = [ maintainers.vbgl ];
|
|
|
|
|
platforms = ocaml.meta.platforms or [];
|
|
|
|
|
};
|
|
|
|
|
}
|