summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2011-01-09 00:05:10 +0000
committerRobin H. Johnson <robbat2@gentoo.org>2011-01-09 00:05:10 +0000
commit6bc39fb708a92ab261e827257e16031e0c886771 (patch)
treed247b8d46718544864dfe33e5f6e46fffa2c293d /eclass
parentadded ~sparc keyword (bug 348984) (diff)
downloadgentoo-2-6bc39fb708a92ab261e827257e16031e0c886771.tar.gz
gentoo-2-6bc39fb708a92ab261e827257e16031e0c886771.tar.bz2
gentoo-2-6bc39fb708a92ab261e827257e16031e0c886771.zip
Implement PHP_EXT_OPTIONAL_USE as a way to make the PHP dependency optional for bug #351098: Supports prevents packages USE=-php bringing in PHP when they do not need it.
Diffstat (limited to 'eclass')
-rw-r--r--eclass/php-ext-source-r2.eclass12
1 files changed, 10 insertions, 2 deletions
diff --git a/eclass/php-ext-source-r2.eclass b/eclass/php-ext-source-r2.eclass
index 2fa12528f41f..84f053765dc1 100644
--- a/eclass/php-ext-source-r2.eclass
+++ b/eclass/php-ext-source-r2.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/php-ext-source-r2.eclass,v 1.6 2010/12/27 22:19:51 darkside Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/php-ext-source-r2.eclass,v 1.7 2011/01/09 00:05:10 robbat2 Exp $
#
# Author: Tal Peer <coredumb@gentoo.org>
# Author: Stuart Herbert <stuart@gentoo.org>
@@ -62,6 +62,12 @@ esac
# Lists the PHP slots compatibile the extension is compatibile with
[[ -z "${USE_PHP}" ]] && USE_PHP="php5-2 php5-3"
+# @ECLASS-VARIABLE: PHP_EXT_OPTIONAL_USE
+# @DESCRIPTION:
+# If set, this is the USE flag that the PHP dependencies are behind
+# Most commonly set as PHP_EXT_OPTIONAL_USE=php to get the dependencies behind
+# USE=php.
+
#Make sure at least one target is installed. Abuses USE dependencies.
for target in ${USE_PHP}; do
IUSE="${IUSE} php_targets_${target}"
@@ -74,8 +80,10 @@ for target in ${USE_PHP}; do
done
RDEPEND="${RDEPEND}
+ ${PHP_EXT_OPTIONAL_USE}${PHP_EXT_OPTIONAL_USE:+? ( }
|| ( ${SELFDEPEND} )
- ${PHPDEPEND}"
+ ${PHPDEPEND}
+ ${PHP_EXT_OPTIONAL_USE:+ )}"
# @FUNCTION: php-ext-source-r2_src_unpack