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