From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id ULD6BHt472OBegAAbAwnHQ (envelope-from ) for ; Fri, 17 Feb 2023 13:52:11 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id KIPSBHt472OT6wAAauVa8A (envelope-from ) for ; Fri, 17 Feb 2023 13:52:11 +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 AD48A10866 for ; Fri, 17 Feb 2023 13:52:10 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=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"; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmx.com (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1676638330; a=rsa-sha256; cv=none; b=Cn090DDrKdGsRaG8163VdckhTPKKkp/bPUfuFRZmGygF9DKdnGVceF5ngyi2aeD6+9Bn+R uXtUhnr0hN35e26VebhGMy9uFDvqn/qQ6ZunhrfM/t5GB3eqWAOzZFXXU4fvDLjO78O1Pv yZKfMakeRZ+pAh/C0OMAFChVDSRzgdNOph366I7SYodbE0HJ6W5p8nJ2ZpCAXwGDIFoXAM iy78waahN0PQURf5HNoASDO8cKb40BFewjT0Utk7o6OpV+yQlrdNq8zdeatPED9F1cIPkf NJcM/s78T8Fpp0J3tmB2dVM2+bNWq/kNWx2BYCoSdyV6OWoDSJnaUkD7WRybTg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=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"; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmx.com (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1676638330; 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: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; bh=lDCT70L2tQZ8vYAoBHblz1N9HuDmmWr59UwnKDN8Y0g=; b=iM4f1w5+ENRDRpwef9DNZOU7an6DhPWeXe2LmCRIBZFVSLeJ9C44ppLtvw2volMNZ039c0 BG2wS+Qk1lVvV0flQWX+Cz5Y5lB/9cTHrot4k31DT+WIQaMjESSdj1PWn9n1ysy742x5m+ USYjqaD7Z740GfyoGleCjMCw7XBoFjTiRAMSt3WPqrFzBpGky0s6V6gIUNCPpbBiEKYLtf CFoOy/d0iCnv1zqIFT1XoZGAdc09q66C48FFjrgfVpCVhykYqsHiJd8jW36CUA76i8ARoV XLd6lBSkhZRd47lVk8y1eOQZKaGq4YXySg6ScE6VdhUi1Jkn+HZsIbr6nHvoOw== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pT0Db-0008GW-Fp; Fri, 17 Feb 2023 07:52:03 -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 1pT0Da-0008Aq-F3 for guix-patches@gnu.org; Fri, 17 Feb 2023 07:52: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 1pT0Da-0005IB-4f for guix-patches@gnu.org; Fri, 17 Feb 2023 07:52:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pT0Da-0001iL-1A for guix-patches@gnu.org; Fri, 17 Feb 2023 07:52:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#49946] [PATCH v8 5/7] gnu: Add emacs-tree-sitter-core. Resent-From: Pierre Langlois Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 17 Feb 2023 12:52:01 +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.16766382896548 (code B ref 49946); Fri, 17 Feb 2023 12:52:01 +0000 Received: (at 49946) by debbugs.gnu.org; 17 Feb 2023 12:51:29 +0000 Received: from localhost ([127.0.0.1]:38750 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pT0D2-0001hY-QO for submit@debbugs.gnu.org; Fri, 17 Feb 2023 07:51:29 -0500 Received: from mout.gmx.net ([212.227.17.22]:55257) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pT0D0-0001h9-1j for 49946@debbugs.gnu.org; Fri, 17 Feb 2023 07:51:27 -0500 Received: from labiere ([82.69.64.142]) by mail.gmx.net (mrgmx104 [212.227.17.174]) with ESMTPSA (Nemesis) id 1M8QS8-1pXNvb2mci-004Q9Q; Fri, 17 Feb 2023 13:51:19 +0100 References: <20221125012142.22579-1-pierre.langlois@gmx.com> <20230217123722.15143-1-pierre.langlois@gmx.com> <20230217123722.15143-6-pierre.langlois@gmx.com> User-agent: mu4e 1.8.13; emacs 28.2 From: Pierre Langlois Date: Fri, 17 Feb 2023 12:48:03 +0000 In-reply-to: <20230217123722.15143-6-pierre.langlois@gmx.com> Message-ID: <87sff4tpyz.fsf@gmx.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Provags-ID: V03:K1:OIfNoPBOIzY2pnztwDAwpBtUB7bzuYtQgmNw0riq9iP8wxvJ5B3 1PxQkmK/Qp2uWY3ytQy4reywWuPDZMlVdQQ0nejLDlhPmst5eFVjjv4fUDG/Pk6ScMdSy30 2xJs/MnFHWPOGDWrxxDMlfmZKs0YrOzMoznpR07ZNjCjm7NrtbTTsuXOyUdEDIEO3pa3mUZ j+DGs8AbyPeOOpoq+takg== UI-OutboundReport: notjunk:1;M01:P0:J6rF/fTIX/s=;viJ3q59PhOq2HVPtuikP9f1+and 1UELt1qoZbE5SxzGpXmuP9BbDA2itARirh9PMfLSC//VnnbCyO6HaIlfJExZi9bQJX8r2923U M33AWfkJfO8ejxXdwghq3rPKRp4qC7H7iSxXo/ZaA4OSApsgK5MBRcWxwcl0A5K9m1qPXipw1 NHuevk0vFlcz8yuDCwbbgfC09eVMq3gdU+xN0r+QBePdHec9kgLV83SIykrPyWVuz9JDU6wmq uFALUO21j3XirMUk6gASJzMIaTy0zTa7BnIHX5JcKsMfySy+p/xIqcKf9Su2ErHQXJ6xjVwxt GAHZ1keHWSI4DoTPvTl7L/DqhmCXXL6PbrrN1yAcyoXsIzoq4ynjmVlP2Kd6/RXMig7UTy4CH PyLTqxxEmWGGVgSHlFNP84mddNyM8nZbUxyaJYxG6IGAl51XEJMPBkGeSQVDpI1WR4bglg6Yb AXQ90nKeRCb959wY6ZE2MXAuI8nncr7YYk+Gm9MsHqC2kxZnoOXBMo3M63RPSpJTGwNmv8+wP sWbAFq97k9q1qaUCBMXvnD/thbRQ9tL9OrDtj/5gQp5mdUb2XAL7XFRzJIGQt6jkQtVymenEt qPJPZ/2e0nyih3QRAAe1IZSjonhl+L008jd0JmhUMVyJ4dwBXOvpq0gY1bi2tZe3swlTkFGY1 cNnxe+D44/1FXwGjjf56PBsSeO2E9y4TwAoa8nhbhNwXLVgpTXPbeoWlLjRLYj8FLb8Hd+/Zw eTMC5X7bB9wDTB7a4dq1JuLZvEBVnvHhtiHs7r1vohgSXntceOWxWe0zPJKD2nxt2UJX1hy/P aJJA6nm0ZRWKUOuHPBRhsK73vTpwKp6Cga5cQfpC/k+u1nsA7Y4Ti6yX+/b0c+JvjpXp4LuPZ 1zNBTGNB8JWYmhmiRDKbXTe8y+7Hh6rg3rthTwGcAwPdDpqjpXc0Vh0QW/pQZzj+7KqjqBYzF W6gdM6NXAjTuaHoxigcaSWU92ko= 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: X-Migadu-Queue-Id: AD48A10866 X-Spam-Score: -6.13 X-Migadu-Spam-Score: -6.13 X-Migadu-Scanner: scn0.migadu.com List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-TUID: +IguFn48D9Jx --=-=-= Content-Type: text/plain Pierre Langlois writes: > * gnu/packages/tree-sitter.scm (tree-sitter-emacs-module): New local variable. > (emacs-tree-sitter-core): New variable. > --- > gnu/packages/tree-sitter.scm | 85 ++++++++++++++++++++++++++++++++++++ > 1 file changed, 85 insertions(+) > > diff --git a/gnu/packages/tree-sitter.scm b/gnu/packages/tree-sitter.scm > index bb9972cb00..12f2d108d9 100644 > --- a/gnu/packages/tree-sitter.scm > +++ b/gnu/packages/tree-sitter.scm > @@ -29,6 +29,7 @@ (define-module (gnu packages tree-sitter) > #:use-module (gnu packages icu4c) > #:use-module (gnu packages node) > #:use-module (guix build-system cargo) > + #:use-module (guix build-system emacs) > #:use-module (guix build-system gnu) > #:use-module (guix build-system tree-sitter) > #:use-module (guix download) > @@ -538,3 +539,87 @@ (define-public tree-sitter-racket > (git-version "0.1.0" revision commit) > #:repository-url "https://github.com/6cdh/tree-sitter-racket" > #:commit commit))) > + > +;; Local package definition solely for building the native emacs module > +;; written in Rust. > +(define tree-sitter-emacs-module > + (package > + (name "tree-sitter-emacs-module") > + (version "0.18.0") > + (source (origin > + (method git-fetch) > + (uri (git-reference > + (url "https://github.com/emacs-tree-sitter/elisp-tree-sitter") > + (commit version))) > + (file-name (git-file-name name version)) > + (sha256 > + (base32 > + "1sdvz827v436qijs6xafakkfw2d16bvp8frymd818rppjc7a9dif")))) > + (build-system cargo-build-system) > + (inputs > + (list tree-sitter)) > + (arguments > + (list > + #:cargo-inputs > + `(("rust-anyhow" ,rust-anyhow-1) > + ("rust-emacs" ,rust-emacs-0.18) > + ("rust-libloading" ,rust-libloading-0.7) > + ("rust-once-cell" ,rust-once-cell-1) > + ("rust-tree-sitter" ,rust-tree-sitter-for-emacs)) > + #:phases > + #~(modify-phases %standard-phases > + (add-after 'unpack 'chdir > + (lambda _ (chdir "core"))) > + (add-after 'chdir 'delete-cargo.lock > + (lambda _ (delete-file "Cargo.lock"))) > + (add-after 'delete-cargo.lock 'do-not-fetch-from-github > + (lambda _ > + (substitute* "Cargo.toml" > + (("\\[patch.*") "") > + (("git = .*") "")))) > + (replace 'install > + (lambda _ > + (let ((lib (string-append #$output "/lib"))) > + (mkdir-p lib) > + (copy-file "target/release/libtsc_dyn.so" > + (string-append lib "/tsc-dyn.so")))))))) > + (home-page #f) > + (synopsis #f) > + (description #f) > + (license license:expat))) > + > +(define-public emacs-tree-sitter-core > + (package > + (name "emacs-tree-sitter-core") > + (version (package-version tree-sitter-emacs-module)) > + (source (package-source tree-sitter-emacs-module)) > + (build-system emacs-build-system) > + (native-inputs > + (list tree-sitter-emacs-module)) Wait, I think this should have been a regular input, not a native-input, otherwise it'll break if we ever add cross-compilation support. > + (arguments > + (list > + #:phases > + #~(modify-phases %standard-phases > + (add-after 'unpack 'chdir > + (lambda _ (chdir "core"))) > + (add-before 'install 'find-tsc-dyn > + (lambda* (#:key inputs #:allow-other-keys) > + (let ((module (search-input-file inputs "/lib/tsc-dyn.so"))) > + ;; Install the tsc-dyn module in site-lisp and the current > + ;; directory for test to pass. > + (install-file module (elpa-directory #$output)) > + (copy-file module "tsc-dyn.so") > + ;; We replace the tsc-dyn-get.el file with an empty stub to > + ;; prevent the code from downloading the module. > + (call-with-output-file "tsc-dyn-get.el" > + (lambda (port) > + (for-each > + (lambda (sexp) (write sexp port)) > + '((defun tsc-dyn-get-ensure (requested) > + nil) > + (provide 'tsc-dyn-get))))))))))) > + (home-page "https://emacs-tree-sitter.github.io") > + (synopsis "Tree-sitter bindings for Emacs Lisp, core library") > + (description "This package provides core APIs of the Emacs binding for > +Tree-sitter, an incremental parsing system.") > + (license license:expat))) --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQFMBAEBCgA2FiEEctU9gYy29KFyWDdMqPyeRH9PfVQFAmPveEQYHHBpZXJyZS5s YW5nbG9pc0BnbXguY29tAAoJEKj8nkR/T31UvgAIAIGI9qpyfnkSFMMdo9vduDxa X+e+0p8MxMjx/vBdHY322TYbKE0nFObTTt45clczxVrhDv/zq97VqSHyF0l1O5nr 0w7IztFyhml01PLMmfxBOuMnZO5cREglvC9Ev9CIDLNfPEzFRlPliG2VbMK3L6RX lx+Yf3a7FGxhxSvmy4bAPzEPofayoui4DyD/4Tb+ShvLict5i8Xq1YwuTYZ/y0oS Gp1Gkv6vERZn4l9BFBLqGRR1OSqdC+SmqQ0Cv9vMj0GXLns8cFGfspYrA87KmwiT 8Q/pCPCqQDBdLcdxX1yckC7JYRLOJEtBZKkJmUZtlpw5sfYvRALzwugtRKJRgOw= =q6wG -----END PGP SIGNATURE----- --=-=-=--