From f73c95d1c0d6ebc8981a11eeed4df8a2227d98f2 Mon Sep 17 00:00:00 2001 From: Jay Petacat Date: Wed, 5 Aug 2026 22:45:14 -0600 Subject: [PATCH] Switch SDL dependency to allyourcodebase's package `preferred_linkage` build option renamed to `linkage`. --- .github/workflows/ci.yaml | 5 +++++ build.zig | 10 +++------- build.zig.zon | 4 ++-- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b171de32..5b599de1 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -27,6 +27,11 @@ jobs: - name: Setup Zig uses: mlugg/setup-zig@v2 + - name: Workaround Zig 0.16.0 ZIP unpack failure + # https://codeberg.org/ziglang/zig/issues/31964 + shell: bash + run: mkdir -p "${ZIG_GLOBAL_CACHE_DIR}/tmp" + - name: Check Formatting run: zig fmt --ast-check --check . diff --git a/build.zig b/build.zig index b9c83563..6a0b141f 100644 --- a/build.zig +++ b/build.zig @@ -6,11 +6,7 @@ pub fn build(b: *std.Build) void { const sanitize_c_type = @typeInfo(@FieldType(std.Build.Module.CreateOptions, "sanitize_c")).optional.child; const sanitize_c = b.option(sanitize_c_type, "sanitize-c", "Detect undefined behavior in C"); const harfbuzz_enabled = b.option(bool, "enable-harfbuzz", "Use HarfBuzz to improve text shaping") orelse true; - const preferred_linkage = b.option( - std.builtin.LinkMode, - "preferred_linkage", - "Prefer building statically or dynamically linked libraries (default: static)", - ) orelse .static; + const linkage = b.option(std.builtin.LinkMode, "linkage", "Link mode") orelse .static; const upstream = b.dependency("SDL_ttf", .{}); @@ -24,7 +20,7 @@ pub fn build(b: *std.Build) void { const lib = b.addLibrary(.{ .name = "SDL3_ttf", .version = .{ .major = 3, .minor = 2, .patch = 2 }, - .linkage = preferred_linkage, + .linkage = linkage, .root_module = mod, }); mod.addIncludePath(upstream.path("include")); @@ -52,7 +48,7 @@ pub fn build(b: *std.Build) void { const sdl = b.dependency("SDL", .{ .target = target, .optimize = optimize, - .preferred_linkage = preferred_linkage, + .linkage = linkage, }).artifact("SDL3"); mod.linkLibrary(sdl); diff --git a/build.zig.zon b/build.zig.zon index c9078da9..96b3c451 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -13,8 +13,8 @@ .hash = "freetype-2.14.3-C3-WdXSKAAB-kHs4qgRoeoFnRkNQn6M_SSlUGZ6ywgBQ", }, .SDL = .{ - .url = "git+https://github.com/castholm/sdl?ref=v0.5.1+3.4.10#018241066ffdae90d8b11f8bdc6242202f0f5451", - .hash = "sdl-0.5.1+3.4.10-SDL--kbMpgGMXke11Ujh5HUPKch7G_SUAS12LI0QFoqj", + .url = "git+https://github.com/allyourcodebase/SDL?ref=1.0.1+3.4.14#1d0008fda80e78bb6136832b89578422798b4dbf", + .hash = "sdl-1.0.1+3.4.14-i4QD0ViwqQAThHDlng1K46lINQ5PioLIz9bDKpGJTuzs", }, .SDL_ttf = .{ .url = "git+https://github.com/libsdl-org/SDL_ttf#release-3.2.2",