From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id CaidLpdsEGEWKQEAgWs5BA (envelope-from ) for ; Mon, 09 Aug 2021 01:45:27 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id mOaOKZdsEGEbDwAAB5/wlQ (envelope-from ) for ; Sun, 08 Aug 2021 23:45:27 +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 56B15DDAB for ; Mon, 9 Aug 2021 01:45:27 +0200 (CEST) Received: from localhost ([::1]:46248 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mCsTu-0003OL-Fv for larch@yhetil.org; Sun, 08 Aug 2021 19:45:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57876) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mCsTX-0002u9-PL for guix-patches@gnu.org; Sun, 08 Aug 2021 19:45:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:43513) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mCsTX-0004fd-Ig for guix-patches@gnu.org; Sun, 08 Aug 2021 19:45:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mCsTX-0001ER-Hf for guix-patches@gnu.org; Sun, 08 Aug 2021 19:45:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49946] [PATCH 23/31] gnu: Add tree-sitter-typescript. Resent-From: Pierre Langlois Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 08 Aug 2021 23:45: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.16284662604598 (code B ref 49946); Sun, 08 Aug 2021 23:45:03 +0000 Received: (at 49946) by debbugs.gnu.org; 8 Aug 2021 23:44:20 +0000 Received: from localhost ([127.0.0.1]:55042 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mCsSp-0001Bk-Gh for submit@debbugs.gnu.org; Sun, 08 Aug 2021 19:44:20 -0400 Received: from mout.gmx.net ([212.227.17.21]:55573) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mCsSn-0001AX-4e for 49946@debbugs.gnu.org; Sun, 08 Aug 2021 19:44:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1628466251; bh=ogMCDOZpYhgYne+HPX4ONUD/1czl+21nGVgXy7G7p20=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=LENjyUMHfJLtJVXXqCsuc15Lqsdfwde1TEagJvW/9/t8Hhrb0YcMwRvWHO5NDftCe buzv8gtmRWyGDt7Aa3hOGzhZSAtebUBoKJNXDzESb+gVlQPC4/ahmJpAzQJB+itqjm LbtmxG5ApRsq5VKuXASo+qNh1yjwjAQY5zgv7dWw= 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 1MXp5Q-1mc4pS3So8-00Y75w; Mon, 09 Aug 2021 01:44:10 +0200 From: Pierre Langlois Date: Mon, 9 Aug 2021 00:43:50 +0100 Message-Id: <20210808234358.7241-3-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:vC9FtyYfrjya7jZswpZOIvP8rsY5RrAA4lIK6069yqZQDCawY92 OV60shhcpblqUFgNRDcx822dk9jw8N6uzb34v1RtAh/A2At+R0+Kz6c0+AK7LRpYmwKjoHB VcWy9RhifpjS6Evrmw38ZdlA2m/O3gRpQWRO75uYia39YrgtEINyeJVmts2a/x1Nu7ZxibZ i33boqfGXEI4ZAI0i4mfA== X-UI-Out-Filterresults: notjunk:1;V03:K0:oghJLTr4wr4=:72bnKL10kh1OWXAwY/OyrR OYxLE7Lej/AYjR23q2aKnDMKK47ygRLC5cr7d8BsaN6cB3E2CcSUQ/6Suot0ghY/y/iXtfG1V c9iyUWNoyfPQqjg08VY89UN2jZzD/GdNuLFx06f/TGROi8kD7TEH50DcHHuGHC6r9l2JnwLKO dpoXQ+ydNEe24hGKaRwGpDLqzkopXfsVby4KuPCXjE4j3LzBcJRzTqxdy3PkzXqn8hxkK7da9 2RUyFzCEeAUdcMmaj2ZVcVVBCRit73ntPSDzrHkBBHYZRCSzMRkbuOSlPZP5Mh+XzHTTX2GtJ isofWjfFi8jdB7pFN+AzvP7+6/6fQH72qIv9ihYsVhq5GXWoOjQ33ZOSesDE/o9AnoFeAFthB j+3eQBOR32Ngy4XKm98oFEJU+wdf/EciOeEkfMWInT+HsqRpl7rr1omFU1kPcun3kbl+LkfOL dny8RnfXIHNhaKCZptaUSiQojPPAWeP0p3GlgEYUs2ZfUesX6hStOmp5cjIKTdHuxiISQAV6C Gl3ugABlsxl/7k/HtxNcrOv0PIc06UYAJ6sRnGcI5LIW7dNBrP7L79YLFKDudVqh/tGHddenc uHYc4hGlfbBgbtqxeiD6qeeEBlg4ClzAQwrTmL6xfENPh/JQdyqppPxoP61CxE5SufFACG5Vq heg+/4J8yS65d8DKIHjaVnvM2xEr1D1b4UMKqRmuASpZNQnh49BUXz79tOE9M5b2elM8aPdJh mU/y7UH2ZCsh+o6NdFH2uKPFxjDX81AQlF1NcEnqhoopw7NHSbkSHjL8NoXHwgypWc4+MEJYE TmRfUalJ/z7ozGv2n7RUWVDxZ5oIS0B+54k+/nhBUwPm8OzokOFY+7ZgmqjD1Ayd6DtjqAP8B 5fErA1os+ZPyP1RXs2l1813DPtgmEGAkC4NGN6LOABOHoNJbAkeSDl461xvfPVYQp4fziJlfS in2MkYK4Rs2wRebxorDNWbEgHl8Csy2tqqLXBk2qSfWs8tkjpknu0xv0C9MZo7+Hm9j1sm8R8 nWKYuhoq4F7zq9LpHXUm+RjvbaCiqeSEVo+iADD+lI+n3i0wRdiQep6vIhwoQCqbYCCf3KaTN VwfsaOeSg5QpglDsD2kAthED0/kpadqKyEKp07ZvuIPU/rT0XHnkFI07g== 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=1628466327; 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=wsijfursHizjxZZIlE/9hSV/+x5D6qWumQwndIYNrOo=; b=dF2OKh6aTZn+23W0ysHaqxpGwZIguydCsU2ZwNUy4I/8+QWNH9zYn51CIhpXMjUuo617d2 AIt6ScTl32ifIlHNjFVzU/BbnwnLA/SRHPqSBwDyY2Oe9d4qKyntEGvq2p5SOMj8rIrskI R+2/42lYt+LX2oI/Z8vCGZmL0Ih2P6DuzeNXozrFKDmonZnCp+XmW4XzSRTRQ3x6zdqcnb Ba/e/t7wjLK4ue+TI7l+4HU+4RqECYlzz3Bgy59WU4EJRJVU6kD3SD1t0HpAzgjknFoHyc vtDJHQYJ5XqltSpgiMTx74BPZ/1YAVNeo9TwyMpvR4AwYPzijiRJKXZMRM2t+w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1628466327; a=rsa-sha256; cv=none; b=Qcw2fQ3Zn6PrGKcEAl1ATEeC0JSspgHx0ilL5A5lDLMFPGc+OxrGm/+3Ftu7Qb3ANflVoH q15Tvs0c4UAyENprmaY6kPD/Dt7ZorSG2uGxYpdTtca7N80q7jB/wFYxMhc4E+pu31ieH4 pFGoZk+6GILf7JAxXAT9wgVJs8E5DSl4l0vz1KgrtwG+UDiIRIaR4RKZL29rRl5DHtAiub lH2dOw9hNxSFE+ivdYLa1GOkJOOrrSS8WnM4ETVBngI9LCYfJsPP2QczdSgoqY/DYmm50e HDIpP9140Jop4sIhFyTm0h6JT84fQEyEIIyvYVFTlvsGHDd1pE+nE0JXZsIcTw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmx.net header.s=badeba3b8450 header.b=LENjyUMH; 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=LENjyUMH; 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: 56B15DDAB X-Spam-Score: 2.19 X-Migadu-Scanner: scn0.migadu.com X-TUID: QlVaPdalbqa6 * 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 6c2b2e7577..0f1946a77e 100644 =2D-- a/gnu/packages/tree-sitter.scm +++ b/gnu/packages/tree-sitter.scm @@ -442,3 +442,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" ,tree-sitter) + ("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.32.0