From patchwork Fri Feb 17 12:37:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre Langlois X-Patchwork-Id: 47034 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 DF89E1693E; Fri, 17 Feb 2023 12:39:03 +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=-3.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,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 50DE0167D0 for ; Fri, 17 Feb 2023 12:39:02 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pT005-0003j7-J9; Fri, 17 Feb 2023 07:38:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pT002-0003bS-Tg for guix-patches@gnu.org; Fri, 17 Feb 2023 07:38:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pT002-0000zS-JY for guix-patches@gnu.org; Fri, 17 Feb 2023 07:38:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pT002-0001I7-Fn for guix-patches@gnu.org; Fri, 17 Feb 2023 07:38:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#49946] [PATCH v8 3/7] gnu: Add rust-tree-sitter. Resent-From: Pierre Langlois Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 17 Feb 2023 12:38: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.16766374594872 (code B ref 49946); Fri, 17 Feb 2023 12:38:02 +0000 Received: (at 49946) by debbugs.gnu.org; 17 Feb 2023 12:37:39 +0000 Received: from localhost ([127.0.0.1]:38699 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSzze-0001GV-Ug for submit@debbugs.gnu.org; Fri, 17 Feb 2023 07:37:39 -0500 Received: from mout.gmx.net ([212.227.17.22]:54169) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSzzW-0001FG-Vf for 49946@debbugs.gnu.org; Fri, 17 Feb 2023 07:37:32 -0500 Received: from localhost.localdomain ([82.69.64.142]) by mail.gmx.net (mrgmx105 [212.227.17.174]) with ESMTPSA (Nemesis) id 1MiaYJ-1owOSw0TsF-00fgM1; Fri, 17 Feb 2023 13:37:25 +0100 From: Pierre Langlois Date: Fri, 17 Feb 2023 12:37:18 +0000 Message-Id: <20230217123722.15143-4-pierre.langlois@gmx.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230217123722.15143-1-pierre.langlois@gmx.com> References: <20221125012142.22579-1-pierre.langlois@gmx.com> <20230217123722.15143-1-pierre.langlois@gmx.com> MIME-Version: 1.0 X-Provags-ID: V03:K1:e4UooE3z0hKF7C3PBzeLAEk9J3Vy2iQD3b158aKcD4zMjWFris0 kS3lOhr1M/8kTUL9rkZZSB/kt0DX3J20SOwTmxNl024m7Bg6xPr/twvhTmPZ+pRyQ/gOJ2z 6bRq21JikO7HEpHf35HdaWUuLRpFwMC8Aqa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Bc7X0dSduIMrj49jzWkcpy8SQ= 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-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/tree-sitter.scm (rust-tree-sitter): New variable. --- gnu/packages/tree-sitter.scm | 37 ++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/gnu/packages/tree-sitter.scm b/gnu/packages/tree-sitter.scm index b202ebf4d3..7256ad02e4 100644 --- a/gnu/packages/tree-sitter.scm +++ b/gnu/packages/tree-sitter.scm @@ -30,6 +30,7 @@ (define-module (gnu packages tree-sitter) #:use-module (guix build-system cargo) #:use-module (guix build-system gnu) #:use-module (guix build-system tree-sitter) + #:use-module (guix download) #:use-module (guix gexp) #:use-module (guix git-download) #:use-module (guix packages) @@ -188,6 +189,42 @@ (define-public tree-sitter-cli This package includes the @command{tree-sitter} command-line tool.") (license license:expat))) +(define-public rust-tree-sitter + (package + (name "rust-tree-sitter") + (version "0.20.7") + (source (origin + (method url-fetch) + (uri (crate-uri "tree-sitter" version)) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "183niy9malzr4dm81swcgl05xkwqamim6ck0gw5xb6k78nprz6jl")) + (modules '((guix build utils))) + (snippet + #~(begin + ;; Remove the runtime library code and dynamically link to + ;; it instead. + (delete-file-recursively "src") + (delete-file "binding_rust/build.rs") + (with-output-to-file "binding_rust/build.rs" + (lambda _ + (format #t "fn main() {~@ + println!(\"cargo:rustc-link-lib=tree-sitter\");~@ + }~%"))))))) + (build-system cargo-build-system) + (inputs (list tree-sitter)) + (arguments + `(#:cargo-inputs + (("rust-cc" ,rust-cc-1) + ("rust-lazy-static" ,rust-lazy-static-1) + ("rust-regex" ,rust-regex-1)))) + (home-page "https://tree-sitter.github.io/tree-sitter/") + (synopsis "Rust bindings to the Tree-sitter parsing library") + (description "This package provides Rust bindings to the Tree-sitter +parsing library.") + (license license:expat))) + (define (tree-sitter-delete-generated-files grammar-directories) #~(begin (use-modules (guix build utils))