summaryrefslogtreecommitdiff
path: root/dev-python/tree-sitter/tree-sitter-0.20.1-r1.ebuild
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-10-14 00:19:02 +0100
committerV3n3RiX <venerix@koprulu.sector>2023-10-14 00:19:02 +0100
commit333918aa838615aed27cb5f4b49b87269868deeb (patch)
tree9781ce1626081e4dd17db9dd1cde49b9f89f194b /dev-python/tree-sitter/tree-sitter-0.20.1-r1.ebuild
parentb8330d80ce605a72596ccfa1bfc087b9ded559b8 (diff)
gentoo auto-resync : 14:10:2023 - 00:19:01
Diffstat (limited to 'dev-python/tree-sitter/tree-sitter-0.20.1-r1.ebuild')
-rw-r--r--dev-python/tree-sitter/tree-sitter-0.20.1-r1.ebuild64
1 files changed, 64 insertions, 0 deletions
diff --git a/dev-python/tree-sitter/tree-sitter-0.20.1-r1.ebuild b/dev-python/tree-sitter/tree-sitter-0.20.1-r1.ebuild
new file mode 100644
index 000000000000..f7fa52853dbd
--- /dev/null
+++ b/dev-python/tree-sitter/tree-sitter-0.20.1-r1.ebuild
@@ -0,0 +1,64 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_EXT=1
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{10..12} )
+
+inherit distutils-r1
+
+FIXTURE_PV=0.19.0
+
+DESCRIPTION="Python bindings to the Tree-sitter parsing library"
+HOMEPAGE="
+ https://github.com/tree-sitter/py-tree-sitter/
+ https://pypi.org/project/tree-sitter/
+"
+SRC_URI="
+ https://github.com/tree-sitter/py-tree-sitter/archive/v${PV}.tar.gz
+ -> ${P}.gh.tar.gz
+ test? (
+ https://github.com/tree-sitter/tree-sitter-javascript/archive/v${FIXTURE_PV}.tar.gz
+ -> tree-sitter-javascript-${FIXTURE_PV}.tar.gz
+ https://github.com/tree-sitter/tree-sitter-python/archive/v${FIXTURE_PV}.tar.gz
+ -> tree-sitter-python-${FIXTURE_PV}.tar.gz
+ )
+"
+S=${WORKDIR}/py-${P}
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ppc ppc64 ~riscv ~s390 sparc x86 ~x64-macos"
+
+DEPEND="dev-libs/tree-sitter:="
+RDEPEND="${DEPEND}
+ $(python_gen_cond_dep '
+ dev-python/setuptools[${PYTHON_USEDEP}]
+ ' 3.12)
+"
+
+distutils_enable_tests unittest
+
+PATCHES=(
+ "${FILESDIR}"/tree-sitter-0.19.0_p20210506-unbundle.patch
+)
+
+src_unpack() {
+ default
+ rmdir "${S}/tree_sitter/core" || die
+
+ if use test; then
+ mkdir "${S}/tests/fixtures" || die
+ local f
+ for f in tree-sitter-{javascript,python}; do
+ mv "${f}-${FIXTURE_PV}" "${S}/tests/fixtures/${f}" || die
+ done
+ fi
+}
+
+src_test() {
+ rm -r tree_sitter || die
+ distutils-r1_src_test
+}