summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Schmaus <flow@gentoo.org>2021-07-15 13:14:23 +0200
committerFlorian Schmaus <flow@gentoo.org>2021-08-18 12:39:59 +0200
commit8f7593ab923d047fe43ee96a4d59613354b1ef01 (patch)
tree68e7fcd011079b5a367d36f9a25eae6f75826c83 /eclass/xdg.eclass
parentmedia-plugins/vdr-vompserver: use https (diff)
downloadgentoo-8f7593ab923d047fe43ee96a4d59613354b1ef01.tar.gz
gentoo-8f7593ab923d047fe43ee96a4d59613354b1ef01.tar.bz2
gentoo-8f7593ab923d047fe43ee96a4d59613354b1ef01.zip
xdg.eclass: add EAPI 8 support
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. Thanks to ulm and others for providing feedback. Signed-off-by: Florian Schmaus <flow@gentoo.org>
Diffstat (limited to 'eclass/xdg.eclass')
-rw-r--r--eclass/xdg.eclass30
1 files changed, 24 insertions, 6 deletions
diff --git a/eclass/xdg.eclass b/eclass/xdg.eclass
index 219be712e84..d973a09c29d 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 <eva@gentoo.org>
-# @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
@@ -14,29 +14,47 @@
inherit xdg-utils
-case "${EAPI:-0}" in
+_DEFINE_XDG_SRC_PREPARE=false
+case "${EAPI}" 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
+ _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
+ 4|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
}
+fi
# @FUNCTION: xdg_pkg_preinst
# @DESCRIPTION: