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 ms5.migadu.com with LMTPS id oGIGFUwWzGNIdAAAbAwnHQ (envelope-from ) for ; Sat, 21 Jan 2023 17:43:56 +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 SH39FEwWzGOccgAA9RJhRA (envelope-from ) for ; Sat, 21 Jan 2023 17:43:56 +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 2AE583D010 for ; Sat, 21 Jan 2023 17:43:56 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pJGxn-0007L6-Iy; Sat, 21 Jan 2023 11:43: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 1pJGxl-0007Ka-2t; Sat, 21 Jan 2023 11:43:29 -0500 Received: from mail-il1-x132.google.com ([2607:f8b0:4864:20::132]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pJGxi-0005yI-Ie; Sat, 21 Jan 2023 11:43:28 -0500 Received: by mail-il1-x132.google.com with SMTP id b15so2074121ils.11; Sat, 21 Jan 2023 08:43:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=x8R1chWI8HDPDaalRU4Y1QQIreGyWM8qra9aiDLh/6k=; b=qEAKi/tgkiDXFSAL4qd5ncI0L6hw+AJIQ2sGYeai46Lkb+JSdNGIVJLC3x3kycXUhn 6hzZf45wKhc9JwVNrQIKGDs48dPHs0Uzu4XjGeiOUDg4RmLGScKZikICHBf0+FrbBM/I WSSB5mmgPmacSsWVv92hZWdNavlwXSbuNTw94NW0qA7YvYnQN45NLBfiRjYDtY77pdSY NhgIUGQzcRjFiKPfrzoybiSdvwxUmuxKcdEJSpD7I0zkVIqgftg00qJoaK71W01j+6Bk d9RUB4AxovXDHDvgwJfmF00z8cuG2gEVbi7ZVw2kGVBvS5j/YNFqoGZ8aexiCC0NTNKq X5xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=x8R1chWI8HDPDaalRU4Y1QQIreGyWM8qra9aiDLh/6k=; b=eolr6gVt4P4LDFNzmqw6FqmDt+SNMu6/NsRGji6PRmzqkzoCble5wSo0TbRYirnCJ3 91MDxT1qTStPZE7/aewu2lpSOXVjzQLYYS45SR7F6uA4Juvtt/GAxHl0MZj3QcjF9nbR Wsa4EIT0MSP+kii+smxkYpU+CBSTPS+1avJQM892oWy2gAZ52Okv2h2zdvh4CTogTTQc CUx/nj1DFBhN2kqt+F+mnx83DYyjtQBAWBcWgX8ctFlSzdCYmcbYB9pjKhC4JMbtTgz5 zNJST6GoyLDsvgA/9liBVnTQWhPtQUec6rU6eevJP40/0F2DU5+wodH2WeG/p1PVx7Td oxew== X-Gm-Message-State: AFqh2kq6GA+kayYqPdQttKaKc/zo7UG8/UVMS18+c4mP9EpfMCHzI8yv aIOg9lP/MgJDLx00xfV9/VNQ3I6pkvI= X-Google-Smtp-Source: AMrXdXvSzevMh37Tqq97xbFIRwNPtN7PIueN2LpIKkWE5Ss0ymJAi+nrHARj1uo/i+cgP7ki5+SQ7A== X-Received: by 2002:a05:6e02:1b04:b0:30f:5630:5d69 with SMTP id i4-20020a056e021b0400b0030f56305d69mr4865689ilv.2.1674319404865; Sat, 21 Jan 2023 08:43:24 -0800 (PST) Received: from washu-v4 (c-174-51-139-101.hsd1.co.comcast.net. [174.51.139.101]) by smtp.gmail.com with ESMTPSA id y17-20020a056e02129100b0030eef54da08sm6250163ilq.30.2023.01.21.08.43.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Jan 2023 08:43:24 -0800 (PST) From: Katherine Cox-Buday To: Demis Balbach Cc: help-guix@gnu.org, andrew@trop.in, Guix Devel Subject: Re: Getting tree-sitter grammars in Guix References: <87h6wycn8f.fsf@minikn.xyz> Date: Sat, 21 Jan 2023 09:43:23 -0700 In-Reply-To: <87h6wycn8f.fsf@minikn.xyz> (Demis Balbach's message of "Tue, 10 Jan 2023 18:29:04 +0100") Message-ID: <87o7qrzvmc.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::132; envelope-from=cox.katherine.e@gmail.com; helo=mail-il1-x132.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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-Seal: i=1; s=key1; d=yhetil.org; t=1674319436; a=rsa-sha256; cv=none; b=baQQYsfhKYqhJtpiFwJcYMIMF3Dw8O8IYDcPEYbb6gy0sZeOMBWXUzbcYogQNQqmvjNp1n xqktSXkUC5a94VnX7QbewB2X8TMfsxm/i3+NmxPG3UpoI5WKxiO2NwqjRbhXPXVHGNwmOh YQj5VbQ1X17xnk8XEpXbu9KWK4Z3I6dw8iMwrIHPC/754g0WdrLHiUZZ3z8kA/CuecXea0 gN/iSQsSPSWkD/oXSVjL8iwQUx/EMiZC73E4qdwh6Bfi6lzJLTTPYR/X7EUAeoA8UUCDsH Rg5mlnDLE7Nrip9QBCm0ijGrTpst4+CbWS/TQtbq3LAUOY5ubyLKIiEi3YeVEw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="qEAKi/tg"; dmarc=pass (policy=none) header.from=gmail.com; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1674319436; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=x8R1chWI8HDPDaalRU4Y1QQIreGyWM8qra9aiDLh/6k=; b=g59UOkMbzwlvtp+3XOfBVtBWElZ0X9BZjEsWFlD7iHBL5tjpc6LWAl2V4cXXVkRBX+3y3M mmCDh+RaIwtDXHu+OXYWyp0PmilzFvnwE+6jGiTriTybnhwaHd/oeo/oBi7sZ36nR6LHNH 56DJUV9/4tknG3Oy8xzS5HGj92izIiRwPZLmklKrnafmriy7KDnK9SuUTQ6sYvlCJc8gZk +u72J+HUW3DBzl3C+UTTb1EquQbXi38yRqqvVJ3g9XVOmvbJZ4DDZWgpj9BeWSfGHsrN9r XK9wrMQJYlL7OpagCZS5dlbJ/YMbr8Ih7g4fmYh57lvbwK6RbvZJ61bLBya0yA== X-Spam-Score: -6.57 X-Migadu-Queue-Id: 2AE583D010 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="qEAKi/tg"; dmarc=pass (policy=none) header.from=gmail.com; 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" X-Migadu-Scanner: scn0.migadu.com X-Migadu-Spam-Score: -6.57 X-TUID: nVvNmoSoaCaN Demis Balbach writes: > 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: > > (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" lib))))))) > (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)))) > > 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). This seems correct to me, but you might get more informed opinions on guix-devel@gnu.org (CCed), since this is a packaging question. > > Thanks in advance! -- Katherine