[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gentoo-dev
Subject:    [gentoo-dev] About disabling DISABLE_DEPRECATED
From:       Gilles Dartiguelongue <eva () gentoo ! org>
Date:       2012-09-30 21:44:05
Message-ID: 1349041445.23985.20.camel () kanae
[Download RAW message or body]

Hi all,

as discussed this morning on #-desktop, I found out while reading
commits from April that we have quite a few ebuilds in tree doing this
manually.

The problem is that in those ~153 instances of the same command, some do
take care of problems such as i18n env, some don't, some delete whole
lines, some replace with $(NULL) or even other values.

I think it is high time we provide a reference solution for this, even
if the solution should be to push upstream to fix there build system as
usual.

You'll find in attachement a prototype patch from gnome2-utils eclass.

It does not take care of packages providing
--disable-deprecations{,-flags} on purpose for now since I have not
found a MACRO and hence a reliable way to make sure this works in
upstream tarballs. Some packages do have such configure switch but it
does not always work.

-- 
Gilles Dartiguelongue <eva@gentoo.org>
Gentoo

["deprecation-warnings.patch" (deprecation-warnings.patch)]

Index: eclass/gnome2.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/gnome2.eclass,v
retrieving revision 1.107
diff -u -B -r1.107 gnome2.eclass
--- eclass/gnome2.eclass	27 Sep 2012 16:35:41 -0000	1.107
+++ eclass/gnome2.eclass	30 Sep 2012 09:58:09 -0000
@@ -94,6 +94,9 @@
 	# Prevent scrollkeeper access violations
 	gnome2_omf_fix
 
+	# Disable all deprecation warnings
+	gnome2_disable_deprecation_warning
+
 	# Run libtoolize
 	if has ${EAPI:-0} 0 1 2 3; then
 		elibtoolize ${ELTCONF}
Index: eclass/gnome2-utils.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/gnome2-utils.eclass,v
retrieving revision 1.29
diff -u -B -r1.29 gnome2-utils.eclass
--- eclass/gnome2-utils.eclass	27 Sep 2012 16:35:41 -0000	1.29
+++ eclass/gnome2-utils.eclass	30 Sep 2012 09:59:43 -0000
@@ -424,3 +424,40 @@
 gnome2_query_immodules_gtk3() {
 	"${EPREFIX}/usr/bin/gtk-query-immodules-3.0" --update-cache
 }
+
+# @FUNCTION: gnome2_disable_deprecation_warning
+# @USAGE: gnome2_disable_deprecation_warning
+# @DESCRIPTION:
+# Disable deprecation warnings commonly found in glib based packages.
+# Should be called from src_prepare.
+gnome2_disable_deprecation_warning() {
+	local retval=0
+	local fails=( )
+
+	ebegin "Disabling deprecation warnings"
+	# The sort is important to ensure .am is listed before the respective .in for
+	# maintainer mode regeneration not kicking in due to .am being newer than .in
+	for makefile in $(find "${S}" -name "Makefile.in" \
+		-o -name "Makefile.am" -o -name "Makefile.decl" | sort); do
+
+		if ! grep -qE "(DISABLE_DEPRECATED|GSEAL_ENABLE)" "${makefile}"; then
+			continue
+		fi
+
+		LC_ALL=C sed -e 's:-D[A-Z_]\+_DISABLE_DEPRECATED:$(NULL):g' \
+			-e 's:-DGSEAL_ENABLE:$(NULL):g' \
+			-i "${makefile}"
+
+		if [[ $? -ne 0 ]]; then
+			# Add to the list of failures
+			fails[$(( ${#fails[@]} + 1 ))]="${makefile}"
+
+			retval=2
+		fi
+	done
+	eend ${retval}
+
+	for makefile in "${fails[@]}" ; do
+		eerror "Failed to disable deprecation warnings in $makefile"
+	done
+}


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic