Gentoo Archives: gentoo-pms

From: "Michał Górny" <mgorny@g.o>
To: gentoo-pms@l.g.o
Cc: "Michał Górny" <mgorny@g.o>
Subject: [gentoo-pms] [PATCH eapi8] EAPI 8 has install-time dependencies (IDEPEND)
Date: Sun, 22 Dec 2019 20:33:10
Message-Id: 20191222203241.180616-1-mgorny@gentoo.org
1 Bug: https://bugs.gentoo.org/660306
2 Signed-off-by: Michał Górny <mgorny@g.o>
3 ---
4 dependencies.tex | 38 ++++++++++++++++++++++++--------------
5 eapi-differences.tex | 4 ++++
6 ebuild-env-vars.tex | 7 ++++---
7 ebuild-vars.tex | 1 +
8 eclasses.tex | 8 ++++----
9 metadata-cache.tex | 2 ++
10 6 files changed, 39 insertions(+), 21 deletions(-)
11
12 diff --git a/dependencies.tex b/dependencies.tex
13 index 40c932a..7924105 100644
14 --- a/dependencies.tex
15 +++ b/dependencies.tex
16 @@ -21,7 +21,7 @@
17 \t{src_install} & \t{DEPEND}, \t{BDEPEND} \\
18 \addlinespace
19 \t{pkg_preinst}, \t{pkg_postinst}, \t{pkg_prerm}, \t{pkg_postrm} &
20 - \t{RDEPEND} \\
21 + \t{RDEPEND}, \t{IDEPEND} \\
22 \addlinespace
23 \t{pkg_config} & \t{RDEPEND}, \t{PDEPEND} \\
24 \bottomrule
25 @@ -30,15 +30,16 @@
26
27 \begin{centertable}{Summary of other interfaces related to dependency classes}
28 \label{tab:dep-class-api}
29 - \begin{tabular}{llll}
30 + \begin{tabular}{lllll}
31 \toprule
32 - & \t{BDEPEND} & \t{DEPEND} & \t{RDEPEND}, \t{PDEPEND} \\
33 + & \t{BDEPEND}, \t{IDEPEND} & \t{DEPEND} & \t{RDEPEND},
34 + \t{PDEPEND} \\
35 \midrule
36 - Binary compatible with & \t{CBUILD} & \t{CHOST} & \t{CHOST} \\
37 - Base unprefixed path & \t{/} & \t{\$\{SYSROOT\}} & \t{\$\{ROOT\}} \\
38 - Relevant offset-prefix & \t{\$\{BROOT\}} & \t{\$\{EPREFIX\}} & \t{\$\{EPREFIX\}} \\
39 - Path combined with prefix & \t{\$\{BROOT\}} & \t{\$\{ESYSROOT\}} & \t{\$\{EROOT\}} \\
40 - PM query command option & \t{-b} & \t{-d} & \t{-r} \\
41 + Binary compatible with & \t{CBUILD} & \t{CHOST} & \t{CHOST} \\
42 + Base unprefixed path & \t{/} & \t{\$\{SYSROOT\}} & \t{\$\{ROOT\}} \\
43 + Relevant offset-prefix & \t{\$\{BROOT\}} & \t{\$\{EPREFIX\}} & \t{\$\{EPREFIX\}} \\
44 + Path combined with prefix & \t{\$\{BROOT\}} & \t{\$\{ESYSROOT\}} & \t{\$\{EROOT\}} \\
45 + PM query command option & \t{-b} & \t{-d} & \t{-r} \\
46 \bottomrule
47 \end{tabular}
48 \end{centertable}
49 @@ -68,16 +69,24 @@ as supporting \t{BDEPEND}, the build dependencies are split into two subclasses:
50 dependency.
51 \end{compactitem}
52
53 +\featurelabel{idepend} Additionally, in EAPIs listed in table~\ref{tab:depend-table} as supporting
54 +\t{IDEPEND}, install-time dependencies can be specified. Those dependencies are binary compatible
55 +with the native build system (\t{CBUILD}). The~ebuild is allowed to call them in \t{pkg_preinst}
56 +and \t{pkg_postinst} phases. The ebuild may also call them in \t{pkg_prerm} and \t{pkg_postrm}
57 +but must not rely on them being available.
58 +
59 \ChangeWhenAddingAnEAPI{8}
60 \begin{centertable}{EAPIs supporting additional dependency types}
61 \label{tab:depend-table}
62 - \begin{tabular}{ll}
63 + \begin{tabular}{lll}
64 \toprule
65 \multicolumn{1}{c}{\textbf{EAPI}} &
66 - \multicolumn{1}{c}{\textbf{Supports \t{BDEPEND}?}} \\
67 + \multicolumn{1}{c}{\textbf{Supports \t{BDEPEND}?}} &
68 + \multicolumn{1}{c}{\textbf{Supports \t{IDEPEND}?}} \\
69 \midrule
70 - 0, 1, 2, 3, 4, 5, 6 & No \\
71 - 7, 8 & Yes \\
72 + 0, 1, 2, 3, 4, 5, 6 & No & No \\
73 + 7 & Yes & No \\
74 + 8 & Yes & Yes \\
75 \bottomrule
76 \end{tabular}
77 \end{centertable}
78 @@ -97,7 +106,7 @@ be surrounded on both sides by whitespace, except at the start and end of the st
79
80 \begin{compactitem}
81 \item A package dependency specification. Permitted in \t{DEPEND}, \t{BDEPEND}, \t{RDEPEND},
82 - \t{PDEPEND}.
83 + \t{IDEPEND}, \t{PDEPEND}.
84 \item A URI, in the form \t{proto://host/path}. Permitted in \t{HOMEPAGE} and \t{SRC_URI}\@.
85 In EAPIs listed in table~\ref{tab:uri-arrows-table} as supporting \t{SRC_URI} arrows, may
86 optionally be followed by whitespace, then \t{->}, then whitespace, then a simple filename when
87 @@ -115,7 +124,8 @@ be surrounded on both sides by whitespace, except at the start and end of the st
88 followed by an open parenthesis, followed by whitespace, followed by one or more
89 of (a dependency item of any kind followed by whitespace), followed by a close parenthesis.
90 More formally: \t{any-of} \t{::=} \t{'||' whitespace '(' whitespace (item whitespace)+ ')'}.
91 - Permitted in \t{DEPEND}, \t{BDEPEND}, \t{RDEPEND}, \t{PDEPEND}, \t{LICENSE}, \t{REQUIRED_USE}.
92 + Permitted in \t{DEPEND}, \t{BDEPEND}, \t{RDEPEND}, \t{IDEPEND}, \t{PDEPEND}, \t{LICENSE},
93 + \t{REQUIRED_USE}.
94 \item An exactly-one-of group, which has the same format as the any-of group, but begins with the
95 string \t{\textasciicircum\textasciicircum} instead. Permitted in \t{REQUIRED_USE}.
96 \item \featurelabel{at-most-one-of} An at-most-one-of group, which has the same format as the
97 diff --git a/eapi-differences.tex b/eapi-differences.tex
98 index 59940b0..94816d4 100644
99 --- a/eapi-differences.tex
100 +++ b/eapi-differences.tex
101 @@ -83,6 +83,9 @@ Selective URI restrictions & \compactfeatureref{selective-uri-restrict} &
102 \t{BDEPEND} & \compactfeatureref{bdepend} &
103 No & No & No & Yes & Yes \\
104
105 +\t{IDEPEND} & \compactfeatureref{idepend} &
106 + No & No & No & No & Yes \\
107 +
108 \t{??\ ( )} groups & \compactfeatureref{at-most-one-of} &
109 No & Yes & Yes & Yes & Yes \\
110
111 @@ -485,6 +488,7 @@ EAPI 8 is EAPI 7 with the following changes:
112
113 \begin{compactitem}
114 \item Selective fetch/mirror restriction, \featureref{selective-uri-restrict}.
115 +\item \t{IDEPEND}, \featureref{idepend}.
116 \end{compactitem}
117
118 \ChangeWhenAddingAnEAPI{8}
119 diff --git a/ebuild-env-vars.tex b/ebuild-env-vars.tex
120 index 2370d9d..6065ff4 100644
121 --- a/ebuild-env-vars.tex
122 +++ b/ebuild-env-vars.tex
123 @@ -147,9 +147,10 @@ variable.
124 \t{BROOT} &
125 Ditto &
126 No &
127 - \featurelabel{broot} The absolute path to the root directory containing build dependencies
128 - satisfied by \t{BDEPEND}, typically executable build tools. This includes any applicable offset
129 - prefix. Only for EAPIs listed in table~\ref{tab:offset-env-vars-table} as supporting \t{BROOT}.
130 + \featurelabel{broot} The absolute path to the root directory containing build host dependencies
131 + satisfied by \t{BDEPEND} and \t{IDEPEND}, typically executable build tools. This includes any
132 + applicable offset prefix. Only for EAPIs listed in table~\ref{tab:offset-env-vars-table} as
133 + supporting \t{BROOT}.
134 \\
135 \t{T} &
136 All &
137 diff --git a/ebuild-vars.tex b/ebuild-vars.tex
138 index 12184a8..1e19d0d 100644
139 --- a/ebuild-vars.tex
140 +++ b/ebuild-vars.tex
141 @@ -86,6 +86,7 @@ Ebuilds may define any of the following variables:
142 details.
143 \item[PDEPEND] See chapter~\ref{ch:dependencies}.
144 \item[BDEPEND] See chapter~\ref{ch:dependencies}.
145 +\item[IDEPEND] See chapter~\ref{ch:dependencies}.
146 \end{description}
147
148 \ChangeWhenAddingAnEAPI{8}
149 diff --git a/eclasses.tex b/eclasses.tex
150 index bf0007b..2ecdc66 100644
151 --- a/eclasses.tex
152 +++ b/eclasses.tex
153 @@ -34,10 +34,10 @@ The \t{inherit} command must also ensure that:
154
155 \section{Eclass-defined Metadata Keys}
156
157 -The \t{IUSE}, \t{REQUIRED_USE}, \t{DEPEND}, \t{BDEPEND}, \t{RDEPEND} and \t{PDEPEND} variables
158 -are handled specially when set by an eclass. They must be accumulated across eclasses, appending
159 -the value set by each eclass to the resulting value after the previous one is loaded. Then the
160 -eclass-defined value is appended to that defined by the ebuild. In the case of \t{RDEPEND}, this
161 +The \t{IUSE}, \t{REQUIRED_USE}, \t{DEPEND}, \t{BDEPEND}, \t{RDEPEND}, \t{IDEPEND} and \t{PDEPEND}
162 +variables are handled specially when set by an eclass. They must be accumulated across eclasses,
163 +appending the~value set by each eclass to the resulting value after the previous one is loaded. Then
164 +the eclass-defined value is appended to that defined by the ebuild. In the case of \t{RDEPEND}, this
165 is done after the implicit \t{RDEPEND} rules in section~\ref{sec:rdepend-depend} are applied.
166
167 \section{EXPORT_FUNCTIONS}
168 diff --git a/metadata-cache.tex b/metadata-cache.tex
169 index 33574c4..d69ecdd 100644
170 --- a/metadata-cache.tex
171 +++ b/metadata-cache.tex
172 @@ -36,6 +36,8 @@ order. Other lines may be present following these; their meanings are not define
173 metadata; see table~\ref{tab:optional-vars-table}.
174 \item Defined phases (\t{DEFINED_PHASES}). In some EAPIs, may optionally be blank, regardless of
175 ebuild metadata; see table~\ref{tab:defined-phases-table}.
176 +\item Install-time dependencies (\t{IDEPEND}).
177 + Blank in some EAPIs; see table~\ref{tab:depend-table}.
178 \item Blank lines to pad the file to 22 lines long
179 \end{compactenum}
180
181 --
182 2.24.1

Replies