From patchwork Fri Feb 18 14:39:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pierre Langlois X-Patchwork-Id: 37332 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 CC5A227BBEA; Fri, 18 Feb 2022 14:48:35 +0000 (GMT) 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 45BAC27BBE9 for ; Fri, 18 Feb 2022 14:48:35 +0000 (GMT) Received: from localhost ([::1]:40368 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nL4Yk-0004dE-DS for patchwork@mira.cbaines.net; Fri, 18 Feb 2022 09:48:34 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43260) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nL4RT-0005Q4-6X for guix-patches@gnu.org; Fri, 18 Feb 2022 09:41:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:59919) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nL4RS-0005Pf-Sr for guix-patches@gnu.org; Fri, 18 Feb 2022 09:41:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nL4RS-0008UT-Qm for guix-patches@gnu.org; Fri, 18 Feb 2022 09:41:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#49946] [PATCH v4 04/31] gnu: Add tree-sitter. Resent-From: Pierre Langlois Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 18 Feb 2022 14:41: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.164519521132420 (code B ref 49946); Fri, 18 Feb 2022 14:41:02 +0000 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 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 X-Provags-ID: V03:K1:M7CP+iJbITCi78Trdem2z9Ao6I3U+A46ItFlsvl4KyyQipXyKAN zvXoAFl4OVTcMqG8DK/aRwi4Sv7UyUKGAs+7P2NVqst467rUKd3QQYk8/9XWFruoDE1dv1+ CPyYwO/ItOOcAmmeJt4abjX7UQh8dbxwrCnS7u5dc/K7j1Pz3gYrTgP8zl1wxS+2MUZXbvY moSOlN9gGShceTSOspGFA== 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-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/package/tree-sitter.scm: New file. * gnu/local.mk (GNU_SYSTEM_MODULES): Register it. --- gnu/local.mk | 1 + gnu/packages/tree-sitter.scm | 83 ++++++++++++++++++++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100644 gnu/packages/tree-sitter.scm -- 2.34.0 diff --git a/gnu/local.mk b/gnu/local.mk index 433467ee39..97ab160c3c 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -584,6 +584,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/tree-sitter.scm b/gnu/packages/tree-sitter.scm new file mode 100644 index 0000000000..10a3a6e57c --- /dev/null +++ b/gnu/packages/tree-sitter.scm @@ -0,0 +1,83 @@ +;;; GNU Guix --- Functional package management for GNU +;;; 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.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 and +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 syntax +errors. +@item Dependency-free so that the runtime library (which is written in pure C) +can be embedded in any application. +@end enumerate + +This package includes the @code{libtree-sitter} runtime library.") + (license license:expat)))