mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-29 11:38:52 +02:00
78 lines
1.8 KiB
Bash
78 lines
1.8 KiB
Bash
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-2026 Max Brunsfeld"
|
|
LICENSE="MIT"
|
|
REVISION="1"
|
|
srcGitRev="cf302b07d1cae984068b7eb44a6e44529566a8c9"
|
|
SOURCE_URI="https://github.com/tree-sitter/tree-sitter/archive/$srcGitRev.tar.gz"
|
|
CHECKSUM_SHA256="c6654f52b0d3eddc9cdc734e44faf3919994951f3feb663f0861eddd1ee4e63f"
|
|
SOURCE_DIR="tree-sitter-$srcGitRev"
|
|
PATCHES="tree_sitter-$portVersion.patchset"
|
|
|
|
ARCHITECTURES="all !x86_gcc2"
|
|
SECONDARY_ARCHITECTURES="x86"
|
|
|
|
libVersion="0.27"
|
|
libVersionCompat="$libVersion compat >= 0"
|
|
|
|
PROVIDES="
|
|
tree_sitter$secondaryArchSuffix = $portVersion
|
|
cmd:tree_sitter = $portVersion
|
|
lib:libtree_sitter$secondaryArchSuffix = $libVersionCompat
|
|
"
|
|
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
|
|
devel:libclang$secondaryArchSuffix >= 21
|
|
"
|
|
BUILD_PREREQUIRES="
|
|
cmd:cargo$secondaryArchSuffix
|
|
cmd:cmake
|
|
cmd:gcc$secondaryArchSuffix
|
|
cmd:make
|
|
"
|
|
|
|
BUILD()
|
|
{
|
|
export CARGO_HOME=$sourceDir/.cargo
|
|
export LIBCLANG_PATH=$(finddir B_SYSTEM_LIB_DIRECTORY)$secondaryArchSubDir
|
|
|
|
cargo fetch
|
|
make
|
|
|
|
cd crates/cli
|
|
cargo -v build --release --offline --no-default-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
|
|
|
|
ln -s $libDir/libtree-sitter.so.0.27 $libDir/libtree-sitter.so.0
|
|
|
|
packageEntries devel \
|
|
"$developDir"
|
|
}
|
|
|