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