Accepting request 970594 from home:susnux:branches:X11:terminals

Fixed build on Factory and Leap.

OBS-URL: https://build.opensuse.org/request/show/970594
OBS-URL: https://build.opensuse.org/package/show/X11:terminals/kitty?expand=0&rev=98
This commit is contained in:
Michael Vetter 2022-04-18 18:20:57 +00:00 committed by Git OBS Bridge
parent ad53d90dc7
commit 4c4669cefb
5 changed files with 135 additions and 54 deletions

27
fix-librsync-leap.patch Normal file
View File

@ -0,0 +1,27 @@
diff -Nur kitty-0.25.0/kittens/transfer/rsync.c new/kittens/transfer/rsync.c
--- kitty-0.25.0/kittens/transfer/rsync.c 2022-04-11 16:01:45.000000000 +0200
+++ new/kittens/transfer/rsync.c 2022-04-18 14:43:47.391998800 +0200
@@ -6,6 +6,7 @@
*/
#include "data-types.h"
+#include <stdio.h>
#include <librsync.h>
#define SIGNATURE_CAPSULE "rs_signature_t"
diff -Nur kitty-0.25.0/setup.py new/setup.py
--- kitty-0.25.0/setup.py 2022-04-18 14:44:34.223998795 +0200
+++ new/setup.py 2022-04-18 14:44:19.307998797 +0200
@@ -263,10 +263,11 @@
def detect_librsync(cc: List[str], cflags: List[str], ldflags: List[str]) -> str:
if not test_compile(
cc, *cflags, libraries=('rsync',), ldflags=ldflags, show_stderr=True,
- src='#include <librsync.h>\nint main(void) { rs_strerror(0); return 0; }'):
+ src='#include <stdio.h>\n#include <librsync.h>\nint main(void) { rs_strerror(0); return 0; }'):
raise SystemExit('The librsync library is required')
# check for rs_sig_args() which was added to librsync in Apr 2020 version 2.3.0
if test_compile(cc, *cflags, libraries=('rsync',), ldflags=ldflags, src='''
+#include <stdio.h>
#include <librsync.h>
int main(void) {
rs_magic_number magic_number = 0;

View File

@ -1,30 +0,0 @@
From 555b8f4232d7b1f35b83966d7a879f26f806059b Mon Sep 17 00:00:00 2001
From: Franck Bui <fbui@suse.com>
Date: Wed, 8 Dec 2021 14:26:36 +0100
Subject: [PATCH 1/1] Disable build of documentation
Leap doesn't ship a recent enough version of sphinx for building kitty
documentation.
---
setup.py | 5 -----
1 file changed, 5 deletions(-)
diff --git a/setup.py b/setup.py
index 98873dc6..00965423 100755
--- a/setup.py
+++ b/setup.py
@@ -944,11 +944,6 @@ def c(base_path: str, **kw: object) -> None:
def create_linux_bundle_gunk(ddir: str, libdir_name: str) -> None:
- if not os.path.exists('docs/_build/html'):
- make = "gmake" if is_freebsd else "make"
- run_tool([make, 'docs'])
- copy_man_pages(ddir)
- copy_html_docs(ddir)
for (icdir, ext) in {'256x256': 'png', 'scalable': 'svg'}.items():
icdir = os.path.join(ddir, 'share', 'icons', 'hicolor', icdir, 'apps')
safe_makedirs(icdir)
--
2.31.1

View File

@ -1,3 +1,14 @@
-------------------------------------------------------------------
Mon Apr 18 11:54:12 UTC 2022 - Ferdinand Thiessen <rpm@fthiessen.de>
- Fixed SPEC to build with Leap
- Replaced kitty-no-docs.patch with optional-disable-docs.patch
* Some Sphinx extensions needed by kitty are not available
in Factory
- Added fix-librsync-leap.patch
* Workaround for "error: unknown type name FILE" in old librsync
header still used by Leap 15.3 and 15.4.
-------------------------------------------------------------------
Tue Apr 12 07:28:36 UTC 2022 - Michael Vetter <mvetter@suse.com>

View File

@ -16,6 +16,8 @@
#
# sphinx_copybutton not in Factory
%bcond_with docs
Name: kitty
Version: 0.25.0
Release: 0
@ -24,7 +26,10 @@ License: GPL-3.0-only
Group: System/X11/Terminals
URL: https://github.com/kovidgoyal/kitty
Source: https://github.com/kovidgoyal/kitty/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Patch0: kitty-no-docs.patch
# PATCH-FIX-OPENSUSE optional-disable-docs.patch -- Optionally disable building documentation files
Patch0: optional-disable-docs.patch
# PATCH-FIX-OPENSUSE fix-librsync-leap.patch -- Fix for Leap, as librsync header is missing the stdio.h header for FILE*
Patch1: fix-librsync-leap.patch
BuildRequires: ImageMagick-devel
BuildRequires: Mesa-libGL-devel
BuildRequires: fdupes
@ -42,27 +47,29 @@ BuildRequires: librsync-devel
BuildRequires: libwayland-egl-devel
BuildRequires: libxkbcommon-devel
BuildRequires: libxkbcommon-x11-devel
%if 0%{?suse_version} >= 1550
BuildRequires: python3-importlib-resources
BuildRequires: python3-readthedocs-sphinx-ext
BuildRequires: python3-sphinx-inline-tabs
BuildRequires: python3-sphinxcontrib-copybutton
BuildRequires: python3-sphinxext-opengraph
# and needs furo, started in: home:jubalh/python-furo_sphinx_theme
%else # Leap
BuildRequires: python3-importlib_resources
%endif
# for 'tic'
BuildRequires: ncurses-devel
BuildRequires: pkgconfig
BuildRequires: python3-devel >= 3.5
BuildRequires: terminfo
BuildRequires: wayland-devel
BuildRequires: wayland-protocols-devel
BuildRequires: zlib-devel
BuildRequires: pkgconfig(dbus-1)
%if 0%{?sle_version} > 150100 || 0%{?suse_version} >= 1550
# Python requirements for Factory and Leap
%if 0%{?suse_version} > 1500
BuildRequires: python3-devel >= 3.7
BuildRequires: python3-sphinxext-opengraph
%else
# Leap still provides python3.6 kitty requires at least 3.7
BuildRequires: python39-devel
%endif
# Optional documentation requirements
%if %{with docs}
BuildRequires: python3-Sphinx >= 1.7
BuildRequires: python3-importlib-resources
BuildRequires: python3-readthedocs-sphinx-ext
BuildRequires: python3-sphinx-inline-tabs
BuildRequires: python3-sphinxcontrib-copybutton
%endif
%description
@ -72,31 +79,44 @@ true-color, OpenType ligatures, mouse protocol, focus tracking,
bracketed paste and so on, and which can be controlled by scripts.
%prep
%setup -q
%if 0%{?suse_version} < 1550
%patch0 -p1
%endif
%autosetup -p1
find . -type f -exec sed -i 's@#!%{_bindir}/env python3$@#!%{_bindir}/python3@' {} +
find . -type f -exec sed -i 's@#!%{_bindir}/env python$@#!%{_bindir}/python@' {} +
%if 0%{?suse_version} > 1500
find . -type f -exec sed -i 's@#!/usr/bin/env python3$@#!%{_bindir}/python3@' {} +
find . -type f -exec sed -i 's@#!/usr/bin/env python$@#!%{_bindir}/python@' {} +
%else
find . -type f -exec sed -i 's@#!/usr/bin/env python3$@#!%{_bindir}/python3.9@' {} +
find . -type f -exec sed -i 's@#!/usr/bin/env python$@#!%{_bindir}/python3.9@' {} +
%endif
%install
# yes they have a makefile, no they dont use it properly
# no they dont have a make install
# we used to have this in the build section but since rpm 4.16 buildroot is cleaned
python3 setup.py --verbose linux-package --prefix %{buildroot}%{_prefix}
%if 0%{?suse_version} > 1500
python3 \
%else
python3.9 -B \
%endif
setup.py --verbose \
%if !%{with docs}
--no-docs \
%endif
linux-package \
--prefix %{buildroot}%{_prefix} \
--libdir-name %{_lib}
%fdupes %{buildroot}%{_prefix}/lib
%fdupes %{buildroot}%{_libdir}/%{name}
%files
%license LICENSE
%doc CHANGELOG.rst README.asciidoc
%{_bindir}/%{name}
%{_prefix}/lib/%{name}
%{_datadir}/applications/%{name}.desktop
%{_libdir}/%{name}
%{_datadir}/applications/%{name}{,-open}.desktop
%{_datadir}/icons/hicolor/
%{_datadir}/terminfo/x/xterm-%{name}
%if 0%{?suse_version} >= 1550
%if %{with docs}
%{_mandir}/man1/%{name}.1%{?ext_man}
%{_datadir}/doc/%{name}
%{_mandir}/man5/kitty.conf.5%{?ext_man}

View File

@ -0,0 +1,53 @@
diff -Nur kitty-0.25.0/setup.py new/setup.py
--- kitty-0.25.0/setup.py 2022-04-11 16:01:45.000000000 +0200
+++ new/setup.py 2022-04-18 14:03:18.715999089 +0200
@@ -65,6 +65,7 @@
verbose: int = 0
sanitize: bool = False
prefix: str = './linux-package'
+ no_docs: bool = False
incremental: bool = True
profile: bool = False
libdir_name: str = 'lib'
@@ -949,12 +950,13 @@
c(base_path, ddir='', rx=exclude, force=True, optimize=optimize, quiet=1, workers=num_workers)
-def create_linux_bundle_gunk(ddir: str, libdir_name: str) -> None:
- if not os.path.exists('docs/_build/html'):
- make = 'gmake' if is_freebsd else 'make'
- run_tool([make, 'docs'])
- copy_man_pages(ddir)
- copy_html_docs(ddir)
+def create_linux_bundle_gunk(ddir: str, libdir_name: str, no_docs=False) -> None:
+ if not no_docs:
+ if not os.path.exists('docs/_build/html'):
+ make = 'gmake' if is_freebsd else 'make'
+ run_tool([make, 'docs'])
+ copy_man_pages(ddir)
+ copy_html_docs(ddir)
for (icdir, ext) in {'256x256': 'png', 'scalable': 'svg'}.items():
icdir = os.path.join(ddir, 'share', 'icons', 'hicolor', icdir, 'apps')
safe_makedirs(icdir)
@@ -1313,7 +1315,7 @@
path = os.path.join(root, f_)
os.chmod(path, 0o755 if f_.endswith('.so') or os.path.basename(f_) == 'askpass.py' else 0o644)
if not is_macos:
- create_linux_bundle_gunk(ddir, args.libdir_name)
+ create_linux_bundle_gunk(ddir, args.libdir_name, args.no_docs)
if bundle_type.startswith('macos-'):
create_macos_bundle_gunk(ddir)
@@ -1397,6 +1399,12 @@
help='Where to create the linux package'
)
p.add_argument(
+ '--no-docs',
+ default=Options.no_docs,
+ action='store_true',
+ help='Disable building documentation when creating the linux package'
+ )
+ p.add_argument(
'--full',
dest='incremental',
default=Options.incremental,