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