From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id uO2ME1KyD2L6agAAgWs5BA (envelope-from ) for ; Fri, 18 Feb 2022 15:50:58 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id CC47DFKyD2KLWgEAG6o9tA (envelope-from ) for ; Fri, 18 Feb 2022 15:50:58 +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 98A9E2FF23 for ; Fri, 18 Feb 2022 15:50:57 +0100 (CET) Received: from localhost ([::1]:43936 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nL4b2-00076e-PF for larch@yhetil.org; Fri, 18 Feb 2022 09:50:56 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44698) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nL4WI-0002EY-7v for guix-patches@gnu.org; Fri, 18 Feb 2022 09:46:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:59964) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nL4WH-0006Q3-UI for guix-patches@gnu.org; Fri, 18 Feb 2022 09:46:01 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nL4WH-0000EC-Nl for guix-patches@gnu.org; Fri, 18 Feb 2022 09:46:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#49946] [PATCH v4 24/31] gnu: Add tree-sitter-typescript. Resent-From: Pierre Langlois Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 18 Feb 2022 14:46:01 +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.1645195511764 (code B ref 49946); Fri, 18 Feb 2022 14:46:01 +0000 Received: (at 49946) by debbugs.gnu.org; 18 Feb 2022 14:45:11 +0000 Received: from localhost ([127.0.0.1]:53848 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nL4VS-0000C4-D7 for submit@debbugs.gnu.org; Fri, 18 Feb 2022 09:45:11 -0500 Received: from mout.gmx.net ([212.227.17.21]:45019) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nL4VQ-0000BR-KB for 49946@debbugs.gnu.org; Fri, 18 Feb 2022 09:45:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1645195502; bh=7AAmr7vo0scDJJ7QeOojM5YXFaeb+R3sAw08rGkoRaQ=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=DO6f+/NYy3qCWjmCZvpyojqpfCUZHA/CwcSocwuYQTSOqx91ppiBw360XzCxNB7BC H5uTIpdIAWu21Hju85nsRfpbs+ond2i36HajIwNJWfbKssHJPAlbMtPidxc5gtX0x/ BmLtCS8lm0s7DAOkVtKwDAcANPdTe7SUhE4OWkTY= 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 1N49lJ-1oKHpY2XxZ-0107YK; Fri, 18 Feb 2022 15:40:01 +0100 From: Pierre Langlois Date: Fri, 18 Feb 2022 14:39:41 +0000 Message-Id: <20220218143948.28989-24-pierre.langlois@gmx.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20220218143948.28989-1-pierre.langlois@gmx.com> References: <877d9s2qa9.fsf@gmx.com> <20220218143948.28989-1-pierre.langlois@gmx.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:AE9ZCNgbpudma1Q/fqvBbsKQa/+Ze2crH0GmB6bFBi2Wp7l8Kbp rQ/p86n5ruW29A8pxCY38bR+zsT1NFUhYCiExNyw370hkM9Jf3B4RpJWfgCbRQJWENsttq8 YDHpp8aL6tP6OntW0snHEznOz2o04YhcKoN7fpnDLBXCgG+vE15D94JsebreA8xtdPT1tPy DZTzLOQNzepGvTt38MKfw== X-UI-Out-Filterresults: notjunk:1;V03:K0:QEvJ2zak6Vs=:0H+wCd8fCbIIyg8+HIKD0X JP61lwLp951VaFtJ4Q7MYH2dXQK7zd3aIeD+aCzgHqKhHqeOKFE8rl+j4y8LDit5Cx4iWNhL9 mRVlXgmJfJGFIzyyl5QkjgL8VXsIyVx0NCzA4/J/wrreee3ai1Y9edny9rTZVjVp0t7QnIL9Y 6HL0HdgcAFajlRlja3MYV/ttWuc83JLoj4wdcTSGltTk5MNCamgqJWnUldU0umqKRNBYniMr4 //IvBvm+SWb2ngGhQyr/PC9plRb97PCDFWjg1/imCTdPYHt2Vd6LWX5+sJ6WPTMgffSpBlUHT +i/7M1q/XikKoubTGxwboq1Sj7+wtinkNpBDaUnvCwXR+utXNBXSf5bZL+rdi8mOIHMDwPzRj SwmdmL5thyoy9TjQqBaMlpmVUoMpqpK4B/2rLlq91tqzHPazC/O3vJvqEgAcfb5aiPfZNgRsx AKE3nPRDyfO6kb57jfROFxA3x3mAvSF/+Ho5ZCh71k7ZH/yUOerrwp7v4EU/1R2y11L6V7F7D pJdapDTbZMfV+BpR0NZZ8ok/2fWUkONEnmyiaioiQb0zIDIGWASHCnd2cK3zay/bkhcib0RWq /nZqOVVYXP+fMhsAQWZghj+MEAqJvJKwa2STObbT+Ks3RI0UK/pdtGJ0x759PdAJBcgtbl12N J7cUbAgBYCMDrd/Ezgqz7JWqYeuiWcVnnGygVmGFZh7sO/uavdJohdTE8w36uKGGOuaAiNoGN Ter2OCVMd558rKe9fWnq7mbG+15vHC9x0ySAKr4dSm6n2BGE7cEcj9PQsbWmyJHkVupMuUBeO lgnD+hsAz8euUTm9k/gOosBecB0vIknfqIuPooY5CKtu3RnjPwGbxgY/Zur5gSzIK32h+r4Hr IFLbDt/IeG8ySrtiy+Yk6pMgdSJsJlnRpPcxb3p4S6cCd4kpochqjFkKUlGJCzdvm4UAQT2Sz RAtAXzu/zzCNvsY3lMbBIOlFDIOJ3PWNgoyNMgH5p/3NwfxEfB5VK5311eMqD1qOhtKxjR2rk kiApL6RSndhKfZF/IodeUJqjWlKZ/95c52oHpNbS11yuM8fS3VzRH8EwG1O3dVfh4g52+TNK/ f6IfUWqhdp2UNA= 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 X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1645195857; 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=qc5EFpX8gQSZNo2AgxRiWzVltGCQ2MiYxb9HsGLkezQ=; b=ps5Ag9c5bwwy009wy7RqJkLg+g8ZM14xUsggRcXJHUq8R0ga5BLGRkh0ibRtfWoaXpWbHy UKfUpPMo0/q494BU+wG6cOuZ4Tmn42PdTvAqf7NS2cM8wyNZnSJqM9HhmZNYjG7haapHC6 BpbTzZfFREK0Pd83yyj6DEBjOQ4CrYSjOTV3q/OkAYiwNmlU+NZOOr9ANCu/WTu61aHw96 bcpVaULHWIKgKHr15ZXUW+yy6vzrJS4m6R8LOk+PWIgV2PBrVUZNjwCCqihQ0OHhwaNelw eCoRgHOrckJS1NJuQaZYzdcBhLHcwvANGPNQRl2CqyV/vDIjEX5MSh4KCBUJxA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1645195857; a=rsa-sha256; cv=none; b=mnj/SnLqE1Eqa23r4yhcKd/fhOqoWqahK8AOVLGLo0cKx5OM9iutvRcEwKg0spYdjfliz+ +0y9ngYIgJwWWTx2bzbTIqLPUIedmQKnYnAnP9MBUoE0SGWPA1xzAkG7P4cfGoivsRz9jD lmaW2b3H5RRpnIf5QNiztFh+mLc233e0jQBY9V6ABtlbhPZhT0hokFry4ZOqAjTrNrMiNf sBaT/t3qXee/pbJdnfnNbB5pchWIvIKBnrrtZi/IadLwnxxh9DA3g5sNJeRv+ba4GruI5h UaqdxhTuKA1eNqTFEt/dcnWVif7qx0e45kNFYCuji62mzlWEsEctKKK5iwbqoA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmx.net header.s=badeba3b8450 header.b="DO6f+/NY"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmx.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -0.63 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmx.net header.s=badeba3b8450 header.b="DO6f+/NY"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmx.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 98A9E2FF23 X-Spam-Score: -0.63 X-Migadu-Scanner: scn1.migadu.com X-TUID: 4gDk78i39niB * gnu/packages/tree-sitter.scm (tree-sitter-typescript): New variable. =2D-- gnu/packages/tree-sitter.scm | 69 ++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/gnu/packages/tree-sitter.scm b/gnu/packages/tree-sitter.scm index f4df5c5335..309b38386d 100644 =2D-- a/gnu/packages/tree-sitter.scm +++ b/gnu/packages/tree-sitter.scm @@ -731,3 +731,72 @@ (define-public tree-sitter-rust (description "This package provides a Rust grammar for the Tree-sitter library."= ) (license license:expat))) + +(define-public tree-sitter-typescript + (let ((commit "111b07762e86efab9a918b7c721f720c37e76b0a") + (revision "1")) + (package (inherit tree-sitter-c) + (name "tree-sitter-typescript") + (version (git-version "0.20.0" revision commit)) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/tree-sitter/tree-sitter-ty= pescript") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 "1364bm3wbqqzvp03cvpx1w89bbqynb1v62i46gy7f6rhib9= bf63a")) + (modules '((guix build utils))) + (snippet + '(begin + (delete-file "binding.gyp") + (delete-file-recursively "bindings") + (for-each + (lambda (lang) + (with-directory-excursion lang + (delete-file "src/grammar.json") + (delete-file "src/node-types.json") + (delete-file "src/parser.c") + (delete-file-recursively "src/tree_sitter"))) + '("typescript" "tsx")) + #t)))) + (inputs + (list `(,tree-sitter-javascript "js"))) + (arguments + (substitute-keyword-arguments (package-arguments tree-sitter-c) + ((#:phases phases) + #~(modify-phases #$phases + (replace 'build + (lambda _ + (for-each (lambda (dir) + (with-directory-excursion dir + (invoke "tree-sitter" "generate" "--no-bin= dings"))) + '("typescript" "tsx")))) + (replace 'check + (lambda _ + (for-each (lambda (dir) + (with-directory-excursion dir + (invoke "tree-sitter" "test"))) + '("typescript" "tsx")))) + (replace 'install + (lambda _ + (let ((lib (string-append #$output "/lib/tree-sitter/"))= ) + (mkdir-p lib) + (for-each + (lambda (lang) + (invoke #$(cxx-for-target) + "-shared" + "-fPIC" + "-fno-exceptions" + "-O2" + "-g" + "-o" (string-append lib "/" lang ".so") + "-xc" (string-append lang "/src/scanner.c") + "-xc" (string-append lang "/src/parser.c"))= ) + '("typescript" "tsx"))))))))) + (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-s= itter +library.") + (license license:expat)))) =2D- 2.34.0