From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 18 09:40:11 2022 Received: (at 49946) by debbugs.gnu.org; 18 Feb 2022 14:40:11 +0000 Received: from localhost ([127.0.0.1]:53778 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nL4Qc-0008Qd-Bu for submit@debbugs.gnu.org; Fri, 18 Feb 2022 09:40:11 -0500 Received: from mout.gmx.net ([212.227.17.21]:41161) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nL4QT-0008NP-8J for 49946@debbugs.gnu.org; Fri, 18 Feb 2022 09:40:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1645195195; bh=FUfcvCDVngJDtA0Uuce9Us8oVgDxmUluH8uD2Q1n8GM=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=Pf4TizqN+2MMebCVfw8xLKD4tLq4BI9o4L3xj/G1zCInXNm8siL8/MXVoo9mbO72b RJS5o8FlnmH4GwzsLmgpQLgZdRADPE21zvqHkC0i0UtwDXay3HZ/8OHT1grNpPx8PN WMuKlMZJU16/5P/7Atctt/e4VXCe5BwpxBStUiCs= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([82.69.64.142]) by mail.gmx.net (mrgmx104 [212.227.17.174]) with ESMTPSA (Nemesis) id 1MpUUm-1o400d1OQO-00pthh; Fri, 18 Feb 2022 15:39:55 +0100 From: Pierre Langlois To: 49946@debbugs.gnu.org Subject: [PATCH v4 04/31] gnu: Add tree-sitter. Date: Fri, 18 Feb 2022 14:39:21 +0000 Message-Id: <20220218143948.28989-4-pierre.langlois@gmx.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20220218143948.28989-1-pierre.langlois@gmx.com> References: <877d9s2qa9.fsf@gmx.com> <20220218143948.28989-1-pierre.langlois@gmx.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:M7CP+iJbITCi78Trdem2z9Ao6I3U+A46ItFlsvl4KyyQipXyKAN zvXoAFl4OVTcMqG8DK/aRwi4Sv7UyUKGAs+7P2NVqst467rUKd3QQYk8/9XWFruoDE1dv1+ CPyYwO/ItOOcAmmeJt4abjX7UQh8dbxwrCnS7u5dc/K7j1Pz3gYrTgP8zl1wxS+2MUZXbvY moSOlN9gGShceTSOspGFA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:QDiYPcHpuEo=:OQGBFV44EwMfeEdIxmCdDJ 2ggn7WqSQtlhR/vDcSSvFbY/ryACPLBYhvru/GuNfAUfb8tp/OKaMYKPMDN4HPkW2KEZ5U1Pb /VlNxAcLxdCa468YKPz1gdn8WKIdN+Mcqo6hY6xAUYtPbdcFndMmHKI+WbreH4Xexwin1YTTW tPPu4XZdDIGMdowyEpxP6LcC3S8tjfY+v70EeTiaFx9TCxMC5Sa3p1WC/1oHIbcYdFwO15yp2 97tBCd+Lo9+WqvIimPwRHr2tm67OFF6N3zxvwtGlSsmAnnaa6HZfz88zzu15OENcGZWgJiRXs Byr+pp75hRetDaiCGwvNwYBqLE9RAa1V3vxYD7yDgpmC48rmoEslKOyZtOpvmy91EX1Yu7Wus qLnYtp3xrrYlH082tw689FnS87oaK2Skz9JLKQo+dYG1cEhmBzeNYb11q4y7KuJdo40jxPiw5 MaBNKUR9qpcqf7Q64c0iRempPUc9OLAqNpFZYPY+lPH6Bg2sTmd9QmBapy2Fnd3goCe0RXby1 lH8rG7tJDUVOzBZxgiTCXezPglkJ5Rh1wvK3kFKOz50xsIKw4M7C/2fMd/C0Ost8ftbVqbWWf gb0q4bAeol840yC/p+8Q3tUZfASJVUGhgvTQKhe4+E1xbde5n8xn2JsS/7hlQvE4ajy2gL0H3 InBXL2mhlRL8WNNgYydipOpuoU8L0R/EuHb/kB53PrZBBqSYSoYSM/VAr60b2rj7WeyQ/nM8M 6G0wz38f9WPYAPUwyGzAvgq8wsW4gBJcs++su59Eaem9pv3LzKPA/XiEfBSvpVzf7AON7zvDV WfMjRjIcF/3qfD67/HVeL40VLnDNgcqaXojUM44GILap+3G4AtJuKOaOqxblPUmMNsZx7VDoL HXbFr+gcjyIOg10du76C4jx1R9A8PX5Y7vXCnPdehHQm1JAEgh3KiMGlw5671HFLFnjQo0nZR k9AnMJunBw1wrcDrdfSwmJl/W0lX2tR6t36T622gkwXqbr8DKjnslf17S2SHNAbtvXDaJjI/m ZkH42/Pcrb7LeFoaFMluf99X4n1dFF51BOpBqDoUSOerlPnZhbfF3sk9jLreafUxOxZDglwNv 8xaCmXPfxBcXEw= X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 49946 Cc: Pierre Langlois X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) * gnu/package/tree-sitter.scm: New file. * gnu/local.mk (GNU_SYSTEM_MODULES): Register it. =2D-- gnu/local.mk | 1 + gnu/packages/tree-sitter.scm | 83 ++++++++++++++++++++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100644 gnu/packages/tree-sitter.scm diff --git a/gnu/local.mk b/gnu/local.mk index 433467ee39..97ab160c3c 100644 =2D-- a/gnu/local.mk +++ b/gnu/local.mk @@ -584,6 +584,7 @@ GNU_SYSTEM_MODULES =3D \ %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/tree-sitter.scm b/gnu/packages/tree-sitter.scm new file mode 100644 index 0000000000..10a3a6e57c =2D-- /dev/null +++ b/gnu/packages/tree-sitter.scm @@ -0,0 +1,83 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright =C2=A9 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.4") + (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 + "1yldgdbf3l5l4ki52abdf81nwkcbvg219gwr3ydcjwfsg7hf7zhz")) + (modules '((guix build utils))) + (snippet + '(begin + (delete-file-recursively "lib/src/unicode"))))) + (inputs + (list icu4c)) + (build-system gnu-build-system) + (arguments + (list + #:tests? #f ;No check target. + #:phases + #~(modify-phases %standard-phases + (delete 'configure) + (add-before 'build 'set-cc + (lambda _ + (setenv "CC" + #$(cc-for-target)))) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) (lib (string-append + out "/lib"))) + (setenv "PREFIX" out) + (invoke "make" "install"))))))) + (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 a= nd +efficiently update the syntax tree as the source file is edited. + +Tree-sitter aims to be: + +@enumerate +@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 syn= tax +errors. +@item Dependency-free so that the runtime library (which is written in pu= re C) +can be embedded in any application. +@end enumerate + +This package includes the @code{libtree-sitter} runtime library.") + (license license:expat))) =2D- 2.34.0