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