Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/tree-sitter/
Date: Thu, 19 May 2022 12:54:36
Message-Id: 1652964819.402d73e94e5a57a80aab6e9f5f8f25a82a5981d6.mgorny@gentoo
1 commit: 402d73e94e5a57a80aab6e9f5f8f25a82a5981d6
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Thu May 19 12:44:59 2022 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Thu May 19 12:53:39 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=402d73e9
7
8 dev-python/tree-sitter: Use PEP517 build
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 .../tree-sitter/tree-sitter-0.20.0-r1.ebuild | 65 ++++++++++++++++++++++
13 1 file changed, 65 insertions(+)
14
15 diff --git a/dev-python/tree-sitter/tree-sitter-0.20.0-r1.ebuild b/dev-python/tree-sitter/tree-sitter-0.20.0-r1.ebuild
16 new file mode 100644
17 index 000000000000..b5e5fb8d350d
18 --- /dev/null
19 +++ b/dev-python/tree-sitter/tree-sitter-0.20.0-r1.ebuild
20 @@ -0,0 +1,65 @@
21 +# Copyright 1999-2022 Gentoo Authors
22 +# Distributed under the terms of the GNU General Public License v2
23 +
24 +EAPI=8
25 +
26 +DISTUTILS_USE_PEP517=setuptools
27 +PYTHON_COMPAT=( python3_{8..10} )
28 +
29 +inherit distutils-r1
30 +
31 +EGIT_COMMIT="4f39f6919ca3be8efb420a338fd2cf9b8b68b156"
32 +MY_P=py-tree-sitter-${EGIT_COMMIT}
33 +FIXTURE_PV=0.19.0
34 +
35 +DESCRIPTION="Python bindings to the Tree-sitter parsing library"
36 +HOMEPAGE="
37 + https://github.com/tree-sitter/py-tree-sitter/
38 + https://pypi.org/project/tree-sitter/
39 +"
40 +SRC_URI="
41 + https://github.com/tree-sitter/py-tree-sitter/archive/${EGIT_COMMIT}.tar.gz
42 + -> ${MY_P}.tar.gz
43 + test? (
44 + https://github.com/tree-sitter/tree-sitter-javascript/archive/v${FIXTURE_PV}.tar.gz
45 + -> tree-sitter-javascript-${FIXTURE_PV}.tar.gz
46 + https://github.com/tree-sitter/tree-sitter-python/archive/v${FIXTURE_PV}.tar.gz
47 + -> tree-sitter-python-${FIXTURE_PV}.tar.gz
48 + )
49 +"
50 +S=${WORKDIR}/${MY_P}
51 +
52 +LICENSE="MIT"
53 +SLOT="0"
54 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
55 +
56 +RDEPEND="
57 + dev-libs/tree-sitter:=
58 +"
59 +DEPEND="
60 + ${RDEPEND}
61 +"
62 +
63 +distutils_enable_tests unittest
64 +
65 +PATCHES=(
66 + "${FILESDIR}"/tree-sitter-0.19.0_p20210506-unbundle.patch
67 +)
68 +
69 +src_unpack() {
70 + default
71 + rmdir "${S}/tree_sitter/core" || die
72 +
73 + if use test; then
74 + mkdir "${S}/tests/fixtures" || die
75 + local f
76 + for f in tree-sitter-{javascript,python}; do
77 + mv "${f}-${FIXTURE_PV}" "${S}/tests/fixtures/${f}" || die
78 + done
79 + fi
80 +}
81 +
82 +src_test() {
83 + rm -r tree_sitter || die
84 + distutils-r1_src_test
85 +}