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: [gentoo-dev] New eclass: multilib-minimal (was New eclass: autotools-multilib-minimal)
Date: Sat, 02 Mar 2013 17:43:52 +0100	[thread overview]
Message-ID: <51322C48.3040201@gentoo.org> (raw)

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

Since mgorny is working on compatibility with multilib-portage I
stripped all of the related code.

So this should be the final version. If there are no objections I would
like to commit.

[-- Attachment #2: multilib-minimal.eclass --]
[-- Type: text/plain, Size: 2558 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


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

	multilib_foreach_abi multilib-minimal_abi_copy_sources
}

multilib-minimal_src_configure() {
	multilib-minimal_abi_src_configure() {
		mkdir -p "${BUILD_DIR}" || die
		pushd "${BUILD_DIR}" >/dev/null || die
		if declare -f multilib_src_configure >/dev/null ; then
			multilib_src_configure
		else
			default_src_configure
		fi
		popd >/dev/null || die
	}

	multilib_foreach_abi multilib-minimal_abi_src_configure
}

multilib-minimal_src_compile() {
	multilib-minimal_abi_src_compile() {
		pushd "${BUILD_DIR}" >/dev/null || die
		if declare -f multilib_src_compile >/dev/null ; then
			multilib_src_compile
		else
			default_src_compile
		fi
		popd >/dev/null || die
	}

	multilib_foreach_abi multilib-minimal_abi_src_compile
}

multilib-minimal_src_test() {
	multilib-minimal_abi_src_test() {
		pushd "${BUILD_DIR}" >/dev/null || die
		if declare -f multilib_src_test >/dev/null ; then
			multilib_src_test
		else
			default_src_test
		fi
		popd >/dev/null || die
	}

	multilib_foreach_abi multilib-minimal_abi_src_test
}

multilib-minimal_src_install() {
	multilib-minimal_abi_src_install() {
		pushd "${BUILD_DIR}" >/dev/null || die
		if declare -f multilib_src_install >/dev/null ; then
			multilib_src_install
		else
			default_src_install	
		fi
		multilib_check_headers
		popd >/dev/null || die
	}
	multilib_foreach_abi multilib-minimal_abi_src_install

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

             reply	other threads:[~2013-03-02 16:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-02 16:43 hasufell [this message]
2013-03-02 16:48 ` [gentoo-dev] New eclass: multilib-minimal (was New eclass: autotools-multilib-minimal) Michał Górny

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=51322C48.3040201@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