From patchwork Sun May 15 18:38:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pierre Langlois X-Patchwork-Id: 39379 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 21DDE27BBEB; Sun, 15 May 2022 19:39:17 +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 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 2F43727BBE9 for ; Sun, 15 May 2022 19:39:16 +0100 (BST) Received: from localhost ([::1]:41286 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nqJ99-0001Ta-Af for patchwork@mira.cbaines.net; Sun, 15 May 2022 14:39:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43798) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nqJ8w-0001TA-6g for guix-patches@gnu.org; Sun, 15 May 2022 14:39:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:56772) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nqJ8v-0008TO-UO for guix-patches@gnu.org; Sun, 15 May 2022 14:39:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nqJ8v-0006b8-Qz for guix-patches@gnu.org; Sun, 15 May 2022 14:39:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49946] [PATCH v6 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: Sun, 15 May 2022 18:39:01 +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.165263992925275 (code B ref 49946); Sun, 15 May 2022 18:39:01 +0000 Received: (at 49946) by debbugs.gnu.org; 15 May 2022 18:38:49 +0000 Received: from localhost ([127.0.0.1]:50641 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nqJ8f-0006YK-AN for submit@debbugs.gnu.org; Sun, 15 May 2022 14:38:49 -0400 Received: from mout.gmx.net ([212.227.17.21]:54667) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nqJ8c-0006XN-Oi for 49946@debbugs.gnu.org; Sun, 15 May 2022 14:38:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1652639916; bh=FzqA3+dMOhc4Ql/C843wbq8n9u0a78NLSKacSKwkmDw=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=idqm0ituAU5fIJjMNO0Xoqmxo+cPpR3ag6+x5cJL30ZAQ43YmAgQwtdNToEYokuhv NGOXp30o6izb7Nmuou54Ixz5X/Hyd7YnP4ePV591WSlLTzGwxThUQcnCo2ryyLrZbM Ilj6inIxmLU7l7vVHHbn1qJPduKWkU4ArJfFssEU= 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 1MbzuB-1nKovz2WCt-00dakV; Sun, 15 May 2022 20:38:36 +0200 From: Pierre Langlois Date: Sun, 15 May 2022 19:38:08 +0100 Message-Id: <20220515183834.18771-1-pierre.langlois@gmx.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <87mtfi63ut.fsf@gmx.com> References: <87mtfi63ut.fsf@gmx.com> MIME-Version: 1.0 X-Provags-ID: V03:K1:XGTi3hdyBKWFDA5EzNRIN43iZYijCej8aPmPUR5YndNj7Z9rHpT wp0DM3vVOxQWDGbPmC006ym7fgJyTYfWiMyzQLTihE5ARNt+9FAkiApQm0wbacX+DlMM5ZA zyJ/eM8nY8eumG4vthehhe6O3DfmK7KvBBsdlWR0EawaW3uhSU03/7d0hFkBQUwIUUK5pP1 +iE2LNSrJuPXLVBtAPRew== X-UI-Out-Filterresults: notjunk:1;V03:K0:tuiHZGxcMA0=:AT5AdGClpxX5bCRkVcbEUx 8h4oj3MObfDOK0MglvDOWxj2TzgqrJ2hlGA/74dLsae/bqcpJgqqEGhfhjvhxwPUhnYrZ4FQE riv2JwfRzcVts127VrY8RlxYlxRpWN7nBIS0sa5u/Mm1rQ3sc/kOvj54BTrBawyvOuhfz/LpT RtDk11ngsosJ4n7dczP1dJzWSx/13CHSNVIpen10JILgXl0qnmo1nwj8hImuWZzp+7Si6Jn8L 4I90OUO9nKJTleYAXXxFEOXFUarwHBsAfNrju9CTeJpACmr9JZGE0EBYjfpNrzEboUndpHesC qFpPtCakUvMtXYjiYuheakUUBjk2RbnnGpEx5Rz1LSz18UYCQCklOzNHpj8Yb1mumb0icLnjQ 5DDibMgLbgG515zEOuaoouoVbR3bkMOfS148+I0C47J4/q8dbmSBcoSuNj4lwRUxfyvr+E2OE 0Wdeh/P6Y1+NpRdBGrYrey8oXB5FsE8ZHUJDp5KwvWkYrVfqEDUPpPkeRLx3mfSus9SmDoCgu rQI9yS5hdg3EwBYoU4VTVKwulgW+r4CatCesXhdRZ3B3sCmRM4QDI7S6WBWgTY2zfWlii9ns1 Svm6Va4QLLHITxFDfgx38PMws6calUrFRogSvSujN8ycX2p3rq9hvgmIMMVkK9NgGQZuNS2Qh dK8LohtS8QL2Hvxs1gRCnjL0tIXk0Yq1nl2LI92rgkT6j5syKtQxijRXDth0/8NajJtTabCw6 YMj05vrAa1QSZj/bvmv9BBzQANHJeP7yDbOpcPfGESpP+YMQN7hF83sp9PHm8G+mUNoTAZHn0 kmJC2eClPiW4RlXCHyy4rSSMkhDTMH7T9/OhkfZR2Pqwm4CmtE/vBUPi95wJ87KESCTZKa7Wq uNzkRGgFj/s3EoTQvXNP4wOcGujrzowrrjfPbrXHYgs5rmsx4d+pnlgcz8fs+coIiWOM+K7B4 DMtyCOxGzfJJg6aF8RM2zNBxQ9xX9TlI7ELVuizLdJOoIpPyWAPCJjmnW51oYmOJ4bIXpy4kU vcXClhoTSfMbcJLzGiRa0P/BPEx1bVeKtgvsPfN4OokTykaB5VG3hbNqKhFJvIkyYNdZ6qryb Mbbh2GTrU3pGQ4= 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.36.0 diff --git a/gnu/local.mk b/gnu/local.mk index cfb499915a..429a0b577b 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -589,6 +589,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 bb459933b0..c7f7697168 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))