From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 98018158064 for ; Fri, 3 May 2024 06:42:26 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 2E6A3E2A4D; Fri, 3 May 2024 06:42:22 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id C441AE2A06 for ; Fri, 3 May 2024 06:42:21 +0000 (UTC) From: Sam James To: gentoo-dev@lists.gentoo.org Cc: base-system@gentoo.org, Sam James Subject: [gentoo-dev] [PATCH 1/2] gnuconfig.eclass: add GNUCONFIG_DEPEND Date: Fri, 3 May 2024 07:42:05 +0100 Message-ID: <20240503064210.3200832-1-sam@gentoo.org> X-Mailer: git-send-email 2.45.0 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Archives-Salt: 38b7a248-b740-48c3-ad9d-521eb9bbe1f6 X-Archives-Hash: b4013e4faafa308ca5077b8126cde609 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 --- 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