summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
Diffstat (limited to 'eclass')
-rw-r--r--eclass/gnome2-la.eclass33
-rw-r--r--eclass/gnome2-utils.eclass268
-rw-r--r--eclass/gnome2.eclass180
3 files changed, 135 insertions, 346 deletions
diff --git a/eclass/gnome2-la.eclass b/eclass/gnome2-la.eclass
deleted file mode 100644
index e9506c3..0000000
--- a/eclass/gnome2-la.eclass
+++ /dev/null
@@ -1,33 +0,0 @@
-# Copyright 1999-2009 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: $
-
-#
-# gnome2-la.eclass
-#
-# Original Author: Nirbheek Chauhan <nirbheek@gentoo.org>
-# Purpose: Temporary eclass for facilitating .la file removal
-#
-# Only for usage in the overlay. This eclass will be redundant once this feature
-# is reviewed and patched into gnome2.eclass (in-tree)
-#
-
-inherit gnome2
-
-EXPORT_FUNCTIONS src_install
-
-# Remove .la files in src_install?
-G2PUNT_LA=${G2PUNT_LA:-"no"}
-
-gnome2-la_src_install() {
- gnome2_src_install
-
- # Remove .la files if they're unneeded
- # Be *absolutely* sure before doing this and read
- # http://dev.gentoo.org/~nirbheek/gnome/gnome-policy.xml#doc_chap3
- if [[ "${G2PUNT_LA}" = "yes" ]]; then
- ebegin "Removing .la files"
- find "${D}" -name '*.la' -delete
- eend
- fi
-}
diff --git a/eclass/gnome2-utils.eclass b/eclass/gnome2-utils.eclass
deleted file mode 100644
index c488dd9..0000000
--- a/eclass/gnome2-utils.eclass
+++ /dev/null
@@ -1,268 +0,0 @@
-# Copyright 1999-2006 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/gnome2-utils.eclass,v 1.13 2008/10/22 21:04:53 eva Exp $
-
-#
-# gnome2-utils.eclass
-#
-# Set of auxiliary functions used to perform actions commonly needed by packages
-# using the GNOME framework.
-#
-# Maintained by Gentoo's GNOME herd <gnome@gentoo.org>
-#
-
-case "${EAPI:-0}" in
- 0|1|2|3) ;;
- *) die "EAPI=${EAPI} is not supported" ;;
-esac
-
-# Path to gconftool-2
-: ${GCONFTOOL_BIN:="/usr/bin/gconftool-2"}
-
-# Directory where scrollkeeper-update should do its work
-: ${SCROLLKEEPER_DIR:="/var/lib/scrollkeeper"}
-
-# Path to scrollkeeper-update
-: ${SCROLLKEEPER_UPDATE_BIN:="/usr/bin/scrollkeeper-update"}
-
-# Path to gtk-update-icon-cache
-: ${GTK_UPDATE_ICON_CACHE:="/usr/bin/gtk-update-icon-cache"}
-
-# Path to glib-compile-schemas
-: ${GLIB_COMPILE_SCHEMAS:="/usr/bin/glib-compile-schemas"}
-
-
-
-DEPEND=">=sys-apps/sed-4"
-
-
-
-# Find the GConf schemas that are about to be installed and save their location
-# in the GNOME2_ECLASS_SCHEMAS environment variable
-gnome2_gconf_savelist() {
- has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}"
- pushd "${ED}" &> /dev/null
- export GNOME2_ECLASS_SCHEMAS=$(find 'etc/gconf/schemas/' -name '*.schemas' 2> /dev/null)
- popd &> /dev/null
-}
-
-
-# Applies any schema files installed by the current ebuild to Gconf's database
-# using gconftool-2
-gnome2_gconf_install() {
- has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
- local updater="${EROOT}${GCONFTOOL_BIN}"
-
- if [[ ! -x "${updater}" ]]; then
- debug-print "${updater} is not executable"
- return
- fi
-
- if [[ -z "${GNOME2_ECLASS_SCHEMAS}" ]]; then
- debug-print "No GNOME 2 GConf schemas found"
- return
- fi
-
- # We are ready to install the GCONF Scheme now
- unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL
- export GCONF_CONFIG_SOURCE="$("${updater}" --get-default-source | sed "s;:/;:${EROOT};")"
-
- einfo "Installing GNOME 2 GConf schemas"
-
- local F
- for F in ${GNOME2_ECLASS_SCHEMAS}; do
- if [[ -e "${EROOT}${F}" ]]; then
- debug-print "Installing schema: ${F}"
- "${updater}" --makefile-install-rule "${EROOT}${F}" 1>/dev/null
- fi
- done
-
- # have gconf reload the new schemas
- pids=$(pgrep -x gconfd-2)
- if [[ $? == 0 ]] ; then
- ebegin "Reloading GConf schemas"
- kill -HUP ${pids}
- eend $?
- fi
-}
-
-
-# Removes schema files previously installed by the current ebuild from Gconf's
-# database.
-gnome2_gconf_uninstall() {
- has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
- local updater="${EROOT}${GCONFTOOL_BIN}"
-
- if [[ ! -x "${updater}" ]]; then
- debug-print "${updater} is not executable"
- return
- fi
-
- if [[ -z "${GNOME2_ECLASS_SCHEMAS}" ]]; then
- debug-print "No GNOME 2 GConf schemas found"
- return
- fi
-
- unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL
- export GCONF_CONFIG_SOURCE="$("${updater}" --get-default-source | sed "s;:/;:${EROOT};")"
-
- einfo "Uninstalling GNOME 2 GConf schemas"
-
- local F
- for F in ${GNOME2_ECLASS_SCHEMAS}; do
- if [[ -e "${EROOT}${F}" ]]; then
- debug-print "Uninstalling gconf schema: ${F}"
- "${updater}" --makefile-uninstall-rule "${EROOT}${F}" 1>/dev/null
- fi
- done
-
- # have gconf reload the new schemas
- pids=$(pgrep -x gconfd-2)
- if [[ $? == 0 ]] ; then
- ebegin "Reloading GConf schemas"
- kill -HUP ${pids}
- eend $?
- fi
-}
-
-
-# Find the icons that are about to be installed and save their location
-# in the GNOME2_ECLASS_ICONS environment variable
-# That function should be called from pkg_preinst
-gnome2_icon_savelist() {
- has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}"
- pushd "${ED}" &> /dev/null
- export GNOME2_ECLASS_ICONS=$(find 'usr/share/icons' -maxdepth 1 -mindepth 1 -type d 2> /dev/null)
- popd &> /dev/null
-}
-
-
-# Updates Gtk+ icon cache files under /usr/share/icons if the current ebuild
-# have installed anything under that location.
-gnome2_icon_cache_update() {
- has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
- local updater="${EROOT}${GTK_UPDATE_ICON_CACHE}"
-
- if [[ ! -x "${updater}" ]] ; then
- debug-print "${updater} is not executable"
- return
- fi
-
- if [[ -z "${GNOME2_ECLASS_ICONS}" ]]; then
- debug-print "No icon cache to update"
- return
- fi
-
- ebegin "Updating icons cache"
-
- local retval=0
- local fails=( )
-
- for dir in ${GNOME2_ECLASS_ICONS}
- do
- if [[ -f "${ROOT}${dir}/index.theme" ]] ; then
- local rv=0
-
- "${updater}" -qf "${EROOT}${dir}"
- rv=$?
-
- if [[ ! $rv -eq 0 ]] ; then
- debug-print "Updating cache failed on ${EROOT}${dir}"
-
- # Add to the list of failures
- fails[$(( ${#fails[@]} + 1 ))]="${EROOT}${dir}"
-
- retval=2
- fi
- fi
- done
-
- eend ${retval}
-
- for f in "${fails[@]}" ; do
- eerror "Failed to update cache with icon $f"
- done
-}
-
-
-# Workaround applied to Makefile rules in order to remove redundant
-# calls to scrollkeeper-update and sandbox violations.
-gnome2_omf_fix() {
- local omf_makefiles filename
-
- omf_makefiles="$@"
-
- if [[ -f ${S}/omf.make ]] ; then
- omf_makefiles="${omf_makefiles} ${S}/omf.make"
- fi
-
- # testing fixing of all makefiles found
- # 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 filename in $(find ./ -name "Makefile.in" -o -name "Makefile.am" |sort) ; do
- omf_makefiles="${omf_makefiles} ${filename}"
- done
-
- ebegin "Fixing OMF Makefiles"
-
- local retval=0
- local fails=( )
-
- for omf in ${omf_makefiles} ; do
- local rv=0
-
- sed -i -e 's:scrollkeeper-update:true:' "${omf}"
- retval=$?
-
- if [[ ! $rv -eq 0 ]] ; then
- debug-print "updating of ${omf} failed"
-
- # Add to the list of failures
- fails[$(( ${#fails[@]} + 1 ))]=$omf
-
- retval=2
- fi
- done
-
- eend $retval
-
- for f in "${fails[@]}" ; do
- eerror "Failed to update OMF Makefile $f"
- done
-}
-
-
-# Updates the global scrollkeeper database.
-gnome2_scrollkeeper_update() {
- has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
- if [[ -x "${EROOT}${SCROLLKEEPER_UPDATE_BIN}" ]]; then
- einfo "Updating scrollkeeper database ..."
- "${EROOT}${SCROLLKEEPER_UPDATE_BIN}" -q -p "${EROOT}${SCROLLKEEPER_DIR}"
- fi
-}
-
-gnome2_schemas_savelist() {
- has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}"
- pushd "${ED}" &>/dev/null
- export GNOME2_ECLASS_GLIB_SCHEMAS=$(find 'usr/share/glib-2.0/schemas' -name '*.gschema.xml' 2>/dev/null)
- popd &>/dev/null
-}
-
-gnome2_schemas_update() {
- has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
- local updater="${EROOT}${GLIB_COMPILE_SCHEMAS}"
-
- if [[ ! -x ${updater} ]]; then
- debug-print "${updater} is not executable"
- return
- fi
-
- if [[ -z ${GNOME2_ECLASS_GLIB_SCHEMAS} ]]; then
- debug-print "No GSettings schemas to update"
- return
- fi
-
- ebegin "Updating GSettings schemas"
- ${updater} --allow-any-name "$@" "${EROOT%/}/usr/share/glib-2.0/schemas" &>/dev/null
- eend $?
-}
diff --git a/eclass/gnome2.eclass b/eclass/gnome2.eclass
index f206fc1..f3c3d72 100644
--- a/eclass/gnome2.eclass
+++ b/eclass/gnome2.eclass
@@ -1,16 +1,14 @@
-# Copyright 1999-2006 Gentoo Foundation
+# 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.87 2010/04/26 19:37:25 abcd Exp $
+# $Header: $
-#
-# gnome2.eclass
-#
+# @ECLASS: gnome2.eclass
+# @MAINTAINER:
+# gnome@gentoo.org
+# @BLURB:
+# @DESCRIPTION:
# Exports portage base functions used by ebuilds written for packages using the
# GNOME framework. For additional functions, see gnome2-utils.eclass.
-#
-# Maintained by Gentoo's GNOME herd <gnome@gentoo.org>
-#
-
inherit fdo-mime libtool gnome.org gnome2-utils
@@ -18,28 +16,74 @@ case "${EAPI:-0}" in
0|1)
EXPORT_FUNCTIONS src_unpack src_compile src_install pkg_preinst pkg_postinst pkg_postrm
;;
- 2|3)
+ 2|3|4)
EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_install pkg_preinst pkg_postinst pkg_postrm
;;
*) die "EAPI=${EAPI} is not supported" ;;
esac
+#if [[ "${I_WANT_GNOME_3_3_X}" != "yes" ]]; then
+# die "
+#
+#The GNOME overlay is switching to GNOME 3.3.x prerelease packages.
+#These are unstable, potentially incompatible with 3.2, and may well
+#break your system in intriguing ways.
+#
+#If you enabled the GNOME overlay to get GNOME 3.2, please disable
+#it now, since GNOME 3.2 is already in portage and unmasked.
+#
+#If you really do want experimental GNOME 3.3.x, please add
+#I_WANT_GNOME_3_3_X=yes
+#to your /etc/make.conf and continue.
+#
+#"
+#fi
+
+# @ECLASS-VARIABLE: G2CONF
+# @DEFAULT-UNSET
+# @DESCRIPTION:
# Extra configure opts passed to econf
G2CONF=${G2CONF:-""}
+# @ECLASS-VARIABLE: GNOME2_LA_PUNT
+# @DESCRIPTION:
# Should we delete all the .la files?
-# Do NOT use without due consideration
+# NOT to be used without due consideration.
GNOME2_LA_PUNT=${GNOME2_LA_PUNT:-"no"}
+# @ECLASS-VARIABLE: ELTCONF
+# @DEFAULT-UNSET
+# @DESCRIPTION:
# Extra options passed to elibtoolize
ELTCONF=${ELTCONF:-""}
+# @ECLASS-VARIABLE: USE_EINSTALL
+# @DEFAULT-UNSET
+# @DEPRECATED
+# @DESCRIPTION:
# Should we use EINSTALL instead of DESTDIR
USE_EINSTALL=${USE_EINSTALL:-""}
-# Run scrollkeeper for this package?
+# @ECLASS-VARIABLE: SCROLLKEEPER_UPDATE
+# @DEPRECATED
+# @DESCRIPTION:
+# Whether to run scrollkeeper for this package or not.
SCROLLKEEPER_UPDATE=${SCROLLKEEPER_UPDATE:-"1"}
+# @ECLASS-VARIABLE: DOCS
+# @DEFAULT-UNSET
+# @DESCRIPTION:
+# String containing documents passed to dodoc command.
+
+# @ECLASS-VARIABLE: GCONF_DEBUG
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# Whether to handle debug or not.
+# Some gnome applications support various levels of debugging (yes, no, minimum,
+# etc), but using --disable-debug also removes g_assert which makes debugging
+# harder. This variable should be set to yes for such packages for the eclass
+# to handle it properly. It will enable minimal debug with USE=-debug.
+# Note that this is most commonly found in configure.ac as GNOME_DEBUG_CHECK.
if [[ ${GCONF_DEBUG} != "no" ]]; then
@@ -47,25 +91,50 @@ if [[ ${GCONF_DEBUG} != "no" ]]; then
fi
-
+# @FUNCTION: gnome2_src_unpack
+# @DESCRIPTION:
+# Stub function for old EAPI.
gnome2_src_unpack() {
unpack ${A}
cd "${S}"
has ${EAPI:-0} 0 1 && gnome2_src_prepare
}
+# @FUNCTION: gnome2_src_prepare
+# @DESCRIPTION:
+# Prepare environment for build, fix build of scrollkeeper documentation,
+# run elibtoolize.
gnome2_src_prepare() {
- # Don't use the session bus address inherited via the environment
- # causes test and introspection-building failures
+ # Reset various variables inherited via the environment.
+ # Causes test failures, introspection-build failures, and access violations
+ # FIXME: seems to have no effect for exported variables, at least with
+ # portage-2.2.0_alpha74
unset DBUS_SESSION_BUS_ADDRESS
+ unset DISPLAY
+ unset GNOME_KEYRING_CONTROL
+ unset GNOME_KEYRING_PID
+ unset XAUTHORITY
+ unset XDG_SESSION_COOKIE
+
+ # Prevent assorted access violations and test failures
+ gnome2_environment_reset
# Prevent scrollkeeper access violations
gnome2_omf_fix
# Run libtoolize
- elibtoolize ${ELTCONF}
+ if has ${EAPI:-0} 0 1 2 3; then
+ elibtoolize ${ELTCONF}
+ else
+ # Everything is fatal EAPI 4 onwards
+ nonfatal elibtoolize ${ELTCONF}
+ fi
+
}
+# @FUNCTION: gnome2_src_configure
+# @DESCRIPTION:
+# Gnome specific configure handling
gnome2_src_configure() {
# Update the GNOME configuration options
if [[ ${GCONF_DEBUG} != 'no' ]] ; then
@@ -75,31 +144,38 @@ gnome2_src_configure() {
fi
# Prevent a QA warning
- if hasq doc ${IUSE} ; then
+ if has doc ${IUSE} ; then
G2CONF="${G2CONF} $(use_enable doc gtk-doc)"
fi
- # Avoid sandbox violations caused by misbehaving packages (bug #128289)
- addwrite "/root/.gnome2"
+ # Pass --disable-maintainer-mode when needed
+ if grep -q "^[[:space:]]*AM_MAINTAINER_MODE(\[enable\])" configure.*; then
+ G2CONF="${G2CONF} --disable-maintainer-mode"
+ fi
+
+ # Pass --disable-scrollkeeper when possible
+ if grep -q "disable-scrollkeeper" configure; then
+ G2CONF="${G2CONF} --disable-scrollkeeper"
+ fi
+
+ # Avoid sandbox violations caused by gnome-vfs (bug #128289 and #345659)
+ addwrite "$(unset HOME; echo ~)/.gnome2"
- # GST_REGISTRY is to work around gst-inspect trying to read/write /root
- GST_REGISTRY="${S}/registry.xml" econf "$@" ${G2CONF} || die "configure failed"
+ econf "$@" ${G2CONF}
}
+# @FUNCTION: gnome2_src_compile
+# @DESCRIPTION:
+# Stub function for old EAPI.
gnome2_src_compile() {
has ${EAPI:-0} 0 1 && gnome2_src_configure "$@"
-
- # Whenever new API is added to glib/cairo/libxml2 etc, gobject-introspection
- # needs to be rebuilt so that the typelibs/girs contain the new API data
- if has introspection ${IUSE} && use introspection; then
- ewarn "If you get a compilation failure related to introspection, try"
- ewarn "rebuilding dev-libs/gobject-introspection so that it's updated"
- ewarn "for any new glib, cairo, etc APIs"
- fi
-
emake || die "compile failure"
}
+# @FUNCTION: gnome2_src_install
+# @DESCRIPTION:
+# Gnome specific install. Handles typical GConf and scrollkeeper setup
+# in packages and removal of .la files if requested
gnome2_src_install() {
has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}"
# if this is not present, scrollkeeper-update may segfault and
@@ -129,10 +205,9 @@ gnome2_src_install() {
# 1. The scrollkeeper database is regenerated at pkg_postinst()
# 2. ${ED}/var/lib/scrollkeeper contains only indexes for the current pkg
# thus it makes no sense if pkg_postinst ISN'T run for some reason.
- if [[ -z "$(find "${D}" -name '*.omf')" ]]; then
- export SCROLLKEEPER_UPDATE="0"
- fi
rm -rf "${ED}${sk_tmp_dir}"
+ rmdir "${ED}/var/lib" 2>/dev/null
+ rmdir "${ED}/var" 2>/dev/null
# Make sure this one doesn't get in the portage db
rm -fr "${ED}/usr/share/applications/mimeinfo.cache"
@@ -140,42 +215,57 @@ gnome2_src_install() {
# Delete all .la files
if [[ "${GNOME2_LA_PUNT}" != "no" ]]; then
ebegin "Removing .la files"
- find "${D}" -name '*.la' -exec rm -f '{}' + || die
+ if ! { has static-libs ${IUSE//+} && use static-libs; }; then
+ find "${D}" -name '*.la' -exec rm -f {} + || die "la file removal failed"
+ fi
eend
fi
}
+# @FUNCTION: gnome2_pkg_preinst
+# @DESCRIPTION:
+# Finds Icons, GConf and GSettings schemas for later handling in pkg_postinst
gnome2_pkg_preinst() {
gnome2_gconf_savelist
gnome2_icon_savelist
gnome2_schemas_savelist
+ gnome2_scrollkeeper_savelist
}
+# @FUNCTION: gnome2_pkg_postinst
+# @DESCRIPTION:
+# Handle scrollkeeper, GConf, GSettings, Icons, desktop and mime
+# database updates.
gnome2_pkg_postinst() {
gnome2_gconf_install
fdo-mime_desktop_database_update
fdo-mime_mime_database_update
gnome2_icon_cache_update
gnome2_schemas_update
-
- if [[ "${SCROLLKEEPER_UPDATE}" = "1" ]]; then
- gnome2_scrollkeeper_update
- fi
+ gnome2_scrollkeeper_update
+
+ # This should only be in the overlay
+ ewarn "**************************************************************"
+ ewarn "This is the *experimental* Gentoo GNOME Overlay"
+ ewarn "Please report bugs at #gentoo-desktop @ FreeNode"
+ ewarn "Do NOT go to upstream with bugs without checking with us first"
+ ewarn "**************************************************************"
}
+# @#FUNCTION: gnome2_pkg_prerm
+# @#DESCRIPTION:
+# # FIXME Handle GConf schemas removal
#gnome2_pkg_prerm() {
# gnome2_gconf_uninstall
#}
+# @FUNCTION: gnome2_pkg_postrm
+# @DESCRIPTION:
+# Handle scrollkeeper, GSettings, Icons, desktop and mime database updates.
gnome2_pkg_postrm() {
fdo-mime_desktop_database_update
fdo-mime_mime_database_update
gnome2_icon_cache_update
- gnome2_schemas_update --uninstall
-
- if [[ "${SCROLLKEEPER_UPDATE}" = "1" ]]; then
- gnome2_scrollkeeper_update
- fi
+ gnome2_schemas_update
+ gnome2_scrollkeeper_update
}
-
-# pkg_prerm