public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: hasufell <hasufell@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Subject: Re: [gentoo-dev] New eclass: autotools-multilib-minimal
Date: Sat, 02 Mar 2013 16:13:42 +0100	[thread overview]
Message-ID: <51321726.7000808@gentoo.org> (raw)
In-Reply-To: <20130302160718.35b39774@pomiocik.lan>

[-- Attachment #1: Type: text/plain, Size: 698 bytes --]

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.

[-- Attachment #2: multilib-minimal.eclass --]
[-- Type: text/plain, Size: 3287 bytes --]

# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

# @ECLASS: multilib-minimal.eclass
# @MAINTAINER:
# Julian Ospald <hasufell@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	other threads:[~2013-03-02 15:14 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-24  0:34 [gentoo-dev] New eclass: autotools-multilib-minimal hasufell
2013-02-24  4:22 ` hasufell
2013-02-24 10:06   ` Michał Górny
2013-02-24 10:11     ` Diego Elio Pettenò
2013-02-24 14:17       ` hasufell
2013-02-24 14:33         ` Pacho Ramos
2013-02-27 13:01         ` Samuli Suominen
2013-02-27 20:13           ` Michał Górny
2013-02-27 20:15           ` Pacho Ramos
2013-02-24 14:57   ` Michał Górny
2013-02-24 15:12     ` hasufell
2013-02-24 15:12     ` Pacho Ramos
2013-02-24 15:53       ` Michał Górny
2013-02-24 16:21         ` Pacho Ramos
2013-02-24 16:28         ` Alexis Ballier
2013-02-24 16:58         ` Samuli Suominen
2013-02-24 18:56           ` Michał Górny
2013-02-24 19:40             ` hasufell
2013-02-24 18:05         ` [gentoo-dev] " Jonathan Callen
2013-02-24 18:18           ` Michał Górny
2013-02-24 16:22 ` [gentoo-dev] " Alexis Ballier
2013-02-24 16:42   ` hasufell
2013-02-24 18:46     ` Alexis Ballier
2013-02-24 22:39 ` Samuli Suominen
2013-02-28  1:06   ` hasufell
2013-02-28  8:30     ` Michał Górny
2013-02-28 15:16       ` hasufell
2013-03-02  2:50       ` hasufell
2013-03-02 15:07         ` Michał Górny
2013-03-02 15:13           ` hasufell [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51321726.7000808@gentoo.org \
    --to=hasufell@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox