about summary refs log tree commit diff
path: root/nixpkgs/pkgs/by-name/bi/bitbake-language-server/package.nix
blob: 8d314053e7bc85e5513a61ad9c0bdb4ea78291d2 (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
{ lib
, nix-update-script
, python3
, fetchFromGitHub
, cmake
, ninja
}:
let
  tree-sitter-bitbake = fetchFromGitHub {
    owner = "amaanq";
    repo = "tree-sitter-bitbake";
    rev = "v1.0.0";
    hash = "sha256-HfWUDYiBCmtlu5fFX287BSDHyCiD7gqIVFDTxH5APAE=";
  };
in
python3.pkgs.buildPythonApplication rec {
  pname = "bitbake-language-server";
  version = "0.0.6";
  format = "pyproject";

  src = fetchFromGitHub {
    owner = "Freed-Wu";
    repo = pname;
    rev = version;
    hash = "sha256-UOeOvaQplDn7jM+3sUZip1f05TbczoaRQKMxVm+euDU=";
  };

  nativeBuildInputs = with python3.pkgs; [
    cmake
    ninja
    pathspec
    pyproject-metadata
    scikit-build-core
    setuptools-scm
  ];

  propagatedBuildInputs = with python3.pkgs; [
    lsprotocol
    platformdirs
    pygls
    tree-sitter
  ];

  SETUPTOOLS_SCM_PRETEND_VERSION = version;

  # The scikit-build-core runs CMake internally so we must let it run the configure step itself.
  dontUseCmakeConfigure = true;
  SKBUILD_CMAKE_ARGS = lib.strings.concatStringsSep ";" [
    "-DFETCHCONTENT_FULLY_DISCONNECTED=ON"
    "-DFETCHCONTENT_QUIET=OFF"
    "-DFETCHCONTENT_SOURCE_DIR_TREE-SITTER-BITBAKE=${tree-sitter-bitbake}"
  ];

  passthru.updateScript = nix-update-script { };

  meta = with lib; {
    description = "Language server for bitbake";
    homepage = "https://github.com/Freed-Wu/bitbake-language-server";
    changelog = "https://github.com/Freed-Wu/bitbake-language-server/releases/tag/v${version}";
    license = licenses.gpl3;
    maintainers = with maintainers; [ otavio ];
  };
}