public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Ionen Wolkens" <ionen@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: x11-terms/kitty/, x11-terms/kitty/files/
Date: Wed,  3 Nov 2021 06:41:22 +0000 (UTC)	[thread overview]
Message-ID: <1635921411.0c349b95e730918fb9af59fffd8e09489b27faf2.ionen@gentoo> (raw)

commit:     0c349b95e730918fb9af59fffd8e09489b27faf2
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Tue Oct 26 23:28:08 2021 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Wed Nov  3 06:36:51 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0c349b95

x11-terms/kitty: revamp ebuild

* EAPI-8
* enable py3.10
* make glfw-x11.so optional with IUSE=+X wrt bug #713702
* move most glfw dlopen() deps to DEPEND-only, they are not
  essential at runtime for kitty save for libglvnd
* add wayland-scanner BDEPEND (if missing it silently skips
  glfw-wayland.so despite USE=wayland)
* export PKGCONFIG_EXE to use right pkg-config
* disable LTO, same reason was already stripping -O3 (if wanted,
  should be set by users in CFLAGS -- there is no custom LTO paths)
* use intended --ignore-compiler-warnings to disable -Werror and
  simplify -flags.patch to hopefully need less rebasing
* replace -tests.patch used to find bin/kitty by setting PATH
* drop terminfo patch, let kitty install its own /usr/lib64/kitty
  terminfo and only skip /usr/share/terminfo from kitty-terminfo
* pin kitty-terminfo to match, the >-r0 check will be removable next
  version and is there to avoid collisions (pinning not always
  /essential/, but on a same system they originate from the same
  package and should match)
* add test dep on dev-python/pillow used by 1 test
* remove unnessary fix shebang (these don't have executable bits and
  are used through kitty's linked libpython)
* make libcanberra an optfeature wrt bug #775266
* for imagemagick optfeature, don't use the virtual so it's not noisy
  if users have *magick installed but not the virtual
* change HOMEPAGE to actual homepage, github is shown from remote-id

Closes: https://bugs.gentoo.org/713702
Closes: https://bugs.gentoo.org/775266
Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 x11-terms/kitty/files/kitty-0.23.1-flags.patch |  17 ++++
 x11-terms/kitty/kitty-0.23.1-r1.ebuild         | 118 +++++++++++++++++++++++++
 2 files changed, 135 insertions(+)

diff --git a/x11-terms/kitty/files/kitty-0.23.1-flags.patch b/x11-terms/kitty/files/kitty-0.23.1-flags.patch
new file mode 100644
index 00000000000..8f23393f8a0
--- /dev/null
+++ b/x11-terms/kitty/files/kitty-0.23.1-flags.patch
@@ -0,0 +1,17 @@
+--- a/setup.py
++++ b/setup.py
+@@ -295,3 +295,3 @@
+     fortify_source = '' if sanitize and is_macos else '-D_FORTIFY_SOURCE=2'
+-    optimize = df if debug or sanitize else '-O3'
++    optimize = ''
+     sanitize_args = get_sanitize_args(cc, ccver) if sanitize else set()
+@@ -319,3 +319,3 @@
+         'OVERRIDE_LDFLAGS',
+-        '-Wall ' + ' '.join(sanitize_args) + ('' if debug else ' -O3')
++        '-Wall ' + ' '.join(sanitize_args)
+     )
+@@ -807,4 +807,2 @@
+             libs.append('-lprofiler')
+-    else:
+-        cflags.append('-O3')
+     if bundle_type.endswith('-freeze'):

diff --git a/x11-terms/kitty/kitty-0.23.1-r1.ebuild b/x11-terms/kitty/kitty-0.23.1-r1.ebuild
new file mode 100644
index 00000000000..2a7084b9f1c
--- /dev/null
+++ b/x11-terms/kitty/kitty-0.23.1-r1.ebuild
@@ -0,0 +1,118 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{8..10} )
+inherit optfeature python-single-r1 toolchain-funcs xdg
+
+if [[ ${PV} == 9999 ]] ; then
+	inherit git-r3
+	EGIT_REPO_URI="https://github.com/kovidgoyal/kitty.git"
+else
+	SRC_URI="https://github.com/kovidgoyal/kitty/releases/download/v${PV}/${P}.tar.xz"
+	KEYWORDS="~amd64 ~x86"
+fi
+
+DESCRIPTION="Fast, feature-rich, GPU-based terminal"
+HOMEPAGE="https://sw.kovidgoyal.net/kitty/"
+
+LICENSE="GPL-3"
+SLOT="0"
+IUSE="+X debug test wayland"
+REQUIRED_USE="
+	|| ( X wayland )
+	${PYTHON_REQUIRED_USE}"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+	${PYTHON_DEPS}
+	media-libs/fontconfig
+	media-libs/freetype:2
+	media-libs/harfbuzz:=
+	media-libs/lcms:2
+	media-libs/libglvnd[X?]
+	media-libs/libpng:=
+	sys-apps/dbus
+	sys-libs/zlib:=
+	x11-libs/libxkbcommon[X?]
+	x11-misc/xkeyboard-config
+	~x11-terms/kitty-terminfo-${PV}
+	>x11-terms/kitty-terminfo-0.23.1-r0
+	X? ( x11-libs/libX11 )
+	wayland? ( dev-libs/wayland )"
+DEPEND="
+	${RDEPEND}
+	X? (
+		x11-base/xorg-proto
+		x11-libs/libXcursor
+		x11-libs/libXi
+		x11-libs/libXinerama
+		x11-libs/libXrandr
+	)
+	wayland? ( dev-libs/wayland-protocols )"
+BDEPEND="
+	${PYTHON_DEPS}
+	sys-libs/ncurses
+	virtual/pkgconfig
+	test? ( $(python_gen_cond_dep 'dev-python/pillow[${PYTHON_USEDEP}]') )
+	wayland? ( dev-util/wayland-scanner )"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-0.23.1-flags.patch
+)
+
+src_prepare() {
+	default
+
+	sed "s/'x11 wayland'/'$(usev X x11) $(usev wayland)'/" -i setup.py || die
+	sed "s/else linux_backends/else [$(usev X "'x11',")$(usev wayland "'wayland'")]/" \
+		-i kitty_tests/check_build.py || die
+	use X || sed "/glfw_path('x11')/s/x11/wayland/" -i kitty_tests/glfw.py || die
+
+	# skip docs for live version
+	[[ ${PV} != 9999 ]] || sed -i '/exists.*_build/,/docs(ddir)/d' setup.py || die
+}
+
+src_compile() {
+	tc-export CC
+	export PKGCONFIG_EXE=$(tc-getPKG_CONFIG)
+
+	local setup=(
+		${EPYTHON} setup.py
+		--disable-link-time-optimization
+		--ignore-compiler-warnings
+		--libdir-name=$(get_libdir)
+		--update-check-interval=0
+		--verbose
+		$(usev debug --debug)
+		linux-package
+	)
+
+	echo "${setup[*]}"
+	"${setup[@]}" || die "setup.py failed to compile ${PN}"
+
+	[[ ${PV} == 9999 ]] || mv linux-package/share/doc/{${PN},${PF}} || die
+	rm -r linux-package/share/terminfo || die
+}
+
+src_test() {
+	PATH=linux-package/bin:${PATH} KITTY_CONFIG_DIRECTORY=${T} \
+		${EPYTHON} test.py || die
+}
+
+src_install() {
+	insinto /usr
+	doins -r linux-package/.
+
+	fperms +x /usr/bin/kitty
+}
+
+pkg_postinst() {
+	xdg_icon_cache_update
+
+	optfeature "displaying images in the terminal" \
+		media-gfx/imagemagick media-gfx/graphicsmagick[imagemagick]
+
+	optfeature "audio-based terminal bell support" media-libs/libcanberra
+}


             reply	other threads:[~2021-11-03  6:41 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-03  6:41 Ionen Wolkens [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-10-05 15:23 [gentoo-commits] repo/gentoo:master commit in: x11-terms/kitty/, x11-terms/kitty/files/ Ionen Wolkens
2023-08-11  4:59 Ionen Wolkens
2021-11-03  6:41 Ionen Wolkens
2021-10-17 20:39 John Helmert III
2021-06-11  7:21 Joonas Niilola
2021-02-02 13:08 Joonas Niilola
2020-05-01 15:09 Joonas Niilola
2020-04-04  7:39 Joonas Niilola
2020-01-09  6:01 Joonas Niilola
2019-12-03 13:13 Joonas Niilola
2019-11-12  4:00 Tim Harder
2019-08-31 10:28 Tim Harder
2019-08-31 10:28 Tim Harder
2019-07-16 23:17 Matthew Thode
2019-06-15 21:27 Tim Harder
2018-06-17  9:18 Tim Harder
2018-06-05  4:34 Tim Harder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1635921411.0c349b95e730918fb9af59fffd8e09489b27faf2.ionen@gentoo \
    --to=ionen@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox