commit: 387f0268019787ae17a476e6ef43267aab1d5e6b Author: Lucio Sauer <watermanpaint <AT> posteo <DOT> net> AuthorDate: Mon Feb 19 21:57:21 2024 +0000 Commit: Julien Roy <julien <AT> jroy <DOT> ca> CommitDate: Mon Feb 19 21:58:45 2024 +0000 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=387f0268
dev-python/pyclip: sync live ebuild Signed-off-by: Lucio Sauer <watermanpaint <AT> posteo.net> dev-python/pyclip/pyclip-9999.ebuild | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/dev-python/pyclip/pyclip-9999.ebuild b/dev-python/pyclip/pyclip-9999.ebuild index 5db126b6c0..85ade02ebc 100644 --- a/dev-python/pyclip/pyclip-9999.ebuild +++ b/dev-python/pyclip/pyclip-9999.ebuild @@ -21,7 +21,8 @@ DESCRIPTION="Python clipboard module" HOMEPAGE="https://pypi.org/project/pyclip/" LICENSE="Apache-2.0" SLOT="0" -IUSE="wayland X" +IUSE="wayland +X" +# Needs a working xorg/wayland setup RESTRICT="test" DOCS="${S}/docs/README.md" REQUIRED_USE="|| ( wayland X )" @@ -30,3 +31,21 @@ RDEPEND=" wayland? ( gui-apps/wl-clipboard ) X? ( x11-misc/xclip ) " + +src_prepare() { + # Clipboard detection should respect USE flags + if use wayland && ! use X; then + sed -ie "/linux':/s/elif .*/elif False:/" pyclip/util.py || die + elif ! use wayland && use X; then + sed -ie "/WAYLAND/s/elif .*/elif False:/" pyclip/util.py || die + fi + distutils-r1_src_prepare +} + +pkg_postinst() { + if use wayland && use X; then + elog "If you wish to use the xclip backend over the wl-clipboard backend," + elog "unset the WAYLAND_DISPLAY environment variable or consider" + elog "installing ${CATEGORY}/${PN}[-wayland,X] instead." + fi +}
