summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur Zamarin <arthurzam@gentoo.org>2024-03-11 13:43:34 +0200
committerArthur Zamarin <arthurzam@gentoo.org>2024-03-23 10:27:40 +0200
commit2182b4ba4f8f1ea6fe9d92d4ea08591136cc0be1 (patch)
tree14829f82c11924f19a4efa159203761f0fc88576 /dev-libs
parentnet-misc/xmrig: add 6.21.2 (diff)
downloadgentoo-2182b4ba4f8f1ea6fe9d92d4ea08591136cc0be1.tar.gz
gentoo-2182b4ba4f8f1ea6fe9d92d4ea08591136cc0be1.tar.bz2
gentoo-2182b4ba4f8f1ea6fe9d92d4ea08591136cc0be1.zip
dev-libs/tree-sitter: add 0.22.1
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
Diffstat (limited to 'dev-libs')
-rw-r--r--dev-libs/tree-sitter/Manifest1
-rw-r--r--dev-libs/tree-sitter/files/tree-sitter-0.22.1-no-static.patch19
-rw-r--r--dev-libs/tree-sitter/tree-sitter-0.22.1.ebuild51
3 files changed, 71 insertions, 0 deletions
diff --git a/dev-libs/tree-sitter/Manifest b/dev-libs/tree-sitter/Manifest
index 3746d0c9031a..ca1e2342ab2e 100644
--- a/dev-libs/tree-sitter/Manifest
+++ b/dev-libs/tree-sitter/Manifest
@@ -1,2 +1,3 @@
DIST tree-sitter-0.20.8.tar.gz 2941223 BLAKE2B 158820a88b20cc96252f8bfdd257e910ca4dc79174bb45ee52623c923b8a634714c65be8f9534411865fb03aaf84bf16bf659567a74cd58141ea687fa89601e5 SHA512 30fa3f97e1a24d469a7565dc91db629accdfbe081b43d951e9751059a0c7f763d727e95efce5806cd9b1689650773bee1106f4f91ba001da57df3b0d83dda967
DIST tree-sitter-0.20.9.tar.gz 3041304 BLAKE2B a6cf6606f75918eeab7dab0d2758cdba0922b5677cd4c8755982c077ee0a734090c8a87f7dd1fd56525b5864f94f5f19c3fd04e43773877e13968855f976d0c0 SHA512 6882c0edf87232d42aa40936c6a2da46e6dbb89d28b3def67e9c5231af19a517fbe22cf0ce9aa25a8ad4252cef6cf4aa94a00f8d0503a8bdd99ce0edd99a392a
+DIST tree-sitter-0.22.1.tar.gz 3038644 BLAKE2B f4a2cae41e6ec327c8a77380fcf531b00a4fcd75997872c73371886379f35e31431da1e175e41b3c6bee9fdad46015d29bec93a103ea1ff36a1d365dc9a04d40 SHA512 fa2656ad3a6d52301b497512aecc87b8c50ab6646aaac4730a26249ed0878e4542e2d256e42e0179ebc06147f772a2cf38f9362bb94ea1a8f0ec8c21e06e75e7
diff --git a/dev-libs/tree-sitter/files/tree-sitter-0.22.1-no-static.patch b/dev-libs/tree-sitter/files/tree-sitter-0.22.1-no-static.patch
new file mode 100644
index 000000000000..c2bcb3cd6fd1
--- /dev/null
+++ b/dev-libs/tree-sitter/files/tree-sitter-0.22.1-no-static.patch
@@ -0,0 +1,19 @@
+--- a/Makefile
++++ b/Makefile
+@@ -45,7 +45,7 @@ ifneq ($(filter $(shell uname),FreeBSD NetBSD DragonFly),)
+ PCLIBDIR := $(PREFIX)/libdata/pkgconfig
+ endif
+
+-all: libtree-sitter.a libtree-sitter.$(SOEXT) tree-sitter.pc
++all: libtree-sitter.$(SOEXT) tree-sitter.pc
+
+ libtree-sitter.a: $(OBJ)
+ $(AR) $(ARFLAGS) $@ $^
+@@ -69,7 +69,6 @@ clean:
+ install: all
+ install -Dm644 lib/include/tree_sitter/api.h '$(DESTDIR)$(INCLUDEDIR)'/tree_sitter/api.h
+ install -Dm644 tree-sitter.pc '$(DESTDIR)$(PCLIBDIR)'/tree-sitter.pc
+- install -Dm644 libtree-sitter.a '$(DESTDIR)$(LIBDIR)'/libtree-sitter.a
+ install -m755 libtree-sitter.$(SOEXT) '$(DESTDIR)$(LIBDIR)'/libtree-sitter.$(SOEXTVER)
+ ln -sf libtree-sitter.$(SOEXTVER) '$(DESTDIR)$(LIBDIR)'/libtree-sitter.$(SOEXTVER_MAJOR)
+ ln -sf libtree-sitter.$(SOEXTVER_MAJOR) '$(DESTDIR)$(LIBDIR)'/libtree-sitter.$(SOEXT)
diff --git a/dev-libs/tree-sitter/tree-sitter-0.22.1.ebuild b/dev-libs/tree-sitter/tree-sitter-0.22.1.ebuild
new file mode 100644
index 000000000000..05b74b9f9391
--- /dev/null
+++ b/dev-libs/tree-sitter/tree-sitter-0.22.1.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# Bump tree-sitter-cli at the same time.
+
+EAPI=8
+
+inherit optfeature toolchain-funcs
+
+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"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-macos"
+fi
+
+LICENSE="MIT"
+SLOT="0"
+RESTRICT="test" # tests are for CLI and not the lib
+
+PATCHES=(
+ "${FILESDIR}/${PN}-0.22.1-no-static.patch"
+)
+
+src_prepare() {
+ default
+ tc-export CC
+}
+
+src_compile() {
+ emake \
+ PREFIX="${EPREFIX}/usr" \
+ LIBDIR="${EPREFIX}/usr/$(get_libdir)" \
+ STRIP="" \
+ CFLAGS="${CFLAGS}"
+}
+
+src_install() {
+ emake DESTDIR="${D}" \
+ PREFIX="${EPREFIX}/usr" \
+ LIBDIR="${EPREFIX}/usr/$(get_libdir)" \
+ install
+}
+
+pkg_postinst() {
+ optfeature "building and testing grammars" dev-util/tree-sitter-cli
+}