/[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.4 Revision 1.6
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.4 2010/11/02 21:46:05 olemarkus Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/php-ext-source-r2.eclass,v 1.6 2010/12/27 22:19:51 darkside 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)
14# @BLURB: A unified interface for compiling and installing standalone PHP extensions. 14# @BLURB: A unified interface for compiling and installing standalone PHP extensions.
15# @DESCRIPTION: 15# @DESCRIPTION:
16# This eclass provides a unified interface for compiling and installing standalone 16# This eclass provides a unified interface for compiling and installing standalone
17# PHP extensions (modules). 17# PHP extensions (modules).
18 18
19inherit flag-o-matic autotools depend.php 19inherit flag-o-matic autotools
20 20
21EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_install 21EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_install
22 22
23# @ECLASS-VARIABLE: PHP_EXT_NAME 23# @ECLASS-VARIABLE: PHP_EXT_NAME
24# @DESCRIPTION: 24# @DESCRIPTION:
67 IUSE="${IUSE} php_targets_${target}" 67 IUSE="${IUSE} php_targets_${target}"
68 target=${target/+} 68 target=${target/+}
69 SELFDEPEND="${SELFDEPEND} =${CATEGORY}/${PF}[php_targets_${target}]" 69 SELFDEPEND="${SELFDEPEND} =${CATEGORY}/${PF}[php_targets_${target}]"
70 slot=${target/php} 70 slot=${target/php}
71 slot=${slot/-/.} 71 slot=${slot/-/.}
72 PHPDEPEND="${PHPDEPEND} 72 PHPDEPEND="${PHPDEPEND}
73 php_targets_${target}? ( dev-lang/php:${slot} )" 73 php_targets_${target}? ( dev-lang/php:${slot} )"
74done 74done
75 75
76RDEPEND="${RDEPEND} 76RDEPEND="${RDEPEND}
77 || ( ${SELFDEPEND} ) 77 || ( ${SELFDEPEND} )
78 ${PHPDEPEND}" 78 ${PHPDEPEND}"
79 79
80 80
81# @FUNCTION: php-ext-source-r2_src_unpack 81# @FUNCTION: php-ext-source-r2_src_unpack
83# runs standard src_unpack + _phpize 83# runs standard src_unpack + _phpize
84# 84#
85# @VARIABLE: PHP_EXT_SKIP_PHPIZE 85# @VARIABLE: PHP_EXT_SKIP_PHPIZE
86# @DESCRIPTION: 86# @DESCRIPTION:
87# phpize will be run by default for all ebuilds that use 87# phpize will be run by default for all ebuilds that use
88# php-ext-source-r1_src_unpack 88# php-ext-source-r2_src_unpack
89# Set PHP_EXT_SKIP_PHPIZE="yes" in your ebuild if you do not want to run phpize. 89# Set PHP_EXT_SKIP_PHPIZE="yes" in your ebuild if you do not want to run phpize.
90php-ext-source-r2_src_unpack() { 90php-ext-source-r2_src_unpack() {
91 unpack ${A} 91 unpack ${A}
92 local slot orig_s="$S" 92 local slot orig_s="$S"
93 for slot in $(php_get_slots); do 93 for slot in $(php_get_slots); do
114 ${PHPIZE} 114 ${PHPIZE}
115 # force run of libtoolize and regeneration of related autotools 115 # force run of libtoolize and regeneration of related autotools
116 # files (bug 220519) 116 # files (bug 220519)
117 rm aclocal.m4 117 rm aclocal.m4
118 eautoreconf 118 eautoreconf
119 fi 119 fi
120} 120}
121 121
122# @FUNCTION: php-ext-source-r2_src_configure 122# @FUNCTION: php-ext-source-r2_src_configure
123# @DESCRIPTION: 123# @DESCRIPTION:
124# Takes care of standard configure for PHP extensions (modules). 124# Takes care of standard configure for PHP extensions (modules).
143php-ext-source-r2_src_compile() { 143php-ext-source-r2_src_compile() {
144 # net-snmp creates this file #324739 144 # net-snmp creates this file #324739
145 addpredict /usr/share/snmp/mibs/.index 145 addpredict /usr/share/snmp/mibs/.index
146 # shm extension createss a semaphore file #173574 146 # shm extension createss a semaphore file #173574
147 addpredict /session_mm_cli0.sem 147 addpredict /session_mm_cli0.sem
148 local slot 148 local slot
149 for slot in $(php_get_slots); do 149 for slot in $(php_get_slots); do
150 php_init_slot_env ${slot} 150 php_init_slot_env ${slot}
151 emake || die "Unable to make code" 151 emake || die "Unable to make code"
152 152
153 done 153 done
195 PHPCLI="/usr/${libdir}/${1}/bin/php" 195 PHPCLI="/usr/${libdir}/${1}/bin/php"
196 PHPCGI="/usr/${libdir}/${1}/bin/php-cgi" 196 PHPCGI="/usr/${libdir}/${1}/bin/php-cgi"
197 PHP_PKG="$(best_version =dev-lang/php-${1:3}*)" 197 PHP_PKG="$(best_version =dev-lang/php-${1:3}*)"
198 PHPPREFIX="/usr/${libdir}/${slot}" 198 PHPPREFIX="/usr/${libdir}/${slot}"
199 EXT_DIR="$(${PHPCONFIG} --extension-dir 2>/dev/null)" 199 EXT_DIR="$(${PHPCONFIG} --extension-dir 2>/dev/null)"
200 PHP_CURRENTSLOT=${1:3}
200 201
201 S="${WORKDIR}/${1}" 202 S="${WORKDIR}/${1}"
202 cd "${S}" 203 cd "${S}"
203} 204}
204 205
220# @FUNCTION: php-ext-source-r2_createinifiles 221# @FUNCTION: php-ext-source-r2_createinifiles
221# @DESCRIPTION: 222# @DESCRIPTION:
222# Builds ini files for every enabled slot and SAPI 223# Builds ini files for every enabled slot and SAPI
223php-ext-source-r2_createinifiles() { 224php-ext-source-r2_createinifiles() {
224 local slot 225 local slot
225 for slot in $(php_get_slots); do 226 for slot in $(php_get_slots); do
226 php_init_slot_env ${slot} 227 php_init_slot_env ${slot}
227 # Pull in the PHP settings 228 # Pull in the PHP settings
228 229
229 # Build the list of <ext>.ini files to edit/add to 230 # Build the list of <ext>.ini files to edit/add to
230 php-ext-source-r2_buildinilist ${slot} 231 php-ext-source-r2_buildinilist ${slot}
249 250
250php-ext-source-r2_addextension() { 251php-ext-source-r2_addextension() {
251 if [[ "${PHP_EXT_ZENDEXT}" = "yes" ]] ; then 252 if [[ "${PHP_EXT_ZENDEXT}" = "yes" ]] ; then
252 # We need the full path for ZendEngine extensions 253 # We need the full path for ZendEngine extensions
253 # and we need to check for debugging enabled! 254 # and we need to check for debugging enabled!
254 if has_zts ; then 255 if has_version "dev-lang/php:${PHP_CURRENTSLOT}[threads]" ; then
255 if has_debug ; then 256 if has_version "dev-lang/php:${PHP_CURRENTSLOT}[debug]" ; then
256 ext_type="zend_extension_debug_ts" 257 ext_type="zend_extension_debug_ts"
257 else 258 else
258 ext_type="zend_extension_ts" 259 ext_type="zend_extension_ts"
259 fi 260 fi
260 ext_file="${EXT_DIR}/${1}" 261 ext_file="${EXT_DIR}/${1}"
261 else 262 else
262 if has_debug ; then 263 if has_version "dev-lang/php:${PHP_CURRENTSLOT}[debug]"; then
263 ext_type="zend_extension_debug" 264 ext_type="zend_extension_debug"
264 else 265 else
265 ext_type="zend_extension" 266 ext_type="zend_extension"
266 fi 267 fi
267 ext_file="${EXT_DIR}/${1}" 268 ext_file="${EXT_DIR}/${1}"

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.6

  ViewVC Help
Powered by ViewVC 1.1.20