EAPI 4
Helpers
Removed dohard and dosed
The dohard and dosed helpers from previous EAPIs are no longer available.
All helpers die on failure
All helpers now die automatically whenever some sort of error occurs.
Helper calls may be prefixed with the 'nonfatal' helper in order
to prevent errors from being fatal.
Controllable Compression
In EAPI 4, the package manager may optionally compress
a subset of the files under the D
directory. To control which directories may or may not be compressed, the
package manager shall maintain two lists:
An inclusion list, which initially contains /usr/share/doc, /usr/share/info
and /usr/share/man.
An exclusion list, which initially contains /usr/share/doc/${PF}/html.
The optional compression shall be carried out after src_install has completed,
and before the execution of any subsequent phase function. For each item in the
inclusion list, pretend it has the value of the D variable prepended, then:
If it is a directory, act as if every file or directory immediately under
this directory were in the inclusion list.
If the item is a file, it may be compressed unless it has been excluded as
described below.
If the item does not exist, it is ignored.
Whether an item is to be excluded is determined as follows: For each item in
the exclusion list, pretend it has the value of the D variable prepended, then:
If it is a directory, act as if every file or directory immediately under
this directory were in the exclusion list.
If the item is a file, it shall not be compressed.
If the item does not exist, it is ignored.
The package manager shall take appropriate steps to ensure that its compression
mechanisms behave sensibly even if an item is listed in the inclusion list
multiple times, if an item is a symlink, or if a file is already compressed.
The following commands may be used in src_install to alter these lists. It is
an error to call any of these functions from any other phase.
docompress helper
If the first argument is -x, add each of its subsequent arguments to the
exclusion list. Otherwise, add each argument to the inclusion list.
dodoc -r
The dodoc helper now has a -r option which enables recursion.
doins and newins preserve symlinks
The doins and newins helpers now preserve symlinks. In earlier EAPIs
symlinks are dereferenced rather than preserved.
doman -i18n option takes precedence over filename language suffix
When the doman helper is called with the -i18n option, this takes precedence
over the filename language suffix.
econf adds --disable-dependency-tracking
The econf helper now adds --disable-dependency-tracking to the
configure arguments if the string disable-dependency-tracking
occurs in the output of configure --help.
use_with and use_enable support empty third argument
Beginning with EAPI 4, an empty third argument
is recognized. In EAPI 3 and earlier, an empty third
argument is treated as if it weren't provided.
Phases
New pkg_pretend Phase Function
The pkg_pretend function may be used to carry out sanity checks early on in the
install process. For example, if an ebuild requires a particular kernel
configuration, it may perform that check in pkg_pretend and call eerror and
then die with appropriate messages if the requirement is not met.
pkg_pretend is run separately from the main phase function sequence, and does
not participate in any kind of environment saving. There is no guarantee that
any of an ebuild's dependencies will be met at this stage, and no guarantee
that the system state will not have changed substantially before the next phase
is executed.
pkg_pretend must not write to the filesystem.
Default src_install no longer a no-op
src_install() {
if [[ -f Makefile || -f GNUmakefile || -f makefile ]] ; then
emake DESTDIR="${D}" install
fi
if ! declare -p DOCS &>/dev/null ; then
local d
for d in README* ChangeLog AUTHORS NEWS TODO CHANGES \
THANKS BUGS FAQ CREDITS CHANGELOG ; do
[[ -s "${d}" ]] && dodoc "${d}"
done
elif [[ $(declare -p DOCS) == "declare -a "* ]] ; then
dodoc "${DOCS[@]}"
else
dodoc ${DOCS}
fi
}
S to WORKDIR fallback restricted
For any of the src_* phases that executes after src_unpack,
it is invalid for the S variable to refer to a non-existent
directory. However, these src_* phases are exempt from this
requirement if none of the prior src_* phases are defined by the
ebuild. When a src_* phase is exempt from this requirement, if the
S variable does not refer to an existing directory, the
WORKDIR directory will be used instead of S as the initial working
directory.
Variables
AA and KV variables are no longer exported
The AA and KV variables are no longer exported to the ebuild environment.
MERGE_TYPE
The type of package that is being merged. Possible values are:
"source" if building and installing a package from source, "binary" if installing a binary
package, and "buildonly" if building a binary package without installing it.
REPLACING_VERSIONS and REPLACED_BY_VERSION
The REPLACING_VERSIONS variable
shall be defined in pkg_preinst and pkg_postinst. In addition, it may be
defined in pkg_pretend and pkg_setup, although ebuild authors should take care
to handle binary package creation and installation correctly when using it in
these phases.
REPLACING_VERSIONS is a list, not a single optional value, to handle
pathological cases such as installing foo-2:2 to replace foo-2:1 and foo-3:2.
The REPLACED_BY variable shall
be defined in pkg_prerm and pkg_postrm. It shall contain at most one value.