2020-12-08 20:50:10 +00:00
|
|
|
{ lib, fetchurl, fetchzip, ocaml-ng
|
2022-08-25 15:04:14 +00:00
|
|
|
, version ? "0.24.1"
|
2020-10-14 14:19:25 +00:00
|
|
|
, tarballName ? "ocamlformat-${version}.tbz",
|
|
|
|
}:
|
|
|
|
|
|
|
|
let src =
|
2022-06-02 08:47:23 +00:00
|
|
|
fetchurl {
|
2020-10-14 14:19:25 +00:00
|
|
|
url = "https://github.com/ocaml-ppx/ocamlformat/releases/download/${version}/${tarballName}";
|
|
|
|
sha256 = {
|
2021-07-28 04:20:00 +00:00
|
|
|
"0.19.0" = "0ihgwl7d489g938m1jvgx8azdgq9f5np5mzqwwya797hx2m4dz32";
|
2022-01-03 09:02:28 +00:00
|
|
|
"0.20.0" = "sha256-JtmNCgwjbCyUE4bWqdH5Nc2YSit+rekwS43DcviIfgk=";
|
|
|
|
"0.20.1" = "sha256-fTpRZFQW+ngoc0T6A69reEUAZ6GmHkeQvxspd5zRAjU=";
|
2022-04-25 17:25:00 +00:00
|
|
|
"0.21.0" = "sha256-KhgX9rxYH/DM6fCqloe4l7AnJuKrdXSe6Y1XY3BXMy0=";
|
2022-06-01 13:23:09 +00:00
|
|
|
"0.22.4" = "sha256-61TeK4GsfMLmjYGn3ICzkagbc3/Po++Wnqkb2tbJwGA=";
|
2022-07-07 08:57:56 +00:00
|
|
|
"0.23.0" = "sha256-m9Pjz7DaGy917M1GjyfqG5Lm5ne7YSlJF2SVcDHe3+0=";
|
2022-07-19 09:04:23 +00:00
|
|
|
"0.24.0" = "sha256-Zil0wceeXmq2xy0OVLxa/Ujl4Dtsmc4COyv6Jo7rVaM=";
|
2022-08-25 15:04:14 +00:00
|
|
|
"0.24.1" = "sha256-AjQl6YGPgOpQU3sjcaSnZsFJqZV9BYB+iKAE0tX0Qc4=";
|
2020-10-14 14:19:25 +00:00
|
|
|
}."${version}";
|
2021-04-01 04:20:00 +00:00
|
|
|
};
|
2022-06-01 14:08:49 +00:00
|
|
|
ocamlPackages = ocaml-ng.ocamlPackages;
|
|
|
|
in
|
2020-12-08 20:50:10 +00:00
|
|
|
|
2020-10-14 14:19:25 +00:00
|
|
|
with ocamlPackages;
|
|
|
|
|
2021-04-01 04:20:00 +00:00
|
|
|
buildDunePackage {
|
2020-10-14 14:19:25 +00:00
|
|
|
pname = "ocamlformat";
|
|
|
|
inherit src version;
|
|
|
|
|
2023-03-29 04:31:56 +00:00
|
|
|
minimalOCamlVersion = "4.08";
|
|
|
|
duneVersion = "3";
|
2022-02-22 09:59:04 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
menhir
|
|
|
|
];
|
|
|
|
|
2022-06-01 14:08:49 +00:00
|
|
|
buildInputs = [
|
|
|
|
base
|
|
|
|
dune-build-info
|
|
|
|
fix
|
|
|
|
fpath
|
|
|
|
menhirLib
|
|
|
|
menhirSdk
|
|
|
|
ocp-indent
|
|
|
|
re
|
|
|
|
stdio
|
|
|
|
uuseg
|
|
|
|
uutf
|
|
|
|
]
|
|
|
|
++ lib.optionals (lib.versionAtLeast version "0.20.0") [ ocaml-version either ]
|
2022-07-19 09:04:23 +00:00
|
|
|
++ (if lib.versionAtLeast version "0.24.0"
|
|
|
|
then [ (odoc-parser.override { version = "2.0.0"; }) ]
|
|
|
|
else if lib.versionAtLeast version "0.20.1"
|
|
|
|
then [ (odoc-parser.override { version = "1.0.1"; }) ]
|
2022-06-01 14:08:49 +00:00
|
|
|
else [ (odoc-parser.override { version = "0.9.0"; }) ])
|
|
|
|
++ (if lib.versionAtLeast version "0.21.0"
|
|
|
|
then [ cmdliner_1_1 ]
|
|
|
|
else [ cmdliner_1_0 ])
|
|
|
|
++ lib.optionals (lib.versionAtLeast version "0.22.4") [ csexp ];
|
2020-10-14 14:19:25 +00:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = "https://github.com/ocaml-ppx/ocamlformat";
|
|
|
|
description = "Auto-formatter for OCaml code";
|
|
|
|
maintainers = [ lib.maintainers.Zimmi48 lib.maintainers.marsam ];
|
|
|
|
license = lib.licenses.mit;
|
|
|
|
};
|
|
|
|
}
|