The Funtoo Linux project has transitioned to "Hobby Mode" and this wiki is now read-only.
EAPI 6
A new EAPI=6 has been released as of 2015-11-13. A noticeable changes and explanation of new features are given below.
bash version
Bash version Ebuilds can use features of Bash version 4.2 (was 3.2 before).
The ebuild file format is in its basic form a subset of the format of a bash script. The interpreter is BASH-VERSION assumed to be GNU bash, version as listed in table below, or any later version. If possible, the package manager should set the shell’s compatibility level to the exact version specified. It must ensure that any such compatibility settings (e.g. the BASH_COMPAT variable) are not exported to external programs.
EAPI | Bash version |
---|---|
0,1,2,3,4,5 | 3.2 |
6 | 4.2 |
Bash's failglob option
The failglob
option of Bash is set in global scope, so that unintentional pattern expansion will be caught as an error.
For EAPIs listed table the failglob option of bash is set in the global scope of ebuilds. FAILGLOB
If set, failed pattern matches during filename expansion result in an error when the ebuild is being
sourced
EAPI | GNU find? | failglob in global scope? |
---|---|---|
0,1,2,3,4 | Undefined | No |
5 | Yes | No |
6 | Yes | Yes |
Locale settings
It is ensured that the behavior of case modification and collation order for ASCII characters (LC_CTYPE and LC_COLLATE) are the same as in the POSIX locale. The package manager must ensure that the LC_CTYPE and LC_COLLATE locale categories are equivalent to the POSIX locale, as far as characters in the ASCII range (U+0000 to U+007F) are concerned. Only for EAPIs listed in such a manner in table.
EAPI | Sane LC_CTYPE and LC_COLLATE? |
---|---|
0,1,2,3,4,5 | No |
6 | Yes |
Ebuild Functions changes
src_prepare
This phase function has a default now, which applies patches from the PATCHES variable with the new eapply
command, and user-provided patches
with eapply_user
, formerly known epatch_user
.
Example of code:
src_prepare() { if declare -p PATCHES | grep -q "^declare -a "; then [[ -n ${PATCHES[@]} ]] && eapply "${PATCHES[@]}" else [[ -n ${PATCHES} ]] && eapply ${PATCHES} fi eapply_user }
nonfatal die
When die
or assert
are called under the nonfatal
command and with the -n
option, they
will not abort the build process but return with an error.
These commands are used when an error is detected that will prevent the build process from completing.
Ebuilds must not run any of these commands once the current phase function has returned.
- die If called under the
nonfatal
command and with-n
as its first parameter, displays a failure message provided in its following argument and then returns a non-zero exit status. Only in EAPIs listed in table as supporting option-n
. Otherwise, displays a failure message provided in its first and only argument, and then aborts the build process. die is not guaranteed to work correctly if called from a subshell environment. - assert Checks the value of the shell’s pipe status variable, and if any component is non-zero (indicating failure), calls die, passing any parameters to it.
EAPI | die and assert support -n? |
---|---|
0,1,2,3,4,5 | No |
6 | Yes |
src_unpack
pathnames
Both absolute paths and paths relative to the working directory are accepted as arguments. Unpacks one or more source archives, in order, into the current directory. After unpacking, must ensure that all filesystem objects inside the current working directory (but not the currentworking directory itself) have permissions a+r,u+w,go-w and that all directories under the current working directory additionally have permissions a+x. Arguments to unpack are interpreted as follows:
- A filename without path (i. e., not containing any slash) is looked up in
DISTDIR
. - An argument starting with the string ./ is a path relative to the working directory.
- Otherwise, for EAPIs listed in table as supporting absolute and relative paths, the argument is interpreted as a literal path (absolute, or relative to the working directory); for EAPIs listed as not supporting such paths, unpack shall abort the build process.