Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: x11-terms/kitty/files/, x11-terms/kitty/
Date: Tue, 01 Jun 2021 00:02:42
Message-Id: 1622505589.f11153fa749b505cf7feed51870fccea06325d79.sam@gentoo
1 commit: f11153fa749b505cf7feed51870fccea06325d79
2 Author: Pablo <pord <AT> tuta <DOT> io>
3 AuthorDate: Wed May 19 21:48:28 2021 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Mon May 31 23:59:49 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f11153fa
7
8 x11-terms/kitty: bump to 0.20.3
9
10 Signed-off-by: Pablo Orduna <pabloorduna98 <AT> gmail.com>
11 Signed-off-by: Sam James <sam <AT> gentoo.org>
12
13 x11-terms/kitty/Manifest | 1 +
14 x11-terms/kitty/files/kitty-0.20.3-flags.patch | 53 ++++++++++++
15 x11-terms/kitty/kitty-0.20.3.ebuild | 109 +++++++++++++++++++++++++
16 3 files changed, 163 insertions(+)
17
18 diff --git a/x11-terms/kitty/Manifest b/x11-terms/kitty/Manifest
19 index 68abc25bf93..8a8bf738a61 100644
20 --- a/x11-terms/kitty/Manifest
21 +++ b/x11-terms/kitty/Manifest
22 @@ -1,2 +1,3 @@
23 DIST kitty-0.19.3.tar.xz 3269628 BLAKE2B b3b673f8ad06baf770b03bcee87b2f405e1ff09d0fa5c6a232fd8df651351a428c8fbd9e2d0dc90ed44a0d6632192bea83650388ee73ebc3b523f51e51168006 SHA512 d1eea7f909c9492542650a83a149fd279c44380cf10387759f10caad57cd4dbabeac1ce84e8142bfa47266ec2562dfa3766ce08e2aee4d8e0ebacea165f101e4
24 DIST kitty-0.20.1.tar.xz 3449932 BLAKE2B aed9a250fbc7005cd67fd22bfc33de845bea7e39a5561e6957b744f03a5438945f9739ca7066a93889144a5d0289185f337ef4d487c754cba37f242030f1c46a SHA512 19dfa66eb2a2115877b25fbff0ba7a81071bff00c732236f20342aeb619cca88ae4a4e8ce4e73908ac7d7d12fca5232a76e0167754f2e658af02e442cf5ba0cd
25 +DIST kitty-0.20.3.tar.xz 3487500 BLAKE2B 49397ac2aef10e5fc41e351af65050ad510e58915392e6b1b8c022db31f2e5e81ac2cce645468ff213dafb609a30d43934b7388b93227fbbba5af7aa35be74e8 SHA512 9e9d81696bcb0d3894c04b08bc52ccf7aaf533125b3ecfb4c894b8d42dbf8511239c49f1c977d81872ce49fc6b3aa8e8c92b9c944bd31fe59fce6e3750295e58
26
27 diff --git a/x11-terms/kitty/files/kitty-0.20.3-flags.patch b/x11-terms/kitty/files/kitty-0.20.3-flags.patch
28 new file mode 100644
29 index 00000000000..131d6214b4c
30 --- /dev/null
31 +++ b/x11-terms/kitty/files/kitty-0.20.3-flags.patch
32 @@ -0,0 +1,53 @@
33 +diff --git a/setup.py b/setup.py
34 +index f751107f..69bf39d4 100755
35 +--- a/setup.py
36 ++++ b/setup.py
37 +@@ -293,7 +293,7 @@ def init_env(
38 + df += ' -Og'
39 + float_conversion = '-Wfloat-conversion'
40 + fortify_source = '' if sanitize and is_macos else '-D_FORTIFY_SOURCE=2'
41 +- optimize = df if debug or sanitize else '-O3'
42 ++ optimize = ''
43 + sanitize_args = get_sanitize_args(cc, ccver) if sanitize else set()
44 + cppflags_ = os.environ.get(
45 + 'OVERRIDE_CPPFLAGS', '-D{}DEBUG'.format('' if debug else 'N'),
46 +@@ -308,8 +308,8 @@ def init_env(
47 + cflags_ = os.environ.get(
48 + 'OVERRIDE_CFLAGS', (
49 + f'-Wextra {float_conversion} -Wno-missing-field-initializers -Wall -Wstrict-prototypes {std}'
50 +- f' -pedantic-errors {werror} {optimize} {sanitize_flag} -fwrapv {stack_protector} {missing_braces}'
51 +- f' -pipe {march} -fvisibility=hidden {fortify_source}'
52 ++ f' -pedantic-errors {optimize} {sanitize_flag} -fwrapv {stack_protector} {missing_braces}'
53 ++ f' {march} -fvisibility=hidden {fortify_source}'
54 + )
55 + )
56 + cflags = shlex.split(cflags_) + shlex.split(
57 +@@ -317,7 +317,7 @@ def init_env(
58 + )
59 + ldflags_ = os.environ.get(
60 + 'OVERRIDE_LDFLAGS',
61 +- '-Wall ' + ' '.join(sanitize_args) + ('' if debug else ' -O3')
62 ++ '-Wall ' + ' '.join(sanitize_args)
63 + )
64 + ldflags = shlex.split(ldflags_)
65 + ldflags.append('-shared')
66 +@@ -789,9 +789,7 @@ def safe_makedirs(path: str) -> None:
67 +
68 +
69 + def build_launcher(args: Options, launcher_dir: str = '.', bundle_type: str = 'source') -> None:
70 +- cflags = '-Wall -Werror -fpie'.split()
71 +- if args.build_universal_binary:
72 +- cflags += '-arch x86_64 -arch arm64'.split()
73 ++ cflags = '-Wall -fpie'.split()
74 + cppflags = []
75 + libs: List[str] = []
76 + if args.profile or args.sanitize:
77 +@@ -803,8 +801,6 @@ def build_launcher(args: Options, launcher_dir: str = '.', bundle_type: str = 's
78 + cflags.append('-g')
79 + if args.profile:
80 + libs.append('-lprofiler')
81 +- else:
82 +- cflags.append('-O3')
83 + if bundle_type.endswith('-freeze'):
84 + cppflags.append('-DFOR_BUNDLE')
85 + cppflags.append('-DPYVER="{}"'.format(sysconfig.get_python_version()))
86
87 diff --git a/x11-terms/kitty/kitty-0.20.3.ebuild b/x11-terms/kitty/kitty-0.20.3.ebuild
88 new file mode 100644
89 index 00000000000..35273c44a07
90 --- /dev/null
91 +++ b/x11-terms/kitty/kitty-0.20.3.ebuild
92 @@ -0,0 +1,109 @@
93 +# Copyright 1999-2021 Gentoo Authors
94 +# Distributed under the terms of the GNU General Public License v2
95 +
96 +EAPI=7
97 +
98 +PYTHON_COMPAT=( python3_{7,8,9} )
99 +
100 +inherit optfeature python-single-r1 toolchain-funcs xdg
101 +
102 +if [[ ${PV} == "9999" ]] ; then
103 + EGIT_REPO_URI="https://github.com/kovidgoyal/kitty.git"
104 + inherit git-r3
105 +else
106 + SRC_URI="https://github.com/kovidgoyal/kitty/releases/download/v${PV}/${P}.tar.xz"
107 + KEYWORDS="~amd64 ~x86"
108 +fi
109 +
110 +DESCRIPTION="A modern, hackable, featureful, OpenGL-based terminal emulator"
111 +HOMEPAGE="https://github.com/kovidgoyal/kitty"
112 +
113 +LICENSE="GPL-3"
114 +SLOT="0"
115 +IUSE="debug wayland"
116 +REQUIRED_USE="${PYTHON_REQUIRED_USE}"
117 +
118 +RDEPEND="
119 + ${PYTHON_DEPS}
120 + media-libs/fontconfig
121 + media-libs/freetype:2
122 + >=media-libs/harfbuzz-1.5.0:=
123 + media-libs/lcms
124 + media-libs/libcanberra
125 + media-libs/libpng:0=
126 + sys-apps/dbus
127 + sys-libs/zlib
128 + x11-libs/libxcb[xkb]
129 + x11-libs/libXcursor
130 + x11-libs/libXi
131 + x11-libs/libXinerama
132 + x11-libs/libxkbcommon[X]
133 + x11-libs/libXrandr
134 + x11-terms/kitty-terminfo
135 + wayland? (
136 + dev-libs/wayland
137 + >=dev-libs/wayland-protocols-1.17
138 + )
139 +"
140 +
141 +DEPEND="${RDEPEND}
142 + media-libs/mesa[X]
143 + sys-libs/ncurses
144 +"
145 +
146 +BDEPEND="virtual/pkgconfig"
147 +
148 +[[ ${PV} == *9999 ]] && BDEPEND+=" >=dev-python/sphinx-1.7"
149 +
150 +PATCHES=(
151 + "${FILESDIR}"/${PN}-0.20.3-flags.patch
152 + "${FILESDIR}"/${PN}-0.14.4-svg-icon.patch
153 + "${FILESDIR}"/${PN}-0.20.1-remove-terminfo.patch
154 + "${FILESDIR}"/${PN}-0.20.1-tests.patch
155 +)
156 +
157 +src_prepare() {
158 + default
159 +
160 + # disable wayland as required
161 + if ! use wayland; then
162 + sed -i "/'x11 wayland'/s/ wayland//" setup.py || die
163 + # also disable wayland tests
164 + sed -i "/if not self.is_ci/d" kitty_tests/check_build.py || die
165 + sed -i "/linux_backends.append('wayland')/d" kitty_tests/check_build.py || die
166 + fi
167 +
168 + # respect doc dir
169 + sed -i "/htmldir =/s/appname/'${PF}'/" setup.py || die
170 +
171 + tc-export CC
172 +}
173 +
174 +src_compile() {
175 + "${EPYTHON}" setup.py \
176 + --verbose $(usex debug --debug "") \
177 + --libdir-name $(get_libdir) \
178 + --update-check-interval=0 \
179 + linux-package || die "Failed to compile kitty."
180 +}
181 +
182 +src_test() {
183 + export KITTY_CONFIG_DIRECTORY=${T}
184 + "${EPYTHON}" test.py || die
185 +}
186 +
187 +src_install() {
188 + insinto /usr
189 + doins -r linux-package/*
190 + dobin linux-package/bin/kitty
191 + python_fix_shebang "${ED}"
192 +}
193 +
194 +pkg_postinst() {
195 + xdg_icon_cache_update
196 + optfeature "Displaying images in the terminal" virtual/imagemagick-tools
197 +}
198 +
199 +pkg_postrm() {
200 + xdg_icon_cache_update
201 +}