From: Theodor Thornhill via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: 59737@debbugs.gnu.org
Subject: bug#59737: 29.0.60; Fix tree-sitter-build-scripts
Date: Thu, 01 Dec 2022 09:49:31 +0100 [thread overview]
Message-ID: <87mt87zexw.fsf@thornhill.no> (raw)
[-- Attachment #1: Type: text/plain, Size: 82 bytes --]
Hello there!
Attached is a patch to build typescript in addition to tsx.
Theo
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-tree-sitter-build-scripts.patch --]
[-- Type: text/x-diff, Size: 2605 bytes --]
From 077bd1ff9825721bc6023f9e81e379774429bb13 Mon Sep 17 00:00:00 2001
From: Theodor Thornhill <theo@thornhill.no>
Date: Thu, 1 Dec 2022 09:39:17 +0100
Subject: [PATCH] Fix tree-sitter build scripts
* admin/notes/tree-sitter/build-module/batch.sh (languages): Add tsx.
* admin/notes/tree-sitter/build-module/build.sh (lang): Make guards to
account for typescript/tsx. It's a little hacky because of the nested
nature of that particular repository.
---
admin/notes/tree-sitter/build-module/batch.sh | 1 +
admin/notes/tree-sitter/build-module/build.sh | 29 ++++++++++++-------
2 files changed, 20 insertions(+), 10 deletions(-)
diff --git a/admin/notes/tree-sitter/build-module/batch.sh b/admin/notes/tree-sitter/build-module/batch.sh
index deed18978a..d45f37f4b6 100755
--- a/admin/notes/tree-sitter/build-module/batch.sh
+++ b/admin/notes/tree-sitter/build-module/batch.sh
@@ -12,6 +12,7 @@ languages=
'python'
'rust'
'typescript'
+ 'tsx'
)
for language in "${languages[@]}"
diff --git a/admin/notes/tree-sitter/build-module/build.sh b/admin/notes/tree-sitter/build-module/build.sh
index 102ab310fa..02c6ebaf5d 100755
--- a/admin/notes/tree-sitter/build-module/build.sh
+++ b/admin/notes/tree-sitter/build-module/build.sh
@@ -12,20 +12,23 @@ lang=
echo "Building ${lang}"
# Retrieve sources.
-git clone "https://github.com/tree-sitter/tree-sitter-${lang}.git" \
- --depth 1 --quiet
-if [ "${lang}" == "typescript" ]
+if [ "${lang}" == "typescript" ] || [ "${lang}" == "tsx" ]
then
- lang="typescript/tsx"
+ git clone "https://github.com/tree-sitter/tree-sitter-typescript.git" \
+ --depth 1 --quiet
+
+ lang="typescript/${lang}"
+else
+ git clone "https://github.com/tree-sitter/tree-sitter-${lang}.git" \
+ --depth 1 --quiet
fi
-cp tree-sitter-lang.in "tree-sitter-${lang}/src"
-cp emacs-module.h "tree-sitter-${lang}/src"
+
cp "tree-sitter-${lang}/grammar.js" "tree-sitter-${lang}/src"
cd "tree-sitter-${lang}/src"
-if [ "${lang}" == "typescript/tsx" ]
+if [ "${lang}" == "typescript/$1" ]
then
- lang="tsx"
+ lang=$1
fi
# Build.
@@ -50,7 +53,7 @@ lang=
# Copy out.
-if [ "${lang}" == "typescript" ]
+if [ "${lang}" == "typescript" ] || [ "${lang}" == "tsx" ]
then
cp "libtree-sitter-${lang}.${soext}" ..
cd ..
@@ -59,4 +62,10 @@ lang=
mkdir -p ../../dist
cp "libtree-sitter-${lang}.${soext}" ../../dist
cd ../../
-rm -rf "tree-sitter-${lang}"
+
+if [ "${lang}" == "typescript" ] || [ "${lang}" == "tsx" ]
+then
+ rm -rf "tree-sitter-typescript"
+else
+ rm -rf "tree-sitter-${lang}"
+fi
--
2.34.1
next reply other threads:[~2022-12-01 8:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-01 8:49 Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2022-12-07 0:19 ` bug#59737: 29.0.60; Fix tree-sitter-build-scripts Yuan Fu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87mt87zexw.fsf@thornhill.no \
--to=bug-gnu-emacs@gnu.org \
--cc=59737@debbugs.gnu.org \
--cc=theo@thornhill.no \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).