nixpkgs/pkgs/development/coq-modules/coq-lsp/default.nix
Silvan Mosberger 4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00

100 lines
2.4 KiB
Nix

{
lib,
mkCoqDerivation,
coq,
serapi,
makeWrapper,
version ? null,
}:
(mkCoqDerivation rec {
pname = "coq-lsp";
owner = "ejgallego";
namePrefix = [ ];
useDune = true;
release."0.1.8+8.16".sha256 = "sha256-dEEAK5IXGjHB8D/fYJRQG/oCotoXJuWLxXB0GQlY2eo=";
release."0.2.2+8.17".sha256 = "sha256-dWPAwePbfTf2t+ydSd1Cnr2kKTDbvedmxm2+Z6F5zuM=";
release."0.2.2+8.18".sha256 = "sha256-0J/XaSvhnKHRlcWfG1xbUOyN4LDtK1SEahE9kpV7GK4=";
release."0.2.2+8.19".sha256 = "sha256-E2zO2SOU3nmTFf1yA1gefyIWTViUGNTTJ4r6fZYl6UY=";
release."0.2.2+8.20".sha256 = "sha256-9yHisA3YJ/KuolU53qcQAjuSIAZPY+4rnkWV9dpLc6c=";
inherit version;
defaultVersion =
with lib.versions;
lib.switch coq.coq-version [
{
case = isEq "8.16";
out = "0.1.8+8.16";
}
{
case = isEq "8.17";
out = "0.2.2+8.17";
}
{
case = isEq "8.18";
out = "0.2.2+8.18";
}
{
case = isEq "8.19";
out = "0.2.2+8.19";
}
{
case = isEq "8.20";
out = "0.2.2+8.20";
}
] null;
nativeBuildInputs = [ makeWrapper ];
installPhase = ''
runHook preInstall
dune install -p ${pname} --prefix=$out --libdir $OCAMLFIND_DESTDIR
wrapProgram $out/bin/coq-lsp --prefix OCAMLPATH : $OCAMLPATH
runHook postInstall
'';
propagatedBuildInputs = with coq.ocamlPackages; [
dune-build-info
menhir
result
uri
yojson
];
meta = with lib; {
description = "Language Server Protocol and VS Code Extension for Coq";
homepage = "https://github.com/ejgallego/coq-lsp";
changelog = "https://github.com/ejgallego/coq-lsp/blob/${defaultVersion}/CHANGES.md";
maintainers = with maintainers; [ alizter ];
license = licenses.lgpl21Only;
};
}).overrideAttrs
(
o: with coq.ocamlPackages; {
propagatedBuildInputs =
o.propagatedBuildInputs
++ (
if o.version != null && lib.versions.isLe "0.1.9+8.19" o.version && o.version != "dev" then
[
camlp-streams
serapi
]
else
[
cmdliner
ppx_deriving
ppx_deriving_yojson
ppx_import
ppx_sexp_conv
ppx_compare
ppx_hash
sexplib
]
);
patches = lib.optional (lib.versions.isEq "0.1.8" o.version) ./coq-loader.patch;
}
)