depot/third_party/nixpkgs/pkgs/development/tools/misc/cmake-language-server/default.nix
Default email e7ec2969af Project import generated by Copybara.
GitOrigin-RevId: 9b19f5e77dd906cb52dade0b7bd280339d2a1f3d
2024-01-13 09:15:51 +01:00

71 lines
1.5 KiB
Nix

{ lib
, buildPythonApplication
, fetchFromGitHub
, cmake-format
, pygls
, cmake
, pdm-backend
, pytest-datadir
, pytestCheckHook
, pythonOlder
}:
buildPythonApplication rec {
pname = "cmake-language-server";
version = "0.1.8";
format = "pyproject";
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "regen100";
repo = "cmake-language-server";
rev = "refs/tags/v${version}";
hash = "sha256-7AlF+FqhZR+6lLsR1dxAGHd/GU+mB3ojYLDXVm7Il4M=";
};
patches = [
# Test timeouts occasionally cause the build to fail
./disable-test-timeouts.patch
];
nativeBuildInputs = [
pdm-backend
];
propagatedBuildInputs = [
cmake-format
pygls
];
nativeCheckInputs = [
cmake
cmake-format
pytest-datadir
pytestCheckHook
];
# version.py generated by pdm, no idea why it's not present in test phase
# https://github.com/regen100/cmake-language-server/blob/68bbc8187b6110a75f498647af7c44df790ffa87/pyproject.toml#L35-L36
preCheck = ''
echo "__version__ = \"$PDM_BUILD_SCM_VERSION\"" > cmake_language_server/version.py
'';
postCheck = ''
rm cmake_language_server/version.py
'';
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 ];
mainProgram = "cmake-language-server";
};
}