coqPackages: fix serapi & coq-lsp (#355995)

authored by zimmi48.tngl.sh and committed by

GitHub f288ae8b 2143d323

+48 -23
+11
pkgs/development/coq-modules/coq-lsp/coq-loader.patch
···
··· 1 + --- a/coq/loader.ml 2024-11-14 17:54:36.562137810 +0100 2 + +++ b/coq/loader.ml 2024-11-14 17:55:01.485154767 +0100 3 + @@ -81,7 +81,7 @@ 4 + Exninfo.iraise iexn 5 + 6 + let plugin_handler user_loader = 7 + - let loader = Option.default (Fl_dynload.load_packages ~debug:false) user_loader in 8 + + let loader = Option.default (Fl_dynload.load_packages ?loadfile:None ~debug:false) user_loader in 9 + let safe_loader = safe_loader loader in 10 + fun fl_pkg -> 11 + let _, fl_pkg = Mltop.PluginSpec.repr fl_pkg in
+3 -1
pkgs/development/coq-modules/coq-lsp/default.nix
··· 32 ''; 33 34 propagatedBuildInputs = 35 - with coq.ocamlPackages; [ dune-build-info menhir uri yojson ]; 36 37 meta = with lib; { 38 description = "Language Server Protocol and VS Code Extension for Coq"; ··· 49 else 50 [ cmdliner ppx_deriving ppx_deriving_yojson ppx_import ppx_sexp_conv 51 ppx_compare ppx_hash sexplib ]); 52 })
··· 32 ''; 33 34 propagatedBuildInputs = 35 + with coq.ocamlPackages; [ dune-build-info menhir result uri yojson ]; 36 37 meta = with lib; { 38 description = "Language Server Protocol and VS Code Extension for Coq"; ··· 49 else 50 [ cmdliner ppx_deriving ppx_deriving_yojson ppx_import ppx_sexp_conv 51 ppx_compare ppx_hash sexplib ]); 52 + 53 + patches = lib.optional (lib.versions.isEq "0.1.8" o.version) ./coq-loader.patch; 54 })
+10 -5
pkgs/development/coq-modules/serapi/default.nix
··· 42 with coq.ocamlPackages; [ 43 cmdliner 44 findlib # run time dependency of SerAPI 45 - ppx_deriving 46 - ppx_import 47 ppx_sexp_conv 48 ppx_hash 49 sexplib ··· 63 }; 64 }).overrideAttrs(o: 65 if lib.versions.isLe "8.19.0+0.19.3" o.version && o.version != "dev" then 66 let inherit (o) version; in { 67 src = fetchzip { 68 url = ··· 73 sha256 = release."${version}".sha256; 74 }; 75 76 - patches = 77 if version == "8.10.0+0.7.2" 78 then [ 79 ./8.10.0+0.7.2.patch ··· 95 ./janestreet-0.16.patch 96 ] 97 else [ 98 - ]; 99 100 propagatedBuildInputs = o.propagatedBuildInputs 101 - ++ (with coq.ocamlPackages; [ ppx_deriving_yojson yojson zarith ]) # zarith needed because of Coq 102 ; } 103 else 104 { propagatedBuildInputs = o.propagatedBuildInputs ++ [ coq-lsp ]; }
··· 42 with coq.ocamlPackages; [ 43 cmdliner 44 findlib # run time dependency of SerAPI 45 ppx_sexp_conv 46 ppx_hash 47 sexplib ··· 61 }; 62 }).overrideAttrs(o: 63 if lib.versions.isLe "8.19.0+0.19.3" o.version && o.version != "dev" then 64 + let ppx_deriving = coq.ocamlPackages.ppx_deriving.override { version = "5.2.1"; }; in 65 let inherit (o) version; in { 66 src = fetchzip { 67 url = ··· 72 sha256 = release."${version}".sha256; 73 }; 74 75 + patches = lib.optional (lib.versions.isGe "8.16" version) ./sertop.patch ++ ( 76 if version == "8.10.0+0.7.2" 77 then [ 78 ./8.10.0+0.7.2.patch ··· 94 ./janestreet-0.16.patch 95 ] 96 else [ 97 + ]); 98 99 propagatedBuildInputs = o.propagatedBuildInputs 100 + ++ (with coq.ocamlPackages; [ 101 + ppx_deriving 102 + (ppx_deriving_yojson.override { inherit ppx_deriving; }) 103 + (ppx_import.override { inherit ppx_deriving; }) 104 + yojson 105 + zarith # zarith needed because of Coq 106 + ]) 107 ; } 108 else 109 { propagatedBuildInputs = o.propagatedBuildInputs ++ [ coq-lsp ]; }
+11
pkgs/development/coq-modules/serapi/sertop.patch
···
··· 1 + --- a/sertop/sertop_loader.ml 2024-11-14 11:49:00.887576232 +0100 2 + +++ b/sertop/sertop_loader.ml 2024-11-14 11:49:32.433659096 +0100 3 + @@ -51,7 +51,7 @@ 4 + else None 5 + 6 + let plugin_handler user_handler = 7 + - let loader = Option.default (Fl_dynload.load_packages ~debug:false) user_handler in 8 + + let loader = Option.default (Fl_dynload.load_packages ?loadfile:None ~debug:false) user_handler in 9 + fun fl_pkg -> 10 + try 11 + let _, fl_pkg = Mltop.PluginSpec.repr fl_pkg in
+13 -17
pkgs/development/ocaml-modules/ppx_deriving/default.nix
··· 10 , ounit 11 , ounit2 12 , ocaml-migrate-parsetree 13 }: 14 15 - let params = 16 - if lib.versionAtLeast ppxlib.version "0.32" then { 17 - version = "6.0.3"; 18 - sha256 = "sha256-N0qpezLF4BwJqXgQpIv6IYwhO1tknkRSEBRVrBnJSm0="; 19 - } else if lib.versionAtLeast ppxlib.version "0.20" then { 20 - version = "5.2.1"; 21 - sha256 = "11h75dsbv3rs03pl67hdd3lbim7wjzh257ij9c75fcknbfr5ysz9"; 22 - } else if lib.versionAtLeast ppxlib.version "0.15" then { 23 - version = "5.1"; 24 - sha256 = "1i64fd7qrfzbam5hfbl01r0sx4iihsahcwqj13smmrjlnwi3nkxh"; 25 - } else { 26 - version = "5.0"; 27 - sha256 = "0fkzrn4pdyvf1kl0nwvhqidq01pnq3ql8zk1jd56hb0cxaw851w3"; 28 - } 29 - ; in 30 31 buildDunePackage rec { 32 pname = "ppx_deriving"; 33 - inherit (params) version; 34 35 src = fetchurl { 36 url = "https://github.com/ocaml-ppx/ppx_deriving/releases/download/v${version}/ppx_deriving-${lib.optionalString (lib.versionOlder version "6.0") "v"}${version}.tbz"; 37 - inherit (params) sha256; 38 }; 39 40 strictDeps = true;
··· 10 , ounit 11 , ounit2 12 , ocaml-migrate-parsetree 13 + , version ? 14 + if lib.versionAtLeast ppxlib.version "0.32" then "6.0.3" 15 + else if lib.versionAtLeast ppxlib.version "0.20" then "5.2.1" 16 + else if lib.versionAtLeast ppxlib.version "0.15" then "5.1" 17 + else "5.0" 18 }: 19 20 + let hash = { 21 + "6.0.3" = "sha256-N0qpezLF4BwJqXgQpIv6IYwhO1tknkRSEBRVrBnJSm0="; 22 + "5.2.1" = "sha256:11h75dsbv3rs03pl67hdd3lbim7wjzh257ij9c75fcknbfr5ysz9"; 23 + "5.1" = "sha256:1i64fd7qrfzbam5hfbl01r0sx4iihsahcwqj13smmrjlnwi3nkxh"; 24 + "5.0" = "sha256:0fkzrn4pdyvf1kl0nwvhqidq01pnq3ql8zk1jd56hb0cxaw851w3"; 25 + }."${version}"; in 26 27 buildDunePackage rec { 28 pname = "ppx_deriving"; 29 + inherit version; 30 31 src = fetchurl { 32 url = "https://github.com/ocaml-ppx/ppx_deriving/releases/download/v${version}/ppx_deriving-${lib.optionalString (lib.versionOlder version "6.0") "v"}${version}.tbz"; 33 + inherit hash; 34 }; 35 36 strictDeps = true;