- src/matrix.zig: minimal Matrix client (conduwuit @ matrix.chaosmith.systems) via curl subprocess transport (native TLS swap later): login, createRoom (trusted_private_chat, unencrypted — no olm), sendText, sync polling with window-scan event extraction reusing letta.jsonStr - src/matrix_harness.zig: standalone entrypoint (independent of tray daemon): login -> DM with peer -> sync loop -> peer messages routed through letta CLI (chaos-prime) -> replies sent back to the room - build.zig: second exe matrix_harness; use_llvm fix promoted into build.zig for both executables (native lld vs GCC16 .sframe relocations) - calling/Element Call (livekit SFU already deployed on ass-host) layers on top of this harness next 👾 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());
|
|
if (b.args) |args| run_cmd.addArgs(args);
|
|
}
|