1 |
commit: 11266ab01b368d08fb5a5aa07c4c6fe69c9d260e |
2 |
Author: Ulrich Müller <ulm <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun May 16 19:06:02 2021 +0000 |
4 |
Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon May 24 19:19:39 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/pms.git/commit/?id=11266ab0 |
7 |
|
8 |
EAPI 8: Default src_prepare doesn't accept options in PATCHES |
9 |
|
10 |
Bug: https://bugs.gentoo.org/752486 |
11 |
Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org> |
12 |
|
13 |
eapi-differences.tex | 3 ++- |
14 |
ebuild-functions.tex | 21 ++++++++++++++++++--- |
15 |
2 files changed, 20 insertions(+), 4 deletions(-) |
16 |
|
17 |
diff --git a/eapi-differences.tex b/eapi-differences.tex |
18 |
index 842e09f..aeddb6e 100644 |
19 |
--- a/eapi-differences.tex |
20 |
+++ b/eapi-differences.tex |
21 |
@@ -124,7 +124,7 @@ Working directory in \t{pkg_*} phases & \compactfeatureref{phase-function-dir} & |
22 |
* & Yes & Yes & Yes & Yes \\ |
23 |
|
24 |
\t{src_prepare} style & \compactfeatureref{src-prepare} & |
25 |
- * & no-op & 6 & 6 & 6 \\ |
26 |
+ * & no-op & 6 & 6 & 8 \\ |
27 |
|
28 |
\t{src_configure} & \compactfeatureref{src-configure} & |
29 |
* & Yes & Yes & Yes & Yes \\ |
30 |
@@ -498,6 +498,7 @@ EAPI 8 is EAPI 7 with the following changes: |
31 |
\item Selective fetch/mirror restriction, \featureref{uri-restrict}. |
32 |
\item \t{IDEPEND}, \featureref{idepend}. |
33 |
\item Empty working directory in \t{pkg_*} phase functions, \featureref{phase-function-dir}. |
34 |
+\item Different \t{src_prepare} implementation, \featureref{src-prepare}. |
35 |
\end{compactitem} |
36 |
|
37 |
\ChangeWhenAddingAnEAPI{8} |
38 |
|
39 |
diff --git a/ebuild-functions.tex b/ebuild-functions.tex |
40 |
index b224e0b..d95d8ce 100644 |
41 |
--- a/ebuild-functions.tex |
42 |
+++ b/ebuild-functions.tex |
43 |
@@ -142,9 +142,9 @@ post-unpack source preparation. |
44 |
The initial working directory is \t{S}, with an error or fallback to \t{WORKDIR} as discussed in |
45 |
section~\ref{sec:s-to-workdir-fallback}. |
46 |
|
47 |
-For EAPIs listed in table~\ref{tab:src-prepare-table} as using format~6, the default |
48 |
+For EAPIs listed in table~\ref{tab:src-prepare-table} as using format 6 or~8, the default |
49 |
implementation used when the ebuild lacks the \t{src_prepare} function shall behave as in |
50 |
-listing~\ref{lst:src-prepare-6}. |
51 |
+listing~\ref{lst:src-prepare-6} or listing~\ref{lst:src-prepare-8}, respectively. |
52 |
|
53 |
For other EAPIs supporting \t{src_prepare}, the default implementation used when the ebuild lacks |
54 |
the \t{src_prepare} function is a no-op. |
55 |
@@ -160,7 +160,8 @@ the \t{src_prepare} function is a no-op. |
56 |
\midrule |
57 |
0, 1 & No & Not applicable \\ |
58 |
2, 3, 4, 5 & Yes & no-op \\ |
59 |
- 6, 7, 8 & Yes & 6 \\ |
60 |
+ 6, 7 & Yes & 6 \\ |
61 |
+ 8 & Yes & 8 \\ |
62 |
\bottomrule |
63 |
\end{tabular} |
64 |
\end{centertable} |
65 |
@@ -179,6 +180,20 @@ src_prepare() { |
66 |
\end{verbatim} |
67 |
\end{listing} |
68 |
|
69 |
+\begin{listing}[H] |
70 |
+\caption{\t{src_prepare}, format~8} \label{lst:src-prepare-8} |
71 |
+\begin{verbatim} |
72 |
+src_prepare() { |
73 |
+ if [[ $(declare -p PATCHES 2>/dev/null) == "declare -a"* ]]; then |
74 |
+ [[ -n ${PATCHES[@]} ]] && eapply -- "${PATCHES[@]}" |
75 |
+ else |
76 |
+ [[ -n ${PATCHES} ]] && eapply -- ${PATCHES} |
77 |
+ fi |
78 |
+ eapply_user |
79 |
+} |
80 |
+\end{verbatim} |
81 |
+\end{listing} |
82 |
+ |
83 |
\subsection{src_configure} |
84 |
|
85 |
\featurelabel{src-configure} The \t{src_configure} function is only called for EAPIs listed in |