DOKK Library

EAPI Cheat Sheet Version 8.0

Authors Christian Faulhammer Ulrich Müller

License CC-BY-SA-4.0

Plaintext
                                                                 ......................................................................................................................................................




                                                                                                                                                                                                                                                                                              ......................................................................................................................................................
Removals/Bans                                                                                                                                                                                                                 IUSE, REQUIRED_USE, and *DEPEND were before.
                                                                                                                                                                                                                              See ACCUMULATE - VARS on page 49.
package.provided Deprecated since a long time and
   finally dropped. See PACKAGE - PROVIDED on page 25.                                                                                                                                                                    econf If supported, options --disable-static and
PORTDIR and ECLASSDIR No longer defined, because
                                                                                                                                                                                                                             --datarootdir=${EPREFIX}/usr/share are                                                                                                                                                                                                      EAPI Cheat Sheet
                                                                                                                                                                                                                              passed to configure, respectively. See ECONF - OPTIONS
   ebuilds should not directly access files in the repository.
                                                                                                                                                                                                                              on page 65.
   See PORTDIR on page 53 and ECLASSDIR on page 53.                                                                                                                                                                                                                                                                                                                                                                                                          Christian Faulhammer                     Ulrich Müller
                                                                                                                                                                                                                          dosym With the new option -r, an absolute path specified                                                                                                                                                                             fauli@gentoo.org                     ulm@gentoo.org
DESTTREE and INSDESTTREE Not defined any more.
                                                                                                                                                                                                                              for the link target will be converted to a path relative to
   Use the into and insinto commands instead. See
                                                                                                                                                                                                                              the link location. See DOSYM - RELATIVE on page 69.
   DESTTREE   on page 54 and INSDESTTREE on page 54.                                                                                                                                                                                                                                                                                                                                                                                                                               Version 8.0
                                                                                                                                                                                                                          insopts Commands doconfd, doenvd, doheader                                                                                                                                                                                                             13th June 2021
dohtml No longer allowed. doins -r can be used as a
                                                                                                                                                                                                                              install files with fixed mode 0644, i. e., they are no longer
   replacement. See BANNED - COMMANDS on page 61.
                                                                                                                                                                                                                              affected by insopts. See INSOPTS on page 71.
dolib and libopts No longer allowed. The specific                                                                                                                                                                                                                                                                                                                                                                                                                                       Abstract
                                                                                                                                                                                                                          exeopts Command doinitd installs files with fixed
   dolib.a or dolib.so commands should be used
                                                                                                                                                                                                                             mode 0755, i. e., it is no longer affected by exeopts.
   as replacement. See BANNED - COMMANDS on page 61.                                                                                                                                                                                                                                                                                                                                                                                                             An overview of the main EAPI changes in Gentoo, for
                                                                                                                                                                                                                              See EXEOPTS on page 71.
                                                                                                                                                                                                                                                                                                                                                                                                                                                             ebuild authors. For full details, consult the Package Man-
                                                                                                                                                                                                                          usev This helper has an optional second argument now:                                                                                                                                                                              ager Specification found on the project page;1 this is an
EAPI 8 (2021-06-13)                                                                                                                                                                                                          usev <flag> [true]. If the flag is set, outputs [true], or the                                                                                                                                                                  incomplete summary only.
                                                                                                                                                                                                                              flag’s name if called with only one argument. Otherwise                                                                                                                                                                            Official Gentoo EAPIs are consecutively numbered in-
Additions/Changes                                                                                                                                                                                                             outputs nothing. See USEV on page 73.                                                                                                                                                                                          tegers (0, 1, 2, . . . ). Except where otherwise noted, an
                                                                                                                                                                                                                                                                                                                                                                                                                                                             EAPI is the same as the previous EAPI. All labels refer to
profiles/updates directory Arbitrary filenames are                                                                                                                                                                                                                                                                                                                                                                                                           the PMS document itself, built from the same checkout as
   now allowed, instead of strict naming by quarters (like                                                                                                                                                                Removals/Bans                                                                                                                                                                                                                      this overview.
   2Q-2021). See UPDATES - FILENAMES on page 21.                                                                                                                                                                                                                                                                                                                                                                                                                 This work is released under the Creative Commons
                                                                                                                                                                                                                          useq No longer allowed. Use regular use as a drop-in
Bash version Ebuilds can use features of Bash version 5.0                                                                                                                                                                                                                                                                                                                                                                                                    Attribution-ShareAlike 4.0 International Licence.2
                                                                                                                                                                                                                              replacement. See BANNED - COMMANDS on page 61.
   (was 4.2 before). See BASH - VERSION on page 29.
                                                                                                                                                                                                                          hasv and hasq No longer allowed. Regular has should
Selective fetch/mirror restriction In SRC_URI, adding a                                                                                                                                                                       be used instead. See BANNED - COMMANDS on page 61.                                                                                                                                                                       EAPIs 0, 1, 2, 3, 4, and 5
   fetch+ or mirror+ prefix to an individual URI means
   that the file may be fetched or mirrored. This overrides                                                                                                                                                               unpack No longer supports unpacking of 7-Zip, RAR, and                                                                                                                                                                       Omitted for lack of space. See version 5.0 of this document
   the corresponding global settings in the RESTRICT                                                                                                                                                                          LHA archives. See UNPACK - EXTENSIONS on page 76.                                                                                                                                                                        for differences between these previous EAPIs.
   variable. See URI - RESTRICT on page 32.
IDEPEND This variable specifies install-time dependen-
                                                                                                                                                                                                                                                                                                                                                                                                                                                       EAPI 6 (2015-11-13)
   cies on packages used in (e. g.) pkg_postinst. In a
   cross-compilation environment, these are dependencies                                                                                                                                                                                                                                                                                                                                                                                               Additions/Changes
   for native tools (CBUILD). See IDEPEND on page 35.
                                                                                                                                                                                                                                                                                                                                                                                                                                                       Bash version Ebuilds can use features of Bash version 4.2
pkg_* phases The initial working directory is guaranteed                                                                                                                                                                                                                                                                                                                                                                                                  (was 3.2 before). See BASH - VERSION on page 29.
   to be empty. See PHASE - FUNCTION - DIR on page 41.
                                                                                                                                                                                                                                                                                                                                                                                                                                                       failglob The failglob option of Bash is set in global
src_prepare Items in the PATCHES variable are inter-                                                                                                                                                                                                                                                                                                                                                                                                         scope, so that unintentional pattern expansion will be
   preted as files, even if their name begins with a hyphen.                                                                                                                                                                                                                                                                                                                                                                                                 caught as an error. See FAILGLOB on page 29.
   See SRC - PREPARE on page 43.
                                                                                                                                                                                                                                                                                                                                                                                                                                                         1
                                                                                                                                                                                                                                                                                                                                                                                                                                                             https://wiki.gentoo.org/wiki/Project:Package_Manager_Specification
PROPERTIES and RESTRICT These variables are accu-                                                                                                                                                                                                                                                                                                                                                                                                        2
                                                                                                                                                                                                                                                                                                                                                                                                                                                             https://creativecommons.org/licenses/by-sa/4.0/
   mulated across the ebuild and inherited eclasses, like
Locale settings It is ensured that the behaviour of case                                                                                                                                                                   get_libdir The get_libdir command outputs the                                                                                                                                                                                 has_version and best_version These helpers
   modification and collation order for ASCII characters                                                                                                                                                                      lib* directory basename suitable for the current ABI.                                                                                                                                                                         support -b, -d or -r options, causing the query
   (LC_CTYPE and LC_COLLATE) are the same as in the                                                                                                                                                                           See GET- LIBDIR on page 77.                                                                                                                                                                                                   to apply to BDEPEND, DEPEND or RDEPEND (the
   POSIX locale. See LOCALE - SETTINGS on page 56.                                                                                                                                                                                                                                                                                                                                                                                                          default). This replaces the --host-root option.
src_prepare This phase function has a default now,                                                                                                                                                                         Removals/Bans                                                                                                                                                                                                                    See PM - QUERY- OPTIONS on page 62.
   which applies patches from the PATCHES variable with                                                                                                                                                                                                                                                                                                                                                                                               Environment blacklist Any environment variable listed in
                                                                                                                                                                                                                           einstall No longer allowed. Use emake install
   the new eapply command, and user-provided patches                                                                                                                                                                                                                                                                                                                                                                                                     the profile-defined ENV_UNSET variable will be unset
                                                                                                                                                                                                                              as replacement. See BANNED - COMMANDS on page 61.
   with eapply_user. See SRC - PREPARE on page 43.                                                                                                                                                                                                                                                                                                                                                                                                       by the package manager. See ENV- UNSET on page 56.
src_install The default implementation uses the new                                                                                                                                                                                                                                                                                                                                                                                                   patch All inputs valid for GNU patch version 2.7 are sup-
   einstalldocs function for installing documentation.                                                                                                                                                                     EAPI 7 (2018-04-30)                                                                                                                                                                                                           ported. Especially, this includes support for git-formatted
   See SRC - INSTALL on page 45.                                                                                                                                                                                                                                                                                                                                                                                                                         patches. See GNU - PATCH on page 60.
                                                                                                                                                                                                                           Additions/Changes
nonfatal die When die or assert are called under                                                                                                                                                                                                                                                                                                                                                                                                      nonfatal In addition to its definition as a shell function,
   the nonfatal command and with the -n option, they                                                                                                                                                                       package.* and use.* These profile files can be direc-                                                                                                                                                                         the nonfatal wrapper has now a fallback implemen-
   will not abort the build process but return with an error.                                                                                                                                                                 tories instead of regular files. This is intended to be used                                                                                                                                                               tation as an external command. Thus, it can be called
   See NONFATAL - DIE on page 63.                                                                                                                                                                                             in overlays only. See PACKAGE - MASK - DIR on page 19                                                                                                                                                                      from other commands. See NONFATAL on page 61.
unpack changes unpack has been extended:                                                                                                                                                                                      and PROFILE - FILE - DIRS on page 24.
                                                                                                                                                                                                                                                                                                                                                                                                                                                      Output commands einfo and friends no longer use std-
    Pathnames Both absolute paths and paths relative to                                                                                                                                                                    || and ^^ dependency groups These groups now eval-                                                                                                                                                                            out, so inside of command substitution their output won’t
       the working directory are accepted as arguments.                                                                                                                                                                       uate to false when they are empty (for example, if there                                                                                                                                                                   be caught. See OUTPUT- NO - STDOUT on page 62.
       See UNPACK - ABSOLUTE on page 76.                                                                                                                                                                                      are only unmatched use dependencies inside of them).
                                                                                                                                                                                                                              See EMPTY- DEP - GROUPS on page 37.                                                                                                                                                                                     eqawarn The eqawarn output command is supported in
    .txz files Suffix .txz for xz compressed tarballs is                                                                                                                                                                                                                                                                                                                                                                                                 the package manager itself. See EQAWARN on page 63.
        recognised. See UNPACK - EXTENSIONS on page 76.                                                                                                                                                                    No trailing slash The paths specified by ROOT, EROOT,
                                                                                                                                                                                                                              D, and ED no longer end with a slash. Thus, default                                                                                                                                                                     die in subshell The die command is guaranteed to work
    Filename case Character case of filename extensions                                                                                                                                                                                                                                                                                                                                                                                                  in a subshell context. See SUBSHELL - DIE on page 63.
                                                                                                                                                                                                                              ROOT is empty now. See TRAILING - SLASH on page 58.
        is ignored. See UNPACK - IGNORE - CASE on page 76.
                                                                                                                                                                                                                           Cross compilation support Several variables have been                                                                                                                                                                      domo destination domo installs the specified files under
econf changes Options --docdir and --htmldir                                                                                                                                                                                                                                                                                                                                                                                                             /usr/share/locale instead of ${DESTTREE}/
                                                                                                                                                                                                                              added and some commands have been extended for
   are passed to configure, in addition to the existing                                                                                                                                                                                                                                                                                                                                                                                                  share/locale. See DOMO - PATH on page 69.
                                                                                                                                                                                                                              better cross compilation support:
   options. See ECONF - OPTIONS on page 65.
                                                                                                                                                                                                                               BDEPEND Build dependencies are divided into two                                                                                                                                                                        Controllable stripping The dostrip -x command can
eapply The eapply command is a simplified substitute                                                                                                                                                                                                                                                                                                                                                                                                     be used to add paths to an exclusion list for stripping of
   for epatch, implemented in the package manager. The                                                                                                                                                                            classes: BDEPEND for native build tools (CBUILD);
                                                                                                                                                                                                                                  DEPEND for dependencies compatible with the sys-                                                                                                                                                                       debug symbols, to allow more fine-grained control than
   patches from its file or directory arguments are applied                                                                                                                                                                                                                                                                                                                                                                                              with RESTRICT="strip". See DOSTRIP on page 72.
   using patch -p1. See EAPPLY on page 63.                                                                                                                                                                                        tem being built (CHOST). See BDEPEND on page 35.
                                                                                                                                                                                                                               SYSROOT The path to the root directory for DEPEND                                                                                                                                                                      Version manipulation and comparison commands
eapply_user The eapply_user command permits
   the package manager to apply user-provided patches.                                                                                                                                                                            type dependencies. See SYSROOT on page 53.                                                                                                                                                                             ver_cut range [version] Print the version substring
   It must be called from every src_prepare function.                                                                                                                                                                          ESYSROOT The concatenation of SYSROOT and the                                                                                                                                                                                specified by range. version defaults to PV.
   See EAPPLY- USER on page 65.                                                                                                                                                                                                    applicable offset-prefix. See SYSROOT on page 53.                                                                                                                                                                     ver_rs range repl . . . [version] Replace all version
einstalldocs The einstalldocs function will in-                                                                                                                                                                                BROOT The prefixed root directory path for BDEPEND                                                                                                                                                                           separators in range by string repl. Multiple range
   stall the files specified by the DOCS variable (or a default                                                                                                                                                                   type dependencies, typically executable build tools.                                                                                                                                                                      repl pairs are allowed. version defaults to PV.
   set of files if DOCS is unset) and by the HTML_DOCS                                                                                                                                                                            See BROOT on page 53.                                                                                                                                                                                                  ver_test [v1] op v2 Check if the relation v1 op v2 is
   variable. See EINSTALLDOCS on page 77.                                                                                                                                                                                                                                                                                                                                                                                                                   true. v1 defaults to PVR; op can be -eq, -ne, -gt,
                                                                                                                                                                                                                               econf If supported, configure will be called with the
in_iuse The in_iuse function returns true if the USE                                                                                                                                                                              --with-sysroot=${ESYSROOT:-/} option.                                                                                                                                                                                      -ge, -lt or -le.
   flag given as its argument is available in the ebuild for                                                                                                                                                                       See ECONF - OPTIONS on page 65.                                                                                                                                                                                       See VER - COMMANDS on page 74.
   USE queries. See IN - IUSE on page 73.




                                                                  ......................................................................................................................................................
                                                                                                                                                                                                                                                                                             ......................................................................................................................................................