]> git.pld-linux.org Git - SPECS.git/blob - kitty.spec
SPECS updated Mon 29 Apr 22:05:02 CEST 2024
[SPECS.git] / kitty.spec
1 #
2 # Conditional build:
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
6
7 # NOTE:
8 # - docs build requires git checkout and (yet) missing sphinxext-opengraph package
9
10 Summary:        Cross-platform, fast, feature full, GPU based terminal emulator
11 Name:           kitty
12 Version:        0.28.0
13 Release:        1
14 # BSD:          docs/_templates/searchbox.html
15 # zlib:         glfw/
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
22 Source2:        %{name}.sh
23 Source3:        %{name}.fish
24 %if %{without vendor}
25 Source4:        %{name}-%{version}-vendor.tar.xz
26 # Source4-md5:  c509736ee0f2073aa504124e6efa1be0
27 %endif
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
34 BuildRequires:  gcc
35 BuildRequires:  gnupg2
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
63 %endif
64 %if %{with tests}
65 BuildRequires:  /usr/bin/getent
66 BuildRequires:  /usr/bin/ssh
67 %endif
68 Requires:       hicolor-icon-theme
69 Requires:       python3
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
75 # machine.
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
80 Suggests:       ImageMagick
81 ExclusiveArch:  %go_arches
82 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
83
84 %define specflags       -Wno-array-bounds
85
86 %description
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
102   Unix-like platforms.
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.
107
108 %package bash-integration
109 Summary:        Automatic Bash integration for Kitty Terminal
110 BuildArch:      noarch
111
112 %description bash-integration
113 Cross-platform, fast, feature full, GPU based terminal emulator.
114
115 Bash integration for Kitty Terminal.
116
117 %package fish-integration
118 Summary:        Automatic Fish integration for Kitty Terminal
119 BuildArch:      noarch
120
121 %description fish-integration
122 Cross-platform, fast, feature full, GPU based terminal emulator.
123
124 Fish integration for Kitty Terminal.
125
126 %package terminfo
127 Summary:        The terminfo file for Kitty Terminal
128 Requires:       ncurses
129 BuildArch:      noarch
130
131 %description    terminfo
132 Cross-platform, fast, feature full, GPU based terminal emulator.
133
134 The terminfo file for Kitty Terminal.
135
136 %package doc
137 Summary:        Documentation for %{name}
138
139 %description doc
140 This package contains the documentation for %{name}.
141
142 %prep
143 %autosetup -p1 %{?without_vendor:-a4}
144
145 %if %{with vendor}
146 go mod vendor
147 tar -caf %{_sourcedir}/%{name}-%{version}-vendor.tar.xz vendor
148 exit 1
149 %endif
150
151 # Changing sphinx theme to classic
152 sed "s/html_theme = 'furo'/html_theme = 'classic'/" -i docs/conf.py
153
154 # Missing in pld
155 %{__sed} -i -e '/sphinxext.opengraph/d' docs/conf.py
156
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' \
161         %{nil}
162
163 # non-executable-script
164 sed -e "s/f.endswith('\.so')/f.endswith('\.so') or f.endswith('\.py')/g" -i setup.py
165
166 # script-without-shebang '__init__.py'
167 find -type f -name "*.py*" | xargs chmod a-x
168
169 %build
170 %if %{with build_docs}
171 %{__python3} setup.py build
172 %{__make} -C docs man html
173 %endif
174
175 %install
176 rm -rf $RPM_BUILD_ROOT
177 %set_build_flags
178 export CC="%{__cc}"
179 export CXX="%{__cxx}"
180 export GOCACHE=%go_cachedir
181 export NUM_WORKERS=1
182 # unset PWD for https://github.com/kovidgoyal/kitty/issues/6051
183 unset PWD
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 \
189     --verbose \
190     --debug \
191     --shell-integration "disabled" \
192     %{nil}
193
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
197
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
202
203 # script-without-shebang '__init__.py'
204 find $RPM_BUILD_ROOT -type f -name "*.py*" ! -name askpass.py | xargs chmod a-x
205
206 # rpmlint fixes
207 rm $RPM_BUILD_ROOT%{_docdir}/%{name}/html/.buildinfo \
208         $RPM_BUILD_ROOT%{_docdir}/%{name}/html/.nojekyll
209
210 %if %{with tests}
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}
217 %endif
218
219 appstream-util validate-relax --nonet $RPM_BUILD_ROOT%{_metainfodir}/*.xml
220 desktop-file-validate $RPM_BUILD_ROOT%{_desktopdir}/*.desktop
221
222 %clean
223 rm -rf $RPM_BUILD_ROOT
224
225 %files
226 %defattr(644,root,root,755)
227 %doc LICENSE
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*
240
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
277
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
289
290 %files bash-integration
291 %defattr(644,root,root,755)
292 /etc/profile.d/kitty.sh
293
294 %files fish-integration
295 %defattr(644,root,root,755)
296 %{fish_compdir}/kitty.fish
297
298 %files terminfo
299 %defattr(644,root,root,755)
300 %doc LICENSE
301 %{_datadir}/terminfo/x/xterm-kitty
302
303 %files doc
304 %defattr(644,root,root,755)
305 %doc CONTRIBUTING.md CHANGELOG.rst INSTALL.md LICENSE
306 %dir %{_docdir}/%{name}
307 %{_docdir}/%{name}/html
This page took 0.448898 seconds and 3 git commands to generate.