2022-06-16 17:23:12 +00:00
|
|
|
{ lib
|
|
|
|
, buildDunePackage, camlp5
|
|
|
|
, ocaml
|
|
|
|
, menhir, menhirLib
|
2022-08-12 12:06:08 +00:00
|
|
|
, atdgen
|
2022-06-16 17:23:12 +00:00
|
|
|
, stdlib-shims
|
2021-12-06 16:07:01 +00:00
|
|
|
, re, perl, ncurses
|
|
|
|
, ppxlib, ppx_deriving
|
|
|
|
, ppxlib_0_15, ppx_deriving_0_15
|
2022-06-16 17:23:12 +00:00
|
|
|
, coqPackages
|
2024-01-13 08:15:51 +00:00
|
|
|
, version ? if lib.versionAtLeast ocaml.version "4.08" then "1.18.1"
|
2022-08-12 12:06:08 +00:00
|
|
|
else if lib.versionAtLeast ocaml.version "4.07" then "1.15.2" else "1.14.1"
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
2023-02-02 18:25:31 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
let p5 = camlp5; in
|
|
|
|
let camlp5 = p5.override { legacy = true; }; in
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
let fetched = coqPackages.metaFetch ({
|
2024-01-13 08:15:51 +00:00
|
|
|
release."1.18.1".sha256 = "sha256-zgBJefQDe3JyCGbC0wvMcx/9iMVbftBJ43NPogkNeHY=";
|
2023-10-09 19:29:22 +00:00
|
|
|
release."1.17.0".sha256 = "sha256-DTxE8CvYl0et20pxueydI+WzraI6UPHMNvxyp2gU/+w=";
|
2022-08-12 12:06:08 +00:00
|
|
|
release."1.16.5".sha256 = "sha256-tKX5/cVPoBeHiUe+qn7c5FIRYCwY0AAukN7vSd/Nz9A=";
|
2022-06-16 17:23:12 +00:00
|
|
|
release."1.15.2".sha256 = "sha256-XgopNP83POFbMNyl2D+gY1rmqGg03o++Ngv3zJfCn2s=";
|
|
|
|
release."1.15.0".sha256 = "sha256:1ngdc41sgyzyz3i3lkzjhnj66gza5h912virkh077dyv17ysb6ar";
|
2022-02-20 05:27:41 +00:00
|
|
|
release."1.14.1".sha256 = "sha256-BZPVL8ymjrE9kVGyf6bpc+GA2spS5JBpkUtZi04nPis=";
|
2021-10-28 06:52:43 +00:00
|
|
|
release."1.13.7".sha256 = "10fnwz30bsvj7ii1vg4l1li5pd7n0qqmwj18snkdr5j9gk0apc1r";
|
2021-05-28 09:39:13 +00:00
|
|
|
release."1.13.5".sha256 = "02a6r23mximrdvs6kgv6rp0r2dgk7zynbs99nn7lphw2c4189kka";
|
2021-04-19 03:05:28 +00:00
|
|
|
release."1.13.1".sha256 = "12a9nbdvg9gybpw63lx3nw5wnxfznpraprb0wj3l68v1w43xq044";
|
2021-02-19 19:06:45 +00:00
|
|
|
release."1.13.0".sha256 = "0dmzy058m1mkndv90byjaik6lzzfk3aaac7v84mpmkv6my23bygr";
|
2021-01-09 10:05:03 +00:00
|
|
|
release."1.12.0".sha256 = "1agisdnaq9wrw3r73xz14yrq3wx742i6j8i5icjagqk0ypmly2is";
|
|
|
|
release."1.11.4".sha256 = "1m0jk9swcs3jcrw5yyw5343v8mgax238cjb03s8gc4wipw1fn9f5";
|
|
|
|
releaseRev = v: "v${v}";
|
|
|
|
location = { domain = "github.com"; owner = "LPCIC"; repo = "elpi"; };
|
|
|
|
}) version;
|
|
|
|
in
|
2020-04-24 23:36:52 +00:00
|
|
|
buildDunePackage rec {
|
|
|
|
pname = "elpi";
|
2021-01-09 10:05:03 +00:00
|
|
|
inherit (fetched) version src;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
patches = lib.optional (version == "1.16.5")
|
2022-09-09 14:08:57 +00:00
|
|
|
./atd_2_10.patch;
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
minimalOCamlVersion = "4.04";
|
2023-04-12 12:48:02 +00:00
|
|
|
duneVersion = "3";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-02-09 11:40:11 +00:00
|
|
|
# atdgen is both a library and executable
|
2023-02-22 10:55:15 +00:00
|
|
|
nativeBuildInputs = [ perl ]
|
|
|
|
++ [ (if lib.versionAtLeast version "1.15" || version == "dev" then menhir else camlp5) ]
|
2023-02-02 18:25:31 +00:00
|
|
|
++ lib.optional (lib.versionAtLeast version "1.16" || version == "dev") atdgen;
|
2023-02-09 11:40:11 +00:00
|
|
|
buildInputs = [ ncurses ]
|
|
|
|
++ lib.optional (lib.versionAtLeast version "1.16" || version == "dev") atdgen;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
propagatedBuildInputs = [ re stdlib-shims ]
|
2023-02-02 18:25:31 +00:00
|
|
|
++ (if lib.versionAtLeast version "1.15" || version == "dev"
|
2022-06-16 17:23:12 +00:00
|
|
|
then [ menhirLib ]
|
|
|
|
else [ camlp5 ]
|
|
|
|
)
|
|
|
|
++ (if lib.versionAtLeast version "1.13" || version == "dev"
|
2021-12-06 16:07:01 +00:00
|
|
|
then [ ppxlib ppx_deriving ]
|
|
|
|
else [ ppxlib_0_15 ppx_deriving_0_15 ]
|
|
|
|
);
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Embeddable λProlog Interpreter";
|
2021-01-09 10:05:03 +00:00
|
|
|
license = licenses.lgpl21Plus;
|
|
|
|
maintainers = [ maintainers.vbgl ];
|
2020-06-18 07:06:33 +00:00
|
|
|
homepage = "https://github.com/LPCIC/elpi";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2020-06-18 07:06:33 +00:00
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace elpi_REPL.ml --replace "tput cols" "${ncurses}/bin/tput cols"
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
}
|