3 %bcond_with tests # build without tests
4 %bcond_with build_docs # build docs instead of pre-packaged files
5 %bcond_with vendor # create vendor tarba
8 # - docs build requires git checkout and (yet) missing sphinxext-opengraph package
10 Summary: Cross-platform, fast, feature full, GPU based terminal emulator
14 # BSD: docs/_templates/searchbox.html
16 License: GPLv3 and zlib and BSD
17 Source0: https://github.com/kovidgoyal/kitty/releases/download/v%{version}/%{name}-%{version}.tar.xz
18 # Source0-md5: 5b458f1e594f7b5668b0e728957c221d
19 # Add AppData manifest file
20 # * https://github.com/kovidgoyal/kitty/pull/2088
21 Source1: %{name}.metainfo.xml
25 Source4: %{name}-%{version}-vendor.tar.xz
26 # Source4-md5: c509736ee0f2073aa504124e6efa1be0
28 Patch0: num-workers.patch
29 URL: https://sw.kovidgoyal.net/kitty
30 BuildRequires: appstream-glib
31 BuildRequires: dbus-devel
32 BuildRequires: desktop-file-utils
33 BuildRequires: fontconfig-devel
36 BuildRequires: golang >= 1.20
37 BuildRequires: harfbuzz-devel >= 2.2
38 BuildRequires: lcms2-devel
39 BuildRequires: libcanberra-devel
40 BuildRequires: libglvnd-libGL-devel
41 BuildRequires: libpng-devel
42 BuildRequires: librsync-devel
43 BuildRequires: ncurses
44 BuildRequires: openssl-devel
45 BuildRequires: python3-devel >= 1:3.8
46 BuildRequires: python3dist(setuptools)
47 BuildRequires: rpm-build >= 4.6
48 BuildRequires: rpmbuild(macros) >= 2.023
49 BuildRequires: wayland-devel
50 BuildRequires: wayland-protocols
51 BuildRequires: xorg-lib-libXcursor-devel
52 BuildRequires: xorg-lib-libXi-devel
53 BuildRequires: xorg-lib-libXinerama-devel
54 BuildRequires: xorg-lib-libXrandr-devel
55 BuildRequires: xorg-lib-libxkbcommon-x11-devel
56 BuildRequires: zlib-devel
57 %if %{with build_docs}
58 BuildRequires: python3dist(sphinx)
59 BuildRequires: python3dist(sphinx-copybutton)
60 BuildRequires: python3dist(sphinx-inline-tabs)
61 #BuildRequires: python3dist(sphinxext-opengraph)
62 BuildRequires: sphinx-pdg
65 BuildRequires: /usr/bin/getent
66 BuildRequires: /usr/bin/ssh
68 Requires: hicolor-icon-theme
70 Suggests: %{name}-bash-integration
71 Suggests: %{name}-fish-integration
72 # Terminfo file has been split from the main program and is required for use
73 # without errors. It has been separated to support SSH into remote machines using
74 # kitty as per the maintainers suggestion. Install the terminfo file on the remote
76 Requires: %{name}-terminfo = %{version}-%{release}
77 # Very weak dependencies, these are required to enable all features of kitty's
78 # "kittens" functions install separately
79 Recommends: python3-pygments
81 ExclusiveArch: %go_arches
82 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
84 %define specflags -Wno-array-bounds
87 - Offloads rendering to the GPU for lower system load and buttery
88 smooth scrolling. Uses threaded rendering to minimize input latency.
89 - Supports all modern terminal features: graphics (images), unicode,
90 true-color, OpenType ligatures, mouse protocol, focus tracking,
91 bracketed paste and several new terminal protocol extensions.
92 - Supports tiling multiple terminal windows side by side in different
93 layouts without needing to use an extra program like tmux.
94 - Can be controlled from scripts or the shell prompt, even over SSH.
95 - Has a framework for Kittens, small terminal programs that can be
96 used to extend kitty's functionality. For example, they are used for
97 Unicode input, Hints and Side-by-side diff.
98 - Supports startup sessions which allow you to specify the window/tab
99 layout, working directories and programs to run on startup.
100 - Cross-platform: kitty works on Linux and macOS, but because it uses
101 only OpenGL for rendering, it should be trivial to port to other
103 - Allows you to open the scrollback buffer in a separate window using
104 arbitrary programs of your choice. This is useful for browsing the
105 history comfortably in a pager or editor.
106 - Has multiple copy/paste buffers, like vim.
108 %package bash-integration
109 Summary: Automatic Bash integration for Kitty Terminal
112 %description bash-integration
113 Cross-platform, fast, feature full, GPU based terminal emulator.
115 Bash integration for Kitty Terminal.
117 %package fish-integration
118 Summary: Automatic Fish integration for Kitty Terminal
121 %description fish-integration
122 Cross-platform, fast, feature full, GPU based terminal emulator.
124 Fish integration for Kitty Terminal.
127 Summary: The terminfo file for Kitty Terminal
131 %description terminfo
132 Cross-platform, fast, feature full, GPU based terminal emulator.
134 The terminfo file for Kitty Terminal.
137 Summary: Documentation for %{name}
140 This package contains the documentation for %{name}.
143 %autosetup -p1 %{?without_vendor:-a4}
147 tar -caf %{_sourcedir}/%{name}-%{version}-vendor.tar.xz vendor
151 # Changing sphinx theme to classic
152 sed "s/html_theme = 'furo'/html_theme = 'classic'/" -i docs/conf.py
155 %{__sed} -i -e '/sphinxext.opengraph/d' docs/conf.py
157 find -type f -name "*.py" | xargs sed -i \
158 -e 's|%{_bindir}/env python3|%{__python3}|g' \
159 -e 's|%{_bindir}/env python|%{__python3}|g' \
160 -e 's|%{_bindir}/env -S kitty|%{_bindir}/kitty|g' \
163 # non-executable-script
164 sed -e "s/f.endswith('\.so')/f.endswith('\.so') or f.endswith('\.py')/g" -i setup.py
166 # script-without-shebang '__init__.py'
167 find -type f -name "*.py*" | xargs chmod a-x
170 %if %{with build_docs}
171 %{__python3} setup.py build
172 %{__make} -C docs man html
176 rm -rf $RPM_BUILD_ROOT
179 export CXX="%{__cxx}"
180 export GOCACHE=%go_cachedir
182 # unset PWD for https://github.com/kovidgoyal/kitty/issues/6051
184 # NOTE: setup.py is not regular setuptools setup.py
185 %{__python3} setup.py linux-package \
186 --libdir-name=%{_lib} \
187 --prefix=$RPM_BUILD_ROOT%{_prefix} \
188 --update-check-interval=0 \
191 --shell-integration "disabled" \
194 install -Dp %{SOURCE1} $RPM_BUILD_ROOT%{_metainfodir}/%{name}.metainfo.xml
195 install -Dp %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/profile.d/%{name}.sh
196 install -Dp %{SOURCE3} $RPM_BUILD_ROOT%{fish_compdir}/%{name}.fish
198 sed 's|KITTY_INSTALLATION_DIR=.*|KITTY_INSTALLATION_DIR="%{_libdir}/%{name}"|' \
199 -i $RPM_BUILD_ROOT%{_sysconfdir}/profile.d/%{name}.sh
200 sed 's|set -l KITTY_INSTALLATION_DIR .*|set -l KITTY_INSTALLATION_DIR "%{_libdir}/%{name}"|' \
201 -i $RPM_BUILD_ROOT%{fish_compdir}/%{name}.fish
203 # script-without-shebang '__init__.py'
204 find $RPM_BUILD_ROOT -type f -name "*.py*" ! -name askpass.py | xargs chmod a-x
207 rm $RPM_BUILD_ROOT%{_docdir}/%{name}/html/.buildinfo \
208 $RPM_BUILD_ROOT%{_docdir}/%{name}/html/.nojekyll
211 # Some tests ignores PATH env...
212 install -d kitty/launcher
213 ln -s $RPM_BUILD_ROOT%{_bindir}/%{name} kitty/launcher
214 export PATH=$RPM_BUILD_ROOT%{_bindir}:$PATH
215 %{__python3} setup.py test \
216 --prefix=$RPM_BUILD_ROOT%{_prefix}
219 appstream-util validate-relax --nonet $RPM_BUILD_ROOT%{_metainfodir}/*.xml
220 desktop-file-validate $RPM_BUILD_ROOT%{_desktopdir}/*.desktop
223 rm -rf $RPM_BUILD_ROOT
226 %defattr(644,root,root,755)
228 %attr(755,root,root) %{_bindir}/kitten
229 %attr(755,root,root) %{_bindir}/kitty
230 %{_desktopdir}/kitty-open.desktop
231 %{_desktopdir}/kitty.desktop
232 %{_iconsdir}/hicolor/*/*/kitty.{png,svg}
233 %{_metainfodir}/kitty.metainfo.xml
234 %dir %{_libdir}/%{name}
235 %{_libdir}/%{name}/logo
236 %{_libdir}/%{name}/shell-integration
237 %{_libdir}/%{name}/terminfo
238 %{_mandir}/man1/kitty.1*
239 %{_mandir}/man5/kitty.conf.5*
241 # verbose files to specify attr for shared libs
242 %{_libdir}/%{name}/*.py
243 %{_libdir}/%{name}/__pycache__
244 %dir %{_libdir}/%{name}/kittens
245 %{_libdir}/%{name}/kittens/*.py
246 %{_libdir}/%{name}/kittens/__pycache__
247 %dir %{_libdir}/%{name}/kittens/choose
248 %{_libdir}/%{name}/kittens/choose/*.py
249 %{_libdir}/%{name}/kittens/choose/__pycache__
250 %dir %{_libdir}/%{name}/kittens/diff
251 %{_libdir}/%{name}/kittens/diff/*.py
252 %{_libdir}/%{name}/kittens/diff/__pycache__
253 %{_libdir}/%{name}/kittens/diff/options
254 %dir %{_libdir}/%{name}/kittens/transfer
255 %{_libdir}/%{name}/kittens/transfer/*.py
256 %{_libdir}/%{name}/kittens/transfer/__pycache__
257 %dir %{_libdir}/%{name}/kittens/unicode_input
258 %{_libdir}/%{name}/kittens/unicode_input/*.py
259 %{_libdir}/%{name}/kittens/unicode_input/__pycache__
260 %attr(755,root,root) %{_libdir}/%{name}/kittens/*/*.so
261 %{_libdir}/%{name}/kittens/ask
262 %{_libdir}/%{name}/kittens/broadcast
263 %{_libdir}/%{name}/kittens/clipboard
264 %{_libdir}/%{name}/kittens/hints
265 %{_libdir}/%{name}/kittens/hyperlinked_grep
266 %{_libdir}/%{name}/kittens/icat
267 %{_libdir}/%{name}/kittens/mouse_demo
268 %{_libdir}/%{name}/kittens/panel
269 %{_libdir}/%{name}/kittens/query_terminal
270 %{_libdir}/%{name}/kittens/remote_file
271 %{_libdir}/%{name}/kittens/resize_window
272 %{_libdir}/%{name}/kittens/show_error
273 %{_libdir}/%{name}/kittens/show_key
274 %{_libdir}/%{name}/kittens/ssh
275 %{_libdir}/%{name}/kittens/themes
276 %{_libdir}/%{name}/kittens/tui
278 %dir %{_libdir}/%{name}/kitty
279 %{_libdir}/%{name}/kitty/__pycache__
280 %{_libdir}/%{name}/kitty/*.py
281 %{_libdir}/%{name}/kitty/*.glsl
282 %{_libdir}/%{name}/kitty/conf
283 %{_libdir}/%{name}/kitty/fonts
284 %{_libdir}/%{name}/kitty/launcher
285 %{_libdir}/%{name}/kitty/layout
286 %{_libdir}/%{name}/kitty/options
287 %{_libdir}/%{name}/kitty/rc
288 %attr(755,root,root) %{_libdir}/%{name}/kitty/*.so
290 %files bash-integration
291 %defattr(644,root,root,755)
292 /etc/profile.d/kitty.sh
294 %files fish-integration
295 %defattr(644,root,root,755)
296 %{fish_compdir}/kitty.fish
299 %defattr(644,root,root,755)
301 %{_datadir}/terminfo/x/xterm-kitty
304 %defattr(644,root,root,755)
305 %doc CONTRIBUTING.md CHANGELOG.rst INSTALL.md LICENSE
306 %dir %{_docdir}/%{name}
307 %{_docdir}/%{name}/html