[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#49946] [PATCH v8 3/7] gnu: Add rust-tree-sitter.
From: |
Pierre Langlois |
Subject: |
[bug#49946] [PATCH v8 3/7] gnu: Add rust-tree-sitter. |
Date: |
Fri, 17 Feb 2023 12:37:18 +0000 |
* gnu/packages/tree-sitter.scm (rust-tree-sitter): New variable.
---
gnu/packages/tree-sitter.scm | 37 ++++++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)
diff --git a/gnu/packages/tree-sitter.scm b/gnu/packages/tree-sitter.scm
index b202ebf4d3..7256ad02e4 100644
--- a/gnu/packages/tree-sitter.scm
+++ b/gnu/packages/tree-sitter.scm
@@ -30,6 +30,7 @@ (define-module (gnu packages tree-sitter)
#:use-module (guix build-system cargo)
#:use-module (guix build-system gnu)
#:use-module (guix build-system tree-sitter)
+ #:use-module (guix download)
#:use-module (guix gexp)
#:use-module (guix git-download)
#:use-module (guix packages)
@@ -188,6 +189,42 @@ (define-public tree-sitter-cli
This package includes the @command{tree-sitter} command-line tool.")
(license license:expat)))
+(define-public rust-tree-sitter
+ (package
+ (name "rust-tree-sitter")
+ (version "0.20.7")
+ (source (origin
+ (method url-fetch)
+ (uri (crate-uri "tree-sitter" version))
+ (file-name (string-append name "-" version ".tar.gz"))
+ (sha256
+ (base32
+ "183niy9malzr4dm81swcgl05xkwqamim6ck0gw5xb6k78nprz6jl"))
+ (modules '((guix build utils)))
+ (snippet
+ #~(begin
+ ;; Remove the runtime library code and dynamically link to
+ ;; it instead.
+ (delete-file-recursively "src")
+ (delete-file "binding_rust/build.rs")
+ (with-output-to-file "binding_rust/build.rs"
+ (lambda _
+ (format #t "fn main() {~@
+ println!(\"cargo:rustc-link-lib=tree-sitter\");~@
+ }~%")))))))
+ (build-system cargo-build-system)
+ (inputs (list tree-sitter))
+ (arguments
+ `(#:cargo-inputs
+ (("rust-cc" ,rust-cc-1)
+ ("rust-lazy-static" ,rust-lazy-static-1)
+ ("rust-regex" ,rust-regex-1))))
+ (home-page "https://tree-sitter.github.io/tree-sitter/")
+ (synopsis "Rust bindings to the Tree-sitter parsing library")
+ (description "This package provides Rust bindings to the Tree-sitter
+parsing library.")
+ (license license:expat)))
+
(define (tree-sitter-delete-generated-files grammar-directories)
#~(begin
(use-modules (guix build utils))
--
2.39.1
- [bug#49946] [PATCH v8 0/7] Add tree-sitter support for Emacs 28, Pierre Langlois, 2023/02/17
- [bug#49946] [PATCH v8 1/7] gnu: Add tree-sitter-lua., Pierre Langlois, 2023/02/17
- [bug#49946] [PATCH v8 2/7] gnu: Add tree-sitter-rust@0.20.2., Pierre Langlois, 2023/02/17
- [bug#49946] [PATCH v8 3/7] gnu: Add rust-tree-sitter.,
Pierre Langlois <=
- [bug#49946] [PATCH v8 6/7] gnu: Add emacs-tree-sitter., Pierre Langlois, 2023/02/17
- [bug#49946] [PATCH v8 4/7] gnu: Add rust-tree-sitter-for-emacs., Pierre Langlois, 2023/02/17
- [bug#49946] [PATCH v8 7/7] gnu: Add emacs-tree-sitter-langs., Pierre Langlois, 2023/02/17
- [bug#49946] [PATCH v8 5/7] gnu: Add emacs-tree-sitter-core., Pierre Langlois, 2023/02/17