libxev, zig-js, zig-objc

This commit is contained in:
Mitchell Hashimoto
2023-10-01 16:49:02 -07:00
parent 3ed6a02176
commit 8666ab81c3
2 changed files with 21 additions and 9 deletions

View File

@ -15,11 +15,8 @@ const XCFrameworkStep = @import("src/build/XCFrameworkStep.zig");
const Version = @import("src/build/Version.zig");
const glfw = @import("vendor/mach-glfw/build.zig");
const js = @import("vendor/zig-js/build.zig");
const libxev = @import("vendor/libxev/build.zig");
const libxml2 = @import("vendor/zig-libxml2/libxml2.zig");
const macos = @import("pkg/macos/build.zig");
const objc = @import("vendor/zig-objc/build.zig");
const tracylib = @import("pkg/tracy/build.zig");
const system_sdk = @import("vendor/mach-glfw/system_sdk.zig");
@ -662,6 +659,9 @@ fn addDeps(
};
// Dependencies
const js_dep = b.dependency("zig_js", .{ .target = step.target, .optimize = step.optimize });
const libxev_dep = b.dependency("libxev", .{ .target = step.target, .optimize = step.optimize });
const objc_dep = b.dependency("zig_objc", .{ .target = step.target, .optimize = step.optimize });
const fontconfig_dep = b.dependency("fontconfig", .{
.target = step.target,
.optimize = step.optimize,
@ -699,7 +699,7 @@ fn addDeps(
// never actually WORKS with wasm.
step.addModule("tracy", tracylib.module(b));
step.addModule("utf8proc", utf8proc.module(b));
step.addModule("zig-js", js.module(b));
step.addModule("zig-js", js_dep.module("zig-js"));
// utf8proc
step.linkLibrary(utf8proc_dep.artifact("utf8proc"));
@ -733,21 +733,18 @@ fn addDeps(
if (font_backend.hasFontconfig()) step.addModule("fontconfig", fontconfig.module(b));
const mod_freetype = freetype.module(b);
const mod_macos = macos.module(b);
const mod_libxev = b.createModule(.{
.source_file = .{ .path = "vendor/libxev/src/main.zig" },
});
step.addModule("freetype", mod_freetype);
step.addModule("harfbuzz", harfbuzz.module(b, .{
.freetype = mod_freetype,
.macos = mod_macos,
}));
step.addModule("xev", mod_libxev);
step.addModule("xev", libxev_dep.module("xev"));
step.addModule("pixman", pixman.module(b));
step.addModule("utf8proc", utf8proc.module(b));
// Mac Stuff
if (step.target.isDarwin()) {
step.addModule("objc", objc.module(b));
step.addModule("objc", objc_dep.module("objc"));
step.addModule("macos", mod_macos);
_ = try macos.link(b, step, .{});

View File

@ -2,6 +2,21 @@
.name = "ghostty",
.version = "0.1.0",
.dependencies = .{
// Zig libs
.libxev = .{
.url = "https://github.com/mitchellh/libxev/archive/ecbc161a5dace26a1fd47e494f8be2cfd051cbfb.tar.gz",
.hash = "1220f34357168affd9aab1a3fcafcaff093c44beb75ce1d4d4b75490e90729221771",
},
.zig_objc = .{
.url = "https://github.com/mitchellh/zig-objc/archive/01c16aaeeb674622f4a0e715aeeb16c8ce0bc30e.tar.gz",
.hash = "1220f9c919a1171ecf5d097a0d0349e8a9a01b45afa41006dd7eb0afa6243a5fa21f",
},
.zig_js = .{
.url = "https://github.com/mitchellh/zig-js/archive/60ac42ab137461cdba2b38cc6c5e16376470aae6.tar.gz",
.hash = "1220319b42fbc0116f3f198343256018e9f1da9483cef259201afe4ebab0ce0d8f6a",
},
// C libs
.fontconfig = .{ .path = "./pkg/fontconfig" },
.freetype = .{ .path = "./pkg/freetype" },
.harfbuzz = .{ .path = "./pkg/harfbuzz" },