[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#49946] [PATCH v7 07/32] gnu: Add tree-sitter-c.
From: |
Pierre Langlois |
Subject: |
[bug#49946] [PATCH v7 07/32] gnu: Add tree-sitter-c. |
Date: |
Fri, 25 Nov 2022 01:21:17 +0000 |
* gnu/packages/tree-sitter.scm (tree-sitter-c): New variable.
---
gnu/packages/tree-sitter.scm | 33 +++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)
diff --git a/gnu/packages/tree-sitter.scm b/gnu/packages/tree-sitter.scm
index 30bf17b79b..4f75b0251a 100644
--- a/gnu/packages/tree-sitter.scm
+++ b/gnu/packages/tree-sitter.scm
@@ -22,6 +22,7 @@ (define-module (gnu packages tree-sitter)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix build-system cargo)
#:use-module (guix build-system gnu)
+ #:use-module (guix build-system tree-sitter)
#:use-module (guix git-download)
#:use-module (guix packages)
#:use-module (guix utils)
@@ -156,3 +157,35 @@ (define-public tree-sitter-cli
This package includes the @command{tree-sitter} command-line tool.")
(license license:expat)))
+
+(define tree-sitter-delete-generated-files
+ '(begin
+ (delete-file "binding.gyp")
+ (delete-file-recursively "bindings")
+ (delete-file "src/grammar.json")
+ (delete-file "src/node-types.json")
+ (delete-file "src/parser.c")
+ (delete-file-recursively "src/tree_sitter")
+ #t))
+
+(define-public tree-sitter-c
+ (package
+ (name "tree-sitter-c")
+ (version "0.20.2")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/tree-sitter/tree-sitter-c")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1w03r4l773ki4iq2xxsc2pqxf3pjsbybq3xq4glmnsihgylibn8v"))
+ (modules '((guix build utils)))
+ (snippet tree-sitter-delete-generated-files)))
+ (build-system tree-sitter-build-system)
+ (home-page "https://github.com/tree-sitter/tree-sitter-c")
+ (synopsis "Tree-sitter C grammar")
+ (description
+ "This package provides a C grammar for the Tree-sitter library.")
+ (license license:expat)))
--
2.38.1
- [bug#49946] [PATCH v7 01/32] gnu: tree-sitter: Move to its own module., (continued)
- [bug#49946] [PATCH v7 04/32] gnu: Add rust-smallbitvec-2., Pierre Langlois, 2022/11/24
- [bug#49946] [PATCH v7 03/32] gnu: Add rust-html-escape., Pierre Langlois, 2022/11/24
- [bug#49946] [PATCH v7 08/32] gnu: Add tree-sitter-cpp., Pierre Langlois, 2022/11/24
- [bug#49946] [PATCH v7 10/32] gnu: Add tree-sitter-css., Pierre Langlois, 2022/11/24
- [bug#49946] [PATCH v7 07/32] gnu: Add tree-sitter-c.,
Pierre Langlois <=
- [bug#49946] [PATCH v7 05/32] gnu: Add tree-sitter-cli., Pierre Langlois, 2022/11/24
- [bug#49946] [PATCH v7 13/32] gnu: Add tree-sitter-elm., Pierre Langlois, 2022/11/24
- [bug#49946] [PATCH v7 14/32] gnu: Add tree-sitter-go., Pierre Langlois, 2022/11/24
- [bug#49946] [PATCH v7 15/32] gnu: Add tree-sitter-haskell., Pierre Langlois, 2022/11/24