Page MenuHomeFreeBSD

x11/ghostty: Update 1.2.0 => 1.3.1, undeprecate (fix build)
Needs ReviewPublic

Authored by nxjoseph on Mon, Mar 9, 8:27 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Mar 17, 4:40 PM
Unknown Object (File)
Wed, Mar 11, 10:26 AM
Unknown Object (File)
Wed, Mar 11, 10:18 AM
Unknown Object (File)
Wed, Mar 11, 8:37 AM
Unknown Object (File)
Wed, Mar 11, 7:55 AM
Unknown Object (File)
Wed, Mar 11, 5:24 AM
Unknown Object (File)
Wed, Mar 11, 4:52 AM
Unknown Object (File)
Wed, Mar 11, 4:19 AM
Subscribers

Details

Reviewers
diizzy
osa
vvd
Summary

Hi,

I have tried to update x11/ghostty to latest stable release and unmarked recently-added BROKEN by diizzy@.

It seems it was failing to build due to library search - it looks for libbzip2.so which on our side we have libbz2.so instead.

Currently I have not tried the DOCS option, since it needs pandoc (requires lang/ghc) which I need to take time and build, but I am going to try and let you know about it.

Thank you in advance.

Diff Detail

Repository
R11 FreeBSD ports repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

nxjoseph created this revision.

I have added a post-patch target to change where ghostty installs ($PREFIX/share/ghostty/doc) their documentation to the default $DOCSDIR value.

I have tested it in poudriere with both DOCS=on and off.

Also one thing I'd like to note, there is a warning from lld that says:

ct-0.3.0-Skun7ET3nQAc0LzvO0NAvTiGGnmkF36cnmbeCAF6MB7Z/src/gdkpixbuf2/gdkpixbuf2.zig -OReleaseFast --dep gbp -MGraphemeData=/wrkdirs/usr/ports/x11/ghostty/work/zig-packages/zg-0.13.4-AAAAAGiZ7QLz4pvECFa_wG4O4TP4FLABHHbemH2KakWM/src/GraphemeData.zig -OReleaseFast -Mascii=/wrkdirs/usr/ports/x11/ghostty/work/zig-packages/zg-0.13.4-AAAAAGiZ7QLz4pvECFa_wG4O4TP4FLABHHbemH2KakWM/src/ascii.zig -OReleaseFast --dep dwp --dep GraphemeData -MDisplayWidthData=/wrkdirs/usr/ports/x11/ghostty/work/zig-packages/zg-0.13.4-AAAAAGiZ7QLz4pvECFa_wG4O4TP4FLABHHbemH2KakWM/src/WidthData.zig -Mgbp=/wrkdirs/usr/ports/x11/ghostty/work/ghostty-1.2.3/.zig-cache/o/147457d07c5b04b1ef1ab0d4b51f7e1c/gbp.bin.z -Mdwp=/wrkdirs/usr/ports/x11/ghostty/work/ghostty-1.2.3/.zig-cache/o/e84352f839e4f96c9e0feac5c0d05d86/dwp.bin.z -I/usr/local/include/freetype2 -I/usr/local/include/libpng16 -I/usr/local/include -lc++ -lc --cache-dir /wrkdirs/usr/ports/x11/ghostty/work/ghostty-1.2.3/.zig-cache --global-cache-dir /wrkdirs/usr/ports/x11/ghostty/work/.cache/zig --name ghostty --zig-lib-dir /usr/local/lib/zig/ -fPIE --listen=-
install
└─ install ghostty
   └─ zig build-exe ghostty ReleaseSmall native-native failure
error: warning(link): unexpected LLD stderr:
ld.lld: warning: /wrkdirs/usr/ports/x11/ghostty/work/ghostty-1.2.3/.zig-cache/o/e85944919bd1b779ba3874b7d2fc2b04/libcimgui.a: archive member '/usr/local/lib/libfreetype.so' is neither ET_REL nor LLVM bitcode


====> Compressing man pages (compress-man)
yusuf@143amd64-default:/usr/ports/x11/ghostty $

I don't know if it's an important thing but the port seems to function fine so that running make again won't rebuild it.

Thank you.

In D55762#1275805, @vvd wrote:

Okay, Thanks. I have checked, now I have made these changes below.

diff --git a/x11/ghostty/Makefile b/x11/ghostty/Makefile
index d47c486b3a91..00027f521623 100644
--- a/x11/ghostty/Makefile
+++ b/x11/ghostty/Makefile
@@ -14,7 +14,9 @@ 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 \
+               libfreetype.so:print/freetype2

 USES=          gettext-runtime gettext-tools gnome pkgconfig zig:014
 USE_GITHUB=    yes
@@ -23,11 +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 -fsys=freetype

-# Try to use system bzip2 (libbz2.so) instead of port archivers/bzip2
-CFLAGS+=       -I/usr/include
-LDFLAGS+=      -L/usr/lib
+LDFLAGS+=      -lbz2

 OPTIONS_DEFINE=        DOCS
 OPTIONS_SUB=   yes
diff --git a/x11/ghostty/files/patch-src_build_SharedDeps.zig b/x11/ghostty/files/patch-src_build_SharedDeps.zig
index fcfabeae669c..67fc8362a024 100644
--- a/x11/ghostty/files/patch-src_build_SharedDeps.zig
+++ b/x11/ghostty/files/patch-src_build_SharedDeps.zig
@@ -1,6 +1,6 @@
 The library name is different in our side so change like this -> libbz2.so.

---- src/build/SharedDeps.zig.orig      2026-03-09 07:19:09 UTC
+--- src/build/SharedDeps.zig.orig      2025-10-23 17:14:48 UTC
 +++ src/build/SharedDeps.zig
 @@ -121,7 +121,7 @@ pub fn add(
              );
@@ -11,3 +11,14 @@ The library name is different in our side so change like this -> libbz2.so.
                  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(

If everything compiles fine in poudriere, you can commit it.

Example of the commit message:

x11/ghostty: Update 1.2.0 => 1.2.3, undeprecate (fix build)

Changelogs:
 . . .

- Unbundle libs: . . .

PR: 292482
Approved by: charlesrocket <slowdive@me.com> (maintainer, timeout >1 month), vvd (mentor)
Differential Revision: https://reviews.freebsd.org/D55762
MFH: 2026Q1
Co-authored-by: Vladimir Druzenko <vvd@FreeBSD.org>

It's broken in 2026Q1 too - fix:

git switch 2026Q1
git cherry-pick -x HASH_of_this_commit
git push

After commit close https://bugs.freebsd.org/292482 as Fixed and set Assignee to you.

This revision is now accepted and ready to land.Sun, Mar 15, 3:12 PM

It obviously needs runtime testing before committing

nxjoseph retitled this revision from x11/ghostty: Update 1.2.0 => 1.2.3, unmark BROKEN to x11/ghostty: Update 1.2.0 => 1.3.1, undeprecate (fix build).

Hi,

After v1.2.3, two more versions arrived, so I have updated to latest one, which is v1.3.1.

I have tested the build in poudriere (amd64 14.3-RELEASE-p9) with a ports tree as recent as this commit (2ee1a8a5e18d630a15655c4fe2c7b612ee87c1cc).

I have not tested neither runtime nor poudriere with the 2026Q1 branch, since it would rebuild rust, ghc, etc. (i can test if i must need to, just let me know)

I have tested port's runtime basically on FreeBSD 14.3-RELEASE Bhyve VM, using X11 SSH Forwarding.

Here is recently amended git commit message.

commit ecd88b48b1ac7d8151ee9844827e3e363f038018 (HEAD -> x11/ghostty)
Author: Yusuf Yaman <nxjoseph@FreeBSD.org>
Date:   Mon Mar 9 11:22:19 2026 +0300

    x11/ghostty: Update 1.2.0 => 1.3.1, undeprecate (fix build)

    While here, unbundle libraries: freetype, spirv-cross.

    Changelog:
    https://ghostty.org/docs/install/release-notes

    PR:             292482
    Reviewed by:    diizzy, osa (mentor), vvd (mentor)
    Approved by:    charlesrocket <slowdive@me.com> (maintainer, timeout >1 month), vvd (mentor)
    Co-authored-by: Vladimir Druzenko <vvd@FreeBSD.org>
    MFH:            2026Q1
    Differential Revision:  https://reviews.freebsd.org/D55762

Thank you!

This revision now requires review to proceed.Sun, Mar 15, 5:31 PM