summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorBrian Evans <grknight@gentoo.org>2018-01-26 10:29:06 -0500
committerBrian Evans <grknight@gentoo.org>2018-01-29 08:47:45 -0500
commit24e8fadab71d00fffab4206a6aa08c663d919e2b (patch)
tree7be18f7da43ecc7c7130807addac0a2f697a12c3 /eclass
parentphp-ext-source-r3.eclass: Introduce PHP_INI_NAME variable (diff)
downloadgentoo-24e8fadab71d00fffab4206a6aa08c663d919e2b.tar.gz
gentoo-24e8fadab71d00fffab4206a6aa08c663d919e2b.tar.bz2
gentoo-24e8fadab71d00fffab4206a6aa08c663d919e2b.zip
php-ext-source-r3.eclass: Introduce PHP_EXT_NEEDED_USE
This simplifies the dependencies in an ebuild @DESCRIPTION: A list of USE flags to append to each PHP target selected as a valid USE-dependency string. The value should be valid for all targets so USE defaults may be necessary. Example: PHP_EXT_NEEDED_USE="mysql?,pdo,pcre(+)" The PHP dependencies will result in: php_targets_php7-0? ( dev-lang/php:7.0[mysql?,pdo,pcre(+)] ) Bug: https://bugs.gentoo.org/586446
Diffstat (limited to 'eclass')
-rw-r--r--eclass/php-ext-source-r3.eclass19
1 files changed, 19 insertions, 0 deletions
diff --git a/eclass/php-ext-source-r3.eclass b/eclass/php-ext-source-r3.eclass
index 315ce32887f6..96d55f97a553 100644
--- a/eclass/php-ext-source-r3.eclass
+++ b/eclass/php-ext-source-r3.eclass
@@ -84,6 +84,22 @@ esac
# @CODE@
: ${PHP_INI_NAME:=${PHP_EXT_NAME}}
+# @ECLASS-VARIABLE: PHP_EXT_NEEDED_USE
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# A list of USE flags to append to each PHP target selected
+# as a valid USE-dependency string. The value should be valid
+# for all targets so USE defaults may be necessary.
+# Example:
+# @CODE
+# PHP_EXT_NEEDED_USE="mysql?,pdo,pcre(+)"
+# @CODE
+#
+# The PHP dependencies will result in:
+# @CODE
+# php_targets_php7-0? ( dev-lang/php:7.0[mysql?,pdo,pcre(+)] )
+# @CODE
+
# Make sure at least one target is installed. First, start a USE
# conditional like "php?", but only when PHP_EXT_OPTIONAL_USE is
@@ -96,6 +112,9 @@ for _php_target in ${USE_PHP}; do
REQUIRED_USE+="php_targets_${_php_target} "
_php_slot=${_php_target/php}
_php_slot=${_php_slot/-/.}
+ if [[ ${PHP_EXT_NEEDED_USE} ]] ; then
+ _php_slot+=[${PHP_EXT_NEEDED_USE}]
+ fi
PHPDEPEND+=" php_targets_${_php_target}? ( dev-lang/php:${_php_slot} )"
done