%global zig_minimum_version 0.15.0 %global _missing_build_ids_terminate_build 0 %global debug_package %{nil} %global ghostty_systemd_user_unitdir %{_prefix}/lib/systemd/user %global ghostty_libdir %{_prefix}/lib %global ghostty_pkgconfig_dir %{_prefix}/share/pkgconfig Name: ghostty Version: 1.3.0 Release: 1%{?dist} Summary: Fast, feature-rich, and cross-platform terminal emulator that uses platform-native UI and GPU acceleration License: MIT URL: https://github.com/ghostty-org/ghostty Source0: https://release.files.ghostty.org/%{version}/ghostty-%{version}.tar.gz ExclusiveArch: x86_64 aarch64 BuildRequires: zig >= %{zig_minimum_version} BuildRequires: blueprint-compiler BuildRequires: fontconfig-devel BuildRequires: freetype-devel BuildRequires: glib2-devel BuildRequires: gtk4-devel BuildRequires: gtk4-layer-shell-devel BuildRequires: harfbuzz-devel BuildRequires: libadwaita-devel BuildRequires: libpng-devel BuildRequires: oniguruma-devel BuildRequires: pixman-devel BuildRequires: pkg-config BuildRequires: wayland-protocols-devel BuildRequires: zlib-ng-devel BuildRequires: curl Requires: fontconfig Requires: freetype Requires: glib2 Requires: gtk4 Requires: harfbuzz Requires: libadwaita Requires: libpng Requires: oniguruma Requires: pixman Requires: zlib-ng %package devel Summary: Development files for Ghostty Requires: %{name}%{?_isa} = %{version}-%{release} %description devel Development files for Ghostty. Includes headers and pkg-config metadata for the libghostty-vt API. %description %{summary}. %prep %setup -q -n ghostty-%{version} # Fetch remote dependencies to a local Zig cache so build is reproducible and offline-safe ZIG_GLOBAL_CACHE_DIR=$PWD/zig-deps if [ -x ./nix/build-support/fetch-zig-cache.sh ]; then ZIG_GLOBAL_CACHE_DIR=$ZIG_GLOBAL_CACHE_DIR ./nix/build-support/fetch-zig-cache.sh else echo "WARNING: fetch-zig-cache.sh not found; proceeding with direct network access." fi %build ZIG_BIN=%{_bindir}/zig ZIG_GLOBAL_CACHE_DIR=$PWD/zig-deps if [ ! -d "$ZIG_GLOBAL_CACHE_DIR/p" ]; then echo "ERROR: Zig cache directory not found at $ZIG_GLOBAL_CACHE_DIR/p; expected pre-fetched deps." exit 1 fi export ZIG_GLOBAL_CACHE_DIR mkdir -p %{_builddir}/ghostty-buildroot DESTDIR=%{_builddir}/ghostty-buildroot "$ZIG_BIN" build install \ --system "$ZIG_GLOBAL_CACHE_DIR/p" \ --summary all \ --prefix "%{_prefix}" \ -Dversion-string=%{version}-%{release} \ -Doptimize=ReleaseFast \ -Dcpu=baseline \ -Dpie=true \ -Demit-docs=false %install cp -a %{_builddir}/ghostty-buildroot/* %{buildroot}/ if [ ! -f "%{buildroot}%{ghostty_systemd_user_unitdir}/app-com.mitchellh.ghostty.service" ]; then echo "ERROR: Ghostty systemd user service file was not generated by zig build." exit 1 fi PKGCONFIG_SOURCE_FILE="$(find %{_builddir}/ghostty-buildroot -type f \ -path '*/pkgconfig/libghostty-vt.pc' | head -n 1)" if [ -z "$PKGCONFIG_SOURCE_FILE" ]; then echo "ERROR: Ghostty pkg-config metadata libghostty-vt.pc was not generated by zig build." echo "Searched in: */pkgconfig/libghostty-vt.pc" find %{_builddir}/ghostty-buildroot -type f -path '*/pkgconfig/*ghostty*' | head -n 20 || true exit 1 fi mkdir -p "%{buildroot}%{ghostty_pkgconfig_dir}" cp -a "$PKGCONFIG_SOURCE_FILE" "%{buildroot}%{ghostty_pkgconfig_dir}/libghostty-vt.pc" %if 0%{?fedora} >= 42 rm -f "%{buildroot}%{_prefix}/share/terminfo/g/ghostty" %endif %files %license LICENSE %{_bindir}/ghostty %{_prefix}/share/applications/com.mitchellh.ghostty.desktop %{_prefix}/share/bash-completion/completions/ghostty.bash %{_prefix}/share/bat/syntaxes/ghostty.sublime-syntax %{_prefix}/share/fish/vendor_completions.d/ghostty.fish %{_prefix}/share/ghostty %{_prefix}/share/icons/hicolor/1024x1024/apps/com.mitchellh.ghostty.png %{_prefix}/share/icons/hicolor/128x128/apps/com.mitchellh.ghostty.png %{_prefix}/share/icons/hicolor/128x128@2/apps/com.mitchellh.ghostty.png %{_prefix}/share/icons/hicolor/16x16/apps/com.mitchellh.ghostty.png %{_prefix}/share/icons/hicolor/16x16@2/apps/com.mitchellh.ghostty.png %{_prefix}/share/icons/hicolor/256x256/apps/com.mitchellh.ghostty.png %{_prefix}/share/icons/hicolor/256x256@2/apps/com.mitchellh.ghostty.png %{_prefix}/share/icons/hicolor/32x32/apps/com.mitchellh.ghostty.png %{_prefix}/share/icons/hicolor/32x32@2/apps/com.mitchellh.ghostty.png %{_prefix}/share/icons/hicolor/512x512/apps/com.mitchellh.ghostty.png %{_prefix}/share/kio/servicemenus/com.mitchellh.ghostty.desktop %{_prefix}/share/nautilus-python/extensions/ghostty.py %{_prefix}/share/nvim/site/compiler/ghostty.vim %{_prefix}/share/nvim/site/ftdetect/ghostty.vim %{_prefix}/share/nvim/site/ftplugin/ghostty.vim %{_prefix}/share/nvim/site/syntax/ghostty.vim %{_prefix}/share/vim/vimfiles/compiler/ghostty.vim %{_prefix}/share/vim/vimfiles/ftdetect/ghostty.vim %{_prefix}/share/vim/vimfiles/ftplugin/ghostty.vim %{_prefix}/share/vim/vimfiles/syntax/ghostty.vim %{_prefix}/share/zsh/site-functions/_ghostty %{_prefix}/share/dbus-1/services/com.mitchellh.ghostty.service %{_prefix}/share/locale/*/LC_MESSAGES/com.mitchellh.ghostty.mo %{_prefix}/share/metainfo/com.mitchellh.ghostty.metainfo.xml %{ghostty_systemd_user_unitdir}/app-com.mitchellh.ghostty.service %{ghostty_libdir}/libghostty-vt.so.0* %{_prefix}/share/terminfo/x/xterm-ghostty %if 0%{?fedora} < 42 %{_prefix}/share/terminfo/g/ghostty %endif %files devel %dir %{_includedir}/ghostty %dir %{_includedir}/ghostty/vt %{_includedir}/ghostty/vt.h %{_includedir}/ghostty/vt/allocator.h %{_includedir}/ghostty/vt/color.h %{_includedir}/ghostty/vt/key.h %{_includedir}/ghostty/vt/key/encoder.h %{_includedir}/ghostty/vt/key/event.h %{_includedir}/ghostty/vt/osc.h %{_includedir}/ghostty/vt/paste.h %{_includedir}/ghostty/vt/result.h %{_includedir}/ghostty/vt/sgr.h %{_includedir}/ghostty/vt/wasm.h %{ghostty_libdir}/libghostty-vt.so %{ghostty_pkgconfig_dir}/libghostty-vt.pc %changelog %autochangelog