aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory M. Tuner <gmt@be-evil.net>2013-12-25 06:11:22 -0800
committerGregory M. Tuner <gmt@be-evil.net>2013-12-25 06:11:22 -0800
commit8ab18967b8717092a152799f3149026a7cb2c238 (patch)
treebfc5f0b55c81b832ce6322a6cbabb772a35e1dcf /eclass/gnome2-multilib.eclass
parentsys-devel/gettext: multilib-utize (diff)
downloadgmt-8ab18967b8717092a152799f3149026a7cb2c238.tar.gz
gmt-8ab18967b8717092a152799f3149026a7cb2c238.tar.bz2
gmt-8ab18967b8717092a152799f3149026a7cb2c238.zip
eclass/{gnome2,clutter}-multilib: big refactor
gnome2-multilib and clutter-multilib were in pretty sad shape. Here I've refactored them both almost entirely, to be much more consistent with the ehook patterns in other multilib ebuilds. Also sync'ed these both with upstream gx86, feature-for-feature. Signed-off-by: Gregory M. Tuner <gmt@be-evil.net>
Diffstat (limited to 'eclass/gnome2-multilib.eclass')
-rw-r--r--eclass/gnome2-multilib.eclass486
1 files changed, 267 insertions, 219 deletions
diff --git a/eclass/gnome2-multilib.eclass b/eclass/gnome2-multilib.eclass
index f21a0ff..dfea37b 100644
--- a/eclass/gnome2-multilib.eclass
+++ b/eclass/gnome2-multilib.eclass
@@ -10,76 +10,165 @@
# Exports portage base functions used by ebuilds written for packages using the
# GNOME framework. For additional functions, see gnome2{,-utils}.eclass
+# src_prepare comes from autotools multilib
inherit ehooker gtk-doc gnome2 autotools-multilib
case "${EAPI:-0}" in
- 4|5)
- EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_install pkg_preinst pkg_postinst pkg_postrm
- ;;
+ 4|5) :; ;;
*) die "EAPI=${EAPI} is not supported" ;;
esac
-# if G2CONF is a string upgrade it to an array
+EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_install pkg_preinst pkg_postinst pkg_postrm
+
+# @ECLASS-VARIABLE: G2CONF
+# @DESCRIPTION:
+# An array of arguments to provide to configure.
+# In gnome2.eclass, this was a string; if a string
+# is used, it will be convert to an array automatically,
+# but an ugly warning will issue forth unto the end-user
if declare -p G2CONF >/dev/null 2>&1 ; then
if [[ $(declare -p G2CONF) != declare\ -[Aa]* ]] ; then
- # lets optimistically assume it's a string. right thing probably happens if we create a local array shadow-var
- declare -a -g G2CONF=( ${G2CONF} )
+ if [[ "${G2CONF}" == "" ]] ; then
+ # this is the default from inheriting gnome2.eclass, let's
+ # go ahead and change it to an array...
+ unset G2CONF
+ declare -a G2CONF=()
+ fi
fi
-else
- # fine, lets make a local empty one, then
- declare -a -g G2CONF
fi
-# simple proxy: intercept ehooks matching "autotools-utils_{pre,post}*"
-# and rebroadcast into ehooks matching "gnome2-multilib_{pre,post}*"
-_gnome2-multilib_autotools-utils_ehook-proxy() {
- debug-print-function ${FUNCNAME} "$@"
- case $1 in
- autotools-utils-pre_*) ehook_fire "gnome2-multilib${1#autotools-utils}" ;;
- autotools-utils-post_*) ehook_fire "gnome2-multilib${1#autotools-utils}" -u ;;
- *) ewarn "_gnome2-multilib_autotools-utils_ehook-proxy received unexpected notification \"$1\"." ;;
- esac
+# the following five functions are not superflous; DUCY?
+
+# @FUNCTION: gnome2-multilib_src_unpack
+# @DESCRIPTION:
+# Calls gnome2_src_unpack
+gnome2-multilib_src_unpack() {
+ gnome2_src_unpack "$@"
}
-for hook in autotools-utils_{pre,post}-src_{prepare,compile,install} ; do
- ehook "${hook}" _gnome2-multilib_autotools-utils_ehook-proxy
-done
+# @FUNCTION: gnome2-multilib_src_compile
+# @DESCRIPTION:
+# Calls autotools-multilib_src_compile
+gnome2-multilib_src_compile() {
+ autotools-multilib_src_compile "$@"
+}
-_gnome2-multilib-pre_src_configure_ehook-proxy() {
- declare -a G2CONF=("${myeconfargs[@]}")
- declare -a G2CONF_OTHER=("${othereconfargs[@]}")
- ehook_fire gnome2-multilib-pre_src_configure
- local fire_result=$?
- myeconfargs=("${G2CONF[@]}")
- othereconfargs=("${G2CONF_OTHER[@]}")
- return $fire_result
+# @FUNCTION: gnome2-multilib_pkg_preinst
+# @DESCRIPTION:
+# Calls gnome2_pkg_preinst
+gnome2-multilib_pkg_preinst() {
+ gnome2_pkg_preinst "$@"
}
-ehook autotools-utils-pre_src_configure _gnome2-multilib-pre_src_configure_ehook-proxy
-ehook autotools-utils-post_src_configure _gnome2-multilib_autotools-utils_ehook-proxy
+# @FUNCTION: gnome2-multilib_pkg_postinst
+# @DESCRIPTION:
+# Calls gnome2_pkg_postinst
+gnome2-multilib_pkg_postinst() {
+ gnome2_pkg_postinst "$@"
+}
-# @FUNCTION: gnome2-multilib_src_unpack
+# @FUNCTION: gnome2-multilib_pkg_postrm
# @DESCRIPTION:
-# Stub function for old EAPI.
-gnome2-multilib_src_unpack() {
- gnome2_src_unpack
+# Calls gnome2_pkg_postrm
+gnome2-multilib_pkg_postrm() {
+ gnome2_pkg_postrm "$@"
}
# @FUNCTION: gnome2-multilib_src_prepare
# @DESCRIPTION:
-# Prepare environment for build, fix build of scrollkeeper documentation,
-# run elibtoolize.
+# Fires the gnome2-multilib-global-{pre,post}_src_prepare ehooks, and,
+# not cancelled by hook listener, calls
+# autotools-utils_src_prepare and gnome2_src_prepare.
gnome2-multilib_src_prepare() {
- # Prevent assorted access violations and test failures
- gnome2_environment_reset
+ if ehook_fire gnome2-multilib-global-pre_src_prepare ; then
+ AT_NOELIBTOOLIZE=yes autotools-utils_src_prepare
+ gnome2_src_prepare
+ fi
+ ehook_fire gnome2-multilib-global-post_src_prepare -u
+}
- # Prevent scrollkeeper access violations
- gnome2_omf_fix
+# this ehook proxy intercepts ehooks matching:
+#
+# autotools-multilib-{global,per-abi,best-abi}-{pre,post}_src_{configure,test,install}
+#
+# and fires corresponding gnome2-multilib ehooks as a convenience. For example, it
+# will listen for the
+#
+# autotools-multilib-per-abi-pre_src_configure
+#
+# ehook and, upon receipt, broadcast:
+#
+# gnome2-multilib-per-abi-pre_src_configure
+#
+# result codes are propagated to the original ehook if the hook is interruptible.
+_gnome2-multilib_autotools-multilib_ehook-proxy() {
+ debug-print-function ${FUNCNAME} "$@"
+ case $1 in
+ autotools-multilib-global-pre_src_install|autotools-multilib-global-post_src_install)
+ # these two hooks are fired manually in gnome2-multilib_src_install so there is no
+ # need to proxy them (to do so would fire broken duplicate hooks)
+ return 0
+ ;;
+ autotools-multilib-global-pre_src_configure|autotools-multilib-global-post_src_configure)
+ # these two hooks are fired manually in gnome2-multilib_src_configure so there is no
+ # need to proxy them (to do so would fire broken duplicate hooks)
+ return 0
+ ;;
+ autotools-multilib-*-pre_src_configure)
+ # translate myeconfargs to G2CONF & back
+ declare -a G2CONF=("${myeconfargs[@]}")
+ declare -a G2CONF_CMDLINE_ARGUMENTS=("${othereconfargs[@]}")
+ debug-print "${FUNCNAME}: G2CONF (before): $( declare -p G2CONF 2>&1 )"
+ debug-print "${FUNCNAME}: G2CONF_CMDLINE_ARGUMENTS (before): $( declare -p G2CONF_CMDLINE_ARGUMENTS 2>&1 )"
+ ehook_fire "gnome2-${1#autotools-}"
+ local rslt=$?
+ debug-print "${FUNCNAME}: G2CONF (after): $( declare -p G2CONF 2>&1 )"
+ debug-print "${FUNCNAME}: G2CONF_CMDLINE_ARGUMENTS (after): $( declare -p G2CONF_CMDLINE_ARGUMENTS 2>&1 )"
+ myeconfargs=("${G2CONF[@]}")
+ othereconfargs=("${G2CONF_CMDLINE_ARGUMENTS[@]}")
+ return $rslt
+ ;;
+ autotools-multilib-*-pre_src_*)
+ ehook_fire "gnome2-${1#autotools-}"
+ ;;
+ autotools-multilib-*-post_src_*)
+ ehook_fire "gnome2-${1#autotools-}" -u
+ ;;
+ *)
+ ewarn "_gnome2-multilib_autotools-utils_ehook-proxy received unexpected notification: \"$1\"."
+ return 0
+ ;;
+ esac
+}
- # Disable all deprecation warnings
- gnome2_disable_deprecation_warning
+for hook in autotools-multilib-{global,per-abi,best-abi}-{pre,post}_src_{configure,compile,test,install} ; do
+ ehook "${hook}" _gnome2-multilib_autotools-multilib_ehook-proxy
+done
- autotools-multilib_src_prepare
+# Convenience function to check if an option or its inverse is present in _g2conf.
+# Used only by gnome2-multilib_src_configure. As an example of how this works,
+# it will return 0 (true) if the argument is "--disable-monkey-poo" and
+# ${G2CONF_CMDLINE_ARGUMENTS[4]} is --enable-monkey-poo="delicious!!!".
+_g2conf_has_like() {
+ local confitem directive="$1"
+ # bool-flip negative directives
+ case ${directive} in
+ --disable-*) directive="--enable-${directive#--disable-}" ;;
+ --without-*) directive="--with-${directive#--without-}" ;;
+ *) :; ;;
+ esac
+ for confitem in "${G2CONF[@]}" "${G2CONF_CMDLINE_ARGUMENTS}" ; do
+ # strip any equals sign and following junk
+ confitem="${confitem%%=*}"
+ # bool-flip negative confitems
+ case ${confitem} in
+ --disable-*) confitem="--enable-${confitem#--disable-}" ;;
+ --without-*) confitem="--with-${confitem#--without-}" ;;
+ *) :; ;;
+ esac
+ [[ ${directive} == ${confitem} ]] && return 0
+ done
+ return 1
}
# @FUNCTION: gnome2-multilib_src_configure
@@ -90,134 +179,87 @@ gnome2-multilib_src_prepare() {
# to gnome2-multilib_src_configure, are available in the G2CONF array
# during the gnome2-multilib-pre_src_configure hook event and any
# changes made by listeners will be passed on to econf.
+#
# The default configure process is supressed entirely and
-# gnome2-multilib_src_configure hook processing cut short, if a nonzero
-# value is returned by any gnome2-multilib-pre_src_configure listener
-# functions, if it is desired to configure by some nonstandard means.
+# gnome2-multilib-per-abi-pre_src_configure ehook processing cut short,
+# if a nonzero value is returned by any
+# gnome2-multilib-per-abi-pre_src_configure ehook listener.
+# This can be used to "override" the default src_configure
+# process on a per-abi basis.
+#
+# Any occurance of "@GET_LIBDIR@" in G2CONF or in the command-line
+# arguments will be substituted with the results of $(get_libdir),
+# on a per-multilib-abi-basis. This feature is provided by the
+# autotools-multilib framework (gnome2-multilib inherits the
+# feature for "free")
gnome2-multilib_src_configure() {
+ debug-print-function ${FUNCTION} "$@"
+ # Assume any myeconfargs from the environment is a bug
+ if declare -p myeconfargs >/dev/null 2>&1 ; then
+ die "Detected myeconfargs in gnome2-multilib. Use G2CONF instead."
+ fi
+
+ declare -a G2CONF_CMDLINE_ARGUMENTS=("$@")
+
+ debug-print "${FUNCNAME}: G2CONF (before): $( declare -p G2CONF 2>&1 )"
+ debug-print "${FUNCNAME}: G2CONF_CMDLINE_ARGUMENTS (before): $( declare -p G2CONF_CMDLINE_ARGUMENTS 2>&1 )"
# if G2CONF is a string upgrade it to an array
if declare -p G2CONF >/dev/null 2>&1 ; then
if [[ $(declare -p G2CONF) != declare\ -[Aa]* ]] ; then
# lets optimistically assume it's a string. right thing probably happens if we create a local array shadow-var
+ ewarn
ewarn "In gnome2-multilib it's preferred to make G2CONF an array, although a string will probably work"
+ ewarn "It was: $(declare -p G2CONF)"
+ ewarn
declare -a G2CONF=( ${G2CONF} )
fi
else
- # fine, lets make a local empty one, then
+ # fine, then lets make a local, empty one
declare -a G2CONF
fi
- # Update the GNOME configuration options
- if [[ ${GCONF_DEBUG} != 'no' ]] ; then
- if use debug ; then
- has "--enable-debug=yes" "${G2CONF[@]}" "$@" || G2CONF+=(--enable-debug=yes)
+ if ehook_fire gnome2-multilib-global-pre_src_configure ; then
+ if [[ ${GCONF_DEBUG} != 'no' ]] && use debug ; then
+ _gconf_has_like "--enable-debug" || G2CONF+=(--enable-debug=yes)
fi
- fi
-
- # Starting with EAPI=5, we consider packages installing gtk-doc to be
- # handled by adding DEPEND="dev-util/gtk-doc-am" which provides tools to
- # relink URLs in documentation to already installed documentation.
- # This decision also greatly helps with constantly broken doc generation.
- # 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 [[ ${EAPI:-4} == 4 ]] && in_iuse doc ; then
- has "$(use_enable doc gtk-doc)" "${G2CONF[@]}" "$@" || G2CONF+=($(use_enable doc gtk-doc))
- else
- has "--disable-gtk-doc" "${G2CONF[@]}" "$@" || G2CONF+=(--disable-gtk-doc)
+ if grep -q "enable-gtk-doc" "${ECONF_SOURCE:-.}"/configure ; then
+ if ! _g2conf_has_like "--disable-gtk-doc" ; then
+ if [[ ${EAPI:-4} == 4 ]] && in_iuse doc ; then
+ G2CONF+=("$(use_enable doc gtk-doc)")
+ else
+ G2CONF+=("--disable-gtk-doc")
+ fi
+ fi
fi
- fi
-
- # Pass --disable-maintainer-mode when needed
- if grep -q "^[[:space:]]*AM_MAINTAINER_MODE(\[enable\])" \
- "${ECONF_SOURCE:-.}"/configure.*; then
- has "--disable-maintainer-mode" "${G2CONF[@]}" "$@" || G2CONF+=(--disable-maintainer-mode)
- fi
-
- # Pass --disable-scrollkeeper when possible
- if grep -q "disable-scrollkeeper" "${ECONF_SOURCE:-.}"/configure; then
- has "--disable-scrollkeeper" "${G2CONF[@]}" "$@" || G2CONF+=(--disable-scrollkeeper)
- fi
-
- # Pass --disable-silent-rules when possible (not needed for eapi5), bug #429308
- if has ${EAPI:-2} 2 3 4; then
- if grep -q "disable-silent-rules" "${ECONF_SOURCE:-.}"/configure; then
- has "--disable-silent-rules" "${G2CONF[@]}" "$@" || G2CONF+=(--disable-silent-rules)
+ if grep -q "^[[:space:]]*AM_MAINTAINER_MODE(\[enable\])" \
+ "${ECONF_SOURCE:-.}"/configure.*; then
+ _g2conf_has_like "--enable-maintainer-mode" || G2CONF+=(--disable-maintainer-mode)
fi
- fi
-
- # Pass --disable-schemas-install when possible
- if grep -q "disable-schemas-install" "${ECONF_SOURCE:-.}"/configure; then
- has "--disable-schemas-install" "${G2CONF[@]}" "$@" || G2CONF+=(--disable-schemas-install)
- fi
-
- # Pass --disable-schemas-compile when possible
- if grep -q "disable-schemas-compile" "${ECONF_SOURCE:-.}"/configure; then
- has "--disable-schemas-compile" "${G2CONF[@]}" "$@" || G2CONF+=(--disable-schemas-compile)
- 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
- local g2confitem g2conf_has_enable_compile_warnings=no
- declare -i g2confitemidx
- for g2confitemidx in "${!G2CONF[@]}" ; do
- g2confitem="${G2CONF[${g2confitemidx}]}"
- if [[ ${g2confitem} == --enable-compile-warnings ]] ; then
- [[ ${g2conf_has_enable_compile_warnings} == yes ]] && \
- die multiple --enable-compile-warnings configure arguments
- G2CONF[${g2confitemidx}]="--enable-compile-warnings=minimum"
- g2conf_has_enable_compile_warnings=yes
- elif [[ ${g2confitem} == --enable-compile-warnings=* ]] ; then
- [[ ${g2conf_has_enable_compile_warnings} == yes ]] && \
- die multiple --enable-compile-warnings configure arguments
- g2conf_has_enable_compile_warnings=yes
- fi
- done
- declare -a new_src_compile_args
- local old_src_compile_arg
- for old_src_comile_arg in "$@" ; do
- if [[ ${old_src_compile_arg} == --enable-compile-warnings ]] ; then
- [[ ${g2conf_has_enable_compile_warnings} == yes ]] && \
- die multiple --enable-compile-warnings configure arguments
- new_src_compile_args+=("--enable-compile-warnings=minimum")
- g2conf_has_enable_compile_warnings=yes
- elif [[ ${old_src_compile_arg} == --enable-compile-warnings=* ]] ; then
- [[ ${g2conf_has_enable_compile_warnings} == yes ]] && \
- die multiple --enable-compile-warnings configure arguments
- new_src_compile_args+=("${old_src_compile_arg}")
- g2conf_has_enable_compile_warnings=yes
- else
- new_src_compile_args+=("${old_src_compile_arg}")
- fi
- done
- set -- "${new_src_compile_args[@]}"
- [[ ${g2conf_has_enable_compile_warnings} == no ]] && G2CONF+=(--enable-compile-warnings=minimum)
- unset new_src_compile_args
- unset old_src_compile_arg
- unset g2conf_has_enable_compile_warnings
- unset g2confitemidx
- unset g2confitem
- fi
+ if grep -q "disable-scrollkeeper" "${ECONF_SOURCE:-.}"/configure; then
+ _g2conf_has_like "--enable-scrollkeeper" || G2CONF+=(--disable-scrollkeeper)
+ fi
+ if [[ ${EAPI:-4} == 4 ]] && grep -q "disable-silent-rules" "${ECONF_SOURCE:-.}"/configure; then
+ _g2conf_has_like "--enable-silent-rules" || G2CONF+=(--disable-silent-rules)
+ fi
+ if grep -q "disable-schemas-install" "${ECONF_SOURCE:-.}"/configure; then
+ _g2conf_has_like "--enable-schemas-install" || G2CONF+=(--disable-schemas-install)
+ fi
+ if grep -q "disable-schemas-compile" "${ECONF_SOURCE:-.}"/configure; then
+ _g2conf_has_like "--enable-schemas-compile" || G2CONF+=(--disable-schemas-compile)
+ fi
+ if grep -q "enable-compile-warnings" "${ECONF_SOURCE:-.}"/configure; then
+ _g2conf_has_like "--enable-compile-warnings" || G2CONF+=(--enable-compile-warnings=minimum)
+ fi
+ addwrite "$(unset HOME; echo ~)/.gnome2"
- # Avoid sandbox violations caused by gnome-vfs (bug #128289 and #345659)
- addwrite "$(unset HOME; echo ~)/.gnome2"
+ debug-print "${FUNCNAME}: G2CONF (after): $( declare -p G2CONF 2>&1 )"
+ debug-print "${FUNCNAME}: G2CONF_CMDLINE_ARGUMENTS (after): $( declare -p G2CONF_CMDLINE_ARGUMENTS 2>&1 )"
- # Assume any myeconfargs from the environment is a collision or side effect of some kind
- if declare -p myeconfargs >/dev/null 2>&1 ; then
- ewarn "Detected myeconfargs in gnome2-multilib. Ignoring it, but chances are this is a bug of some kind."
+ declare -a myeconfargs=("${G2CONF[@]}")
+ autotools-multilib_src_configure "${G2CONF_CMDLINE_ARGUMENTS[@]}"
fi
- declare -a myeconfargs=("${G2CONF[@]}")
-
- autotools-multilib_src_configure "$@"
-}
-
-# @FUNCTION: gnome2-multilib_src_compile
-# @DESCRIPTION:
-# Stub function for old EAPI.
-gnome2-multilib_src_compile() {
- autotools-multilib_src_compile "${@}"
+ ehook_fire gnome2-multilib-global-post_src_configure -u
}
# @FUNCTION: gnome2-multilib_src_install
@@ -225,96 +267,102 @@ gnome2-multilib_src_compile() {
# Gnome specific install. Handles typical GConf and scrollkeeper setup
# in packages and removal of .la files if requested
gnome2-multilib_src_install() {
- has ${EAPI:-2} 2 && ! use prefix && ED="${D}"
+ debug-print-function ${FUNCTION} "$@"
+
# if this is not present, scrollkeeper-update may segfault and
# create bogus directories in /var/lib/
local sk_tmp_dir="/var/lib/scrollkeeper"
dodir "${sk_tmp_dir}" || die "dodir failed"
# we must delay gconf schema installation due to sandbox
- export GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL="1"
+ local GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL="1"
- # lets be nice about DOCS as this creates a backward
- # compatibility issue
- if declare -p DOCS >/dev/null 2>&1 ; then
- if ! declare -p DOCS | grep -q '^declare -[aA]' ; then
- local DOCS=( ${DOCS} )
- fi
- fi
+ # GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL will be auto-un-exported
+ # when it falls out of scope at the end of this function.
+ export GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL
- if [[ -z "${USE_EINSTALL}" || "${USE_EINSTALL}" = "0" ]]; then
- debug-print "Installing with 'make install'"
+ if ehook_fire gnome2-multilib-global-pre_src_install ; then
+ # upgrade DOCS to an array if required
+ if declare -p DOCS >/dev/null 2>&1 ; then
+ if ! declare -p DOCS | grep -q '^declare -[aA]' ; then
+ declare -a DOCS=( ${DOCS} )
+ fi
+ fi
- AUTOTOOLS_PRUNE_LIBTOOL_FILES=${AUTOTOOLS_PRUNE_LIBTOOL_FILES:-none} \
- autotools-multilib_src_install \
- "scrollkeeper_localstate_dir=${ED}${sk_tmp_dir}"
- "$@" || \
- die "install failed"
- else
- die "USE_EINSTALL not supported"
- fi
+ # defer the pruning of libtool files until later, as this is already a standard behavior in
+ # gnome2.eclass, and there's no reason to do it twice.
+ case x${AUTOTOOLS_PRUNE_LIBTOOL_FILES} in
+ xnone|x) :; ;;
+ xall) GNOME2_LA_PUNT=fuck_yeah ;;
+ xmodules) GNOME2_LA_PUNT=modules ;;
+ *) GNOME2_LA_PUNT=meh ;;
+ esac
- unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL
+ local AUTOTOOLS_PRUNE_LIBTOOL_FILES=none
+
+ # this last-minute registration ensures that no autotools-multilib-per-abi-pre_src_install
+ # ehook listener is deprived of notification due to _gnome2-multilib-per-abi-pre_src_install
+ # aborting the ehook (which it must do when USE_EINSTALL is set)
+ ehook autotools-multilib-per-abi-pre_src_install _gnome2-multilib-per-abi-pre_src_install
+ autotools-multilib_src_install "scrollkeeper_localstate_dir=${ED}${sk_tmp_dir}" "$@"
+ eunhook autotools-multilib-per-abi-pre_src_install _gnome2-multilib-per-abi-pre_src_install
+
+ # Handle documentation as 'default' for eapi5 and newer, bug #373131
+ if [[ ${EAPI:-4} == 4 ]] ; then
+ # Manual document installation
+ if declare -p DOCS >/dev/null 2>&1 ; then
+ if [[ ${#DOCS[@]} -gt 0 ]]; then
+ dodoc "${DOCS[@]}" || die "dodoc failed"
+ fi
+ fi
+ else
+ einstalldocs
+ fi
- # Handle documentation as 'default' for eapi5 and newer, bug #373131
- if [[ ${EAPI:-4} == 4 ]] ; then
- # Manual document installation
- if declare -p DOCS >/dev/null 2>&1 ; then
- if [[ ${#DOCS[@]} -gt 0 ]]; then
- dodoc "${DOCS[@]}" || die "dodoc failed"
+ # Delete all .la files
+ if [[ ${EAPI:-4} == 4 ]] ; then
+ if [[ "${GNOME2_LA_PUNT}" != "no" ]]; then
+ if ! use_if_iuse static-libs ; then
+ ebegin "Removing .la files"
+ find "${D}" -name '*.la' -exec rm -f {} + || die "la file removal failed"
+ eend
+ fi
fi
+ else
+ case "${GNOME2_LA_PUNT}" in
+ yes) prune_libtool_files --modules ;;
+ no) :; ;;
+ fuck_yeah) prune_libtool_files --all ;;
+ *) prune_libtool_files ;;
+ esac
fi
- else
- einstalldocs
fi
+ ehook_fire gnome2-multilib-global-post_src_install -u
+
# Do not keep /var/lib/scrollkeeper because:
# 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.
rm -rf "${ED}${sk_tmp_dir}"
- rmdir "${ED}/var/lib" 2>/dev/null
- rmdir "${ED}/var" 2>/dev/null
+ 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"
-
- # Delete all .la files
- if [[ ${EAPI:-4} == 4 ]] ; then
- if [[ "${GNOME2_LA_PUNT}" != "no" ]]; then
- if ! use_if_iuse static-libs ; then
- ebegin "Removing .la files"
- find "${D}" -name '*.la' -exec rm -f {} + || die "la file removal failed"
- eend
- fi
- fi
- else
- case "${GNOME2_LA_PUNT}" in
- yes) prune_libtool_files --modules;;
- no) ;;
- *) prune_libtool_files;;
- esac
- fi
-}
-
-# @FUNCTION: gnome2-multilib_pkg_preinst
-# @DESCRIPTION:
-# Finds Icons, GConf and GSettings schemas for later handling in pkg_postinst
-gnome2-multilib_pkg_preinst() {
- gnome2_pkg_preinst
-}
+ rm -fr "${ED}usr/share/applications/mimeinfo.cache"
-# @FUNCTION: gnome2-multilib_pkg_postinst
-# @DESCRIPTION:
-# Handle scrollkeeper, GConf, GSettings, Icons, desktop and mime
-# database updates.
-gnome2-multilib_pkg_postinst() {
- gnome2_pkg_postinst
}
-# @FUNCTION: gnome2-multilib_pkg_postrm
-# @DESCRIPTION:
-# Handle scrollkeeper, GSettings, Icons, desktop and mime database updates.
-gnome2-multilib_pkg_postrm() {
- gnome2_pkg_postrm
+# Since it was registered after the hook-wrapping listener to the same
+# ehook, if any gnome2-multilib-per-abi-pre_src_install
+# ehook listener aborts the ehook, this listener will never be called,
+_gnome2-multilib-per-abi-pre_src_install() {
+ if [[ -z "${USE_EINSTALL}" || "${USE_EINSTALL}" = "0" ]]; then
+ debug-print "Installing multilib abi ${ABI} with 'make install'"
+ return 0
+ else
+ debug-print "Installing multilib abi ${ABI} with 'einstall'"
+ einstall "${myemakeinstallargs[@]}" "${otheremakeinstallargs[@]}" || die "einstall failed"
+ return 1
+ fi
}