gnome2.eclass: G2CONF usage now triggers eqawarn
authorGilles Dartiguelongue <eva@gentoo.org>
Sat, 21 Nov 2015 11:00:08 +0000 (12:00 +0100)
committerGilles Dartiguelongue <eva@gentoo.org>
Tue, 24 Nov 2015 21:56:23 +0000 (22:56 +0100)
According to our policy and to make tracking last offenders easier.

eclass/gnome2.eclass

index 4bbe0097d92a7b9ee398a2f7c50913e0b8ec2865..000b3d65d45c99d1b85065fdaa808403eb2c2106 100644 (file)
@@ -22,7 +22,8 @@ esac
 # @ECLASS-VARIABLE: G2CONF
 # @DEFAULT_UNSET
 # @DESCRIPTION:
-# Extra configure opts passed to econf
+# Extra configure opts passed to econf.
+# Deprecated, pass extra arguments to gnome2_src_configure.
 G2CONF=${G2CONF:-""}
 
 # @ECLASS-VARIABLE: GNOME2_LA_PUNT
@@ -93,10 +94,17 @@ gnome2_src_prepare() {
 # @DESCRIPTION:
 # Gnome specific configure handling
 gnome2_src_configure() {
+       # Deprecated for a long time now, see Gnome team policies
+       if [[ -n ${G2CONF} ]] ; then
+               eqawarn "G2CONF set, please review documentation at https://wiki.gentoo.org/wiki/Project:GNOME/Gnome_Team_Ebuild_Policies#G2CONF_and_src_configure"
+       fi
+
+       local g2conf=()
+
        # Update the GNOME configuration options
        if [[ ${GCONF_DEBUG} != 'no' ]] ; then
                if use debug ; then
-                       G2CONF="--enable-debug=yes ${G2CONF}"
+                       g2conf+=( --enable-debug=yes )
                fi
        fi
 
@@ -109,54 +117,54 @@ gnome2_src_configure() {
        # Preserve old behavior for older EAPI.
        if grep -q "enable-gtk-doc" "${ECONF_SOURCE:-.}"/configure ; then
                if has ${EAPI:-0} 4 && in_iuse doc ; then
-                       G2CONF="$(use_enable doc gtk-doc) ${G2CONF}"
+                       g2conf+=( $(use_enable doc gtk-doc) )
                else
-                       G2CONF="--disable-gtk-doc ${G2CONF}"
+                       g2conf+=( --disable-gtk-doc )
                fi
        fi
 
        # Pass --disable-maintainer-mode when needed
        if grep -q "^[[:space:]]*AM_MAINTAINER_MODE(\[enable\])" \
                "${ECONF_SOURCE:-.}"/configure.*; then
-               G2CONF="--disable-maintainer-mode ${G2CONF}"
+               g2conf+=( --disable-maintainer-mode )
        fi
 
        # Pass --disable-scrollkeeper when possible
        if grep -q "disable-scrollkeeper" "${ECONF_SOURCE:-.}"/configure; then
-               G2CONF="--disable-scrollkeeper ${G2CONF}"
+               g2conf+=( --disable-scrollkeeper )
        fi
 
        # Pass --disable-silent-rules when possible (not needed for eapi5), bug #429308
        if has ${EAPI:-0} 4; then
                if grep -q "disable-silent-rules" "${ECONF_SOURCE:-.}"/configure; then
-                       G2CONF="--disable-silent-rules ${G2CONF}"
+                       g2conf+=( --disable-silent-rules )
                fi
        fi
 
        # Pass --disable-schemas-install when possible
        if grep -q "disable-schemas-install" "${ECONF_SOURCE:-.}"/configure; then
-               G2CONF="--disable-schemas-install ${G2CONF}"
+               g2conf+=( --disable-schemas-install )
        fi
 
        # Pass --disable-schemas-compile when possible
        if grep -q "disable-schemas-compile" "${ECONF_SOURCE:-.}"/configure; then
-               G2CONF="--disable-schemas-compile ${G2CONF}"
+               g2conf+=( --disable-schemas-compile )
        fi
 
        # Pass --enable-compile-warnings=minimum as we don't want -Werror* flags, bug #471336
        if grep -q "enable-compile-warnings" "${ECONF_SOURCE:-.}"/configure; then
-               G2CONF="--enable-compile-warnings=minimum ${G2CONF}"
+               g2conf+=( --enable-compile-warnings=minimum )
        fi
 
        # Pass --docdir with proper directory, bug #482646
        if grep -q "^ *--docdir=" "${ECONF_SOURCE:-.}"/configure; then
-               G2CONF="--docdir="${EPREFIX}"/usr/share/doc/${PF} ${G2CONF}"
+               g2conf+=( --docdir="${EPREFIX}"/usr/share/doc/${PF} )
        fi
 
        # Avoid sandbox violations caused by gnome-vfs (bug #128289 and #345659)
        addwrite "$(unset HOME; echo ~)/.gnome2"
 
-       econf ${G2CONF} "$@"
+       econf ${g2conf[@]} ${G2CONF} "$@"
 }
 
 # @FUNCTION: gnome2_src_compile