multibuild.eclass

Name

multibuild.eclass -- 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).

Supported EAPIs

6 7 8

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_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.

Variables

MULTIBUILD_VARIANTS (REQUIRED)

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 (GENERATED BY ECLASS)

The current variant which the function was executed for.

Example value:

python2_6
MULTIBUILD_ID (GENERATED BY ECLASS)

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 (GENERATED BY ECLASS)

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 https://bugs.gentoo.org/