Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ jobs:
strategy:
fail-fast: false
matrix:
zig-version: [0.14.0, latest]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -27,8 +26,6 @@ jobs:

- name: Setup Zig
uses: mlugg/setup-zig@v2
with:
version: ${{ matrix.zig-version }}

- name: Check Formatting
run: zig fmt --ast-check --check .
Expand Down
26 changes: 14 additions & 12 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -9,41 +9,43 @@ pub fn build(b: *std.Build) void {

const upstream = b.dependency("SDL_ttf", .{});

const mod = b.createModule(.{
.target = target,
.optimize = optimize,
.link_libc = true,
.sanitize_c = sanitize_c,
});

const lib = b.addLibrary(.{
.name = "SDL2_ttf",
.version = .{ .major = 2, .minor = 24, .patch = 0 },
.linkage = .static,
.root_module = b.createModule(.{
.target = target,
.optimize = optimize,
.link_libc = true,
.sanitize_c = sanitize_c,
}),
.root_module = mod,
});
lib.addCSourceFile(.{ .file = upstream.path("SDL_ttf.c") });
mod.addCSourceFile(.{ .file = upstream.path("SDL_ttf.c") });

if (harfbuzz_enabled) {
const harfbuzz_dep = b.dependency("harfbuzz", .{
.target = target,
.optimize = optimize,
});
lib.linkLibrary(harfbuzz_dep.artifact("harfbuzz"));
lib.root_module.addCMacro("TTF_USE_HARFBUZZ", "1");
mod.linkLibrary(harfbuzz_dep.artifact("harfbuzz"));
mod.addCMacro("TTF_USE_HARFBUZZ", "1");
}

const freetype_dep = b.dependency("freetype", .{
.target = target,
.optimize = optimize,
});
lib.linkLibrary(freetype_dep.artifact("freetype"));
mod.linkLibrary(freetype_dep.artifact("freetype"));

const sdl_dep = b.dependency("SDL", .{
.target = target,
.optimize = optimize,
});
const sdl_lib = sdl_dep.artifact("SDL2");
lib.linkLibrary(sdl_lib);
lib.addIncludePath(sdl_lib.getEmittedIncludeTree().path(b, "SDL2"));
mod.linkLibrary(sdl_lib);
mod.addIncludePath(sdl_lib.getEmittedIncludeTree().path(b, "SDL2"));

lib.installHeader(upstream.path("SDL_ttf.h"), "SDL2/SDL_ttf.h");

Expand Down
14 changes: 7 additions & 7 deletions build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
.name = .SDL_ttf,
.version = "2.24.0",
.fingerprint = 0xa98f7681c4b9d53c,
.minimum_zig_version = "0.14.0",
.minimum_zig_version = "0.15.2",
.dependencies = .{
.harfbuzz = .{
.url = "git+https://github.com/allyourcodebase/harfbuzz#6bb522d22cee0ce1d1446bd59fa5b0417f25303e",
.hash = "harfbuzz-8.5.0-Ip1VAqCZAADRh-K2AVujG0N3VAal-AKwkZrvlYOaloyB",
.url = "git+https://github.com/allyourcodebase/harfbuzz#da947143173370b8123ef93f21353d58ce6e6d65",
.hash = "harfbuzz-12.2.0-Ip1VAuGZAAD2dBKDBtAW50eyC9VhSmXFlupI1vCNTFL4",
},
.freetype = .{
.url = "git+https://github.com/allyourcodebase/freetype#9d847affbd224cf6a7303ad6d98715e3675ef78c",
.hash = "freetype-2.13.3-C3-WdeyJAAD9z8BeYYQ8N3gNlPI9NvHRxg5039S5vhz7",
.url = "git+https://github.com/allyourcodebase/freetype#f2f3f662cfc6cf7be2d39d8373c6e6b91297ced8",
.hash = "freetype-2.14.1-C3-WdWqKAADgPV0BhYffbFweY71Qns18mICAEtclm1a6",
},
.SDL = .{
.url = "git+https://github.com/allyourcodebase/SDL#a91ef63a07449874ec049dacfd6459b1131fd27b",
.hash = "SDL-2.32.10-JToi3_a0EgFQAnsafUA-gNv9ku-yxMoYF9Wjq7HhD5q5",
.url = "git+https://github.com/allyourcodebase/SDL#25dc764272bf117198f3cd6f44f52dae5c45d60a",
.hash = "SDL-2.32.10-JToi38G1EgFICTNzwfhy7XOMuWw7gN1xDvPOQ5CCoI8R",
},
.SDL_ttf = .{
.url = "git+https://github.com/libsdl-org/SDL_ttf#release-2.24.0",
Expand Down