mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-22 19:50:05 +02:00
tree-sitter: add recipe for 0.20.10~git (#9633)
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
From 46a5c1cce2765a7731ed30865f4cd8bb98c01c89 Mon Sep 17 00:00:00 2001
|
||||
From: Chris Roberts <cpr420@gmail.com>
|
||||
Date: Sat, 14 Oct 2023 21:58:18 -0600
|
||||
Subject: don't install static library
|
||||
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index eb4075f..f6bf6fa 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -41,7 +41,7 @@ ifneq (,$(filter $(shell uname),FreeBSD NetBSD DragonFly))
|
||||
PCLIBDIR := $(PREFIX)/libdata/pkgconfig
|
||||
endif
|
||||
|
||||
-all: libtree-sitter.a libtree-sitter.$(SOEXTVER)
|
||||
+all: libtree-sitter.$(SOEXTVER)
|
||||
|
||||
libtree-sitter.a: $(OBJ)
|
||||
$(AR) rcs $@ $^
|
||||
@@ -61,7 +61,6 @@ install: all
|
||||
tree-sitter.pc.in > tree-sitter.pc
|
||||
|
||||
install -d '$(DESTDIR)$(LIBDIR)'
|
||||
- install -m644 libtree-sitter.a '$(DESTDIR)$(LIBDIR)'/
|
||||
install -m755 libtree-sitter.$(SOEXTVER) '$(DESTDIR)$(LIBDIR)'/
|
||||
ln -sf libtree-sitter.$(SOEXTVER) '$(DESTDIR)$(LIBDIR)'/libtree-sitter.$(SOEXTVER_MAJOR)
|
||||
ln -sf libtree-sitter.$(SOEXTVER) '$(DESTDIR)$(LIBDIR)'/libtree-sitter.$(SOEXT)
|
||||
--
|
||||
2.42.0
|
||||
|
||||
74
dev-libs/tree-sitter/tree_sitter-0.20.10~git.recipe
Normal file
74
dev-libs/tree-sitter/tree_sitter-0.20.10~git.recipe
Normal file
@@ -0,0 +1,74 @@
|
||||
SUMMARY="An incremental parsing system for programming tools"
|
||||
DESCRIPTION="Tree-sitter is an extendable parsing system for various programming tools."
|
||||
HOMEPAGE="https://tree-sitter.github.io/"
|
||||
COPYRIGHT="2018-2023 Max Brunsfeld"
|
||||
LICENSE="MIT"
|
||||
REVISION="1"
|
||||
srcGitRev="20924fa4cdeb10d82ac308481e39bf8519334e55"
|
||||
SOURCE_URI="https://github.com/tree-sitter/tree-sitter/archive/$srcGitRev.tar.gz"
|
||||
CHECKSUM_SHA256="8aa9b4ad2d8ab69177912e6872dc94bb973b295e8718d62a599a49b62f9a9e5d"
|
||||
SOURCE_DIR="tree-sitter-$srcGitRev"
|
||||
PATCHES="tree_sitter-$portVersion.patchset"
|
||||
|
||||
ARCHITECTURES="all !x86_gcc2"
|
||||
SECONDARY_ARCHITECTURES="x86"
|
||||
|
||||
libVersion="0.0"
|
||||
libVersionCompat="$libVersion compat >= 0"
|
||||
|
||||
PROVIDES="
|
||||
tree_sitter$secondaryArchSuffix = $portVersion
|
||||
lib:libtree_sitter$secondaryArchSuffix = $libVersionCompat
|
||||
cmd:tree_sitter
|
||||
"
|
||||
REQUIRES="
|
||||
haiku$secondaryArchSuffix
|
||||
"
|
||||
|
||||
PROVIDES_devel="
|
||||
tree_sitter${secondaryArchSuffix}_devel
|
||||
devel:libtree_sitter$secondaryArchSuffix = $libVersionCompat
|
||||
"
|
||||
REQUIRES_devel="
|
||||
tree_sitter$secondaryArchSuffix == $portVersion base
|
||||
"
|
||||
|
||||
BUILD_REQUIRES="
|
||||
haiku${secondaryArchSuffix}_devel
|
||||
"
|
||||
BUILD_PREREQUIRES="
|
||||
cmd:gcc$secondaryArchSuffix
|
||||
cmd:cargo$secondaryArchSuffix >= 0.70.0
|
||||
cmd:make
|
||||
"
|
||||
|
||||
BUILD()
|
||||
{
|
||||
export CARGO_HOME=$sourceDir/.cargo
|
||||
|
||||
# will become the default with rust 1.70
|
||||
export CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
|
||||
|
||||
cargo fetch --locked
|
||||
make
|
||||
|
||||
cd cli
|
||||
cargo build --release --locked --offline --all-features
|
||||
}
|
||||
|
||||
INSTALL()
|
||||
{
|
||||
export CARGO_HOME=$sourceDir/.cargo
|
||||
|
||||
make PREFIX=$prefix INCLUDEDIR=$includeDir \
|
||||
LIBDIR=$libDir install
|
||||
|
||||
install -Dm 755 target/release/tree-sitter -t $prefix/bin
|
||||
|
||||
prepareInstalledDevelLib libtree-sitter
|
||||
fixPkgconfig
|
||||
|
||||
packageEntries devel \
|
||||
"$developDir"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user