Content-type: text/html
Examples:
sys-apps/sed sys-libs/zlib net-misc/dhcp
Examples:
sys-apps/sed-4.0.5 sys-libs/zlib-1.1.4-r1 net-misc/dhcp-3.0_p2
Versions are normally made up of two or three numbers separated by periods, such as 1.2 or 4.5.2. This string may be followed by a character such as 1.2a or 4.5.2z. Note that this letter is not meant to indicate alpha, beta, etc... status. For that, use the optional suffix; either _alpha, _beta, _pre (pre-release), _rc (release candidate), or _p (patch). This means for the 3rd pre-release of a package, you would use something like 1.2_pre3. The suffixes here can be arbitrarily chained without limitation.
Examples:
>media-libs/libgd-1.6 >=media-libs/libgd-1.6 =media-libs/libgd-1.6 <=media-libs/libgd-1.6 <media-libs/libgd-1.6
Example:
~net-libs/libnet-1.0.2a
Example:
!app-text/dos2unix
Example:
!!<sys-apps/portage-2.1.4_rc1
Examples:
=dev-libs/glib-2* !=net-fs/samba-2*
Examples:
x11-libs/qt:3 ~x11-libs/qt-3.3.8:3 >=x11-libs/qt-3.3.8:3 =x11-libs/qt-3.3*:3
Examples:
dev-libs/icu:0/0 dev-libs/icu:0/49 dev-lang/perl:0/5.12 dev-libs/glib:2/2.30
Examples:
dev-libs/icu:* dev-lang/perl:* dev-libs/glib:*
Examples:
dev-libs/icu:= dev-lang/perl:= dev-libs/glib:=
Examples:
dev-libs/icu:0= dev-lang/perl:0= dev-libs/glib:2=
To implement the equals slot operator, the package manager will need to store the slot/sub-slot pair of the best installed version of the matching package. This syntax is only for package manager use and must not be used by ebuilds. The package manager may do this by inserting the appropriate slot/sub-slot pair between the colon and equals sign when saving the package's dependencies. The sub-slot part must not be omitted here (when the SLOT variable omits the sub-slot part, the package is considered to have an implicit sub-slot which is equal to the regular slot).
Examples:
dev-libs/icu:0/0= dev-libs/icu:0/49= dev-lang/perl:0/5.12= dev-libs/glib:2/2.30=
Example | Meaning |
foo[bar,baz] | foo must have both bar and baz enabled |
foo[-bar,baz] | foo must have bar disabled and baz enabled |
Compact Form | Equivalent Expanded Form |
foo[!bar?] | bar? ( foo ) !bar? ( foo[-bar] ) |
foo[bar=] | bar? ( foo[bar] ) !bar? ( foo[-bar] ) |
foo[!bar=] | bar? ( foo[-bar] ) !bar? ( foo[bar] ) |
Examples:
media-video/ffmpeg[threads(+)] media-video/ffmpeg[-threads(-)]
jpeg? ( media-libs/jpeg )
!nophysfs? ( dev-games/physfs )
This is often useful for those times when you want to want to add optional support for a feature and have it enabled by default.
gtk2? ( =x11-libs/gtk+-2* ) !gtk2? ( =x11-libs/gtk+-1* )
That way the default is the superior GTK2 library.
Example:
|| ( app-games/unreal-tournament app-games/unreal-tournament-goty )
Here we see that unreal-tournament has a normal version and it has a goty version. Since they provide the same base set of files, another package can use either. Adding a virtual is inappropriate due to the small scope of it.
Another good example is when a package can be built with multiple video interfaces, but it can only ever have just one.
Example:
|| ( sdl? ( media-libs/libsdl ) svga? ( media-libs/svgalib ) opengl? ( virtual/opengl ) ggi? ( media-libs/libggi ) virtual/x11 )
Here only one of the packages will be chosen, and the order of preference is determined by the order in which they appear. So sdl has the best chance of being chosen, followed by svga, then opengl, then ggi, with a default of X if the user does not specify any of the previous choices.
Note that if any of the packages listed are already merged, the package manager will use that to consider the dependency satisfied.
If ROOT is "/", all dependency types will be installed there. Otherwise, for EAPIs that support HDEPEND (experimental EAPI 5-hdepend), only HDEPEND is installed into "/". For EAPIs that do not support HDEPEND, the behaviour is controlled by the --root-deps flag to emerge(1), defaulting to install only DEPEND into the host.
For EAPIs that support HDEPEND (experimental EAPI 5-hdepend), DEPEND, RDEPEND, and PDEPEND list the target dependencies, i.e. those to be installed into ROOT. For EAPIs that do not support HDEPEND, the emerge(1) flag --root-deps controls what the package manager installs there. Without it, emerge defaults to install only runtime dependencies (i.e. RDEPEND and PDEPEND) into ROOT.
See section VARIABLES for more information about the DEPEND, RDEPEND and HDEPEND variables.
xfree-4.2.1-r2.ebuild --> $P=='xfree-4.2.1'
xfree-4.2.1-r2.ebuild --> $PN=='xfree'
xfree-4.2.1-r2.ebuild --> $PV=='4.2.1'
xfree-4.2.1-r2.ebuild --> $PR=='r2'
xfree-4.2.1-r2.ebuild --> $PVR=='4.2.1-r2'
xfree-4.2.1-r2.ebuild --> $PF=='xfree-4.2.1-r2'
Value | Meaning |
buildonly | source-build which is not scheduled for merge |
source | source-build which is scheduled for merge |
Beginning with EAPI 5, the SLOT variable may contain an optional sub-slot part that follows the regular slot and is delimited by a / character. The sub-slot must be a valid slot name. The sub-slot is used to represent cases in which an upgrade to a new version of a package with a different sub-slot may require dependent packages to be rebuilt. When the sub-slot part is omitted from the SLOT definition, the package is considered to have an implicit sub-slot which is equal to the regular slot. Refer to the Atom Slot Operators section for more information about sub-slot usage.
Starting from experimental EAPI 5-hdepend, tools should go into the HDEPEND variable instead, as DEPEND will only be installed into the target system and hence cannot be executed in a cross-compile setting. (See section Cross-compilation for more information.)
You may use the syntax described above in the Dependencies section.
In EAPI 3 or earlier, if this is not set, then it defaults to the value of DEPEND. In EAPI 4 or later, RDEPEND will never be implicitly set.
You may use the syntax described above in the Dependencies section.
This variable is new in experimental EAPI 5-hdepend and will be installed into the host system. (See section Cross-compilation for more information.)
You may use the syntax described above in the Dependencies section.
***WARNING***
Use this only as last resort to break cyclic dependencies!
You may use the syntax described above in the Dependencies section.
Behavior | Expression |
If flag1 enabled then flag2 enabled | flag1? ( flag2 ) |
If flag1 disabled then flag2 enabled | !flag1? ( flag2 ) |
If flag1 disabled then flag2 disabled | !flag1? ( !flag2 ) |
Must enable any one or more (inclusive or) | || ( flag1 flag2 flag3 ) |
Must enable exactly one but not more (exclusive or) | ^^ ( flag1 flag2 flag3 ) |
May enable at most one (EAPI 5 or later) | ?? ( flag1 flag2 flag3 ) |
The PROVIDE variable has been deprecated. See https://wiki.gentoo.org/wiki/GLEP:37 for details.
Note that objects that violate these rules may fail on some architectures.
This variable is intended to be used on closed-source binary objects that cannot be altered.
This variable is intended to be used on objects that truly need executable stack (i.e. not those marked to need it which in fact do not).
This variable is intended to be used on files of binary packages which ignore CFLAGS, CXXFLAGS, FFLAGS, FCFLAGS, and LDFLAGS variables.
Beginning with EAPI 4, if src_install is undefined then the following default implementation is used:
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 }
Default Phase Functions |
default_src_unpack |
default_src_prepare |
default_src_configure |
default_src_compile |
default_src_test |
Beginning with EAPI 4, all helpers automatically call die whenever some sort of error occurs. Helper calls may be prefixed with the nonfatal helper in order to prevent errors from being fatal.
if use gnome ; then guiconf="--enable-gui=gnome --with-x" elif use gtk ; then guiconf="--enable-gui=gtk --with-x" elif use X ; then guiconf="--enable-gui=athena --with-x" else # No gui version will be built guiconf="" fi
USE="opengl" myconf=$(use_with opengl) (myconf now has the value "--with-opengl") USE="jpeg" myconf=$(use_with jpeg libjpeg) (myconf now has the value "--with-libjpeg") USE="" myconf=$(use_with jpeg libjpeg) (myconf now has the value "--without-libjpeg") USE="sdl" myconf=$(use_with sdl SDL all-plugins) (myconf now has the value "--with-SDL=all-plugins")
Example:
VERINS="$(best_version net-ftp/glftpd)" (VERINS now has the value "net-ftp/glftpd-1.27" if glftpd-1.27 is installed)
${ECONF_SOURCE:-.}/configure \ ${CBUILD:+--build=${CBUILD}} \ --datadir="${EPREFIX}"/usr/share \ --host=${CHOST} \ --infodir="${EPREFIX}"/usr/share/info \ --localstatedir="${EPREFIX}"/var/lib \ --prefix="${EPREFIX}"/usr \ --mandir="${EPREFIX}"/usr/share/man \ --sysconfdir="${EPREFIX}"/etc \ ${CTARGET:+--target=${CTARGET}} \ --disable-dependency-tracking \ ${EXTRA_ECONF} \ configure options || die "econf failed"Note that the EXTRA_ECONF is for users only, not for ebuild writers. If you wish to pass more options to configure, just pass the extra arguments to econf. Also note that econf automatically calls die if the configure script fails. Beginning with EAPI 3, econf uses the ${EPREFIX} variable which is disregarded for prior EAPI values. Beginning with EAPI 4, econf adds --disable-dependency-tracking to the arguments if the string disable-dependency-tracking occurs in the output of configure --help. Beginning with EAPI 5, econf adds disable-silent-rules to the arguments if the string disable-silent-rules occurs in the output of configure --help.
The MAKEOPTS variable is set by the user so they can enable features such as parallel builds; see make.conf(5) for more details.
The EXTRA_EMAKE knob is portage feature so developers can override things while debugging ebuilds; it is not part of any EAPI specification.
***WARNING***
You must make sure your build is happy with parallel makes (make -j2). It
should be tested thoroughly as parallel makes are notorious for failing
_sometimes_ but not always. If you determine that your package fails to build
in parallel, and you are unable to resolve the issue, then you should run
`emake -j1` explicitly. This is a last resort however as it can
significantly slow down builds on systems with lots of processors.
make \ prefix=${ED}/usr \ datadir=${ED}/usr/share \ infodir=${ED}/usr/share/info \ localstatedir=${ED}/var/lib \ mandir=${ED}/usr/share/man \ sysconfdir=${ED}/etc \ ${EXTRA_EINSTALL} \ make options \ installPlease do not use this in place of 'emake install DESTDIR=${D}'. That is the preferred way of installing make-based packages. Also, do not utilize the EXTRA_EINSTALL variable since it is for users.
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 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 the item is a file, it shall not be compressed.
If the item does not exist, it is ignored.
Performs sed in place on filename inside ${ED}. If no expression is
given then "s:${D}::g" is used as the default expression. Note
that this expression does NOT use the offset prefix.
'dosed s:/usr/local:/usr:g /usr/bin/some-script'
runs sed on ${ED}/usr/bin/some-script
# Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ EAPI="5" inherit some_eclass another_eclass DESCRIPTION="Super-useful stream editor (sed)" HOMEPAGE="https://www.gnu.org/software/sed/" SRC_URI="ftp://alpha.gnu.org/pub/gnu/${PN}/${P}.tar.gz" LICENSE="GPL-2" SLOT="0" KEYWORDS="~x86" IUSE="" RDEPEND="" DEPEND="nls? ( sys-devel/gettext )" src_configure() { econf \ --bindir="${EPREFIX}"/bin } src_install() { emake DESTDIR="${D}" install dodoc NEWS README* THANKS AUTHORS BUGS ChangeLog }
Achim Gottinger <achim@gentoo.org> Mark Guertin <gerk@gentoo.org> Nicholas Jones <carpaski@gentoo.org> Mike Frysinger <vapier@gentoo.org> Arfrever Frehtes Taifersar Arahesis <arfrever@apache.org> Fabian Groffen <grobian@gentoo.org>