about summary refs log tree commit diff
path: root/pkgs/development/tools/misc/cmake-language-server/default.nix
blob: fcaac283029a52c61d52432532b9e3eb075c0138 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
{ lib
, buildPythonApplication
, fetchFromGitHub
, poetry
, cmake-format
, pygls
, pyparsing
, cmake
, pytest-datadir
, pytestCheckHook
}:

buildPythonApplication rec {
  pname = "cmake-language-server";
  version = "0.1.5";
  format = "pyproject";

  src = fetchFromGitHub {
    owner = "regen100";
    repo = pname;
    rev = "refs/tags/v${version}";
    sha256 = "sha256-4GchuxArSJKnl28ckefJgbqxyf1fOU0DUj8R50upTcQ=";
  };

  patches = [
    # Test timeouts occasionally cause the build to fail
    ./disable-test-timeouts.patch

    # cmake-language-server depends on pygls 0.11, but still works with 0.12
    ./use-latest-pygls.patch
  ];

  postPatch = ''
    substituteInPlace pyproject.toml \
      --replace 'pyparsing = "^2.4"' 'pyparsing = "^3.0.6"'
  '';

  nativeBuildInputs = [
    poetry
  ];

  propagatedBuildInputs = [
    cmake-format
    pygls
    pyparsing
  ];

  checkInputs = [
    cmake
    cmake-format
    pytest-datadir
    pytestCheckHook
  ];

  dontUseCmakeConfigure = true;
  pythonImportsCheck = [ "cmake_language_server" ];

  meta = with lib; {
    description = "CMake LSP Implementation";
    homepage = "https://github.com/regen100/cmake-language-server";
    license = licenses.mit;
    maintainers = with maintainers; [ kira-bruneau ];
  };
}