Gentoo Archives: gentoo-commits

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