- build: b.args -> addPassthruArgs, libqt6zig repointed to 0.17-ready rev - matrix: Event carries room id; joinRoom percent-encodes alias and validates room_id in response (http() ignores HTTP status) - harness: downloads room (#downloads) — URL in, yt-dlp out: detached job thread per request, /tmp/x2dm output, 2G cap, file-or-error reply - resolveDownloadRoom: env MATRIX_DOWNLOAD_ROOM pin (continuwuity bare room ids have no :server suffix), join-or-create fallback 👾 Generated with [Letta Code](https://letta.com) Co-Authored-By: Letta Code <noreply@letta.com>
89 lines
2.6 KiB
Zig
89 lines
2.6 KiB
Zig
const std = @import("std");
|
|
const configureQtExeRootModule = @import("libqt6zig").configureQtExeRootModule;
|
|
|
|
pub fn build(b: *std.Build) void {
|
|
const target = b.standardTargetOptions(.{});
|
|
const optimize = b.standardOptimizeOption(.{});
|
|
|
|
const qt6zig = b.dependency("libqt6zig", .{
|
|
.target = target,
|
|
.optimize = optimize,
|
|
});
|
|
|
|
// Qt C++ binding libraries we link for the tray daemon.
|
|
const qt_libraries = [_][]const u8{
|
|
"qapplication",
|
|
"qcoreapplication",
|
|
"qguiapplication",
|
|
"qaction",
|
|
"qabstractscrollarea",
|
|
"qabstractslider",
|
|
"qboxlayout",
|
|
"qcursor",
|
|
"qevent",
|
|
"qlabel",
|
|
"qlayout",
|
|
"qobject",
|
|
"qbrush",
|
|
"qcolor",
|
|
"qpoint",
|
|
"qscreen",
|
|
"qscrollarea",
|
|
"qicon",
|
|
"qpainter",
|
|
"qpixmap",
|
|
"qmenu",
|
|
"qrect",
|
|
"qsystemtrayicon",
|
|
"qt6zigthreading",
|
|
"qtextedit",
|
|
"qwidget",
|
|
};
|
|
|
|
const exe = b.addExecutable(.{
|
|
.name = "inferon",
|
|
.root_module = b.createModule(.{
|
|
.root_source_file = b.path("src/main.zig"),
|
|
.target = target,
|
|
.optimize = optimize,
|
|
.link_libc = true,
|
|
.imports = &.{
|
|
.{ .name = "libqt6zig", .module = qt6zig.module("libqt6zig") },
|
|
},
|
|
}),
|
|
});
|
|
|
|
for (qt_libraries) |lib|
|
|
exe.root_module.linkLibrary(qt6zig.artifact(lib));
|
|
|
|
configureQtExeRootModule(b, exe, .{}) catch @panic("Qt configuration failed");
|
|
|
|
exe.use_llvm = true; // native lld chokes on GCC16 .sframe relocations
|
|
b.installArtifact(exe);
|
|
|
|
// Matrix bridge test harness (independent of the tray daemon).
|
|
const harness = b.addExecutable(.{
|
|
.name = "matrix_harness",
|
|
.root_module = b.createModule(.{
|
|
.root_source_file = b.path("src/matrix_harness.zig"),
|
|
.target = target,
|
|
.optimize = optimize,
|
|
.link_libc = true,
|
|
.imports = &.{
|
|
.{ .name = "libqt6zig", .module = qt6zig.module("libqt6zig") },
|
|
},
|
|
}),
|
|
});
|
|
for (qt_libraries) |lib|
|
|
harness.root_module.linkLibrary(qt6zig.artifact(lib));
|
|
configureQtExeRootModule(b, harness, .{}) catch @panic("Qt configuration failed");
|
|
harness.use_llvm = true;
|
|
b.installArtifact(harness);
|
|
|
|
const run_step = b.step("run", "Run inferon");
|
|
const run_cmd = b.addRunArtifact(exe);
|
|
run_step.dependOn(&run_cmd.step);
|
|
run_cmd.step.dependOn(b.getInstallStep());
|
|
run_cmd.addPassthruArgs();
|
|
}
|