1 |
The php-ext-pecl eclasses are based mainly on the php-ext-source |
2 |
eclasses. Now that we have a new revision php-ext-source-r3.eclass, |
3 |
this new revision of php-ext-pecl inherits that. As a result, all of |
4 |
the changes affecting that revision also affect this one. A migration |
5 |
guide for users can be found on the wiki: |
6 |
|
7 |
https://wiki.gentoo.org/wiki/Project:PHP/Php-ext-source-r3_migration_guide |
8 |
|
9 |
Gentoo-Bug: 512184 |
10 |
--- |
11 |
eclass/php-ext-pecl-r3.eclass | 93 +++++++++++++++++++++++++++++++++++++++++++ |
12 |
1 file changed, 93 insertions(+) |
13 |
create mode 100644 eclass/php-ext-pecl-r3.eclass |
14 |
|
15 |
diff --git a/eclass/php-ext-pecl-r3.eclass b/eclass/php-ext-pecl-r3.eclass |
16 |
new file mode 100644 |
17 |
index 0000000..bd9c622 |
18 |
--- /dev/null |
19 |
+++ b/eclass/php-ext-pecl-r3.eclass |
20 |
@@ -0,0 +1,93 @@ |
21 |
+# Copyright 1999-2016 Gentoo Foundation |
22 |
+# Distributed under the terms of the GNU General Public License v2 |
23 |
+# $Id$ |
24 |
+ |
25 |
+# @ECLASS: php-ext-pecl-r3.eclass |
26 |
+# @MAINTAINER: |
27 |
+# Gentoo PHP team <php-bugs@g.o> |
28 |
+# @BLURB: A uniform way to install PECL extensions |
29 |
+# @DESCRIPTION: |
30 |
+# This eclass should be used by all dev-php/pecl-* ebuilds as a uniform |
31 |
+# way of installing PECL extensions. For more information about PECL, |
32 |
+# see http://pecl.php.net/ |
33 |
+ |
34 |
+# @ECLASS-VARIABLE: PHP_EXT_PECL_PKG |
35 |
+# @DESCRIPTION: |
36 |
+# Set in ebuild before inheriting this eclass if the tarball name |
37 |
+# differs from ${PN/pecl-/} so that SRC_URI and HOMEPAGE get set |
38 |
+# correctly by the eclass. |
39 |
+# |
40 |
+# Setting this variable manually also affects PHP_EXT_NAME and ${S} |
41 |
+# unless you override those in ebuild. If that is not desired, please |
42 |
+# use PHP_EXT_PECL_FILENAME instead. |
43 |
+[[ -z "${PHP_EXT_PECL_PKG}" ]] && PHP_EXT_PECL_PKG="${PN/pecl-/}" |
44 |
+ |
45 |
+# @ECLASS-VARIABLE: PHP_EXT_PECL_FILENAME |
46 |
+# @DEFAULT_UNSET |
47 |
+# @DESCRIPTION: |
48 |
+# Set in ebuild before inheriting this eclass if the tarball name |
49 |
+# differs from ${PN/pecl-/} so that SRC_URI gets set correctly by |
50 |
+# the eclass. |
51 |
+# |
52 |
+# Unlike PHP_EXT_PECL_PKG, setting this variable does not affect |
53 |
+# HOMEPAGE, PHP_EXT_NAME or ${S}. |
54 |
+ |
55 |
+ |
56 |
+[[ -z ${MY_PV} ]] && MY_PV=${PV} |
57 |
+PECL_PKG="${PHP_EXT_PECL_PKG}" |
58 |
+MY_PV="${MY_PV/_/}" |
59 |
+PECL_PKG_V="${PECL_PKG}-${MY_PV}" |
60 |
+ |
61 |
+# Set PHP_EXT_NAME for php-ext-source-r3.eclass. |
62 |
+[[ -z "${PHP_EXT_NAME}" ]] && PHP_EXT_NAME="${PECL_PKG}" |
63 |
+ |
64 |
+S="${WORKDIR}/${PECL_PKG_V}" |
65 |
+ |
66 |
+inherit php-ext-source-r3 |
67 |
+ |
68 |
+EXPORT_FUNCTIONS src_compile src_install src_test |
69 |
+ |
70 |
+FILENAME="${PECL_PKG_V}.tgz" |
71 |
+if [[ -n "${PHP_EXT_PECL_FILENAME}" ]] ; then |
72 |
+ FILENAME="${PHP_EXT_PECL_FILENAME}-${MY_PV}.tgz" |
73 |
+fi |
74 |
+ |
75 |
+SRC_URI="http://pecl.php.net/get/${FILENAME}" |
76 |
+HOMEPAGE="http://pecl.php.net/${PECL_PKG}" |
77 |
+ |
78 |
+ |
79 |
+# @FUNCTION: php-ext-pecl-r3_src_compile |
80 |
+# @DESCRIPTION: |
81 |
+# Compile a standard PECL package. The process is the same as for any |
82 |
+# standalone PHP extension, so we delegate to php-ext-source-r3.eclass. |
83 |
+php-ext-pecl-r3_src_compile() { |
84 |
+ php-ext-source-r3_src_compile |
85 |
+} |
86 |
+ |
87 |
+ |
88 |
+# @FUNCTION: php-ext-pecl-r3_src_install |
89 |
+# @DESCRIPTION: |
90 |
+# Install a standard PECL package. First we delegate to |
91 |
+# php-ext-source-r3.eclass, and then we attempt to install examples |
92 |
+# found in a standard location. |
93 |
+php-ext-pecl-r3_src_install() { |
94 |
+ php-ext-source-r3_src_install |
95 |
+ |
96 |
+ if has examples ${IUSE} && use examples ; then |
97 |
+ dodoc -r examples |
98 |
+ fi |
99 |
+} |
100 |
+ |
101 |
+ |
102 |
+# @FUNCTION: php-ext-pecl-r3_src_test |
103 |
+# @DESCRIPTION: |
104 |
+# Run tests delivered with the PECL package. Phpize will have generated |
105 |
+# a run-tests.php file to be executed by `make test`. We only need to |
106 |
+# force the test suite to run in non-interactive mode. |
107 |
+php-ext-pecl-r3_src_test() { |
108 |
+ for slot in $(php_get_slots); do |
109 |
+ php_init_slot_env "${slot}" |
110 |
+ NO_INTERACTION="yes" emake test || \ |
111 |
+ die "emake test failed for slot ${slot}" |
112 |
+ done |
113 |
+} |
114 |
-- |
115 |
2.7.3 |