# Copyright 1999-2024 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 ZIG_SLOT="0.13" inherit git-r3 zig DESCRIPTION="Ghostty is a fast, feature-rich, and cross-platform terminal emulator that uses platform-native UI and GPU acceleration." HOMEPAGE="ghostty.org" EGIT_REPO_URI="https://github.com/ghostty-org/ghostty.git" LICENSE="MIT" SLOT="0" IUSE="adwaita man gtk +glfw" IUSE+=" +system-fontconfig +system-freetype +system-glslang +system-harfbuzz +system-libpng system-libxml2 +system-oniguruma +system-zlib +system-simdutf" REQUIRED_USE=" adwaita? ( gtk ) ^^ ( gtk glfw ) " RDEPEND=" adwaita? ( gui-libs/libadwaita:1= ) gtk? ( gui-libs/gtk:4=[X] system-libxml2? ( >=dev-libs/libxml2-2.11.5:= ) ) system-fontconfig? ( >=media-libs/fontconfig-2.14.2:= ) system-freetype? ( >=media-libs/freetype-2.13.2:=[bzip2] ) system-glslang? ( >=dev-util/glslang-1.3.296.0:= ) system-harfbuzz? ( >=media-libs/harfbuzz-8.4.0:= ) system-libpng? ( >=media-libs/libpng-1.6.43:= ) system-oniguruma? ( >=dev-libs/oniguruma-6.9.9:= ) system-zlib? ( >=sys-libs/zlib-1.3.1:= ) system-simdutf? ( >=dev-cpp/simdutf-5.7.2:= ) " DEPEND="${RDEPEND}" QA_FLAGS_IGNORED="usr/bin/ghostty" QA_PRESTRIPPED="usr/bin/ghostty" PATCHES=( "${FILESDIR}"/${PN}-1.0.0-bzip2-dependency.patch ) src_unpack() { git-r3_fetch git-r3_checkout cd ${S}/ || die zig build --help -Dapp-runtime=glfw 2&>/dev/null zig build --help -Dapp-runtime=glfw 2&>/dev/null zig build --help -Dapp-runtime=glfw 2&>/dev/null zig build --help -Dapp-runtime=gtk } src_prepare() { default my_zbs_args=( -Doptimize=ReleaseFast -Dfont-backend=fontconfig_freetype -Drenderer=opengl -Dgtk-adwaita=$(usex adwaita true false) -Demit-docs=$(usex man true false) -f$(usex system-fontconfig sys no-sys)=fontconfig -f$(usex system-freetype sys no-sys)=freetype -f$(usex system-glslang sys no-sys)=glslang -f$(usex system-harfbuzz sys no-sys)=harfbuzz -f$(usex system-libpng sys no-sys)=libpng -f$(usex system-oniguruma sys no-sys)=oniguruma -f$(usex system-zlib sys no-sys)=zlib -f$(usex system-simdutf sys no-sys)=simdutf ) if use gtk; then my_zbs_args+=( -Dapp-runtime=gtk ) if use system-libxml2; then my_zbs_args+=( -Dsys=libxml2 ) fi elif use glfw; then my_zbs_args+=( -Dapp-runtime=glfw ) fi zig_src_configure } src_compile() { BUILD_DIR=${S} zig_src_compile } src_install() { zig_src_install # dosym -r /usr/share/terminfo/x/xterm-ghostty /usr/share/terminfo/g/ghostty rm ${DISTDIR}/usr/share/terminfo/g/ghostty }