summaryrefslogtreecommitdiff
blob: 236cc6d4b7978728702a0d0a136afeb5042b99e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
\chapter{Dependencies}
\label{dependencies}

\section{Dependency Classes}

There are three classes of dependencies supported by ebuilds:

\begin{bulletlist}
\item Build dependencies (\t{DEPEND}). These must be installed before the ebuild is installed.
\item Runtime dependencies (\t{RDEPEND}). These should usually be installed before the ebuild,
    but may be dropped to post dependencies where necessary to resolve cycles.
\item Post dependencies (\t{PDEPEND}). These should be installed at some point, usually after
    the ebuild if they are not already installed.
\end{bulletlist}

In addition, \t{SRC\_URI}, \t{HOMEPAGE}, \t{PROVIDE} and \t{LICENSE} use dependency-style
specifications to specify their values.

\section{Dependency Specification Format}

The following elements are recognised in at least one class of specification. All elements must
be surrounded on both sides by whitespace, except at the start and end of the string.

\begin{bulletlist}
\item A package dependency specification. Permitted in \t{DEPEND}, \t{RDEPEND}, \t{PDEPEND}.
\item A simple qualified package name. Permitted in \t{PROVIDE} (and inside \t{DEPEND} etc
    via the previous item).
\item A URI, in the form \t{proto://host/path}. Permitted in \t{SRC\_URI} and \t{HOMEPAGE}.
\item A flat filename. Permitted in \t{SRC\_URI}.
\item A license name (e.g. \t{GPL-2}). Permitted in \t{LICENSE}.
\item An all-of group, which consists of an open parenthesis, followed by whitespace,
    followed by zero or more of (a dependency item of any kind followed by whitespace), followed
    by a close parenthesis. More formally:
    \t{all-of ::= '(' whitespace (item whitespace)* ')'}. Permitted in all specification style
    variables.
\item An any-of group, which consists of the string \t{||}, followed by whitespace,
    followed by an open parenthesis, followed by whitespace, followed by zero or more
    of (a dependency item of any kind followed by whitespace), followed by a close parenthesis.
    More formally: \t{any-of ::= '||' whitespace '(' whitespace (item whitespace)* ')'}.
    Permitted in \t{DEPEND}, \t{RDEPEND}, \t{PDEPEND}, \t{LICENSE}.
\item A use-conditional group, which consists of an optional exclamation mark, followed by
    a use flag name, followed by a question mark, followed by whitespace, followed by
    an open parenthesis, followed by whitespace, followed by zero or more of (a dependency item
    of any kind followed by whitespace), followed by a close parenthesis. More formally:
    \t{use-conditional ::= '!'? flag-name '?' whitespace '(' whitespace (item whitespace)* ')'}.
    Permitted in all specification style variables.
\end{bulletlist}

In particular, note that whitespace is not optional.

\subsection{Package Dependency Specifications}

A package dependency can be in one of the following base formats. A package manager must warn or
error on non-compliant input.

\begin{bulletlist}
\item A simple \t{category/package} name.
\item An operator, followed immediately by \t{category/package}, followed by a hyphen,
   followed by a version specification.
\end{bulletlist}

In EAPI 1, either of the above formats may additionally be suffixed by a \t{:slot}
restriction. A package manager must warn or error if slot dependencies are used with EAPI 0.

The following operators are available:

\begin{description}
\item[\t{<}] Strictly less than the specified version.
\item[\t{<=}] Less than or equal to the specified version.
\item[\t{=}] Exactly equal to the specified version. Special exception: if the version
    specified has an asterisk immediately following it, a string prefix comparison is
    used instead. When an asterisk is used, the specification must remain valid if the
    asterisk were removed. (An asterisk used with any other operator is illegal.)
\item[\t{\~}] Equal to the specified version, except the revision part of the matching
    package may be greater than the revision part of the specified version (\t{-r0} is
    assumed if no revision is explicitly stated).
\item[\t{>=}] Greater than or equal to the specified version.
\item[\t{>}] Strictly greater than the specified version.
\end{description}

If the specification is prefixed with an exclamation mark, the named dependency is a block rather
than a requirement---that is to say, the specified package must not be installed, except with the
following exceptions:

\begin{bulletlist}
\item Blocks on a package provided by the ebuild do not count. \label{provided-blocks}
\item Blocks on the ebuild itself do not count.
\end{bulletlist}

\subsection{All-of Dependency Specifications}

In an all-of group, all of the child elements must be matched.

\subsection{Use-conditional Dependency Specifications}

In a use-conditional group, if the associated use flag is enabled (or disabled if it has an
exclamation mark prefix), all of the child elements must be matched.

\subsection{Any-of Dependency Specifications}

Any use-conditional group that is an immediate child of an any-of group, if not enabled (disabled
for an exclamation mark prefixed use flag name), is not considered a member of the any-of group
for match purposes.

In an any-of group, at least one immediate child element must be matched. A blocker is
considered to be matched if its associated package dependency specification is not matched.

An empty any-of group counts as being matched.

% vim: set filetype=tex fileencoding=utf8 et tw=100 spell spelllang=en :