From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.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 ENg3JoGZBWI7RgEAgWs5BA (envelope-from ) for ; Fri, 11 Feb 2022 00:02:25 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id cAWoI4GZBWLTAgAA9RJhRA (envelope-from ) for ; Fri, 11 Feb 2022 00:02:25 +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 4F3D93819A for ; Fri, 11 Feb 2022 00:02:21 +0100 (CET) Received: from localhost ([::1]:48648 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nIISC-0006hJ-H4 for larch@yhetil.org; Thu, 10 Feb 2022 18:02:20 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37280) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nIIQx-0005YK-Bd for guix-patches@gnu.org; Thu, 10 Feb 2022 18:01:11 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:35461) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nIIQx-0007OR-23 for guix-patches@gnu.org; Thu, 10 Feb 2022 18:01:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nIIQx-0001AP-2P for guix-patches@gnu.org; Thu, 10 Feb 2022 18:01:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#49946] [WIP PATCH v3 26/26] gnu: Add emacs-tree-sitter-langs. Resent-From: Pierre Langlois Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 10 Feb 2022 23:01: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.16445340484440 (code B ref 49946); Thu, 10 Feb 2022 23:01:03 +0000 Received: (at 49946) by debbugs.gnu.org; 10 Feb 2022 23:00:48 +0000 Received: from localhost ([127.0.0.1]:57589 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nIIQh-00019S-Fh for submit@debbugs.gnu.org; Thu, 10 Feb 2022 18:00:47 -0500 Received: from mout.gmx.net ([212.227.17.22]:42233) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nIIQf-00018t-2Q for 49946@debbugs.gnu.org; Thu, 10 Feb 2022 18:00:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1644534039; bh=Y0ruqogCZF6AfqowFM97UmFau0VQvx63bes3SYbLPDE=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=gjOXK+TNnlbloz3SoJ2xBPxtwDbxoTELoL5efJUg3W2IR95a8/krwC9grjrUz67YC G1BGKNpAPko9zWFSunexhpdmbUn4m5UPQnuUrbqoPGCH1oRC/emicP84ZhxOFHMKYV kUOFq+daq0E3G8z9cuGLvlOKnShsOqNv9gY0jAkM= 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 1N2mFY-1oIxZm3usG-0139fm; Thu, 10 Feb 2022 23:55:39 +0100 From: Pierre Langlois Date: Thu, 10 Feb 2022 22:55:27 +0000 Message-Id: <20220210225527.25189-26-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:2GGimL3vfqRQuOlDeoUhkwvlof28ls/CZZzMu8HfOqo4KnoqMds b2lWugzt45H71brnW9dqz3/GJQUMgSPKPU9rZ7kiyDeij+J+boqWvKUctjLkvg2Tb1762V/ B+Abi3wszLMnOclGf3VhOUplONpN7kBxawCJg9ECNVvkFu0ok4KwZm9Jc5TtTeM9NTqSxr6 vcWOTB5NOjmpY04HDElbQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:5HlD6LLeaqw=:tFaXn4B6uOJ6+fgbPRdJK3 /YAUnLOwAsNSwxyVB7aH9WpVepv1PVOBc1+lLTNS21iSufxRrQPL136RqjVX6oDfbrG7bmput dQIHz8gws2nG+aZeEoVG4KdOybtJAXZNm3lLk0oeC4EZkFCcJ16j92sg+TDB8TNBV7mEk4HJJ XRlrd+GJmkwakmq0Ai5bXdxlD50GNPTmyGM1nxzUxWEW/gyZBwuYj8evkbz+eTMcCLJcJdyuQ QOhGJsG+De3JqYE8aQVgsOWJcazokDrMt5GXj/hJicfouaYjvi0HkOnN0NiNAb189ix1eLkIC 6Lca0+ra3i2ExWURazewpLuLjjj+LoNLrGl5IG17vzmE/H32grhPnuST620/q85wBdB5xjcaS OnzFJ3k0NaXsa4WpUkQeecWZ9pakuGEWu/f5nZnArEcGAKHyvW63Qrc7LtR6pbmUff2yY4rW0 4+KCkNtgrDzKa15wwcyrdQolF65RYUeJBnHL4vIRfIQ3RBcV4HuXs0p+n3+ecdNAqDiZ6M/ew mNCH+/i+Vb4ReJysy+E3pfV/6lhEHsDDSvF7BewJEAuTzUn0I/0SM6vtorQYnGUVl7/15oXyO vPlaM9FLG979YLUey/Z9Ttq9t6yQT/am6AbuXKulROXXqY0EbT895viEW7EuQyEIR2ai7WRA0 xJcVIziDOptDw9vwsRiKE6MbprSoX2xHW42xEInrQ8pYH1wKR9RbIe4hxm3UQrLq3ts9DUQD2 +R0NHXPtGr9t67soH7ymzs4dTciziAZCFK+7WJPoJKao2KXvHDS9wzbp5HrIIqkYw9vWwmocw uQ0QFtxbFhQ8N2GkhwouuA1pXbajxRTktLuupNSzc2FfE3k1hY8s7vzG62FYsRElc6Xf/zJ8F FGM1Ia+tVVBR0kY6p3f1DOzZnS3x2vJuiuB92QR2CmB0mel4thv2wuGyiQNzAcObLinoVqpbQ 4rnuxxx2939dK/1zpLL1Qpxh8RQ8EF+iAWp4CqwRkZH4g6pMxEg/VqdKW5piJexCu6ZaEzMO0 +wG3AG2VSEpgYW7LGixvpOgm22sFA2iXBBLrhdNN3REo+goxT0uHA7QPllzGpWi2cy4dNKxO4 u0GVPWO295pplk= 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=1644534141; 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=Bqbvqq5KG3td9MJj1ra0ASMfYdAlPVQDjREf3S++ovY=; b=bZSUes7ZTUET0eAMep022pqJjb16h6HW6DPUyjG8nHwYyqzpQefg4wmsGdonwOVYIVC5hi 1LSdIZ+OKntkdrAIqfE+X7e4eMRrPT4gqXavPuwnE4u8z3ULdFsOjodiyc+S7+IPUw9PAs 7/SLGiA/MQAXDCrbAXzJA5PZ4yzvski+uU48yMrb3cNHNc82+bA/sNYrget7tcDs6znOOy gRp+XUoIL0KclHCC5/s3Yy2iGp1T+ORxopkH7Tb4OdO3l4p/I6WelMJ75+yb3dJg7Zqeaz f2kl0J+jR59hxPnNHbkP3KxxGrigkoI8DDns/SPugK8eiUC+BJOH5Ya44nfgqw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1644534141; a=rsa-sha256; cv=none; b=MIB2x5cWhrB8l4GatRyZUCbvjbc9jzeS7/j0D+CvXFTYzW+P5mEFB31+uOI0F6qpz1dsBT Tr+dcwNjo8D0kg+VP0tk7nWjOL+y/91sI/RQemfzywdiIC7Akr7sFS4jAKL9D7rSFXaO6f FbIQFbNidQjNJy5CKs+Xtf6YfLG6FE04/HPfgIKDiCTylNUh6zcgbYjpWKvsDB0l8G+Cap uNIkKMnJPEvQnrCqh07IJLK+iZLokiKxU8yIYT6ZNcHQCMqO0VdUmDe+TMEgGamO+N0or3 B1ndiJN1rV1aMOuNuSshJ9qnB3+g7VhCsmcCcMRf+Syee1WuxaNUp7YBIDKmyQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmx.net header.s=badeba3b8450 header.b=gjOXK+TN; 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: -1.73 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmx.net header.s=badeba3b8450 header.b=gjOXK+TN; 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: 4F3D93819A X-Spam-Score: -1.73 X-Migadu-Scanner: scn0.migadu.com X-TUID: Bv7izmlkkKnk * gnu/packages/tree-sitter.scm (emacs-tree-sitter-langs): New variable. =2D-- gnu/packages/tree-sitter.scm | 81 ++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) diff --git a/gnu/packages/tree-sitter.scm b/gnu/packages/tree-sitter.scm index b412f3d031..00b91f5c91 100644 =2D-- a/gnu/packages/tree-sitter.scm +++ b/gnu/packages/tree-sitter.scm @@ -725,3 +725,84 @@ (define-public emacs-tree-sitter @item More informative indexing for imenu. @end enumerate") (license license:expat))) + +(define-public emacs-tree-sitter-langs + (package + (name "emacs-tree-sitter-langs") + (version "0.11.1") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/emacs-tree-sitter/tree-sitte= r-langs") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0r3yw25czg1vcxk9015yd8p1n0z427z2l4hizfjy8w8jjjg7cxxf")))= ) + (build-system emacs-build-system) + ;; FIXME: Support for some languages, such as ruby, is still missing = from + ;; the bundle. + (inputs + (list tree-sitter-bash + tree-sitter-c + tree-sitter-cpp + tree-sitter-css + tree-sitter-go + tree-sitter-html + tree-sitter-java + tree-sitter-javascript + tree-sitter-json + tree-sitter-julia + tree-sitter-php + tree-sitter-python + tree-sitter-rust + tree-sitter-typescript)) + (propagated-inputs + (list emacs-tree-sitter)) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-before 'build 'fake-bundle + (lambda _ + ;; The BUNDLE-VERSION file prevents the package from + ;; downloading libraries at load time. + (call-with-output-file "bin/BUNDLE-VERSION" + (lambda (port) (display ,version port))))) + (add-after 'install 'install-libs + (lambda* (#:key outputs inputs #:allow-other-keys) + (let ((elpa (elpa-directory (assoc-ref outputs "out")))) + (mkdir-p (string-append elpa "/bin")) + ;; The BUNDLE-VERSION file prevents the package from + ;; downloading libraries at load time. + (call-with-output-file (string-append elpa "/bin/BUNDLE-VE= RSION") + (lambda (port) (display ,version port))) + + (define (install-lib lang) + (let ((input (assoc-ref inputs (string-append "tree-sitt= er-" lang)))) + (symlink (string-append input "/lib/tree-sitter/" lang= ".so") + (string-append elpa "/bin/" lang ".so")))) + (for-each (lambda (input) + (use-modules (ice-9 regex)) + (cond + ((string-match "^tree-sitter-(.*)$" (car inpu= t)) + =3D> (lambda (m) + (install-lib (match:substring m 1)))))) + inputs)))) + (add-after 'install 'install-queries + (lambda* (#:key outputs #:allow-other-keys) + (let ((elpa (elpa-directory (assoc-ref outputs "out")))) + (copy-recursively "queries" (string-append elpa "/queries= ")))))))) + (home-page "https://ubolonton.github.io/emacs-tree-sitter/languages/"= ) + (synopsis "Language support bundle for Tree-sitter") + (description "This package is a convenient language bundle for +Tree-sitter. For each supported language, this package provides: + +@enumerate +@item Pre-compiled grammar binaries. +@item An optional highlights.scm file that provides highlighting patterns= . +This is mainly intended for major modes that are not aware of tree-sitter= . +@item Optional query patterns for other minor modes that provide high-lev= el +functionalities on top of tree-sitter, such as code folding, evil text +objects, ...etc. +@end enumerate") + (license license:expat))) =2D- 2.34.0