Gentoo Archives: gentoo-commits

From: Brian Evans <grknight@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/php/
Date: Tue, 28 Nov 2017 13:47:39
Message-Id: 1511876833.51ea42a0484fabd7049905f267af4e9275758f2d.grknight@gentoo
1 commit: 51ea42a0484fabd7049905f267af4e9275758f2d
2 Author: Brian Evans <grknight <AT> gentoo <DOT> org>
3 AuthorDate: Tue Nov 28 13:47:13 2017 +0000
4 Commit: Brian Evans <grknight <AT> gentoo <DOT> org>
5 CommitDate: Tue Nov 28 13:47:13 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=51ea42a0
7
8 dev-lang/php: Version bump to 7.0.26
9
10 Package-Manager: Portage-2.3.16, Repoman-2.3.6
11
12 dev-lang/php/Manifest | 9 +-
13 dev-lang/php/php-7.0.26.ebuild | 739 +++++++++++++++++++++++++++++++++++++++++
14 2 files changed, 744 insertions(+), 4 deletions(-)
15
16 diff --git a/dev-lang/php/Manifest b/dev-lang/php/Manifest
17 index 53bc1176af6..102f1714134 100644
18 --- a/dev-lang/php/Manifest
19 +++ b/dev-lang/php/Manifest
20 @@ -1,4 +1,5 @@
21 -DIST php-5.6.32.tar.xz 12464512 SHA256 8c2b4f721c7475fb9eabda2495209e91ea933082e6f34299d11cba88cd76e64b SHA512 f0556a23f2a2711cda25dd25e63996c9315e7da13555a7169ee701406454e4d372ffca82476b4a474a96b2f3d3b783f6827042df71bb245514884d7c3d23530b WHIRLPOOL eae1a493ddb2c01166fb2364d31248f0d68eadb53aa0802cec336833ee7d76f30c161ae36d0984f5b9386a3e1ace33c0d8bc02153d0c0da49a7a2d5f489b8624
22 -DIST php-7.0.25.tar.xz 11963668 SHA256 5cc14bd20fb2226f6d34465662425cd100441bde9042ea1cef2e4506d6ded8cc SHA512 7a31fe48f3843a5380a7ab7b04ba2006e739f96d314b662beb337a8e76fbb2f3c1e1e22a8c9d5209bad61deb0ccc21706f0dedd12d15766f7795497549b4cae4 WHIRLPOOL 3998e5d6dcded72feb38ffdfd3c1e0b467151f5b9c0ff111ab4b6a90e2ad29a4a4929641f7af1c983b9a5df0a8a2d54af17d2eeb82a9b7efe8e6cbb199334440
23 -DIST php-7.1.11.tar.xz 12169884 SHA256 074093e9d7d21afedc5106904218a80a47b854abe368d2728ed22184c884893e SHA512 400bc75d938f49754586d2b14b8f300c5a1e961489c02c968c7560ea0edc3765992580306c6185ecee57734775f8abaf7525a2aaa5110db2d8efacf2701c0101 WHIRLPOOL 8d5414b31838e10524a34facbab9a6e749d84f03752c2ec5a2d82f3dcab2b6e804d691101610398a136c68e1002eb6a9294d818166eecebb706d7f7d343f9620
24 -DIST php-7.2.0RC6.tar.xz 12077856 SHA256 be4df00ff5b66e9f13c83e1d08d1d5384ae7ccc820e26f7e5f9e660011496a9e SHA512 7cddd7bce3dddbe478124450f95150012dfa4376ea7a0dde7d2b1caaf9de6b44c39c60db3da6756b25c100f0f852d17cee8e13986d5e9711337388a40a6635e4 WHIRLPOOL 8dd4bc62d4f0863a41a0200efa6012fd1ea38a51a468a21886fd8b6d9e050bfd7777f4066cb4db4ade70610c68174a8da89358a235b564aac4388c4bbf4ef04e
25 +DIST php-5.6.32.tar.xz 12464512 BLAKE2B ef54f9a30e15f16f456973c4e0ef0bcb9402b206f944b1b2838b10b0c5c985fe9d9966ecd5569d9f4dbb1c5dd3ff63dbbe79be7009da8379942f442a1a0ad1f2 SHA512 f0556a23f2a2711cda25dd25e63996c9315e7da13555a7169ee701406454e4d372ffca82476b4a474a96b2f3d3b783f6827042df71bb245514884d7c3d23530b
26 +DIST php-7.0.25.tar.xz 11963668 BLAKE2B 8d20ce3574d72c39b4e90b466d7d06800458e9ab95724b92c07da7689a69014ec5924355399651b63b3cef7261ba8778bb29dc65712acf47fd4bd000ab6d2180 SHA512 7a31fe48f3843a5380a7ab7b04ba2006e739f96d314b662beb337a8e76fbb2f3c1e1e22a8c9d5209bad61deb0ccc21706f0dedd12d15766f7795497549b4cae4
27 +DIST php-7.0.26.tar.xz 11966888 BLAKE2B 4d7ceefa2226aa8a7f2a62511504f63d4d22a59fa2953edcca9b086b1ce5ec1a5cb111c37678fc24b32bcd67d53cdd127a728eb4340c24c64f8042e6ee6e2b88 SHA512 314062acb2e1c860ba616dae15254fcb25d73784e976a1a4dd1de200e4a457f4fd167d2e6c8400f37156839e474ff484fddd35d7ea57a9c923b39ad529449c38
28 +DIST php-7.1.11.tar.xz 12169884 BLAKE2B e7ec69cdf5e0e985a9d48b90308e1e4a97967239f9fac3d503fc0639af474bfc933c90861137f31c4b0685e850e5eb5813e755dd4587cb7eea5dddc61105161b SHA512 400bc75d938f49754586d2b14b8f300c5a1e961489c02c968c7560ea0edc3765992580306c6185ecee57734775f8abaf7525a2aaa5110db2d8efacf2701c0101
29 +DIST php-7.2.0RC6.tar.xz 12077856 BLAKE2B 0143858ff760cf9b81e05fea753f2021924b3ec8414e4e7a56426beb457698a2789b204f1e6b446ecec4c48f2b7c646575ef59a60d040e242a28ae9bf7e650fc SHA512 7cddd7bce3dddbe478124450f95150012dfa4376ea7a0dde7d2b1caaf9de6b44c39c60db3da6756b25c100f0f852d17cee8e13986d5e9711337388a40a6635e4
30
31 diff --git a/dev-lang/php/php-7.0.26.ebuild b/dev-lang/php/php-7.0.26.ebuild
32 new file mode 100644
33 index 00000000000..947d712ca81
34 --- /dev/null
35 +++ b/dev-lang/php/php-7.0.26.ebuild
36 @@ -0,0 +1,739 @@
37 +# Copyright 1999-2017 Gentoo Foundation
38 +# Distributed under the terms of the GNU General Public License v2
39 +
40 +EAPI=6
41 +
42 +inherit flag-o-matic versionator systemd
43 +
44 +DESCRIPTION="The PHP language runtime engine"
45 +HOMEPAGE="https://secure.php.net/"
46 +SRC_URI="https://secure.php.net/distributions/${P}.tar.xz"
47 +
48 +LICENSE="PHP-3.01
49 + BSD
50 + Zend-2.0
51 + bcmath? ( LGPL-2.1+ )
52 + fpm? ( BSD-2 )
53 + gd? ( gd )
54 + unicode? ( BSD-2 LGPL-2.1 )"
55 +
56 +SLOT="$(get_version_component_range 1-2)"
57 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
58 +
59 +# We can build the following SAPIs in the given order
60 +SAPIS="embed cli cgi fpm apache2 phpdbg"
61 +
62 +# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
63 +IUSE="${IUSE}
64 + ${SAPIS/cli/+cli}
65 + threads"
66 +
67 +IUSE="${IUSE} acl bcmath berkdb bzip2 calendar cdb cjk
68 + coverage crypt +ctype curl debug
69 + enchant exif +fileinfo +filter firebird
70 + flatfile ftp gd gdbm gmp +hash +iconv imap inifile
71 + intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl
72 + mhash mssql mysql mysqli nls
73 + oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
74 + readline recode selinux +session sharedmem
75 + +simplexml snmp soap sockets spell sqlite ssl
76 + sysvipc systemd tidy +tokenizer truetype unicode wddx webp
77 + +xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib"
78 +
79 +# The supported (that is, autodetected) versions of BDB are listed in
80 +# the ./configure script. Other versions *work*, but we need to stick to
81 +# the ones that can be detected to avoid a repeat of bug #564824.
82 +COMMON_DEPEND="
83 + >=app-eselect/eselect-php-0.9.1[apache2?,fpm?]
84 + >=dev-libs/libpcre-8.32[unicode]
85 + acl? ( sys-apps/acl )
86 + apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=]
87 + <www-servers/apache-2.4[threads=] ) )
88 + berkdb? ( || ( sys-libs/db:5.3
89 + sys-libs/db:5.1
90 + sys-libs/db:4.8
91 + sys-libs/db:4.7
92 + sys-libs/db:4.6
93 + sys-libs/db:4.5 ) )
94 + bzip2? ( app-arch/bzip2 )
95 + cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
96 + cjk? ( !gd? (
97 + virtual/jpeg:0
98 + media-libs/libpng:0=
99 + sys-libs/zlib
100 + ) )
101 + coverage? ( dev-util/lcov )
102 + crypt? ( >=dev-libs/libmcrypt-2.4 )
103 + curl? ( >=net-misc/curl-7.10.5 )
104 + enchant? ( app-text/enchant )
105 + exif? ( !gd? (
106 + virtual/jpeg:0
107 + media-libs/libpng:0=
108 + sys-libs/zlib
109 + ) )
110 + firebird? ( dev-db/firebird )
111 + gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib )
112 + gdbm? ( >=sys-libs/gdbm-1.8.0 )
113 + gmp? ( dev-libs/gmp:0 )
114 + iconv? ( virtual/libiconv )
115 + imap? ( virtual/imap-c-client[kerberos=,ssl=] )
116 + intl? ( dev-libs/icu:= )
117 + iodbc? ( dev-db/libiodbc )
118 + kerberos? ( virtual/krb5 )
119 + ldap? ( >=net-nds/openldap-1.2.11 )
120 + ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 )
121 + libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) )
122 + mssql? ( dev-db/freetds[mssql] )
123 + nls? ( sys-devel/gettext )
124 + oci8-instant-client? ( dev-db/oracle-instantclient-basic )
125 + odbc? ( >=dev-db/unixODBC-1.8.13 )
126 + postgres? ( dev-db/postgresql:* )
127 + qdbm? ( dev-db/qdbm )
128 + readline? ( sys-libs/readline:0= )
129 + recode? ( app-text/recode )
130 + sharedmem? ( dev-libs/mm )
131 + simplexml? ( >=dev-libs/libxml2-2.6.8 )
132 + snmp? ( >=net-analyzer/net-snmp-5.2 )
133 + soap? ( >=dev-libs/libxml2-2.6.8 )
134 + spell? ( >=app-text/aspell-0.50 )
135 + sqlite? ( >=dev-db/sqlite-3.7.6.3 )
136 + ssl? (
137 + !libressl? ( dev-libs/openssl:0 )
138 + libressl? ( dev-libs/libressl )
139 + )
140 + tidy? ( app-text/htmltidy )
141 + truetype? (
142 + =media-libs/freetype-2*
143 + !gd? (
144 + virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib )
145 + )
146 + unicode? ( dev-libs/oniguruma:= )
147 + wddx? ( >=dev-libs/libxml2-2.6.8 )
148 + webp? ( media-libs/libwebp )
149 + xml? ( >=dev-libs/libxml2-2.6.8 )
150 + xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
151 + xmlreader? ( >=dev-libs/libxml2-2.6.8 )
152 + xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
153 + xpm? (
154 + x11-libs/libXpm
155 + virtual/jpeg:0
156 + media-libs/libpng:0= sys-libs/zlib
157 + )
158 + xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
159 + zip? ( sys-libs/zlib )
160 + zlib? ( sys-libs/zlib )
161 +"
162 +
163 +RDEPEND="${COMMON_DEPEND}
164 + virtual/mta
165 + fpm? (
166 + selinux? ( sec-policy/selinux-phpfpm )
167 + systemd? ( sys-apps/systemd ) )"
168 +
169 +DEPEND="${COMMON_DEPEND}
170 + app-arch/xz-utils
171 + >=sys-devel/bison-3.0.1
172 + sys-devel/flex
173 + >=sys-devel/m4-1.4.3
174 + >=sys-devel/libtool-1.5.18"
175 +
176 +# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
177 +REQUIRED_USE="
178 + || ( cli cgi fpm apache2 embed phpdbg )
179 + cli? ( ^^ ( readline libedit ) )
180 + truetype? ( gd )
181 + webp? ( gd )
182 + cjk? ( gd )
183 + exif? ( gd )
184 + xpm? ( gd )
185 + gd? ( zlib )
186 + simplexml? ( xml )
187 + soap? ( xml )
188 + wddx? ( xml )
189 + xmlrpc? ( || ( xml iconv ) )
190 + xmlreader? ( xml )
191 + xslt? ( xml )
192 + ldap-sasl? ( ldap )
193 + mhash? ( hash )
194 + phar? ( hash )
195 + qdbm? ( !gdbm )
196 + readline? ( !libedit )
197 + recode? ( !imap !mysqli !mysql )
198 + sharedmem? ( !threads )
199 + mysql? ( || ( mysqli pdo ) )
200 +"
201 +
202 +PHP_MV="$(get_major_version)"
203 +
204 +php_install_ini() {
205 + local phpsapi="${1}"
206 +
207 + # work out where we are installing the ini file
208 + php_set_ini_dir "${phpsapi}"
209 +
210 + # Always install the production INI file, bug 611214.
211 + local phpinisrc="php.ini-production-${phpsapi}"
212 + cp php.ini-production "${phpinisrc}" || die
213 +
214 + # default to /tmp for save_path, bug #282768
215 + sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die
216 +
217 + # Set the extension dir
218 + sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \
219 + -i "${phpinisrc}" || die
220 +
221 + # Set the include path to point to where we want to find PEAR packages
222 + sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die
223 +
224 + dodir "${PHP_INI_DIR#${EPREFIX}}"
225 + insinto "${PHP_INI_DIR#${EPREFIX}}"
226 + newins "${phpinisrc}" php.ini
227 +
228 + elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}"
229 + elog
230 +
231 + dodir "${PHP_EXT_INI_DIR#${EPREFIX}}"
232 + dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}"
233 +
234 + if use opcache; then
235 + elog "Adding opcache to $PHP_EXT_INI_DIR"
236 + echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \
237 + "${D}/${PHP_EXT_INI_DIR}"/opcache.ini
238 + dosym "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" \
239 + "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini"
240 + fi
241 +
242 + # SAPI-specific handling
243 + if [[ "${sapi}" == "fpm" ]] ; then
244 + einfo "Installing FPM config files php-fpm.conf and www.conf"
245 + insinto "${PHP_INI_DIR#${EPREFIX}}"
246 + doins sapi/fpm/php-fpm.conf
247 + insinto "${PHP_INI_DIR#${EPREFIX}}/fpm.d"
248 + doins sapi/fpm/www.conf
249 + fi
250 +
251 + dodoc php.ini-{development,production}
252 +}
253 +
254 +php_set_ini_dir() {
255 + PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}"
256 + PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
257 + PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
258 +}
259 +
260 +src_prepare() {
261 + default
262 +
263 + # In php-7.x, the FPM pool configuration files have been split off
264 + # of the main config. By default the pool config files go in
265 + # e.g. /etc/php-fpm.d, which isn't slotted. So here we move the
266 + # include directory to a subdirectory "fpm.d" of $PHP_INI_DIR. Later
267 + # we'll install the pool configuration file "www.conf" there.
268 + php_set_ini_dir fpm
269 + sed -i "s~^include=.*$~include=${PHP_INI_DIR}/fpm.d/*.conf~" \
270 + sapi/fpm/php-fpm.conf.in \
271 + || die 'failed to move the include directory in php-fpm.conf'
272 +}
273 +
274 +src_configure() {
275 + addpredict /usr/share/snmp/mibs/.index
276 + addpredict /var/lib/net-snmp/mib_indexes
277 +
278 + PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
279 +
280 + # The php-fpm config file wants localstatedir to be ${EPREFIX}/var
281 + # and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002.
282 + local our_conf=(
283 + --prefix="${PHP_DESTDIR}"
284 + --mandir="${PHP_DESTDIR}/man"
285 + --infodir="${PHP_DESTDIR}/info"
286 + --libdir="${PHP_DESTDIR}/lib"
287 + --with-libdir="$(get_libdir)"
288 + --localstatedir="${EPREFIX}/var"
289 + --without-pear
290 + $(use_enable threads maintainer-zts)
291 + )
292 +
293 + our_conf+=(
294 + $(use_with acl fpm-acl)
295 + $(use_enable bcmath bcmath)
296 + $(use_with bzip2 bz2 "${EPREFIX}/usr")
297 + $(use_enable calendar calendar)
298 + $(use_enable coverage gcov)
299 + $(use_enable ctype ctype)
300 + $(use_with curl curl "${EPREFIX}/usr")
301 + $(use_enable xml dom)
302 + $(use_with enchant enchant "${EPREFIX}/usr")
303 + $(use_enable exif exif)
304 + $(use_enable fileinfo fileinfo)
305 + $(use_enable filter filter)
306 + $(use_enable ftp ftp)
307 + $(use_with nls gettext "${EPREFIX}/usr")
308 + $(use_with gmp gmp "${EPREFIX}/usr")
309 + $(use_enable hash hash)
310 + $(use_with mhash mhash "${EPREFIX}/usr")
311 + $(use_with iconv iconv \
312 + $(use elibc_glibc || use elibc_musl || echo "${EPREFIX}/usr"))
313 + $(use_enable intl intl)
314 + $(use_enable ipv6 ipv6)
315 + $(use_enable json json)
316 + $(use_with kerberos kerberos "${EPREFIX}/usr")
317 + $(use_enable xml libxml)
318 + $(use_with xml libxml-dir "${EPREFIX}/usr")
319 + $(use_enable unicode mbstring)
320 + $(use_with crypt mcrypt "${EPREFIX}/usr")
321 + $(use_with unicode onig "${EPREFIX}/usr")
322 + $(use_with ssl openssl "${EPREFIX}/usr")
323 + $(use_with ssl openssl-dir "${EPREFIX}/usr")
324 + $(use_enable pcntl pcntl)
325 + $(use_enable phar phar)
326 + $(use_enable pdo pdo)
327 + $(use_enable opcache opcache)
328 + $(use_with postgres pgsql "${EPREFIX}/usr")
329 + $(use_enable posix posix)
330 + $(use_with spell pspell "${EPREFIX}/usr")
331 + $(use_with recode recode "${EPREFIX}/usr")
332 + $(use_enable simplexml simplexml)
333 + $(use_enable sharedmem shmop)
334 + $(use_with snmp snmp "${EPREFIX}/usr")
335 + $(use_enable soap soap)
336 + $(use_enable sockets sockets)
337 + $(use_with sqlite sqlite3 "${EPREFIX}/usr")
338 + $(use_enable sysvipc sysvmsg)
339 + $(use_enable sysvipc sysvsem)
340 + $(use_enable sysvipc sysvshm)
341 + $(use_with systemd fpm-systemd)
342 + $(use_with tidy tidy "${EPREFIX}/usr")
343 + $(use_enable tokenizer tokenizer)
344 + $(use_enable wddx wddx)
345 + $(use_enable xml xml)
346 + $(use_enable xmlreader xmlreader)
347 + $(use_enable xmlwriter xmlwriter)
348 + $(use_with xmlrpc xmlrpc)
349 + $(use_with xslt xsl "${EPREFIX}/usr")
350 + $(use_enable zip zip)
351 + $(use_with zlib zlib "${EPREFIX}/usr")
352 + $(use_enable debug debug)
353 + )
354 +
355 + # DBA support
356 + if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
357 + || use qdbm ; then
358 + our_conf+=( "--enable-dba${shared}" )
359 + fi
360 +
361 + # DBA drivers support
362 + our_conf+=(
363 + $(use_with cdb cdb)
364 + $(use_with berkdb db4 "${EPREFIX}/usr")
365 + $(use_enable flatfile flatfile)
366 + $(use_with gdbm gdbm "${EPREFIX}/usr")
367 + $(use_enable inifile inifile)
368 + $(use_with qdbm qdbm "${EPREFIX}/usr")
369 + )
370 +
371 + # Support for the GD graphics library
372 + our_conf+=(
373 + $(use_with truetype freetype-dir "${EPREFIX}/usr")
374 + $(use_enable cjk gd-jis-conv)
375 + $(use_with gd jpeg-dir "${EPREFIX}/usr")
376 + $(use_with gd png-dir "${EPREFIX}/usr")
377 + $(use_with xpm xpm-dir "${EPREFIX}/usr")
378 + )
379 + if use webp; then
380 + our_conf+=( --with-webp-dir="${EPREFIX}/usr" )
381 + fi
382 + # enable gd last, so configure can pick up the previous settings
383 + our_conf+=( $(use_with gd gd) )
384 +
385 + # IMAP support
386 + if use imap ; then
387 + our_conf+=(
388 + $(use_with imap imap "${EPREFIX}/usr")
389 + $(use_with ssl imap-ssl "${EPREFIX}/usr")
390 + )
391 + fi
392 +
393 + # Interbase/firebird support
394 + our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") )
395 +
396 + # LDAP support
397 + if use ldap ; then
398 + our_conf+=(
399 + $(use_with ldap ldap "${EPREFIX}/usr")
400 + $(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr")
401 + )
402 + fi
403 +
404 + # MySQL support
405 + local mysqllib="mysqlnd"
406 + local mysqlilib="mysqlnd"
407 +
408 + our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
409 +
410 + local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock"
411 + if use mysql || use mysqli ; then
412 + our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") )
413 + fi
414 +
415 + # ODBC support
416 + our_conf+=(
417 + $(use_with odbc unixODBC "${EPREFIX}/usr")
418 + $(use_with iodbc iodbc "${EPREFIX}/usr")
419 + )
420 +
421 + # Oracle support
422 + our_conf+=( $(use_with oci8-instant-client oci8) )
423 +
424 + # PDO support
425 + if use pdo ; then
426 + our_conf+=(
427 + $(use_with mssql pdo-dblib "${EPREFIX}/usr")
428 + $(use_with mysql pdo-mysql "${mysqllib}")
429 + $(use_with postgres pdo-pgsql)
430 + $(use_with sqlite pdo-sqlite "${EPREFIX}/usr")
431 + $(use_with firebird pdo-firebird "${EPREFIX}/usr")
432 + $(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr")
433 + $(use_with oci8-instant-client pdo-oci)
434 + )
435 + fi
436 +
437 + # readline/libedit support
438 + our_conf+=(
439 + $(use_with readline readline "${EPREFIX}/usr")
440 + $(use_with libedit libedit "${EPREFIX}/usr")
441 + )
442 +
443 + # Session support
444 + if use session ; then
445 + our_conf+=( $(use_with sharedmem mm "${EPREFIX}/usr") )
446 + else
447 + our_conf+=( $(use_enable session session) )
448 + fi
449 +
450 + # Use pic for shared modules such as apache2's mod_php
451 + our_conf+=( --with-pic )
452 +
453 + # we use the system copy of pcre
454 + # --with-pcre-regex affects ext/pcre
455 + # --with-pcre-dir affects ext/filter and ext/zip
456 + our_conf+=(
457 + --with-pcre-regex="${EPREFIX}/usr"
458 + --with-pcre-dir="${EPREFIX}/usr"
459 + )
460 +
461 + # Catch CFLAGS problems
462 + # Fixes bug #14067.
463 + # Changed order to run it in reverse for bug #32022 and #12021.
464 + replace-cpu-flags "k6*" "i586"
465 +
466 + # Cache the ./configure test results between SAPIs.
467 + our_conf+=( --cache-file="${T}/config.cache" )
468 +
469 + # Support user-passed configuration parameters
470 + our_conf+=( ${EXTRA_ECONF:-} )
471 +
472 + # Support the Apache2 extras, they must be set globally for all
473 + # SAPIs to work correctly, especially for external PHP extensions
474 +
475 + mkdir -p "${WORKDIR}/sapis-build" || die
476 + for one_sapi in $SAPIS ; do
477 + use "${one_sapi}" || continue
478 + php_set_ini_dir "${one_sapi}"
479 +
480 + # The BUILD_DIR variable is used to determine where to output
481 + # the files that autotools creates. This was all originally
482 + # based on the autotools-utils eclass.
483 + BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}"
484 + cp -a "${S}" "${BUILD_DIR}" || die
485 + cd "${BUILD_DIR}" || die
486 +
487 + local sapi_conf=(
488 + --with-config-file-path="${PHP_INI_DIR}"
489 + --with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}"
490 + )
491 +
492 + for sapi in $SAPIS ; do
493 + case "$sapi" in
494 + cli|cgi|embed|fpm|phpdbg)
495 + if [[ "${one_sapi}" == "${sapi}" ]] ; then
496 + sapi_conf+=( "--enable-${sapi}" )
497 + else
498 + sapi_conf+=( "--disable-${sapi}" )
499 + fi
500 + ;;
501 +
502 + apache2)
503 + if [[ "${one_sapi}" == "${sapi}" ]] ; then
504 + sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" )
505 + else
506 + sapi_conf+=( --without-apxs2 )
507 + fi
508 + ;;
509 + esac
510 + done
511 +
512 + # Construct the $myeconfargs array by concatenating $our_conf
513 + # (the common args) and $sapi_conf (the SAPI-specific args).
514 + local myeconfargs=( "${our_conf[@]}" )
515 + myeconfargs+=( "${sapi_conf[@]}" )
516 +
517 + pushd "${BUILD_DIR}" > /dev/null || die
518 + econf "${myeconfargs[@]}"
519 + popd > /dev/null || die
520 + done
521 +}
522 +
523 +src_compile() {
524 + # snmp seems to run during src_compile, too (bug #324739)
525 + addpredict /usr/share/snmp/mibs/.index
526 + addpredict /var/lib/net-snmp/mib_indexes
527 +
528 + for sapi in ${SAPIS} ; do
529 + if use "${sapi}"; then
530 + cd "${WORKDIR}/sapis-build/$sapi" || \
531 + die "Failed to change dir to ${WORKDIR}/sapis-build/$1"
532 + emake
533 + fi
534 + done
535 +}
536 +
537 +src_install() {
538 + # see bug #324739 for what happens when we don't have that
539 + addpredict /usr/share/snmp/mibs/.index
540 +
541 + # grab the first SAPI that got built and install common files from there
542 + local first_sapi=""
543 + for sapi in $SAPIS ; do
544 + if use $sapi ; then
545 + first_sapi=$sapi
546 + break
547 + fi
548 + done
549 +
550 + # Makefile forgets to create this before trying to write to it...
551 + dodir "${PHP_DESTDIR#${EPREFIX}}/bin"
552 +
553 + # Install php environment (without any sapis)
554 + cd "${WORKDIR}/sapis-build/$first_sapi" || die
555 + emake INSTALL_ROOT="${D}" \
556 + install-build install-headers install-programs
557 +
558 + local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)"
559 +
560 + # Create the directory where we'll put version-specific php scripts
561 + keepdir "/usr/share/php${PHP_MV}"
562 +
563 + local sapi="", file=""
564 + local sapi_list=""
565 +
566 + for sapi in ${SAPIS}; do
567 + if use "${sapi}" ; then
568 + einfo "Installing SAPI: ${sapi}"
569 + cd "${WORKDIR}/sapis-build/${sapi}" || die
570 +
571 + if [[ "${sapi}" == "apache2" ]] ; then
572 + # We're specifically not using emake install-sapi as libtool
573 + # may cause unnecessary relink failures (see bug #351266)
574 + insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/"
575 + newins ".libs/libphp${PHP_MV}$(get_libname)" \
576 + "libphp${PHP_MV}$(get_libname)"
577 + keepdir "/usr/$(get_libdir)/apache2/modules"
578 + else
579 + # needed each time, php_install_ini would reset it
580 + local dest="${PHP_DESTDIR#${EPREFIX}}"
581 + into "${dest}"
582 + case "$sapi" in
583 + cli)
584 + source="sapi/cli/php"
585 + ;;
586 + cgi)
587 + source="sapi/cgi/php-cgi"
588 + ;;
589 + fpm)
590 + source="sapi/fpm/php-fpm"
591 + ;;
592 + embed)
593 + source="libs/libphp${PHP_MV}$(get_libname)"
594 + ;;
595 + phpdbg)
596 + source="sapi/phpdbg/phpdbg"
597 + ;;
598 + *)
599 + die "unhandled sapi in src_install"
600 + ;;
601 + esac
602 +
603 + if [[ "${source}" == *"$(get_libname)" ]]; then
604 + dolib.so "${source}"
605 + else
606 + dobin "${source}"
607 + local name="$(basename ${source})"
608 + dosym "${dest}/bin/${name}" "/usr/bin/${name}${SLOT}"
609 + fi
610 + fi
611 +
612 + php_install_ini "${sapi}"
613 +
614 + # construct correct SAPI string for php-config
615 + # thanks to ferringb for the bash voodoo
616 + if [[ "${sapi}" == "apache2" ]]; then
617 + sapi_list="${sapi_list:+${sapi_list} }apache2handler"
618 + else
619 + sapi_list="${sapi_list:+${sapi_list} }${sapi}"
620 + fi
621 + fi
622 + done
623 +
624 + # Installing opcache module
625 + if use opcache ; then
626 + into "${PHP_DESTDIR#${EPREFIX}}"
627 + dolib.so "modules/opcache$(get_libname)"
628 + fi
629 +
630 + # Install env.d files
631 + newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}"
632 + sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
633 + sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
634 +
635 + # set php-config variable correctly (bug #278439)
636 + sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \
637 + "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die
638 +
639 + if use fpm ; then
640 + if use systemd; then
641 + systemd_newunit "${FILESDIR}/php-fpm_at.service" \
642 + "php-fpm@${SLOT}.service"
643 + else
644 + systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \
645 + "php-fpm@${SLOT}.service"
646 + fi
647 + fi
648 +}
649 +
650 +src_test() {
651 + echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
652 + PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
653 + if [[ ! -x "${PHP_BIN}" ]] ; then
654 + ewarn "Test phase requires USE=cli, skipping"
655 + return
656 + else
657 + export TEST_PHP_EXECUTABLE="${PHP_BIN}"
658 + fi
659 +
660 + if [[ -x "${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" ]] ; then
661 + export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi"
662 + fi
663 +
664 + if [[ -x "${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" ]] ; then
665 + export TEST_PHPDBG_EXECUTABLE="${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg"
666 + fi
667 +
668 + REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \
669 + "session.save_path=${T}" \
670 + "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \
671 + "session.save_path=${T}"
672 +
673 + for name in ${EXPECTED_TEST_FAILURES}; do
674 + mv "${name}.out" "${name}.out.orig" 2>/dev/null || die
675 + done
676 +
677 + local failed="$(find -name '*.out')"
678 + if [[ ${failed} != "" ]] ; then
679 + ewarn "The following test cases failed unexpectedly:"
680 + for name in ${failed}; do
681 + ewarn " ${name/.out/}"
682 + done
683 + else
684 + einfo "No unexpected test failures, all fine"
685 + fi
686 +
687 + if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
688 + local passed=""
689 + for name in ${EXPECTED_TEST_FAILURES}; do
690 + [[ -f "${name}.diff" ]] && continue
691 + passed="${passed} ${name}"
692 + done
693 + if [[ ${passed} != "" ]] ; then
694 + einfo "The following test cases passed unexpectedly:"
695 + for name in ${passed}; do
696 + ewarn " ${passed}"
697 + done
698 + else
699 + einfo "None of the known-to-fail tests passed, all fine"
700 + fi
701 + fi
702 +}
703 +
704 +pkg_postinst() {
705 + # Output some general info to the user
706 + if use apache2 ; then
707 + elog
708 + elog "To enable PHP in apache, you will need to add \"-D PHP\" to"
709 + elog "your apache2 command. OpenRC users can append that string to"
710 + elog "APACHE2_OPTS in /etc/conf.d/apache2."
711 + elog
712 + elog "The apache module configuration file 70_mod_php.conf is"
713 + elog "provided (and maintained) by eselect-php."
714 + elog
715 + fi
716 +
717 + # Create the symlinks for php
718 + for m in ${SAPIS}; do
719 + [[ ${m} == 'embed' ]] && continue;
720 + if use $m ; then
721 + local ci=$(eselect php show $m)
722 + if [[ -z $ci ]]; then
723 + eselect php set $m php${SLOT} || die
724 + einfo "Switched ${m} to use php:${SLOT}"
725 + einfo
726 + elif [[ $ci != "php${SLOT}" ]] ; then
727 + elog "To switch $m to use php:${SLOT}, run"
728 + elog " eselect php set $m php${SLOT}"
729 + elog
730 + fi
731 + fi
732 + done
733 +
734 + # Remove dead symlinks for SAPIs that were just disabled. For
735 + # example, if the user has the cgi SAPI enabled, then he has an
736 + # eselect-php symlink for it. If he later reinstalls PHP with
737 + # USE="-cgi", that symlink will break. This call to eselect is
738 + # supposed to remove that dead link per bug 572436.
739 + eselect php cleanup || die
740 +
741 + if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then
742 + elog "To build extensions for this version of PHP, you will need to"
743 + elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable."
744 + elog
745 + fi
746 +
747 + # Warn about the removal of PHP_INI_VERSION if the user has it set.
748 + if [[ -n "${PHP_INI_VERSION}" ]]; then
749 + ewarn 'The PHP_INI_VERSION variable has been phased out. You may'
750 + ewarn 'remove it from your configuration at your convenience. See'
751 + ewarn
752 + ewarn ' https://bugs.gentoo.org/611214'
753 + ewarn
754 + ewarn 'for more information.'
755 + fi
756 +
757 + elog "For details on how version slotting works, please see"
758 + elog "the wiki:"
759 + elog
760 + elog " https://wiki.gentoo.org/wiki/PHP"
761 + elog
762 +}
763 +
764 +pkg_postrm() {
765 + # This serves two purposes. First, if we have just removed the last
766 + # installed version of PHP, then this will remove any dead symlinks
767 + # belonging to eselect-php. Second, if a user upgrades slots from
768 + # (say) 5.6 to 7.0 and depcleans the old slot, then this will update
769 + # his existing symlinks to point to the new 7.0 installation. The
770 + # latter is bug 432962.
771 + #
772 + # Note: the eselect-php package may not be installed at this point,
773 + # so we can't die() if this command fails.
774 + eselect php cleanup
775 +}