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 W33WNT5nK2EmdAAAgWs5BA (envelope-from ) for ; Sun, 29 Aug 2021 12:53:50 +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 uIsSMT5nK2H4UwAA1q6Kng (envelope-from ) for ; Sun, 29 Aug 2021 10:53:50 +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 6AB7250E4 for ; Sun, 29 Aug 2021 12:53:50 +0200 (CEST) Received: from localhost ([::1]:43718 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mKIRh-0001Ef-DQ for larch@yhetil.org; Sun, 29 Aug 2021 06:53:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40598) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mKIPz-0007tB-OO for guix-patches@gnu.org; Sun, 29 Aug 2021 06:52:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:44099) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mKIPz-0005wI-Do for guix-patches@gnu.org; Sun, 29 Aug 2021 06:52:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mKIPz-0000R0-CY for guix-patches@gnu.org; Sun, 29 Aug 2021 06:52:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49946] [PATCH v2 25/33] gnu: Add tree-sitter-typescript. Resent-From: Pierre Langlois Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 29 Aug 2021 10:52: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.16302343061611 (code B ref 49946); Sun, 29 Aug 2021 10:52:03 +0000 Received: (at 49946) by debbugs.gnu.org; 29 Aug 2021 10:51:46 +0000 Received: from localhost ([127.0.0.1]:55640 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mKIPh-0000Pl-Gd for submit@debbugs.gnu.org; Sun, 29 Aug 2021 06:51:45 -0400 Received: from mout.gmx.net ([212.227.17.20]:53075) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mKIPe-0000OU-Ss for 49946@debbugs.gnu.org; Sun, 29 Aug 2021 06:51:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1630234297; bh=XEVsE5haDqyTF5sJmIF4ELU7bh7XBDWzcbkWvjd9iio=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=Pjld7V/szvsmCGohbZN93SytLqKDLWQtTqHTHALvGUrbn9qUa3i3AFEu6oWMv6mM+ yqn3tY6w4fLcQlMwYOaGYrexuEZtrv7ZSF8kgu9ZWTiEVNkezARhBHeYXymuinVh4c L6nLBZXUvJFAN5cISBoxxZuuBFZnWojV2ahem1l4= 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 1MpUYu-1mo7Jg2tf2-00psUz; Sun, 29 Aug 2021 12:46:36 +0200 From: Pierre Langlois Date: Sun, 29 Aug 2021 11:46:00 +0100 Message-Id: <20210829104608.3103-25-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:aEQA2Hq+oC6Kav3qhssM9yHe2/LFSqOay6NmnnYsKNdCAsuezXD uWBDvZ5ZRXzFcpS10nth7HeHBnCbIOly8lhhm7lYiNtsgvhka2/Y2V2u6hfuatOCRbCtCT6 ElWTmEG5Lwk0T18uJuIs/5hZFoqRTi8dNPdWVuY0MAgU7fyx4NEIfL5xhfcIxbSyE6gNKPd MdAGvrXGhFR3ZyZsykSig== X-UI-Out-Filterresults: notjunk:1;V03:K0:YPgCtautpBU=:YZBajVYazJ3EFW8Amq0RXi izvu7llqCoGjNA55hez+XFq/TxcfUJco8A22Pt7b+w5qSJ6mdBh0IMN/hR5u0I6FHE0PufS1L eT1M8dsC+ixCdj9EGKo1fwMDKn3sw3FTBz2Ca2GaiqPQa8xY+fAHuplabYhmzUuJepX88Kuay eYK2CGjV4lLfkllm9e0xc3hL4PkxVT6rYAicPCOEMIzxWII9NeIMnEN1wcxre6cxJoo4tcK0Y MtzfSW1tAbmMN1/Po2K7umOsvxM1qK12Nsy6l/usD7ZhjKTRA//anxVHSBEb+2cF4MdgDka1b 6D2iymFSKOT7wqiWeuYkM+Dzbzolv3zZTHCtsYHm8fSliepXzcWwrIlP22peBWGXRWI1R4FLU cwYy/GTDGUBF6eI3MPg2Tboso0Gpb5KVUoWhOyjyMO3jXgyoN1oDo+5i62S8JpqJZZe574VVA Mw3nPAHGKBzUxMX19gnPjkT0deqpfxnmh3rr2o+dbePyUiT3qqHUY8uiRbnr3if6FMQTKkbiF mua4iWW/GMLRKrMV2VVCnm/vhSgE4521giSceO2PQeF/dBshPU1qIH//5oob8rQp5TlxJXn1q 89ltoF6rSP2i+gPeUdv32O4KmicDAuC5lBnlu3PMyXl8MwgDHNt4ZCETiGKksvkP6sH8GFrEY G+HbakrP+Xd99g6kE+G6uK+lbcalnR9+oKcEip3lj0DPkQM8WAR+otewB/SOP2hCFIwslUz8N QIXsz3vASvawPkijfJWQe+dXRDXMjV4UZN0H03thTtqOetccuGcFrQ/NuxHEb5JJxY+E2pGmK 9djbSJBw7eIImqz0mB+AlPiRFzmQLDAj+4/WRP+LxlCtS4ase8YX4luV4KTgYQwHMS6HQrI2C j6kqgrA+NsiA2zr0wvHka1pJ9v0RkXiGEPaC4chdCl41lYJRl8qU+AYZvMdC88uy09Z6EsSj5 qU5mgQkKEqgAG3cUaKbMagOBxRDeNrSktA68XqmBJzSQsRpWmFoEq//XSBfrcdnMmGwiKGRnk MfhcbAcePQwli6cNgNFWiL/zeWeNG9AbnmJRprRSNrEjrYuxjLDsS99U2wac0bmF7WrKQ/zM9 NJzJSCCUpTZHGs6DdMrjLLSa+cnjyj78BLANQHz7/cyQ2fPlzmR7qt7qg== 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=1630234430; 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=D83n89XPD3v5NfzDcEkOhq2AGMQRS9f/ZTNdBllYe7w=; b=snrwekacNAbJorIX0cYc78VmopoU7fVuc3N3mNLDJz8FzdeMe8FlohtaCnfhroNxqs/PvV HoL+t/qe6ZQ4+Ze5QDKZy/VkptqAtqzXlSHiFY7e9/aCH0qRqbu3VTiqI45Vc34lgBBltu ABR1TrBuwpgzQ3bliXHQPRAhf7X9HQMcRGPuzLfxgaX72xgd8RsyIiGpvmmQGGd9LLlX3J pXWsKRYCUDye3Et1E+l/yw+hxfFjJPww56sq4hL5zLIhXOceoq7+/bAB0WK9chSEGQ3em8 eWmqjBd9O6yEjtQMo+12yvyrdgwwQkKIbE4B9Iw9FSxJ/rC9j5UKFZap2f1eBw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1630234430; a=rsa-sha256; cv=none; b=Bv6p/vZBTczxkPHzfDWooJx/xhYNhO3CDyQe7shdC42P/pbESoEyzOhK12g80C2zJ4bNdw ENx0PEIWJFwmpNG8V0z3Vso1zI5+aqhKvc+eYeSFE8pQfta6FPp7MW7DA8ay9ANN3xl+Bj vangmgdX1n5Uijiwmew2uBjQDZglmJ/zhmega2b7G4+coh/FxJ1lDvwdhFZ3Gc9rjIucaG abXJQ80xi5DoD/wO8YErRJJmqux3RkfSZ3nlqJCaTOE9+xuX/4YNvlEWxedFt+rSFGWVAz ccoGS6YeJbBWA27MdcvrH+xLvVBCZ2UVAVqBXe0W/lTJqcFpCRKVtZ4mIKP3oQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmx.net header.s=badeba3b8450 header.b="Pjld7V/s"; 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.17 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmx.net header.s=badeba3b8450 header.b="Pjld7V/s"; 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: 6AB7250E4 X-Spam-Score: 2.17 X-Migadu-Scanner: scn0.migadu.com X-TUID: VcsXXy1XWb5M * gnu/packages/tree-sitter.scm (tree-sitter-typescript): New variable. =2D-- gnu/packages/tree-sitter.scm | 60 ++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/gnu/packages/tree-sitter.scm b/gnu/packages/tree-sitter.scm index 8456a15607..001322dd84 100644 =2D-- a/gnu/packages/tree-sitter.scm +++ b/gnu/packages/tree-sitter.scm @@ -516,3 +516,63 @@ library.") (description "This package provides a Rust grammar for the Tree-sitter library."= ) (license license:expat))) + +(define-public tree-sitter-typescript + (package (inherit tree-sitter-c) + (name "tree-sitter-typescript") + (version "0.19.0") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/tree-sitter/tree-sitter-typescript= ") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "01pkmwwmbv6kxda0n6g4cfg72ldmpi9gmp11a5gygn472vhrh2xw")))) + (native-inputs + `(("tree-sitter-cli" ,tree-sitter-cli) + ("tree-sitter-javascript" ,tree-sitter-javascript) + ("node-nan" ,node-nan))) + (arguments + (substitute-keyword-arguments (package-arguments tree-sitter-c) + ((#:phases phases) + `(modify-phases ,phases + ;; The parse-example script tries to clone git repositories. + (add-after 'unpack 'remove-parse-example + (lambda _ + (substitute* "package.json" + ((" && script\\/parse-examples") "")))) + (add-after 'build 'build-gyp + (lambda* (#:key inputs #:allow-other-keys) + (let ((node (assoc-ref inputs "node"))) + (invoke (string-append node "/lib/node_modules/npm/node_mo= dules" + "/node-gyp/bin/node-gyp.js") + "build")))) + (replace 'make-files-writable + (lambda _ + (for-each make-file-writable + (find-files "typescript" ".*")) + (for-each make-file-writable + (find-files "tsx" ".*")))) + (replace 'install-native-lib + (lambda* (#:key outputs #:allow-other-keys) + (let ((lib (string-append (assoc-ref outputs "out") + "/lib/tree-sitter"))) + ;; Invoking `tree-sitter test' loads the grammar which + ;; compiles it to a .so binary that we install. + (with-directory-excursion "typescript" + (invoke "tree-sitter" "test")) + (with-directory-excursion "tsx" + (invoke "tree-sitter" "test")) + (mkdir-p lib) + (copy-recursively (string-append (getenv "HOME") + "/.tree-sitter/bin") + lib)))))))) + (home-page "https://github.com/tree-sitter/tree-sitter-typescript") + (synopsis "Tree-sitter Typescript grammar") + (description + "This package provides Typescript and TSX grammars for the Tree-sit= ter +library.") + (license license:expat))) =2D- 2.33.0