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: Mon, 29 Jan 2018 13:48:18
Message-Id: 1517233665.24e8fadab71d00fffab4206a6aa08c663d919e2b.grknight@gentoo
1 commit: 24e8fadab71d00fffab4206a6aa08c663d919e2b
2 Author: Brian Evans <grknight <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jan 26 15:29:06 2018 +0000
4 Commit: Brian Evans <grknight <AT> gentoo <DOT> org>
5 CommitDate: Mon Jan 29 13:47:45 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=24e8fada
7
8 php-ext-source-r3.eclass: Introduce PHP_EXT_NEEDED_USE
9
10 This simplifies the dependencies in an ebuild
11
12 @DESCRIPTION:
13 A list of USE flags to append to each PHP target selected
14 as a valid USE-dependency string. The value should be valid
15 for all targets so USE defaults may be necessary.
16 Example:
17 PHP_EXT_NEEDED_USE="mysql?,pdo,pcre(+)"
18
19 The PHP dependencies will result in:
20 php_targets_php7-0? ( dev-lang/php:7.0[mysql?,pdo,pcre(+)] )
21
22 Bug: https://bugs.gentoo.org/586446
23
24 eclass/php-ext-source-r3.eclass | 19 +++++++++++++++++++
25 1 file changed, 19 insertions(+)
26
27 diff --git a/eclass/php-ext-source-r3.eclass b/eclass/php-ext-source-r3.eclass
28 index 315ce32887f..96d55f97a55 100644
29 --- a/eclass/php-ext-source-r3.eclass
30 +++ b/eclass/php-ext-source-r3.eclass
31 @@ -84,6 +84,22 @@ esac
32 # @CODE@
33 : ${PHP_INI_NAME:=${PHP_EXT_NAME}}
34
35 +# @ECLASS-VARIABLE: PHP_EXT_NEEDED_USE
36 +# @DEFAULT_UNSET
37 +# @DESCRIPTION:
38 +# A list of USE flags to append to each PHP target selected
39 +# as a valid USE-dependency string. The value should be valid
40 +# for all targets so USE defaults may be necessary.
41 +# Example:
42 +# @CODE
43 +# PHP_EXT_NEEDED_USE="mysql?,pdo,pcre(+)"
44 +# @CODE
45 +#
46 +# The PHP dependencies will result in:
47 +# @CODE
48 +# php_targets_php7-0? ( dev-lang/php:7.0[mysql?,pdo,pcre(+)] )
49 +# @CODE
50 +
51
52 # Make sure at least one target is installed. First, start a USE
53 # conditional like "php?", but only when PHP_EXT_OPTIONAL_USE is
54 @@ -96,6 +112,9 @@ for _php_target in ${USE_PHP}; do
55 REQUIRED_USE+="php_targets_${_php_target} "
56 _php_slot=${_php_target/php}
57 _php_slot=${_php_slot/-/.}
58 + if [[ ${PHP_EXT_NEEDED_USE} ]] ; then
59 + _php_slot+=[${PHP_EXT_NEEDED_USE}]
60 + fi
61 PHPDEPEND+=" php_targets_${_php_target}? ( dev-lang/php:${_php_slot} )"
62 done