From: Sam James <sam@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Cc: base-system@gentoo.org, Sam James <sam@gentoo.org>
Subject: [gentoo-dev] [PATCH v2 1/3] gnuconfig.eclass: add GNUCONFIG_DEPEND
Date: Fri, 3 May 2024 12:41:46 +0100 [thread overview]
Message-ID: <20240503114151.571218-1-sam@gentoo.org> (raw)
The motivation here is to allow autotools.eclass consumers setting
AUTOTOOLS_AUTO_DEPEND=no to not have a useless gnuconfig dependency.
Signed-off-by: Sam James <sam@gentoo.org>
---
eclass/gnuconfig.eclass | 22 +++++++++++++++++++---
1 file changed, 19 insertions(+), 3 deletions(-)
diff --git a/eclass/gnuconfig.eclass b/eclass/gnuconfig.eclass
index 0791798632cdb..df3c748676082 100644
--- a/eclass/gnuconfig.eclass
+++ b/eclass/gnuconfig.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: gnuconfig.eclass
@@ -24,9 +24,25 @@ esac
if [[ -z ${_GNUCONFIG_ECLASS} ]] ; then
_GNUCONFIG_CLASS=1
-BDEPEND="sys-devel/gnuconfig"
+# @ECLASS_VARIABLE: GNUCONFIG_DEPEND
+# @OUTPUT_VARIABLE
+# @DESCRIPTION:
+# Contains dependency on gnuconfig in *DEPEND format.
+GNUCONFIG_DEPEND="sys-devel/gnuconfig"
-[[ ${EAPI} == [56] ]] && DEPEND="${BDEPEND}"
+# @ECLASS_VARIABLE: GNUCONFIG_AUTO_DEPEND
+# @PRE_INHERIT
+# @DESCRIPTION:
+# Set to 'no' to disable automatically adding to DEPEND. This lets
+# ebuilds form conditional depends by using ${GNUCONFIG_DEPEND} in
+# their own DEPEND string.
+: "${GNUCONFIG_AUTO_DEPEND:=yes}"
+if [[ ${GNUCONFIG_AUTO_DEPEND} != "no" ]] ; then
+ case ${EAPI} in
+ 5|6) DEPEND=${GNUCONFIG_DEPEND} ;;
+ *) BDEPEND=${GNUCONFIG_DEPEND} ;;
+ esac
+fi
# @FUNCTION: gnuconfig_update
# @USAGE: [file1 file2 ...]
--
2.45.0
next reply other threads:[~2024-05-03 11:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-03 11:41 Sam James [this message]
2024-05-03 11:41 ` [gentoo-dev] [PATCH v2 2/3] autotools.eclass: conditionalize gnuconfig dependency Sam James
2024-05-03 11:41 ` [gentoo-dev] [PATCH v2 3/3] gnuconfig.eclass: drop EAPI 5 support Sam James
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=20240503114151.571218-1-sam@gentoo.org \
--to=sam@gentoo.org \
--cc=base-system@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