commit:     52cc160503fcb07dfe87595299da9dc8b0349f5b
Author:     Matthew Smith <matt <AT> offtopica <DOT> uk>
AuthorDate: Sun Jan  2 15:06:16 2022 +0000
Commit:     Nick Sarnie <sarnex <AT> gentoo <DOT> org>
CommitDate: Sun Jan  2 17:51:03 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=52cc1605

dev-libs/tree-sitter: add 0.20.2

Signed-off-by: Matthew Smith <matt <AT> offtopica.uk>
Closes: https://github.com/gentoo/gentoo/pull/23632
Signed-off-by: Nick Sarnie <sarnex <AT> gentoo.org>

 dev-libs/tree-sitter/Manifest                  |   1 +
 dev-libs/tree-sitter/tree-sitter-0.20.2.ebuild | 171 +++++++++++++++++++++++++
 2 files changed, 172 insertions(+)

diff --git a/dev-libs/tree-sitter/Manifest b/dev-libs/tree-sitter/Manifest
index 8aaaed52f233..468ce91de5d5 100644
--- a/dev-libs/tree-sitter/Manifest
+++ b/dev-libs/tree-sitter/Manifest
@@ -83,6 +83,7 @@ DIST tinyvec_macros-0.1.0.crate 1817 BLAKE2B 
a3d1966bf57c11afcd026269135a6189f14
 DIST toml-0.5.8.crate 54219 BLAKE2B 
b4f9f563e5ba4574d4f2dcbe244378a2e1e984bd9fbbbfa5a06bdd5f8b8d677394f0db9cb8696f6936c80a52caa86b1b3ebaf3885c53855af23f03d318785f19
 SHA512 
26b7901ee4b7cbb4cf8ea57d365a99ed05e0a76e73452e47d4bcb3b4eeb7bbd393c13eea9ea33dc13622942efcda39acdba9425b74b40c920c9f19673a1f2082
 DIST tree-sitter-0.20.0.tar.gz 2876764 BLAKE2B 
058f62c2067ce5fcf9440f281c63908f93fda09a6b3604d7196b9c56a15ba88ded7d75f9c21b4c5c4209f587fb5f326ae655cb5f5d84b46bfd783b2147048568
 SHA512 
a51fa0af45a6a99bb74ff53c15a4d7939eb24c6720e65ec7a96f74ffbce54801f14539e071ec6a4891dae778d7dea5edcecc6dd57716cc70a891c9e6cfa55013
 DIST tree-sitter-0.20.1.tar.gz 2903038 BLAKE2B 
092b3110ca2dd2dc2f6298dad98c2400064ba7b7bce90cdf7c50bdfabf0bf52629f5315728b578ae46efc1a4c2f71ff024ffae202205a3b563188e3537565359
 SHA512 
172e9b2fba5d4610f663934dff1cf4580d09631a3d8d5d7249b6a80288aa9fdda9f5eac50a501935a87414563b46f843c3d98a1f7e45302a5c61dd3c08159606
+DIST tree-sitter-0.20.2.tar.gz 2904490 BLAKE2B 
cae19e3a66778ea72bf5cb0e5153bb6b7dfec0b059c01825377742886fadd52d789f456e82287d71841afad8bd5347361d5ef718b12e20e94c629480c43f4f33
 SHA512 
4b9a7da47b48b0003daf9af60f9d48aacf7c74d1c9e2645eafd74f62f568bc69e2fb36bb8f0c6b9f1dc85829e146786cc6bf7050ed1402167790b1552990665f
 DIST unicode-bidi-0.3.4.crate 32228 BLAKE2B 
853a85b29d1ac2025b7a28af64ead9387e3b4b1e790ad719d4374e349c1853ddbb5959a2890d9d6c94a5c28e4523fc3324deb6b1ed1aeb5e917f21b0e2516f6c
 SHA512 
170ce083fa82bed13ecc62d85cb882fdd6491ae721e1633d3c1a5d3cee69422153afcf6695765c0e8fc7035440d0370d34afac9e978cb27f7506c07cba300e1e
 DIST unicode-normalization-0.1.17.crate 100345 BLAKE2B 
2579748ab87f6d74ab8e845d88c1990e4ef32e46e38f9a1841e3381d257d973f2f8a9da359c8e3f11790a888acf81f548ed3b749a67bb3e95acf3b744dd063f3
 SHA512 
727b4844a4eb103375dff7d88d620e1fb581cbdf2523f07a5c1673ff333d772d48ffae7658bfe4816a5bb42de5f68a96e15be9341c540a0f746c2990eeccb3d6
 DIST unicode-width-0.1.8.crate 16732 BLAKE2B 
5aa7b87eef1322e4151a3fcf981ade311b8fa030527d7561815950e58d3f15156163dfe34da6a708c37dccc3f7652bf7fc2cd899fe8bb0118b67c4113ff3a2d2
 SHA512 
0abba6da6981a2451e01d93bbd47652c46eb6fb07cc0214f33259fb29945bfd5ee2b302e883ddca8f68e921635f222701b7310e7da2a5e225f854980d1e474b0

diff --git a/dev-libs/tree-sitter/tree-sitter-0.20.2.ebuild 
b/dev-libs/tree-sitter/tree-sitter-0.20.2.ebuild
new file mode 100644
index 000000000000..f85c79757058
--- /dev/null
+++ b/dev-libs/tree-sitter/tree-sitter-0.20.2.ebuild
@@ -0,0 +1,171 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+CARGO_OPTIONAL=1
+
+CRATES="
+       aho-corasick-0.7.15
+       ansi_term-0.11.0
+       ansi_term-0.12.1
+       anyhow-1.0.40
+       arrayref-0.3.6
+       arrayvec-0.5.2
+       ascii-1.0.0
+       atty-0.2.14
+       autocfg-1.0.1
+       base64-0.13.0
+       bitflags-1.2.1
+       blake2b_simd-0.5.11
+       bumpalo-3.6.1
+       cc-1.0.67
+       cfg-if-1.0.0
+       chrono-0.4.19
+       chunked_transfer-1.4.0
+       clap-2.33.3
+       constant_time_eq-0.1.5
+       crossbeam-utils-0.8.3
+       ctor-0.1.20
+       diff-0.1.12
+       difference-2.0.0
+       dirs-3.0.1
+       dirs-sys-0.3.5
+       either-1.6.1
+       form_urlencoded-1.0.1
+       getrandom-0.1.16
+       getrandom-0.2.2
+       glob-0.3.0
+       hashbrown-0.9.1
+       hermit-abi-0.1.18
+       html-escape-0.2.6
+       idna-0.2.2
+       indexmap-1.6.1
+       itoa-0.4.7
+       js-sys-0.3.48
+       lazy_static-1.4.0
+       libc-0.2.86
+       libloading-0.7.0
+       log-0.4.14
+       matches-0.1.8
+       memchr-2.3.4
+       num-integer-0.1.44
+       num-traits-0.2.14
+       once_cell-1.7.0
+       output_vt100-0.1.2
+       percent-encoding-2.1.0
+       ppv-lite86-0.2.10
+       pretty_assertions-0.7.2
+       proc-macro2-1.0.24
+       quote-1.0.9
+       rand-0.8.3
+       rand_chacha-0.3.0
+       rand_core-0.6.2
+       rand_hc-0.3.0
+       redox_syscall-0.1.57
+       redox_syscall-0.2.5
+       redox_users-0.3.5
+       regex-1.4.3
+       regex-syntax-0.6.22
+       remove_dir_all-0.5.3
+       rust-argon2-0.8.3
+       rustc-hash-1.1.0
+       ryu-1.0.5
+       same-file-1.0.6
+       serde-1.0.130
+       serde_derive-1.0.130
+       serde_json-1.0.63
+       smallbitvec-2.5.1
+       strsim-0.8.0
+       syn-1.0.67
+       tempfile-3.2.0
+       textwrap-0.11.0
+       thiserror-1.0.25
+       thiserror-impl-1.0.25
+       thread_local-1.1.3
+       time-0.1.43
+       tiny_http-0.8.0
+       tinyvec-1.1.1
+       tinyvec_macros-0.1.0
+       toml-0.5.8
+       unicode-bidi-0.3.4
+       unicode-normalization-0.1.17
+       unicode-width-0.1.8
+       unicode-xid-0.2.1
+       url-2.2.1
+       utf8-width-0.1.4
+       vec_map-0.8.2
+       walkdir-2.3.1
+       wasi-0.9.0+wasi-snapshot-preview1
+       wasi-0.10.2+wasi-snapshot-preview1
+       wasm-bindgen-0.2.71
+       wasm-bindgen-backend-0.2.71
+       wasm-bindgen-macro-0.2.71
+       wasm-bindgen-macro-support-0.2.71
+       wasm-bindgen-shared-0.2.71
+       web-sys-0.3.48
+       webbrowser-0.5.5
+       which-4.1.0
+       widestring-0.4.3
+       winapi-0.3.9
+       winapi-i686-pc-windows-gnu-0.4.0
+       winapi-util-0.1.5
+       winapi-x86_64-pc-windows-gnu-0.4.0
+"
+
+inherit toolchain-funcs cargo
+
+DESCRIPTION="Tree-sitter is a parser generator tool and an incremental parsing 
library"
+HOMEPAGE="https://github.com/tree-sitter/tree-sitter";
+
+if [[ ${PV} == *9999* ]]; then
+       inherit git-r3
+       EGIT_REPO_URI="https://github.com/${PN}/${PN}";
+else
+       SRC_URI="
+               https://github.com/${PN}/${PN}/archive/refs/tags/v${PV}.tar.gz 
-> ${P}.tar.gz
+               ts-cli? ( $(cargo_crate_uris) )
+       "
+       KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~riscv 
~s390 ~sparc ~x86"
+fi
+
+LICENSE="MIT ts-cli? ( Apache-2.0 BSD-2 CC0-1.0 ISC MIT )"
+SLOT="0"
+
+IUSE="ts-cli"
+
+BDEPEND="ts-cli? ( virtual/rust )"
+
+PATCHES=(
+       "${FILESDIR}/${PN}-No-static-libs-gentoo.patch"
+)
+
+src_unpack() {
+       if [[ ${PV} == *9999* ]]; then
+               git-r3_src_unpack
+               use ts-cli && cargo_live_src_unpack
+       else
+               # behaves as default too, so it is ok to call it unconditonally
+               cargo_src_unpack
+       fi
+}
+
+src_prepare() {
+       default
+       tc-export CC
+}
+
+src_configure() {
+       default
+       use ts-cli && cargo_src_configure
+}
+
+src_compile() {
+       default
+       use ts-cli && cargo_src_compile
+}
+
+src_install() {
+       emake DESTDIR="${D}" PREFIX="${EPREFIX}/usr" 
LIBDIR="${EPREFIX}/usr/$(get_libdir)" install
+       use ts-cli && cargo_src_install --path "./cli"
+}

Reply via email to