From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id GNqjMnRmK2HTcgAAgWs5BA (envelope-from ) for ; Sun, 29 Aug 2021 12:50:28 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id gCg9LnRmK2HIJQAAbx9fmQ (envelope-from ) for ; Sun, 29 Aug 2021 10:50:28 +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 49F1DFA67 for ; Sun, 29 Aug 2021 12:50:28 +0200 (CEST) Received: from localhost ([::1]:39994 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mKIOP-0006sw-6T for larch@yhetil.org; Sun, 29 Aug 2021 06:50:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39986) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mKILE-00066y-2Z for guix-patches@gnu.org; Sun, 29 Aug 2021 06:47:10 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:44058) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mKILD-0001da-Mc for guix-patches@gnu.org; Sun, 29 Aug 2021 06:47:07 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mKILD-0000GX-L4 for guix-patches@gnu.org; Sun, 29 Aug 2021 06:47:07 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49946] [PATCH v2 08/33] gnu: Add tree-sitter-cli. Resent-From: Pierre Langlois Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 29 Aug 2021 10:47:07 +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.1630234020848 (code B ref 49946); Sun, 29 Aug 2021 10:47:07 +0000 Received: (at 49946) by debbugs.gnu.org; 29 Aug 2021 10:47:00 +0000 Received: from localhost ([127.0.0.1]:55566 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mKIL5-0000DW-LX for submit@debbugs.gnu.org; Sun, 29 Aug 2021 06:47:00 -0400 Received: from mout.gmx.net ([212.227.17.20]:52627) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mKIKi-0000AD-UI for 49946@debbugs.gnu.org; Sun, 29 Aug 2021 06:46:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1630233991; bh=4i+AH3M0k9oKHKFs+3X1xwXbyLuH32/cVilwNPVNRQY=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=e9Tv/uYIjU9g1ggu9OVghk2yRTjBIEQsCSDMdVhhB6AvAZAQs+V6b2CwtuFe4O+ia maYGNnn6XFYcKAuqdx3nSB2TW2I/8RymOEwFnAO5J9Pkx8ckhFEDnNW6okgXu7iyo6 eb6afp/tckes61H/KdgzjE4cBRe1HsP1qDcZ92Mk= 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 1MatRT-1mqc9603AJ-00cOLV; Sun, 29 Aug 2021 12:46:31 +0200 From: Pierre Langlois Date: Sun, 29 Aug 2021 11:45:43 +0100 Message-Id: <20210829104608.3103-8-pierre.langlois@gmx.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210829104608.3103-1-pierre.langlois@gmx.com> References: <87czpwzg9e.fsf@gmx.com> <20210829104608.3103-1-pierre.langlois@gmx.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:zFJqB2rzgksW3azCwFl2gh8ycTv3deOr8rydpj3DhHT40e5Y3MZ Vl+8woFMUECwH5pV9cz9oSkVXxFUbuc14KjRiEeCp/Ln3ZQQPBdo5exq8LbofFciWXPil2T yCBXO0St5Y9lpPxacVtQVtPCwS3xJuyeF2vtV8X/Nq0wdpmD2pvTNSV1PEBZ2rdh6HykndR IZKvw0w39BRgdmCj90lDQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:TTKHXMHE1HE=:mvo4JASSyrCHMBo9VFIwb/ hFSY6Y/yluoUbVHrSuToVeY4szWnCA3FuW2hTiHWOfbrpGvRXwvlqRBETuJIFDndaVydX8piv mVgkKUzV0eHAxNeWvRSKf+LZWoTEPqhFiuQ4oaHjI91uVmPeLlc8oWtqql+fS1kRlcw7i4Ojh S9qcTcj3YaVArOGzCe8F6NGft7sKcYHk4i2EtP+j5aSfLlh6rhD1+TG4juqj005FQGiMJS4Az MlQukARUJrsSA6VFg6QAncmbcYQQshfi8r1kWCBDjh42TB9cLEhtDXxo1GxbI7+f4wiQ8hOmm hlI4ZQURrDH058aZ8ruBWMvAZ2dATiBbBqiN2Lzu3krMggJUPZUdjU27O1FMbk1+M/Hc/m6FO Www58up+QbqxGzCAoIAzqGs2+ydZj6MCUSoKHzCpG33offLLlDJNRbJqGIbcgmcVZnrM7dkUh 3WHFYG2MHmZmjb4zxnR5fk1SEA1kRNRJFqXV8qsTVBG3y1Vda7AruEDVwdhpr3frY/qaQxdvS mr8v4cYX4PBrgmcRGTrIWLYr905oTPHmc7QmhtCtRBOJHoJBqUDXxKkaUh3RSAH6vZsCJ3cwP uUGQRcYjaGPmUErmBztbbF1k0xcCuBvsyZ5Bt+RR+MzqMYG+PcySdp+imkLPV9DSIlXiqPoHI XYtHYNzA5qCehn3E+30/Jn5wBjUntAsfYTXkFrBcJrojaniIyoCuvyRUkq05vJadhRSaRn7IW ahvT/kA8WY+R83+vukY1hk1zIZS9flYaOVIukzF2YiKYyyvCvdRUkuzrMzYEkoMp4EiEf4AAH aVsmEFCCoCSZZF5MK/ohK+7wrvLsjCDsMs5Eyjefnd9dgCaNwWCpXWbinEIzj4WKhay7R/SkO 63o//p7q2g07ugVVh9GYqOtvJ5L1EcovQ8JqooM37ue8pMQGHUtGUjLAxX9DW9bYpz8ySG+OL fWXLEB4vJBpMEaBMxqz2EnUpxOwct9iAa/oEO54Mkk049WmJFUH0wbapcvv/9EPiiyffu0G4I J0whSiWE/0qg7EGn15xhppaSZ6fX9EGDx0Tv043PnBcaWC44dbhdTwtH4+BPw8mCWKBCPWZnL 4+c8JPL4+p3mLddNZZTLl/UgFkRr9XPKN0APB5BtnsCiIrbGB+m390XxQ== 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=1630234228; 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=1wUUG1+kT1IBY4R1ihp2tw0PwG+Cp+Cs6nsHUXp46lc=; b=hfh97BKXyXALN59cNkOnEmP5MtbENRzvuq3i0IMckl59AqXPmyQRy3eTd948SkXHiNEzNm IwK3t9DJp+Hwktk1QPfD2VPiMvQ+2/uehEeBKhwiWLG94Pr0S1B/2plpj/13vD8nunwM4R F/usscnH473LmA5pYloNKDb6Pyrmk6ebEX3Ui8pqMvv/A2l5F0U/TUMTxL6Z649/OfnD8J NESJoz/gpJdPlBde3+5InRCw5y4prt94CKUBmtj2mJDMfd/ckGBsAbqmgjsMNZvCXY8koM agHP/kXu8XQmAAtBzjLRkn4tb/8fWvPmO3wEwtp9iqFXskPI6r1XQUoemI/3WA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1630234228; a=rsa-sha256; cv=none; b=rd1F2GufMlS1YLvWCRMYtyO6cT0RR8yo0ztk+buP6Gk5gaciu7GGv/f5CX9zNdlCoDMhYr 9lzvxjZ1CEfvNzQd9jR8LONbvAGWS55ZagWcBTbD8U93v/l5yAli76IEviC+T8cGkgSW4Z VuLWI0C35ClrBHZGydAzq94Q7pHdgk12uk+tMfqrN63NbqH++R+o8fWJNfUE7KXbSAxIH0 czyizF/ebGmBOLn+9Ja9LDDkyI0OFuuP+D8Q0K5hUUHF+uqzyGgdTMQSroAv2o6iukKDqY S7t7VbhxjlN6Cw/7rFnBebyWo0CcaJoaC5o2hWcCfmbPLnlsg3X3a+gnOtmj/Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmx.net header.s=badeba3b8450 header.b="e9Tv/uYI"; 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-Spam-Score: 2.17 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmx.net header.s=badeba3b8450 header.b="e9Tv/uYI"; 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: 49F1DFA67 X-Spam-Score: 2.17 X-Migadu-Scanner: scn0.migadu.com X-TUID: cYM3L8dCqYmq * gnu/packages/tree-sitter.scm (tree-sitter-cli): New variable. =2D-- gnu/packages/tree-sitter.scm | 61 +++++++++++++++++++++++++++++++++++- 1 file changed, 60 insertions(+), 1 deletion(-) diff --git a/gnu/packages/tree-sitter.scm b/gnu/packages/tree-sitter.scm index e6e66cd447..d8d4a305da 100644 =2D-- a/gnu/packages/tree-sitter.scm +++ b/gnu/packages/tree-sitter.scm @@ -18,10 +18,13 @@ (define-module (gnu packages tree-sitter) #: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 (guix utils) + #:use-module (gnu packages crates-graphics) + #:use-module (gnu packages crates-io)) (define-public tree-sitter (package @@ -71,3 +74,59 @@ can be embedded in any application. 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-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"))) + (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.33.0