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