/[gentoo-x86]/eclass/php-ext-source-r2.eclass
Gentoo

Diff of /eclass/php-ext-source-r2.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.7 Revision 1.8
1# Copyright 1999-2007 Gentoo Foundation 1# Copyright 1999-2007 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/php-ext-source-r2.eclass,v 1.7 2011/01/09 00:05:10 robbat2 Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/php-ext-source-r2.eclass,v 1.8 2011/01/10 11:25:21 olemarkus Exp $
4# 4#
5# Author: Tal Peer <coredumb@gentoo.org> 5# Author: Tal Peer <coredumb@gentoo.org>
6# Author: Stuart Herbert <stuart@gentoo.org> 6# Author: Stuart Herbert <stuart@gentoo.org>
7# Author: Luca Longinotti <chtekk@gentoo.org> 7# Author: Luca Longinotti <chtekk@gentoo.org>
8# Author: Jakub Moc <jakub@gentoo.org> (documentation) 8# Author: Jakub Moc <jakub@gentoo.org> (documentation)
65# @ECLASS-VARIABLE: PHP_EXT_OPTIONAL_USE 65# @ECLASS-VARIABLE: PHP_EXT_OPTIONAL_USE
66# @DESCRIPTION: 66# @DESCRIPTION:
67# If set, this is the USE flag that the PHP dependencies are behind 67# If set, this is the USE flag that the PHP dependencies are behind
68# Most commonly set as PHP_EXT_OPTIONAL_USE=php to get the dependencies behind 68# Most commonly set as PHP_EXT_OPTIONAL_USE=php to get the dependencies behind
69# USE=php. 69# USE=php.
70
71# @ECLASS-VARIABLE: PHP_EXT_S
72# @DESCRIPTION:
73# The relative location of the temporary build directory for the PHP extension within
74# the source package. This is useful for packages that bundle the PHP extension.
75# Defaults to ${S}
76[[ -z "${PHP_EXT_S}" ]] && PHP_EXT_S="${S}"
70 77
71#Make sure at least one target is installed. Abuses USE dependencies. 78#Make sure at least one target is installed. Abuses USE dependencies.
72for target in ${USE_PHP}; do 79for target in ${USE_PHP}; do
73 IUSE="${IUSE} php_targets_${target}" 80 IUSE="${IUSE} php_targets_${target}"
74 target=${target/+} 81 target=${target/+}
95# phpize will be run by default for all ebuilds that use 102# phpize will be run by default for all ebuilds that use
96# php-ext-source-r2_src_unpack 103# php-ext-source-r2_src_unpack
97# Set PHP_EXT_SKIP_PHPIZE="yes" in your ebuild if you do not want to run phpize. 104# Set PHP_EXT_SKIP_PHPIZE="yes" in your ebuild if you do not want to run phpize.
98php-ext-source-r2_src_unpack() { 105php-ext-source-r2_src_unpack() {
99 unpack ${A} 106 unpack ${A}
100 local slot orig_s="$S" 107 local slot orig_s="${PHP_EXT_S}"
101 for slot in $(php_get_slots); do 108 for slot in $(php_get_slots); do
102 cp -r "${orig_s}" "${WORKDIR}/${slot}" 109 cp -r "${orig_s}" "${WORKDIR}/${slot}"
103 done 110 done
104} 111}
105 112
106php-ext-source-r2_src_prepare() { 113php-ext-source-r2_src_prepare() {
107 local slot orig_s="$S" 114 local slot orig_s="${PHP_EXT_S}"
108 for slot in $(php_get_slots); do 115 for slot in $(php_get_slots); do
109 php_init_slot_env ${slot} 116 php_init_slot_env ${slot}
110 php-ext-source-r2_phpize 117 php-ext-source-r2_phpize
111 done 118 done
112} 119}
139 for slot in $(php_get_slots); do 146 for slot in $(php_get_slots); do
140 php_init_slot_env ${slot} 147 php_init_slot_env ${slot}
141 # Set the correct config options 148 # Set the correct config options
142 # We cannot use econf here, phpize/php-config deals with setting 149 # We cannot use econf here, phpize/php-config deals with setting
143 # --prefix etc to whatever the php slot was configured to use 150 # --prefix etc to whatever the php slot was configured to use
151 echo ./configure --with-php-config=${PHPCONFIG} ${my_conf}
144 ./configure --with-php-config=${PHPCONFIG} ${my_conf} || die "Unable to configure code to compile" 152 ./configure --with-php-config=${PHPCONFIG} ${my_conf} || die "Unable to configure code to compile"
145 done 153 done
146} 154}
147 155
148# @FUNCTION: php-ext-source-r2_src_compile 156# @FUNCTION: php-ext-source-r2_src_compile
205 PHP_PKG="$(best_version =dev-lang/php-${1:3}*)" 213 PHP_PKG="$(best_version =dev-lang/php-${1:3}*)"
206 PHPPREFIX="/usr/${libdir}/${slot}" 214 PHPPREFIX="/usr/${libdir}/${slot}"
207 EXT_DIR="$(${PHPCONFIG} --extension-dir 2>/dev/null)" 215 EXT_DIR="$(${PHPCONFIG} --extension-dir 2>/dev/null)"
208 PHP_CURRENTSLOT=${1:3} 216 PHP_CURRENTSLOT=${1:3}
209 217
210 S="${WORKDIR}/${1}" 218 PHP_EXT_S="${WORKDIR}/${1}"
211 cd "${S}" 219 cd "${PHP_EXT_S}"
212} 220}
213 221
214php-ext-source-r2_buildinilist() { 222php-ext-source-r2_buildinilist() {
215 # Work out the list of <ext>.ini files to edit/add to 223 # Work out the list of <ext>.ini files to edit/add to
216 if [[ -z "${PHPSAPILIST}" ]] ; then 224 if [[ -z "${PHPSAPILIST}" ]] ; then

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

  ViewVC Help
Powered by ViewVC 1.1.20