tree-sitter: add disabled recipe for new version

Reproducer for Rust crash.
This commit is contained in:
PulkoMandy
2025-09-09 20:10:20 +02:00
parent cf9aff2073
commit 2a3236e443
2 changed files with 110 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
From feb2da7b3a6b8d5962786b667847a3e781263505 Mon Sep 17 00:00:00 2001
From: PulkoMandy <pulkomandy@pulkomandy.tk>
Date: Tue, 9 Sep 2025 20:07:53 +0200
Subject: Fixes for Haiku:
- Use newer version of fs4 which pulls Rustix 1.x, that includes Haiku
support
- Define what to do for Haiku in endian.h
diff --git a/Cargo.toml b/Cargo.toml
index 134bb08..e19b4d9 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -118,7 +118,7 @@ ctrlc = { version = "3.4.5", features = ["termination"] }
dialoguer = { version = "0.11.0", features = ["fuzzy-select"] }
etcetera = "0.8.0"
filetime = "0.2.25"
-fs4 = "0.12.0"
+fs4 = "0.13.1"
git2 = "0.20.0"
glob = "0.3.2"
heck = "0.5.0"
diff --git a/lib/src/portable/endian.h b/lib/src/portable/endian.h
index f467ec5..5f88b5d 100644
--- a/lib/src/portable/endian.h
+++ b/lib/src/portable/endian.h
@@ -18,6 +18,7 @@
#if defined(HAVE_ENDIAN_H) || \
defined(__linux__) || \
defined(__GNU__) || \
+ defined(__HAIKU__) || \
defined(__illumos__) || \
defined(__NetBSD__) || \
defined(__OpenBSD__) || \
--
2.50.1

View File

@@ -0,0 +1,73 @@
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-2025 Max Brunsfeld"
LICENSE="MIT"
REVISION="1"
SOURCE_URI="https://github.com/tree-sitter/tree-sitter/archive/v$portVersion.tar.gz"
SOURCE_DIR="tree-sitter-$portVersion"
CHECKSUM_SHA256="178b575244d967f4920a4642408dc4edf6de96948d37d7f06e5b78acee9c0b4e"
PATCHES="tree_sitter-$portVersion.patchset"
# Disabled:
# - Needs fixes in rustix, https://github.com/bytecodealliance/rustix/pull/1515
# - rustc crashes during build
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:cmake
cmd:make
"
BUILD()
{
export CARGO_HOME=$sourceDir/.cargo
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"
}