On 03/02/2013 04:07 PM, Michał Górny wrote:
> I don't think you should introduce workarounds in your eclass. I think
> multilib-build should be the place to do that.

Feel free to implement a solution. I think an explicit variable might
even be better instead of some magical checks which could cause
unexpected behavior for in-source builds or ebuilds that do a lot of
additional stuff on top of these eclasses.
So in case that solution breaks something, it would only be for
multilib-portage and they could still handle that via masking those
packages.

> 
> And please don't attach patches to patched version since that's too
> hard to follow.
> 

I didn't. However, here is the full version.
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

# @ECLASS: multilib-minimal.eclass
# @MAINTAINER:
# Julian Ospald <hasuf...@gentoo.org>
# @BLURB: wrapper for multilib builds providing convenient multilib_src_* 
functions
# @DESCRIPTION:
#
# src_configure, src_compile, src_test and src_install are exported
# use multilib_src_* instead of src_* which runs this phase for
# all enabled ABIs
# multilib-minimal should _always_ go last in inherit order!!
#
# If you are using in-source builds, then you must run multilib_copy_sources
# at the end of src_prepare!!
#
# If you need generic install rules, use multilib_src_install_all function.


# EAPI=5 is required for meaningful MULTILIB_USEDEP.
case ${EAPI:-0} in
        5) ;;
        *) die "EAPI=${EAPI} is not supported" ;;
esac


inherit multilib-build

EXPORT_FUNCTIONS src_configure src_compile src_test src_install


unset DISABLE_MULTILIB
_multilib-minimal_set_globals() {
        if [[ $(multilib_get_enabled_abis) == ${DEFAULT_ABI} ]] ; then
                DISABLE_MULTILIB="ON"
        fi
}
_multilib-minimal_set_globals


multilib_copy_sources() {
        _abi_copy_sources() {
                einfo "${ABI}: copying to ${BUILD_DIR}"
                cp -pR "${S}" "${BUILD_DIR}" || die "failed to copy sources"
        }

        if [[ -z ${DISABLE_MULTILIB} ]] ; then
                einfo "Will copy sources to abi-specific dirs"
                multilib_foreach_abi _abi_copy_sources
        fi
}

multilib-minimal_src_configure() {
        _common_src_configure() {
                if declare -f multilib_src_configure >/dev/null ; then
                        multilib_src_configure
                else
                        default_src_configure
                fi
        }

        _abi_src_configure() {
                einfo "${ABI}: Configuring"

                mkdir -p "${BUILD_DIR}" || die
                pushd "${BUILD_DIR}" >/dev/null || die
                _common_src_configure
                popd >/dev/null || die
        }

        if [[ -z ${DISABLE_MULTILIB} ]] ; then
                multilib_foreach_abi _abi_src_configure
        else
                _common_src_configure
        fi      
}

multilib-minimal_src_compile() {
        _common_src_compile() {
                if declare -f multilib_src_compile >/dev/null ; then
                        multilib_src_compile
                else
                        default_src_compile
                fi
        }

        _abi_src_compile() {
                einfo "${ABI}: Compiling"

                pushd "${BUILD_DIR}" >/dev/null || die
                _common_src_compile
                popd >/dev/null || die
        }

        if [[ -z ${DISABLE_MULTILIB} ]] ; then
                multilib_foreach_abi _abi_src_compile
        else
                _common_src_compile
        fi
}

multilib-minimal_src_test() {
        _common_src_test() {
                if declare -f multilib_src_test >/dev/null ; then
                        multilib_src_test
                else
                        default_src_test
                fi
        }

        _abi_src_test() {
                einfo "${ABI}: Testing"

                pushd "${BUILD_DIR}" >/dev/null || die
                _common_src_test
                popd >/dev/null || die
        }

        if [[ -z ${DISABLE_MULTILIB} ]] ; then
                multilib_foreach_abi _abi_src_test
        else
                _common_src_test
        fi
}

multilib-minimal_src_install() {
        _common_src_install() {
                if declare -f multilib_src_install >/dev/null ; then
                        multilib_src_install
                else
                        default_src_install     
                fi
        }

        _abi_src_install() {
                einfo "${ABI}: Installing"

                pushd "${BUILD_DIR}" >/dev/null || die
                _common_src_install
                multilib_check_headers
                popd >/dev/null || die
        }

        if [[ -z ${DISABLE_MULTILIB} ]] ; then
                multilib_foreach_abi _abi_src_install
        else
                _common_src_install
        fi

        if declare -f multilib_src_install_all >/dev/null ; then
                multilib_src_install_all
        fi
}

Reply via email to