1 |
commit: 852a595a2accb69d5b930693a11b3f378fd357a0 |
2 |
Author: Michael Orlitzky <mjo <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Aug 26 02:04:32 2015 +0000 |
4 |
Commit: Michael Orlitzky <mjo <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Aug 30 14:26:24 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=852a595a |
7 |
|
8 |
php-ext-source-r2.eclass: add prefix support. |
9 |
|
10 |
The php-ext-source-r2 eclass sets a bunch of environment variables of |
11 |
the form, |
12 |
|
13 |
PHPIZE="/usr/${libdir}/${1}/bin/phpize" |
14 |
|
15 |
and also tests for the existence of an INI file using absolute |
16 |
paths. To accomodate a prefix environment, all of these paths need to |
17 |
be prefixed with $EPREFIX. This commit adds the prefix to all absolute |
18 |
paths in the eclass. We then need to strip $EPREFIX from one |
19 |
invocation of `insinto` which handles $EPREFIX in its own way. |
20 |
|
21 |
This has been tested on =dev-php/pecl-imagick-3.3.0_rc2 in a prefix |
22 |
environment. |
23 |
|
24 |
Bug: 371985 |
25 |
Bug: 481410 |
26 |
|
27 |
eclass/php-ext-source-r2.eclass | 19 ++++++++++--------- |
28 |
1 file changed, 10 insertions(+), 9 deletions(-) |
29 |
|
30 |
diff --git a/eclass/php-ext-source-r2.eclass b/eclass/php-ext-source-r2.eclass |
31 |
index 17073a9..ad82fee 100644 |
32 |
--- a/eclass/php-ext-source-r2.eclass |
33 |
+++ b/eclass/php-ext-source-r2.eclass |
34 |
@@ -191,8 +191,9 @@ php-ext-source-r2_src_install() { |
35 |
for slot in $(php_get_slots); do |
36 |
php_init_slot_env ${slot} |
37 |
|
38 |
- # Let's put the default module away |
39 |
- insinto "${EXT_DIR}" |
40 |
+ # Let's put the default module away. Strip $EPREFIX from |
41 |
+ # $EXT_DIR before calling newins (which handles EPREFIX itself). |
42 |
+ insinto "${EXT_DIR#$EPREFIX}" |
43 |
newins "modules/${PHP_EXT_NAME}.so" "${PHP_EXT_NAME}.so" || die "Unable to install extension" |
44 |
|
45 |
local doc |
46 |
@@ -217,12 +218,12 @@ php_get_slots() { |
47 |
php_init_slot_env() { |
48 |
libdir=$(get_libdir) |
49 |
|
50 |
- PHPIZE="/usr/${libdir}/${1}/bin/phpize" |
51 |
- PHPCONFIG="/usr/${libdir}/${1}/bin/php-config" |
52 |
- PHPCLI="/usr/${libdir}/${1}/bin/php" |
53 |
- PHPCGI="/usr/${libdir}/${1}/bin/php-cgi" |
54 |
+ PHPIZE="${EPREFIX}/usr/${libdir}/${1}/bin/phpize" |
55 |
+ PHPCONFIG="${EPREFIX}/usr/${libdir}/${1}/bin/php-config" |
56 |
+ PHPCLI="${EPREFIX}/usr/${libdir}/${1}/bin/php" |
57 |
+ PHPCGI="${EPREFIX}/usr/${libdir}/${1}/bin/php-cgi" |
58 |
PHP_PKG="$(best_version =dev-lang/php-${1:3}*)" |
59 |
- PHPPREFIX="/usr/${libdir}/${slot}" |
60 |
+ PHPPREFIX="${EPREFIX}}/usr/${libdir}/${slot}" |
61 |
EXT_DIR="$(${PHPCONFIG} --extension-dir 2>/dev/null)" |
62 |
PHP_CURRENTSLOT=${1:3} |
63 |
|
64 |
@@ -239,7 +240,7 @@ php-ext-source-r2_buildinilist() { |
65 |
PHPINIFILELIST="" |
66 |
local x |
67 |
for x in ${PHPSAPILIST} ; do |
68 |
- if [[ -f "/etc/php/${x}-${1}/php.ini" ]] ; then |
69 |
+ if [[ -f "${EPREFIX}/etc/php/${x}-${1}/php.ini" ]] ; then |
70 |
PHPINIFILELIST="${PHPINIFILELIST} etc/php/${x}-${1}/ext/${PHP_EXT_NAME}.ini" |
71 |
fi |
72 |
done |
73 |
@@ -281,7 +282,7 @@ php-ext-source-r2_createinifiles() { |
74 |
done |
75 |
|
76 |
# Add support for installing PHP files into a version dependant directory |
77 |
- PHP_EXT_SHARED_DIR="/usr/share/php/${PHP_EXT_NAME}" |
78 |
+ PHP_EXT_SHARED_DIR="${EPREFIX}/usr/share/php/${PHP_EXT_NAME}" |
79 |
done |
80 |
} |