Skip to content

Commit 5aebba9

Browse files
tree-sitter: add new package
Tree-sitter is an incremental parsing library. It can build a concrete syntax tree for a source file and efficiently update the syntax tree as the source file is edited. Signed-off-by: Valeriy Kosikhin <[email protected]>
1 parent 37bfd2b commit 5aebba9

File tree

2 files changed

+67
-0
lines changed

2 files changed

+67
-0
lines changed

libs/tree-sitter/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2018 Max Brunsfeld
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

libs/tree-sitter/Makefile

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
include $(TOPDIR)/rules.mk
2+
3+
PKG_NAME:=tree-sitter
4+
PKG_VERSION:=0.25.10
5+
PKG_RELEASE:=1
6+
7+
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
8+
PKG_SOURCE_URL:=https://codeload.github.com/tree-sitter/tree-sitter/tar.gz/v$(PKG_VERSION)?
9+
PKG_HASH:=ad5040537537012b16ef6e1210a572b927c7cdc2b99d1ee88d44a7dcdc3ff44c
10+
11+
PKG_MAINTAINER:=
12+
PKG_LICENSE:=MIT
13+
PKG_LICENSE_FILES:=LICENSE
14+
15+
PKG_BUILD_PARALLEL:=1
16+
PKG_INSTALL:=1
17+
18+
include $(INCLUDE_DIR)/package.mk
19+
20+
define Package/libtree-sitter
21+
SECTION:=libs
22+
CATEGORY:=Libraries
23+
TITLE:=Incremental parsing system for programming tools
24+
URL:=https://tree-sitter.github.io/
25+
endef
26+
27+
define Package/libtree-sitter/description
28+
Tree-sitter is an incremental parsing library.
29+
For the CLI tool, see tree-sitter-cli.
30+
endef
31+
32+
define Build/InstallDev
33+
$(INSTALL_DIR) $(1)/usr/include/tree_sitter
34+
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
35+
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/local/include/tree_sitter/api.h $(1)/usr/include/tree_sitter/
36+
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/local/lib/pkgconfig/tree-sitter.pc $(1)/usr/lib/pkgconfig/
37+
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/local/lib/libtree-sitter.a $(1)/usr/lib/
38+
$(CP) $(PKG_INSTALL_DIR)/usr/local/lib/libtree-sitter.so* $(1)/usr/lib/
39+
endef
40+
41+
define Package/libtree-sitter/install
42+
$(INSTALL_DIR) $(1)/usr/lib
43+
$(CP) $(PKG_INSTALL_DIR)/usr/local/lib/libtree-sitter.so* $(1)/usr/lib/
44+
endef
45+
46+
$(eval $(call BuildPackage,libtree-sitter))

0 commit comments

Comments
 (0)