# ChangeLog for eclass directory
# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.11 2011/11/12 20:46:39 pesa Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.12 2011/11/14 06:10:32 tetromino Exp $
+
+ 14 Nov 2011; Alexandre Rostovtsev <tetromino@gentoo.org> gnome2-utils.eclass,
+ gnome2.eclass:
+ Add gnome2_environment_reset() to reset env variables that often cause build
+ or test failures (most recently bug #380639). The XDG_* resetting code had
+ been tested in the gnome overlay for months with good results.
12 Nov 2011; Davide Pesavento <pesa@gentoo.org> qt4-r2.eclass:
Restore ${S} fallback, but with a deprecation notice saying that it will be
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/gnome2-utils.eclass,v 1.23 2011/08/22 04:46:31 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/gnome2-utils.eclass,v 1.24 2011/11/14 06:10:32 tetromino Exp $
# @ECLASS: gnome2-utils.eclass
# @MAINTAINER:
DEPEND=">=sys-apps/sed-4"
+# @FUNCTION: gnome2_environment_reset
+# @DESCRIPTION:
+# Reset various variables inherited from root's evironment to a reasonable
+# default for ebuilds to help avoid access violations and test failures.
+gnome2_environment_reset() {
+ # Respected by >=glib-2.30.1-r1
+ export G_HOME="${T}"
+
+ # GST_REGISTRY is to work around gst utilities trying to read/write /root
+ export GST_REGISTRY="${T}/registry.xml"
+
+ # XXX: code for resetting XDG_* directories should probably be moved into
+ # a separate function in a non-gnome eclass
+ export XDG_DATA_HOME="${T}/.local/share"
+ export XDG_CONFIG_HOME="${T}/.config"
+ export XDG_CACHE_HOME="${T}/.cache"
+ export XDG_RUNTIME_DIR="${T}/run"
+ mkdir -p "${XDG_DATA_HOME}" "${XDG_CONFIG_HOME}" "${XDG_CACHE_HOME}" \
+ "${XDG_RUNTIME_DIR}"
+ # This directory needs to be owned by the user, and chmod 0700
+ # http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
+ chmod 0700 "${XDG_RUNTIME_DIR}"
+}
+
# @FUNCTION: gnome2_gconf_savelist
# @DESCRIPTION:
# Find the GConf schemas that are about to be installed and save their location
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/gnome2.eclass,v 1.102 2011/09/25 15:15:21 pacho Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/gnome2.eclass,v 1.103 2011/11/14 06:10:32 tetromino Exp $
# @ECLASS: gnome2.eclass
# @MAINTAINER:
# Prepare environment for build, fix build of scrollkeeper documentation,
# run elibtoolize.
gnome2_src_prepare() {
- # GST_REGISTRY is to work around gst utilities trying to read/write /root
- export GST_REGISTRY="${T}/registry.xml"
+ # Prevent assorted access violations and test failures
+ gnome2_environment_reset
# Prevent scrollkeeper access violations
gnome2_omf_fix