commit: 06ebb1e10f4c93b4be4ee76442f63c88b328169c Author: Ulrich Müller <ulm <AT> gentoo <DOT> org> AuthorDate: Sun May 16 19:06:02 2021 +0000 Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org> CommitDate: Mon May 17 21:21:00 2021 +0000 URL: https://gitweb.gentoo.org/proj/pms.git/commit/?id=06ebb1e1
EAPI 8: Default src_prepare doesn't accept options in PATCHES Bug: https://bugs.gentoo.org/752486 Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org> eapi-differences.tex | 3 ++- ebuild-functions.tex | 21 ++++++++++++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/eapi-differences.tex b/eapi-differences.tex index f3af563..5d7170d 100644 --- a/eapi-differences.tex +++ b/eapi-differences.tex @@ -121,7 +121,7 @@ Use dependencies & \compactfeatureref{use-deps} & * & Yes & Yes & Yes & Yes \\ \t{src_prepare} style & \compactfeatureref{src-prepare} & - * & no-op & 6 & 6 & 6 \\ + * & no-op & 6 & 6 & 8 \\ \t{src_configure} & \compactfeatureref{src-configure} & * & Yes & Yes & Yes & Yes \\ @@ -494,6 +494,7 @@ EAPI 8 is EAPI 7 with the following changes: \item Bash version is 5.0, \featureref{bash-version}. \item Selective fetch/mirror restriction, \featureref{uri-restrict}. \item \t{IDEPEND}, \featureref{idepend}. +\item Different \t{src_prepare} implementation, \featureref{src-prepare-8}. \end{compactitem} \ChangeWhenAddingAnEAPI{8} diff --git a/ebuild-functions.tex b/ebuild-functions.tex index 108b8bc..c8e02db 100644 --- a/ebuild-functions.tex +++ b/ebuild-functions.tex @@ -144,6 +144,24 @@ src_prepare() { \end{verbatim} \end{listing} +\featurelabel{src-prepare-8} For EAPIs listed in table~\ref{tab:src-prepare-table} as using format +8, the default implementation used when the ebuild lacks the \t{src_prepare} function shall behave +as: + +\begin{listing}[H] +\caption{\t{src_prepare}, format~8} +\begin{verbatim} +src_prepare() { + if [[ $(declare -p PATCHES 2>/dev/null) == "declare -a"* ]]; then + [[ -n ${PATCHES[@]} ]] && eapply -- "${PATCHES[@]}" + else + [[ -n ${PATCHES} ]] && eapply -- ${PATCHES} + fi + eapply_user +} +\end{verbatim} +\end{listing} + For other EAPIs supporting \t{src_prepare}, the default implementation used when the ebuild lacks the \t{src_prepare} function is a no-op. @@ -158,7 +176,8 @@ the \t{src_prepare} function is a no-op. \midrule 0, 1 & No & Not applicable \\ 2, 3, 4, 5 & Yes & no-op \\ - 6, 7, 8 & Yes & 6 \\ + 6, 7 & Yes & 6 \\ + 8 & Yes & 8 \\ \bottomrule \end{tabular} \end{centertable}
