Gentoo Archives: gentoo-commits

From: "Ulrich Müller" <ulm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/pms:eapi-8 commit in: /
Date: Wed, 26 May 2021 07:13:47
Message-Id: 1621972616.6b3cf2189ce9e661384b6d4e360e5bf839eb750c.ulm@gentoo
1 commit: 6b3cf2189ce9e661384b6d4e360e5bf839eb750c
2 Author: Ulrich Müller <ulm <AT> gentoo <DOT> org>
3 AuthorDate: Sun May 23 14:37:05 2021 +0000
4 Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org>
5 CommitDate: Tue May 25 19:56:56 2021 +0000
6 URL: https://gitweb.gentoo.org/proj/pms.git/commit/?id=6b3cf218
7
8 Rearrange listings of phase functions
9
10 Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>
11
12 eapi-differences.tex | 10 ++--
13 ebuild-functions.tex | 164 ++++++++++++++++++++++++---------------------------
14 2 files changed, 82 insertions(+), 92 deletions(-)
15
16 diff --git a/eapi-differences.tex b/eapi-differences.tex
17 index 08c4e9f..842e09f 100644
18 --- a/eapi-differences.tex
19 +++ b/eapi-differences.tex
20 @@ -349,7 +349,7 @@ EAPI 1 is EAPI 0 with the following changes:
21 \begin{compactitem}
22 \item \t{IUSE} defaults, \featureref{iuse-defaults}.
23 \item Slot dependencies, \featureref{slot-deps}.
24 -\item Different \t{src_compile} implementation, \featureref{src-compile-1}.
25 +\item Different \t{src_compile} implementation, \featureref{src-compile}.
26 \end{compactitem}
27
28 \section{EAPI 2}
29 @@ -362,7 +362,7 @@ EAPI 2 is EAPI 1 with the following changes:
30 \item \t{!}\ and \t{!!}\ blockers, \featureref{bang-strength}.
31 \item \t{src_prepare}, \featureref{src-prepare}.
32 \item \t{src_configure}, \featureref{src-configure}.
33 -\item Different \t{src_compile} implementation, \featureref{src-compile-2}.
34 +\item Different \t{src_compile} implementation, \featureref{src-compile}.
35 \item \t{default_} phase functions for phases \t{pkg_nofetch}, \t{src_unpack}, \t{src_prepare},
36 \t{src_configure}, \t{src_compile} and \t{src_test}; \featureref{default-phase-funcs}.
37 \item \t{doman} language detection by filename, \featureref{doman-langs}.
38 @@ -391,7 +391,7 @@ EAPI 4 is EAPI 3 with the following changes:
39 \item Use dependency defaults, \featureref{use-dep-defaults}.
40 \item \t{S} to \t{WORKDIR} fallback restricted, \featureref{s-workdir-fallback}.
41 \item \t{pkg_pretend}, \featureref{pkg-pretend}.
42 -\item Default \t{src_install} no longer a no-op, \featureref{src-install-4}.
43 +\item Default \t{src_install} no longer a no-op, \featureref{src-install}.
44 \item \t{pkg_info} can run on non-installed packages, \featureref{pkg-info}.
45 \item \t{AA} is gone, \featureref{aa}.
46 \item \t{KV} is gone, \featureref{kv}.
47 @@ -436,8 +436,8 @@ EAPI 6 is EAPI 5 with the following changes:
48 \begin{compactitem}
49 \item Bash version is 4.2, \featureref{bash-version}.
50 \item \t{failglob} is enabled in global scope, \featureref{failglob}.
51 -\item Default \t{src_prepare} no longer a no-op, \featureref{src-prepare-6}.
52 -\item Different \t{src_install} implementation, \featureref{src-install-6}.
53 +\item Default \t{src_prepare} no longer a no-op, \featureref{src-prepare}.
54 +\item Different \t{src_install} implementation, \featureref{src-install}.
55 \item \t{LC_CTYPE} and \t{LC_COLLATE} compatible with POSIX locale, \featureref{locale-settings}.
56 \item \t{einstall} banned, \featureref{banned-commands}.
57 \item \t{die} and \t{assert} called with \t{-n} respect \t{nonfatal}, \featureref{nonfatal-die}.
58
59 diff --git a/ebuild-functions.tex b/ebuild-functions.tex
60 index 00fd259..b224e0b 100644
61 --- a/ebuild-functions.tex
62 +++ b/ebuild-functions.tex
63 @@ -120,10 +120,10 @@ The \t{src_unpack} function extracts all of the package's sources. In EAPIs lack
64 \t{src_prepare}, it may also apply patches and set up the package's build system for further use.
65
66 The initial working directory must be \t{WORKDIR}, and the default implementation used when
67 -the ebuild lacks the \t{src_unpack} function shall behave as:
68 +the ebuild lacks the \t{src_unpack} function shall behave as in listing~\ref{lst:src-unpack-0}.
69
70 \begin{listing}[H]
71 -\caption{\t{src_unpack}}
72 +\caption{\t{src_unpack}} \label{lst:src-unpack-0}
73 \begin{verbatim}
74 src_unpack() {
75 if [[ -n ${A} ]]; then
76 @@ -142,23 +142,9 @@ post-unpack source preparation.
77 The initial working directory is \t{S}, with an error or fallback to \t{WORKDIR} as discussed in
78 section~\ref{sec:s-to-workdir-fallback}.
79
80 -\featurelabel{src-prepare-6} For EAPIs listed in table~\ref{tab:src-prepare-table} as using format
81 -6, the default implementation used when the ebuild lacks the \t{src_prepare} function shall behave
82 -as:
83 -
84 -\begin{listing}[H]
85 -\caption{\t{src_prepare}, format~6}
86 -\begin{verbatim}
87 -src_prepare() {
88 - if [[ $(declare -p PATCHES 2>/dev/null) == "declare -a"* ]]; then
89 - [[ -n ${PATCHES[@]} ]] && eapply "${PATCHES[@]}"
90 - else
91 - [[ -n ${PATCHES} ]] && eapply ${PATCHES}
92 - fi
93 - eapply_user
94 -}
95 -\end{verbatim}
96 -\end{listing}
97 +For EAPIs listed in table~\ref{tab:src-prepare-table} as using format~6, the default
98 +implementation used when the ebuild lacks the \t{src_prepare} function shall behave as in
99 +listing~\ref{lst:src-prepare-6}.
100
101 For other EAPIs supporting \t{src_prepare}, the default implementation used when the ebuild lacks
102 the \t{src_prepare} function is a no-op.
103 @@ -179,6 +165,20 @@ the \t{src_prepare} function is a no-op.
104 \end{tabular}
105 \end{centertable}
106
107 +\begin{listing}[H]
108 +\caption{\t{src_prepare}, format~6} \label{lst:src-prepare-6}
109 +\begin{verbatim}
110 +src_prepare() {
111 + if [[ $(declare -p PATCHES 2>/dev/null) == "declare -a"* ]]; then
112 + [[ -n ${PATCHES[@]} ]] && eapply "${PATCHES[@]}"
113 + else
114 + [[ -n ${PATCHES} ]] && eapply ${PATCHES}
115 + fi
116 + eapply_user
117 +}
118 +\end{verbatim}
119 +\end{listing}
120 +
121 \subsection{src_configure}
122
123 \featurelabel{src-configure} The \t{src_configure} function is only called for EAPIs listed in
124 @@ -188,18 +188,8 @@ The initial working directory is \t{S}, with an error or fallback to \t{WORKDIR}
125 section~\ref{sec:s-to-workdir-fallback}.
126
127 The \t{src_configure} function configures the package's build environment. The default
128 -implementation used when the ebuild lacks the \t{src_configure} function shall behave as:
129 -
130 -\begin{listing}[H]
131 -\caption{\t{src_configure}}
132 -\begin{verbatim}
133 -src_configure() {
134 - if [[ -x ${ECONF_SOURCE:-.}/configure ]]; then
135 - econf
136 - fi
137 -}
138 -\end{verbatim}
139 -\end{listing}
140 +implementation used when the ebuild lacks the \t{src_configure} function shall behave as in
141 +listing~\ref{lst:src-configure-2}.
142
143 \ChangeWhenAddingAnEAPI{8}
144 \begin{centertable}{EAPIs supporting \t{src_configure}}
145 @@ -215,6 +205,17 @@ src_configure() {
146 \end{tabular}
147 \end{centertable}
148
149 +\begin{listing}[H]
150 +\caption{\t{src_configure}} \label{lst:src-configure-2}
151 +\begin{verbatim}
152 +src_configure() {
153 + if [[ -x ${ECONF_SOURCE:-.}/configure ]]; then
154 + econf
155 + fi
156 +}
157 +\end{verbatim}
158 +\end{listing}
159 +
160 \subsection{src_compile}
161
162 \featurelabel{src-compile} The \t{src_compile} function configures the package's build environment
163 @@ -223,12 +224,28 @@ in EAPIs lacking \t{src_configure}, and builds the package in all EAPIs.
164 The initial working directory is \t{S}, with an error or fallback to \t{WORKDIR} as discussed in
165 section~\ref{sec:s-to-workdir-fallback}.
166
167 -\featurelabel{src-compile-0} For EAPIs listed in table~\ref{tab:src-compile-table} as using format
168 -0, the default implementation used when the ebuild lacks the \t{src_compile} function shall behave
169 -as:
170 +For EAPIs listed in table~\ref{tab:src-compile-table} as using format 0, 1 or~2, the default
171 +implementation used when the ebuild lacks the \t{src_prepare} function shall behave as in
172 +listing~\ref{lst:src-compile-0}, listing~\ref{lst:src-compile-1} or listing~\ref{lst:src-compile-2},
173 +respectively.
174 +
175 +\ChangeWhenAddingAnEAPI{8}
176 +\begin{centertable}{\t{src_compile} behaviour for EAPIs}
177 + \label{tab:src-compile-table}
178 + \begin{tabular}{ll}
179 + \toprule
180 + \multicolumn{1}{c}{\textbf{EAPI}} &
181 + \multicolumn{1}{c}{\textbf{Format}} \\
182 + \midrule
183 + 0 & 0 \\
184 + 1 & 1 \\
185 + 2, 3, 4, 5, 6, 7, 8 & 2 \\
186 + \bottomrule
187 + \end{tabular}
188 +\end{centertable}
189
190 \begin{listing}[H]
191 -\caption{\t{src_compile}, format~0}
192 +\caption{\t{src_compile}, format~0} \label{lst:src-compile-0}
193 \begin{verbatim}
194 src_compile() {
195 if [[ -x ./configure ]]; then
196 @@ -241,12 +258,8 @@ src_compile() {
197 \end{verbatim}
198 \end{listing}
199
200 -\featurelabel{src-compile-1} For EAPIs listed in table~\ref{tab:src-compile-table} as using format
201 -1, the default implementation used when the ebuild lacks the \t{src_compile} function shall behave
202 -as:
203 -
204 \begin{listing}[H]
205 -\caption{\t{src_compile}, format~1}
206 +\caption{\t{src_compile}, format~1} \label{lst:src-compile-1}
207 \begin{verbatim}
208 src_compile() {
209 if [[ -x ${ECONF_SOURCE:-.}/configure ]]; then
210 @@ -259,12 +272,8 @@ src_compile() {
211 \end{verbatim}
212 \end{listing}
213
214 -\featurelabel{src-compile-2} For EAPIs listed in table~\ref{tab:src-compile-table} as using format
215 -2, the default implementation used when the ebuild lacks the \t{src_compile} function shall behave
216 -as:
217 -
218 \begin{listing}[H]
219 -\caption{\t{src_compile}, format~2}
220 +\caption{\t{src_compile}, format~2} \label{lst:src-compile-2}
221 \begin{verbatim}
222 src_compile() {
223 if [[ -f Makefile ]] || [[ -f GNUmakefile ]] || [[ -f makefile ]]; then
224 @@ -274,21 +283,6 @@ src_compile() {
225 \end{verbatim}
226 \end{listing}
227
228 -\ChangeWhenAddingAnEAPI{8}
229 -\begin{centertable}{\t{src_compile} behaviour for EAPIs}
230 - \label{tab:src-compile-table}
231 - \begin{tabular}{ll}
232 - \toprule
233 - \multicolumn{1}{c}{\textbf{EAPI}} &
234 - \multicolumn{1}{c}{\textbf{Format}} \\
235 - \midrule
236 - 0 & 0 \\
237 - 1 & 1 \\
238 - 2, 3, 4, 5, 6, 7, 8 & 2 \\
239 - \bottomrule
240 - \end{tabular}
241 -\end{centertable}
242 -
243 \subsection{src_test}
244
245 The \t{src_test} function runs unit tests for the newly built but not yet installed package as
246 @@ -330,12 +324,30 @@ directory specified in \t{D}.
247 The initial working directory is \t{S}, with an error or fallback to \t{WORKDIR} as discussed in
248 section~\ref{sec:s-to-workdir-fallback}.
249
250 -\featurelabel{src-install-4} For EAPIs listed in table~\ref{tab:src-install-table} as using format
251 -4, the default implementation used when the ebuild lacks the \t{src_install} function shall behave
252 -as:
253 +For EAPIs listed in table~\ref{tab:src-install-table} as using format 4 or~6, the default
254 +implementation used when the ebuild lacks the \t{src_prepare} function shall behave as in
255 +listing~\ref{lst:src-install-4} or listing~\ref{lst:src-install-6}, respectively.
256 +
257 +For other EAPIs, the default implementation used when the ebuild lacks the \t{src_install} function
258 +is a no-op.
259 +
260 +\ChangeWhenAddingAnEAPI{8}
261 +\begin{centertable}{\t{src_install} behaviour for EAPIs}
262 + \label{tab:src-install-table}
263 + \begin{tabular}{ll}
264 + \toprule
265 + \multicolumn{1}{c}{\textbf{EAPI}} &
266 + \multicolumn{1}{c}{\textbf{Format}} \\
267 + \midrule
268 + 0, 1, 2, 3 & no-op \\
269 + 4, 5 & 4 \\
270 + 6, 7, 8 & 6 \\
271 + \bottomrule
272 + \end{tabular}
273 +\end{centertable}
274
275 \begin{listing}[H]
276 -\caption{\t{src_install}, format~4}
277 +\caption{\t{src_install}, format~4} \label{lst:src-install-4}
278 \begin{verbatim}
279 src_install() {
280 if [[ -f Makefile ]] || [[ -f GNUmakefile ]] || [[ -f makefile ]]; then
281 @@ -357,12 +369,8 @@ src_install() {
282 \end{verbatim}
283 \end{listing}
284
285 -\featurelabel{src-install-6} For EAPIs listed in table~\ref{tab:src-install-table} as using format
286 -6, the default implementation used when the ebuild lacks the \t{src_install} function shall behave
287 -as:
288 -
289 \begin{listing}[H]
290 -\caption{\t{src_install}, format~6}
291 +\caption{\t{src_install}, format~6} \label{lst:src-install-6}
292 \begin{verbatim}
293 src_install() {
294 if [[ -f Makefile ]] || [[ -f GNUmakefile ]] || [[ -f makefile ]]; then
295 @@ -373,24 +381,6 @@ src_install() {
296 \end{verbatim}
297 \end{listing}
298
299 -For other EAPIs, the default implementation used when the ebuild lacks the \t{src_install} function
300 -is a no-op.
301 -
302 -\ChangeWhenAddingAnEAPI{8}
303 -\begin{centertable}{\t{src_install} behaviour for EAPIs}
304 - \label{tab:src-install-table}
305 - \begin{tabular}{ll}
306 - \toprule
307 - \multicolumn{1}{c}{\textbf{EAPI}} &
308 - \multicolumn{1}{c}{\textbf{Format}} \\
309 - \midrule
310 - 0, 1, 2, 3 & no-op \\
311 - 4, 5 & 4 \\
312 - 6, 7, 8 & 6 \\
313 - \bottomrule
314 - \end{tabular}
315 -\end{centertable}
316 -
317 \subsection{pkg_preinst}
318
319 The \t{pkg_preinst} function performs any special tasks that are required immediately before