From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id sFndMSCYBWIFTwEAgWs5BA (envelope-from ) for ; Thu, 10 Feb 2022 23:56:32 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id QCcyLyCYBWIHqwAA9RJhRA (envelope-from ) for ; Thu, 10 Feb 2022 23:56:32 +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 59F6433E0A for ; Thu, 10 Feb 2022 23:56:32 +0100 (CET) Received: from localhost ([::1]:38792 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nIIMZ-0008H3-JB for larch@yhetil.org; Thu, 10 Feb 2022 17:56:31 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35974) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nIIM7-0007jm-Uw for guix-patches@gnu.org; Thu, 10 Feb 2022 17:56:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:35411) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nIIM7-0006JF-Bj for guix-patches@gnu.org; Thu, 10 Feb 2022 17:56:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nIIM7-0000wr-BO for guix-patches@gnu.org; Thu, 10 Feb 2022 17:56:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#49946] [WIP PATCH v3 05/26] gnu: Add tree-sitter-cli. Resent-From: Pierre Langlois Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 10 Feb 2022 22:56: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.16445337453502 (code B ref 49946); Thu, 10 Feb 2022 22:56:03 +0000 Received: (at 49946) by debbugs.gnu.org; 10 Feb 2022 22:55:45 +0000 Received: from localhost ([127.0.0.1]:57514 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nIILn-0000u4-8p for submit@debbugs.gnu.org; Thu, 10 Feb 2022 17:55:44 -0500 Received: from mout.gmx.net ([212.227.17.22]:51965) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nIILi-0000rx-8G for 49946@debbugs.gnu.org; Thu, 10 Feb 2022 17:55:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1644533732; bh=nK+Iy+tq5s20cNQVc+wvmkuOaJHEMoNfBDAnxqtpde4=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=S3rUIrxp4At9v+HpjOz0pvIAsvWGbOqMEEnDg6dlILZ4Ium0xhMQ2RjGQQGAY3oso YgA9PUm2Twezqz8Pwi/vaN9cPiel18JXH2f5m9HbxweRuyZ2gDws8BhPK/a3xQakRv jZLFUtHXIg3kDnpf0BR1Chxp28ohIbTUBbvzGdbQ= 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 1M7b2T-1nNVPt1VZl-007ydm; Thu, 10 Feb 2022 23:55:32 +0100 From: Pierre Langlois Date: Thu, 10 Feb 2022 22:55:06 +0000 Message-Id: <20220210225527.25189-5-pierre.langlois@gmx.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20220210225527.25189-1-pierre.langlois@gmx.com> References: <87leyinxly.fsf@gmx.com> <20220210225527.25189-1-pierre.langlois@gmx.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:5zk0mTCX2rPav7RhVfT9jgPTrLqUa5TjuhuWnaW2sHEj8c/xZdQ /mqH8Fwm/5Nr39XW3KEQF/MUhYsC8JTL1JEzOUQXfJlo5iFb2HjsSw7rFjJWzkQGox3V+36 p5YMh0NXNeEaOPrxjXBiuE3BifX/3DhmrT5O9jZIQUw1S5paMrIv+hgom3vEimC1w37msor rKTD8Z4+kk+dQk8uqqZtQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:JbA/LCthomQ=:nfTwbWpFk5d0MRDmvSAnp/ LMadGJoH/jXPsD8nvWXBCXVOwYq3xRe2MZOjkYFsVjyxtYg/CAkJSwXKXOEjnZNbmFUYgehWx 87XB6RMTXyYxuhZNfEDhyBOJpSZbMBI9oE3osQcnwXKo+/YBs0uicCeE7LZVckhS8zZOVrrDg Wi5b2V2A2fD8R+oFLHl3qLFIgpM4DXcujOkyifgV1avmLE3eDikpdcEiocY3BEBoe98YselOC tyupEJV/A9v8OythVLxMrgvakJxvSM6okXpvrLGuoziDoCBVJDK8YEqOduK6fTXsK3A/s3+ji 4cd00Rp23e+ODq9372EtczdE+4dj/azPHsNCyU8m+OxHXuZHiY7qoTRzP1Xpbp1cmN68emSOn T+uuRq6fUrQzHsNXwux0eP9j1Tc2MD56WeGm0L7yo+TjmyIlhxRvxk4CGTM9vgz2P9HQglaBx eZszkvxjuziAfamU/mfF1/h6JG9utTJziP8tc4j70SSUinWRVsak2gO4UhpEfIrF9Hnyvk44u 1UtU3xBBR3GscCCpYC1320D1hlyOwiY3NcyFtgFzwDTGDT2wF96H8KSBQI2L/srgFtAa0rmQ4 cApbEy+gsxupDI8DxRWjWxV2D03yx81+STE8F7igQwKw9SN/aJAuRKF6hCT8YaG0lFtaIrw4m uPSfp+FFTlCSdQXg4JA/RPauARzV0fUMpN3rsQmx8OcHbaymxRg25gcLS92G3D9XuO5fJTxz+ q3AbJqGqDm16VLjVn0Osde5HptzQ6bRFCds0a1bRE2xx40NjrU29hin+k6xUMRljo1+Edmwxn SAf9K0GH3O4+LGh5Ai7BtAPuL/KO1vYWsEAcyyc+Cl59arfnCfvYqNAgaYReGGS4Ep8GgvvnM NbKEYpx+xLdeZjn9wADAbl5Ewrk9oOouwip/VICQALPeUBd2eDfL9g18ZKVsfARUHHsXi06zc T4zC/F1WurtvhSITw6buIaOn4HaVFbtjdij/w1szFgLkTL9kg7tYtwMxS2PozchvS6Tj7dozv hrAVZPCEsaEAa7HWjHZAX/7Bf5rR9FH8U5db7L6PempBwTgc5FKcMBA6m36XTe0WYP7eKlQ+o fNsz7neCMg3Fvo= 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=1644533792; 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=Ri9KcFcKIk7vxrnOAOMfTn8HE4sMuu0akw2Q6xvsSoE=; b=bN2OEpzdR6ln84OX7K6jfJWs+kF+EIavrJpIE/3ruCg10mCFsHO2csk2+M0xFbU0BzxM+8 4SKFWg18cfxIyTCIRU6MGWKF6Z1RuzyYbUljPRDgPdCKbhzUTKg4PjwepliqyfDLsbyTVZ YEELYluTdLS6I8GxwUFfxjrpwXBIPsR+nQH+wHpXizT3OQAboSJCdF+jSdhElkvQU4qaaT 7TAUeYQRrbpgGH7fDVtmhgmXd6LOc+Hju6NR/Gdk8KbF6+YFAHpJ7gvmqgMjK22SUADI8t tkjbbO785xaUOzXra4UiayJZUmqNO0YhFrLdwuJBIYL8WDc9iwbqebTzkuPgzg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1644533792; a=rsa-sha256; cv=none; b=c/7EYpQPq1AokG1mydBe9yl8VLTONgikBQz8xyCp0UtTTc0Zgwd1b+IMYOXK9EdVn1D3Uu O4VEloDURwD2IlHD4f1b7tJV93JK5QPoOAOxnL61o6AKpHSZigCzfj5SXm74LlwI5PzoYw MMK271x81fXZMlqtOMJdujSOQv7RB/GTLO/hHdkqVdZBykp5tsCb3pH4Pb2AVOEtFEhRpF e8j5NEzpAB4D1cS86gZUdvT+waW5vptugg8xOiqVqBNK4AuGCRxCPCK+427E9UqDAxVmrh oa0VG9mjhqT0mKhDuVbSoRT+kYMfPdjUiBLvGvLxoyQg6S7FDcrENK4lNJYf9w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmx.net header.s=badeba3b8450 header.b=S3rUIrxp; 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=S3rUIrxp; 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: 59F6433E0A X-Spam-Score: -0.63 X-Migadu-Scanner: scn1.migadu.com X-TUID: MdqU//dl+lRZ * gnu/packages/tree-sitter.scm (tree-sitter-cli): New variable. =2D-- gnu/packages/tree-sitter.scm | 68 +++++++++++++++++++++++++++++++++++- 1 file changed, 67 insertions(+), 1 deletion(-) diff --git a/gnu/packages/tree-sitter.scm b/gnu/packages/tree-sitter.scm index e7d2ce113d..c2919e76b2 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 (guix utils) + #:use-module (gnu packages crates-graphics) + #:use-module (gnu packages crates-io)) (define-public tree-sitter (package @@ -74,3 +77,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