aboutsummaryrefslogtreecommitdiff
path: root/vendor/libghostty-vt/src/build/CombineArchivesStep.zig
diff options
context:
space:
mode:
authorOgulcan Celik <ogulcancelik@gmail.com>2026-05-07 18:29:21 +0300
committerOgulcan Celik <ogulcancelik@gmail.com>2026-05-07 18:29:21 +0300
commitdcfe11a7588fcd42471159453810abc9b7720a57 (patch)
treec32a77266028e73ca2382b96c96f8438a5fcd621 /vendor/libghostty-vt/src/build/CombineArchivesStep.zig
parent2dfed860103c4e4505ac7f25def9fe37da1e1e6a (diff)
build: update libghostty-vt vendor
vendor ghostty 063ac3e and remove the musl libc++ link workaround. expose the new selection formatter and hyperlink uri apis for follow-up rendering work. add manual artifact validation for static linux builds.
Diffstat (limited to 'vendor/libghostty-vt/src/build/CombineArchivesStep.zig')
-rw-r--r--vendor/libghostty-vt/src/build/CombineArchivesStep.zig50
1 files changed, 50 insertions, 0 deletions
diff --git a/vendor/libghostty-vt/src/build/CombineArchivesStep.zig b/vendor/libghostty-vt/src/build/CombineArchivesStep.zig
new file mode 100644
index 00000000..cebd8e9f
--- /dev/null
+++ b/vendor/libghostty-vt/src/build/CombineArchivesStep.zig
@@ -0,0 +1,50 @@
+//! Combines multiple static archives into a single fat archive.
+//! Uses libtool on Darwin and a cross-platform MRI-script build tool
+//! on all other platforms (including Windows).
+const std = @import("std");
+const builtin = @import("builtin");
+const LibtoolStep = @import("LibtoolStep.zig");
+
+/// Combine multiple static archives into a single fat archive.
+///
+/// `name` identifies the library (e.g. "ghostty-internal", "ghostty-vt").
+/// Output uses a `-fat` suffix to distinguish the combined archive from
+/// the single-library archive in the build cache.
+pub fn create(
+ b: *std.Build,
+ target: std.Build.ResolvedTarget,
+ name: []const u8,
+ sources: []const std.Build.LazyPath,
+) struct { step: *std.Build.Step, output: std.Build.LazyPath } {
+ if (target.result.os.tag.isDarwin() and
+ comptime builtin.os.tag.isDarwin())
+ {
+ const libtool = LibtoolStep.create(b, .{
+ .name = name,
+ .out_name = b.fmt("lib{s}-fat.a", .{name}),
+ .sources = @constCast(sources),
+ });
+ return .{ .step = libtool.step, .output = libtool.output };
+ }
+
+ // On non-Darwin, use a build tool that generates an MRI script and
+ // pipes it to `zig ar -M`. This works on all platforms including
+ // Windows (the previous /bin/sh approach did not).
+ const tool = b.addExecutable(.{
+ .name = "combine_archives",
+ .root_module = b.createModule(.{
+ .root_source_file = b.path("src/build/combine_archives.zig"),
+ .target = b.graph.host,
+ }),
+ });
+ const run = b.addRunArtifact(tool);
+ run.addArg(b.graph.zig_exe);
+ const out_name = if (target.result.os.tag == .windows)
+ b.fmt("{s}-fat.lib", .{name})
+ else
+ b.fmt("lib{s}-fat.a", .{name});
+ const output = run.addOutputFileArg(out_name);
+ for (sources) |source| run.addFileArg(source);
+
+ return .{ .step = &run.step, .output = output };
+}