Gentoo Archives: gentoo-commits

From: Mart Raudsepp <leio@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/gnome:master commit in: eclass/
Date: Sat, 30 Jan 2021 20:02:53
Message-Id: 1612036961.9a3e97683af38a7b9242a3a66e13a88cfbd8ac46.leio@gentoo
1 commit: 9a3e97683af38a7b9242a3a66e13a88cfbd8ac46
2 Author: Mart Raudsepp <leio <AT> gentoo <DOT> org>
3 AuthorDate: Sat Jan 30 20:00:25 2021 +0000
4 Commit: Mart Raudsepp <leio <AT> gentoo <DOT> org>
5 CommitDate: Sat Jan 30 20:02:41 2021 +0000
6 URL: https://gitweb.gentoo.org/proj/gnome.git/commit/?id=9a3e9768
7
8 gnome2.eclass: sync with main repository
9
10 Just a copy with the ewarn about experimental overlay kept for now
11
12 Signed-off-by: Mart Raudsepp <leio <AT> gentoo.org>
13
14 eclass/gnome2.eclass | 104 ++++++++++++++++-----------------------------------
15 1 file changed, 33 insertions(+), 71 deletions(-)
16
17 diff --git a/eclass/gnome2.eclass b/eclass/gnome2.eclass
18 index 2cc54393..3d745c01 100644
19 --- a/eclass/gnome2.eclass
20 +++ b/eclass/gnome2.eclass
21 @@ -1,9 +1,10 @@
22 -# Copyright 1999-2015 Gentoo Foundation
23 +# Copyright 1999-2020 Gentoo Authors
24 # Distributed under the terms of the GNU General Public License v2
25
26 # @ECLASS: gnome2.eclass
27 # @MAINTAINER:
28 # gnome@g.o
29 +# @SUPPORTED_EAPIS: 5 6 7
30 # @BLURB: Provides phases for Gnome/Gtk+ based packages.
31 # @DESCRIPTION:
32 # Exports portage base functions used by ebuilds written for packages using the
33 @@ -16,25 +17,19 @@
34 GNOME2_EAUTORECONF=${GNOME2_EAUTORECONF:-""}
35
36 [[ ${GNOME2_EAUTORECONF} == 'yes' ]] && inherit autotools
37 -inherit eutils libtool gnome.org gnome2-utils xdg
38 +[[ ${EAPI} == [56] ]] && inherit eutils ltprune
39 +inherit libtool gnome.org gnome2-utils xdg
40
41 -case "${EAPI:-0}" in
42 - 4|5)
43 +case ${EAPI:-0} in
44 + 5)
45 EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_install pkg_preinst pkg_postinst pkg_postrm
46 ;;
47 - 6)
48 + 6|7)
49 EXPORT_FUNCTIONS src_prepare src_configure src_compile src_install pkg_preinst pkg_postinst pkg_postrm
50 ;;
51 *) die "EAPI=${EAPI} is not supported" ;;
52 esac
53
54 -# @ECLASS-VARIABLE: DOCS
55 -# @DEFAULT_UNSET
56 -# @DESCRIPTION:
57 -# String containing documents passed to dodoc command for eapi4.
58 -# In eapi5 we rely on einstalldocs (from eutils.eclass) and for newer EAPIs we
59 -# follow PMS spec.
60 -
61 # @ECLASS-VARIABLE: ELTCONF
62 # @DEFAULT_UNSET
63 # @DESCRIPTION:
64 @@ -47,7 +42,7 @@ ELTCONF=${ELTCONF:-""}
65 # Extra configure opts passed to econf.
66 # Deprecated, pass extra arguments to gnome2_src_configure.
67 # Banned in eapi6 and newer.
68 -if has ${EAPI:-0} 4 5; then
69 +if has ${EAPI} 5; then
70 G2CONF=${G2CONF:-""}
71 fi
72
73 @@ -63,7 +58,7 @@ fi
74 #
75 # Banned since eapi6 as upstream is moving away from this obsolete macro in favor
76 # of autoconf-archive macros, that do not expose this issue (bug #270919)
77 -if has ${EAPI:-0} 4 5; then
78 +if has ${EAPI} 5; then
79 if [[ ${GCONF_DEBUG} != "no" ]]; then
80 IUSE="debug"
81 fi
82 @@ -76,27 +71,22 @@ fi
83
84 # @ECLASS-VARIABLE: GNOME2_LA_PUNT
85 # @DESCRIPTION:
86 -# For eapi4 it sets if we should delete ALL or none of the .la files
87 -# For eapi5 and newer it relies on prune_libtool_files (from eutils.eclass)
88 -# for this. Available values for GNOME2_LA_PUNT:
89 +# In EAPIs 5 and 6, it relies on prune_libtool_files (from ltprune.eclass) for
90 +# this. Later EAPIs use find ... -delete. Available values for GNOME2_LA_PUNT:
91 # - "no": will not clean any .la files
92 # - "yes": will run prune_libtool_files --modules
93 # - If it is not set, it will run prune_libtool_files
94 -if has ${EAPI:-0} 4; then
95 - GNOME2_LA_PUNT=${GNOME2_LA_PUNT:-"no"}
96 -else
97 - GNOME2_LA_PUNT=${GNOME2_LA_PUNT:-""}
98 -fi
99 +GNOME2_LA_PUNT=${GNOME2_LA_PUNT:-""}
100
101 # @FUNCTION: gnome2_src_unpack
102 # @DESCRIPTION:
103 # Stub function for old EAPI.
104 gnome2_src_unpack() {
105 - if has ${EAPI:-0} 4 5; then
106 + if has ${EAPI} 5; then
107 unpack ${A}
108 cd "${S}"
109 else
110 - die "gnome2_src_unpack is banned from eapi6"
111 + die "gnome2_src_unpack is banned since eapi6"
112 fi
113 }
114
115 @@ -114,7 +104,7 @@ gnome2_src_prepare() {
116 # We stop to run it from eapi6 as scrollkeeper helpers from
117 # rarian are not running anything and, then, access violations
118 # shouldn't occur.
119 - has ${EAPI:-0} 4 5 && gnome2_omf_fix
120 + has ${EAPI} 5 && gnome2_omf_fix
121
122 # Disable all deprecation warnings
123 gnome2_disable_deprecation_warning
124 @@ -134,7 +124,7 @@ gnome2_src_prepare() {
125 gnome2_src_configure() {
126 # Deprecated for a long time now and banned since eapi6, see Gnome team policies
127 if [[ -n ${G2CONF} ]] ; then
128 - if has ${EAPI:-0} 4 5; then
129 + if has ${EAPI} 5; then
130 eqawarn "G2CONF set, please review documentation at https://wiki.gentoo.org/wiki/Project:GNOME/Gnome_Team_Ebuild_Policies#G2CONF_and_src_configure"
131 else
132 die "G2CONF set, please review documentation at https://wiki.gentoo.org/wiki/Project:GNOME/Gnome_Team_Ebuild_Policies#G2CONF_and_src_configure"
133 @@ -143,7 +133,7 @@ gnome2_src_configure() {
134
135 local g2conf=()
136
137 - if has ${EAPI:-0} 4 5; then
138 + if has ${EAPI} 5; then
139 if [[ ${GCONF_DEBUG} != 'no' ]] ; then
140 if use debug ; then
141 g2conf+=( --enable-debug=yes )
142 @@ -155,19 +145,14 @@ gnome2_src_configure() {
143 fi
144 fi
145
146 - # Starting with EAPI=5, we consider packages installing gtk-doc to be
147 - # handled by adding DEPEND="dev-util/gtk-doc-am" which provides tools to
148 - # relink URLs in documentation to already installed documentation.
149 - # This decision also greatly helps with constantly broken doc generation.
150 + # We consider packages installing gtk-doc to be handled by adding
151 + # DEPEND="dev-util/gtk-doc-am" which provides tools to relink URLs in
152 + # documentation to already installed documentation. This decision also
153 + # greatly helps with constantly broken doc generation.
154 # Remember to drop 'doc' USE flag from your package if it was only used to
155 # rebuild docs.
156 - # Preserve old behavior for older EAPI.
157 if grep -q "enable-gtk-doc" "${ECONF_SOURCE:-.}"/configure ; then
158 - if has ${EAPI:-0} 4 && in_iuse doc ; then
159 - g2conf+=( $(use_enable doc gtk-doc) )
160 - else
161 - g2conf+=( --disable-gtk-doc )
162 - fi
163 + g2conf+=( --disable-gtk-doc )
164 fi
165
166 # Pass --disable-maintainer-mode when needed
167 @@ -181,13 +166,6 @@ gnome2_src_configure() {
168 g2conf+=( --disable-scrollkeeper )
169 fi
170
171 - # Pass --disable-silent-rules when possible (not needed since eapi5), bug #429308
172 - if has ${EAPI:-0} 4; then
173 - if grep -q "disable-silent-rules" "${ECONF_SOURCE:-.}"/configure; then
174 - g2conf+=( --disable-silent-rules )
175 - fi
176 - fi
177 -
178 # Pass --disable-schemas-install when possible
179 if grep -q "disable-schemas-install" "${ECONF_SOURCE:-.}"/configure; then
180 g2conf+=( --disable-schemas-install )
181 @@ -209,20 +187,20 @@ gnome2_src_configure() {
182 fi
183
184 # Pass --docdir with proper directory, bug #482646 (not needed since eapi6)
185 - if has ${EAPI:-0} 4 5; then
186 + if has ${EAPI} 5; then
187 if grep -q "^ *--docdir=" "${ECONF_SOURCE:-.}"/configure; then
188 g2conf+=( --docdir="${EPREFIX}"/usr/share/doc/${PF} )
189 fi
190 fi
191
192 # Avoid sandbox violations caused by gnome-vfs (bug #128289 and #345659)
193 - if has ${EAPI:-0} 4 5; then
194 + if has ${EAPI} 5; then
195 addwrite "$(unset HOME; echo ~)/.gnome2"
196 else
197 addpredict "$(unset HOME; echo ~)/.gnome2"
198 fi
199
200 - if has ${EAPI:-0} 4 5; then
201 + if has ${EAPI} 5; then
202 econf ${g2conf[@]} ${G2CONF} "$@"
203 else
204 econf ${g2conf[@]} "$@"
205 @@ -233,7 +211,7 @@ gnome2_src_configure() {
206 # @DESCRIPTION:
207 # Only default src_compile for now
208 gnome2_src_compile() {
209 - if has ${EAPI:-0} 4 5; then
210 + if has ${EAPI} 5; then
211 emake
212 else
213 default
214 @@ -254,7 +232,7 @@ gnome2_src_install() {
215 #
216 # if this is not present, scrollkeeper-update may segfault and
217 # create bogus directories in /var/lib/
218 - if has ${EAPI:-0} 4 5; then
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 || die "install failed"
222 else
223 @@ -266,12 +244,7 @@ gnome2_src_install() {
224 # Handle documentation as 'default' for eapi5, bug #373131
225 # Since eapi6 this is handled by default on its own plus MAINTAINERS and HACKING
226 # files that are really common in gnome packages (bug #573390)
227 - if has ${EAPI:-0} 4; then
228 - # Manual document installation
229 - if [[ -n "${DOCS}" ]]; then
230 - dodoc ${DOCS} || die "dodoc failed"
231 - fi
232 - elif has ${EAPI:-0} 5; then
233 + if has ${EAPI} 5; then
234 einstalldocs
235 else
236 local d
237 @@ -292,20 +265,16 @@ gnome2_src_install() {
238 rm -fr "${ED}/usr/share/applications/mimeinfo.cache"
239
240 # Delete all .la files
241 - if has ${EAPI:-0} 4; then
242 - if [[ "${GNOME2_LA_PUNT}" != "no" ]]; then
243 - ebegin "Removing .la files"
244 - if ! use_if_iuse static-libs ; then
245 - find "${D}" -name '*.la' -exec rm -f {} + || die "la file removal failed"
246 - fi
247 - eend
248 - fi
249 - else
250 + if has ${EAPI} 5 6; then
251 case "${GNOME2_LA_PUNT}" in
252 yes) prune_libtool_files --modules;;
253 no) ;;
254 *) prune_libtool_files;;
255 esac
256 + else
257 + if [[ ${GNOME2_LA_PUNT} != 'no' ]]; then
258 + find "${ED}" -name '*.la' -delete || die
259 + fi
260 fi
261 }
262
263 @@ -315,7 +284,6 @@ gnome2_src_install() {
264 gnome2_pkg_preinst() {
265 xdg_pkg_preinst
266 gnome2_gconf_savelist
267 - gnome2_icon_savelist
268 gnome2_schemas_savelist
269 gnome2_scrollkeeper_savelist
270 gnome2_gdk_pixbuf_savelist
271 @@ -337,9 +305,6 @@ gnome2_pkg_preinst() {
272 gnome2_pkg_postinst() {
273 xdg_pkg_postinst
274 gnome2_gconf_install
275 - if [[ -n ${GNOME2_ECLASS_ICONS} ]]; then
276 - gnome2_icon_cache_update
277 - fi
278 if [[ -n ${GNOME2_ECLASS_GLIB_SCHEMAS} ]]; then
279 gnome2_schemas_update
280 fi
281 @@ -368,9 +333,6 @@ gnome2_pkg_postinst() {
282 # Handle scrollkeeper, GSettings, Icons, desktop and mime database updates.
283 gnome2_pkg_postrm() {
284 xdg_pkg_postrm
285 - if [[ -n ${GNOME2_ECLASS_ICONS} ]]; then
286 - gnome2_icon_cache_update
287 - fi
288 if [[ -n ${GNOME2_ECLASS_GLIB_SCHEMAS} ]]; then
289 gnome2_schemas_update
290 fi