gnu: tree-sitter-grammar: Add get-cleanup-snippet argument.
* gnu/packages/tree-sitter.scm (tree-sitter-grammar): Add get-cleanup-snippet argument.
This commit is contained in:
		
							parent
							
								
									a88da4199c
								
							
						
					
					
						commit
						1936f38d6d
					
				
					 1 changed files with 5 additions and 2 deletions
				
			
		|  | @ -271,11 +271,14 @@ This package includes the @command{tree-sitter} command-line tool.") | ||||||
|           (grammar-directories '(".")) |           (grammar-directories '(".")) | ||||||
|           (article "a") |           (article "a") | ||||||
|           (inputs '()) |           (inputs '()) | ||||||
|  |           (get-cleanup-snippet tree-sitter-delete-generated-files) | ||||||
|           (license license:expat)) |           (license license:expat)) | ||||||
|   "Returns a package for Tree-sitter grammar.  NAME will be used with |   "Returns a package for Tree-sitter grammar.  NAME will be used with | ||||||
| tree-sitter- prefix to generate package name and also for generating | tree-sitter- prefix to generate package name and also for generating | ||||||
| REPOSITORY-URL value if it's not specified explicitly, TEXT is a string which | REPOSITORY-URL value if it's not specified explicitly, TEXT is a string which | ||||||
| will be used in description and synopsis." | will be used in description and synopsis. GET-CLEANUP-SNIPPET is a function, | ||||||
|  | it recieves GRAMMAR-DIRECTORIES as an argument and should return a G-exp, | ||||||
|  | which will be used as a snippet in origin." | ||||||
|   (let* ((multiple? (> (length grammar-directories) 1)) |   (let* ((multiple? (> (length grammar-directories) 1)) | ||||||
|          (grammar-names (string-append text " grammar" (if multiple? "s" ""))) |          (grammar-names (string-append text " grammar" (if multiple? "s" ""))) | ||||||
|          (synopsis (string-append "Tree-sitter " grammar-names)) |          (synopsis (string-append "Tree-sitter " grammar-names)) | ||||||
|  | @ -296,7 +299,7 @@ will be used in description and synopsis." | ||||||
|                 (file-name (git-file-name name version)) |                 (file-name (git-file-name name version)) | ||||||
|                 (sha256 (base32 hash)) |                 (sha256 (base32 hash)) | ||||||
|                 (snippet |                 (snippet | ||||||
|                  (tree-sitter-delete-generated-files grammar-directories)))) |                  (get-cleanup-snippet grammar-directories)))) | ||||||
|       (build-system tree-sitter-build-system) |       (build-system tree-sitter-build-system) | ||||||
|       (arguments (list #:grammar-directories grammar-directories)) |       (arguments (list #:grammar-directories grammar-directories)) | ||||||
|       (inputs inputs) |       (inputs inputs) | ||||||
|  |  | ||||||
		Reference in a new issue