[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#49946] [PATCH v6 23/27] gnu: Add rust-tree-sitter.
From: |
Pierre Langlois |
Subject: |
[bug#49946] [PATCH v6 23/27] gnu: Add rust-tree-sitter. |
Date: |
Sun, 15 May 2022 19:38:30 +0100 |
* gnu/packages/tree-sitter.scm (rust-tree-sitter): New variable.
---
gnu/packages/tree-sitter.scm | 39 ++++++++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)
diff --git a/gnu/packages/tree-sitter.scm b/gnu/packages/tree-sitter.scm
index 04747f47e5..58ecc445a6 100644
--- a/gnu/packages/tree-sitter.scm
+++ b/gnu/packages/tree-sitter.scm
@@ -23,6 +23,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 git-download)
#:use-module (guix packages)
#:use-module (guix utils)
@@ -157,6 +158,44 @@ (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.6")
+ (source (origin
+ (method url-fetch)
+ (uri (crate-uri "tree-sitter" version))
+ (file-name (string-append name "-" version ".tar.gz"))
+ (sha256
+ (base32
+ "0wcvxgnvj7ga1y7xa7wm0pmabkfj8936ifg8jacd4201cj0vgcq9"))
+ (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\");~@
+ }~%")))
+ #t))))
+ (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)
+ ("rust-spin" ,rust-spin-0.7))))
+ (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
'(begin
(delete-file "binding.gyp")
--
2.36.0
- [bug#49946] [PATCH v6 17/27] gnu: Add tree-sitter-ocaml., (continued)
- [bug#49946] [PATCH v6 17/27] gnu: Add tree-sitter-ocaml., Pierre Langlois, 2022/05/15
- [bug#49946] [PATCH v6 25/27] gnu: Add emacs-tree-sitter-core., Pierre Langlois, 2022/05/15
- [bug#49946] [PATCH v6 20/27] gnu: Add tree-sitter-ruby., Pierre Langlois, 2022/05/15
- [bug#49946] [PATCH v6 22/27] gnu: Add tree-sitter-typescript., Pierre Langlois, 2022/05/15
- [bug#49946] [PATCH v6 26/27] gnu: Add emacs-tree-sitter., Pierre Langlois, 2022/05/15
- [bug#49946] [PATCH v6 14/27] gnu: Add tree-sitter-javascript., Pierre Langlois, 2022/05/15
- [bug#49946] [PATCH v6 19/27] gnu: Add tree-sitter-python., Pierre Langlois, 2022/05/15
- [bug#49946] [PATCH v6 27/27] gnu: Add emacs-tree-sitter-langs., Pierre Langlois, 2022/05/15
- [bug#49946] [PATCH v6 21/27] gnu: Add tree-sitter-rust., Pierre Langlois, 2022/05/15
- [bug#49946] [PATCH v6 24/27] gnu: Add rust-tree-sitter-for-emacs., Pierre Langlois, 2022/05/15
- [bug#49946] [PATCH v6 23/27] gnu: Add rust-tree-sitter.,
Pierre Langlois <=
- Message not available