From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:c151::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id JaYvOHlnK2GidAAAgWs5BA (envelope-from ) for ; Sun, 29 Aug 2021 12:54:49 +0200 Received: from aspmx2.migadu.com ([2001:41d0:2:c151::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id OFtXM3lnK2EDHgAAB5/wlQ (envelope-from ) for ; Sun, 29 Aug 2021 10:54:49 +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 aspmx2.migadu.com (Postfix) with ESMTPS id 82C951D6EC for ; Sun, 29 Aug 2021 12:54:49 +0200 (CEST) Received: from localhost ([::1]:45920 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mKISe-0002kP-KW for larch@yhetil.org; Sun, 29 Aug 2021 06:54:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40846) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mKIQx-0000YD-5S for guix-patches@gnu.org; Sun, 29 Aug 2021 06:53:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:44113) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mKIQw-0006ng-TM for guix-patches@gnu.org; Sun, 29 Aug 2021 06:53:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mKIQw-0000TE-SD for guix-patches@gnu.org; Sun, 29 Aug 2021 06:53:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49946] [PATCH v2 33/33] gnu: Add emacs-tree-sitter-langs. Resent-From: Pierre Langlois Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 29 Aug 2021 10:53: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.16302343491742 (code B ref 49946); Sun, 29 Aug 2021 10:53:02 +0000 Received: (at 49946) by debbugs.gnu.org; 29 Aug 2021 10:52:29 +0000 Received: from localhost ([127.0.0.1]:55654 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mKIQO-0000Rw-S1 for submit@debbugs.gnu.org; Sun, 29 Aug 2021 06:52:29 -0400 Received: from mout.gmx.net ([212.227.17.22]:50447) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mKIPh-0000Oc-Ft for 49946@debbugs.gnu.org; Sun, 29 Aug 2021 06:51:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1630234299; bh=hGsmnd70jNnqpUrvdvObgDfxmqpXI+UeJO6gkV7J740=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=ZSMI8jmWhscB6Pm65dUrcruADicSrBK7ARXYYhkeQtBEU+PfBo1d/jgkC/SGR2bu4 Xph8UkiAFeM0r35BBO2oHQeZqP8k9ngDx4AdR3KNb+krzzMC4EnouZXiQ+wWUj6JU2 G4B2mH97K6+xXC7LaPkHeuugC2NsIiev+vNdh32o= 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 1MKbkC-1majHn12U8-00Kzej; Sun, 29 Aug 2021 12:46:39 +0200 From: Pierre Langlois Date: Sun, 29 Aug 2021 11:46:08 +0100 Message-Id: <20210829104608.3103-33-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:Efu7kQ97ARUSCVvEnLTYntxq56k1eECu9p+zwYs/qH3zRDi/0ce OMsfBYxw6TBh+lG1i8iVdzIvxJEvzSFcJn0XJTFLUsrH5pdIKjyH9NsFpQ7zgeuy6xYol79 ymO16udXVe1TW5r473aejQhp8+jZVrbP10Tk1TVwBGj665H0+wLVEZ2PBx44RGrIW9J+sGE Cx0rRLaVVSORsJ1EoRcQw== X-UI-Out-Filterresults: notjunk:1;V03:K0:nq0dePAl09o=:9j2GbvSTyLXuKssbQ0lc09 nMa+/EAQrVYw+yCxFxvW00fQR+ncnlwTTUSabxt5+jA1cyY+Fz1rjaLwJjSmSP6Eq30M3nhsU p4akchvDI+Zl6IHNa1YfabwEP3nFVdzTIL7AkS6lTvaPNitD0wd+caz67P/0PiPRDqxkb2aT0 /S5ArETvvg+LDBk6x1u7BvqHorf9siPxVUl9UJ0hwqE50eFIWS8DCh9u4RzJAjotCafCgMN0q B72y0kPcdp6cdlb5X9H4AktMWIz7zlaH0OhjnDbEJgGhlO1PClAe6rlkVhvC4zVWkkx8dkuar 75GzWWTg6XUJ6YZBo/6BN1yaMFVS6q4T2sRFq6cDkAtWMDsBqNiglFVDLSb5CmMZ7Pt33bGoq et5mEI5CO+4OI1sswjwgBd3/s4E7nqVuyPwDo+3aB82Lvi8pVVJCqS5UcZ9jMx9JmJps3AbBf uWD5rLSNfURYvKh/vp8THBTRl+v73WFrrL9OMgO/KtMXGSW9UdIGN5aBilWguPj1hBAJDG3c+ tbcZzbmX051jtsP9sETI6ydva+XMzO+0TaCoAu69BZj+3ZgO3uZ17IzMugEbWU0M8xYtMx3xw 6aKVLutNlJomitYVj6LhYZ77gObs//krskHyN+renxyPocb3YnptbRzkpY0YxZ7uZiiyButtT pC8uLbHwrSsvxFq9abdRoPxnx6UuVjjmdhnf9eVgT7dH6S3KgoMZnk6Gj4a9kyUW69i/X4IAq COTf+gzysDIrpNIHsGZSQZDncAYNeNmV3kybQATRSbrE12y6VA7aIQrqyf9eAKIqbq7+UE5t9 wB8mc2qp+ddVjtOv16b9p54mO0ORxaZVDHTAlX25uVT4px1Z0XR+1+thBFBqfSrMIQ7S6pubJ A2ecwXt1mAVUZkv8pbgfaWwFmxLfsMv5yC1AJTwWz5tfRos+hGWG23TaQSxqVHYV9EKMFJ98G etyM/Bq4IIXyljUSYwhxEwgxyWgRuUTsr6PEIu9Th8aJwnJCWhZr5JiE6rmQA+XUjQOvYueJ9 Bkp+nHgBfO1UptfBFk/GZD7BWV1bItfUpaNs3I7MGTOe8+KHFDedtyicuNXeIBJh+hScdBZBJ 6KToA16CHwDo/nDLs2JT2g7cr4Mv4MYUAQs11WfLt5fJU2ry3mBHnZplg== 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=1630234489; 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=nBBVcu+w9UPwpj6UoC1APj/tOxT41fA3+XRQ3fShCjw=; b=etV48LWLdMS2ez4AsFJ5FpfRNPp+5Tsf6/6trXKjydNRP0VkRp4pb6l0DacAfyLqDCx+PG PiKPiv/fY29MiZKAr4Kz6SFoTgHVGelUqOuztUdUTJpJD7mRmaziC+Yq/7vDjbB36QIaTL HBio3aNR5El2S3RFFScgAMMDhHc//rOnW2SaAPVch62ntb2asTOh6ghRMfYZeNOqGa5fvL AACpGYJ8g8Fm5/vnoiKy0pNLZuVHATPK3AtsyNTsoNAJ+CHLwI8En0+gd1345UeBFRcIYO u/+k5L74u0vhoOZdP5e0udWB/8xW7rtJ1zpnZceFXukEh//dF4/pLqCx6t4pfw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1630234489; a=rsa-sha256; cv=none; b=bJqi0EB0ZorYyHb69Sl1gbRAsWkF1SDpC46M5WI2Ep77kuDRrlBXqDKe9hHCPjOUtyP6CX r5g2l0pvYvFOUbG6dGxnPQ+Bw2SKdrxRv9mgqIXlgIzzxcUL4GqzOW5sjKgJ1z5A3wD5HP NepS5oCII5m0EK2QKGZil27FXcB53/gaWjFXGCivwz85TE0VQLOKjv48qz2xi4mF/pBhu2 lK7FwOKPbGjAMaBEtsqJR1Cu5n/RC4IA/eLvQ2spsXLY2zSKev4UvA2j4kNxX5paaulwcr TJk7XyKLVXv3T2QGLTs5zU8WT9ifxv/9C+wbDXdFzdC9bY6XaEWyS05ZBQKGRA== ARC-Authentication-Results: i=1; aspmx2.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmx.net header.s=badeba3b8450 header.b=ZSMI8jmW; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmx.com (policy=none); spf=pass (aspmx2.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: aspmx2.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmx.net header.s=badeba3b8450 header.b=ZSMI8jmW; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmx.com (policy=none); spf=pass (aspmx2.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: 82C951D6EC X-Spam-Score: 2.17 X-Migadu-Scanner: scn0.migadu.com X-TUID: RIeWYs7QhEr4 * gnu/packages/tree-sitter.scm (emacs-tree-sitter-langs): New variable. =2D-- gnu/packages/tree-sitter.scm | 80 ++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/gnu/packages/tree-sitter.scm b/gnu/packages/tree-sitter.scm index 0454d75ad4..6bb52b68ac 100644 =2D-- a/gnu/packages/tree-sitter.scm +++ b/gnu/packages/tree-sitter.scm @@ -709,3 +709,83 @@ Emacs packages that understand code structurally. Fo= r example: @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.10.3") + (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 + "0fa0xi8sky5h3rscnvcci9djdi71qj30vivzzvx7w8pqkmsy1vq7")))= ) + (build-system emacs-build-system) + ;; FIXME: Support for some languages, such as bash, is still missing = from + ;; the bundle. + (inputs + `(("tree-sitter-bash" ,tree-sitter-bash) + ("tree-sitter-c" ,tree-sitter-c) + ("tree-sitter-cpp" ,tree-sitter-cpp) + ("tree-sitter-css" ,tree-sitter-css) + ("tree-sitter-go" ,tree-sitter-go) + ("tree-sitter-html" ,tree-sitter-html) + ("tree-sitter-java" ,tree-sitter-java) + ("tree-sitter-javascript" ,tree-sitter-javascript) + ("tree-sitter-json" ,tree-sitter-json) + ("tree-sitter-julia" ,tree-sitter-julia) + ("tree-sitter-php" ,tree-sitter-php) + ("tree-sitter-python" ,tree-sitter-python) + ("tree-sitter-rust" ,tree-sitter-rust) + ("tree-sitter-typescript" ,tree-sitter-typescript))) + (propagated-inputs + `(("emacs-tree-sitter" ,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")))) + (define (install-lib lang) + (let ((input (assoc-ref inputs (string-append "tree-sitt= er-" lang)))) + (copy-file (string-append input "/lib/tree-sitter/" la= ng ".so") + (string-append elpa "/bin/" lang ".so")))) + (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))) + (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.33.0