From: Brian Evans <grknight@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Cc: Brian Evans <grknight@gentoo.org>
Subject: [gentoo-dev] [PATCH 2/2] php-ext-source-r3.eclass: Introduce PHP_EXT_NEEDED_USE
Date: Fri, 26 Jan 2018 10:38:57 -0500 [thread overview]
Message-ID: <20180126153857.30315-3-grknight@gentoo.org> (raw)
In-Reply-To: <20180126153857.30315-1-grknight@gentoo.org>
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(+)] )
---
eclass/php-ext-source-r3.eclass | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/eclass/php-ext-source-r3.eclass b/eclass/php-ext-source-r3.eclass
index 315ce32887f..96d55f97a55 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
--
2.16.1
next prev parent reply other threads:[~2018-01-26 15:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-26 15:38 [gentoo-dev] [RFC] php-ext-source-r3 eclass improvements Brian Evans
2018-01-26 15:38 ` [gentoo-dev] [PATCH 1/2] php-ext-source-r3.eclass: Introduce PHP_INI_NAME variable Brian Evans
2018-01-26 15:38 ` Brian Evans [this message]
2018-01-29 13:50 ` [gentoo-dev] [RFC] php-ext-source-r3 eclass improvements Brian Evans
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180126153857.30315-3-grknight@gentoo.org \
--to=grknight@gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox