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