public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH 1/2] gnuconfig.eclass: add GNUCONFIG_DEPEND
@ 2024-05-03  6:42 Sam James
  2024-05-03  6:42 ` [gentoo-dev] [PATCH 2/2] autotools.eclass: conditionalize gnuconfig dependency Sam James
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Sam James @ 2024-05-03  6:42 UTC (permalink / raw)
  To: gentoo-dev; +Cc: base-system, Sam James

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



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [gentoo-dev] [PATCH 2/2] autotools.eclass: conditionalize gnuconfig dependency
  2024-05-03  6:42 [gentoo-dev] [PATCH 1/2] gnuconfig.eclass: add GNUCONFIG_DEPEND Sam James
@ 2024-05-03  6:42 ` Sam James
  2024-05-03 10:00 ` [gentoo-dev] [PATCH 1/2] gnuconfig.eclass: add GNUCONFIG_DEPEND Arsen Arsenović
  2024-05-03 10:14 ` Ulrich Mueller
  2 siblings, 0 replies; 6+ messages in thread
From: Sam James @ 2024-05-03  6:42 UTC (permalink / raw)
  To: gentoo-dev; +Cc: base-system, Sam James

Use newly-added GNUCONFIG_DEPEND so that AUTOTOOLS_AUTO_DEPEND=no doesn't
result in a useless dependency on gnuconfig.

Signed-off-by: Sam James <sam@gentoo.org>
---
 eclass/autotools.eclass | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/eclass/autotools.eclass b/eclass/autotools.eclass
index 1ced771c5345f..a456e9b9f5898 100644
--- a/eclass/autotools.eclass
+++ b/eclass/autotools.eclass
@@ -33,6 +33,7 @@ _AUTOTOOLS_ECLASS=1
 
 [[ ${EAPI} == 6 ]] && inherit eqawarn
 
+GNUCONFIG_AUTO_DEPEND=no
 inherit gnuconfig libtool
 
 # @ECLASS_VARIABLE: WANT_AUTOCONF
@@ -164,9 +165,12 @@ fi
 # @DESCRIPTION:
 # Contains the combination of requested automake/autoconf/libtool
 # versions in *DEPEND format.
-AUTOTOOLS_DEPEND="${_automake_atom}
+AUTOTOOLS_DEPEND="
+	${GNUCONFIG_DEPEND}
+	${_automake_atom}
 	${_autoconf_atom}
-	${_libtool_atom}"
+	${_libtool_atom}
+"
 RDEPEND=""
 
 # @ECLASS_VARIABLE: AUTOTOOLS_AUTO_DEPEND
-- 
2.45.0



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [gentoo-dev] [PATCH 1/2] gnuconfig.eclass: add GNUCONFIG_DEPEND
  2024-05-03  6:42 [gentoo-dev] [PATCH 1/2] gnuconfig.eclass: add GNUCONFIG_DEPEND Sam James
  2024-05-03  6:42 ` [gentoo-dev] [PATCH 2/2] autotools.eclass: conditionalize gnuconfig dependency Sam James
@ 2024-05-03 10:00 ` Arsen Arsenović
  2024-05-03 11:43   ` Sam James
  2024-05-03 10:14 ` Ulrich Mueller
  2 siblings, 1 reply; 6+ messages in thread
From: Arsen Arsenović @ 2024-05-03 10:00 UTC (permalink / raw)
  To: Sam James; +Cc: gentoo-dev, base-system

[-- Attachment #1: Type: text/plain, Size: 228 bytes --]

Sam James <sam@gentoo.org> writes:

> The motivation here is to allow autotools.eclass consumers setting
> AUTOTOOLS_AUTO_DEPEND=no to not have a useless gnuconfig dependency.

series looks ok to me
-- 
Arsen Arsenović

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 251 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-dev] [PATCH 1/2] gnuconfig.eclass: add GNUCONFIG_DEPEND
  2024-05-03  6:42 [gentoo-dev] [PATCH 1/2] gnuconfig.eclass: add GNUCONFIG_DEPEND Sam James
  2024-05-03  6:42 ` [gentoo-dev] [PATCH 2/2] autotools.eclass: conditionalize gnuconfig dependency Sam James
  2024-05-03 10:00 ` [gentoo-dev] [PATCH 1/2] gnuconfig.eclass: add GNUCONFIG_DEPEND Arsen Arsenović
@ 2024-05-03 10:14 ` Ulrich Mueller
  2024-05-03 11:42   ` Sam James
  2 siblings, 1 reply; 6+ messages in thread
From: Ulrich Mueller @ 2024-05-03 10:14 UTC (permalink / raw)
  To: Sam James; +Cc: gentoo-dev, base-system

[-- Attachment #1: Type: text/plain, Size: 188 bytes --]

>>>>> On Fri, 03 May 2024, Sam James wrote:
 
> +	case ${EAPI} in
> +		5|6) DEPEND=${GNUCONFIG_DEPEND} ;;
> +		*) BDEPEND=${GNUCONFIG_DEPEND} ;;
> +	esac

Drop EAPI 5 while at it?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 507 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-dev] [PATCH 1/2] gnuconfig.eclass: add GNUCONFIG_DEPEND
  2024-05-03 10:14 ` Ulrich Mueller
@ 2024-05-03 11:42   ` Sam James
  0 siblings, 0 replies; 6+ messages in thread
From: Sam James @ 2024-05-03 11:42 UTC (permalink / raw)
  To: Ulrich Mueller; +Cc: gentoo-dev, base-system

Ulrich Mueller <ulm@gentoo.org> writes:

>>>>>> On Fri, 03 May 2024, Sam James wrote:
>  
>> +	case ${EAPI} in
>> +		5|6) DEPEND=${GNUCONFIG_DEPEND} ;;
>> +		*) BDEPEND=${GNUCONFIG_DEPEND} ;;
>> +	esac
>
> Drop EAPI 5 while at it?

Good point, done & pushed, thanks.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-dev] [PATCH 1/2] gnuconfig.eclass: add GNUCONFIG_DEPEND
  2024-05-03 10:00 ` [gentoo-dev] [PATCH 1/2] gnuconfig.eclass: add GNUCONFIG_DEPEND Arsen Arsenović
@ 2024-05-03 11:43   ` Sam James
  0 siblings, 0 replies; 6+ messages in thread
From: Sam James @ 2024-05-03 11:43 UTC (permalink / raw)
  To: Arsen Arsenović; +Cc: gentoo-dev, base-system

Arsen Arsenović <arsen@gentoo.org> writes:

> Sam James <sam@gentoo.org> writes:
>
>> The motivation here is to allow autotools.eclass consumers setting
>> AUTOTOOLS_AUTO_DEPEND=no to not have a useless gnuconfig dependency.
>
> series looks ok to me

thanks!


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-05-03 11:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-03  6:42 [gentoo-dev] [PATCH 1/2] gnuconfig.eclass: add GNUCONFIG_DEPEND Sam James
2024-05-03  6:42 ` [gentoo-dev] [PATCH 2/2] autotools.eclass: conditionalize gnuconfig dependency Sam James
2024-05-03 10:00 ` [gentoo-dev] [PATCH 1/2] gnuconfig.eclass: add GNUCONFIG_DEPEND Arsen Arsenović
2024-05-03 11:43   ` Sam James
2024-05-03 10:14 ` Ulrich Mueller
2024-05-03 11:42   ` Sam James

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox