[Bug 292482] x11/ghostty: do not use system freetype

From: <bugzilla-noreply_at_freebsd.org>
Date: Sat, 17 Jan 2026 17:37:04 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292482

--- Comment #4 from Vladimir Druzenko <vvd@FreeBSD.org> ---
Unbundle spirv-cross too:

diff --git a/x11/ghostty/Makefile b/x11/ghostty/Makefile
index d4c8a4876deb..1885cc3f3e38 100644
--- a/x11/ghostty/Makefile
+++ b/x11/ghostty/Makefile
@@ -15,7 +15,8 @@ LICENSE_FILE= ${WRKSRC}/LICENSE
 BUILD_DEPENDS= blueprint-compiler>0:devel/blueprint-compiler
 LIB_DEPENDS=   libgtk4-layer-shell.so:x11-toolkits/gtk4-layer-shell \
                libonig.so:devel/oniguruma \
-               libsimdutf.so:converters/simdutf
+               libsimdutf.so:converters/simdutf \
+               libspirv-cross-c-shared.so:graphics/spirv-cross

 USES=          gettext-runtime gettext-tools gnome pkgconfig zig:014
 USE_GITHUB=    yes
@@ -24,7 +25,9 @@ GH_ACCOUNT=   ghostty-org
 USE_GNOME=     glib20 gtk40 libadwaita libxml2

 ZIG_ARGS=      -Dapp-runtime=gtk -Dgtk-wayland=true -Dgtk-x11=true \
-               -fsys=simdutf -fno-sys=spirv-cross
+               -fsys=simdutf -fsys=spirv-cross
+
+LDFLAGS+=      -lbz2

 OPTIONS_DEFINE=        DOCS

diff --git a/usr/ports/x11/ghostty/files/patch-src_build_SharedDeps.zig
b/x11/ghostty/files/patch-src_build_SharedDeps.zig
new file mode 100644
index 000000000000..51107e01a5dc
--- /dev/null
+++ b/x11/ghostty/files/patch-src_build_SharedDeps.zig
@@ -0,0 +1,22 @@
+--- src/build/SharedDeps.zig.orig      2025-09-15 16:33:51 UTC
++++ src/build/SharedDeps.zig
+@@ -121,7 +121,7 @@ pub fn add(
+             );
+
+             if (b.systemIntegrationOption("freetype", .{})) {
+-                step.linkSystemLibrary2("bzip2", dynamic_link_opts);
++                step.linkSystemLibrary2("bz2", dynamic_link_opts);
+                 step.linkSystemLibrary2("freetype2", dynamic_link_opts);
+             } else {
+                 step.linkLibrary(freetype_dep.artifact("freetype"));
+@@ -256,8 +256,8 @@ pub fn add(
+             "spirv_cross",
+             spirv_cross_dep.module("spirv_cross"),
+         );
+-        if (b.systemIntegrationOption("spirv-cross", .{})) {
+-            step.linkSystemLibrary2("spirv-cross", dynamic_link_opts);
++        if (b.systemIntegrationOption("spirv-cross-c-shared", .{})) {
++            step.linkSystemLibrary2("spirv-cross-c-shared",
dynamic_link_opts);
+         } else {
+             step.linkLibrary(spirv_cross_dep.artifact("spirv_cross"));
+             try static_libs.append(

-- 
You are receiving this mail because:
You are the assignee for the bug.