Gentoo Archives: gentoo-commits

From: Brian Evans <grknight@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
Date: Thu, 22 Mar 2018 01:29:44
Message-Id: 1521682089.2c8e98a82221e9ef9f6661949e986218176bdc02.grknight@gentoo
1 commit: 2c8e98a82221e9ef9f6661949e986218176bdc02
2 Author: Brian Evans <grknight <AT> gentoo <DOT> org>
3 AuthorDate: Tue Mar 13 00:19:36 2018 +0000
4 Commit: Brian Evans <grknight <AT> gentoo <DOT> org>
5 CommitDate: Thu Mar 22 01:28:09 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2c8e98a8
7
8 eclass: php-ext-sources-r3 - Apply user patches to all targets
9
10 The original eclass copied sources as part of the exported src_unpack
11 and then attempted to apply default_src_prepare to every PHP_TARGET.
12
13 As the bug shows, this fails on eapply_user because that function will
14 only ever apply once.
15
16 Instead, eliminate the php-ext-sources-r3_src_unpack. Move the copy
17 function to src_prepare phase after patches were applied,
18 optionally disabled by PHP_EXT_SKIP_PATCHES=yes.
19
20 This eclass will only apply patches to PHP_EXT_S.
21
22 Fixes: https://bugs.gentoo.org/650324
23
24 eclass/php-ext-source-r3.eclass | 30 +++++++++++++++---------------
25 1 file changed, 15 insertions(+), 15 deletions(-)
26
27 diff --git a/eclass/php-ext-source-r3.eclass b/eclass/php-ext-source-r3.eclass
28 index dfcec487685..22f07f8827b 100644
29 --- a/eclass/php-ext-source-r3.eclass
30 +++ b/eclass/php-ext-source-r3.eclass
31 @@ -11,7 +11,7 @@
32
33 inherit autotools
34
35 -EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_install src_test
36 +EXPORT_FUNCTIONS src_prepare src_configure src_compile src_install src_test
37
38 case ${EAPI} in
39 6) ;;
40 @@ -141,23 +141,16 @@ DEPEND="${DEPEND}
41 # @ECLASS-VARIABLE: PHP_EXT_SKIP_PHPIZE
42 # @DEFAULT_UNSET
43 # @DESCRIPTION:
44 -# By default, we run "phpize" in php-ext-source-r3_src_unpack(). Set
45 +# By default, we run "phpize" in php-ext-source-r3_src_prepare(). Set
46 # PHP_EXT_SKIP_PHPIZE="yes" in your ebuild if you do not want to run
47 # phpize (and the autoreconf that becomes necessary afterwards).
48
49 -# @FUNCTION: php-ext-source-r3_src_unpack
50 +# @ECLASS-VARIABLE: PHP_EXT_SKIP_PATCHES
51 +# @DEFAULT_UNSET
52 # @DESCRIPTION:
53 -# Runs the default src_unpack and then makes a copy for each PHP slot.
54 -php-ext-source-r3_src_unpack() {
55 - default
56 -
57 - local slot orig_s="${PHP_EXT_S}"
58 - for slot in $(php_get_slots); do
59 - cp --recursive --preserve "${orig_s}" "${WORKDIR}/${slot}" || \
60 - die "failed to copy sources from ${orig_s} to ${WORKDIR}/${slot}"
61 - done
62 -}
63 -
64 +# By default, we run default_src_prepare to PHP_EXT_S.
65 +# Set PHP_EXT_SKIP_PATCHES="yes" in your ebuild if you
66 +# want to apply patches yourself.
67
68 # @FUNCTION: php-ext-source-r3_src_prepare
69 # @DESCRIPTION:
70 @@ -165,9 +158,16 @@ php-ext-source-r3_src_unpack() {
71 # src_prepare() for PATCHES/eapply_user support, and then call
72 # php-ext-source-r3_phpize.
73 php-ext-source-r3_src_prepare() {
74 + local slot orig_s="${PHP_EXT_S}"
75 + if [[ "${PHP_EXT_SKIP_PATCHES}" != 'yes' ]] ; then
76 + pushd "${orig_s}" > /dev/null || die
77 + default
78 + popd > /dev/null || die
79 + fi
80 for slot in $(php_get_slots); do
81 + cp --recursive --preserve "${orig_s}" "${WORKDIR}/${slot}" || \
82 + die "failed to copy sources from ${orig_s} to ${WORKDIR}/${slot}"
83 php_init_slot_env "${slot}"
84 - default
85 php-ext-source-r3_phpize
86 done
87 }