build: make build.zig generate helptags without running "nvim" binary

This is matters for cross-compiling where we might not
be able to run the "nvim" binary on the host.

Instead reimplement the helptags extractor as a small
lua script, which we can run on the host using the nlua0
helper already used for other generator scripts.
This commit is contained in:
bfredl
2025-05-25 14:14:28 +02:00
parent 25bc41847e
commit 6b936002cc
6 changed files with 104 additions and 12 deletions

View File

@@ -8,6 +8,7 @@ pub fn build_nlua0(
use_luajit: bool,
ziglua: *std.Build.Dependency,
lpeg: *std.Build.Dependency,
libluv: *std.Build.Step.Compile,
) *std.Build.Step.Compile {
const options = b.addOptions();
options.addOption(bool, "use_luajit", use_luajit);
@@ -39,6 +40,7 @@ pub fn build_nlua0(
mod.addImport("embedded_data", embedded_data);
// addImport already links by itself. but we need headers as well..
mod.linkLibrary(ziglua.artifact("lua"));
mod.linkLibrary(libluv);
mod.addOptions("options", options);