all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#59737: 29.0.60; Fix tree-sitter-build-scripts
@ 2022-12-01  8:49 Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2022-12-07  0:19 ` Yuan Fu
  0 siblings, 1 reply; 2+ messages in thread
From: Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-12-01  8:49 UTC (permalink / raw)
  To: 59737

[-- 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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* bug#59737: 29.0.60; Fix tree-sitter-build-scripts
  2022-12-01  8:49 bug#59737: 29.0.60; Fix tree-sitter-build-scripts Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2022-12-07  0:19 ` Yuan Fu
  0 siblings, 0 replies; 2+ messages in thread
From: Yuan Fu @ 2022-12-07  0:19 UTC (permalink / raw)
  To: Theodor Thornhill; +Cc: 59737-done, 59737


Theodor Thornhill <theo@thornhill.no> writes:

> Hello there!
>
> Attached is a patch to build typescript in addition to tsx.
>
> Theo

Ah, I was trying to find this bug report and wasn’t able to. Turns out
the default filter of debbugs.el filsters out wishlist by default :-(

Anyway, I worked on the build script and it should now produce tsx and
typescript separately. Thanks!

Yuan





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-12-07  0:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-01  8:49 bug#59737: 29.0.60; Fix tree-sitter-build-scripts Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-07  0:19 ` Yuan Fu

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.