Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion common/shlibs
Original file line number Diff line number Diff line change
Expand Up @@ -4225,7 +4225,7 @@ libsword-1.9.0.so libsword-1.9.0_1
libgivaro.so.9 givaro-4.1.1_1
liblinbox.so.0 linbox-1.6.3_1
libpari-gmp-tls.so.9 pari-2.17.0_1
libtree-sitter.so.0.25 tree-sitter-0.25.2_1
libtree-sitter.so.0.26 tree-sitter-0.26.3_1
libplanarity.so.2 planarity-4.0.0.0_1
libgap.so.11 gap-4.16.0_1
libgtkdatabox.so.1 gtkdatabox3-1.0.0_1
Expand Down
100 changes: 100 additions & 0 deletions srcpkgs/emacs/patches/tree-sitter-0.26.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
Based on the following patch:
From d587ce8c65a0e22ab0a63ef2873a3dfcfbeba166 Mon Sep 17 00:00:00 2001
From: Eli Zaretskii <eliz@gnu.org>
Date: Fri, 17 Oct 2025 14:15:41 +0300
Subject: [PATCH] Support Tree-sitter version 0.26 and later

diff --git a/src/treesit.c b/src/treesit.c
index bf982de580bd..69751b5ea106 100644
--- a/emacs-30.2/src/treesit.c
+++ b/emacs-30.2/src/treesit.c
@@ -34,7 +34,11 @@ along with GNU Emacs. If not, see <http
# include "w32common.h"

/* In alphabetical order. */
+#if TREE_SITTER_LANGUAGE_VERSION >= 15
+#undef ts_language_abi_version
+#else
#undef ts_language_version
+#endif
#undef ts_node_child
#undef ts_node_child_by_field_name
#undef ts_node_child_count
@@ -89,7 +93,11 @@ along with GNU Emacs. If not, see <http
#undef ts_tree_get_changed_ranges
#undef ts_tree_root_node

+#if TREE_SITTER_LANGUAGE_VERSION >= 15
+DEF_DLL_FN (uint32_t, ts_language_abi_version, (const TSLanguage *));
+#else
DEF_DLL_FN (uint32_t, ts_language_version, (const TSLanguage *));
+#endif
DEF_DLL_FN (TSNode, ts_node_child, (TSNode, uint32_t));
DEF_DLL_FN (TSNode, ts_node_child_by_field_name,
(TSNode, const char *, uint32_t));
@@ -166,7 +174,11 @@ init_treesit_functions (void)
if (!library)
return false;

+#if TREE_SITTER_LANGUAGE_VERSION >= 15
+ LOAD_DLL_FN (library, ts_language_abi_version);
+#else
LOAD_DLL_FN (library, ts_language_version);
+#endif
LOAD_DLL_FN (library, ts_node_child);
LOAD_DLL_FN (library, ts_node_child_by_field_name);
LOAD_DLL_FN (library, ts_node_child_count);
@@ -224,7 +236,11 @@ init_treesit_functions (void)
return true;
}

+#if TREE_SITTER_LANGUAGE_VERSION >= 15
+#define ts_language_abi_version fn_ts_language_abi_version
+#else
#define ts_language_version fn_ts_language_version
+#endif
#define ts_node_child fn_ts_node_child
#define ts_node_child_by_field_name fn_ts_node_child_by_field_name
#define ts_node_child_count fn_ts_node_child_count
@@ -632,6 +648,22 @@ treesit_load_language_push_for_each_suff
}
}

+/* This function is a compatibility shim. Tree-sitter 0.25 introduced
+ ts_language_abi_version as a replacement for ts_language_version, and
+ tree-sitter 0.26 removed ts_language_version. Here we use the fact
+ that 0.25 bumped TREE_SITTER_LANGUAGE_VERSION to 15, to use the new
+ function instead of the old one, when Emacs is compiled against
+ tree-sitter version 0.25 or newer. */
+static uint32_t
+treesit_language_abi_version (const TSLanguage *ts_lang)
+{
+#if TREE_SITTER_LANGUAGE_VERSION >= 15
+ return ts_language_abi_version (ts_lang);
+#else
+ return ts_language_version (ts_lang);
+#endif
+}
+
/* Load the dynamic library of LANGUAGE_SYMBOL and return the pointer
to the language definition.

@@ -746,7 +778,7 @@ treesit_load_language (Lisp_Object langu
{
*signal_symbol = Qtreesit_load_language_error;
*signal_data = list2 (Qversion_mismatch,
- make_fixnum (ts_language_version (lang)));
+ make_fixnum (treesit_language_abi_version (lang)));
return NULL;
}
return lang;
@@ -817,7 +849,7 @@ Return nil if a grammar library for LANG
&signal_data);
if (ts_language == NULL)
return Qnil;
- uint32_t version = ts_language_version (ts_language);
+ uint32_t version = treesit_language_abi_version (ts_language);
return make_fixnum((ptrdiff_t) version);
}
}

2 changes: 1 addition & 1 deletion srcpkgs/emacs/template
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ desc_option_xpm="Enable support for XPM images"
build_options_default="cairo gif gmp gnutls harfbuzz jpeg m17n nativecomp
png sound sqlite svg tiff treesitter webp xml xpm"

post_extract() {
post_patch() {
# Just configuring in different directories results in
# spurious emacs rebuilds with incompatible build numbers.
cp -a emacs-* nox
Expand Down
2 changes: 1 addition & 1 deletion srcpkgs/neovim/template
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Template file for 'neovim'
pkgname=neovim
version=0.12.5
revision=1
revision=2
build_style=cmake
build_helper="qemu"
configure_args="-DCOMPILE_LUA=OFF -DENABLE_TRANSLATIONS=ON -DPREFER_LUA=$(vopt_if luajit OFF ON)"
Expand Down
2 changes: 1 addition & 1 deletion srcpkgs/rizin/template
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Rebuild cutter on update
pkgname=rizin
version=0.7.3
revision=5
revision=6
build_style=meson
configure_args="-D use_sys_capstone=enabled -D use_capstone_version=v5
-D use_sys_magic=enabled -D use_sys_libzip=enabled -D use_sys_zlib=enabled
Expand Down
7 changes: 4 additions & 3 deletions srcpkgs/tree-sitter/template
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
# Template file for 'tree-sitter'
pkgname=tree-sitter
version=0.25.10
version=0.26.8
revision=2

Check failure on line 4 in srcpkgs/tree-sitter/template

View workflow job for this annotation

GitHub Actions / Lint templates

Template Lint

revision should be set to 1 on update
build_style=cargo
make_install_args="--path=cli"
make_install_args="--path=crates/cli"
hostmakedepends="clang19-devel"
short_desc="Parser generator tool and incremental parsing library"
maintainer="Érico Nogueira <ericonr@disroot.org>"
license="MIT"
homepage="https://tree-sitter.github.io"
changelog="https://github.com/tree-sitter/tree-sitter/releases"
distfiles="https://github.com/tree-sitter/tree-sitter/archive/refs/tags/v${version}.tar.gz"
checksum=ad5040537537012b16ef6e1210a572b927c7cdc2b99d1ee88d44a7dcdc3ff44c
checksum=e6826b7533ec3a885aba598377a6d20b5a6321ff3db76968e960c2352d3a5077
make_check=no # tests require generating fixtures from remote repositories

post_build() {
Expand Down
Loading