From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id y6WJCkNqEGGCJAEAgWs5BA (envelope-from ) for ; Mon, 09 Aug 2021 01:35:31 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id 4BqMBUNqEGHJMwAA1q6Kng (envelope-from ) for ; Sun, 08 Aug 2021 23:35:31 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 94AF2DC90 for ; Mon, 9 Aug 2021 01:35:30 +0200 (CEST) Received: from localhost ([::1]:42076 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mCsKH-0008Tj-Kr for larch@yhetil.org; Sun, 08 Aug 2021 19:35:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56850) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mCsJt-0007oD-R3 for guix-patches@gnu.org; Sun, 08 Aug 2021 19:35:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:43464) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mCsJt-00063k-Hh for guix-patches@gnu.org; Sun, 08 Aug 2021 19:35:05 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mCsJt-0000uq-En for guix-patches@gnu.org; Sun, 08 Aug 2021 19:35:05 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49946] [PATCH 07/31] gnu: Add tree-sitter. Resent-From: Pierre Langlois Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 08 Aug 2021 23:35:05 +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.16284656743346 (code B ref 49946); Sun, 08 Aug 2021 23:35:05 +0000 Received: (at 49946) by debbugs.gnu.org; 8 Aug 2021 23:34:34 +0000 Received: from localhost ([127.0.0.1]:54979 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mCsJN-0000ro-Rz for submit@debbugs.gnu.org; Sun, 08 Aug 2021 19:34:34 -0400 Received: from mout.gmx.net ([212.227.17.22]:47423) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mCsJF-0000ox-55 for 49946@debbugs.gnu.org; Sun, 08 Aug 2021 19:34:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1628465659; bh=kRbz6Vpf/V7l4+XEZ+ruIutM5jbgz2lSJZdniE5wKik=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=Y4p2hVd4AOy1OUSMPoLUjh40DcfGb3hf0AAXz0C/6HbdU6Yf/IQptovA9AubYPR7Z HcEDEztW7Ot0W1N0YtO/ctYELxw2JA6Tj2glq70T36B+EHvFTnZlGd8FoH/FZiodCu AG3jpRmHHVY8FwgvUjazdhlIMa44mbUd0wxQALz4= 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 1N0Fxf-1n1Hrg1Iu7-00xLEA; Mon, 09 Aug 2021 01:34:19 +0200 From: Pierre Langlois Date: Mon, 9 Aug 2021 00:33:30 +0100 Message-Id: <20210808233354.6745-7-pierre.langlois@gmx.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210808233354.6745-1-pierre.langlois@gmx.com> References: <87h7fztt60.fsf@gmx.com> <20210808233354.6745-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:4ga6ZpdNZHWP5NTgmmG+heLGpVqHBgCNeH1t2KkjPIsAtzJv5CE 7/mI0trw8hGs6IM6hZJ3om5zuIpR89tOxuVMasC0mXaa+hdYh4fvVytrYy7Ax+BKxKZ3OK6 yO+a8mvCYkioV608lyP5lsZxHFoixLR2KyEwc+KIOiZ4+E0rSXBFWIvQDOcoEyB65C3X/Or OwIIQCxBuM/YmVjQXHHqA== X-UI-Out-Filterresults: notjunk:1;V03:K0:21j0w1KyVKA=:IF/h5CS6FXRIqZX+OuwR79 t2rC2tFlDHZgE1RW9Pur0yUBgvuyop6rh3vkW2vI16M7OWSEuoMqNBN6Cn+O/sNfu2kSBu5U4 TMNHxwDMfyAtV19TOj2gHk0TM80g4xXbEXPTRh84frhpGXXYyIPjaAyXS3PNqS1NJDS0H769u qeqqLImExRiBZAfnWhJ/gWHd1gT0j9/NaRQ6rlfpGPhTq9vsoKZI4wnPM30gfqeVos5y8fqVz ZnKjcrWxi+jqBh0DlEcLZ/Id/DOqU1k2q8Mvk2Mw0jYTmTcf9M5a6OHGAWCRHOFtT2m/ZfAOp BEnSi4tn50AiD85+63kiLIkjJr6SCGpG2/4IBp64ZwYF/a0+NE+g/h7YRYBYUGCQfnP4n8GAy vC8O+xErWxLjW8v8ub8rA5RFQWIQn2NcPW9QGTHsfkr6VZBP4UyEV2pY4NPNwjN4mVZwWWAoD vb7xWSS+zrXaMM0eAn/NaJOu4K2JW8vDYr+oPh0EL8+b/deKyL0JuEP56/iLXmMO/BY0Emyxs zqk8Y8uVpXU8ASv0sNAU21ikL9ZThiIybLShK3bIEXR4yRIoKhGjM8EDiaAL9H7F7b0r0uaPm Y9MORJ2KCV8ku61/CkFeDeT9U/7bgu8ylSbPFpIwyXiia7ZNLHsbmYkyjO+FwzV0By28SSQkP SlBVZYmfSPANTnOevdULbpBVp3MfIFY4bMpuXc27SVVJ6VJUci1DmXq4ragAPNVEJEIKwD3aw 6CZOCqho+9gUJ0pxMLm/ZzRtnwo+f0OHzpBJo2GJ0s8+ZALHSiEFE9fp+yai2ZeoW8LlZLhr0 DoS/0RSPyrTm5bgUWxOD2Tkfdw/95/r+0wVRoE4xP+i7aBTlwVU+5zALNdvpZwHaehIVdco/w 6hAdt04S8kWjgi218nmmUrJ2nfOhIaMrx/LrVaC7uw4mp77Hv+xSvOuwmEekxvSfVH4ERnewF /yJmMeqVS8mfCqEy3xDQhtXPa4hyScfy2Fus1ogSnQ7wDgHJUzmNsaDigWDQgw/LASgn8C7x/ pANuP1yblCXYX1jC+fSUIoeQokTCBFFJObxrBHMEtNLncXVk56oCFAkMXky3mqR02Q6taoYRY 4e9wscJJJ+9xZ7jYm+JvcdEDN7a50BxIoG3ln/n6hhp1ADS97CuHVY/4Q== 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+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1628465730; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=evnMRA221i4y8J4eyIRBMActz1MSzA8JrfE6W+DTwUI=; b=hu+faLV4ghnrIRrfRCcgWV2Rb9CYzj/1M6vqvvTI5J0IbbOv7DYPinRNjbKd8YELFLdqqN UDShx2EexxZn1MOYwq7um1bnfLA2kyUfsZIxVzk/XzpT25KloKhd/4Yg68juvi3cavShru ViViDxn2YyhC+sbN01qDCa7dxM+wvsC1RyCE/26eMF5Y0FrFMvG7DOt8SlaIKIZuNDWjfQ t2aOvTKlEpPo0O3JvMLVMTFZhxsAkpBdzSBsKJjv7wcEnK+IR+mgyrXv5QyAzDQE40sCNd bLDu+SjiwC2rxGX7F73j7vO22eEaW3cbBOBfykiLQBDLRU44nloN83uusxjQLw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1628465730; a=rsa-sha256; cv=none; b=u6zVKO0zc6XgI608t+edyZHz50QfPIl5is2Sd0UQ83PeGrrdhK8oKqP+U9Mx7NFu3DPSmV i/RhH0k5FIJa+nWKvnBTNS2n8/7eBjKURCqiyDk4I+SzdG7VnWFejMlAzZ6XD/jjiHyFFI UPbQ9AgfjysM+ji+eF8td/KO5OhGdVtvR/XXpI9zMEaA13ErC74+6ArZDh+aIsiBYXc/b2 UY0qVSHblrJbptuMU/FC3GT2S9GIzoXqJR/TGkLjFKVgRvAPDkU+F8o1VGmnONJsFnLqlk sWKMNETBJBvxgivl6vQlRZ9Gb9Ba9/hxPwvzHiESMalblbCVUpuBXRy9OFXBPA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmx.net header.s=badeba3b8450 header.b=Y4p2hVd4; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -0.31 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmx.net header.s=badeba3b8450 header.b=Y4p2hVd4; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmx.com (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 94AF2DC90 X-Spam-Score: -0.31 X-Migadu-Scanner: scn1.migadu.com X-TUID: tw5CSIDg8v4Z * gnu/packages/tree-sitter.scm: New file. * gnu/local.mk (GNU_SYSTEM_MODULES): Register it. =2D-- gnu/local.mk | 1 + gnu/packages/tree-sitter.scm | 98 ++++++++++++++++++++++++++++++++++++ 2 files changed, 99 insertions(+) create mode 100644 gnu/packages/tree-sitter.scm diff --git a/gnu/local.mk b/gnu/local.mk index 3f09b167b1..3763df0821 100644 =2D-- a/gnu/local.mk +++ b/gnu/local.mk @@ -559,6 +559,7 @@ GNU_SYSTEM_MODULES =3D \ %D%/packages/tls.scm \ %D%/packages/tmux.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..2c749dc0a8 =2D-- /dev/null +++ b/gnu/packages/tree-sitter.scm @@ -0,0 +1,98 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright =C2=A9 2021 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 licenses) #:prefix license:) + #:use-module (guix build-system cargo) + #:use-module (guix git-download) + #:use-module (guix packages) + #:use-module (gnu packages crates-io) + #:use-module (gnu packages crates-graphics)) + +(define-public tree-sitter + (package + (name "tree-sitter") + (version "0.19.5") + (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 + "1qmb0sva28zv6r3c3j7xs9pc8bpwwhkb9vxxndw2zbdn9wkvmbmn")))) + (build-system cargo-build-system) + (arguments + `(;; Running test requires downloading fixtures, see the + ;; script/fetch-fixtures script. + #:tests? #f + ;; FIXME: Installing the sources for the tree-sitter Rust bindings + ;; doesn't work out of the box due to tree-sitter having multiple + ;; Rust packages in the same repository (bindings and CLI). + #:install-source? #f + #:cargo-inputs + (("rust-ansi-term" ,rust-ansi-term-0.12) + ("rust-atty" ,rust-atty-0.2) + ("rust-clap" ,rust-clap-2) + ("rust-difference" ,rust-difference-2) + ("rust-dirs" ,rust-dirs-3) + ("rust-html-escape" ,rust-html-escape-0.2) + ("rust-libloading" ,rust-libloading-0.7) + ("rust-smallbitvec" ,rust-smallbitvec-2) + ("rust-spin" ,rust-spin-0.7) + ("rust-tiny-http" ,rust-tiny-http-0.8) + ("rust-walkdir" ,rust-walkdir-2) + ("rust-webbrowser" ,rust-webbrowser-0.5) + ("rust-which" ,rust-which-4)) + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'delete-cargo.lock + (lambda _ (delete-file "Cargo.lock"))) + (add-after 'build 'build-lib + (lambda _ (invoke "make"))) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (bin (string-append out "/bin")) + (lib (string-append out "/lib"))) + (mkdir-p bin) + (install-file "target/release/tree-sitter" bin) + (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 increment= al +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 @command{tree-sitter} tool as well as the runti= me +library.") + (license license:expat))) =2D- 2.32.0