summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorBrian Evans <grknight@gentoo.org>2018-03-12 20:19:36 -0400
committerBrian Evans <grknight@gentoo.org>2018-03-21 21:28:09 -0400
commit2c8e98a82221e9ef9f6661949e986218176bdc02 (patch)
tree27d7a680a05b6c3046d52d88817cb68de8cf02c3 /eclass
parentdev-libs/libzip: hppa stable, bugs 622044, 629574 (diff)
downloadgentoo-2c8e98a82221e9ef9f6661949e986218176bdc02.tar.gz
gentoo-2c8e98a82221e9ef9f6661949e986218176bdc02.tar.bz2
gentoo-2c8e98a82221e9ef9f6661949e986218176bdc02.zip
eclass: php-ext-sources-r3 - Apply user patches to all targets
The original eclass copied sources as part of the exported src_unpack and then attempted to apply default_src_prepare to every PHP_TARGET. As the bug shows, this fails on eapply_user because that function will only ever apply once. Instead, eliminate the php-ext-sources-r3_src_unpack. Move the copy function to src_prepare phase after patches were applied, optionally disabled by PHP_EXT_SKIP_PATCHES=yes. This eclass will only apply patches to PHP_EXT_S. Fixes: https://bugs.gentoo.org/650324
Diffstat (limited to 'eclass')
-rw-r--r--eclass/php-ext-source-r3.eclass30
1 files changed, 15 insertions, 15 deletions
diff --git a/eclass/php-ext-source-r3.eclass b/eclass/php-ext-source-r3.eclass
index dfcec487685b..22f07f8827b5 100644
--- a/eclass/php-ext-source-r3.eclass
+++ b/eclass/php-ext-source-r3.eclass
@@ -11,7 +11,7 @@
inherit autotools
-EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_install src_test
+EXPORT_FUNCTIONS src_prepare src_configure src_compile src_install src_test
case ${EAPI} in
6) ;;
@@ -141,23 +141,16 @@ DEPEND="${DEPEND}
# @ECLASS-VARIABLE: PHP_EXT_SKIP_PHPIZE
# @DEFAULT_UNSET
# @DESCRIPTION:
-# By default, we run "phpize" in php-ext-source-r3_src_unpack(). Set
+# By default, we run "phpize" in php-ext-source-r3_src_prepare(). Set
# PHP_EXT_SKIP_PHPIZE="yes" in your ebuild if you do not want to run
# phpize (and the autoreconf that becomes necessary afterwards).
-# @FUNCTION: php-ext-source-r3_src_unpack
+# @ECLASS-VARIABLE: PHP_EXT_SKIP_PATCHES
+# @DEFAULT_UNSET
# @DESCRIPTION:
-# Runs the default src_unpack and then makes a copy for each PHP slot.
-php-ext-source-r3_src_unpack() {
- default
-
- local slot orig_s="${PHP_EXT_S}"
- for slot in $(php_get_slots); do
- cp --recursive --preserve "${orig_s}" "${WORKDIR}/${slot}" || \
- die "failed to copy sources from ${orig_s} to ${WORKDIR}/${slot}"
- done
-}
-
+# By default, we run default_src_prepare to PHP_EXT_S.
+# Set PHP_EXT_SKIP_PATCHES="yes" in your ebuild if you
+# want to apply patches yourself.
# @FUNCTION: php-ext-source-r3_src_prepare
# @DESCRIPTION:
@@ -165,9 +158,16 @@ php-ext-source-r3_src_unpack() {
# src_prepare() for PATCHES/eapply_user support, and then call
# php-ext-source-r3_phpize.
php-ext-source-r3_src_prepare() {
+ local slot orig_s="${PHP_EXT_S}"
+ if [[ "${PHP_EXT_SKIP_PATCHES}" != 'yes' ]] ; then
+ pushd "${orig_s}" > /dev/null || die
+ default
+ popd > /dev/null || die
+ fi
for slot in $(php_get_slots); do
+ cp --recursive --preserve "${orig_s}" "${WORKDIR}/${slot}" || \
+ die "failed to copy sources from ${orig_s} to ${WORKDIR}/${slot}"
php_init_slot_env "${slot}"
- default
php-ext-source-r3_phpize
done
}