jpokorny / rpms / kitty

Forked from rpms/kitty 3 years ago
Clone

Blame kitty.spec

91033f9
# Enable LTO
91033f9
%global optflags        %{optflags} -flto
91033f9
%global build_ldflags   %{build_ldflags} -flto
91033f9
91033f9
Name:           kitty
5f2daf8
Version:        0.16.0
99eb880
Release:        2%{?dist}
91033f9
Summary:        Cross-platform, fast, feature full, GPU based terminal emulator
91033f9
b90a9fa
# https://pagure.io/koji/issue/1679
b90a9fa
ExcludeArch:    s390x
b90a9fa
91033f9
# BSD:          docs/_templates/searchbox.html
66fa275
# zlib:         glfw/
91033f9
License:        GPLv3 and zlib and BSD
91033f9
URL:            https://sw.kovidgoyal.net/kitty
91033f9
Source0:        https://github.com/kovidgoyal/kitty/archive/v%{version}/%{name}-%{version}.tar.gz
91033f9
5f2daf8
# Add AppData manifest file
5f2daf8
# * https://github.com/kovidgoyal/kitty/pull/2088
91033f9
Source1:        https://raw.githubusercontent.com/kovidgoyal/kitty/46c0951751444e4f4994008f0d2dcb41e49389f4/kitty/data/%{name}.appdata.xml
91033f9
99eb880
Patch0:         kitty-0.16.0-gcc10.patch
99eb880
91033f9
BuildRequires:  desktop-file-utils
91033f9
BuildRequires:  gcc
91033f9
BuildRequires:  libappstream-glib
91033f9
BuildRequires:  python3-devel
91033f9
BuildRequires:  python3dist(setuptools)
91033f9
BuildRequires:  wayland-devel
91033f9
BuildRequires:  wayland-protocols-devel
91033f9
BuildRequires:  pkgconfig(dbus-1)
91033f9
BuildRequires:  pkgconfig(fontconfig)
91033f9
BuildRequires:  pkgconfig(gl)
91033f9
BuildRequires:  pkgconfig(harfbuzz)
91033f9
BuildRequires:  pkgconfig(libcanberra)
91033f9
BuildRequires:  pkgconfig(libpng)
91033f9
BuildRequires:  pkgconfig(xcursor)
91033f9
BuildRequires:  pkgconfig(xi)
91033f9
BuildRequires:  pkgconfig(xinerama)
91033f9
BuildRequires:  pkgconfig(xkbcommon-x11)
91033f9
BuildRequires:  pkgconfig(xrandr)
91033f9
BuildRequires:  pkgconfig(zlib)
91033f9
Requires:       python3%{?_isa}
91033f9
Requires:       hicolor-icon-theme
91033f9
5f2daf8
# Terminfo file has been split from the main program and is required for use
5f2daf8
# without errors. It has been separated to support SSH into remote machines using
5f2daf8
# kitty as per the maintainers suggestion. Install the terminfo file on the remote
5f2daf8
# machine.
91033f9
Requires:       %{name}-terminfo = %{version}-%{release}
91033f9
5f2daf8
# Very weak dependencies, these are required to enable all features of kitty's
5f2daf8
# "kittens" functions install separately
91033f9
Recommends:     python3-pygments
91033f9
Suggests:       ImageMagick%{?_isa}
91033f9
91033f9
%description
91033f9
- Offloads rendering to the GPU for lower system load and buttery smooth
91033f9
  scrolling. Uses threaded rendering to minimize input latency.
91033f9
91033f9
- Supports all modern terminal features: graphics (images), unicode, true-color,
91033f9
  OpenType ligatures, mouse protocol, focus tracking, bracketed paste and
91033f9
  several new terminal protocol extensions.
91033f9
91033f9
- Supports tiling multiple terminal windows side by side in different layouts
91033f9
  without needing to use an extra program like tmux.
91033f9
91033f9
- Can be controlled from scripts or the shell prompt, even over SSH.
91033f9
91033f9
- Has a framework for Kittens, small terminal programs that can be used to
91033f9
  extend kitty's functionality. For example, they are used for Unicode input,
91033f9
  Hints and Side-by-side diff.
91033f9
91033f9
- Supports startup sessions which allow you to specify the window/tab layout,
91033f9
  working directories and programs to run on startup.
91033f9
91033f9
- Cross-platform: kitty works on Linux and macOS, but because it uses only
91033f9
  OpenGL for rendering, it should be trivial to port to other Unix-like
91033f9
  platforms.
91033f9
91033f9
- Allows you to open the scrollback buffer in a separate window using arbitrary
91033f9
  programs of your choice. This is useful for browsing the history comfortably
91033f9
  in a pager or editor.
91033f9
91033f9
- Has multiple copy/paste buffers, like vim.
91033f9
91033f9
91033f9
%package        terminfo
91033f9
Summary:        The terminfo file for Kitty Terminal
91033f9
BuildArch:      noarch
91033f9
91033f9
Requires:       ncurses-base
91033f9
91033f9
%description    terminfo
91033f9
Cross-platform, fast, feature full, GPU based terminal emulator.
91033f9
91033f9
The terminfo file for Kitty Terminal.
91033f9
91033f9
91033f9
%package        doc
91033f9
Summary:        Documentation for %{name}
91033f9
91033f9
BuildRequires:  python3dist(sphinx)
91033f9
91033f9
%description    doc
91033f9
This package contains the documentation for %{name}.
91033f9
91033f9
91033f9
%prep
99eb880
%autosetup -p1
ec35ed4
91033f9
# Replace python shebangs to make them compatible with fedora
5f2daf8
find -type f -name "*.py" -exec sed -e 's|/usr/bin/env python3|%{__python3}|g'  \
5f2daf8
                                    -e 's|/usr/bin/env python|%{__python3}|g'   \
5f2daf8
                                    -i "{}" \;
91033f9
91033f9
# non-executable-script
91033f9
sed -e "s/f.endswith('\.so')/f.endswith('\.so') or f.endswith('\.py')/g" -i setup.py
91033f9
91033f9
# script-without-shebang '__init__.py'
3221c11
find -type f -name "*.py*" -exec chmod -x "{}"  \;
91033f9
e7dbb6b
# Disable native optimizations
66fa275
sed -i 's|native_optimizations=True|native_optimizations=False|' setup.py
e7dbb6b
91033f9
91033f9
%build
91033f9
%set_build_flags
ec35ed4
91033f9
# Project using custom build scripts :(
91033f9
%{__python3} setup.py build
91033f9
91033f9
91033f9
%install
ec35ed4
%{__python3} setup.py linux-package \
5f2daf8
    --libdir-name=%{_lib}           \
ec35ed4
    --prefix=%{buildroot}%{_prefix} \
5f2daf8
    --update-check-interval=0       \
ec35ed4
    --debug
91033f9
install -m 0644 -Dp %{SOURCE1} %{buildroot}%{_metainfodir}/%{name}.appdata.xml
91033f9
91033f9
# script-without-shebang '__init__.py'
3221c11
find %{buildroot} -type f -name "*.py*" -exec chmod -x "{}"  \;
91033f9
91033f9
# rpmlint fixes
66fa275
rm %{buildroot}%{_datadir}/doc/%{name}/html/.buildinfo \
66fa275
   %{buildroot}%{_datadir}/doc/%{name}/html/.nojekyll
91033f9
91033f9
91033f9
%check
91033f9
%{__python3} setup.py test --prefix=%{buildroot}%{_prefix}
91033f9
appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/*.appdata.xml
91033f9
desktop-file-validate %{buildroot}/%{_datadir}/applications/*.desktop
91033f9
91033f9
91033f9
%files
91033f9
%license LICENSE
91033f9
%{_bindir}/%{name}
91033f9
%{_datadir}/applications/*.desktop
91033f9
%{_datadir}/icons/hicolor/*/*/*.png
ec35ed4
%{_libdir}/%{name}/
91033f9
%{_mandir}/man1/*
91033f9
%{_metainfodir}/*.xml
91033f9
91033f9
%files terminfo
91033f9
%license LICENSE
91033f9
%{_datadir}/terminfo/x/xterm-%{name}
91033f9
91033f9
%files doc
91033f9
%license LICENSE
91033f9
%doc CONTRIBUTING.md CHANGELOG.rst INSTALL.md
91033f9
%{_datadir}/doc/%{name}/html
91033f9
%dir %{_datadir}/doc/%{name}
91033f9
91033f9
91033f9
%changelog
99eb880
* Thu Mar 05 2020 Than Ngo <than@redhat.com> - 0.16.0-2
99eb880
- Fixed #1792789 - kitty fails to build
99eb880
5f2daf8
* Tue Jan 28 2020 Artem Polishchuk <ego.cordatus@gmail.com> - 0.16.0-1
5f2daf8
- Update to 0.16.0
5f2daf8
66fa275
* Thu Jan 02 2020 Artem Polishchuk <ego.cordatus@gmail.com> - 0.15.1-1
66fa275
- Update to 0.15.1
66fa275
c5cb8bd
* Wed Nov 27 2019 Artem Polishchuk <ego.cordatus@gmail.com> - 0.15.0-1
c5cb8bd
- Update to 0.15.0
c5cb8bd
33f72ec
* Sun Oct 20 2019 Artem Polishchuk <ego.cordatus@gmail.com> - 0.14.6-12
91033f9
- Update to 0.14.6
91033f9
- Spec file fixes
91033f9
- Thanks to Vitaly Zaitsev <vitaly@easycoding.org>
91033f9
91033f9
* Fri Jul 12 2019 eskse <eskse@users.noreply.github.com> 0.14.2-1
91033f9
- Initial version of file