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/
Date: Tue, 31 Jan 2023 13:46:30
Message-Id: 1675172686.2baf08ebb67f124cc965e4b63f6870825f5b7ef3.ionen@gentoo
1 commit: 2baf08ebb67f124cc965e4b63f6870825f5b7ef3
2 Author: Ionen Wolkens <ionen <AT> gentoo <DOT> org>
3 AuthorDate: Tue Jan 31 12:46:09 2023 +0000
4 Commit: Ionen Wolkens <ionen <AT> gentoo <DOT> org>
5 CommitDate: Tue Jan 31 13:44:46 2023 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2baf08eb
7
8 x11-terms/kitty: add 0.27.0
9
10 As noted previously in live, adds Go requirement for /usr/bin/kitten.
11
12 Drop ImageMagick optfeature, kitty now has its own methods for common
13 image format using Go and ImageMagick is only a fallback.
14
15 Move test deletions behind `use test` so that the live ebuild won't
16 fail over this with USE=-test if something is moved around (e.g. the
17 typo'ed tpmfile -> tmpfile).
18
19 Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>
20
21 x11-terms/kitty/Manifest | 3 +
22 x11-terms/kitty/kitty-0.27.0.ebuild | 156 ++++++++++++++++++++++++++++++++++++
23 2 files changed, 159 insertions(+)
24
25 diff --git a/x11-terms/kitty/Manifest b/x11-terms/kitty/Manifest
26 index 12d34a7c8440..e8b07330c97a 100644
27 --- a/x11-terms/kitty/Manifest
28 +++ b/x11-terms/kitty/Manifest
29 @@ -1,2 +1,5 @@
30 DIST kitty-0.26.5.tar.xz 4749988 BLAKE2B 488969b4d7c6aed489a540a8e3bee183345fcfb7e05ae5604f4af40f0720ed931cff82cf389e2fa4015eed74762c0630481a99eeb9302c22c89c4f3e247170d4 SHA512 086ae03d0e382afbe3001e357ef51388c7a8e81fa5b4bf9ce8b123a7fc8bfff3bd68d074e926f540a1f2b83062baa831e44d29c017cabfe8221bebe49b64e808
31 DIST kitty-0.26.5.tar.xz.sig 566 BLAKE2B 377202d46e66854e0cf1998506e0fafca54b33d85264e47c13aa4b98d272c786809375f1e277ec169291e06809f11b5b061ec1243a708711fa2350243ad1eca2 SHA512 0c691d8becff2b0f24e09b941d7315efaac831beacfed6f66b9186bde9c502f2ae86289f4b0d8fa6a34624dce7a1e958ba2d0502fd87003ba08b07fa07c6ae17
32 +DIST kitty-0.27.0-vendor.tar.xz 696348 BLAKE2B cc20c2dec531907d50f796d2ee61e1468b66f02a37b1228cc1e0e3ef405342fcb8c027d96bb161d7b205384e179f1de1f45f5e39caafe8282a1811fdde905d5e SHA512 37dfac07238aac007938734fa8d7a3dd3cde3f064d5ab544f21230ad1feb733c4a39fa61a871275848f6dbfeeb66671b2a893e7f7b6a69f13e2fec16f348b77c
33 +DIST kitty-0.27.0.tar.xz 5067860 BLAKE2B 5c9126dd9e76afcd6d53aa025adc36912145129b16b0db60c9cb12736df895166d417cbce9198e1feddd3f07c216e557136a130853fa0ddd91833c67fe236c4e SHA512 8063008df261747a7089c69ad9ae3a3d3c24286014f02d04faee9f0b5b6f452172cf99ff8a520ca8e314ba0009e0009701292656db913c23d84b6a2311085813
34 +DIST kitty-0.27.0.tar.xz.sig 566 BLAKE2B d2b39e05e56e10eb3856a4aec105acfa1c3bd289eddab7ff9047e6a9743cf142c5b9b6aa85aa6196e7d6be7a168b475b96e2586ef57f66e29045744ca81c9fa7 SHA512 3f4a70659a17440d0d08d2f909b3279c5043adc981e075d9648892bfa2b7d617bfd520fac8571cd692833082e03b1d9997f9aaa75187318168dfbe6922ec389d
35
36 diff --git a/x11-terms/kitty/kitty-0.27.0.ebuild b/x11-terms/kitty/kitty-0.27.0.ebuild
37 new file mode 100644
38 index 000000000000..9d20478938f2
39 --- /dev/null
40 +++ b/x11-terms/kitty/kitty-0.27.0.ebuild
41 @@ -0,0 +1,156 @@
42 +# Copyright 1999-2023 Gentoo Authors
43 +# Distributed under the terms of the GNU General Public License v2
44 +
45 +EAPI=8
46 +
47 +PYTHON_COMPAT=( python3_{9..11} )
48 +inherit edo optfeature multiprocessing python-single-r1 toolchain-funcs xdg
49 +
50 +if [[ ${PV} == 9999 ]]; then
51 + inherit git-r3
52 + EGIT_REPO_URI="https://github.com/kovidgoyal/kitty.git"
53 +else
54 + inherit verify-sig
55 + SRC_URI="
56 + https://github.com/kovidgoyal/kitty/releases/download/v${PV}/${P}.tar.xz
57 + https://dev.gentoo.org/~ionen/distfiles/${P}-vendor.tar.xz
58 + verify-sig? ( https://github.com/kovidgoyal/kitty/releases/download/v${PV}/${P}.tar.xz.sig )"
59 + VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}/usr/share/openpgp-keys/kovidgoyal.gpg"
60 + KEYWORDS="~amd64 ~ppc64 ~riscv ~x86"
61 +fi
62 +
63 +DESCRIPTION="Fast, feature-rich, GPU-based terminal"
64 +HOMEPAGE="https://sw.kovidgoyal.net/kitty/"
65 +
66 +LICENSE="GPL-3 ZLIB"
67 +LICENSE+=" Apache-2.0 BSD MIT" # go
68 +SLOT="0"
69 +IUSE="+X test wayland"
70 +REQUIRED_USE="
71 + ${PYTHON_REQUIRED_USE}
72 + || ( X wayland )
73 + test? ( X wayland )"
74 +RESTRICT="!test? ( test )"
75 +
76 +# dlopen: fontconfig,libglvnd
77 +RDEPEND="
78 + ${PYTHON_DEPS}
79 + dev-libs/openssl:=
80 + media-libs/fontconfig
81 + media-libs/harfbuzz:=
82 + media-libs/lcms:2
83 + media-libs/libglvnd[X?]
84 + media-libs/libpng:=
85 + net-libs/librsync:=
86 + sys-apps/dbus
87 + sys-libs/zlib:=
88 + x11-libs/libxkbcommon[X?]
89 + x11-misc/xkeyboard-config
90 + ~x11-terms/kitty-shell-integration-${PV}
91 + ~x11-terms/kitty-terminfo-${PV}
92 + X? ( x11-libs/libX11 )
93 + wayland? ( dev-libs/wayland )"
94 +DEPEND="
95 + ${RDEPEND}
96 + X? (
97 + x11-base/xorg-proto
98 + x11-libs/libXcursor
99 + x11-libs/libXi
100 + x11-libs/libXinerama
101 + x11-libs/libXrandr
102 + )
103 + wayland? ( dev-libs/wayland-protocols )"
104 +BDEPEND="
105 + ${PYTHON_DEPS}
106 + >=dev-lang/go-1.19
107 + sys-libs/ncurses
108 + virtual/pkgconfig
109 + test? ( $(python_gen_cond_dep 'dev-python/pillow[${PYTHON_USEDEP}]') )
110 + wayland? ( dev-util/wayland-scanner )"
111 +[[ ${PV} == 9999 ]] || BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-kovidgoyal )"
112 +
113 +QA_FLAGS_IGNORED="usr/bin/kitten" # written in Go
114 +
115 +src_unpack() {
116 + if [[ ${PV} == 9999 ]]; then
117 + git-r3_src_unpack
118 + cd "${S}" || die
119 + edo go mod vendor
120 + else
121 + use verify-sig &&
122 + verify-sig_verify_detached "${DISTDIR}"/${P}.tar.xz{,.sig}
123 + default
124 + fi
125 +}
126 +
127 +src_prepare() {
128 + default
129 +
130 + # sed unfortunately feels easier on maintenance than patches here
131 + local sedargs=(
132 + -e "/num_workers =/s/=.*/= $(makeopts_jobs)/"
133 + -e "s/cflags.append.*-O3.*/pass/" -e 's/-O3//'
134 + -e "s/ld_flags.append('-[sw]')/pass/"
135 + )
136 +
137 + # kitty is often popular on wayland-only setups, try to allow this
138 + use !X && sedargs+=( -e '/gl_libs =/s/=.*/= []/' ) #857918
139 + use !X || use !wayland &&
140 + sedargs+=( -e "s/'x11 wayland'/'$(usex X x11 wayland)'/" )
141 +
142 + # skip docs for live version, missing dependencies
143 + [[ ${PV} == 9999 ]] && sedargs+=( -e '/exists.*_build/,/docs(ddir)/d' )
144 +
145 + sed -i setup.py "${sedargs[@]}" || die
146 +
147 + local skiptests=(
148 + # relies on 'who' command which doesn't detect users with pid-sandbox
149 + kitty_tests/utmp.py
150 + # may fail/hang depending on environment and shell initialization
151 + kitty_tests/{shell_integration,ssh}.py
152 + # relies on /proc/self/fd and gets confused when ran from here
153 + tools/utils/tpmfile_test.go
154 + )
155 + use !test || rm "${skiptests[@]}" || die
156 +}
157 +
158 +src_compile() {
159 + tc-export CC
160 + local -x GOFLAGS="-buildmode=pie -v -x"
161 + local -x PKGCONFIG_EXE=$(tc-getPKG_CONFIG)
162 +
163 + local conf=(
164 + --disable-link-time-optimization
165 + --ignore-compiler-warnings
166 + --libdir-name=$(get_libdir)
167 + --shell-integration="enabled no-rc"
168 + --update-check-interval=0
169 + --verbose
170 + )
171 +
172 + edo "${EPYTHON}" setup.py linux-package "${conf[@]}"
173 + use test && edo "${EPYTHON}" setup.py build-launcher "${conf[@]}"
174 +
175 + [[ ${PV} == 9999 ]] || mv linux-package/share/doc/{${PN},${PF}} || die
176 + rm -r linux-package/share/terminfo || die
177 +}
178 +
179 +src_test() {
180 + KITTY_CONFIG_DIRECTORY=${T} ./test.py || die # shebang is kitty
181 +}
182 +
183 +src_install() {
184 + insinto /usr
185 + doins -r linux-package/.
186 +
187 + local execbit
188 + mapfile -t execbit < <(find linux-package -type f -perm /+x -printf '/usr/%P\n' || die)
189 + fperms +x "${execbit[@]}"
190 +}
191 +
192 +pkg_postinst() {
193 + xdg_pkg_postinst
194 +
195 + optfeature "audio-based terminal bell support" media-libs/libcanberra
196 + optfeature "opening links from the terminal" x11-misc/xdg-utils
197 +}