Subject: [bug#49946] [PATCH v4 08/31] gnu: Add tree-sitter-bash.

From: Pierre Langlois <[email-masked]>
Date: Fri, 18 Feb 2022 14:39:25 +0000

* gnu/packages/tree-sitter.scm (tree-sitter-bash): New variable.
---
 gnu/packages/tree-sitter.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/gnu/packages/tree-sitter.scm b/gnu/packages/tree-sitter.scm
index e82c6e60a9..8f12559dde 100644
--- a/gnu/packages/tree-sitter.scm
+++ b/gnu/packages/tree-sitter.scm
@@ -267,3 +267,35 @@ (define-public tree-sitter-cpp
     (description
      "This package provides a C++ grammar for the Tree-sitter library.")
     (license license:expat)))
+
+(define-public tree-sitter-bash
+  (package (inherit tree-sitter-c)
+    (name "tree-sitter-bash")
+    (version "0.19.0")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/tree-sitter/tree-sitter-bash")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "18c030bb65r50i6z37iy7jb9z9i8i36y7b08dbc9bchdifqsijs5"))
+              (modules '((guix build utils)))
+              (snippet tree-sitter-delete-generated-files)))
+    (arguments
+     (substitute-keyword-arguments (package-arguments tree-sitter-c)
+      ((#:phases phases)
+       `(modify-phases ,phases
+          (replace 'delete-dependencies
+           (lambda _
+             (delete-dependencies '("tree-sitter-cli"
+                                    "nan"
+                                    "node-gyp"
+                                    "prebuild"
+                                    "prebuild-install"))))))))
+    (home-page "https://github.com/tree-sitter/tree-sitter-bash")
+    (synopsis "Tree-sitter Bash grammar")
+    (description
+      "This package provides a Bash grammar for the Tree-sitter library.")
+    (license license:expat)))
--
2.34.0