From patchwork Tue Mar 29 19:42:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pierre Langlois X-Patchwork-Id: 38190 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 8207527BBEA; Tue, 29 Mar 2022 20:45:13 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,SPF_HELO_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id BC42C27BBE9 for ; Tue, 29 Mar 2022 20:45:12 +0100 (BST) Received: from localhost ([::1]:36372 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nZHmB-0004nw-R8 for patchwork@mira.cbaines.net; Tue, 29 Mar 2022 15:45:11 -0400 Received: from eggs.gnu.org ([209.51.188.92]:57018) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nZHl5-0003QK-09 for guix-patches@gnu.org; Tue, 29 Mar 2022 15:44:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:39732) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nZHl4-0001Al-OA for guix-patches@gnu.org; Tue, 29 Mar 2022 15:44:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nZHl4-0004xf-Lb for guix-patches@gnu.org; Tue, 29 Mar 2022 15:44:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49946] [PATCH v5 01/27] gnu: tree-sitter: Move to its own module. Resent-From: Pierre Langlois Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 29 Mar 2022 19:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49946 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49946@debbugs.gnu.org Cc: Pierre Langlois Received: via spool by 49946-submit@debbugs.gnu.org id=B49946.164858303018861 (code B ref 49946); Tue, 29 Mar 2022 19:44:02 +0000 Received: (at 49946) by debbugs.gnu.org; 29 Mar 2022 19:43:50 +0000 Received: from localhost ([127.0.0.1]:33567 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nZHko-0004sp-Kq for submit@debbugs.gnu.org; Tue, 29 Mar 2022 15:43:50 -0400 Received: from mout.gmx.net ([212.227.17.20]:60219) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nZHkm-0004ro-Pr for 49946@debbugs.gnu.org; Tue, 29 Mar 2022 15:43:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1648583018; bh=1uN7yqkLMJFSJMce8g4LmU+W/9vHzsYy5Cqr3mTmdoo=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=e0pRO3BGM/it6WjEtOVHsgUIma1GT0QanKdomkrDy9ZVmJI7KpcVtCfypMO92ed1e tL64Rt36p98VhGoB6akKk7dQfT7+n2WLNyrZebqqXrKUAZ89+ZHf4buSiPFYdBEAeZ DW3Bz1XtnrSpAt9v/O0On05edVV5s2AYv9t1UZXU= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([82.69.64.142]) by mail.gmx.net (mrgmx105 [212.227.17.174]) with ESMTPSA (Nemesis) id 1MJE27-1nJ0BV2Tet-00KgvP; Tue, 29 Mar 2022 21:43:38 +0200 From: Pierre Langlois Date: Tue, 29 Mar 2022 20:42:52 +0100 Message-Id: <20220329194318.6106-2-pierre.langlois@gmx.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20220329194318.6106-1-pierre.langlois@gmx.com> References: <877d9s2qa9.fsf@gmx.com> <20220329194318.6106-1-pierre.langlois@gmx.com> MIME-Version: 1.0 X-Provags-ID: V03:K1:Wq7OxtBNypThL7aFJcyBghZvD/JOv3lNqu3KNdUc8YFZ1sSpdfs olDezGEsenX+AyEGYNtsSQNb1eCp+WMhsX9QhQAbCocao0Bj0wKD42OmhW/yLH3otMhVmH2 Ik0M56rg6TVsbdUCKeVcJ1Lm2L1LTVGHzRPkUKCnds9RfbN01koX+oXC8MScK7pqrFnOajt QFLFw4UnPuB5Ca8hmMB/w== X-UI-Out-Filterresults: notjunk:1;V03:K0:C28bLHJpfYY=:uvB+wsf6OMHOCxfwIttSQl U0qfL8P8SH5oLBSFriev3m2ANRG7580X0U8iWJ9KRACPazpzRUqZad3e7V0Wl/M05HYJhArZ5 kvh72UYvpT3wdGORzdFc7tTQt9oYiB/01lpi6zTja9QcYPsn7VEzDlAFNyU857xqOpNceNTaB P4HJyi6hnO1g3RzRRPK+YmrFBXE2VX6ULcJKhO+lUYsxkCzxWk+Wr3MJk2MYH5V1HJEHB5dh1 v3gNyqIa/iAb8bARmlUFhhM2SZnVfdE+JFFC6fOmlHvzhDwmXXgBZz1dgVFQyMQ5/zydfQ5/k yH9zN3nOwxwSyyTSiEJ+PkYT0dT3qb04/hD08q+hKCH/Dlq/tkNyf4MkpLGDK5BINBJAkrWsJ 9uWuXDarCDyZJanroBBa3TAEiIbA6jfSHdOyaVu1acmKE/vs2v5j66fmKfM9tiq5ew9Kyb1gE 98242Gpbw5E+kgcQZS93TmE8oniiAo7dmh0bNyTmb7xwmCIfyKMEB/2qeOHm4+Z2HVfDX4IYM MZXITlqCZVDLZOEJXUerBX+jKO7LAgXKtVx0oP+5yTsgq43Cv2tH0XYrd2sNM0MkWb1X/Iuh6 lWBWeJ6V6UmCLeAg7/TtmKkmPPFQnX+jR3JJJDVBD5ib7eTMw9BeGz5VYHCde5ag0qbsMLR1n mdivp1MlonHPiIu/Hz1pFFI0430GFHxNxY/iat8Xm5U9iDv710NLWgRgIYkwDzcPZJyjZQDL2 IO3utJzVqP09yurkRKj7ZafxyxBqbOjbxuMIctoSyUxHBvx7q4gDVEhhvTQITeoZCoTmcwNJs Rn+SoUXtW1jfIjc0VBHIfOGdDKl9AyHlfwfyR+8ewA0Gkfkf4TTs++Z44UCY1sxMNU6zMWiD5 xOx5SJRY6VEBWZ7T3N7tuL9zKZ/+e/QPG1zBIQHM4XASXmmbhFNW6C4wmI/YBsun27QErNUal y5gP0GABceWji0q+Um+an+SeLrvCsyAKcpQ6sRPBMn1Tr6GNgWX11kQv7o+Kgw4/1Hm7QndOI 4+YWfuhDpmLLmbI6hneO5FoCosISwi+z0xyQXhiP3LZyeBtjRvWD9N8XwycwLpSj0yReFVT3D d1zQ0mgQq98YC4= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/text-editors.scm (tree-sitter): Move to ... * gnu/packages/tree-sitter.scm: ... here, a new module. * gnu/packages/vim.scm: Use (gnu packages tree-sitter). * gnu/local.mk (GNU_SYSTEM_MODULES): Register tree-sitter.scm new module. --- gnu/local.mk | 1 + gnu/packages/text-editors.scm | 52 ----------------------- gnu/packages/tree-sitter.scm | 78 +++++++++++++++++++++++++++++++++++ gnu/packages/vim.scm | 1 + 4 files changed, 80 insertions(+), 52 deletions(-) create mode 100644 gnu/packages/tree-sitter.scm -- 2.34.0 diff --git a/gnu/local.mk b/gnu/local.mk index a704161abc..03972441e6 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -587,6 +587,7 @@ GNU_SYSTEM_MODULES = \ %D%/packages/tmux.scm \ %D%/packages/toolkits.scm \ %D%/packages/tor.scm \ + %D%/packages/tree-sitter.scm \ %D%/packages/tv.scm \ %D%/packages/uglifyjs.scm \ %D%/packages/uml.scm \ diff --git a/gnu/packages/text-editors.scm b/gnu/packages/text-editors.scm index 7cbad042c9..ddbfef3e77 100644 --- a/gnu/packages/text-editors.scm +++ b/gnu/packages/text-editors.scm @@ -63,7 +63,6 @@ (define-module (gnu packages text-editors) #:use-module (gnu packages gtk) #:use-module (gnu packages guile) #:use-module (gnu packages haskell-xyz) - #:use-module (gnu packages icu4c) #:use-module (gnu packages image) #:use-module (gnu packages libbsd) #:use-module (gnu packages libreoffice) @@ -1167,54 +1166,3 @@ (define-public virtaal provided by the Translate Toolkit, including XLIFF and PO.") (home-page "https://virtaal.translatehouse.org/") (license license:gpl2+))) - -(define-public tree-sitter - (package - (name "tree-sitter") - (version "0.20.6") - (source (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/tree-sitter/tree-sitter") - (commit (string-append "v" version)))) - (file-name (git-file-name name version)) - (sha256 - (base32 - "1z20518snyg0zp75qgs5bxmzjqws4dd19vnp6sya494za3qp5b6d")) - (modules '((guix build utils))) - (snippet '(begin - ;; Remove bundled ICU parts - (delete-file-recursively "lib/src/unicode") - #t)))) - (build-system gnu-build-system) - (inputs (list icu4c)) - (arguments - (list #:phases - '(modify-phases %standard-phases - (delete 'configure)) - #:tests? #f ; there are no tests for the runtime library - #:make-flags - #~(list (string-append "PREFIX=" - #$output) - (string-append "CC=" - #$(cc-for-target))))) - (home-page "https://tree-sitter.github.io/tree-sitter/") - (synopsis "Incremental parsing system for programming tools") - (description - "Tree-sitter is a parser generator tool and an incremental parsing -library. It can build a concrete syntax tree for a source file and efficiently -update the syntax tree as the source file is edited. - -Tree-sitter aims to be: - -@itemize -@item General enough to parse any programming language -@item Fast enough to parse on every keystroke in a text editor -@item Robust enough to provide useful results even in the presence of syntax errors -@item Dependency-free so that the runtime library (which is written in pure C) -can be embedded in any application -@end itemize - -This package includes the @code{libtree-sitter} runtime library. -") - (license license:expat))) diff --git a/gnu/packages/tree-sitter.scm b/gnu/packages/tree-sitter.scm new file mode 100644 index 0000000000..7116a10ed7 --- /dev/null +++ b/gnu/packages/tree-sitter.scm @@ -0,0 +1,78 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2022 Luis Henrique Gomes Higino +;;; Copyright © 2022 Pierre Langlois +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu packages tree-sitter) + #:use-module (guix gexp) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix build-system gnu) + #:use-module (guix git-download) + #:use-module (guix packages) + #:use-module (guix utils) + #:use-module (gnu packages icu4c)) + +(define-public tree-sitter + (package + (name "tree-sitter") + (version "0.20.6") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/tree-sitter/tree-sitter") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1z20518snyg0zp75qgs5bxmzjqws4dd19vnp6sya494za3qp5b6d")) + (modules '((guix build utils))) + (snippet '(begin + ;; Remove bundled ICU parts + (delete-file-recursively "lib/src/unicode") + #t)))) + (build-system gnu-build-system) + (inputs (list icu4c)) + (arguments + (list #:phases + '(modify-phases %standard-phases + (delete 'configure)) + #:tests? #f ; there are no tests for the runtime library + #:make-flags + #~(list (string-append "PREFIX=" + #$output) + (string-append "CC=" + #$(cc-for-target))))) + (home-page "https://tree-sitter.github.io/tree-sitter/") + (synopsis "Incremental parsing system for programming tools") + (description + "Tree-sitter is a parser generator tool and an incremental parsing +library. It can build a concrete syntax tree for a source file and efficiently +update the syntax tree as the source file is edited. + +Tree-sitter aims to be: + +@itemize +@item General enough to parse any programming language +@item Fast enough to parse on every keystroke in a text editor +@item Robust enough to provide useful results even in the presence of syntax errors +@item Dependency-free so that the runtime library (which is written in pure C) +can be embedded in any application +@end itemize + +This package includes the @code{libtree-sitter} runtime library. +") + (license license:expat))) diff --git a/gnu/packages/vim.scm b/gnu/packages/vim.scm index bc5e36c6f2..f2fc39586e 100644 --- a/gnu/packages/vim.scm +++ b/gnu/packages/vim.scm @@ -71,6 +71,7 @@ (define-module (gnu packages vim) #:use-module (gnu packages tcl) #:use-module (gnu packages text-editors) #:use-module (gnu packages terminals) + #:use-module (gnu packages tree-sitter) #:use-module (gnu packages xdisorg) #:use-module (gnu packages xorg))