Gentoo Archives: gentoo-portage-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-portage-dev@l.g.o
Cc: "Michał Górny" <mgorny@g.o>
Subject: [gentoo-portage-dev] [PATCH 13/13] Add tentative EAPI6 phase functions
Date: Mon, 18 Aug 2014 17:57:07
Message-Id: 1408384612-14713-14-git-send-email-mgorny@gentoo.org
In Reply to: [gentoo-portage-dev] [PATCHES] Initial EAPI6 patch set for review by "Michał Górny"
1 ---
2 bin/phase-functions.sh | 11 +++++++++++
3 bin/phase-helpers.sh | 18 ++++++++++++++++++
4 2 files changed, 29 insertions(+)
5
6 diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
7 index b7fb5d7..f2088bd 100644
8 --- a/bin/phase-functions.sh
9 +++ b/bin/phase-functions.sh
10 @@ -806,6 +806,17 @@ __ebuild_phase_funcs() {
11 declare -F src_install >/dev/null || \
12 src_install() { default; }
13 fi
14 +
15 + # defaults starting with EAPI 6
16 + if ! has ${eapi} 2 3 4 4-python 4-slot-abi 5 5-progress 5-hdepend; then
17 + [[ ${phase_func} == src_prepare ]] && \
18 + default_src_prepare() { __eapi6_src_prepare; }
19 + [[ ${phase_func} == src_install ]] && \
20 + default_src_install() { __eapi6_src_install; }
21 +
22 + declare -F src_prepare >/dev/null || \
23 + src_prepare() { default; }
24 + fi
25 ;;
26 esac
27 }
28 diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
29 index 2eada2f..e64fe8b 100644
30 --- a/bin/phase-helpers.sh
31 +++ b/bin/phase-helpers.sh
32 @@ -748,6 +748,24 @@ __eapi4_src_install() {
33 fi
34 }
35
36 +__eapi6_src_prepare() {
37 + if [[ $(declare -p PATCHES) == "declare -a "* ]]; then
38 + eapply "${PATCHES[@]}"
39 + elif [[ -n ${PATCHES} ]]; then
40 + eapply ${PATCHES}
41 + fi
42 +
43 + eapply_user
44 +}
45 +
46 +__eapi6_src_install() {
47 + if [[ -f Makefile || -f GNUmakefile || -f makefile ]] ; then
48 + emake DESTDIR="${D}" install
49 + fi
50 +
51 + einstalldocs
52 +}
53 +
54 # @FUNCTION: has_version
55 # @USAGE: [--host-root] <DEPEND ATOM>
56 # @DESCRIPTION:
57 --
58 2.0.4