diff --git a/pkgs/development/coq-modules/serapi/default.nix b/pkgs/development/coq-modules/serapi/default.nix index 126fcbf1ae7a..3b7cc6c73032 100644 --- a/pkgs/development/coq-modules/serapi/default.nix +++ b/pkgs/development/coq-modules/serapi/default.nix @@ -42,8 +42,6 @@ in with coq.ocamlPackages; [ cmdliner findlib # run time dependency of SerAPI - ppx_deriving - ppx_import ppx_sexp_conv ppx_hash sexplib @@ -63,6 +61,7 @@ in }; }).overrideAttrs(o: if lib.versions.isLe "8.19.0+0.19.3" o.version && o.version != "dev" then + let ppx_deriving = coq.ocamlPackages.ppx_deriving.override { version = "5.2.1"; }; in let inherit (o) version; in { src = fetchzip { url = @@ -73,7 +72,7 @@ if lib.versions.isLe "8.19.0+0.19.3" o.version && o.version != "dev" then sha256 = release."${version}".sha256; }; - patches = + patches = lib.optional (lib.versions.isGe "8.16" version) ./sertop.patch ++ ( if version == "8.10.0+0.7.2" then [ ./8.10.0+0.7.2.patch @@ -95,10 +94,16 @@ if lib.versions.isLe "8.19.0+0.19.3" o.version && o.version != "dev" then ./janestreet-0.16.patch ] else [ - ]; + ]); propagatedBuildInputs = o.propagatedBuildInputs - ++ (with coq.ocamlPackages; [ ppx_deriving_yojson yojson zarith ]) # zarith needed because of Coq + ++ (with coq.ocamlPackages; [ + ppx_deriving + (ppx_deriving_yojson.override { inherit ppx_deriving; }) + (ppx_import.override { inherit ppx_deriving; }) + yojson + zarith # zarith needed because of Coq + ]) ; } else { propagatedBuildInputs = o.propagatedBuildInputs ++ [ coq-lsp ]; } diff --git a/pkgs/development/coq-modules/serapi/sertop.patch b/pkgs/development/coq-modules/serapi/sertop.patch new file mode 100644 index 000000000000..2aabe687f855 --- /dev/null +++ b/pkgs/development/coq-modules/serapi/sertop.patch @@ -0,0 +1,11 @@ +--- a/sertop/sertop_loader.ml 2024-11-14 11:49:00.887576232 +0100 ++++ b/sertop/sertop_loader.ml 2024-11-14 11:49:32.433659096 +0100 +@@ -51,7 +51,7 @@ + else None + + let plugin_handler user_handler = +- let loader = Option.default (Fl_dynload.load_packages ~debug:false) user_handler in ++ let loader = Option.default (Fl_dynload.load_packages ?loadfile:None ~debug:false) user_handler in + fun fl_pkg -> + try + let _, fl_pkg = Mltop.PluginSpec.repr fl_pkg in