Gentoo Development Guide

MULTIBUILD

Section: portage (5)
Updated: Oct 2014
Index Return to Main Contents
 

NAME

multibuild - A generic eclass for building multiple variants of packages.  

DESCRIPTION

The multibuild eclass aims to provide a generic framework for building multiple 'variants' of a package (e.g. multilib, Python implementations).  

FUNCTIONS

multibuild_foreach_variant [<argv>...]
Run the passed command repeatedly for each of the enabled package variants.

Each of the runs will have variant-specific BUILD_DIR set, and output teed to a separate log in ${T}.

The function returns 0 if all commands return 0, or the first non-zero exit status otherwise. However, it performs all the invocations nevertheless. It is preferred to call 'die' inside of the passed function.

multibuild_parallel_foreach_variant [<argv>...]
Run the passed command repeatedly for each of the enabled package variants alike multibuild_foreach_variant. Multiple invocations of the command will be performed in parallel, up to MULTIBUILD_JOBS tasks.

The function returns 0 if all commands return 0, or the first non-zero exit status otherwise. However, it performs all the invocations nevertheless. It is preferred to call 'die' inside of the passed function.

multibuild_for_best_variant [<argv>...]
Run the passed command once, for the best of the enabled package variants.

The run will have a proper, variant-specificBUILD_DIR set, and output teed to a separate log in ${T}.

The function returns command exit status.

multibuild_copy_sources
Create per-variant copies of source tree. The source tree is assumed to be in ${BUILD_DIR}, or ${S} if the former is unset. The copies will be placed in directories matching BUILD_DIRs used by multibuild_foreach().
run_in_build_dir <argv>...
Run the given command in the directory pointed by BUILD_DIR.
multibuild_merge_root <src-root> <dest-root>
Merge the directory tree (fake root) from <src-root> to <dest-root> (the real root). Both directories have to be real, absolute paths (i.e. including ${D}). Source root will be removed.

This functions uses locking to support merging during parallel installs.

 

ECLASS VARIABLES

MULTIBUILD_VARIANTS
An array specifying all enabled variants which multibuild_foreach* can execute the process for.

In ebuild, it can be set in global scope. Eclasses should set it locally in function scope to support nesting properly.

Example:

python_foreach_impl() {
local MULTIBUILD_VARIANTS=( python{2_5,2_6,2_7} ... )
multibuild_foreach_variant python_compile
}
MULTIBUILD_VARIANT
The current variant which the function was executed for.

Example value:

python2_6
MULTIBUILD_ID
The unique identifier for a multibuild run. In a simple run, it is equal to MULTIBUILD_VARIANT. In a nested multibuild environment, it contains the complete selection tree.

It can be used to create variant-unique directories and files.

Example value:

amd64-double
BUILD_DIR
The current build directory. In global scope, it is supposed to contain an 'initial' build directory. If unset, ${S} is used.

multibuild_foreach_variant() sets BUILD_DIR locally to variant-specific build directories based on the initial value of BUILD_DIR.

Example value:

${WORKDIR}/foo-1.3-python2_6
 

AUTHORS

Author: Michał Górny <mgorny@gentoo.org>
 

MAINTAINERS

Michał Górny <mgorny@gentoo.org>
 

REPORTING BUGS

Please report bugs via http://bugs.gentoo.org/  

FILES

/usr/portage/eclass/multibuild  

SEE ALSO

ebuild(5)
http://sources.gentoo.org/eclass/multibuild?view=log


 

Index

NAME
DESCRIPTION
FUNCTIONS
ECLASS VARIABLES
AUTHORS
MAINTAINERS
REPORTING BUGS
FILES
SEE ALSO

This document was created by man2html, using the manual pages.
Time: 03:25:02 GMT, October 26, 2014