# there are some dependencies that are only used as fallbacks if a system version # could not be found, however they will still be compiled even if they end up unused. # Those unused dependencies will have a comment denoting this, # pleasy verify if any unused dependencies can be dropped in future versions # # Zig only dependencies are vendored all other dependencies will be resolved from the system # in future releases. # fontconfig is unused %global fontconfig_version 2.14.2 # harfbuzz is unused %global harfbuzz_version 8.4.0 %global utfcpp_version 4.0.5 %global iterm2_color_commit d6c42066b3045292e0b1154ad84ff22d6863ebf7 %global z2d_commit 4638bb02a9dc41cc2fb811f092811f6a951c752a %global spirv_cross_commit 476f384eb7d9e48613c45179e502a15ab95b6b49 %global libvaxis_commit1 6d729a2dc3b934818dffe06d2ba3ce02841ed74b %global libvaxis_commit2 dc0a228a5544988d4a920cfb40be9cd28db41423 %global sentry_version 0.7.8 # glslang is unused %global glslang_version 14.2.0 # freetype is unused %global freetype_version 2.13.2 %global freetype_dash_version %{lua x = string.gsub(macros['freetype_version'], "%.", "-"); print(x)} # oniguruma is unused %global oniguruma_version 6.9.9 %global highway_version 1.1.0 %global libxev_commit db6a52bafadf00360e675fefa7926e8e6c0e9931 %global imgui_commit e391fe2e66eb1c96b1624ae8444dc64c23146ef4 %global breakpad_commit b99f444ba5f6b98cac261cbb391d8766b34a5918 %global wuffs_version 0.4.0-alpha.8 %global ziglyph_commit b89d43d1e3fb01b6074bc1f7fc980324b04d26a5 %global zf_commit ed99ca18b02dda052e20ba467e90b623c04690dd %global zigimg_commit 3a667bdb3d7f0955a5a51c8468eac83210c1439e %global zg_version 0.13.2 # These aren't needed for compiling on linux however these are not marked as lazy # thus required to be valid zig packages %global zig_objc_commit 9b8ba849b0f58fe207ecd6ab7c147af55b17556e %global zig_js_commit d0b8b0a57c52fbc89f9d9fecba75ca29da7dd7d1 # needed to get rid of a header informing the user the application is compiled in debug mode %global _zig_release_mode fast %global build_options %{shrink: \ -Dflatpak=false \ -Dfont-backend=fontconfig_freetype \ -Drenderer=opengl \ -Dgtk-adwaita=true \ -Dpie=true \ -Demit-docs=true \ -Dversion-string="%{version}" \ -Dstrip=false \ } %global gtk_options %{shrink: \ %{build_options} \ -Dapp-runtime=gtk \ } %global lib_options %{shrink: \ %{build_options} \ -Dapp-runtime=none \ } # Signing key from https://github.com/ghostty-org/ghostty/blob/main/PACKAGING.md %global public_key RWQlAjJC23149WL2sEpT/l0QKy7hMIFhYdQOFy0Z7z7PbneUgvlsnYcV # libghostty is considered unstable so don't ship it yet # BUG: zig fails to assign a build-id to shared objects # https://github.com/ziglang/zig/pull/22357 %bcond lib 0 Name: ghostty Version: 1.0.0 Release: 1%{?dist} Summary: Fast, native, feature-rich terminal emulator pushing modern features # ghostty: MIT # libvaxis: MIT # libxev: MIT # zig-objc: MIT # zig-js: MIT # z2d: MPL-2.0 # zf: MIT # zigimg: MIT # ziglyph: MIT # zg: MIT # iTerm2-Color-Schemes: MIT # pkg/fontconfig: HPND AND LicenseRef-Fedora-Public-Domain AND Unicode-DFS-2016 # pkg/harfbuzz: MIT-Modern-Variant # pkg/utfcpp: BSL-1.0 # pkg/spirv-cross: Apache-2.0 # pkg/sentry: MIT # pkg/glslang: BSD-2-Clause AND BSD-3-Clause AND GPL-3.0-or-later AND Apache-2.0 # pkg/freetype: (FTL OR GPL-2.0-or-later) AND BSD-3-Clause AND MIT AND MIT-Modern-Variant AND LicenseRef-Fedora-Public-Domain AND Zlib) # pkg/oniguruma: BSD-2-Clause # pkg/highway: Apache-2.0 # pkg/cimgui: MIT # pkg/breakpad: MIT AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause AND Apache-2.0 AND MIT AND curl AND APSL-2.0 AND ClArtistic AND Unicode-3.0 AND LicenseRef-Fedora-Public-Domain AND (GPL-2.0-or-later WITH Autoconf-exception-generic) # pkg/wuffs: Apache-2.0 AND MIT License: MIT AND MIT-Modern-Variant AND Zlib AND curl AND MPL-2.0 AND HPND AND LicenseRef-Fedora-Public-Domain AND Unicode-DFS-2016 AND Unicode-3.0 AND BSL-1.0 AND Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause AND (FTL OR GPL-2.0-or-later) AND APSL-2.0 AND ClArtistic AND GPL-3.0-or-later AND (GPL-2.0-or-later WITH Autoconf-exception-generic) AND OFL-1.1 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 # filename is "ghostty-source" for 1.0.0 Source0: https://release.files.ghostty.org/%{version}/ghostty-source.tar.gz Source1: https://release.files.ghostty.org/%{version}/ghostty-source.tar.gz.minisig # Needed for installation to work properly with DESTDIR # https://github.com/ghostty-org/ghostty/commit/2114e0a613a2e786f82430804e9d2ad0d05a6a45 Patch0: 0001-Fix-DESTDIR-handling-for-terminfo-installation.patch # Release builds get automatically stripped, added an option to disable it # https://github.com/ghostty-org/ghostty/pull/3945 Patch1: https://github.com/ghostty-org/ghostty/pull/3945.patch#/ghostty-3945.patch Source10: https://deps.files.ghostty.org/fontconfig-%{fontconfig_version}.tar.gz Source11: https://github.com/harfbuzz/harfbuzz/archive/refs/tags/%{harfbuzz_version}/harfbuzz-%{harfbuzz_version}.tar.gz Source12: https://github.com/nemtrif/utfcpp/archive/refs/tags/v%{utfcpp_version}/utfcpp-%{utfcpp_version}.tar.gz Source13: https://github.com/mbadolato/iTerm2-Color-Schemes/archive/%{iterm2_color_commit}/iTerm2-Color-Schemes-%{iterm2_color_commit}.tar.gz Source14: https://github.com/vancluever/z2d/archive/%{z2d_commit}/z2d-%{z2d_commit}.tar.gz Source15: https://github.com/KhronosGroup/SPIRV-Cross/archive/%{spirv_cross_commit}/SPIRV-Cross-%{spirv_cross_commit}.tar.gz # zf requires a different version of libvaxis than ghostty Source16: https://github.com/rockorager/libvaxis/archive/%{libvaxis_commit1}/libvaxis-%{libvaxis_commit1}.tar.gz Source17: https://github.com/rockorager/libvaxis/archive/%{libvaxis_commit2}/libvaxis-%{libvaxis_commit2}.tar.gz # sentry is only used for catching errors and not for uploading # PR to disable it https://github.com/ghostty-org/ghostty/pull/3934 Source18: https://github.com/getsentry/sentry-native/archive/refs/tags/%{sentry_version}/sentry-native-%{sentry_version}.tar.gz Source19: https://github.com/KhronosGroup/glslang/archive/refs/tags/%{glslang_version}/glslang-%{glslang_version}.tar.gz Source20: https://github.com/freetype/freetype/archive/refs/tags/VER-%{freetype_dash_version}.tar.gz#/freetype2-%{freetype_dash_version}.tar.gz Source21: https://github.com/kkos/oniguruma/archive/refs/tags/v%{oniguruma_version}/oniguruma-%{oniguruma_version}.tar.gz Source22: https://github.com/google/highway/archive/refs/tags/%{highway_version}/highway-%{highway_version}.tar.gz Source23: https://github.com/mitchellh/libxev/archive/%{libxev_commit}/libxev-%{libxev_commit}.tar.gz Source24: https://github.com/ocornut/imgui/archive/%{imgui_commit}/imgui-%{imgui_commit}.tar.gz Source25: https://github.com/getsentry/breakpad/archive/%{breakpad_commit}/sentry-breakpad-%{breakpad_commit}.tar.gz Source26: https://github.com/google/wuffs/archive/refs/tags/v%{wuffs_version}/wuffs-%{wuffs_version}.tar.gz Source27: https://deps.files.ghostty.org/ziglyph-%{ziglyph_commit}.tar.gz Source28: https://github.com/natecraddock/zf/archive/%{zf_commit}/zf-%{zf_commit}.tar.gz Source29: https://github.com/zigimg/zigimg/archive/%{zigimg_commit}/zigimg-%{zigimg_commit}.tar.gz Source30: https://codeberg.org/atman/zg/archive/v%{zg_version}.tar.gz#/zg-%{zg_version}.tar.gz Source31: https://github.com/mitchellh/zig-objc/archive/%{zig_objc_commit}/zig-objc-%{zig_objc_commit}.tar.gz Source32: https://github.com/mitchellh/zig-js/archive/%{zig_js_commit}/zig-js-%{zig_js_commit}.tar.gz %global source_setup %{lua: \ for i = 10, 32 do \ print(" -a " .. i) \ end \ } Provides: bundled(fontconfig) = %{fontconfig_version} Provides: bundled(harfbuzz) = %{harfbuzz_version} Provides: bundled(utfcpp) = %{utfcpp_version} Provides: bundled(z2d) = %{z2d_commit} Provides: bundled(SPIRV-Cross) = %{spirv_cross_commit} Provides: bundled(libvaxis) = %{libvaxis_commit1} Provides: bundled(libvaxis) = %{libvaxis_commit2} Provides: bundled(sentry-native) = %{sentry_version} Provides: bundled(glslang) = %{glslang_version} Provides: bundled(freetype2) = %{freetype_version} Provides: bundled(oniguruma) = %{oniguruma_version} Provides: bundled(highway) = %{highway_version} Provides: bundled(libxev) = %{libxev_commit} Provides: bundled(imgui) = %{imgui_commit} Provides: bundled(breakpad) = %{breakpad_commit} Provides: bundled(wuffs) = %{wuffs_version} Provides: bundled(ziglyph) = %{ziglyph_commit} Provides: bundled(zf) = %{zf_commit} Provides: bundled(zigimg) = %{zigimg_commit} Provides: bundled(zg) = %{zg_version} Provides: bundled(zig-objc) = %{zig_objc_commit} Provides: bundled(zig-js) = %{zig_js_commit} # the fonts are included with ghostty and are embedded directly into the executable # https://github.com/ghostty-org/ghostty/blob/v1.0.0/src/font/embedded.zig # CodeNewRoman OFL-1.1 # GeistMono OFL-1.1 # Inconsolata OFL-1.1 # JetBrainsMono OFL-1.1 # JuliaMono OFL-1.1 # KawkabMono OFL-1.1 # Lilex OFL-1.1 # MonaspaceNeon OFL-1.1 # NotoEmoji OFL-1.1 # CozetteVector MIT # NerdFont MIT AND OFL-1.1 Provides: bundled(font(JetBrainsMonoNerdFont)) = 2.3.0 Provides: bundled(font(JetBrainsMono)) = 2.3.0 Provides: bundled(font(NotoEmoji)) = 2.034 Provides: bundled(font(KawkabMono)) = 0.501 Provides: bundled(font(Lilex)) = 2.200 Provides: bundled(font(CodeNewRoman)) = 2.000 Provides: bundled(font(Inconsolata)) = 3.001 Provides: bundled(font(GeistMono)) = 1.2.0 Provides: bundled(font(JuliaMono)) = 0.055 Provides: bundled(font(CozetteVector)) = 1.22.2 Provides: bundled(font(MonaspaceNeon)) = 1.000 ExclusiveArch: %{zig_arches} BuildRequires: gcc BuildRequires: desktop-file-utils BuildRequires: (zig >= 0.13 with zig < 0.14) BuildRequires: zig-rpm-macros BuildRequires: pkg-config BuildRequires: pkgconfig(glslang) BuildRequires: pkgconfig(simdutf) # font backend BuildRequires: pkgconfig(bzip2) BuildRequires: pkgconfig(freetype2) BuildRequires: pkgconfig(fontconfig) BuildRequires: pkgconfig(harfbuzz) BuildRequires: pkgconfig(libpng) BuildRequires: pkgconfig(zlib) BuildRequires: pkgconfig(oniguruma) # app runtime BuildRequires: pkgconfig(gtk4) BuildRequires: pkgconfig(libadwaita-1) BuildRequires: libX11-devel # docs BuildRequires: pandoc # for signature verification BuildRequires: minisign Requires: %{name}-terminfo = %{version}-%{release} Requires: %{name}-shell-integration = %{version}-%{release} Requires: %{name}-themes = %{version}-%{release} %description Ghostty is a terminal emulator that differentiates itself by being fast, feature-rich, and native. While there are many excellent terminal emulators available, they all force you to choose between speed, features, or native UIs. Ghostty provides all three. %if %{with lib} %package -n libghostty Summary: ghostty terminal library %description -n libghostty ghostty terminal library %package -n libghostty-static Summary: static ghostty terminal libary %description -n libghostty-static static ghostty terminal libary %package -n libghostty-devel Summary: development files for libghostty Requires: libghostty BuildArch: noarch %description -n libghostty-devel development files for libghostty %endif %package bash-completion Summary: Bash completion for %{name} BuildArch: noarch Requires: %{name} = %{version}-%{release} Requires: bash-completion Supplements: (%{name} and bash-completion) %description bash-completion Bash command line completion support for %{name}. %package zsh-completion Summary: Zsh completion for %{name} BuildArch: noarch Requires: %{name} = %{version}-%{release} Requires: zsh Supplements: (%{name} and zsh) %description zsh-completion Zsh command line completion support for %{name}. %package fish-completion Summary: Fish completion for %{name} BuildArch: noarch Requires: %{name} = %{version}-%{release} Requires: fish Supplements: (%{name} and fish) %description fish-completion Fish command line completion support for %{name}. %package shell-integration Summary: Shell integration scripts for %{name} BuildArch: noarch %description shell-integration shell-integration for %{name} %package nvim-plugin Summary: Neovim plugin for %{name} BuildArch: noarch Supplements: (%{name} and nvim) %description nvim-plugin Neovim plugin for %{name} %package vim-plugin Summary: Vim plugin for %{name} BuildArch: noarch Supplements: (%{name} and vim) %description vim-plugin Vim plugin for %{name} %package bat-syntax Summary: Bat syntax for %{name} BuildArch: noarch Supplements: (%{name} and bat) %description bat-syntax Bat syntax for %{name} %package terminfo Summary: terminfo for %{name} BuildArch: noarch Requires: %{name} = %{version}-%{release} Requires: ncurses-base %description terminfo terminfo for %{name} %package themes Summary: Themes for %{name} BuildArch: noarch %description themes Themes for %{name} %package docs Summary: Documentation for %{name} BuildArch: noarch %description docs Documentation for %{name} %prep /usr/bin/minisign -V -m %{SOURCE0} -x %{SOURCE1} -P %{public_key} %setup -q -n ghostty-source %{source_setup} %patch 0 -p1 %patch 1 -p1 # Put all packages in the cache %zig_fetch fontconfig-%{fontconfig_version} %zig_fetch harfbuzz-%{harfbuzz_version} %zig_fetch utfcpp-%{utfcpp_version} %zig_fetch iTerm2-Color-Schemes-%{iterm2_color_commit} %zig_fetch z2d-%{z2d_commit} %zig_fetch SPIRV-Cross-%{spirv_cross_commit} %zig_fetch libvaxis-%{libvaxis_commit1} %zig_fetch libvaxis-%{libvaxis_commit2} %zig_fetch sentry-native-%{sentry_version} %zig_fetch glslang-%{glslang_version} %zig_fetch freetype-VER-%{freetype_dash_version} %zig_fetch oniguruma-%{oniguruma_version} %zig_fetch highway-%{highway_version} %zig_fetch libxev-%{libxev_commit} %zig_fetch imgui-%{imgui_commit} %zig_fetch breakpad-%{breakpad_commit} %zig_fetch wuffs-%{wuffs_version} %zig_fetch ziglyph %zig_fetch zf-%{zf_commit} %zig_fetch zigimg-%{zigimg_commit} %zig_fetch zg %zig_fetch zig-objc-%{zig_objc_commit} %zig_fetch zig-js-%{zig_js_commit} # stubbing some packages that aren't needed # libxml2 mkdir %{_zig_cache_dir}/p/122032442d95c3b428ae8e526017fad881e7dc78eab4d558e9a58a80bfbd65a64f7d # libpng mkdir %{_zig_cache_dir}/p/1220aa013f0c83da3fb64ea6d327f9173fa008d10e28bc9349eac3463457723b1c66 # zlib mkdir %{_zig_cache_dir}/p/1220fed0c74e1019b3ee29edae2051788b080cd96e90d56836eea857b0b966742efb %build # Building GTK frontend %zig_build %{gtk_options} # print out the build config ./zig-out/bin/ghostty +version %if %{with lib} # Building libghostty %zig_build %{lib_options} %endif %install mkdir -p %{buildroot}%{_datadir} %zig_install %{gtk_options} %if %{with lib} %zig_install %{lib_options} %endif %check %zig_test desktop-file-validate %{buildroot}%{_datadir}/applications/com.mitchellh.ghostty.desktop %files %license LICENSE %{_bindir}/ghostty %{_datadir}/applications/com.mitchellh.ghostty.desktop %{_datadir}/kio/servicemenus/com.mitchellh.ghostty.desktop %{_datadir}/icons/hicolor/*/apps/com.mitchellh.ghostty.png %{_mandir}/man1/ghostty.1.* %{_mandir}/man5/ghostty.5.* %if %{with lib} %files -n libghostty %{_libdir}/libghostty.so %files -n libghostty-static %{_libdir}/libghostty.a %files -n libghostty-devel %{_includedir}/ghostty.h %endif %files bash-completion %{bash_completions_dir}/ghostty.bash %files zsh-completion %{zsh_completions_dir}/_%{name} %files fish-completion %{fish_completions_dir}/%{name}.fish %files shell-integration %{_datadir}/ghostty/shell-integration %files nvim-plugin %{_datadir}/nvim/site/ftdetect/ghostty.vim %{_datadir}/nvim/site/ftplugin/ghostty.vim %{_datadir}/nvim/site/syntax/ghostty.vim %files vim-plugin %{_datadir}/vim/vimfiles/ftdetect/ghostty.vim %{_datadir}/vim/vimfiles/ftplugin/ghostty.vim %{_datadir}/vim/vimfiles/syntax/ghostty.vim %files bat-syntax %{_datadir}/bat/syntaxes/ghostty.sublime-syntax %files terminfo %{_datadir}/terminfo/g/ghostty %{_datadir}/terminfo/ghostty.termcap %{_datadir}/terminfo/ghostty.terminfo %{_datadir}/terminfo/x/xterm-ghostty %files themes %{_datadir}/ghostty/themes/ %files docs %doc README.md %{_datadir}/ghostty/doc/ %changelog * Mon Dec 30 2024 Jan200101 - 1.0.0-1 - initial release