From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id mGBiO//lvWMSGAEAbAwnHQ (envelope-from ) for ; Tue, 10 Jan 2023 23:26:08 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id 0Lt6Ov/lvWODEAEAG6o9tA (envelope-from ) for ; Tue, 10 Jan 2023 23:26:07 +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 9DA87CAD6 for ; Tue, 10 Jan 2023 23:26:07 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pFN3i-0003uH-6x; Tue, 10 Jan 2023 17:25:31 -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 1pFIR1-0007mz-MF for help-guix@gnu.org; Tue, 10 Jan 2023 12:29:15 -0500 Received: from mout-p-101.mailbox.org ([80.241.56.151]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1pFIQz-0007Ph-NH for help-guix@gnu.org; Tue, 10 Jan 2023 12:29:15 -0500 Received: from smtp102.mailbox.org (smtp102.mailbox.org [IPv6:2001:67c:2050:b231:465::102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4NryTt5KxCz9sgK; Tue, 10 Jan 2023 18:29:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=minikn.xyz; s=MBO0001; t=1673371746; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type; bh=isa86xHv1kXooxSjUEPXSbXoeY0wvi6frBK6smqv3Dw=; b=AyxNUobZBqGQdNSt77hUcNWKn69yLRfbz9InsyCe+XlIKA7Zxu3dqOC3P/AEl4wDZcey+z T2R1JhQDU7JxXAhm1scMIQn9jVvlVLl5Rs4+ZicedHIHtFrhlCC/Cl429VgS6xnBtZeIjT 624OFkXvCdWNFZToVaLZEkeg5G0dVkx0OuCAaIl7YI1HC3f3VyhAh1SF1R0lSyiR4lsV/Q hlUx21dDLDQovrBZJOJC7x/wVrrEM25IkYtk0wW3qIOJA48aDr17ykSoQiyn2GM1kJLoVF KnmfpQMIhz6JSmW5679Tg0Os6TNR5IloQ+zNGJ70MC8k6uA+Va3jjim2kUb0qQ== From: Demis Balbach To: help-guix@gnu.org Subject: Getting tree-sitter grammars in Guix CC: andrew@trop.in Date: Tue, 10 Jan 2023 18:29:04 +0100 Message-ID: <87h6wycn8f.fsf@minikn.xyz> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Rspamd-Queue-Id: 4NryTt5KxCz9sgK Received-SPF: none client-ip=80.241.56.151; envelope-from=db@minikn.xyz; helo=mout-p-101.mailbox.org X-Spam_score_int: -2 X-Spam_score: -0.3 X-Spam_bar: / X-Spam_report: (-0.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FROM_SUSPICIOUS_NTLD=0.499, FROM_SUSPICIOUS_NTLD_FP=1.999, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_PDS_OTHER_BAD_TLD=0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Tue, 10 Jan 2023 17:25:27 -0500 X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: help-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=minikn.xyz header.s=MBO0001 header.b=AyxNUobZ; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Seal: i=1; s=key1; d=yhetil.org; t=1673389567; a=rsa-sha256; cv=none; b=TXFWaZ8FEok06eLxBknV/WhqLTVJ7fS9ieXonDBUJdpDsvQELwMSCfkKDmHMnj0ExL14d2 EWxjJ/KRRDOPII3yB7Z0IwRu7MTvhb+9p74Gp7lTVjWGzEjsZCQ8nOppwzDD+ZUXC5VtK8 a4eiARHpgSkm50cSHefD428mfGle3omsOqFqAPNG5Hrvsn6KwVz5Y+8QBptIkrlPqQBDkW SW+QasRkUrs3rwMLLBvul0kcVGlg9xG5tAcGDfM6cMy+iJdhI5r/523mD0Qt4xAfJkOSF3 PJ4VEzNXDOssX/zHhmVx4TBCw/OtbBBUQg0LzSBXuhVzvo9yM8xBZLLlMv+40Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1673389567; 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:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=isa86xHv1kXooxSjUEPXSbXoeY0wvi6frBK6smqv3Dw=; b=PXIyFflOFOIzhus0jY9tC1TMAutvOV4ah6thUPQdTySanA+1wIyXcmV5TpoD0TADyVm5z0 Gao9CpaNf4KQ4EYCKQNZIHICuAO7Yeb3ztojy1juoZUENXL+vXy6CiyN04sxq6P4dZ1Dg0 wiZYUy/fC8ixA1wuSVyc4KXBiIWYmKwMm5KLuFLKEuYPtsGvqLw8Bd0TlkfqCYsTSO89J9 Z9m+LSCJhZPnN5fz9ic4u1XIDcIw1Xr56ESD/nSVT7rTxO49o9ds5Eet7ana0cpMfaR0/I preOeKasKGZYRGAy+h1SjdwIVNbEaPnbAq7DFHwLO+RYu0r7VU11vAPlGrL8YA== X-Migadu-Queue-Id: 9DA87CAD6 X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=minikn.xyz header.s=MBO0001 header.b=AyxNUobZ; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=none X-Migadu-Spam-Score: -13.66 X-Spam-Score: -13.66 X-TUID: 6BJ7R5frenIb --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello, I was wondering what the "correct" way would be to get grammars for the tree-sitter library available in Guix when using tree-sitter with Emacs 29+. There is https://github.com/emacs-tree-sitter/tree-sitter-langs, but I don't think it has been packaged in Guix yet. I started packaging the grammar for JS/TS: =2D-8<---------------cut here---------------start------------->8--- (define-public tree-sitter-javascript (let ((commit "7a29d06274b7cf87d643212a433d970b73969016") (revision "0") (version "0.20.0")) (package (name "tree-sitter-javascript") (version (git-version version revision commit)) (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/tree-sitter/tree-sitter-javascript") (commit commit))) (sha256 (base32 "1pk6d9g6a7bzhxmwnvfiycarcgz76wq2rgfqr0xjh7y7swfw5hvw")) (file-name (git-file-name name version)))) (build-system gnu-build-system) (native-inputs (list gcc)) (arguments `(#:tests? #f #:phases (modify-phases %standard-phases (delete 'configure) (delete 'install) (delete 'build) (add-after 'unpack 'create-dirs (lambda _ (mkdir "lib"))) (add-after 'create-dirs 'compile (lambda* (#:key inputs outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) (gcc (string-append (assoc-ref inputs "gcc") "= /bin"))) (copy-file "grammar.js" "src/grammar.js") (with-directory-excursion (string-append "./src") (invoke (string-append gcc "/gcc") "-fPIC" "-c" "-= I." "parser.c") (invoke (string-append gcc "/gcc") "-fPIC" "-c" "-= I." "scanner.c") (invoke (string-append gcc "/gcc") "-fPIC" "-shared" "parser.o" "scanner.o" "= -o" "libtree-sitter-javascript.so"))))) (add-after 'compile 'symlink (lambda* (#:key inputs outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) (lib (string-append out "/lib"))) (install-file "src/libtree-sitter-javascript.so" li= b))))))) (home-page "https://github.com/tree-sitter/tree-sitter-javascript") (synopsis "JavaScript and JSX grammar for tree-sitter.") (description "JavaScript and JSX grammar for tree-sitter.") (license license:expat)))) =2D-8<---------------cut here---------------end--------------->8--- But I'm not sure if packaging each grammar is the correct way. I hesitate to continue working on this because there are not other grammars packaged in Guix (yet). With tree-sitter being built into Emacs 29+ I expected grammars to be packaged already (hence why I'm asking if this approach is correct). Thanks in advance! =2D-=20 Best regards / Mit freundlichen Gr=C3=BC=C3=9Fen, Demis Balbach --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEz9zHmXzCRksxyCGU8X3bmMw8QFwFAmO9oGAACgkQ8X3bmMw8 QFzQBQ//Tvodpc7H0bjXdJItFSHi38R6IIj/dbFpyZNzjb1eTZ7krzXgqu8A1YP6 Egu/EZMzCXN9G3f4fXvLHXWBKuxi8VkFHi6iDATVt/Wd2B6xye7SqHhZBy4rPaNX 3d918j3bpEnkkHntLCuPvI8H5pSWE19mngc1xJhw1+bZJvbrLisi9SI/QAqux8Wb bkhR83dYEfoXGAaH7bLjGwGcE2jj+otP/n2jFKJfaCJx+WAlB99utFwB2lUm+dx/ p/7rx4FJAGl9XSaLF8HnZSRVc67IzqbdRQC9eFkiffiKQVxwy+7RghRPYcDRiQJh oQgRdZLiQpvYxaO2Y7R+MJqGxTo1tAw0kR+voyExUEemHHriHDaU267hyfF8kkx5 sN3bcR4coVMU/8APNREDVNy1+feNP6LojzxahWPZf6kVXoZv6W0zvxaw7Zu8mlaM ocfBmVLl/3X2dCWPatpY8KzMnFrk+ONgFkoJTFQW5msZKJ2fU0ff9i+1TvruVNd3 nhCBvvRi+KrzMqCTb4wtHgHmCU05vgdlGsp1Oe5d7jQECc9d/lE8OV2pBXqKI66q KDJPbjQgt4FXRO9RAlIJE4NRjQaLg+m84m4rbi3iTE3uRINAaT+wECQY+VZDHDG0 BSWebG+3I8tbJ0rCFFdn4ABu5qEn0I6IPHyvBfQaXawZWBMlXGE= =mZT7 -----END PGP SIGNATURE----- --=-=-=--