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 135AA13881E for ; Wed, 11 Dec 2013 23:44:27 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 77B91E0B8B; Wed, 11 Dec 2013 23:44:26 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 99CCAE0B13 for ; Wed, 11 Dec 2013 23:44:25 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 9495133F412 for ; Wed, 11 Dec 2013 23:44:24 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 45598D0052 for ; Wed, 11 Dec 2013 23:44:23 +0000 (UTC) From: "Gilles Dartiguelongue" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Gilles Dartiguelongue" Message-ID: <1386805424.6e514c4c1a602f3a97e276f6e07084561f3ae897.eva@gentoo> Subject: [gentoo-commits] proj/gnome:master commit in: eclass/ X-VCS-Repository: proj/gnome X-VCS-Files: eclass/gnome2-utils.eclass eclass/gnome2.eclass X-VCS-Directories: eclass/ X-VCS-Committer: eva X-VCS-Committer-Name: Gilles Dartiguelongue X-VCS-Revision: 6e514c4c1a602f3a97e276f6e07084561f3ae897 X-VCS-Branch: master Date: Wed, 11 Dec 2013 23:44:23 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 95769994-f1b4-4d3b-8f0e-60623b0865f3 X-Archives-Hash: b1e22ea7a67ad879890ca78a202a0182 commit: 6e514c4c1a602f3a97e276f6e07084561f3ae897 Author: Gilles Dartiguelongue gentoo org> AuthorDate: Wed Dec 11 23:41:34 2013 +0000 Commit: Gilles Dartiguelongue gentoo org> CommitDate: Wed Dec 11 23:43:44 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gnome.git;a=commit;h=6e514c4c eclass: sync with gentoo-x86 --- eclass/gnome2-utils.eclass | 98 ++++++++++++++++++++++++++++++++++++---------- eclass/gnome2.eclass | 31 +++++++-------- 2 files changed, 92 insertions(+), 37 deletions(-) diff --git a/eclass/gnome2-utils.eclass b/eclass/gnome2-utils.eclass index 2da7528..a70e322 100644 --- a/eclass/gnome2-utils.eclass +++ b/eclass/gnome2-utils.eclass @@ -1,6 +1,6 @@ -# Copyright 1999-2012 Gentoo Foundation +# Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/gnome2-utils.eclass,v 1.31 2012/10/27 22:24:10 tetromino Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/gnome2-utils.eclass,v 1.33 2013/09/15 19:29:11 pacho Exp $ # @ECLASS: gnome2-utils.eclass # @MAINTAINER: @@ -15,6 +15,8 @@ # * GConf schemas management # * scrollkeeper (old Gnome help system) management +inherit multilib + case "${EAPI:-0}" in 0|1|2|3|4|5) ;; *) die "EAPI=${EAPI} is not supported" ;; @@ -50,6 +52,12 @@ esac # Path to glib-compile-schemas : ${GLIB_COMPILE_SCHEMAS:="/usr/bin/glib-compile-schemas"} +# @ECLASS-VARIABLE: GDK_PIXBUF_UPDATE_BIN +# @INTERNAL +# @DESCRIPTION: +# Path to gdk-pixbuf-query-loaders +: ${GDK_PIXBUF_UPDATE_BIN:="/usr/bin/gdk-pixbuf-query-loaders"} + # @ECLASS-VARIABLE: GNOME2_ECLASS_SCHEMAS # @INTERNAL # @DEFAULT_UNSET @@ -74,6 +82,12 @@ esac # @DESCRIPTION: # List of GSettings schemas provided by the package +# @ECLASS-VARIABLE: GNOME2_ECLASS_GDK_PIXBUF_LOADERS +# @INTERNAL +# @DEFAULT_UNSET +# @DESCRIPTION: +# List of gdk-pixbuf loaders provided by the package + DEPEND=">=sys-apps/sed-4" @@ -387,34 +401,78 @@ gnome2_schemas_update() { eend $? } +# @FUNCTION: gnome2_gdk_pixbuf_savelist +# @DESCRIPTION: +# Find if there is any gdk-pixbuf loader to install and save the list in +# GNOME2_ECLASS_GDK_PIXBUF_LOADERS variable. +# This function should be called from pkg_preinst. +gnome2_gdk_pixbuf_savelist() { + has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}" + pushd "${ED}" 1>/dev/null + export GNOME2_ECLASS_GDK_PIXBUF_LOADERS=$(find "usr/$(get_libdir)/gdk-pixbuf-2.0" -type f 2>/dev/null) + popd 1>/dev/null +} + +# @FUNCTION: gnome2_gdk_pixbuf_update +# @USAGE: gnome2_gdk_pixbuf_update +# @DESCRIPTION: +# Updates gdk-pixbuf loader cache if GNOME2_ECLASS_GDK_PIXBUF_LOADERS has some. +# This function should be called from pkg_postinst and pkg_postrm. +gnome2_gdk_pixbuf_update() { + has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}" + local updater="${EROOT}${GDK_PIXBUF_UPDATE_BIN}" + + if [[ ! -x ${updater} ]]; then + debug-print "${updater} is not executable" + return + fi + + if [[ -z ${GNOME2_ECLASS_GDK_PIXBUF_LOADERS} ]]; then + debug-print "gdk-pixbuf loader cache does not need an update" + return + fi + + ebegin "Updating gdk-pixbuf loader cache" + local tmp_file=$(mktemp -t tmp.XXXXXXXXXX_gdkpixbuf) + ${updater} 1> "${tmp_file}" && + chmod 0644 "${tmp_file}" && + mv -f "${tmp_file}" "${EROOT}usr/$(get_libdir)/gdk-pixbuf-2.0/2.10.0/loaders.cache" + eend $? +} + + # @FUNCTION: gnome2_query_immodules_gtk2 # @USAGE: gnome2_query_immodules_gtk2 # @DESCRIPTION: # Updates gtk2 immodules/gdk-pixbuf loaders listing. gnome2_query_immodules_gtk2() { - local GTK2_CONFDIR="/etc/gtk-2.0/$(get_abi_CHOST)" + if has_version ">=x11-libs/gtk+-2.24.20:2"; then + "${EPREFIX}/usr/bin/gtk-query-immodules-2.0" --update-cache + else + local GTK2_CONFDIR="/etc/gtk-2.0/$(get_abi_CHOST)" - local query_exec="${EPREFIX}/usr/bin/gtk-query-immodules-2.0" - local gtk_conf="${EPREFIX}${GTK2_CONFDIR}/gtk.immodules" - local gtk_conf_dir=$(dirname "${gtk_conf}") + local query_exec="${EPREFIX}/usr/bin/gtk-query-immodules-2.0" + local gtk_conf="${EPREFIX}${GTK2_CONFDIR}/gtk.immodules" + local gtk_conf_dir=$(dirname "${gtk_conf}") - einfo "Generating Gtk2 immodules/gdk-pixbuf loaders listing:" - einfo "-> ${gtk_conf}" + einfo "Generating Gtk2 immodules/gdk-pixbuf loaders listing:" + einfo "-> ${gtk_conf}" - mkdir -p "${gtk_conf_dir}" - local tmp_file=$(mktemp -t tmp.XXXXXXXXXXgtk_query_immodules) - if [ -z "${tmp_file}" ]; then - ewarn "gtk_query_immodules: cannot create temporary file" - return 1 - fi + mkdir -p "${gtk_conf_dir}" + local tmp_file=$(mktemp -t tmp.XXXXXXXXXXgtk_query_immodules) + if [ -z "${tmp_file}" ]; then + ewarn "gtk_query_immodules: cannot create temporary file" + return 1 + fi - if ${query_exec} > "${tmp_file}"; then - cat "${tmp_file}" > "${gtk_conf}" || \ - ewarn "Failed to write to ${gtk_conf}" - else - ewarn "Cannot update gtk.immodules, file generation failed" + if ${query_exec} > "${tmp_file}"; then + cat "${tmp_file}" > "${gtk_conf}" || \ + ewarn "Failed to write to ${gtk_conf}" + else + ewarn "Cannot update gtk.immodules, file generation failed" + fi + rm "${tmp_file}" fi - rm "${tmp_file}" } # @FUNCTION: gnome2_query_immodules_gtk3 diff --git a/eclass/gnome2.eclass b/eclass/gnome2.eclass index 53ffe22..af95a5b 100644 --- a/eclass/gnome2.eclass +++ b/eclass/gnome2.eclass @@ -150,7 +150,7 @@ gnome2_src_configure() { # Remember to drop 'doc' USE flag from your package if it was only used to # rebuild docs. # Preserve old behavior for older EAPI. - if grep -q "enable-gtk-doc" ${ECONF_SOURCE:-.}/configure ; then + if grep -q "enable-gtk-doc" "${ECONF_SOURCE:-.}"/configure ; then if has ${EAPI:-0} 0 1 2 3 4 && in_iuse doc ; then G2CONF="$(use_enable doc gtk-doc) ${G2CONF}" else @@ -160,32 +160,37 @@ gnome2_src_configure() { # Pass --disable-maintainer-mode when needed if grep -q "^[[:space:]]*AM_MAINTAINER_MODE(\[enable\])" \ - ${ECONF_SOURCE:-.}/configure.*; then + "${ECONF_SOURCE:-.}"/configure.*; then G2CONF="--disable-maintainer-mode ${G2CONF}" fi # Pass --disable-scrollkeeper when possible - if grep -q "disable-scrollkeeper" ${ECONF_SOURCE:-.}/configure; then + if grep -q "disable-scrollkeeper" "${ECONF_SOURCE:-.}"/configure; then G2CONF="--disable-scrollkeeper ${G2CONF}" fi # Pass --disable-silent-rules when possible (not needed for eapi5), bug #429308 if has ${EAPI:-0} 0 1 2 3 4; then - if grep -q "disable-silent-rules" ${ECONF_SOURCE:-.}/configure; then + if grep -q "disable-silent-rules" "${ECONF_SOURCE:-.}"/configure; then G2CONF="--disable-silent-rules ${G2CONF}" fi fi # Pass --disable-schemas-install when possible - if grep -q "disable-schemas-install" ${ECONF_SOURCE:-.}/configure; then + if grep -q "disable-schemas-install" "${ECONF_SOURCE:-.}"/configure; then G2CONF="--disable-schemas-install ${G2CONF}" fi # Pass --disable-schemas-compile when possible - if grep -q "disable-schemas-compile" ${ECONF_SOURCE:-.}/configure; then + if grep -q "disable-schemas-compile" "${ECONF_SOURCE:-.}"/configure; then G2CONF="--disable-schemas-compile ${G2CONF}" 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}" + fi + # Avoid sandbox violations caused by gnome-vfs (bug #128289 and #345659) addwrite "$(unset HOME; echo ~)/.gnome2" @@ -231,17 +236,7 @@ gnome2_src_install() { dodoc ${DOCS} || die "dodoc failed" fi else - if ! declare -p DOCS >/dev/null 2>&1 ; then - local d - for d in README* ChangeLog AUTHORS NEWS TODO CHANGES THANKS BUGS \ - FAQ CREDITS CHANGELOG ; do - [[ -s "${d}" ]] && dodoc "${d}" - done - elif declare -p DOCS | grep -q '^declare -a' ; then - dodoc "${DOCS[@]}" - else - dodoc ${DOCS} - fi + einstalldocs fi # Do not keep /var/lib/scrollkeeper because: @@ -281,6 +276,7 @@ gnome2_pkg_preinst() { gnome2_icon_savelist gnome2_schemas_savelist gnome2_scrollkeeper_savelist + gnome2_gdk_pixbuf_savelist } # @FUNCTION: gnome2_pkg_postinst @@ -294,6 +290,7 @@ gnome2_pkg_postinst() { gnome2_icon_cache_update gnome2_schemas_update gnome2_scrollkeeper_update + gnome2_gdk_pixbuf_update # This should only be in the overlay ewarn "**************************************************************"