Gentoo Archives: gentoo-commits

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