From 7c59acba5699c9c58090a7a738669669a7307023 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sat, 21 Aug 2021 23:14:26 +0100 Subject: gentoo resync : 21.08.2021 --- eclass/xdg.eclass | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) (limited to 'eclass/xdg.eclass') diff --git a/eclass/xdg.eclass b/eclass/xdg.eclass index 219be712e84d..08dc8432a5e0 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: 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 @@ -14,29 +14,47 @@ inherit xdg-utils -case "${EAPI:-0}" in - 4|5|6|7) - EXPORT_FUNCTIONS src_prepare pkg_preinst pkg_postinst pkg_postrm +_DEFINE_XDG_SRC_PREPARE=false +case "${EAPI}" in + 5|6|7) + # src_prepare is only exported in EAPI < 8. + EXPORT_FUNCTIONS src_prepare + _DEFINE_XDG_SRC_PREPARE=true ;; - *) die "EAPI=${EAPI} is not supported" ;; + 8) + ;; + *) die "${ECLASS}: EAPI=${EAPI} is not supported" ;; esac +EXPORT_FUNCTIONS pkg_preinst pkg_postinst pkg_postrm # 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 + 5|6|7) + DEPEND="${_XDG_DEPEND}" + ;; + *) + IDEPEND="${_XDG_DEPEND}" + ;; +esac fi +if ${_DEFINE_XDG_SRC_PREPARE}; then # @FUNCTION: xdg_src_prepare # @DESCRIPTION: # Prepare sources to work with XDG standards. +# Note that this function is only defined and exported in EAPIs < 8. xdg_src_prepare() { xdg_environment_reset - [[ ${EAPI:-0} != [45] ]] && default + [[ ${EAPI} != 5 ]] && default } +fi # @FUNCTION: xdg_pkg_preinst # @DESCRIPTION: -- cgit v1.2.3