Subject: [bug#49946] [PATCH v5 18/27] gnu: Add tree-sitter-php.

From: Pierre Langlois <[email-masked]>
Date: Tue, 29 Mar 2022 20:43:09 +0100

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

diff --git a/gnu/packages/tree-sitter.scm b/gnu/packages/tree-sitter.scm
index ff98044cc1..654445f71d 100644
--- a/gnu/packages/tree-sitter.scm
+++ b/gnu/packages/tree-sitter.scm
@@ -497,3 +497,33 @@ (define-public tree-sitter-ocaml
       (description
        "This package provides a OCaml grammar for the Tree-sitter library.")
       (license license:expat))))
+
+(define-public tree-sitter-php
+  (let ((commit "435fa00006c0d1515c37fbb4dd6a9de284af75ab")
+        (revision "1"))
+    (package
+      (name "tree-sitter-php")
+      (version (git-version "0.19.0" revision commit))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/tree-sitter/tree-sitter-php")
+                      (commit commit)))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32
+                  "05k4h58gi616gv41r0qqdb1x4rs8y94vghn2r10yczisgzq4vbad"))
+                (modules '((guix build utils)))
+                (snippet
+                 '(begin
+                    (delete-file "src/grammar.json")
+                    (delete-file "src/node-types.json")
+                    (delete-file "src/parser.c")
+                    (delete-file-recursively "src/tree_sitter")
+                    #t))))
+    (build-system tree-sitter-build-system)
+    (home-page "https://github.com/tree-sitter/tree-sitter-php")
+    (synopsis "Tree-sitter PHP grammar")
+    (description
+     "This package provides a PHP grammar for the Tree-sitter library.")
+    (license license:expat))))
--
2.34.0