Ghostty is ready for FreeBSD

If I understand correctly, this is written in Zig. Also, it only uses Swift language for bindings and graphical interface only when used for MacOS?

That it uses GUI acceleration, which wouldn't typically be needed for terminal emulators. Is that for animations in the background window of the terminal, as implied in an image?
 
Yes, I am running it with GTK on Wayland.

Code:
info: ghostty version=1.1.4-fbsd+8b8b4cb6

info: ghostty build optimize=Debug

info: runtime=apprt.Runtime.gtk

info: font_backend=font.main.Backend.fontconfig_freetype

info: dependency harfbuzz=11.0.0

info: dependency fontconfig=21402

info: renderer=renderer.OpenGL

info: libxev default backend=kqueue

Idk about the acceleration, I blur via Hyprland. It looks slightly better than alacritty or foot i got looking exactly like alacritty
 
Is there a special way to build Ghostty for FreeBSD? I'm hitting an issue regarding some intl stuff in the linking phase.

Bash:
dusan@Dell-Latitude-5400 /V/P/ghostty> zig build -Doptimize=ReleaseFast run                                                               main                                                 
run                                                                                                                                                                                           
└─ run ghostty                                                                                                                                                                                 
   └─ zig build-exe ghostty ReleaseFast native 2 errors                                                                                                                                       
error: ld.lld:                                                                                                                                                                                 
error: ld.lld: undefined symbol: bindtextdomain                                                                                                                                               
    note: referenced by ghostty                                                                                                                                                               
    note:               /Volumes/Projects/ghostty/.zig-cache/o/e2e8d04b7729d61175fad5eda9047ec7/ghostty.o:(global.GlobalState.init)                                                           
error: the following command failed with 2 compilation errors:
 
Is there a special way to build Ghostty for FreeBSD? I'm hitting an issue regarding some intl stuff in the linking phase.

Bash:
dusan@Dell-Latitude-5400 /V/P/ghostty> zig build -Doptimize=ReleaseFast run                                                               main                                              
run                                                                                                                                                                                        
└─ run ghostty                                                                                                                                                                              
   └─ zig build-exe ghostty ReleaseFast native 2 errors                                                                                                                                    
error: ld.lld:                                                                                                                                                                              
error: ld.lld: undefined symbol: bindtextdomain                                                                                                                                            
    note: referenced by ghostty                                                                                                                                                            
    note:               /Volumes/Projects/ghostty/.zig-cache/o/e2e8d04b7729d61175fad5eda9047ec7/ghostty.o:(global.GlobalState.init)                                                        
error: the following command failed with 2 compilation errors:
Recently I had dealt with 2 ports that use locale.bindtextdomain, changing it from locale to gettext worked for me. Other one was locale.textdomain I guess. You may try editing source code of the program.

For example:
Diff:
Fix for runtime attribute errors of python, locale doesn't
have these things but the gettext has.

--- src/pigment.in.orig    2025-06-25 15:58:07 UTC
+++ src/pigment.in
@@ -31,8 +31,8 @@ signal.signal(signal.SIGINT, signal.SIG_DFL)
 
 sys.path.insert(1, pkgdatadir)
 signal.signal(signal.SIGINT, signal.SIG_DFL)
-locale.bindtextdomain('pigment', localedir)
-locale.textdomain('pigment')
+gettext.bindtextdomain('pigment', localedir)
+gettext.textdomain('pigment')
 gettext.install('pigment', localedir)
 
 if __name__ == '__main__':
 
Is there a special way to build Ghostty for FreeBSD? I'm hitting an issue regarding some intl stuff in the linking phase.

Bash:
dusan@Dell-Latitude-5400 /V/P/ghostty> zig build -Doptimize=ReleaseFast run                                                               main                                               
run                                                                                                                                                                                         
└─ run ghostty                                                                                                                                                                               
   └─ zig build-exe ghostty ReleaseFast native 2 errors                                                                                                                                     
error: ld.lld:                                                                                                                                                                               
error: ld.lld: undefined symbol: bindtextdomain                                                                                                                                             
    note: referenced by ghostty                                                                                                                                                             
    note:               /Volumes/Projects/ghostty/.zig-cache/o/e2e8d04b7729d61175fad5eda9047ec7/ghostty.o:(global.GlobalState.init)                                                         
error: the following command failed with 2 compilation errors:
you need to specify gui backend as well, and install pandoc + gettext stuff
Code:
pkg install gettext-tools hs-pandoc
zig build -Dapp-runtime=gtk run
 
Dang, I won't be able to try the port cuz i've tried to reduce devel/llvm19's build time by eliminating some options:(

Rich (BB code):
===>  Performing out-of-source build
/bin/mkdir -p /wrkdirs/usr/ports/lang/zig/work/.build
-- The C compiler identification is Clang 19.1.7
-- The CXX compiler identification is Clang 19.1.7
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/local/libexec/ccache/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/local/libexec/ccache/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring zig version 0.14.0
CMake Error at cmake/Findllvm.cmake:30 (message):
  LLVM (according to /usr/local/bin/llvm-config19) is missing target AArch64.
  Zig requires LLVM to be built with all default targets enabled.
Call Stack (most recent call first):
  CMakeLists.txt:135 (find_package)


-- Configuring incomplete, errors occurred!
*** Error code 1

Stop.
make: stopped in /usr/ports/lang/zig
=>> Cleaning up wrkdir
===>  Cleaning for zig-0.14.0
build of lang/zig | zig-0.14.0 ended at Thu Jun 26 18:45:40 +03 2025
build time: 00:00:13
!!! build failure encountered !!!
 
Working good, nice terminal. This is what I did to make it work:
Code:
pkg install zig gettext-tools hs-pandoc blueprint-compiler
git clone https://github.com/ghostty-org/ghostty
cd ghostty
zig build -p $HOME/.local -Dapp-runtime=gtk -Doptimize=ReleaseFast
The integration with FreeBSD is not perfect. First I had to manually set the variable:
GHOSTTY_RESOURCES_DIR=~/.local/share/ghostty
then I had to create a symbolic link:
Code:
[15:08][fmc000@tu45b-freebsd ~] $ ls -l .local/share/terminfo
lrwxr-xr-x  1 fmc000 fmc000 13 28 giu 15:02 .local/share/terminfo -> site-terminfo
[15:09][fmc000@tu45b-freebsd ~] $
so that the correct terminal type could be set. Not only that, I had to copy inside that dir the ghostty.termcap and ghostty.terminfo from the distribution.
Finally, I had to copy the icon icon_256.png from the distribution to ~/.icons/ghostty.png and then create the desktop file:
Code:
[15:23][fmc000@tu45b-freebsd ~/.local/share/applications] $ cat ghostty.desktop
[Desktop Entry]
Name=Ghostty
Exec=ghostty
# Translators: Do NOT translate or transliterate this text (this is an icon file name)!
Icon=ghostty
Keywords=command;prompt;cmd;commandline;run;shell;terminal;kgx;kings cross;
Terminal=false
Type=Application
Categories=System;TerminalEmulator;Utility;GTK;GNOME;
StartupNotify=true
DBusActivatable=true
X-GNOME-UsesNotifications=true
Actions=new-window;new-tab;
# Translators: Do NOT translate or transliterate this text (these are enum types)!
X-Purism-FormFactor=Workstation;Mobile;
[15:23][fmc000@tu45b-freebsd ~/.local/share/applications] $
 
Working good, nice terminal. This is what I did to make it work:
Code:
pkg install zig gettext-tools hs-pandoc blueprint-compiler
git clone https://github.com/ghostty-org/ghostty
cd ghostty
zig build -p $HOME/.local -Dapp-runtime=gtk -Doptimize=ReleaseFast
The integration with FreeBSD is not perfect. First I had to manually set the variable:
GHOSTTY_RESOURCES_DIR=~/.local/share/ghostty
then I had to create a symbolic link:
Code:
[15:08][fmc000@tu45b-freebsd ~] $ ls -l .local/share/terminfo
lrwxr-xr-x  1 fmc000 fmc000 13 28 giu 15:02 .local/share/terminfo -> site-terminfo
[15:09][fmc000@tu45b-freebsd ~] $
so that the correct terminal type could be set. Not only that, I had to copy inside that dir the ghostty.termcap and ghostty.terminfo from the distribution.
Finally, I had to copy the icon icon_256.png from the distribution to ~/.icons/ghostty.png and then create the desktop file:
Code:
[15:23][fmc000@tu45b-freebsd ~/.local/share/applications] $ cat ghostty.desktop
[Desktop Entry]
Name=Ghostty
Exec=ghostty
# Translators: Do NOT translate or transliterate this text (this is an icon file name)!
Icon=ghostty
Keywords=command;prompt;cmd;commandline;run;shell;terminal;kgx;kings cross;
Terminal=false
Type=Application
Categories=System;TerminalEmulator;Utility;GTK;GNOME;
StartupNotify=true
DBusActivatable=true
X-GNOME-UsesNotifications=true
Actions=new-window;new-tab;
# Translators: Do NOT translate or transliterate this text (these are enum types)!
X-Purism-FormFactor=Workstation;Mobile;
[15:23][fmc000@tu45b-freebsd ~/.local/share/applications] $
Makes sense, its a source build. Port is in the works.
 
I was working on this port since yesterday evening, i am almost done, just being sure everything is working correctly by testing it in poudriere.

There's an annoying issue I've noticed, the WM_NAME of the port is shown as "broken" and is empty as seen in xprop output, i don't know how to solve it and why that happens.
 

Attachments

  • 2025-06-28-193937_1920x1080_scrot.png
    2025-06-28-193937_1920x1080_scrot.png
    103.7 KB · Views: 105
Back
Top