Gentoo Archives: gentoo-commits

From: Ionen Wolkens <ionen@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: x11-terms/kitty/, x11-terms/kitty/files/
Date: Wed, 03 Nov 2021 06:41:30
Message-Id: 1635921411.0c349b95e730918fb9af59fffd8e09489b27faf2.ionen@gentoo
1 commit: 0c349b95e730918fb9af59fffd8e09489b27faf2
2 Author: Ionen Wolkens <ionen <AT> gentoo <DOT> org>
3 AuthorDate: Tue Oct 26 23:28:08 2021 +0000
4 Commit: Ionen Wolkens <ionen <AT> gentoo <DOT> org>
5 CommitDate: Wed Nov 3 06:36:51 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0c349b95
7
8 x11-terms/kitty: revamp ebuild
9
10 * EAPI-8
11 * enable py3.10
12 * make glfw-x11.so optional with IUSE=+X wrt bug #713702
13 * move most glfw dlopen() deps to DEPEND-only, they are not
14 essential at runtime for kitty save for libglvnd
15 * add wayland-scanner BDEPEND (if missing it silently skips
16 glfw-wayland.so despite USE=wayland)
17 * export PKGCONFIG_EXE to use right pkg-config
18 * disable LTO, same reason was already stripping -O3 (if wanted,
19 should be set by users in CFLAGS -- there is no custom LTO paths)
20 * use intended --ignore-compiler-warnings to disable -Werror and
21 simplify -flags.patch to hopefully need less rebasing
22 * replace -tests.patch used to find bin/kitty by setting PATH
23 * drop terminfo patch, let kitty install its own /usr/lib64/kitty
24 terminfo and only skip /usr/share/terminfo from kitty-terminfo
25 * pin kitty-terminfo to match, the >-r0 check will be removable next
26 version and is there to avoid collisions (pinning not always
27 /essential/, but on a same system they originate from the same
28 package and should match)
29 * add test dep on dev-python/pillow used by 1 test
30 * remove unnessary fix shebang (these don't have executable bits and
31 are used through kitty's linked libpython)
32 * make libcanberra an optfeature wrt bug #775266
33 * for imagemagick optfeature, don't use the virtual so it's not noisy
34 if users have *magick installed but not the virtual
35 * change HOMEPAGE to actual homepage, github is shown from remote-id
36
37 Closes: https://bugs.gentoo.org/713702
38 Closes: https://bugs.gentoo.org/775266
39 Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>
40
41 x11-terms/kitty/files/kitty-0.23.1-flags.patch | 17 ++++
42 x11-terms/kitty/kitty-0.23.1-r1.ebuild | 118 +++++++++++++++++++++++++
43 2 files changed, 135 insertions(+)
44
45 diff --git a/x11-terms/kitty/files/kitty-0.23.1-flags.patch b/x11-terms/kitty/files/kitty-0.23.1-flags.patch
46 new file mode 100644
47 index 00000000000..8f23393f8a0
48 --- /dev/null
49 +++ b/x11-terms/kitty/files/kitty-0.23.1-flags.patch
50 @@ -0,0 +1,17 @@
51 +--- a/setup.py
52 ++++ b/setup.py
53 +@@ -295,3 +295,3 @@
54 + fortify_source = '' if sanitize and is_macos else '-D_FORTIFY_SOURCE=2'
55 +- optimize = df if debug or sanitize else '-O3'
56 ++ optimize = ''
57 + sanitize_args = get_sanitize_args(cc, ccver) if sanitize else set()
58 +@@ -319,3 +319,3 @@
59 + 'OVERRIDE_LDFLAGS',
60 +- '-Wall ' + ' '.join(sanitize_args) + ('' if debug else ' -O3')
61 ++ '-Wall ' + ' '.join(sanitize_args)
62 + )
63 +@@ -807,4 +807,2 @@
64 + libs.append('-lprofiler')
65 +- else:
66 +- cflags.append('-O3')
67 + if bundle_type.endswith('-freeze'):
68
69 diff --git a/x11-terms/kitty/kitty-0.23.1-r1.ebuild b/x11-terms/kitty/kitty-0.23.1-r1.ebuild
70 new file mode 100644
71 index 00000000000..2a7084b9f1c
72 --- /dev/null
73 +++ b/x11-terms/kitty/kitty-0.23.1-r1.ebuild
74 @@ -0,0 +1,118 @@
75 +# Copyright 1999-2021 Gentoo Authors
76 +# Distributed under the terms of the GNU General Public License v2
77 +
78 +EAPI=8
79 +
80 +PYTHON_COMPAT=( python3_{8..10} )
81 +inherit optfeature python-single-r1 toolchain-funcs xdg
82 +
83 +if [[ ${PV} == 9999 ]] ; then
84 + inherit git-r3
85 + EGIT_REPO_URI="https://github.com/kovidgoyal/kitty.git"
86 +else
87 + SRC_URI="https://github.com/kovidgoyal/kitty/releases/download/v${PV}/${P}.tar.xz"
88 + KEYWORDS="~amd64 ~x86"
89 +fi
90 +
91 +DESCRIPTION="Fast, feature-rich, GPU-based terminal"
92 +HOMEPAGE="https://sw.kovidgoyal.net/kitty/"
93 +
94 +LICENSE="GPL-3"
95 +SLOT="0"
96 +IUSE="+X debug test wayland"
97 +REQUIRED_USE="
98 + || ( X wayland )
99 + ${PYTHON_REQUIRED_USE}"
100 +RESTRICT="!test? ( test )"
101 +
102 +RDEPEND="
103 + ${PYTHON_DEPS}
104 + media-libs/fontconfig
105 + media-libs/freetype:2
106 + media-libs/harfbuzz:=
107 + media-libs/lcms:2
108 + media-libs/libglvnd[X?]
109 + media-libs/libpng:=
110 + sys-apps/dbus
111 + sys-libs/zlib:=
112 + x11-libs/libxkbcommon[X?]
113 + x11-misc/xkeyboard-config
114 + ~x11-terms/kitty-terminfo-${PV}
115 + >x11-terms/kitty-terminfo-0.23.1-r0
116 + X? ( x11-libs/libX11 )
117 + wayland? ( dev-libs/wayland )"
118 +DEPEND="
119 + ${RDEPEND}
120 + X? (
121 + x11-base/xorg-proto
122 + x11-libs/libXcursor
123 + x11-libs/libXi
124 + x11-libs/libXinerama
125 + x11-libs/libXrandr
126 + )
127 + wayland? ( dev-libs/wayland-protocols )"
128 +BDEPEND="
129 + ${PYTHON_DEPS}
130 + sys-libs/ncurses
131 + virtual/pkgconfig
132 + test? ( $(python_gen_cond_dep 'dev-python/pillow[${PYTHON_USEDEP}]') )
133 + wayland? ( dev-util/wayland-scanner )"
134 +
135 +PATCHES=(
136 + "${FILESDIR}"/${PN}-0.23.1-flags.patch
137 +)
138 +
139 +src_prepare() {
140 + default
141 +
142 + sed "s/'x11 wayland'/'$(usev X x11) $(usev wayland)'/" -i setup.py || die
143 + sed "s/else linux_backends/else [$(usev X "'x11',")$(usev wayland "'wayland'")]/" \
144 + -i kitty_tests/check_build.py || die
145 + use X || sed "/glfw_path('x11')/s/x11/wayland/" -i kitty_tests/glfw.py || die
146 +
147 + # skip docs for live version
148 + [[ ${PV} != 9999 ]] || sed -i '/exists.*_build/,/docs(ddir)/d' setup.py || die
149 +}
150 +
151 +src_compile() {
152 + tc-export CC
153 + export PKGCONFIG_EXE=$(tc-getPKG_CONFIG)
154 +
155 + local setup=(
156 + ${EPYTHON} setup.py
157 + --disable-link-time-optimization
158 + --ignore-compiler-warnings
159 + --libdir-name=$(get_libdir)
160 + --update-check-interval=0
161 + --verbose
162 + $(usev debug --debug)
163 + linux-package
164 + )
165 +
166 + echo "${setup[*]}"
167 + "${setup[@]}" || die "setup.py failed to compile ${PN}"
168 +
169 + [[ ${PV} == 9999 ]] || mv linux-package/share/doc/{${PN},${PF}} || die
170 + rm -r linux-package/share/terminfo || die
171 +}
172 +
173 +src_test() {
174 + PATH=linux-package/bin:${PATH} KITTY_CONFIG_DIRECTORY=${T} \
175 + ${EPYTHON} test.py || die
176 +}
177 +
178 +src_install() {
179 + insinto /usr
180 + doins -r linux-package/.
181 +
182 + fperms +x /usr/bin/kitty
183 +}
184 +
185 +pkg_postinst() {
186 + xdg_icon_cache_update
187 +
188 + optfeature "displaying images in the terminal" \
189 + media-gfx/imagemagick media-gfx/graphicsmagick[imagemagick]
190 +
191 + optfeature "audio-based terminal bell support" media-libs/libcanberra
192 +}