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