commit:     c49ea4647556e0f547d203b66472ac8498a95867
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Tue Nov 22 14:04:15 2022 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Tue Nov 22 14:35:49 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c49ea464

x11-terms/kitty: revamp seds in live

Not that much clearer, but makes iwdevtools' qa-sed happier by
not doing seds that are expected to do nothing (and so easier
to track if these need updates).

Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 x11-terms/kitty/kitty-9999.ebuild | 25 ++++++++++++++++---------
 1 file changed, 16 insertions(+), 9 deletions(-)

diff --git a/x11-terms/kitty/kitty-9999.ebuild 
b/x11-terms/kitty/kitty-9999.ebuild
index 06e7d84c2b81..66de305b3f00 100644
--- a/x11-terms/kitty/kitty-9999.ebuild
+++ b/x11-terms/kitty/kitty-9999.ebuild
@@ -82,13 +82,22 @@ src_unpack() {
 src_prepare() {
        default
 
-       # seds unfortunately feel easier on maintainenance than patches here
-       sed -e "s/'x11 wayland'/'$(usev X x11) $(usev wayland)'/" \
-               -e "$(usev !X '/gl_libs =/s/=.*/= []/')" \
-               -e "/num_workers =/s/=.*/= $(makeopts_jobs)/" \
-               -e "s/cflags.append.*-O3.*/pass/" -e 's/-O3//' \
-               -e "s/ld_flags.append('-s')/pass/" \
-               -i setup.py || die
+       # sed unfortunately feels easier on maintainenance than patches here
+       local sedargs=(
+               -e "/num_workers =/s/=.*/= $(makeopts_jobs)/"
+               -e "s/cflags.append.*-O3.*/pass/" -e 's/-O3//'
+               -e "s/ld_flags.append('-s')/pass/"
+       )
+
+       # kitty is often popular on wayland-only setups, try to allow this
+       use !X && sedargs+=( -e '/gl_libs =/s/=.*/= []/' ) #857918
+       use !X || use !wayland &&
+               sedargs+=( -e "s/'x11 wayland'/'$(usex X x11 wayland)'/" )
+
+       # skip docs for live version, missing dependencies
+       [[ ${PV} == 9999 ]] && sedargs+=( -e '/exists.*_build/,/docs(ddir)/d' )
+
+       sed -i setup.py "${sedargs[@]}" || die
 
        # test relies on 'who' command which doesn't detect users with 
pid-sandbox
        rm kitty_tests/utmp.py || die
@@ -96,8 +105,6 @@ src_prepare() {
        # test may fail/hang depending on environment and shell initialization 
scripts
        rm kitty_tests/{shell_integration,ssh}.py || die
 
-       # skip docs for live version
-       [[ ${PV} != 9999 ]] || sed -i '/exists.*_build/,/docs(ddir)/d' setup.py 
|| die
 }
 
 src_compile() {

Reply via email to