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