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 08/22] gnome2.eclass: remove EAPI 5
Date: Tue, 14 Mar 2023 20:01:03
Message-Id: 20230314195826.35239-8-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/gnome2.eclass | 154 +++++++++----------------------------------
4 1 file changed, 31 insertions(+), 123 deletions(-)
5
6 diff --git a/eclass/gnome2.eclass b/eclass/gnome2.eclass
7 index a701b58fd9e7..37fbb94e55cd 100644
8 --- a/eclass/gnome2.eclass
9 +++ b/eclass/gnome2.eclass
10 @@ -1,35 +1,34 @@
11 -# Copyright 1999-2022 Gentoo Authors
12 +# Copyright 1999-2023 Gentoo Authors
13 # Distributed under the terms of the GNU General Public License v2
14
15 # @ECLASS: gnome2.eclass
16 # @MAINTAINER:
17 # gnome@g.o
18 -# @SUPPORTED_EAPIS: 5 6 7 8
19 +# @SUPPORTED_EAPIS: 6 7 8
20 # @PROVIDES: gnome2-utils
21 # @BLURB: Provides phases for Gnome/Gtk+ based packages.
22 # @DESCRIPTION:
23 # Exports portage base functions used by ebuilds written for packages using the
24 # GNOME framework. For additional functions, see gnome2-utils.eclass.
25
26 +case ${EAPI} in
27 + 6|7|8) ;;
28 + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
29 +esac
30 +
31 +if [[ -z ${_GNOME2_ECLASS} ]]; then
32 +_GNOME2_ECLASS=1
33 +
34 # @ECLASS_VARIABLE: GNOME2_EAUTORECONF
35 # @DEFAULT_UNSET
36 # @DESCRIPTION:
37 # Run eautoreconf instead of only elibtoolize
38 GNOME2_EAUTORECONF=${GNOME2_EAUTORECONF:-""}
39
40 -[[ ${GNOME2_EAUTORECONF} == 'yes' ]] && inherit autotools
41 -[[ ${EAPI} == [56] ]] && inherit eutils ltprune
42 -inherit libtool gnome.org gnome2-utils xdg
43 +[[ ${GNOME2_EAUTORECONF} == yes ]] && inherit autotools
44 +[[ ${EAPI} == 6 ]] && inherit ltprune
45
46 -case ${EAPI} in
47 - 5)
48 - EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_install pkg_preinst pkg_postinst pkg_postrm
49 - ;;
50 - 6|7|8)
51 - EXPORT_FUNCTIONS src_prepare src_configure src_compile src_install pkg_preinst pkg_postinst pkg_postrm
52 - ;;
53 - *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
54 -esac
55 +inherit libtool gnome.org gnome2-utils xdg
56
57 # @ECLASS_VARIABLE: ELTCONF
58 # @DEFAULT_UNSET
59 @@ -37,34 +36,6 @@ esac
60 # Extra options passed to elibtoolize
61 ELTCONF=${ELTCONF:-""}
62
63 -# @ECLASS_VARIABLE: G2CONF
64 -# @DEFAULT_UNSET
65 -# @DESCRIPTION:
66 -# Extra configure opts passed to econf.
67 -# Deprecated, pass extra arguments to gnome2_src_configure.
68 -# Banned in eapi6 and newer.
69 -if has ${EAPI} 5; then
70 - G2CONF=${G2CONF:-""}
71 -fi
72 -
73 -# @ECLASS_VARIABLE: GCONF_DEBUG
74 -# @DEFAULT_UNSET
75 -# @DESCRIPTION:
76 -# Whether to handle debug or not.
77 -# Some gnome applications support various levels of debugging (yes, no, minimum,
78 -# etc), but using --disable-debug also removes g_assert which makes debugging
79 -# harder. This variable should be set to yes for such packages for the eclass
80 -# to handle it properly. It will enable minimal debug with USE=-debug.
81 -# Note that this is most commonly found in configure.ac as GNOME_DEBUG_CHECK.
82 -#
83 -# Banned since eapi6 as upstream is moving away from this obsolete macro in favor
84 -# of autoconf-archive macros, that do not expose this issue (bug #270919)
85 -if has ${EAPI} 5; then
86 - if [[ ${GCONF_DEBUG} != "no" ]]; then
87 - IUSE="debug"
88 - fi
89 -fi
90 -
91 # @ECLASS_VARIABLE: GNOME2_ECLASS_GIO_MODULES
92 # @INTERNAL
93 # @DESCRIPTION:
94 @@ -72,47 +43,29 @@ fi
95
96 # @ECLASS_VARIABLE: GNOME2_LA_PUNT
97 # @DESCRIPTION:
98 -# In EAPIs 5 and 6, it relies on prune_libtool_files (from ltprune.eclass) for
99 +# In EAPI 6, it relies on prune_libtool_files (from ltprune.eclass) for
100 # this. Later EAPIs use find ... -delete. Available values for GNOME2_LA_PUNT:
101 # - "no": will not clean any .la files
102 # - "yes": will run prune_libtool_files --modules
103 # - If it is not set, it will run prune_libtool_files
104 GNOME2_LA_PUNT=${GNOME2_LA_PUNT:-""}
105
106 -# @FUNCTION: gnome2_src_unpack
107 -# @DESCRIPTION:
108 -# Stub function for old EAPI.
109 -gnome2_src_unpack() {
110 - if has ${EAPI} 5; then
111 - unpack ${A}
112 - cd "${S}"
113 - else
114 - die "gnome2_src_unpack is banned since eapi6"
115 - fi
116 -}
117 -
118 # @FUNCTION: gnome2_src_prepare
119 # @DESCRIPTION:
120 # Prepare environment for build, fix build of scrollkeeper documentation,
121 # run elibtoolize.
122 gnome2_src_prepare() {
123 - [[ ${EAPI} != 5 ]] && default
124 + default
125
126 # Prevent assorted access violations and test failures
127 gnome2_environment_reset
128
129 - # Prevent scrollkeeper access violations
130 - # We stop to run it from eapi6 as scrollkeeper helpers from
131 - # rarian are not running anything and, then, access violations
132 - # shouldn't occur.
133 - has ${EAPI} 5 && gnome2_omf_fix
134 -
135 # Disable all deprecation warnings
136 gnome2_disable_deprecation_warning
137
138 # Run libtoolize or eautoreconf, bug #591584
139 # https://bugzilla.gnome.org/show_bug.cgi?id=655517
140 - if [[ ${GNOME2_EAUTORECONF} == 'yes' ]]; then
141 + if [[ ${GNOME2_EAUTORECONF} == yes ]]; then
142 eautoreconf
143 else
144 elibtoolize ${ELTCONF}
145 @@ -123,29 +76,8 @@ gnome2_src_prepare() {
146 # @DESCRIPTION:
147 # Gnome specific configure handling
148 gnome2_src_configure() {
149 - # Deprecated for a long time now and banned since eapi6, see Gnome team policies
150 - if [[ -n ${G2CONF} ]] ; then
151 - if has ${EAPI} 5; then
152 - eqawarn "G2CONF set, please review documentation at https://wiki.gentoo.org/wiki/Project:GNOME/Gnome_Team_Ebuild_Policies#G2CONF_and_src_configure"
153 - else
154 - die "G2CONF set, please review documentation at https://wiki.gentoo.org/wiki/Project:GNOME/Gnome_Team_Ebuild_Policies#G2CONF_and_src_configure"
155 - fi
156 - fi
157 -
158 local g2conf=()
159
160 - if has ${EAPI} 5; then
161 - if [[ ${GCONF_DEBUG} != 'no' ]] ; then
162 - if use debug ; then
163 - g2conf+=( --enable-debug=yes )
164 - fi
165 - fi
166 - else
167 - if [[ -n ${GCONF_DEBUG} ]] ; then
168 - die "GCONF_DEBUG is banned since eapi6 in favor of each ebuild taking care of the proper handling of debug configure option"
169 - fi
170 - fi
171 -
172 # We consider packages installing gtk-doc to be handled by adding
173 # DEPEND="dev-util/gtk-doc-am" which provides tools to relink URLs in
174 # documentation to already installed documentation. This decision also
175 @@ -187,36 +119,17 @@ gnome2_src_configure() {
176 g2conf+=( --enable-compile-warnings=minimum )
177 fi
178
179 - # Pass --docdir with proper directory, bug #482646 (not needed since eapi6)
180 - if has ${EAPI} 5; then
181 - if grep -q "^ *--docdir=" "${ECONF_SOURCE:-.}"/configure; then
182 - g2conf+=( --docdir="${EPREFIX}"/usr/share/doc/${PF} )
183 - fi
184 - fi
185 -
186 # Avoid sandbox violations caused by gnome-vfs (bug #128289 and #345659)
187 - if has ${EAPI} 5; then
188 - addwrite "$(unset HOME; echo ~)/.gnome2"
189 - else
190 - addpredict "$(unset HOME; echo ~)/.gnome2"
191 - fi
192 + addpredict "$(unset HOME; echo ~)/.gnome2"
193
194 - if has ${EAPI} 5; then
195 - econf ${g2conf[@]} ${G2CONF} "$@"
196 - else
197 - econf ${g2conf[@]} "$@"
198 - fi
199 + econf ${g2conf[@]} "$@"
200 }
201
202 # @FUNCTION: gnome2_src_compile
203 # @DESCRIPTION:
204 # Only default src_compile for now
205 gnome2_src_compile() {
206 - if has ${EAPI} 5; then
207 - emake
208 - else
209 - default
210 - fi
211 + default
212 }
213
214 # @FUNCTION: gnome2_src_install
215 @@ -233,40 +146,31 @@ gnome2_src_install() {
216 #
217 # if this is not present, scrollkeeper-update may segfault and
218 # create bogus directories in /var/lib/
219 - if has ${EAPI} 5; then
220 - dodir "${sk_tmp_dir}" || die "dodir failed"
221 - emake DESTDIR="${D}" "scrollkeeper_localstate_dir=${ED}${sk_tmp_dir} " "$@" install
222 - else
223 - default
224 - fi
225 + default
226
227 unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL
228
229 # Handle documentation as 'default' for eapi5, bug #373131
230 # Since eapi6 this is handled by default on its own plus MAINTAINERS and HACKING
231 # files that are really common in gnome packages (bug #573390)
232 - if has ${EAPI} 5; then
233 - einstalldocs
234 - else
235 - local d
236 - for d in HACKING MAINTAINERS; do
237 - [[ -s "${d}" ]] && dodoc "${d}"
238 - done
239 - fi
240 + local d
241 + for d in HACKING MAINTAINERS; do
242 + [[ -s ${d} ]] && dodoc "${d}"
243 + done
244
245 # Do not keep /var/lib/scrollkeeper because:
246 # 1. The scrollkeeper database is regenerated at pkg_postinst()
247 # 2. ${ED}/var/lib/scrollkeeper contains only indexes for the current pkg
248 # thus it makes no sense if pkg_postinst ISN'T run for some reason.
249 - rm -rf "${ED}${sk_tmp_dir}"
250 + rm -rf "${ED}${sk_tmp_dir}" || die
251 rmdir "${ED}/var/lib" 2>/dev/null
252 rmdir "${ED}/var" 2>/dev/null
253
254 # Make sure this one doesn't get in the portage db
255 - rm -fr "${ED}/usr/share/applications/mimeinfo.cache"
256 + rm -rf "${ED}/usr/share/applications/mimeinfo.cache" || die
257
258 # Delete all .la files
259 - if has ${EAPI} 5 6; then
260 + if has ${EAPI} 6; then
261 case "${GNOME2_LA_PUNT}" in
262 yes) prune_libtool_files --modules;;
263 no) ;;
264 @@ -336,3 +240,7 @@ gnome2_pkg_postrm() {
265 gnome2_giomodule_cache_update
266 fi
267 }
268 +
269 +fi
270 +
271 +EXPORT_FUNCTIONS src_prepare src_configure src_compile src_install pkg_preinst pkg_postinst pkg_postrm
272 --
273 2.40.0