Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cli: add +boo command #4876

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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
4 changes: 2 additions & 2 deletions build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
.lazy = true,
},
.vaxis = .{
.url = "git+https://github.com/rockorager/libvaxis/?ref=main#6d729a2dc3b934818dffe06d2ba3ce02841ed74b",
.hash = "12200df4ebeaed45de26cb2c9f3b6f3746d8013b604e035dae658f86f586c8c91d2f",
.url = "git+https://github.com/rockorager/libvaxis#2237a7059eae99e9f132dd5acd1555e49d6c7d93",
.hash = "1220f5aec880d4f430cc1597ede88f1530da69e39a4986080e976b0c7b919c2ebfeb",
},
.z2d = .{
.url = "git+https://github.com/vancluever/z2d?ref=v0.4.0#4638bb02a9dc41cc2fb811f092811f6a951c752a",
Expand Down
2 changes: 1 addition & 1 deletion nix/zigCacheHash.nix
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# This file is auto-generated! check build-support/check-zig-cache-hash.sh for
# more details.
"sha256-Nx1tOhDnEZ7LVi/pKxYS3sg/Sf8TAUXDmST6EtBgDoQ="
"sha256-S8kS+gO17dl9LJGKL1+kgDUre+vPTmdTvXzgc585Fl8="
37 changes: 37 additions & 0 deletions src/build/GhosttyFrameData.zig
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
//! GhosttyFrameData generates a compressed file and zig module which contains (and exposes) the
//! Ghostty animation frames for use in `ghostty +boo`
const GhosttyFrameData = @This();

const std = @import("std");
const Config = @import("Config.zig");
const SharedDeps = @import("SharedDeps.zig");

/// The exe.
exe: *std.Build.Step.Compile,

/// The output path for the compressed framedata zig file
output: std.Build.LazyPath,

pub fn init(b: *std.Build) !GhosttyFrameData {
const exe = b.addExecutable(.{
.name = "framegen",
.root_source_file = b.path("src/build/framegen/main.zig"),
.target = b.host,
});

const run = b.addRunArtifact(exe);

_ = run.addOutputFileArg("framedata.compressed");
return .{
.exe = exe,
.output = run.captureStdOut(),
};
}

/// Add the "framedata" import.
pub fn addImport(self: *const GhosttyFrameData, step: *std.Build.Step.Compile) void {
self.output.addStepDependencies(&step.step);
step.root_module.addAnonymousImport("framedata", .{
.root_source_file = self.output,
});
}
4 changes: 4 additions & 0 deletions src/build/SharedDeps.zig
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ const Config = @import("Config.zig");
const HelpStrings = @import("HelpStrings.zig");
const MetallibStep = @import("MetallibStep.zig");
const UnicodeTables = @import("UnicodeTables.zig");
const GhosttyFrameData = @import("GhosttyFrameData.zig");

config: *const Config,

options: *std.Build.Step.Options,
help_strings: HelpStrings,
metallib: ?*MetallibStep,
unicode_tables: UnicodeTables,
framedata: GhosttyFrameData,

/// Used to keep track of a list of file sources.
pub const LazyPathList = std.ArrayList(std.Build.LazyPath);
Expand All @@ -22,6 +24,7 @@ pub fn init(b: *std.Build, cfg: *const Config) !SharedDeps {
.config = cfg,
.help_strings = try HelpStrings.init(b, cfg),
.unicode_tables = try UnicodeTables.init(b),
.framedata = try GhosttyFrameData.init(b),

// Setup by retarget
.options = undefined,
Expand Down Expand Up @@ -495,6 +498,7 @@ pub fn add(

self.help_strings.addImport(step);
self.unicode_tables.addImport(step);
self.framedata.addImport(step);

return static_libs;
}
Expand Down
41 changes: 41 additions & 0 deletions src/build/framegen/frames/frame_001.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@


<span class="b">+++==*%%%%%%%%%%%%*==+++</span>
<span class="b">++****++</span> <span class="b">++****++</span>
<span class="b">++**++</span> <span class="b">++**++</span>
<span class="b">xx**+=</span> o+*%$@@@@@@$%*+o <span class="b">=+**xx</span>
<span class="b">xx**oo</span> ·=$@@@@@@@$$$$$$$$@@@@@@@$=· <span class="b">oo**xx</span>
<span class="b">xx**</span> x$@@@$$$$$$$$$$$$$$$$$$$$$$$$@@@$x <span class="b">**xx</span>
<span class="b">ox**</span> ·$@@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@@$· <span class="b">**xo</span>
<span class="b">==+~</span> ~@@@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@@@~ <span class="b">~+==</span>
<span class="b">x+++</span> $@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$ <span class="b">+++x</span>
<span class="b">==</span> ·@@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@@· <span class="b">==</span>
<span class="b">ox++</span> ~@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@~ <span class="b">++xo</span>
<span class="b">+++~</span> @$$$$$@@@@@@@@@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@ <span class="b">~+++</span>
<span class="b">==</span> $$$$$@@%%%%%%$$$$$$$@@@@@$$$@@@@@@@@@@@@@@@@@@@@$$$$$$ <span class="b">==</span>
<span class="b">==</span> @$$$$* $$$$% =$$$$$@ <span class="b">==</span>
<span class="b">==</span> ·$$$$@ x@$@ @$$$$$· <span class="b">==</span>
<span class="b">==</span> ·@$$$$% ·$$$$% *$$$$$@· <span class="b">==</span>
<span class="b">==</span> ·@$$$$@@$%%$$$$$$@@@@@@@@$$$$@@@@@@@@@@@@@@@@@@@@$$$$$@· <span class="b">==</span>
<span class="b">==</span> ·@$$$$$$$@@@@@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@· <span class="b">==</span>
<span class="b">==</span> ·@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@· <span class="b">==</span>
<span class="b">==</span> ·@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@· <span class="b">==</span>
<span class="b">==</span> ·@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@· <span class="b">==</span>
<span class="b">==</span> ·@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@· <span class="b">==</span>
<span class="b">==</span> ·@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@· <span class="b">==</span>
<span class="b">==</span> ·@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@· <span class="b">==</span>
<span class="b">==</span> ·@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@· <span class="b">==</span>
<span class="b">==</span> ·@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@· <span class="b">==</span>
<span class="b">==</span> ·@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@· <span class="b">==</span>
<span class="b">==</span> ·@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@· <span class="b">==</span>
<span class="b">==</span> ·@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@· <span class="b">==</span>
<span class="b">==</span> ~$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$~ <span class="b">==</span>
<span class="b">==</span> @@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@@ <span class="b">==</span>
<span class="b">==x·</span> $@@$$$$$$$$$@@@@@@@@@@$$$$$$$$@@@@@@@@@@$$$$$$$$$@@$ <span class="b">·+==</span>
<span class="b">++++</span> =@@@@@@@@@* x$@@@@@@@@$x *@@@@@@@@@= <span class="b">++++</span>
<span class="b">xx==++</span> <span class="b">++==oo</span>
<span class="b">++===+</span> <span class="b">++%%+o</span> <span class="b">o+%%++</span> <span class="b">+===++</span>
<span class="b">++=====%+=++++*=*========***++++***========*=*++++=+%=====++</span>
<span class="b">xx++==******====++</span> <span class="b">++==********==++</span> <span class="b">++====******==++xx</span>
<span class="b">++++</span> <span class="b">++++</span> <span class="b">++++</span>

41 changes: 41 additions & 0 deletions src/build/framegen/frames/frame_002.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@

<span class="b">++++++++++++</span>
<span class="b">++==*%%%**=++++++=**%%%*==++</span>
<span class="b">++**=*</span> <span class="b">*=**++</span>
<span class="b">x+**+=</span> <span class="b">=+**+x</span>
<span class="b">++==</span> o=%@@@@@@@@@@@@@@@@%=o <span class="b">==++</span>
<span class="b">===+</span> +$@@@@@$$$$$$$$$$$$$$$$@@@@@$+ <span class="b">+===</span>
<span class="b">++=+</span> =@@@@$$$$$$$$$$$$$$$$$$$$$$$$$$@@@@= <span class="b">+=++</span>
<span class="b">++==</span> $@@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@@$ <span class="b">==++</span>
<span class="b">**</span> $@@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@@$ <span class="b">**</span>
<span class="b">+++o</span> +@@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@@+ <span class="b">o+++</span>
<span class="b">==</span> %@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@% <span class="b">==</span>
<span class="b">xx++</span> %@$$$$@@@@@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@% <span class="b">++xx</span>
<span class="b">==+·</span> x@$$$@@%=*%$$@@@@@@@@@@@$$$$$@@@@@@@@@@@@@@@@@@$$$$$@x <span class="b">·+==</span>
<span class="b">==</span> @$$$$% ~$@$$$@= x@$$$$$@ <span class="b">==</span>
<span class="b">==</span> $$$$@* %$$@· @$$$$$ <span class="b">==</span>
<span class="b">==</span> ·@$$$@* $$$$+ $$$$$@· <span class="b">==</span>
<span class="b">==</span> ·@$$$$$~ ~ox+=%@@$$$@@*==============*$@$$$$$@· <span class="b">==</span>
<span class="b">==</span> ·@$$$$$@@@@@@@@@@@@@@@@@$$$$$$$@@@@@@@@@@@@@@@@$$$$$$$@· <span class="b">==</span>
<span class="b">==</span> ·@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@· <span class="b">==</span>
<span class="b">==</span> ·@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@· <span class="b">==</span>
<span class="b">==</span> ·@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@· <span class="b">==</span>
<span class="b">==</span> ·@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@· <span class="b">==</span>
<span class="b">==</span> ·@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@· <span class="b">==</span>
<span class="b">==</span> ·@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@· <span class="b">==</span>
<span class="b">==</span> ·@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@· <span class="b">==</span>
<span class="b">==</span> ·@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@· <span class="b">==</span>
<span class="b">==</span> ·@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@· <span class="b">==</span>
<span class="b">==</span> ·@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@· <span class="b">==</span>
<span class="b">==</span> ·@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@· <span class="b">==</span>
<span class="b">==</span> ~$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$~ <span class="b">==</span>
<span class="b">==</span> ·@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@ <span class="b">==</span>
<span class="b">==</span> $@$$$$$$$$$$$$$$@@@@$$$$$$$$$$$$$$@@@@$$$$$$$$$$$$$$@$ <span class="b">==</span>
<span class="b">==+o</span> +@@@$$$$$$$@@@$***%@@@@$$$$$$@@@@%***$@@@$$$$$$$@@@+ <span class="b">o+==</span>
<span class="b">++==</span> ·=$@@@@@$*~ +%@@@@@@%+ ~*$@@@@@$=· <span class="b">==++</span>
<span class="b">===+</span> <span class="b">+===</span>
<span class="b">++====x+</span> <span class="b">*=**==</span> <span class="b">==**=*</span> <span class="b">+x====++</span>
<span class="b">++=====**%******=========**%****%**=========******%**=====++</span>
<span class="b">++++========++xx</span> <span class="b">++++========++++</span> <span class="b">xx++========++++</span>


Loading
Loading