summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorMichael Orlitzky <mjo@gentoo.org>2015-08-25 22:04:32 -0400
committerMichael Orlitzky <mjo@gentoo.org>2015-08-30 10:26:24 -0400
commit852a595a2accb69d5b930693a11b3f378fd357a0 (patch)
tree529baa566f826cedadbfb33d988a53e982501455 /eclass
parentphp-ext-pecl-r2.eclass: fix eclass/function name comments. (diff)
downloadgentoo-852a595a2accb69d5b930693a11b3f378fd357a0.tar.gz
gentoo-852a595a2accb69d5b930693a11b3f378fd357a0.tar.bz2
gentoo-852a595a2accb69d5b930693a11b3f378fd357a0.zip
php-ext-source-r2.eclass: add prefix support.
The php-ext-source-r2 eclass sets a bunch of environment variables of the form, PHPIZE="/usr/${libdir}/${1}/bin/phpize" and also tests for the existence of an INI file using absolute paths. To accomodate a prefix environment, all of these paths need to be prefixed with $EPREFIX. This commit adds the prefix to all absolute paths in the eclass. We then need to strip $EPREFIX from one invocation of `insinto` which handles $EPREFIX in its own way. This has been tested on =dev-php/pecl-imagick-3.3.0_rc2 in a prefix environment. Bug: 371985 Bug: 481410
Diffstat (limited to 'eclass')
-rw-r--r--eclass/php-ext-source-r2.eclass19
1 files changed, 10 insertions, 9 deletions
diff --git a/eclass/php-ext-source-r2.eclass b/eclass/php-ext-source-r2.eclass
index 17073a9962f7..ad82feec6c32 100644
--- a/eclass/php-ext-source-r2.eclass
+++ b/eclass/php-ext-source-r2.eclass
@@ -191,8 +191,9 @@ php-ext-source-r2_src_install() {
for slot in $(php_get_slots); do
php_init_slot_env ${slot}
- # Let's put the default module away
- insinto "${EXT_DIR}"
+ # Let's put the default module away. Strip $EPREFIX from
+ # $EXT_DIR before calling newins (which handles EPREFIX itself).
+ insinto "${EXT_DIR#$EPREFIX}"
newins "modules/${PHP_EXT_NAME}.so" "${PHP_EXT_NAME}.so" || die "Unable to install extension"
local doc
@@ -217,12 +218,12 @@ php_get_slots() {
php_init_slot_env() {
libdir=$(get_libdir)
- PHPIZE="/usr/${libdir}/${1}/bin/phpize"
- PHPCONFIG="/usr/${libdir}/${1}/bin/php-config"
- PHPCLI="/usr/${libdir}/${1}/bin/php"
- PHPCGI="/usr/${libdir}/${1}/bin/php-cgi"
+ PHPIZE="${EPREFIX}/usr/${libdir}/${1}/bin/phpize"
+ PHPCONFIG="${EPREFIX}/usr/${libdir}/${1}/bin/php-config"
+ PHPCLI="${EPREFIX}/usr/${libdir}/${1}/bin/php"
+ PHPCGI="${EPREFIX}/usr/${libdir}/${1}/bin/php-cgi"
PHP_PKG="$(best_version =dev-lang/php-${1:3}*)"
- PHPPREFIX="/usr/${libdir}/${slot}"
+ PHPPREFIX="${EPREFIX}}/usr/${libdir}/${slot}"
EXT_DIR="$(${PHPCONFIG} --extension-dir 2>/dev/null)"
PHP_CURRENTSLOT=${1:3}
@@ -239,7 +240,7 @@ php-ext-source-r2_buildinilist() {
PHPINIFILELIST=""
local x
for x in ${PHPSAPILIST} ; do
- if [[ -f "/etc/php/${x}-${1}/php.ini" ]] ; then
+ if [[ -f "${EPREFIX}/etc/php/${x}-${1}/php.ini" ]] ; then
PHPINIFILELIST="${PHPINIFILELIST} etc/php/${x}-${1}/ext/${PHP_EXT_NAME}.ini"
fi
done
@@ -281,7 +282,7 @@ php-ext-source-r2_createinifiles() {
done
# Add support for installing PHP files into a version dependant directory
- PHP_EXT_SHARED_DIR="/usr/share/php/${PHP_EXT_NAME}"
+ PHP_EXT_SHARED_DIR="${EPREFIX}/usr/share/php/${PHP_EXT_NAME}"
done
}