python311Packages.tree-sitter-rust: init at 0.21.2

This commit is contained in:
Doron Behar 2024-06-03 14:22:01 +03:00
parent 3413a19915
commit 70ace4421f
3 changed files with 132 additions and 0 deletions

View File

@ -0,0 +1,71 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
[[package]]
name = "aho-corasick"
version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916"
dependencies = [
"memchr",
]
[[package]]
name = "cc"
version = "1.0.98"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "41c270e7540d725e65ac7f1b212ac8ce349719624d7bcff99f8e2e488e8cf03f"
[[package]]
name = "memchr"
version = "2.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d"
[[package]]
name = "regex"
version = "1.10.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c"
dependencies = [
"aho-corasick",
"memchr",
"regex-automata",
"regex-syntax",
]
[[package]]
name = "regex-automata"
version = "0.4.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea"
dependencies = [
"aho-corasick",
"memchr",
"regex-syntax",
]
[[package]]
name = "regex-syntax"
version = "0.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56"
[[package]]
name = "tree-sitter"
version = "0.22.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "df7cc499ceadd4dcdf7ec6d4cbc34ece92c3fa07821e287aedecd4416c516dca"
dependencies = [
"cc",
"regex",
]
[[package]]
name = "tree-sitter-rust"
version = "0.21.2"
dependencies = [
"cc",
"tree-sitter",
]

View File

@ -0,0 +1,59 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, cargo
, rustPlatform
, rustc
, setuptools
, wheel
, tree-sitter
}:
buildPythonPackage rec {
pname = "tree-sitter-rust";
version = "0.21.2";
pyproject = true;
src = fetchFromGitHub {
owner = "tree-sitter";
repo = "tree-sitter-rust";
rev = "v${version}";
hash = "sha256-4CTh6fKSV8TuMHLAfEKWsAeCqeCM2uo6hVmF5KWhyPY=";
};
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_rust" ];
meta = with lib; {
description = "Rust grammar for tree-sitter";
homepage = "https://github.com/tree-sitter/tree-sitter-rust";
license = licenses.mit;
maintainers = with maintainers; [ doronbehar ];
};
}

View File

@ -15406,6 +15406,8 @@ self: super: with self; {
tree-sitter-python = callPackage ../development/python-modules/tree-sitter-python { };
tree-sitter-rust = callPackage ../development/python-modules/tree-sitter-rust { };
treelib = callPackage ../development/python-modules/treelib { };
treelog = callPackage ../development/python-modules/treelog { };