commit:     2e840ff7949dd41dc0b7a2a7d491ec5cc4bf3367
Author:     Daniel Pielmeier <billie <AT> gentoo <DOT> org>
AuthorDate: Mon Nov 21 17:02:04 2022 +0000
Commit:     Daniel Pielmeier <billie <AT> gentoo <DOT> org>
CommitDate: Mon Nov 21 17:02:04 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2e840ff7

app-admin/conky: Another try to fix python related stuff.

Closes: https://bugs.gentoo.org/878427

Signed-off-by: Daniel Pielmeier <billie <AT> gentoo.org>

 app-admin/conky/conky-1.15.0.ebuild | 37 +++++++++++++++++++++++++++++++------
 1 file changed, 31 insertions(+), 6 deletions(-)

diff --git a/app-admin/conky/conky-1.15.0.ebuild 
b/app-admin/conky/conky-1.15.0.ebuild
index ec41cde86063..d3d700c1507a 100644
--- a/app-admin/conky/conky-1.15.0.ebuild
+++ b/app-admin/conky/conky-1.15.0.ebuild
@@ -4,8 +4,9 @@
 EAPI=8
 
 LUA_COMPAT=( lua5-3 )
+PYTHON_COMPAT=( python{3_9,3_10,3_11} )
 
-inherit cmake linux-info lua-single readme.gentoo-r1 xdg
+inherit cmake linux-info lua-single python-any-r1 readme.gentoo-r1 xdg
 
 DESCRIPTION="An advanced, highly configurable system monitor for X"
 HOMEPAGE="https://github.com/brndnmtthws/conky";
@@ -20,7 +21,6 @@ IUSE="apcupsd bundled-toluapp cmus curl doc extras hddtemp 
ical iconv imlib
        webserver wifi X xinerama xmms2"
 
 COMMON_DEPEND="
-       cmus? ( media-sound/cmus )
        curl? ( net-misc/curl )
        ical? ( dev-libs/libical:= )
        iconv? ( virtual/libiconv )
@@ -51,6 +51,7 @@ COMMON_DEPEND="
 RDEPEND="
        ${COMMON_DEPEND}
        apcupsd? ( sys-power/apcupsd )
+       cmus? ( media-sound/cmus )
        hddtemp? ( app-admin/hddtemp )
        moc? ( media-sound/moc )
        extras? (
@@ -60,10 +61,29 @@ RDEPEND="
 "
 DEPEND="
        ${COMMON_DEPEND}
-       doc? ( virtual/pandoc dev-python/pyyaml dev-python/jinja )
-       extras? ( dev-python/pyyaml dev-python/jinja )
+"
+BDEPEND="
+       doc? (
+               virtual/pandoc
+               $(python_gen_any_dep '
+                       dev-python/pyyaml[${PYTHON_USEDEP}]
+                       dev-python/jinja[${PYTHON_USEDEP}]
+               ')
+       )
+       extras? (
+               $(python_gen_any_dep '
+                       dev-python/pyyaml[${PYTHON_USEDEP}]
+                       dev-python/jinja[${PYTHON_USEDEP}]
+               ')
+       )
 "
 
+python_check_deps() {
+       use doc || use extras || return 0
+       python_has_version -b "dev-python/pyyaml[${PYTHON_USEDEP}]" &&
+       python_has_version -b "dev-python/jinja[${PYTHON_USEDEP}]"
+}
+
 REQUIRED_USE="
        imlib? ( X )
        lua-cairo? ( X  bundled-toluapp )
@@ -88,13 +108,14 @@ Also see https://github.com/brndnmtthws/conky/wiki or 
https://wiki.gentoo.org/wi
 
 pkg_setup() {
        linux-info_pkg_setup
-
        lua-single_pkg_setup
+       if use doc || use extras; then
+               python-any-r1_pkg_setup
+       fi
 }
 
 src_prepare() {
        cmake_src_prepare
-
        xdg_environment_reset
 }
 
@@ -158,6 +179,10 @@ src_configure() {
                -DRELEASE=yes
        )
 
+       if use doc || use extras; then
+               mycmakeargs+=( -DPython3_EXECUTABLE="${PYTHON}" )
+       fi
+
        cmake_src_configure
 }
 

Reply via email to