summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2024-05-03 04:20:15 +0100
committerSam James <sam@gentoo.org>2024-05-03 12:40:08 +0100
commit59b986917e336e0e161ef75bcc0b29b3357686d9 (patch)
tree58ae7a86b83efbc770d1c38830ee3a5c95ef10d6 /eclass/gnuconfig.eclass
parentdev-perl/GD: add 2.800.0 (diff)
downloadgentoo-59b986917e336e0e161ef75bcc0b29b3357686d9.tar.gz
gentoo-59b986917e336e0e161ef75bcc0b29b3357686d9.tar.bz2
gentoo-59b986917e336e0e161ef75bcc0b29b3357686d9.zip
gnuconfig.eclass: add GNUCONFIG_DEPEND
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>
Diffstat (limited to 'eclass/gnuconfig.eclass')
-rw-r--r--eclass/gnuconfig.eclass22
1 files changed, 19 insertions, 3 deletions
diff --git a/eclass/gnuconfig.eclass b/eclass/gnuconfig.eclass
index 0791798632cd..df3c74867608 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 ...]