Gentoo Archives: gentoo-dev

From: David Seifert <soap@g.o>
To: gentoo-dev@l.g.o
Cc: David Seifert <soap@g.o>
Subject: [gentoo-dev] [PATCH 21/22] xdg.eclass: remove EAPI 5
Date: Tue, 14 Mar 2023 20:04:54
Message-Id: 20230314195826.35239-21-soap@gentoo.org
In Reply to: [gentoo-dev] [PATCH 01/22] apache-module.eclass: remove EAPI 5 by David Seifert
1 Signed-off-by: David Seifert <soap@g.o>
2 ---
3 eclass/xdg.eclass | 65 ++++++++++++++++++++++++-----------------------
4 1 file changed, 33 insertions(+), 32 deletions(-)
5
6 diff --git a/eclass/xdg.eclass b/eclass/xdg.eclass
7 index a3e75103a046..14c56047af45 100644
8 --- a/eclass/xdg.eclass
9 +++ b/eclass/xdg.eclass
10 @@ -1,4 +1,4 @@
11 -# Copyright 1999-2021 Gentoo Authors
12 +# Copyright 1999-2023 Gentoo Authors
13 # Distributed under the terms of the GNU General Public License v2
14
15 # @ECLASS: xdg.eclass
16 @@ -6,56 +6,54 @@
17 # freedesktop-bugs@g.o
18 # @AUTHOR:
19 # Original author: Gilles Dartiguelongue <eva@g.o>
20 -# @SUPPORTED_EAPIS: 5 6 7 8
21 +# @SUPPORTED_EAPIS: 6 7 8
22 # @PROVIDES: xdg-utils
23 # @BLURB: Provides phases for XDG compliant packages.
24 # @DESCRIPTION:
25 # Utility eclass to update the desktop, icon and shared mime info as laid
26 # out in the freedesktop specs & implementations
27
28 -inherit xdg-utils
29 -
30 -_DEFINE_XDG_SRC_PREPARE=false
31 -case "${EAPI}" in
32 - 5|6|7)
33 - # src_prepare is only exported in EAPI < 8.
34 - EXPORT_FUNCTIONS src_prepare
35 - _DEFINE_XDG_SRC_PREPARE=true
36 - ;;
37 - 8)
38 - ;;
39 - *) die "${ECLASS}: EAPI=${EAPI} is not supported" ;;
40 +case ${EAPI} in
41 + 6|7|8) ;;
42 + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
43 esac
44 -EXPORT_FUNCTIONS pkg_preinst pkg_postinst pkg_postrm
45 +
46 +if [[ -z ${_XDG_ECLASS} ]]; then
47 +_XDG_ECLASS=1
48 +
49 +inherit xdg-utils
50
51 # Avoid dependency loop as both depend on glib-2
52 -if [[ ${CATEGORY}/${P} != dev-libs/glib-2.* ]] ; then
53 -_XDG_DEPEND="
54 +[[ ${CATEGORY}/${P} != dev-libs/glib-2.* ]] && _XDG_DEPEND="
55 dev-util/desktop-file-utils
56 x11-misc/shared-mime-info
57 "
58
59 -case "${EAPI}" in
60 - 5|6|7)
61 +case ${EAPI} in
62 + 6|7)
63 + # src_prepare is only exported in EAPI < 8.
64 + # @FUNCTION: xdg_src_prepare
65 + # @DESCRIPTION:
66 + # Prepare sources to work with XDG standards.
67 + # Note that this function is only defined and exported in EAPIs < 8.
68 + xdg_src_prepare() {
69 + xdg_environment_reset
70 + default
71 + }
72 +
73 + EXPORT_FUNCTIONS src_prepare
74 +
75 DEPEND="${_XDG_DEPEND}"
76 ;;
77 *)
78 + xdg_src_prepare() {
79 + die "Called xdg_src_prepare in EAPI >= 8"
80 + }
81 +
82 IDEPEND="${_XDG_DEPEND}"
83 ;;
84 esac
85 -fi
86 -
87 -if ${_DEFINE_XDG_SRC_PREPARE}; then
88 -# @FUNCTION: xdg_src_prepare
89 -# @DESCRIPTION:
90 -# Prepare sources to work with XDG standards.
91 -# Note that this function is only defined and exported in EAPIs < 8.
92 -xdg_src_prepare() {
93 - xdg_environment_reset
94 -
95 - [[ ${EAPI} != 5 ]] && default
96 -}
97 -fi
98 +unset _XDG_DEPEND
99
100 # @FUNCTION: xdg_pkg_preinst
101 # @DESCRIPTION:
102 @@ -127,3 +125,6 @@ xdg_pkg_postrm() {
103 fi
104 }
105
106 +fi
107 +
108 +EXPORT_FUNCTIONS pkg_preinst pkg_postinst pkg_postrm
109 --
110 2.40.0