diff --git a/pkg/harfbuzz/build.zig b/pkg/harfbuzz/build.zig index 2923f59ab..5e315347c 100644 --- a/pkg/harfbuzz/build.zig +++ b/pkg/harfbuzz/build.zig @@ -14,6 +14,7 @@ pub fn build(b: *std.Build) !void { .@"enable-libpng" = true, }); const macos = b.dependency("macos", .{ .target = target, .optimize = optimize }); + const upstream = b.dependency("harfbuzz", .{}); const module = b.addModule("harfbuzz", .{ .source_file = .{ .path = "main.zig" }, @@ -23,8 +24,6 @@ pub fn build(b: *std.Build) !void { }, }); - const upstream_root = "../../vendor/harfbuzz"; - const lib = b.addStaticLibrary(.{ .name = "harfbuzz", .target = target, @@ -32,7 +31,7 @@ pub fn build(b: *std.Build) !void { }); lib.linkLibC(); lib.linkLibCpp(); - lib.addIncludePath(.{ .path = upstream_root ++ "/src" }); + lib.addIncludePath(upstream.path("src")); const freetype_dep = b.dependency("freetype", .{ .target = target, .optimize = optimize }); lib.linkLibrary(freetype_dep.artifact("freetype")); @@ -65,11 +64,11 @@ pub fn build(b: *std.Build) !void { } lib.addCSourceFile(.{ - .file = .{ .path = upstream_root ++ "/src/harfbuzz.cc" }, + .file = upstream.path("src/harfbuzz.cc"), .flags = flags.items, }); lib.installHeadersDirectoryOptions(.{ - .source_dir = .{ .path = upstream_root ++ "/src" }, + .source_dir = upstream.path("src"), .install_dir = .header, .install_subdir = "", .include_extensions = &.{".h"}, diff --git a/pkg/harfbuzz/build.zig.zon b/pkg/harfbuzz/build.zig.zon index 5609dab3e..2e6b34113 100644 --- a/pkg/harfbuzz/build.zig.zon +++ b/pkg/harfbuzz/build.zig.zon @@ -2,6 +2,11 @@ .name = "harfbuzz", .version = "2.13.2", .dependencies = .{ + .harfbuzz = .{ + .url = "https://github.com/harfbuzz/harfbuzz/archive/refs/tags/8.2.1.tar.gz", + .hash = "12203c1b09a2cf778367376076301322235816598eaf0639da08b233ab852548df92", + }, + .freetype = .{ .path = "../freetype" }, .macos = .{ .path = "../macos" }, .apple_sdk = .{ .path = "../apple-sdk" },