From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 62406138010 for ; Sun, 30 Sep 2012 21:45:45 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id DC02A21C099; Sun, 30 Sep 2012 21:45:21 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 3C09021C098 for ; Sun, 30 Sep 2012 21:44:11 +0000 (UTC) Received: from [192.168.0.53] (nsg93-9-78-225-4-220.fbx.proxad.net [78.225.4.220]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: eva) by smtp.gentoo.org (Postfix) with ESMTPSA id 3706E33D768 for ; Sun, 30 Sep 2012 21:44:10 +0000 (UTC) Message-ID: <1349041445.23985.20.camel@kanae> Subject: [gentoo-dev] About disabling DISABLE_DEPRECATED From: Gilles Dartiguelongue To: gentoo-dev@lists.gentoo.org Date: Sun, 30 Sep 2012 23:44:05 +0200 Organization: Gentoo Content-Type: multipart/mixed; boundary="=-WEoJVOsr1i/8Fctk/CVB" X-Mailer: Evolution 3.4.4 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org Mime-Version: 1.0 X-Archives-Salt: 991905ff-80f1-43be-b0ed-7b412900ad42 X-Archives-Hash: 3d5f78203bf00858f7e99b83c72b3e7e --=-WEoJVOsr1i/8Fctk/CVB Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit 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 Gentoo --=-WEoJVOsr1i/8Fctk/CVB Content-Disposition: attachment; filename="deprecation-warnings.patch" Content-Type: text/x-patch; name="deprecation-warnings.patch"; charset="UTF-8" Content-Transfer-Encoding: 7bit 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 +} --=-WEoJVOsr1i/8Fctk/CVB--