Name: ghostty Version: 1.4.0 Release: 1%{?dist} Summary: Fast, native terminal emulator with the complete Ghostty resource set License: MIT URL: https://ghostty.org/ Source0: https://release.files.ghostty.org/%{version}/ghostty-%{version}.tar.gz Source1: https://release.files.ghostty.org/%{version}/ghostty-%{version}.tar.gz.minisig ExclusiveArch: x86_64 aarch64 # Ghostty 1.4.0 requires Zig 0.17, GTK 4.18, and libadwaita 1.7. BuildRequires: zig >= 0.17.0 BuildRequires: zig < 0.18 BuildRequires: gcc BuildRequires: python3 BuildRequires: minisign BuildRequires: pkgconf-pkg-config BuildRequires: gtk4-devel >= 4.18 BuildRequires: libadwaita-devel >= 1.7 BuildRequires: gtk4-layer-shell-devel >= 1.0.4 BuildRequires: libglvnd-devel BuildRequires: wayland-devel BuildRequires: libxkbcommon-devel BuildRequires: fontconfig-devel BuildRequires: gettext BuildRequires: ncurses Requires: gtk4 >= 4.18 Requires: libadwaita >= 1.7 Requires: libglvnd-egl %description Ghostty is a GPU-accelerated, native terminal emulator with a GTK frontend for Linux. This package builds the upstream 1.4.0 source and installs the complete shared resource directory, including bundled themes, shell integration, completions, desktop integration, and terminfo. %prep # Verify the upstream release archive before unpacking it. minisign -Vm "%{SOURCE0}" -x "%{SOURCE1}" -P 'RWQlAjJC23149WL2sEpT/l0QKy7hMIFhYdQOFy0Z7z7PbneUgvlsnYcV' %autosetup -n ghostty-%{version} %build # The upstream source tarball includes preprocessed GTK resources. # Pre-fetch pinned Zig dependencies into a writable cache (COPR needs network # access for this step); subsequent build operations use this same cache. export ZIG_GLOBAL_CACHE_DIR="$PWD/.ghostty-zig-cache" sh ./nix/build-support/fetch-zig-cache.sh # Install into an isolated staging root using the *real* final prefix. # Never build with the RPM buildroot itself as the Ghostty prefix: that breaks # runtime resource discovery, including /usr/share/ghostty/themes. mkdir -p "$PWD/.ghostty-stage" export DESTDIR="$PWD/.ghostty-stage" zig build \ --prefix /usr \ -Dinstalled-exe-path=/usr/bin/ghostty \ -Doptimize=ReleaseFast \ -Dcpu=baseline \ -Demit-themes=true \ -Demit-terminfo=true \ -Demit-docs=false \ -j2 %install install -d "%{buildroot}%{_prefix}" cp -a .ghostty-stage/usr/. "%{buildroot}%{_prefix}/" # A successful Zig build is not sufficient if its lazy theme dependency was # skipped, or resources were placed under the build directory by mistake. test -x "%{buildroot}%{_bindir}/ghostty" test -d "%{buildroot}%{_datadir}/ghostty/themes" test -d "%{buildroot}%{_datadir}/ghostty/shell-integration" export GHOSTTY_RPM_BUILDROOT="%{buildroot}" python3 - <<'PY' import os from pathlib import Path root = Path(os.environ['GHOSTTY_RPM_BUILDROOT']) files = sorted(p for p in root.rglob('*') if p.is_file() or p.is_symlink()) themes = list((root / 'usr/share/ghostty/themes').rglob('*')) theme_count = sum(p.is_file() for p in themes) if theme_count < 100: raise SystemExit(f'Ghostty resource installation incomplete: only {theme_count} themes') if not files: raise SystemExit('Ghostty installation contains no files') with open('ghostty.files', 'w', encoding='utf-8') as output: for entry in files: path = '/' + entry.relative_to(root).as_posix() if '\n' in path or '\r' in path: raise SystemExit(f'Unexpected newline in installed filename: {path!r}') # RPM file manifests accept quoted filenames, including spaces in # the bundled theme names. Quote each file rather than adding entire # shared directories like /usr/share/icons to %files. escaped = path.replace('\\', '\\\\').replace('"', '\\"') output.write('"' + escaped + '"\n') print(f'Packaging {len(files)} installed files, including {theme_count} themes') PY %check # Verifies the actual staged paths, not merely the source archive. test -x "%{buildroot}%{_bindir}/ghostty" test -s "%{buildroot}%{_datadir}/ghostty/themes/Adwaita Dark" test -d "%{buildroot}%{_datadir}/ghostty/shell-integration" test -d "%{buildroot}%{_datadir}/terminfo" # The theme list should be loadable without a graphical session. Use the # staging path as a resource override here because the binary is not yet # installed at its final /usr/bin location during the RPM build. GHOSTTY_RESOURCES_DIR="%{buildroot}%{_datadir}/ghostty" \ "%{buildroot}%{_bindir}/ghostty" +list-themes --plain \ > .ghostty-themes-test grep -Fxq 'Adwaita Dark' .ghostty-themes-test %files -f ghostty.files %license LICENSE %changelog * Thu Oct 29 2026 Sl (Shahaf Levi) - 1.4.0-1 - Package upstream Ghostty 1.4.0 with the complete shared resources. - Verify the signed release tarball and require installed bundled themes. - Use the final /usr prefix for correct runtime resource discovery.