Gentoo Archives: gentoo-commits

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