Skip to content

Commit

Permalink
Merge pull request NixOS#316901 from doronbehar/pkg/autotools-languag…
Browse files Browse the repository at this point in the history
…e-server

autotools-language-server: init at 0.0.19
  • Loading branch information
doronbehar committed Jun 18, 2024
2 parents 69dd1ca + 306018c commit 7eabbc2
Show file tree
Hide file tree
Showing 16 changed files with 895 additions and 14 deletions.
51 changes: 51 additions & 0 deletions pkgs/by-name/au/autotools-language-server/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{ lib
, python3
, fetchFromGitHub
, fetchpatch
}:

python3.pkgs.buildPythonApplication rec {
pname = "autotools-language-server";
version = "0.0.19";
pyproject = true;

src = fetchFromGitHub {
owner = "Freed-Wu";
repo = "autotools-language-server";
rev = "refs/tags/${version}";
hash = "sha256-V0EOV1ZmeC+4svc2fqV6AIiL37dkrxUJAnjywMZcENw=";
};
patches = [
# Right before the release, upstream decided to replace the
# tree-sitter-languages dependency with tree-sitter-make, which is yanked
# from some reason. Hopefully upstream will fix this dependency a bit
# better in the next release. See also:
# https://github.com/Freed-Wu/autotools-language-server/commit/f149843becfcfd6b2bb4a98eb1f3984c01d5fd33#r142659163
(fetchpatch {
url = "https://github.com/Freed-Wu/autotools-language-server/commit/f149843becfcfd6b2bb4a98eb1f3984c01d5fd33.patch";
hash = "sha256-TrzHbfR6GYAEqDIFiCqSX2+Qv4JeFJ5faiKJhNYojf0=";
revert = true;
})
];

build-system = [
python3.pkgs.setuptools-generate
python3.pkgs.setuptools-scm
];

dependencies = with python3.pkgs; [
tree-sitter-languages
lsp-tree-sitter
];
nativeCheckInputs = [
python3.pkgs.pytestCheckHook
];

meta = with lib; {
description = "Autotools language server, support configure.ac, Makefile.am, Makefile";
homepage = "https://github.com/Freed-Wu/autotools-language-server";
license = licenses.gpl3Only;
maintainers = with maintainers; [ doronbehar ];
mainProgram = "autotools-language-server";
};
}
55 changes: 55 additions & 0 deletions pkgs/development/python-modules/lsp-tree-sitter/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, setuptools-generate
, setuptools-scm
, colorama
, jinja2
, jsonschema
, pygls
, tree-sitter0_21
, pytestCheckHook
}:

buildPythonPackage rec {
pname = "lsp-tree-sitter";
version = "0.0.15";
pyproject = true;

src = fetchFromGitHub {
owner = "neomutt";
repo = "lsp-tree-sitter";
rev = version;
hash = "sha256-yzScgix3BtSCBzlDoE1kMYGtVzkup/+ZK9L1C7VA3do=";
};

build-system = [
setuptools-generate
setuptools-scm
];

dependencies = [
colorama
jinja2
jsonschema
pygls
# The build won't fail if we had used tree-sitter (version > 0.21), but
# this package is only a dependency of autotools-language-server which also
# depends on tree-sitter-languages which must use tree-sitter0_21 and not
# tree-sitter. Hence we avoid different tree-sitter versions dependency
# mismatch by defaulting here to this lower version.
tree-sitter0_21
];
nativeCheckInputs = [
pytestCheckHook
];

pythonImportsCheck = [ "lsp_tree_sitter" ];

meta = with lib; {
description = "A library to create language servers";
homepage = "https://github.com/neomutt/lsp-tree-sitter";
license = licenses.gpl3Only;
maintainers = with maintainers; [ doronbehar ];
};
}
71 changes: 71 additions & 0 deletions pkgs/development/python-modules/tree-sitter-html/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 56 additions & 0 deletions pkgs/development/python-modules/tree-sitter-html/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, cargo
, rustPlatform
, rustc
, setuptools
, wheel
, tree-sitter
}:

buildPythonPackage rec {
pname = "tree-sitter-html";
version = "0.20.3";
pyproject = true;

src = fetchFromGitHub {
owner = "tree-sitter";
repo = "tree-sitter-html";
rev = "v${version}";
hash = "sha256-sHy3fVWemJod18HCQ8zBC/LpeCCPH0nzhI1wrkCg8nw=";
};

cargoDeps = rustPlatform.importCargoLock {
lockFile = ./Cargo.lock;
};

postPatch = ''
ln -s ${./Cargo.lock} Cargo.lock
'';

build-system = [
cargo
rustPlatform.cargoSetupHook
rustc
setuptools
wheel
];

passthru.optional-dependencies = {
core = [
tree-sitter
];
};

# There are no tests
doCheck = false;
pythonImportsCheck = [ "tree_sitter_html" ];

meta = with lib; {
description = "HTML grammar for tree-sitter";
homepage = "https://github.com/tree-sitter/tree-sitter-html";
license = licenses.mit;
maintainers = with maintainers; [ doronbehar ];
};
}
71 changes: 71 additions & 0 deletions pkgs/development/python-modules/tree-sitter-javascript/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

58 changes: 58 additions & 0 deletions pkgs/development/python-modules/tree-sitter-javascript/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, cargo
, rustPlatform
, rustc
, setuptools
, wheel
, tree-sitter
}:

buildPythonPackage rec {
pname = "tree-sitter-javascript";
version = "0.21.3";
pyproject = true;

src = fetchFromGitHub {
owner = "tree-sitter";
repo = "tree-sitter-javascript";
rev = "v${version}";
hash = "sha256-jsdY9Pd9WqZuBYtk088mx1bRQadC6D2/tGGVY+ZZ0J4=";
};

cargoDeps = rustPlatform.importCargoLock {
# Upstream doesn't track a Cargo.lock file unfortunatly, but they barely
# have rust dependencies so it doesn't cost us too much.
lockFile = ./Cargo.lock;
};

postPatch = ''
ln -s ${./Cargo.lock} Cargo.lock
'';

build-system = [
cargo
rustPlatform.cargoSetupHook
rustc
setuptools
wheel
];

passthru.optional-dependencies = {
core = [
tree-sitter
];
};

# There are no tests
doCheck = false;
pythonImportsCheck = [ "tree_sitter_javascript" ];

meta = with lib; {
description = "JavaScript and JSX grammar for tree-sitter";
homepage = "https://github.com/tree-sitter/tree-sitter-javascript";
license = licenses.mit;
maintainers = with maintainers; [ doronbehar ];
};
}
Loading

0 comments on commit 7eabbc2

Please sign in to comment.