commit:     ce227aa165920d92198c2ca24be6e33b77f470c7
Author:     Anna (cybertailor) Vyalkova <cyber+gentoo <AT> sysrq <DOT> in>
AuthorDate: Fri Jul 12 08:36:36 2024 +0000
Commit:     Anna Vyalkova <cyber+gentoo <AT> sysrq <DOT> in>
CommitDate: Sun Jul 14 07:22:19 2024 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=ce227aa1

boinc-app.eclass: allow to set deps for boinc-optional apps

Signed-off-by: Anna (cybertailor) Vyalkova <cyber+gentoo <AT> sysrq.in>

 eclass/boinc-app.eclass | 27 ++++++++++++++++++++-------
 1 file changed, 20 insertions(+), 7 deletions(-)

diff --git a/eclass/boinc-app.eclass b/eclass/boinc-app.eclass
index 00ffd39ed..3a26e6738 100644
--- a/eclass/boinc-app.eclass
+++ b/eclass/boinc-app.eclass
@@ -80,20 +80,33 @@ in order to use this application with BOINC.}
 # @FUNCTION: boinc-app_add_deps
 # @USAGE: [--wrapper]
 # @DESCRIPTION:
-# Generate appropriate (R)DEPEND for wrapper-enabled or
+# Generate appropriate IUSE and (R)DEPEND for wrapper-enabled or
 # native application.
+#
+# If BOINC_APP_OPTIONAL is set to a non-null value, dependencies
+# will be added for "boinc" USE-flag.
 boinc-app_add_deps() {
        debug-print-function ${FUNCNAME} "${@}"
 
-       if [[ $1 == "--wrapper" ]]; then
-               RDEPEND="sci-misc/boinc-wrapper"
+       local depend rdepend
+       if [[ ${1} == "--wrapper" ]]; then
+               rdepend="sci-misc/boinc-wrapper"
        else
-               DEPEND="sci-misc/boinc"
-               RDEPEND="sci-misc/boinc"
+               depend="sci-misc/boinc"
+               rdepend="sci-misc/boinc"
        fi
 
-       DEPEND="${DEPEND} acct-user/boinc"
-       RDEPEND="${RDEPEND} acct-user/boinc"
+       depend+=" acct-user/boinc"
+       rdepend+=" acct-user/boinc"
+
+       if [[ ${BOINC_APP_OPTIONAL} ]]; then
+               IUSE+=" boinc"
+               DEPEND+=" boinc? ( ${depend} )"
+               RDEPEND+=" boinc? ( ${rdepend} )"
+       else
+               DEPEND+=" ${depend}"
+               RDEPEND+=" ${rdepend}"
+       fi
 }
 
 # @FUNCTION: boinc_master_url_check

Reply via email to