commit: 5e519e0676249133c0d65cb7f3cabefe2653513e
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 18 11:57:36 2014 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Dec 4 14:01:35 2014 +0000
URL:
http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5e519e06
Add tentative EAPI6 phase functions
---
bin/phase-functions.sh | 11 +++++++++++
bin/phase-helpers.sh | 18 ++++++++++++++++++
2 files changed, 29 insertions(+)
diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index ee28c27..aec86fd 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -828,6 +828,17 @@ __ebuild_phase_funcs() {
declare -F src_install >/dev/null || \
src_install() { default; }
fi
+
+ # defaults starting with EAPI 6
+ if ! has ${eapi} 2 3 4 4-python 4-slot-abi 5 5-progress
5-hdepend; then
+ [[ ${phase_func} == src_prepare ]] && \
+ default_src_prepare() {
__eapi6_src_prepare; }
+ [[ ${phase_func} == src_install ]] && \
+ default_src_install() {
__eapi6_src_install; }
+
+ declare -F src_prepare >/dev/null || \
+ src_prepare() { default; }
+ fi
;;
esac
}
diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index e2376bf..5605efd 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -795,6 +795,24 @@ __eapi4_src_install() {
fi
}
+__eapi6_src_prepare() {
+ if [[ $(declare -p PATCHES) == "declare -a"* ]]; then
+ eapply "${PATCHES[@]}"
+ elif [[ -n ${PATCHES} ]]; then
+ eapply ${PATCHES}
+ fi
+
+ eapply_user
+}
+
+__eapi6_src_install() {
+ if [[ -f Makefile || -f GNUmakefile || -f makefile ]] ; then
+ emake DESTDIR="${D}" install
+ fi
+
+ einstalldocs
+}
+
# @FUNCTION: has_version
# @USAGE: [--host-root] <DEPEND ATOM>
# @DESCRIPTION: