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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 8440513933E for ; Wed, 21 Jul 2021 15:09:00 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 77605E09C4; Wed, 21 Jul 2021 15:08:55 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 0FD85E099E for ; Wed, 21 Jul 2021 15:08:55 +0000 (UTC) From: Florian Schmaus To: gentoo-dev@lists.gentoo.org Cc: Florian Schmaus Subject: [gentoo-dev] [PATCH v2] xdg.eclass: add EAPI 8 support Date: Wed, 21 Jul 2021 17:08:49 +0200 Message-Id: <20210721150849.175482-1-flow@gentoo.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210715111956.297120-1-flow@gentoo.org> References: <20210715111956.297120-1-flow@gentoo.org> 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: aa8821fe-c422-4ca2-8f8e-849cf76fed88 X-Archives-Hash: 130e62ab81c41f683a2e8c39b52e4ebe Note that this removes the export of src_prepare in EPAI 8 as requested by ionen: 1. remove src_prepare export in EAPI-8 While "some" packages need xdg_environment_reset, most don't because the eclass is often only inherited to handle icons/.desktop and this just needlessly overwrite the src_prepare of other eclasses requiring more careful inherit ordering (e.g. inherit xdg cmake). I'd prefer it was clear when a package need this by calling xdg_environment_reset directly. Unless there is a non-trivial amount of packages that need it (e.g. for tests) that I'm not aware of. Signed-off-by: Florian Schmaus --- Notes: - Do not longer export src_prepare in EAPI 8 (as requested by ionen) eclass/xdg.eclass | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/eclass/xdg.eclass b/eclass/xdg.eclass index 219be712e84d..ce2d337bff5c 100644 --- a/eclass/xdg.eclass +++ b/eclass/xdg.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2019 Gentoo Authors +# Copyright 1999-2021 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: xdg.eclass @@ -6,7 +6,7 @@ # freedesktop-bugs@gentoo.org # @AUTHOR: # Original author: Gilles Dartiguelongue -# @SUPPORTED_EAPIS: 4 5 6 7 +# @SUPPORTED_EAPIS: 4 5 6 7 8 # @BLURB: Provides phases for XDG compliant packages. # @DESCRIPTION: # Utility eclass to update the desktop, icon and shared mime info as laid @@ -16,22 +16,36 @@ inherit xdg-utils case "${EAPI:-0}" in 4|5|6|7) - EXPORT_FUNCTIONS src_prepare pkg_preinst pkg_postinst pkg_postrm + # src_prepare is only exported in EAPI < 8. + EXPORT_FUNCTIONS src_prepare + ;& + 8) + EXPORT_FUNCTIONS pkg_preinst pkg_postinst pkg_postrm ;; *) die "EAPI=${EAPI} is not supported" ;; esac # Avoid dependency loop as both depend on glib-2 if [[ ${CATEGORY}/${P} != dev-libs/glib-2.* ]] ; then -DEPEND=" +_XDG_DEPEND=" dev-util/desktop-file-utils x11-misc/shared-mime-info " + +case "${EAPI}" in + 4|5|6|7) + DEPEND="${_XDG_DEPEND}" + ;; + *) + IDEPEND="${_XDG_DEPEND}" + ;; +esac fi # @FUNCTION: xdg_src_prepare # @DESCRIPTION: # Prepare sources to work with XDG standards. +# Note that this function is only exported in EAPIs < 8. xdg_src_prepare() { xdg_environment_reset -- 2.31.1