From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id wO7NAMawD2LdsgAAgWs5BA (envelope-from ) for ; Fri, 18 Feb 2022 15:44:22 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id EKm4OMWwD2IIbgAAauVa8A (envelope-from ) for ; Fri, 18 Feb 2022 15:44:21 +0100 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 7C8E825A84 for ; Fri, 18 Feb 2022 15:44:21 +0100 (CET) Received: from localhost ([::1]:35496 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nL4Ue-00012v-Ch for larch@yhetil.org; Fri, 18 Feb 2022 09:44:20 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43268) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nL4RT-0005Qg-II for guix-patches@gnu.org; Fri, 18 Feb 2022 09:41:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:59920) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nL4RT-0005Q3-8j for guix-patches@gnu.org; Fri, 18 Feb 2022 09:41:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nL4RT-0008Ub-6t for guix-patches@gnu.org; Fri, 18 Feb 2022 09:41:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#49946] [PATCH v4 05/31] gnu: Add tree-sitter-cli. Resent-From: Pierre Langlois Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 18 Feb 2022 14:41:03 +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.164519521232427 (code B ref 49946); Fri, 18 Feb 2022 14:41:03 +0000 Received: (at 49946) by debbugs.gnu.org; 18 Feb 2022 14:40:12 +0000 Received: from localhost ([127.0.0.1]:53780 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nL4Qd-0008Qr-EH for submit@debbugs.gnu.org; Fri, 18 Feb 2022 09:40:12 -0500 Received: from mout.gmx.net ([212.227.17.22]:57453) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nL4QT-0008NR-RV for 49946@debbugs.gnu.org; Fri, 18 Feb 2022 09:40:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1645195195; bh=2zNsGflsbIMeCw5Z/VXAGLuxeE6NQq36yK7lwf07oGM=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=ZtUzl5JJjVDSv2FjVtMpCH+cdwWhtOAS5VmeUddqULtI3ezmgX5T2zvRkPrBybefZ xkqGbrl5oaHxCeHc9RJAvjyb/V9IcmShtP1v9MAmaQursdTHRSTJD8a8+CKExXikWL MZilXfOa/WMh3Wq7J4qV/Qtn49gHgxFjTH8hvUvo= 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 1Mw9QC-1oAh4h2fkC-00s6c5; Fri, 18 Feb 2022 15:39:55 +0100 From: Pierre Langlois Date: Fri, 18 Feb 2022 14:39:22 +0000 Message-Id: <20220218143948.28989-5-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-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:g+q2+EGMD6PzKSnAVnvmJRETCXRQdlobPrR3Fou5pREa35lDJEX oRFxcrt5Vzf9dQBjypA51PC/FMpULzX0NrvVQzkIVLI9IB/a9Dc0Mo5YooQP5aZiTSBWSXf t0UZSVAj1RjLBl2qPspXMu4t8dEbxlu16LOgF8fWe8mQx3l55u2SEIAGDQtjLlBiPhURBIP eHJ3PSBIYj6xqNtgXkvnQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:D4YhnqBy4eE=:xyXF/oGpI88uBV4K2E4ybi E0nZHY7Q9niNqSyQJ2FhohEGHr38QsoI00CXzpShW/rC+lmbSMTAU2WrEmkMMD2QddvGKSJOo A1TDF25phRWmV4Bcu+VItze3akndXeskt88yjyxQhN1v4s3/7OWkLIINcbyf8xJwh/nJoO0Mt oQBGxGBEYyC9e9CbkIvveH4/LrYbRpUODjfIpm8Z4bxXVTNfNib1w0Ik+rFKM1WMHWfgFaqhA xOLXU9ktzn3LAQ83pN7XwI0/Qm697uhZ1cG3Cp21Kdh96PqJAX579rabqXoKVDlUmSC86cEd+ mE49bxcsEVNSN2UyrlZocCzDTGCrBRc9MuXtKILkOoXGduLrb23S2C3ZCwB0SlsAE1urjvLr+ mOyKrC/+AIOs5I18YCIWEDiFT1kxvF42F92V+8F+pjC8SNtApT6NoNjJ1bH1zAvx5bITqtOu2 L1h9ykUSAITJn/y+P70OVVKUZR81hhLO1M16c+w9k4ERexh1bD8Scj8HcFkUcp3XJuE7jV1eJ Vhn4hncWPiGUQ8cLFc4MpV/SuypJ8WRnr8wgwWaZvqEDv6+E/fEASUz7z076MzT6FUAfOi0v2 n9ZRspcNsaZFSwv8xfzE7jwuce9tM0wD7Cr9eean97SSJ1Q4zYGwpySNrtMNHsVLvXC6C0zNo C4uoFTWFaxtUkwTMCvdt9nBHfLNQN8rwjGVoZQOgVXx6ziWdtnfiRjTAcDVaJGWvMFX5n/bi6 B7lFMV3003FPepqPGFrGaIxmUtm1AtM7VKA3Ok+Q0xzzlshhw7zk06BV9/+60z0z9YqtvoQKV w9OkJc0BoCWZYVhb7Gdfyb9+JkIBFz8vguzE0FMAwThvgz84EtssZ2vRJWmW9X1OUJz62oVFw iXAX/Y0fduXCFh1gAugIQ0BCV9GDrO/UawLRKmUk19nLMvew+uPMwQB1ZtIDTrYDyA3Rn2xfe dsdp4SoWwnnhAAGygprE0NMq1W+Ekv+mGCQ9XiKXm0EgxYDnqpCyC2jSm5WZdxm2ot19ZFPTe 54ZYipRIAQwI9KN4j2zC8CPxmfkQzVoI9irWMx3BynfC7DMO0FcD+VE/5vWzTIXX82JO3rDZm n/3ILToSk1rfcs= 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 X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1645195461; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: 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=UjRRFtfEf8jqLlQgWODUkluI6nzSc3hilfnwyC1UVWw=; b=naQJ73aPGts4CLICr/iF0PUYMHQ5J6u/yPbzI15gWiw9jERgiPbVvVzFGAqlWz+cKObeJK vcQM99eaR1K0YU+TFekwkDjKETpZE7GSH+yJ7FRGPfNGKCkrQEXk1rWpDLK3BRvCjal2SA Tn8Kq+75NmcAL/6BN7iDq/IDpabNmTaJAf7F0vC/kgvyBpEDlK9on07mvoUOab0wC2KWHs cjlrR9fq+sPoV5NQUAtqUKOmaUihyCnxPNcGrX0BUU43fB65JKxGxc/nsMDbzY+MJkl89i eFfQoJ9rDS9VCDuG17MYlqWYrBMkfQY6dv5mNXf+RsO7Vx1DTEAJHXQQO0tT3w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1645195461; a=rsa-sha256; cv=none; b=EWHh0yE4Juv5MMeKUB/Fp3vgRQ6S4+PFW67GsaiyezsC7CwKRL8MMY+AokncGZaPDd7b5J Z4/cSDP9sPomZ4EQV028s6U1OKI7HSFwHF3hid7wYpnAs7nUb42rPp9x2ajyIbCzJ/SBQW zX61UU2ddRR0K57NWCB5fYbKu+VaYnFZ5UZ4pVvWEJvJlE8KLQuVl5SWRr40+3kJ9rjxZH 4b02I9g7q/Onnv0zPl40BUSCWDIVjKheSj4/MmM1UOwGtUq6/IwzluSAtXhrcyWtYErLqh iJxjcM3GW/7V7P941FbNUY0YINAPZP8u+4360U4r0nJAIe51S+p/TKqrugtDXA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmx.net header.s=badeba3b8450 header.b=ZtUzl5JJ; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmx.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -0.63 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmx.net header.s=badeba3b8450 header.b=ZtUzl5JJ; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmx.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 7C8E825A84 X-Spam-Score: -0.63 X-Migadu-Scanner: scn0.migadu.com X-TUID: hVglktAvU5lC * gnu/packages/tree-sitter.scm (tree-sitter-cli): New variable. =2D-- gnu/packages/tree-sitter.scm | 66 ++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/gnu/packages/tree-sitter.scm b/gnu/packages/tree-sitter.scm index 10a3a6e57c..cbf8ecdc6c 100644 =2D-- a/gnu/packages/tree-sitter.scm +++ b/gnu/packages/tree-sitter.scm @@ -19,10 +19,13 @@ (define-module (gnu packages tree-sitter) #:use-module (guix gexp) #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix build-system cargo) #:use-module (guix build-system gnu) #:use-module (guix git-download) #:use-module (guix packages) #:use-module (guix utils) + #:use-module (gnu packages crates-graphics) + #:use-module (gnu packages crates-io) #:use-module (gnu packages icu4c)) (define-public tree-sitter @@ -81,3 +84,66 @@ (define-public tree-sitter This package includes the @code{libtree-sitter} runtime library.") (license license:expat))) + +(define-public tree-sitter-cli + (package (inherit tree-sitter) + (name "tree-sitter-cli") + (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-anyhow" ,rust-anyhow-1) + ("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-rustc-hash" ,rust-rustc-hash-1) + ("rust-serde" ,rust-serde-1) + ("rust-smallbitvec" ,rust-smallbitvec-2) + ("rust-spin" ,rust-spin-0.7) + ("rust-thiserror" ,rust-thiserror-1) + ("rust-tiny-http" ,rust-tiny-http-0.8) + ("rust-toml" ,rust-toml-0.5) + ("rust-walkdir" ,rust-walkdir-2) + ("rust-webbrowser" ,rust-webbrowser-0.5) + ("rust-which" ,rust-which-4)) + #:cargo-development-inputs + (("rust-pretty-assertions" ,rust-pretty-assertions-0.7)) + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'delete-cargo.lock + (lambda _ (delete-file "Cargo.lock"))) + (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))))))) + (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} command-line tool.") + (license license:expat))) =2D- 2.34.0