From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 44BA81382C5 for ; Fri, 26 Jan 2018 15:39:30 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 38D42E09B0; Fri, 26 Jan 2018 15:39:03 +0000 (UTC) Received: from mx1.scent-team.com (mx1.scent-team.com [50.120.197.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id DF020E096F for ; Fri, 26 Jan 2018 15:39:02 +0000 (UTC) X-Virus-Scanned: amavisd-new at scent-team.com Received: from rukia.scent-team.com (unknown [192.168.123.75]) by mx1.scent-team.com (Postfix) with ESMTP id 3zSjkF70TrzBYvkM; Fri, 26 Jan 2018 10:39:01 -0500 (EST) From: Brian Evans To: gentoo-dev@lists.gentoo.org Cc: Brian Evans 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 Message-Id: <20180126153857.30315-3-grknight@gentoo.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180126153857.30315-1-grknight@gentoo.org> References: <20180126153857.30315-1-grknight@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Archives-Salt: dabecb83-ecca-4583-a320-477d2434162b X-Archives-Hash: 6c98ea437703b46b747f8be0b979773f 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