Gentoo Archives: gentoo-commits

From: Gilles Dartiguelongue <eva@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/gnome:master commit in: eclass/
Date: Mon, 05 Sep 2016 22:06:00
Message-Id: 1473111081.4f37fde27700ee6f07923cedf2996b889336862a.eva@gentoo
1 commit: 4f37fde27700ee6f07923cedf2996b889336862a
2 Author: Gilles Dartiguelongue <eva <AT> gentoo <DOT> org>
3 AuthorDate: Mon Sep 5 21:29:37 2016 +0000
4 Commit: Gilles Dartiguelongue <eva <AT> gentoo <DOT> org>
5 CommitDate: Mon Sep 5 21:31:21 2016 +0000
6 URL: https://gitweb.gentoo.org/proj/gnome.git/commit/?id=4f37fde2
7
8 eclass: sync with gentoo
9
10 eclass/gnome2-utils.eclass | 43 ++++++++++-
11 eclass/gnome2.eclass | 181 ++++++++++++++++++++++++++++++++-------------
12 eclass/vala.eclass | 10 +--
13 3 files changed, 174 insertions(+), 60 deletions(-)
14
15 diff --git a/eclass/gnome2-utils.eclass b/eclass/gnome2-utils.eclass
16 index 83a3610..63855da 100644
17 --- a/eclass/gnome2-utils.eclass
18 +++ b/eclass/gnome2-utils.eclass
19 @@ -15,10 +15,11 @@
20 # * GConf schemas management
21 # * scrollkeeper (old Gnome help system) management
22
23 -inherit eutils multilib xdg-utils
24 +[[ ${EAPI:-0} == [012345] ]] && inherit multilib
25 +inherit eutils xdg-utils
26
27 case "${EAPI:-0}" in
28 - 0|1|2|3|4|5) ;;
29 + 0|1|2|3|4|5|6) ;;
30 *) die "EAPI=${EAPI} is not supported" ;;
31 esac
32
33 @@ -97,6 +98,17 @@ gnome2_environment_reset() {
34
35 # GST_REGISTRY is to work around gst utilities trying to read/write /root
36 export GST_REGISTRY="${T}/registry.xml"
37 +
38 + # Ensure we don't rely on dconf/gconf while building, bug #511946
39 + export GSETTINGS_BACKEND="memory"
40 +
41 + if has ${EAPI:-0} 6; then
42 + # Try to cover the packages honoring this variable, bug #508124
43 + export GST_INSPECT="$(type -P true)"
44 +
45 + # Stop relying on random DISPLAY variable values, bug #534312
46 + unset DISPLAY
47 + fi
48 }
49
50 # @FUNCTION: gnome2_gconf_savelist
51 @@ -457,6 +469,29 @@ gnome2_query_immodules_gtk3() {
52 eend $?
53 }
54
55 +# @FUNCTION: gnome2_giomodule_cache_update
56 +# @USAGE: gnome2_giomodule_cache_update
57 +# @DESCRIPTION:
58 +# Updates glib's gio modules cache.
59 +# This function should be called from pkg_postinst and pkg_postrm.
60 +gnome2_giomodule_cache_update() {
61 + has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
62 + local updater="${EROOT}/usr/bin/${CHOST}-gio-querymodules"
63 +
64 + if [[ ! -x ${updater} ]]; then
65 + updater="${EROOT}/usr/bin/gio-querymodules"
66 + fi
67 +
68 + if [[ ! -x ${updater} ]]; then
69 + debug-print "${updater} is not executable"
70 + return
71 + fi
72 +
73 + ebegin "Updating GIO modules cache"
74 + ${updater} "${EROOT%/}"/usr/$(get_libdir)/gio/modules
75 + eend $?
76 +}
77 +
78 # @FUNCTION: gnome2_disable_deprecation_warning
79 # @DESCRIPTION:
80 # Disable deprecation warnings commonly found in glib based packages.
81 @@ -475,8 +510,8 @@ gnome2_disable_deprecation_warning() {
82 fi
83
84 LC_ALL=C sed -r -i \
85 - -e 's:-D[A-Z_]+_DISABLE_DEPRECATED:$(NULL):g' \
86 - -e 's:-DGSEAL_ENABLE+[A-Z_]:$(NULL):g' \
87 + -e 's:-D[A-Z_]+_DISABLE_DEPRECATED:$(/bin/true):g' \
88 + -e 's:-DGSEAL_ENABLE(=[A-Za-z0-9_]*)?:$(/bin/true):g' \
89 -i "${makefile}"
90
91 if [[ $? -ne 0 ]]; then
92
93 diff --git a/eclass/gnome2.eclass b/eclass/gnome2.eclass
94 index ed233b0..45d1d63 100644
95 --- a/eclass/gnome2.eclass
96 +++ b/eclass/gnome2.eclass
97 @@ -16,25 +16,18 @@ case "${EAPI:-0}" in
98 4|5)
99 EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_install pkg_preinst pkg_postinst pkg_postrm
100 ;;
101 + 6)
102 + EXPORT_FUNCTIONS src_prepare src_configure src_compile src_install pkg_preinst pkg_postinst pkg_postrm
103 + ;;
104 *) die "EAPI=${EAPI} is not supported" ;;
105 esac
106
107 -# @ECLASS-VARIABLE: G2CONF
108 +# @ECLASS-VARIABLE: DOCS
109 # @DEFAULT_UNSET
110 # @DESCRIPTION:
111 -# Extra configure opts passed to econf.
112 -# Deprecated, pass extra arguments to gnome2_src_configure.
113 -G2CONF=${G2CONF:-""}
114 -
115 -# @ECLASS-VARIABLE: GNOME2_LA_PUNT
116 -# @DESCRIPTION:
117 -# Should we delete ALL the .la files?
118 -# NOT to be used without due consideration.
119 -if has ${EAPI:-0} 4; then
120 - GNOME2_LA_PUNT=${GNOME2_LA_PUNT:-"no"}
121 -else
122 - GNOME2_LA_PUNT=${GNOME2_LA_PUNT:-""}
123 -fi
124 +# String containing documents passed to dodoc command for eapi4.
125 +# In eapi5 we rely on einstalldocs (from eutils.eclass) and for newer EAPIs we
126 +# follow PMS spec.
127
128 # @ECLASS-VARIABLE: ELTCONF
129 # @DEFAULT_UNSET
130 @@ -42,10 +35,15 @@ fi
131 # Extra options passed to elibtoolize
132 ELTCONF=${ELTCONF:-""}
133
134 -# @ECLASS-VARIABLE: DOCS
135 +# @ECLASS-VARIABLE: G2CONF
136 # @DEFAULT_UNSET
137 # @DESCRIPTION:
138 -# String containing documents passed to dodoc command.
139 +# Extra configure opts passed to econf.
140 +# Deprecated, pass extra arguments to gnome2_src_configure.
141 +# Banned in eapi6 and newer.
142 +if has ${EAPI:-0} 4 5; then
143 + G2CONF=${G2CONF:-""}
144 +fi
145
146 # @ECLASS-VARIABLE: GCONF_DEBUG
147 # @DEFAULT_UNSET
148 @@ -56,18 +54,44 @@ ELTCONF=${ELTCONF:-""}
149 # harder. This variable should be set to yes for such packages for the eclass
150 # to handle it properly. It will enable minimal debug with USE=-debug.
151 # Note that this is most commonly found in configure.ac as GNOME_DEBUG_CHECK.
152 +#
153 +# Banned since eapi6 as upstream is moving away from this obsolete macro in favor
154 +# of autoconf-archive macros, that do not expose this issue (bug #270919)
155 +if has ${EAPI:-0} 4 5; then
156 + if [[ ${GCONF_DEBUG} != "no" ]]; then
157 + IUSE="debug"
158 + fi
159 +fi
160 +
161 +# @ECLASS-VARIABLE: GNOME2_ECLASS_GIO_MODULES
162 +# @INTERNAL
163 +# @DESCRIPTION:
164 +# Array containing glib GIO modules
165
166 -
167 -if [[ ${GCONF_DEBUG} != "no" ]]; then
168 - IUSE="debug"
169 +# @ECLASS-VARIABLE: GNOME2_LA_PUNT
170 +# @DESCRIPTION:
171 +# For eapi4 it sets if we should delete ALL or none of the .la files
172 +# For eapi5 and newer it relies on prune_libtool_files (from eutils.eclass)
173 +# for this. Available values for GNOME2_LA_PUNT:
174 +# - "no": will not clean any .la files
175 +# - "yes": will run prune_libtool_files --modules
176 +# - If it is not set, it will run prune_libtool_files
177 +if has ${EAPI:-0} 4; then
178 + GNOME2_LA_PUNT=${GNOME2_LA_PUNT:-"no"}
179 +else
180 + GNOME2_LA_PUNT=${GNOME2_LA_PUNT:-""}
181 fi
182
183 # @FUNCTION: gnome2_src_unpack
184 # @DESCRIPTION:
185 # Stub function for old EAPI.
186 gnome2_src_unpack() {
187 - unpack ${A}
188 - cd "${S}"
189 + if has ${EAPI:-0} 4 5; then
190 + unpack ${A}
191 + cd "${S}"
192 + else
193 + die "gnome2_src_unpack is banned from eapi6"
194 + fi
195 }
196
197 # @FUNCTION: gnome2_src_prepare
198 @@ -81,36 +105,43 @@ gnome2_src_prepare() {
199 gnome2_environment_reset
200
201 # Prevent scrollkeeper access violations
202 - gnome2_omf_fix
203 + # We stop to run it from eapi6 as scrollkeeper helpers from
204 + # rarian are not running anything and, then, access violations
205 + # shouldn't occur.
206 + has ${EAPI:-0} 4 5 && gnome2_omf_fix
207
208 # Disable all deprecation warnings
209 gnome2_disable_deprecation_warning
210
211 # Run libtoolize
212 - # Everything is fatal EAPI 4 onwards
213 - nonfatal elibtoolize ${ELTCONF}
214 + # https://bugzilla.gnome.org/show_bug.cgi?id=655517
215 + elibtoolize ${ELTCONF}
216 }
217
218 # @FUNCTION: gnome2_src_configure
219 # @DESCRIPTION:
220 # Gnome specific configure handling
221 gnome2_src_configure() {
222 - # Need to catch all offenders before switching behavior
223 - if [[ -z ${GCONF_DEBUG} ]] ; then
224 - eqawarn "GCONF_DEBUG not set, please review documentation at https://wiki.gentoo.org/wiki/Project:GNOME/Gnome_Team_Ebuild_Policies#GCONF_DEBUG"
225 - fi
226 -
227 - # Deprecated for a long time now, see Gnome team policies
228 + # Deprecated for a long time now and banned since eapi6, see Gnome team policies
229 if [[ -n ${G2CONF} ]] ; then
230 - eqawarn "G2CONF set, please review documentation at https://wiki.gentoo.org/wiki/Project:GNOME/Gnome_Team_Ebuild_Policies#G2CONF_and_src_configure"
231 + if has ${EAPI:-0} 4 5; then
232 + eqawarn "G2CONF set, please review documentation at https://wiki.gentoo.org/wiki/Project:GNOME/Gnome_Team_Ebuild_Policies#G2CONF_and_src_configure"
233 + else
234 + die "G2CONF set, please review documentation at https://wiki.gentoo.org/wiki/Project:GNOME/Gnome_Team_Ebuild_Policies#G2CONF_and_src_configure"
235 + fi
236 fi
237
238 local g2conf=()
239
240 - # Update the GNOME configuration options
241 - if [[ ${GCONF_DEBUG} != 'no' ]] ; then
242 - if use debug ; then
243 - g2conf+=( --enable-debug=yes )
244 + if has ${EAPI:-0} 4 5; then
245 + if [[ ${GCONF_DEBUG} != 'no' ]] ; then
246 + if use debug ; then
247 + g2conf+=( --enable-debug=yes )
248 + fi
249 + fi
250 + else
251 + if [[ -n ${GCONF_DEBUG} ]] ; then
252 + die "GCONF_DEBUG is banned since eapi6 in favor of each ebuild taking care of the proper handling of debug configure option"
253 fi
254 fi
255
256 @@ -140,7 +171,7 @@ gnome2_src_configure() {
257 g2conf+=( --disable-scrollkeeper )
258 fi
259
260 - # Pass --disable-silent-rules when possible (not needed for eapi5), bug #429308
261 + # Pass --disable-silent-rules when possible (not needed since eapi5), bug #429308
262 if has ${EAPI:-0} 4; then
263 if grep -q "disable-silent-rules" "${ECONF_SOURCE:-.}"/configure; then
264 g2conf+=( --disable-silent-rules )
265 @@ -157,27 +188,46 @@ gnome2_src_configure() {
266 g2conf+=( --disable-schemas-compile )
267 fi
268
269 + # Pass --disable-update-mimedb when possible
270 + if grep -q "disable-update-mimedb" "${ECONF_SOURCE:-.}"/configure; then
271 + g2conf+=( --disable-update-mimedb )
272 + fi
273 +
274 # Pass --enable-compile-warnings=minimum as we don't want -Werror* flags, bug #471336
275 if grep -q "enable-compile-warnings" "${ECONF_SOURCE:-.}"/configure; then
276 g2conf+=( --enable-compile-warnings=minimum )
277 fi
278
279 - # Pass --docdir with proper directory, bug #482646
280 - if grep -q "^ *--docdir=" "${ECONF_SOURCE:-.}"/configure; then
281 - g2conf+=( --docdir="${EPREFIX}"/usr/share/doc/${PF} )
282 + # Pass --docdir with proper directory, bug #482646 (not needed since eapi6)
283 + if has ${EAPI:-0} 4 5; then
284 + if grep -q "^ *--docdir=" "${ECONF_SOURCE:-.}"/configure; then
285 + g2conf+=( --docdir="${EPREFIX}"/usr/share/doc/${PF} )
286 + fi
287 fi
288
289 # Avoid sandbox violations caused by gnome-vfs (bug #128289 and #345659)
290 - addwrite "$(unset HOME; echo ~)/.gnome2"
291 + if has ${EAPI:-0} 4 5; then
292 + addwrite "$(unset HOME; echo ~)/.gnome2"
293 + else
294 + addpredict "$(unset HOME; echo ~)/.gnome2"
295 + fi
296
297 - econf ${g2conf[@]} ${G2CONF} "$@"
298 + if has ${EAPI:-0} 4 5; then
299 + econf ${g2conf[@]} ${G2CONF} "$@"
300 + else
301 + econf ${g2conf[@]} "$@"
302 + fi
303 }
304
305 # @FUNCTION: gnome2_src_compile
306 # @DESCRIPTION:
307 # Only default src_compile for now
308 gnome2_src_compile() {
309 - emake
310 + if has ${EAPI:-0} 4 5; then
311 + emake
312 + else
313 + default
314 + fi
315 }
316
317 # @FUNCTION: gnome2_src_install
318 @@ -185,27 +235,39 @@ gnome2_src_compile() {
319 # Gnome specific install. Handles typical GConf and scrollkeeper setup
320 # in packages and removal of .la files if requested
321 gnome2_src_install() {
322 - # if this is not present, scrollkeeper-update may segfault and
323 - # create bogus directories in /var/lib/
324 - local sk_tmp_dir="/var/lib/scrollkeeper"
325 - dodir "${sk_tmp_dir}" || die "dodir failed"
326 -
327 # we must delay gconf schema installation due to sandbox
328 export GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL="1"
329
330 - debug-print "Installing with 'make install'"
331 - emake DESTDIR="${D}" "scrollkeeper_localstate_dir=${ED}${sk_tmp_dir} " "$@" install || die "install failed"
332 + local sk_tmp_dir="/var/lib/scrollkeeper"
333 + # scrollkeeper-update from rarian doesn't do anything. Then, since eapi6
334 + # we stop taking care of it
335 + #
336 + # if this is not present, scrollkeeper-update may segfault and
337 + # create bogus directories in /var/lib/
338 + if has ${EAPI:-0} 4 5; then
339 + dodir "${sk_tmp_dir}" || die "dodir failed"
340 + emake DESTDIR="${D}" "scrollkeeper_localstate_dir=${ED}${sk_tmp_dir} " "$@" install || die "install failed"
341 + else
342 + default
343 + fi
344
345 unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL
346
347 - # Handle documentation as 'default' for eapi5 and newer, bug #373131
348 + # Handle documentation as 'default' for eapi5, bug #373131
349 + # Since eapi6 this is handled by default on its own plus MAINTAINERS and HACKING
350 + # files that are really common in gnome packages (bug #573390)
351 if has ${EAPI:-0} 4; then
352 # Manual document installation
353 if [[ -n "${DOCS}" ]]; then
354 dodoc ${DOCS} || die "dodoc failed"
355 fi
356 - else
357 + elif has ${EAPI:-0} 5; then
358 einstalldocs
359 + else
360 + local d
361 + for d in HACKING MAINTAINERS; do
362 + [[ -s "${d}" ]] && dodoc "${d}"
363 + done
364 fi
365
366 # Do not keep /var/lib/scrollkeeper because:
367 @@ -247,6 +309,15 @@ gnome2_pkg_preinst() {
368 gnome2_schemas_savelist
369 gnome2_scrollkeeper_savelist
370 gnome2_gdk_pixbuf_savelist
371 +
372 + local f
373 +
374 + GNOME2_ECLASS_GIO_MODULES=()
375 + while IFS= read -r -d '' f; do
376 + GNOME2_ECLASS_GIO_MODULES+=( ${f} )
377 + done < <(cd "${D}" && find usr/$(get_libdir)/gio/modules -type f -print0 2>/dev/null)
378 +
379 + export GNOME2_ECLASS_GIO_MODULES
380 }
381
382 # @FUNCTION: gnome2_pkg_postinst
383 @@ -261,6 +332,10 @@ gnome2_pkg_postinst() {
384 gnome2_scrollkeeper_update
385 gnome2_gdk_pixbuf_update
386
387 + if [[ ${#GNOME2_ECLASS_GIO_MODULES[@]} -gt 0 ]]; then
388 + gnome2_giomodule_cache_update
389 + fi
390 +
391 # This should only be in the overlay
392 ewarn "**************************************************************"
393 ewarn "This is the *experimental* Gentoo GNOME Overlay"
394 @@ -282,4 +357,8 @@ gnome2_pkg_postrm() {
395 gnome2_icon_cache_update
396 gnome2_schemas_update
397 gnome2_scrollkeeper_update
398 +
399 + if [[ ${#GNOME2_ECLASS_GIO_MODULES[@]} -gt 0 ]]; then
400 + gnome2_giomodule_cache_update
401 + fi
402 }
403
404 diff --git a/eclass/vala.eclass b/eclass/vala.eclass
405 index 895743b..a70c9d8 100644
406 --- a/eclass/vala.eclass
407 +++ b/eclass/vala.eclass
408 @@ -26,13 +26,13 @@ esac
409
410 # @ECLASS-VARIABLE: VALA_MIN_API_VERSION
411 # @DESCRIPTION:
412 -# Minimum vala API version (e.g. 0.20).
413 -VALA_MIN_API_VERSION=${VALA_MIN_API_VERSION:-0.20}
414 +# Minimum vala API version (e.g. 0.26).
415 +VALA_MIN_API_VERSION=${VALA_MIN_API_VERSION:-0.26}
416
417 # @ECLASS-VARIABLE: VALA_MAX_API_VERSION
418 # @DESCRIPTION:
419 -# Maximum vala API version (e.g. 0.30).
420 -VALA_MAX_API_VERSION=${VALA_MAX_API_VERSION:-0.30}
421 +# Maximum vala API version (e.g. 0.32).
422 +VALA_MAX_API_VERSION=${VALA_MAX_API_VERSION:-0.32}
423
424 # @ECLASS-VARIABLE: VALA_USE_DEPEND
425 # @DEFAULT_UNSET
426 @@ -50,7 +50,7 @@ vala_api_versions() {
427 local minimal_supported_minor_version minor_version
428
429 # Dependency atoms are not generated for Vala versions older than 0.${minimal_supported_minor_version}.
430 - minimal_supported_minor_version="20"
431 + minimal_supported_minor_version="26"
432
433 for ((minor_version = ${VALA_MAX_API_VERSION#*.}; minor_version >= ${VALA_MIN_API_VERSION#*.}; minor_version = minor_version - 2)); do
434 if ((minor_version >= minimal_supported_minor_version)); then