diff options
Diffstat (limited to 'build.zig')
| -rw-r--r-- | build.zig | 36 |
1 files changed, 18 insertions, 18 deletions
@@ -25,7 +25,7 @@ const deps_text = blk: { break :blk text; }; -pub const Platform = enum { tty, gui, web, macos, esp32p4 }; +pub const Platform = enum { tui, gui, web, macos, esp32p4 }; const PerfBuild = struct { compiler: []const u8, @@ -71,8 +71,8 @@ const gui_shaders = [_][]const u8{ }; pub fn build(b: *std.Build) void { - const requested_platform = b.option(Platform, "platform", "which shell to build (tty, gui, web, macos, esp32p4); absent builds the tty cli and the SDL gui together"); - const platform = requested_platform orelse .tty; + const requested_platform = b.option(Platform, "platform", "which shell to build (tui, gui, web, macos, esp32p4); absent builds the tui cli and the SDL gui together"); + const platform = requested_platform orelse .tui; const also_gui = requested_platform == null; // A bare `zig build` also copies the binaries into ~/.local/bin. Zig // 0.17 keeps the prefix in the maker process, out of this script's @@ -97,7 +97,7 @@ pub fn build(b: *std.Build) void { .os_version_min = .{ .semver = macos_min_version }, } else .{}, .esp32p4 => esp32p4_target, - .tty, .gui, .web => .{ + .tui, .gui, .web => .{ .cpu_arch = .x86_64, .os_tag = .linux, .abi = .gnu, @@ -225,13 +225,13 @@ pub fn build(b: *std.Build) void { if (is_web and !is_web_target) return failBuild(b, web_step, "-Dplatform=web requires -Dtarget=wasm32-freestanding"); if (!is_web and (is_web_target or target.result.os.tag == .emscripten)) return failBuild(b, web_step, "wasm browser targets require -Dplatform=web"); if (platform == .web and dump_path == null) return failBuild(b, web_step, "-Dplatform=web requires -Ddump=<file.dump> (the browser has no ptys; state replays from an embedded dump)"); - if (enable_mupdf and is_web) return failBuild(b, web_step, "-Dmupdf=true is supported only by the native tty/Kitty and gui/SDL backends"); + if (enable_mupdf and is_web) return failBuild(b, web_step, "-Dmupdf=true is supported only by the native tui/Kitty and gui/SDL backends"); // The board's target is pinned (`target` above), so what is asked of // -Dtarget is checked, not what was resolved: another arch is refused, // not silently built for the board anyway. const requested_board = requested_target.result.cpu.arch == .riscv32 and requested_target.result.os.tag == .freestanding; if (is_esp32p4 and !requested_board) return failBuild(b, web_step, "-Dplatform=esp32p4 requires -Dtarget=riscv32-freestanding (ESP32-P4 firmware)"); - if (enable_mupdf and is_esp32p4) return failBuild(b, web_step, "-Dmupdf=true is supported only by the native tty/Kitty and gui/SDL backends"); + if (enable_mupdf and is_esp32p4) return failBuild(b, web_step, "-Dmupdf=true is supported only by the native tui/Kitty and gui/SDL backends"); if (is_esp32p4 and requested_grammars != null and requested_grammars.? != .disabled) return failBuild(b, web_step, "-Dplatform=esp32p4 has no tree-sitter: the grammars' parse tables are megabytes and the flash partition is 1.5 MiB (-Dtree-sitter=disabled)"); // build-time IO: slurps the grammars' highlights.scm queries, and reads @@ -249,7 +249,7 @@ pub fn build(b: *std.Build) void { .web => "src/web.zig", .macos => "src/macos.zig", .esp32p4 => "src/esp32p4.zig", - .tty, .gui => "src/main.zig", + .tui, .gui => "src/main.zig", }), .link_libc = !freestanding_core, }); @@ -260,7 +260,7 @@ pub fn build(b: *std.Build) void { .link_libc = true, }); - const isolated_mod: ?*std.Build.Module = if (platform == .tty) b.createModule(.{ + const isolated_mod: ?*std.Build.Module = if (platform == .tui) b.createModule(.{ .target = target, .optimize = optimize, .root_source_file = b.path("src/main.zig"), @@ -901,7 +901,7 @@ pub fn build(b: *std.Build) void { \\ ; // And its event queue: a pop that makes room woke one blocked - // writer, and only on the pop from full. The tty has two writers + // writer, and only on the pop from full. The tui has two writers // (a pane's pty reader, and the input reader posting the frame // ack's wake), so when the loop emptied a full queue in one batch // the writer not woken waited on for good: under `yes` the pane @@ -1041,10 +1041,10 @@ pub fn build(b: *std.Build) void { // docs/typ/builtins-<platform>.json: every builtin, from the registry and the Help // rows (src/builtins_json.zig), rewritten in the source tree so a plain // `typst compile` reads it too; a unit test fails when it is stale. - // A terminal build writes builtins-tty.json and a window build + // A terminal build writes builtins-tui.json and a window build // builtins-gui.json; style.typ merges the two into one glossary. - const builtins_json_step = b.step("builtins-json", "rewrite docs/typ/builtins-<tty|gui>.json from the builtin registry (-Dplatform=tty or gui)"); - if (requested_platform == .tty or requested_platform == .gui) { + const builtins_json_step = b.step("builtins-json", "rewrite docs/typ/builtins-<tui|gui>.json from the builtin registry (-Dplatform=tui or gui)"); + if (requested_platform == .tui or requested_platform == .gui) { const gen = b.addExecutable(.{ .name = "pardes-gen-builtins-json", .root_module = b.createModule(.{ .target = target, .optimize = optimize, @@ -1057,7 +1057,7 @@ pub fn build(b: *std.Build) void { update.addCopyFileToSource(json, b.fmt("docs/typ/builtins-{s}.json", .{@tagName(platform)})); builtins_json_step.dependOn(&update.step); for (doc_renders) |r| if (r) |run| run.step.dependOn(&update.step); - } else builtins_json_step.dependOn(&b.addFail("builtins-json writes one build's list: pass -Dplatform=tty or -Dplatform=gui").step); + } else builtins_json_step.dependOn(&b.addFail("builtins-json writes one build's list: pass -Dplatform=tui or -Dplatform=gui").step); const gui_shell_mod: ?*std.Build.Module = gui_mod orelse if (platform == .gui) root_mod else null; @@ -1409,13 +1409,13 @@ pub fn build(b: *std.Build) void { } const run_image_harness = b.addRunArtifact(image_harness); run_image_harness.addArtifactArg(exe); - run_image_harness.addArg(if (platform == .gui) "gui" else "tty"); + run_image_harness.addArg(if (platform == .gui) "gui" else "tui"); run_image_harness.has_side_effects = true; b.step("image-harness", "exercise native Kitty/SDL image rendering end to end").dependOn(&run_image_harness.step); // Kitty graphics through a terminal pane, end to end: a client in // the pane's bash (and kitten icat, chafa when installed), a kitty - // terminal outside (tty) or the GPU capture (gui). test/kitty.zig + // terminal outside (tui) or the GPU capture (gui). test/kitty.zig // is the same protocol at the core. const kitty_client = b.addExecutable(.{ .name = "pardes-kitty-client", @@ -1443,7 +1443,7 @@ pub fn build(b: *std.Build) void { const run_kitty_harness = b.addRunArtifact(kitty_harness); run_kitty_harness.addArtifactArg(exe); run_kitty_harness.addArtifactArg(kitty_client); - run_kitty_harness.addArg(if (platform == .gui) "gui" else "tty"); + run_kitty_harness.addArg(if (platform == .gui) "gui" else "tui"); run_kitty_harness.has_side_effects = true; b.step("kitty-harness", "kitty graphics through a terminal pane end to end (a client inside, a kitty terminal or the GPU capture outside)").dependOn(&run_kitty_harness.step); @@ -1451,7 +1451,7 @@ pub fn build(b: *std.Build) void { if (enable_mupdf) { const run_pdf_harness = b.addRunArtifact(image_harness); run_pdf_harness.addArtifactArg(exe); - run_pdf_harness.addArg(if (platform == .gui) "gui" else "tty"); + run_pdf_harness.addArg(if (platform == .gui) "gui" else "tui"); run_pdf_harness.addArg("pdf"); run_pdf_harness.has_side_effects = true; pdf_harness_step.dependOn(&run_pdf_harness.step); @@ -1968,7 +1968,7 @@ pub fn build(b: *std.Build) void { unit_step.dependOn(&run_deck_test.step); if (unit_match) |check| check.addArtifactArg(deck_test); - if (platform == .tty or platform == .gui) { + if (platform == .tui or platform == .gui) { const shell_test = b.addTest(.{ .root_module = root_mod, .filters = test_filters }); if (test_nonce) |nonce| shell_test.root_module.addImport("test_rebuild_nonce", nonce); test_build.dependOn(&shell_test.step); |
