pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: pkgsrc/editors/neovim
Module Name: pkgsrc
Committed By: wiz
Date: Tue Dec 23 00:07:16 UTC 2025
Modified Files:
pkgsrc/editors/neovim: Makefile distinfo
Added Files:
pkgsrc/editors/neovim/patches:
patch-runtime_lua_vim_treesitter___meta_misc.lua
patch-runtime_lua_vim_treesitter_languagetree.lua
patch-src_nvim_lua_treesitter.c
Log Message:
neovim: fix build with tree-sitter 0.26
Bump PKGREVISION.
To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 pkgsrc/editors/neovim/Makefile
cvs rdiff -u -r1.16 -r1.17 pkgsrc/editors/neovim/distinfo
cvs rdiff -u -r0 -r1.1 \
pkgsrc/editors/neovim/patches/patch-runtime_lua_vim_treesitter___meta_misc.lua \
pkgsrc/editors/neovim/patches/patch-runtime_lua_vim_treesitter_languagetree.lua \
pkgsrc/editors/neovim/patches/patch-src_nvim_lua_treesitter.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: pkgsrc/editors/neovim/Makefile
diff -u pkgsrc/editors/neovim/Makefile:1.19 pkgsrc/editors/neovim/Makefile:1.20
--- pkgsrc/editors/neovim/Makefile:1.19 Tue Nov 4 21:14:00 2025
+++ pkgsrc/editors/neovim/Makefile Tue Dec 23 00:07:15 2025
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.19 2025/11/04 21:14:00 leot Exp $
+# $NetBSD: Makefile,v 1.20 2025/12/23 00:07:15 wiz Exp $
DISTNAME= neovim-0.11.5
+PKGREVISION= 1
CATEGORIES= editors
MASTER_SITES= ${MASTER_SITE_GITHUB:=neovim/}
GITHUB_TAG= v${PKGVERSION_NOREV}
@@ -51,6 +52,13 @@ post-install:
--replace-needed ${BUILDLINK_DIR.lua-lpeg}/lib/lua/5.1/lpeg.so lpeg.so
.endif
+# due to pkgsrc patches, remove when they are gone
+.PHONY: cleanorig
+post-install: cleanorig
+cleanorig:
+ ${RM} ${DESTDIR}${PREFIX}/share/nvim/runtime/lua/vim/treesitter/_meta/misc.lua.orig
+ ${RM} ${DESTDIR}${PREFIX}/share/nvim/runtime/lua/vim/treesitter/languagetree.lua.orig
+
.include "../../converters/libiconv/buildlink3.mk"
.include "../../converters/utf8proc/buildlink3.mk"
.include "../../devel/cmake/build.mk"
Index: pkgsrc/editors/neovim/distinfo
diff -u pkgsrc/editors/neovim/distinfo:1.16 pkgsrc/editors/neovim/distinfo:1.17
--- pkgsrc/editors/neovim/distinfo:1.16 Tue Nov 4 21:14:00 2025
+++ pkgsrc/editors/neovim/distinfo Tue Dec 23 00:07:15 2025
@@ -1,5 +1,8 @@
-$NetBSD: distinfo,v 1.16 2025/11/04 21:14:00 leot Exp $
+$NetBSD: distinfo,v 1.17 2025/12/23 00:07:15 wiz Exp $
BLAKE2s (neovim-0.11.5.tar.gz) = 390b8ce8037b77e5f99afb2ba99616d39a8989f3fb76b499763810eb292242fd
SHA512 (neovim-0.11.5.tar.gz) = 1b2bb241261eefd195275e28bb9ebe4102261d61d8b7fe38ccebad7131ccc38d29fae8494d511b4c440ad71ef95dc405a2ba6e98b5d47426f215c8137c8bc91f
Size (neovim-0.11.5.tar.gz) = 12979925 bytes
+SHA1 (patch-runtime_lua_vim_treesitter___meta_misc.lua) = 1786ffc397926ae2587e82fba3959cb02e7b249c
+SHA1 (patch-runtime_lua_vim_treesitter_languagetree.lua) = acaecd3d21a57dfb99c7282d250266d72092ce88
+SHA1 (patch-src_nvim_lua_treesitter.c) = 776a7bf680fe00399ecbafdc3ce7323b312b3cdb
Added files:
Index: pkgsrc/editors/neovim/patches/patch-runtime_lua_vim_treesitter___meta_misc.lua
diff -u /dev/null pkgsrc/editors/neovim/patches/patch-runtime_lua_vim_treesitter___meta_misc.lua:1.1
--- /dev/null Tue Dec 23 00:07:16 2025
+++ pkgsrc/editors/neovim/patches/patch-runtime_lua_vim_treesitter___meta_misc.lua Tue Dec 23 00:07:15 2025
@@ -0,0 +1,21 @@
+$NetBSD: patch-runtime_lua_vim_treesitter___meta_misc.lua,v 1.1 2025/12/23 00:07:15 wiz Exp $
+
+Fix build with tree-sitter 0.26.
+https://github.com/subnut/cports/blob/neovim-wasm/main/neovim/patches/backport-33141.patch
+
+--- runtime/lua/vim/treesitter/_meta/misc.lua.orig 2025-11-02 16:14:24.000000000 +0000
++++ runtime/lua/vim/treesitter/_meta/misc.lua
+@@ -5,12 +5,10 @@ error('Cannot require a meta file')
+ ---@alias TSLoggerCallback fun(logtype: 'parse'|'lex', msg: string)
+
+ ---@class TSParser: userdata
+----@field parse fun(self: TSParser, tree: TSTree?, source: integer|string, include_bytes: boolean): TSTree, (Range4|Range6)[]
++---@field parse fun(self: TSParser, tree: TSTree?, source: integer|string, include_bytes: boolean, timeout_ns: integer?): TSTree?, (Range4|Range6)[]
+ ---@field reset fun(self: TSParser)
+ ---@field included_ranges fun(self: TSParser, include_bytes: boolean?): integer[]
+ ---@field set_included_ranges fun(self: TSParser, ranges: (Range6|TSNode)[])
+----@field set_timeout fun(self: TSParser, timeout: integer)
+----@field timeout fun(self: TSParser): integer
+ ---@field _set_logger fun(self: TSParser, lex: boolean, parse: boolean, cb: TSLoggerCallback)
+ ---@field _logger fun(self: TSParser): TSLoggerCallback
+
Index: pkgsrc/editors/neovim/patches/patch-runtime_lua_vim_treesitter_languagetree.lua
diff -u /dev/null pkgsrc/editors/neovim/patches/patch-runtime_lua_vim_treesitter_languagetree.lua:1.1
--- /dev/null Tue Dec 23 00:07:16 2025
+++ pkgsrc/editors/neovim/patches/patch-runtime_lua_vim_treesitter_languagetree.lua Tue Dec 23 00:07:16 2025
@@ -0,0 +1,29 @@
+$NetBSD: patch-runtime_lua_vim_treesitter_languagetree.lua,v 1.1 2025/12/23 00:07:16 wiz Exp $
+
+Fix build with tree-sitter 0.26.
+https://github.com/subnut/cports/blob/neovim-wasm/main/neovim/patches/backport-33141.patch
+
+--- runtime/lua/vim/treesitter/languagetree.lua.orig 2025-12-23 00:02:36.443793560 +0000
++++ runtime/lua/vim/treesitter/languagetree.lua
+@@ -1010,7 +1010,7 @@ function LanguageTree:_get_injections(ra
+
+ ---@type table<integer,vim.treesitter.languagetree.Injection>
+ local injections = {}
+- local start = vim.uv.hrtime()
++ local start = hrtime()
+
+ local full_scan = range == true or self._injection_query.has_combined_injections
+
+@@ -1034,9 +1034,9 @@ function LanguageTree:_get_injections(ra
+ end
+
+ -- Check the current function duration against the timeout, if it exists.
+- local current_time = vim.uv.hrtime()
+- self:_subtract_time(thread_state, (current_time - start) / 1000000)
+- start = current_time
++ local current_time = hrtime()
++ self:_subtract_time(thread_state, current_time - start)
++ start = hrtime()
+ end
+ end
+
Index: pkgsrc/editors/neovim/patches/patch-src_nvim_lua_treesitter.c
diff -u /dev/null pkgsrc/editors/neovim/patches/patch-src_nvim_lua_treesitter.c:1.1
--- /dev/null Tue Dec 23 00:07:16 2025
+++ pkgsrc/editors/neovim/patches/patch-src_nvim_lua_treesitter.c Tue Dec 23 00:07:16 2025
@@ -0,0 +1,114 @@
+$NetBSD: patch-src_nvim_lua_treesitter.c,v 1.1 2025/12/23 00:07:16 wiz Exp $
+
+Fix build with tree-sitter 0.26.
+https://github.com/subnut/cports/blob/neovim-wasm/main/neovim/patches/backport-33141.patch
+
+--- src/nvim/lua/treesitter.c.orig 2025-11-02 16:14:24.000000000 +0000
++++ src/nvim/lua/treesitter.c
+@@ -15,6 +15,8 @@
+ #include <tree_sitter/api.h>
+ #include <uv.h>
+
++#include "nvim/os/time.h"
++
+ #ifdef HAVE_WASMTIME
+ # include <wasm.h>
+
+@@ -53,6 +55,11 @@ typedef struct {
+ const TSTree *tree;
+ } TSLuaTree;
+
++typedef struct {
++ uint64_t parse_start_time;
++ uint64_t timeout_threshold_ns;
++} TSLuaParserCallbackPayload;
++
+ #ifdef INCLUDE_GENERATED_DECLARATIONS
+ # include "lua/treesitter.c.generated.h"
+ #endif
+@@ -363,8 +370,6 @@ static struct luaL_Reg parser_meta[] = {
+ { "reset", parser_reset },
+ { "set_included_ranges", parser_set_ranges },
+ { "included_ranges", parser_get_ranges },
+- { "set_timeout", parser_set_timeout },
+- { "timeout", parser_get_timeout },
+ { "_set_logger", parser_set_logger },
+ { "_logger", parser_get_logger },
+ { NULL, NULL }
+@@ -488,6 +493,13 @@ static void push_ranges(lua_State *L, co
+ }
+ }
+
++static bool on_parser_progress(TSParseState *state)
++{
++ TSLuaParserCallbackPayload *payload = state->payload;
++ uint64_t parse_time = os_hrtime() - payload->parse_start_time;
++ return parse_time >= payload->timeout_threshold_ns;
++}
++
+ static int parser_parse(lua_State *L)
+ {
+ TSParser *p = parser_check(L, 1);
+@@ -525,7 +537,17 @@ static int parser_parse(lua_State *L)
+ }
+
+ input = (TSInput){ (void *)buf, input_cb, TSInputEncodingUTF8, NULL };
+- new_tree = ts_parser_parse(p, old_tree, input);
++ if (!lua_isnil(L, 5)) {
++ uint64_t timeout_ns = (uint64_t)lua_tointeger(L, 5);
++ TSLuaParserCallbackPayload payload =
++ (TSLuaParserCallbackPayload){ .parse_start_time = os_hrtime(),
++ .timeout_threshold_ns = timeout_ns };
++ TSParseOptions parse_options = { .payload = &payload,
++ .progress_callback = on_parser_progress };
++ new_tree = ts_parser_parse_with_options(p, old_tree, input, parse_options);
++ } else {
++ new_tree = ts_parser_parse(p, old_tree, input);
++ }
+
+ break;
+
+@@ -535,12 +557,11 @@ static int parser_parse(lua_State *L)
+
+ bool include_bytes = (lua_gettop(L) >= 4) && lua_toboolean(L, 4);
+
+- // Sometimes parsing fails (timeout, or wrong parser ABI)
+- // In those case, just return an error.
+ if (!new_tree) {
+- if (ts_parser_timeout_micros(p) == 0) {
+- // No timeout set, must have had an error
+- return luaL_error(L, "An error occurred when parsing.");
++ // Sometimes parsing fails (no language was set, or it was set to one with an incompatible ABI)
++ // In those cases, just return an error.
++ if (!ts_parser_language(p)) {
++ return luaL_error(L, "Language was unset, or has an incompatible ABI.");
+ }
+ return 0;
+ }
+@@ -671,26 +692,6 @@ static int parser_get_ranges(lua_State *
+ return 1;
+ }
+
+-static int parser_set_timeout(lua_State *L)
+-{
+- TSParser *p = parser_check(L, 1);
+-
+- if (lua_gettop(L) < 2) {
+- luaL_error(L, "integer expected");
+- }
+-
+- uint32_t timeout = (uint32_t)luaL_checkinteger(L, 2);
+- ts_parser_set_timeout_micros(p, timeout);
+- return 0;
+-}
+-
+-static int parser_get_timeout(lua_State *L)
+-{
+- TSParser *p = parser_check(L, 1);
+- lua_pushinteger(L, (lua_Integer)ts_parser_timeout_micros(p));
+- return 1;
+-}
+-
+ static void logger_cb(void *payload, TSLogType logtype, const char *s)
+ {
+ TSLuaLoggerOpts *opts = (TSLuaLoggerOpts *)payload;
Home |
Main Index |
Thread Index |
Old Index