robin/laufey

git clone https://git.robinwobin.dev/robin/laufey

robinmerge: 9a29622b3b00ddb601

master
1.5 KiB39 linesraw
1const std = @import("std");
2const LazyPath = std.Build.LazyPath;
3
4pub const SourceItem = struct { name: []u8, api_export: bool };
5
6pub fn nvim_gen_runtime(
7    b: *std.Build,
8    nlua0: *std.Build.Step.Compile,
9    funcs_data: LazyPath,
10) !*std.Build.Step.WriteFile {
11    const gen_runtime = b.addWriteFiles();
12
13    {
14        const gen_step = b.addRunArtifact(nlua0);
15        gen_step.addFileArg(b.path("src/gen/gen_vimvim.lua"));
16        const file = gen_step.addOutputFileArg("generated.vim");
17        _ = gen_runtime.addCopyFile(file, "syntax/vim/generated.vim");
18        gen_step.addFileArg(funcs_data);
19        gen_step.addFileArg(b.path("src/nvim/options.lua"));
20        gen_step.addFileArg(b.path("src/nvim/auevents.lua"));
21        gen_step.addFileArg(b.path("src/nvim/ex_cmds.lua"));
22        gen_step.addFileArg(b.path("src/nvim/vvars.lua"));
23    }
24
25    {
26        const install_doc_files = b.addInstallDirectory(.{ .source_dir = b.path("runtime/doc"), .install_dir = .prefix, .install_subdir = "runtime/doc" });
27        gen_runtime.step.dependOn(&install_doc_files.step);
28
29        const gen_step = b.addRunArtifact(nlua0);
30        gen_step.addFileArg(b.path("src/gen/gen_helptags.lua"));
31        const file = gen_step.addOutputFileArg("tags");
32        _ = gen_runtime.addCopyFile(file, "doc/tags");
33        gen_step.addDirectoryArg(b.path("runtime/doc"));
34        gen_step.addArg("++t");
35        gen_step.has_side_effects = true; // workaround: missing detection of input changes
36    }
37
38    return gen_runtime;
39}