llvm.org.eclass

Name

llvm.org.eclass -- Common bits for fetching & unpacking llvm.org projects

Description

The llvm.org eclass provides common code to fetch and unpack parts of the llvm.org project tree. It takes care of handling both git checkouts and source tarballs, making it possible to unify the code of live and release ebuilds and effectively reduce the work needed to package new releases/RCs/branches.

In order to use this eclass, the ebuild needs to declare LLVM_COMPONENTS and then call llvm.org_set_globals. If tests require additional components, they need to be listed in LLVM_TEST_COMPONENTS. The eclass exports an implementation of src_unpack() phase.

Example:

inherit llvm.org

LLVM_COMPONENTS=( lld )
LLVM_TEST_COMPONENTS=( llvm/utils/lit )
llvm.org_set_globals

Supported EAPIs

7 8

Exported Phases

  • src_unpack

  • src_prepare

Functions

llvm.org_set_globals

Set global variables. This must be called after setting LLVM_* variables used by the eclass.

llvm.org_src_unpack

Unpack or checkout requested LLVM components.

llvm.org_src_prepare

Call appropriate src_prepare (cmake or default) depending on inherited eclasses. Make sure that PATCHES and user patches are applied in top ${WORKDIR}, so that patches straight from llvm-project repository work correctly with -p1.

get_lit_flags

Get the standard recommended lit flags for running tests, in CMake list form (;-separated).

llvm_manpage_dist_available

Return true (0) if this LLVM version features prebuilt manpage tarball, false (1) otherwise.

llvm_are_manpages_built

Return true (0) if manpages are going to be built from source, false (1) if preinstalled manpages will be used.

llvm_install_manpages

Install pregenerated manpages if available. No-op otherwise.

Variables

LLVM_COMPONENTS (REQUIRED)

List of components needed unconditionally. Specified as bash array with paths relative to llvm-project git. Automatically translated for tarball releases.

The first path specified is used to construct default S.

LLVM_TEST_COMPONENTS

List of additional components needed for tests.

LLVM_MANPAGES

Set to a non-empty value in ebuilds that build manpages via Sphinx. The eclass will either include the dependency on dev-python/sphinx or pull the pregenerated manpage tarball depending on the package version.

LLVM_PATCHSET

LLVM patchset version. No patchset is used if unset.

LLVM_USE_TARGETS

Add LLVM_TARGETS flags. The following values are supported:

  • provide - this package provides LLVM targets. USE flags and REQUIRED_USE will be added but no dependencies.

  • llvm - this package uses targets from LLVM. RDEPEND+DEPEND on matching sys-devel/llvm versions with requested flags will be added.

Note that you still need to pass enabled targets to the build system, usually grabbing them from ${LLVM_TARGETS} (via USE_EXPAND).

ALL_LLVM_EXPERIMENTAL_TARGETS (GENERATED BY ECLASS)

The complete list of LLVM experimental targets available in this LLVM version. The value depends on ${PV}.

ALL_LLVM_PRODUCTION_TARGETS (GENERATED BY ECLASS)

The complete list of LLVM production-ready targets available in this LLVM version. The value depends on ${PV}.

ALL_LLVM_TARGET_FLAGS (GENERATED BY ECLASS)

The list of USE flags corresponding to all LLVM targets in this LLVM version. The value depends on ${PV}.

LIT_JOBS (USER VARIABLE)

Number of test jobs to run simultaneously. If unset, defaults to '-j' in MAKEOPTS. If that is not found, default to nproc.

Authors

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

Maintainers

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

Reporting Bugs

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