stevenblack-blocklist: 3.15.5 -> 3.15.8 (#372042)
[NixPkgs.git] / pkgs / development / coq-modules / coq-lsp / default.nix
blobe4064be1d625b35c907ed965572da3f758123874
2   lib,
3   mkCoqDerivation,
4   coq,
5   serapi,
6   makeWrapper,
7   version ? null,
8 }:
10 (mkCoqDerivation rec {
11   pname = "coq-lsp";
12   owner = "ejgallego";
13   namePrefix = [ ];
15   useDune = true;
17   release."0.1.8+8.16".sha256 = "sha256-dEEAK5IXGjHB8D/fYJRQG/oCotoXJuWLxXB0GQlY2eo=";
18   release."0.2.2+8.17".sha256 = "sha256-dWPAwePbfTf2t+ydSd1Cnr2kKTDbvedmxm2+Z6F5zuM=";
19   release."0.2.2+8.18".sha256 = "sha256-0J/XaSvhnKHRlcWfG1xbUOyN4LDtK1SEahE9kpV7GK4=";
20   release."0.2.2+8.19".sha256 = "sha256-E2zO2SOU3nmTFf1yA1gefyIWTViUGNTTJ4r6fZYl6UY=";
21   release."0.2.2+8.20".sha256 = "sha256-9yHisA3YJ/KuolU53qcQAjuSIAZPY+4rnkWV9dpLc6c=";
23   inherit version;
24   defaultVersion =
25     with lib.versions;
26     lib.switch coq.coq-version [
27       {
28         case = isEq "8.16";
29         out = "0.1.8+8.16";
30       }
31       {
32         case = isEq "8.17";
33         out = "0.2.2+8.17";
34       }
35       {
36         case = isEq "8.18";
37         out = "0.2.2+8.18";
38       }
39       {
40         case = isEq "8.19";
41         out = "0.2.2+8.19";
42       }
43       {
44         case = isEq "8.20";
45         out = "0.2.2+8.20";
46       }
47     ] null;
49   nativeBuildInputs = [ makeWrapper ];
51   installPhase = ''
52     runHook preInstall
53     dune install -p ${pname} --prefix=$out --libdir $OCAMLFIND_DESTDIR
54     wrapProgram $out/bin/coq-lsp --prefix OCAMLPATH : $OCAMLPATH
55     runHook postInstall
56   '';
58   propagatedBuildInputs = with coq.ocamlPackages; [
59     dune-build-info
60     menhir
61     result
62     uri
63     yojson
64   ];
66   meta = with lib; {
67     description = "Language Server Protocol and VS Code Extension for Coq";
68     homepage = "https://github.com/ejgallego/coq-lsp";
69     changelog = "https://github.com/ejgallego/coq-lsp/blob/${defaultVersion}/CHANGES.md";
70     maintainers = with maintainers; [ alizter ];
71     license = licenses.lgpl21Only;
72   };
73 }).overrideAttrs
74   (
75     o: with coq.ocamlPackages; {
76       propagatedBuildInputs =
77         o.propagatedBuildInputs
78         ++ (
79           if o.version != null && lib.versions.isLe "0.1.9+8.19" o.version && o.version != "dev" then
80             [
81               camlp-streams
82               serapi
83             ]
84           else
85             [
86               cmdliner
87               ppx_deriving
88               ppx_deriving_yojson
89               ppx_import
90               ppx_sexp_conv
91               ppx_compare
92               ppx_hash
93               sexplib
94             ]
95         );
97       patches = lib.optional (lib.versions.isEq "0.1.8" o.version) ./coq-loader.patch;
98     }
99   )