blob 46fe3d2d8dbb80b9aef7e2046f59dbd17cc0d48b 1886 bytes (raw)
name: admin/notes/tree-sitter/build-module/build.sh # note: path name is non-authoritative(*)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
| | #!/bin/bash
lang=$1
topdir="$PWD"
case $(uname) in
"Darwin")
soext="dylib"
;;
*"MINGW"*)
soext="dll"
;;
*)
soext="so"
;;
esac
echo "Building ${lang}"
### Retrieve sources
org="tree-sitter"
repo="tree-sitter-${lang}"
sourcedir="tree-sitter-${lang}/src"
grammardir="tree-sitter-${lang}"
case "${lang}" in
"bicep")
org="amaanq"
;;
"cmake")
org="uyha"
;;
"dockerfile")
org="camdencheek"
;;
"elixir")
org="elixir-lang"
;;
"go-mod")
# The parser is called "gomod".
lang="gomod"
org="camdencheek"
;;
"heex")
org="phoenixframework"
;;
"lua")
org="MunifTanjim"
;;
"typescript")
sourcedir="tree-sitter-typescript/typescript/src"
grammardir="tree-sitter-typescript/typescript"
;;
"tsx")
repo="tree-sitter-typescript"
sourcedir="tree-sitter-typescript/tsx/src"
grammardir="tree-sitter-typescript/tsx"
;;
"yaml")
org="ikatyang"
;;
esac
git clone "https://github.com/${org}/${repo}.git" \
--depth 1 --quiet
cp "${grammardir}"/grammar.js "${sourcedir}"
# We have to go into the source directory to compile, because some
# C files refer to files like "../../common/scanner.h".
cd "${sourcedir}"
### Build
cc -fPIC -c -I. parser.c
# Compile scanner.c.
if test -f scanner.c
then
cc -fPIC -c -I. scanner.c
fi
# Compile scanner.cc.
if test -f scanner.cc
then
c++ -fPIC -I. -c scanner.cc
fi
# Link.
if test -f scanner.cc
then
c++ -fPIC -shared *.o -o "libtree-sitter-${lang}.${soext}"
else
cc -fPIC -shared *.o -o "libtree-sitter-${lang}.${soext}"
fi
### Copy out
mkdir -p "${topdir}/dist"
cp "libtree-sitter-${lang}.${soext}" "${topdir}/dist"
cd "${topdir}"
rm -rf "${repo}"
|
debug log:
solving 46fe3d2d8db ...
found 46fe3d2d8db in https://yhetil.org/emacs-devel/B0833DC8-21E7-48DF-9A15-9B7822ED0FA0@secure.kjonigsen.net/
found 969187b7f92 in https://git.savannah.gnu.org/cgit/emacs.git
preparing index
index prepared:
100755 969187b7f9244e25483fda8a063c564e601e006b admin/notes/tree-sitter/build-module/build.sh
applying [1/1] https://yhetil.org/emacs-devel/B0833DC8-21E7-48DF-9A15-9B7822ED0FA0@secure.kjonigsen.net/
diff --git a/admin/notes/tree-sitter/build-module/build.sh b/admin/notes/tree-sitter/build-module/build.sh
index 969187b7f92..46fe3d2d8db 100755
Checking patch admin/notes/tree-sitter/build-module/build.sh...
Applied patch admin/notes/tree-sitter/build-module/build.sh cleanly.
index at:
100755 46fe3d2d8dbb80b9aef7e2046f59dbd17cc0d48b admin/notes/tree-sitter/build-module/build.sh
(*) Git path names are given by the tree(s) the blob belongs to.
Blobs themselves have no identifier aside from the hash of its contents.^
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).