From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id GLLnDLRsEGFyKAEAgWs5BA (envelope-from ) for ; Mon, 09 Aug 2021 01:45:56 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id 6ElrCLRsEGEIOwAA1q6Kng (envelope-from ) for ; Sun, 08 Aug 2021 23:45:56 +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 aspmx1.migadu.com (Postfix) with ESMTPS id DC9D4D32E for ; Mon, 9 Aug 2021 01:45:55 +0200 (CEST) Received: from localhost ([::1]:47502 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mCsUN-0004Me-18 for larch@yhetil.org; Sun, 08 Aug 2021 19:45:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57896) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mCsTa-0002z3-NV for guix-patches@gnu.org; Sun, 08 Aug 2021 19:45:07 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:43520) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mCsTa-0004iG-Hj for guix-patches@gnu.org; Sun, 08 Aug 2021 19:45:06 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mCsTa-0001FJ-FC for guix-patches@gnu.org; Sun, 08 Aug 2021 19:45:06 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49946] [PATCH 31/31] gnu: Add emacs-tree-sitter-langs. Resent-From: Pierre Langlois Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 08 Aug 2021 23:45:06 +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.16284662664652 (code B ref 49946); Sun, 08 Aug 2021 23:45:06 +0000 Received: (at 49946) by debbugs.gnu.org; 8 Aug 2021 23:44:26 +0000 Received: from localhost ([127.0.0.1]:55056 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mCsSw-0001Ct-BH for submit@debbugs.gnu.org; Sun, 08 Aug 2021 19:44:26 -0400 Received: from mout.gmx.net ([212.227.17.21]:45871) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mCsSo-0001Ak-Vl for 49946@debbugs.gnu.org; Sun, 08 Aug 2021 19:44:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1628466253; bh=cJ+smkilZ5hVatxqW5W1zs286emB7Qdg404pjqMfrdg=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=Nq0OjMAhS4cHAuCluJ1f+3ZV/TAANCOVGZfpwRlyM/yv/j1yZRi4Gyxz5wN4p0+2z tk/69Q0g2LvCqHbe7sytpCXt/m8nBIlny2lpw7bQYdfmKO04KELtajuQtwWJb1rNzp o/zio4pzlOxvFLKYuZvnK9mNoXhzELHcI7oh1v10= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([82.69.64.142]) by mail.gmx.net (mrgmx104 [212.227.17.174]) with ESMTPSA (Nemesis) id 1N5mKJ-1nB9420Utn-017AOh; Mon, 09 Aug 2021 01:44:13 +0200 From: Pierre Langlois Date: Mon, 9 Aug 2021 00:43:58 +0100 Message-Id: <20210808234358.7241-11-pierre.langlois@gmx.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210808234358.7241-1-pierre.langlois@gmx.com> References: <20210808233354.6745-20-pierre.langlois@gmx.com> <20210808234358.7241-1-pierre.langlois@gmx.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:HcJDJDroOU3k8IpXLDc3hMMoSPMnAXN/w8o8rBUaUOwFX32CAT0 h6LvwyXgSSDLsSxPtTDyuusc7krSeZQ5k/J6YWEBjhxiacGvbMpf//gd9LD0zksR0I5NjTC ymb7crQhAQU8CxbWFELhnCqDKcPWQmXAit+9STLGaAb6v+RTyuVf42Gze59Yho3fNAox/Md NcU8VBd4IvWXhebhnLAoQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:AW+t8HPvARs=:0Jmm7daJpNw3v8/k/5OUGj 4YYhYTFW2DKv2g3BkOhyyE4gKh9sNR73UCRE+/3RmyJynpzX8yFxahPYIwZYJi3yfB6f0NfO5 1DCHYKU5LeABOriDD0rtYg1be2zIJ6uvqcCyNC0p9nEigfs1Ss8Pb+7rEgXmsn+pYWu7y/jvd ZyJWo3jBos+5f0PaYFdF/9M01qh/gQpn3Yn6WZaJS3c4xDbnWnpzbkXApbdeelgwHIAh7lt/G g9OCi9zmmMp/L5V5aRExYUmUErpp1hnAEa7Yp3fICF4L2BkL2r4Mqazz/wLzgFVsHxhpAMoFH 7JJJVMya2ja9iHPmVjDYO75KUxQ/xF9Ti8soe07uqqVoLvhCNCAvvUNfz1/nEgQmNpvHppRzo 4xoWpG6+zd48cfFwZl214AXD9SEKhq27gq6R1wMbu0aL5OHK7tf6I26ra7LnQMZMrC7ObMl3g iIR+BjXNPHSaF34wnTDmqufz44I+cHIkd98L7JrCPreIG5JTXoHWqjK2VQxuBE87JWhEqiB9P 330mr4Wedh9r2uoXjR8G1DLwxSTN8I6COcLsfY8fawiITukH5GI7K8JPWcbTJvQviMEncbPy8 LajLh2PprMEGlfa65cCyVXC+6XrA7gmeWsybpfWrHsw8ptQXNVSUS9SsDLhrthNTGlDrrZYaB aNnAA0UKkCoLIwgo3T0f8JNzux59zuflVYIOHao6MXcawB0ya5sxSRzNSLyFjEvLvIIda2rv0 CxdxGrMgGhXGUrMZ8ga0iy5mTExwknSAGeAV71EDWkB93uAwJiGDhY8yR5G8pY1RfJ8akMOf3 JEtxZrO0MyZrMMVojQM+diQ0T0xeAmZ7NngM9eFxaP5YlBNSf9ETxQUQH8AZEcCm3GzLKhfcu LxLXWxqfXZTPyHMxXSyn8mnPWWa2fzB9QJRHiC/XvPSet06qckZh/G4lhhfkGlvpxb/cWAHHM cTBKkOMtZq5yZryDMdPgBkNX5H5hFsMHgCrV07nlTurpqIfs3Gf6VTr8oXHBVvfv0YAF1D1v5 qjVUM0EStXB2LLSs3TI0PmyfgUsvyzX54xphb8ePpxRP1dED2RwVv01HsQYxCVhrh4HqUuHmL UNLwTkdk9/V/efYSCwNnxO4zLxwadbVw5AW8JiyFAoumCPnJ+8rWiDLCg== 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=1628466356; 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=sjIaLU3YsAczKpuxhzfV0JNn9iYi/BsQZRufTAaJzAY=; b=pK+bmj6CYrF0MYFQU3BXj89EHRLJtw5ODusampOS7qBWNxw6S6POzJDREuamzaK0qjwtl9 r09RbzPJK0En6cHYMgYFt2jxiRtodoYPeoH8yeY3LVFihwyRR/y6kStgiKKGCTdkAZKfBn jmaVzjqrIb1t3KKtIbXOpEuXh+IOfJ+Nf1CdfcAJrCTHxM8y/Fcqtd5io2KVWUVG92K4ib KaVSG3hos8NmS37bYDA8/4pVlfaCBVHEYsS30/WubZZVzmx5DlHScpdl4EsTjYXCGH6ldS nguk7M7Vqv924cjaFka0Jr2rLRhznslGtsKvT7uwk3qwLQowco1pzvcBIOAC+g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1628466356; a=rsa-sha256; cv=none; b=nhDbpc2JpifPY3Txrz1HkF7ihGOg/JSm2D32Mp0aRUW9abzWT0PNYu4SeBU7aujLGE/z7a iix/Pg/PFwRyt14+K1/jbr1XTxheBRuDGmxkb/erG05lRkondQyvcmab4iNBMXbcLQW9Kw uHBD2Gh0rZKVwFTM+zDffe+WkJggXSZfHAtfMvvdmh0vZTA1X9QgRz6ndM36DFBiMldm7H /nUQFOLhmxazUBA5Vu2tFjrp74LuDL4s7c/BArHwWe5Vzw37odGhXih9Dn7ou+wfVKqAAt gwkyfW14snhv8qkoBCmqpd30cjtuodrfYt5tx1EzPImYOlhU1KuRkpWRRhS6RA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmx.net header.s=badeba3b8450 header.b=Nq0OjMAh; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmx.com (policy=none); spf=pass (aspmx1.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.19 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmx.net header.s=badeba3b8450 header.b=Nq0OjMAh; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmx.com (policy=none); spf=pass (aspmx1.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: DC9D4D32E X-Spam-Score: 2.19 X-Migadu-Scanner: scn0.migadu.com X-TUID: 0PDUVX7mqdC1 * gnu/packages/tree-sitter.scm (emacs-tree-sitter-langs): New variable. =2D-- gnu/packages/tree-sitter.scm | 79 ++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/gnu/packages/tree-sitter.scm b/gnu/packages/tree-sitter.scm index 22551d4482..bfdfacf122 100644 =2D-- a/gnu/packages/tree-sitter.scm +++ b/gnu/packages/tree-sitter.scm @@ -635,3 +635,82 @@ 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.2") + (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 + "0lym09jnlb7kvqkwkjbrqpc24fkpv99f8r9139sw8g537yj5f8rq")))= ) + (build-system emacs-build-system) + ;; FIXME: Support for some languages, such as bash, is still missing = from + ;; the bundle. + (inputs + `(("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.32.0