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 478D6158064 for ; Fri, 3 May 2024 11:42:24 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id BF706E2A8A; Fri, 3 May 2024 11:42:20 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (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 4A258E2A68 for ; Fri, 3 May 2024 11:42:20 +0000 (UTC) From: Sam James To: gentoo-dev@lists.gentoo.org Cc: base-system@gentoo.org, Sam James Subject: [gentoo-dev] [PATCH v2 1/3] gnuconfig.eclass: add GNUCONFIG_DEPEND Date: Fri, 3 May 2024 12:41:46 +0100 Message-ID: <20240503114151.571218-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: 6a1c39d5-dfc9-42ab-9cd1-3c12bc90c41a X-Archives-Hash: 3daa96513fa49213b841cd28d0eb3da7 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