2021-02-19 18:34:30 +00:00
|
|
|
{ lib
|
|
|
|
, buildDunePackage, camlp5
|
2022-05-29 13:45:15 +00:00
|
|
|
, ocaml
|
|
|
|
, menhir, menhirLib
|
2022-07-18 14:47:49 +00:00
|
|
|
, atdgen
|
2022-06-07 12:51:16 +00:00
|
|
|
, stdlib-shims
|
2021-11-05 20:54:48 +00:00
|
|
|
, re, perl, ncurses
|
|
|
|
, ppxlib, ppx_deriving
|
|
|
|
, ppxlib_0_15, ppx_deriving_0_15
|
2021-02-19 18:34:30 +00:00
|
|
|
, coqPackages
|
2024-10-08 19:38:54 +00:00
|
|
|
, version ? if lib.versionAtLeast ocaml.version "4.08" then "1.20.0"
|
2024-09-23 07:52:07 +00:00
|
|
|
else "1.15.2"
|
2018-09-20 05:45:31 +00:00
|
|
|
}:
|
2023-01-26 17:31:02 +00:00
|
|
|
|
2023-08-24 07:58:14 +00:00
|
|
|
let p5 = camlp5; in
|
|
|
|
let camlp5 = p5.override { legacy = true; }; in
|
|
|
|
|
2021-02-19 18:34:30 +00:00
|
|
|
let fetched = coqPackages.metaFetch ({
|
2024-10-08 19:38:54 +00:00
|
|
|
release."1.20.0".sha256 = "sha256-lctZAIQgOg5d+LfILtWsBVcsemV3zTZYfJfDlCxHtcA=";
|
2024-09-23 07:52:07 +00:00
|
|
|
release."1.19.2".sha256 = "sha256-dBj5Ek7PWq/8Btq/dggJUqa8cUtfvbi6EWo/lJEDOU4=";
|
2024-10-30 10:21:31 +00:00
|
|
|
release."1.18.2".sha256 = "sha256-usOYukHQ/h4YBxlhYrAkMTVjNm97hq4IArI9bvDzy/k=";
|
2024-09-23 07:52:07 +00:00
|
|
|
release."1.18.1".sha256 = "sha256-rrIv/mVC0Ez3nU7fpnzwduIC3tI6l73DjgAbv1gd2v0=";
|
|
|
|
release."1.17.0".sha256 = "sha256-J8FJBeaB+2HtHjrkgNzOZJngZ2AcYU+npL9Y1HNPnzo=";
|
|
|
|
release."1.15.2".sha256 = "sha256-+sQYQiN3n+dlzXzi5opOjhkJZqpkNwlHZcUjaUM6+xQ=";
|
|
|
|
release."1.15.0".sha256 = "sha256-vpQzbkDqJPCmaBmXcBnzlWGS7djW9wWv8xslkIlXgP0=";
|
|
|
|
release."1.13.7".sha256 = "sha256-0QbOEnrRCYA2mXDGRKe+QYCXSESLJvLzRW0Iq+/3P9Y=";
|
|
|
|
release."1.12.0".sha256 = "sha256-w4JzLZB8jcxw7nA7AfgU9jTZTr6IYUxPU5E2vNIFC4Q=";
|
|
|
|
release."1.11.4".sha256 = "sha256-dyzEpzokgffsF9lt+FZgUlcZEuAb70vGuHfGUtjZYIM=";
|
2020-08-28 21:05:46 +00:00
|
|
|
releaseRev = v: "v${v}";
|
2024-09-23 07:52:07 +00:00
|
|
|
releaseArtifact = v: if lib.versionAtLeast v "1.13.8"
|
|
|
|
then "elpi-${v}.tbz"
|
|
|
|
else "elpi-v${v}.tbz";
|
2020-08-28 21:05:46 +00:00
|
|
|
location = { domain = "github.com"; owner = "LPCIC"; repo = "elpi"; };
|
|
|
|
}) version;
|
|
|
|
in
|
2024-09-23 07:52:07 +00:00
|
|
|
buildDunePackage {
|
2019-06-23 19:53:51 +00:00
|
|
|
pname = "elpi";
|
2020-08-28 21:05:46 +00:00
|
|
|
inherit (fetched) version src;
|
2018-09-20 05:45:31 +00:00
|
|
|
|
2023-08-28 15:15:17 +00:00
|
|
|
patches = lib.optional (version == "1.16.5")
|
2022-08-09 14:14:28 +00:00
|
|
|
./atd_2_10.patch;
|
|
|
|
|
2024-09-23 07:52:07 +00:00
|
|
|
minimalOCamlVersion = "4.07";
|
2018-09-20 05:45:31 +00:00
|
|
|
|
2022-03-01 15:42:22 +00:00
|
|
|
# atdgen is both a library and executable
|
2023-02-17 06:47:42 +00:00
|
|
|
nativeBuildInputs = [ perl ]
|
|
|
|
++ [ (if lib.versionAtLeast version "1.15" || version == "dev" then menhir else camlp5) ]
|
2023-01-26 17:31:02 +00:00
|
|
|
++ lib.optional (lib.versionAtLeast version "1.16" || version == "dev") atdgen;
|
2022-03-01 15:42:22 +00:00
|
|
|
buildInputs = [ ncurses ]
|
|
|
|
++ lib.optional (lib.versionAtLeast version "1.16" || version == "dev") atdgen;
|
2018-09-20 05:45:31 +00:00
|
|
|
|
2022-06-07 12:51:16 +00:00
|
|
|
propagatedBuildInputs = [ re stdlib-shims ]
|
2023-01-26 17:31:02 +00:00
|
|
|
++ (if lib.versionAtLeast version "1.15" || version == "dev"
|
2022-05-29 13:45:15 +00:00
|
|
|
then [ menhirLib ]
|
|
|
|
else [ camlp5 ]
|
|
|
|
)
|
2021-02-19 18:34:30 +00:00
|
|
|
++ (if lib.versionAtLeast version "1.13" || version == "dev"
|
2021-11-05 20:54:48 +00:00
|
|
|
then [ ppxlib ppx_deriving ]
|
|
|
|
else [ ppxlib_0_15 ppx_deriving_0_15 ]
|
|
|
|
);
|
2018-09-20 05:45:31 +00:00
|
|
|
|
2023-01-26 17:31:02 +00:00
|
|
|
meta = with lib; {
|
2018-09-20 05:45:31 +00:00
|
|
|
description = "Embeddable λProlog Interpreter";
|
2020-08-28 21:05:46 +00:00
|
|
|
license = licenses.lgpl21Plus;
|
|
|
|
maintainers = [ maintainers.vbgl ];
|
2020-06-04 08:25:19 +00:00
|
|
|
homepage = "https://github.com/LPCIC/elpi";
|
2018-09-20 05:45:31 +00:00
|
|
|
};
|
2020-06-04 08:25:19 +00:00
|
|
|
|
2020-08-27 11:49:45 +00:00
|
|
|
postPatch = ''
|
2024-09-23 07:52:07 +00:00
|
|
|
substituteInPlace elpi_REPL.ml --replace-warn "tput cols" "${ncurses}/bin/tput cols"
|
2020-08-27 11:49:45 +00:00
|
|
|
'';
|
2018-09-20 05:45:31 +00:00
|
|
|
}
|