%global forgeurl https://github.com/kovidgoyal/kitty %bcond bundled 1 %global gomodulesmode GO111MODULE=on %global goipath kitty Name: kitty Version: 0.46.2 Release: 1%{?dist} Summary: Cross-platform, fast, feature full, GPU based terminal emulator # GPL-3.0-only: kitty # Zlib: glfw # LGPL-2.1-or-later: kitty/iqsort.h # MIT: docs/_static/custom.css, shell-integration/ssh/bootstrap-utils.sh # MIT AND CC0-1.0: simde # CC0-1.0: c-ringbuf # BSD-2-Clause: base64simd # MIT: NerdFontsSymbolsOnly License: GPL-3.0-only AND LGPL-2.1-or-later AND Zlib AND (MIT AND CC0-1.0) AND BSD-2-Clause AND CC0-1.0 URL: https://github.com/kovidgoyal/kitty Source0: https://github.com/kovidgoyal/kitty/releases/download/v%{version}/%{name}-%{version}.tar.xz # Add AppData manifest file # * https://github.com/kovidgoyal/kitty/pull/2088 Source1: https://raw.githubusercontent.com/kovidgoyal/kitty/46c0951751444e4f4994008f0d2dcb41e49389f4/kitty/data/%{name}.appdata.xml Source2: https://github.com/ryanoasis/nerd-fonts/releases/latest/download/NerdFontsSymbolsOnly.tar.xz # Go vendor tarball (created during SRPM build for offline compilation) Source3: vendor-%{version}.tar.gz # https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval ExcludeArch: %{ix86} BuildRequires: golang >= 1.22.0 BuildRequires: go-rpm-macros BuildRequires: git-core BuildRequires: desktop-file-utils BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: python3-devel BuildRequires: lcms2-devel BuildRequires: libappstream-glib BuildRequires: ncurses BuildRequires: wayland-devel BuildRequires: simde-static BuildRequires: pkgconfig(dbus-1) BuildRequires: pkgconfig(fontconfig) BuildRequires: pkgconfig(gl) BuildRequires: pkgconfig(harfbuzz) BuildRequires: pkgconfig(libcanberra) BuildRequires: pkgconfig(libpng) BuildRequires: pkgconfig(wayland-protocols) BuildRequires: pkgconfig(xcursor) BuildRequires: pkgconfig(xi) BuildRequires: pkgconfig(xinerama) BuildRequires: pkgconfig(xkbcommon-x11) BuildRequires: pkgconfig(xrandr) BuildRequires: pkgconfig(zlib) BuildRequires: pkgconfig(libcrypto) BuildRequires: pkgconfig(libxxhash) Requires: python3%{?_isa} Requires: hicolor-icon-theme Obsoletes: %{name}-bash-integration < 0.28.1-3 Obsoletes: %{name}-fish-integration < 0.28.1-3 Provides: %{name}-bash-integration = %{version}-%{release} Provides: %{name}-fish-integration = %{version}-%{release} # Terminfo file has been split from the main program and is required for use # without errors. It has been separated to support SSH into remote machines using # kitty as per the maintainers suggestion. Install the terminfo file on the remote # machine. Requires: %{name}-terminfo = %{version}-%{release} Requires: %{name}-shell-integration = %{version}-%{release} Requires: %{name}-kitten%{?_isa} = %{version}-%{release} # For the "Hyperlinked grep" feature Recommends: ripgrep # Very weak dependencies, these are required to enable all features of kitty's # "kittens" functions install separately Suggests: ImageMagick%{?_isa} Provides: bundled(font(SymbolsNFM)) Provides: bundled(Verstable) = 2.1.1 # modified version of https://github.com/dhess/c-ringbuf Provides: bundled(c-ringbuf) # heavily modified Provides: bundled(glfw) # https://github.com/aklomp/base64 Provides: bundled(base64simd) %description Cross-platform, fast, feature full, GPU based terminal emulator. Offloads rendering to the GPU for lower system load and buttery smooth scrolling. Uses threaded rendering to minimize input latency. Supports all modern terminal features: graphics (images), unicode, true-color, OpenType ligatures, mouse protocol, focus tracking, bracketed paste and several new terminal protocol extensions. # terminfo subpackage %package terminfo Summary: The terminfo file for Kitty Terminal License: GPL-3.0-only BuildArch: noarch Requires: ncurses-base %description terminfo Cross-platform, fast, feature full, GPU based terminal emulator. The terminfo file for Kitty Terminal. # shell-integration subpackage %package shell-integration Summary: Shell integration scripts for %{name} License: GPL-3.0-only AND MIT BuildArch: noarch Recommends: %{name}-kitten %description shell-integration %{summary}. # kitten subpackage %package kitten Summary: The kitten executable License: GPL-3.0-only AND MIT AND BSD-3-Clause AND BSD-2-Clause AND Apache-2.0 AND MPL-2.0 AND (BSD-2-Clause AND BSD-3-Clause) %description kitten %{summary}. %prep %autosetup %{?with_bundled:-a3} mkdir fonts tar -xf %{SOURCE2} -C fonts # Replace python shebangs to make them compatible with fedora find -type f -name "*.py" -exec sed -e 's|/usr/bin/env python3|%{python3}|g' \ -e 's|/usr/bin/env python|%{python3}|g' \ -e 's|/usr/bin/env -S kitty|/usr/bin/kitty|g' \ -i "{}" \; mkdir src ln -s ../ src/kitty %build %set_build_flags %{python3} setup.py linux-package \ --libdir-name=%{_lib} \ --update-check-interval=0 \ --skip-building-kitten \ --verbose \ --ignore-compiler-warnings unset LDFLAGS mkdir -p _build/bin export %{gomodulesmode} %gobuild -o _build/bin/kitten ./tools/cmd %install # rpmlint fixes find linux-package -type f ! -executable -name "*.py" -exec sed -i '1{\@^#!%{python3}@d}' "{}" \; find linux-package/%{_lib}/%{name}/shell-integration -type f ! -executable -exec sed -r -i '1{\@^#!/bin/(fish|zsh|sh|bash)@d}' "{}" \; cp -r linux-package %{buildroot}%{_prefix} install -m0755 -Dp _build/bin/kitten %{buildroot}%{_bindir}/kitten install -m0644 -Dp %{SOURCE1} %{buildroot}%{_metainfodir}/%{name}.appdata.xml # Remove doc html directory (we don't build the doc subpackage) rm -rf %{buildroot}%{_datadir}/doc/%{name} %check desktop-file-validate %{buildroot}/%{_datadir}/applications/*.desktop appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/*.xml %files %license LICENSE %{_bindir}/%{name} %{_datadir}/applications/*.desktop %{_datadir}/icons/hicolor/*/*/*.{png,svg} %{_libdir}/%{name}/ %exclude %{_libdir}/%{name}/shell-integration %{_mandir}/man{1,5}/*.{1,5}* %{_metainfodir}/*.xml %files kitten %if %{with bundled} # Go bundled provides generator %license vendor/modules.txt %endif %license LICENSE %{_bindir}/kitten %files terminfo %license LICENSE %{_datadir}/terminfo/x/xterm-%{name} %files shell-integration %license LICENSE %{_libdir}/%{name}/shell-integration/ %changelog %autochangelog