rebar.eclass

Name

rebar.eclass -- Build Erlang/OTP projects using dev-util/rebar.

Description

An eclass providing functions to build Erlang/OTP projects using dev-util/rebar.

rebar is a tool which tries to resolve dependencies itself which is by cloning remote git repositories. Dependant projects are usually expected to be in sub-directory 'deps' rather than looking at system Erlang lib directory. Projects relying on rebar usually don't have 'install' make targets. The eclass workarounds some of these problems. It handles installation in a generic way for Erlang/OTP structured projects.

Supported EAPIs

6 7 8

Exported Phases

  • src_compile

  • src_test

  • src_install

  • src_prepare

  • src_configure

Functions

get_erl_libs

Get the full path without EPREFIX to Erlang lib directory.

Return value: the path to Erlang lib directory

rebar_disable_coverage [<rebar_config>]

Disable coverage in rebar.config. This is a workaround for failing coverage. Coverage is not relevant in this context, so there's no harm to disable it, although the issue should be fixed.

erebar <targets>

Run rebar with verbose flag. Die on failure.

rebar_fix_include_path <project_name> [<rebar_config>]

Fix path in rebar.config to 'include' directory of dependant project/package, so it points to installation in system Erlang lib rather than relative 'deps' directory.

<rebar_config> is optional. Default is 'rebar.config'.

The function dies on failure.

rebar_remove_deps [<rebar_config>]

Remove dependencies list from rebar.config and deceive build rules that any dependencies are already fetched and built. Otherwise rebar tries to fetch dependencies and compile them.

<rebar_config> is optional. Default is 'rebar.config'.

The function dies on failure.

rebar_set_vsn [<version>]

Set version in project description file if it's not set.

<version> is optional. Default is PV stripped from version suffix.

The function dies on failure.

rebar_src_prepare

Prevent rebar from fetching and compiling dependencies. Set version in project description file if it's not set.

Existence of rebar.config is optional, but file description file must exist at 'src/${PN}.app.src'.

rebar_src_configure

Configure with ERL_LIBS set.

rebar_src_compile

Compile project with rebar.

rebar_src_test

Run unit tests.

rebar_src_install

Install BEAM files, include headers, executables and native libraries. Install standard docs like README or defined in DOCS variable.

Function expects that project conforms to Erlang/OTP structure.

Variables

REBAR_APP_SRC = "${REBAR_APP_SRC-src/${PN}.app.src}"

Relative path to .app.src description file.

Authors

Amadeusz Żołnowski <aidecoe@gentoo.org>

Reporting Bugs

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