2022-12-31 10:36:56 +00:00
|
|
|
{ lib, fetchurl, buildDunePackage, ocaml
|
2021-03-23 19:43:19 +00:00
|
|
|
, version ?
|
|
|
|
if lib.versionAtLeast ocaml.version "4.07"
|
|
|
|
then if lib.versionAtLeast ocaml.version "4.08"
|
2022-11-09 19:41:22 +00:00
|
|
|
then if lib.versionAtLeast ocaml.version "4.11"
|
|
|
|
then "0.28.0" else "0.24.0" else "0.15.0" else "0.13.0"
|
2018-07-05 19:40:30 +00:00
|
|
|
, ocaml-compiler-libs, ocaml-migrate-parsetree, ppx_derivers, stdio
|
2021-06-21 15:59:07 +00:00
|
|
|
, stdlib-shims, ocaml-migrate-parsetree-2
|
2018-07-05 19:40:30 +00:00
|
|
|
}:
|
|
|
|
|
2020-12-08 20:50:04 +00:00
|
|
|
let param = {
|
|
|
|
"0.8.1" = {
|
2022-12-31 10:36:56 +00:00
|
|
|
sha256 = "sha256-pct57oO7qAMEtlvEfymFOCvviWaLG0b5/7NzTC8vdSE=";
|
2020-12-08 20:50:04 +00:00
|
|
|
max_version = "4.10";
|
2021-01-13 15:09:33 +00:00
|
|
|
useDune2 = false;
|
|
|
|
useOMP2 = false;
|
2020-12-08 20:50:04 +00:00
|
|
|
};
|
|
|
|
"0.13.0" = {
|
2022-12-31 10:36:56 +00:00
|
|
|
sha256 = "sha256-geHz0whQDg5/YQjVsN2iuHlkClwh7z3Eqb2QOBzuOdk=";
|
|
|
|
max_version = "4.11";
|
2021-01-13 15:09:33 +00:00
|
|
|
useDune2 = false;
|
|
|
|
useOMP2 = false;
|
2020-12-08 20:50:04 +00:00
|
|
|
};
|
2020-12-08 20:50:14 +00:00
|
|
|
"0.15.0" = {
|
2022-12-31 10:36:56 +00:00
|
|
|
sha256 = "sha256-C2MNf410qJmlXMJxiLXOA+c1qT8H6gwt5WUy2P2TszA=";
|
2020-12-08 20:50:14 +00:00
|
|
|
min_version = "4.07";
|
2021-03-23 19:43:14 +00:00
|
|
|
max_version = "4.12";
|
2021-01-13 15:09:33 +00:00
|
|
|
useOMP2 = false;
|
|
|
|
};
|
|
|
|
"0.18.0" = {
|
2022-12-31 10:36:56 +00:00
|
|
|
sha256 = "sha256-nUg8NkZ64GHHDfcWbtFGXq3MNEKu+nYPtcVDm/gEfcM=";
|
2021-01-13 15:09:33 +00:00
|
|
|
min_version = "4.07";
|
2021-03-23 19:43:14 +00:00
|
|
|
max_version = "4.12";
|
2020-12-08 20:50:14 +00:00
|
|
|
};
|
2021-03-06 21:07:48 +00:00
|
|
|
"0.22.0" = {
|
2022-12-31 10:36:56 +00:00
|
|
|
sha256 = "sha256-PuuR4DlmZiKEoyIuYS3uf0+it2N8U9lXLSp0E0u5bXo=";
|
2021-03-06 21:07:48 +00:00
|
|
|
min_version = "4.07";
|
2022-12-31 10:36:56 +00:00
|
|
|
max_version = "4.13";
|
2021-03-06 21:07:48 +00:00
|
|
|
};
|
2021-06-27 12:31:31 +00:00
|
|
|
"0.22.2" = {
|
2022-12-31 10:36:56 +00:00
|
|
|
sha256 = "sha256-0Oih69xiILFXTXqSbwCEYMURjM73m/mgzgJC80z/Ilo=";
|
2021-06-27 12:31:31 +00:00
|
|
|
min_version = "4.07";
|
2022-12-31 10:36:56 +00:00
|
|
|
max_version = "4.14";
|
2021-06-27 12:31:31 +00:00
|
|
|
};
|
2021-10-14 16:29:21 +00:00
|
|
|
"0.23.0" = {
|
2022-12-31 10:36:56 +00:00
|
|
|
sha256 = "sha256-G1g2wYa51aFqz0falPOWj08ItRm3cpzYao/TmXH+EuU=";
|
2021-10-14 16:29:21 +00:00
|
|
|
min_version = "4.07";
|
2022-12-31 10:36:56 +00:00
|
|
|
max_version = "4.14";
|
2021-10-14 16:29:21 +00:00
|
|
|
};
|
2022-01-23 20:24:16 +00:00
|
|
|
"0.24.0" = {
|
2022-12-31 10:36:56 +00:00
|
|
|
sha256 = "sha256-d2YCfC7ND1s7Rg6SEqcHCcZ0QngRPrkfMXxWxB56kMg=";
|
2022-01-23 20:24:16 +00:00
|
|
|
min_version = "4.07";
|
|
|
|
};
|
2022-10-11 11:31:29 +00:00
|
|
|
"0.28.0" = {
|
2022-12-31 10:36:56 +00:00
|
|
|
sha256 = "sha256-2Hrl+aCBIGMIypZICbUKZq646D0lSAHouWdUSLYM83c=";
|
2022-10-11 11:31:29 +00:00
|
|
|
min_version = "4.07";
|
|
|
|
};
|
2020-12-08 20:50:04 +00:00
|
|
|
}."${version}"; in
|
2020-05-12 19:14:39 +00:00
|
|
|
|
2020-12-08 20:50:04 +00:00
|
|
|
if param ? max_version && lib.versionAtLeast ocaml.version param.max_version
|
2022-04-25 20:35:24 +00:00
|
|
|
|| param ? min_version && lib.versionOlder ocaml.version param.min_version
|
2020-12-19 17:33:55 +00:00
|
|
|
then throw "ppxlib-${version} is not available for OCaml ${ocaml.version}"
|
2020-05-12 19:14:39 +00:00
|
|
|
else
|
2020-03-06 06:42:04 +00:00
|
|
|
|
2018-11-05 10:21:46 +00:00
|
|
|
buildDunePackage rec {
|
|
|
|
pname = "ppxlib";
|
2020-12-08 20:50:04 +00:00
|
|
|
inherit version;
|
|
|
|
|
2022-12-31 10:36:56 +00:00
|
|
|
duneVersion = if param.useDune2 or true then "2" else "1";
|
2018-07-05 19:40:30 +00:00
|
|
|
|
2022-12-31 10:36:56 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/ocaml-ppx/ppxlib/releases/download/${version}/ppxlib-${version}.tbz";
|
2020-05-12 19:14:39 +00:00
|
|
|
inherit (param) sha256;
|
2018-07-05 19:40:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
2021-01-13 15:09:33 +00:00
|
|
|
ocaml-compiler-libs
|
|
|
|
(if param.useOMP2 or true
|
2021-06-21 15:59:07 +00:00
|
|
|
then ocaml-migrate-parsetree-2
|
2021-01-13 15:09:33 +00:00
|
|
|
else ocaml-migrate-parsetree)
|
|
|
|
ppx_derivers
|
|
|
|
stdio
|
2020-12-08 20:50:14 +00:00
|
|
|
stdlib-shims
|
2018-07-05 19:40:30 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Comprehensive ppx tool set";
|
2020-05-12 19:14:39 +00:00
|
|
|
license = lib.licenses.mit;
|
|
|
|
maintainers = [ lib.maintainers.vbgl ];
|
2022-12-31 10:36:56 +00:00
|
|
|
homepage = "https://github.com/ocaml-ppx/ppxlib";
|
2018-07-05 19:40:30 +00:00
|
|
|
};
|
|
|
|
}
|