1 |
This adds support for the PATCHES array and for user patches. |
2 |
|
3 |
Bug: 463692 |
4 |
--- |
5 |
eapi-differences.tex | 4 ++++ |
6 |
ebuild-functions.tex | 36 +++++++++++++++++++++++++++--------- |
7 |
2 files changed, 31 insertions(+), 9 deletions(-) |
8 |
|
9 |
diff --git a/eapi-differences.tex b/eapi-differences.tex |
10 |
index be8563c..980cbd8 100644 |
11 |
--- a/eapi-differences.tex |
12 |
+++ b/eapi-differences.tex |
13 |
@@ -92,6 +92,9 @@ Use dependencies & \compactfeatureref{use-deps} & |
14 |
\t{src\_prepare} & \compactfeatureref{src-prepare} & |
15 |
* & Yes & Yes & Yes & Yes \\ |
16 |
|
17 |
+\t{src\_prepare} style & \compactfeatureref{src-prepare} & |
18 |
+ * & no-op & no-op & no-op & 6 \\ |
19 |
+ |
20 |
\t{src\_configure} & \compactfeatureref{src-configure} & |
21 |
* & Yes & Yes & Yes & Yes \\ |
22 |
|
23 |
@@ -326,6 +329,7 @@ EAPI 6 is EAPI 5 with the following changes: |
24 |
|
25 |
\begin{compactitem} |
26 |
\item Profile \t{package*} and \t{use*} can be directories, \featureref{profile-file-dirs}. |
27 |
+\item Default \t{src\_prepare} no longer a no-op, \featureref{src-prepare-6}. |
28 |
\item Bash version is 4.2, \featureref{bash-version}. |
29 |
\item \t{failglob} is enabled in global scope, \featureref{failglob}. |
30 |
\item \t{einstall} banned, \featureref{banned-commands}. |
31 |
diff --git a/ebuild-functions.tex b/ebuild-functions.tex |
32 |
index 23f02b4..1f996f0 100644 |
33 |
--- a/ebuild-functions.tex |
34 |
+++ b/ebuild-functions.tex |
35 |
@@ -121,24 +121,42 @@ src_unpack() { |
36 |
\label{sec:src-prepare-function} |
37 |
|
38 |
\featurelabel{src-prepare} The \t{src\_prepare} function is only called for EAPIs listed in |
39 |
-table~\ref{tab:src-prepare-table} as supporting it. |
40 |
- |
41 |
-The \t{src\_prepare} function can be used for post-unpack source preparation. The default |
42 |
-implementation does nothing. |
43 |
+table~\ref{tab:src-prepare-table} as supporting it. The \t{src\_prepare} function can be used for |
44 |
+post-unpack source preparation. |
45 |
|
46 |
The initial working directory is \t{S}, with an error or fallback to \t{WORKDIR} as discussed in |
47 |
section~\ref{sec:s-to-workdir-fallback}. |
48 |
|
49 |
+\featurelabel{src-prepare-6} For EAPIs listed in table~\ref{tab:src-prepare-table} as using format |
50 |
+6, the default implementation used when the ebuild lacks the \t{src\_prepare} function shall behave |
51 |
+as: |
52 |
+ |
53 |
+\begin{verbatim} |
54 |
+src_prepare() { |
55 |
+ if declare -p PATCHES | grep -q "^declare -a "; then |
56 |
+ [[ -n ${PATCHES[@]} ]] && eapply "${PATCHES[@]}" |
57 |
+ else |
58 |
+ [[ -n ${PATCHES} ]] && eapply ${PATCHES} |
59 |
+ fi |
60 |
+ eapply_user |
61 |
+} |
62 |
+\end{verbatim} |
63 |
+ |
64 |
+For other EAPIs supporting \t{src\_prepare}, the default implementation used when the ebuild lacks |
65 |
+the \t{src\_prepare} function is a no-op. |
66 |
+ |
67 |
\ChangeWhenAddingAnEAPI{6} |
68 |
-\begin{centertable}{EAPIs supporting \t{src\_prepare}} |
69 |
+\begin{centertable}{\t{src\_prepare} support and behaviour for EAPIs} |
70 |
\label{tab:src-prepare-table} |
71 |
- \begin{tabular}{ l l } |
72 |
+ \begin{tabular}{ l l l } |
73 |
\toprule |
74 |
\multicolumn{1}{c}{\textbf{EAPI}} & |
75 |
- \multicolumn{1}{c}{\textbf{Supports \t{src\_prepare}?}} \\ |
76 |
+ \multicolumn{1}{c}{\textbf{Supports \t{src\_prepare}?}} & |
77 |
+ \multicolumn{1}{c}{\textbf{Format}} \\ |
78 |
\midrule |
79 |
- 0, 1 & No \\ |
80 |
- 2, 3, 4, 5, 6 & Yes \\ |
81 |
+ 0, 1 & No & Not applicable \\ |
82 |
+ 2, 3, 4, 5 & Yes & no-op \\ |
83 |
+ 6 & Yes & 6 \\ |
84 |
\bottomrule |
85 |
\end{tabular} |
86 |
\end{centertable} |
87 |
-- |
88 |
2.6.1 |