diff options
author | Michael Orlitzky <mjo@gentoo.org> | 2017-01-06 17:11:27 -0500 |
---|---|---|
committer | Michael Orlitzky <mjo@gentoo.org> | 2017-01-06 17:39:14 -0500 |
commit | 25971a5a27a4e2dec8ef93ac9915de1045e7a67e (patch) | |
tree | f6be07c1f55fde673c4150a3d845ad3446c99767 /dev-php | |
parent | app-office/calligra: Drop old (diff) | |
download | gentoo-25971a5a27a4e2dec8ef93ac9915de1045e7a67e.tar.gz gentoo-25971a5a27a4e2dec8ef93ac9915de1045e7a67e.tar.bz2 gentoo-25971a5a27a4e2dec8ef93ac9915de1045e7a67e.zip |
dev-php/twig: fix build with USE=extension unset.
In commit 14f2ab0, I accidentally broke building with
USE="-extension". The eclass src_prepare phase was correctly skipped
(a new change), but then afterwards it became possible for the eclass
src_configure and src_compile to fail. Now those phases are skipped
when USE="-extension", too. For consistency and for a minor
performance improvement, the eclass src_unpack phase is skipped, too.
A new revision was made because I'm not 100% certain that it wasn't
possible to install the extension with USE="-extension" before. If
it was possible, any victims would want to re-emerge twig. I have
also added an unconditional RDEPEND on "dev-lang/php" that could
have been omitted before; that would itself justify a new revision.
Gentoo-Bug: 604874
Package-Manager: portage-2.3.0
Diffstat (limited to 'dev-php')
-rw-r--r-- | dev-php/twig/twig-1.29.0-r1.ebuild (renamed from dev-php/twig/twig-1.29.0.ebuild) | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/dev-php/twig/twig-1.29.0.ebuild b/dev-php/twig/twig-1.29.0-r1.ebuild index 679424cdfef4..55c86754ba10 100644 --- a/dev-php/twig/twig-1.29.0.ebuild +++ b/dev-php/twig/twig-1.29.0-r1.ebuild @@ -24,15 +24,43 @@ IUSE="doc extension test" DEPEND="test? ( dev-php/phpunit )" +# We always require *some* version of PHP; the eclass (conditionally) +# requires *specific* versions. +RDEPEND="dev-lang/php" + +src_unpack() { + # Don't make copies of the source tree if they won't be used. + if use extension; then + php-ext-source-r3_src_unpack + else + default + fi +} + src_prepare(){ # We need to call eapply_user ourselves, because it may be skipped # if either the "extension" USE flag is not set, or if the user's # PHP_TARGETS is essentially empty (does not contain "php5-6"). In - # the latter case, the eclass src_prepare does nothing. + # the latter case, the eclass src_prepare does nothing. We only call + # the eclass phase conditionally because the correct version of + # e.g. "phpize" may not be there unless USE=extension is set. eapply_user use extension && php-ext-source-r3_src_prepare } +src_configure() { + # The eclass phase will try to run the ./configure script even if it + # doesn't exist (in contrast to the default src_configure), so we + # need to skip it if the eclass src_prepare (that creates said + # script) is not run. + use extension && php-ext-source-r3_src_configure +} + +src_compile() { + # Avoids the same problem as in src_configure. + use extension && php-ext-source-r3_src_compile +} + src_install(){ use extension && php-ext-source-r3_src_install |