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: Thu, 29 Mar 2018 19:07:58
Message-Id: 1522350464.e0f142a3f560dfd7a5047ff3810e4faa39a03e48.grknight@gentoo
1 commit: e0f142a3f560dfd7a5047ff3810e4faa39a03e48
2 Author: Brian Evans <grknight <AT> gentoo <DOT> org>
3 AuthorDate: Thu Mar 29 19:01:29 2018 +0000
4 Commit: Brian Evans <grknight <AT> gentoo <DOT> org>
5 CommitDate: Thu Mar 29 19:07:44 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e0f142a3
7
8 dev-lang/php: Drop old 7.2.x
9
10 Package-Manager: Portage-2.3.26, Repoman-2.3.7
11
12 dev-lang/php/Manifest | 2 -
13 dev-lang/php/php-7.2.2.ebuild | 733 -----------------------------------------
14 dev-lang/php/php-7.2.3.ebuild | 737 ------------------------------------------
15 3 files changed, 1472 deletions(-)
16
17 diff --git a/dev-lang/php/Manifest b/dev-lang/php/Manifest
18 index 2c0796a88f1..cdf78e19805 100644
19 --- a/dev-lang/php/Manifest
20 +++ b/dev-lang/php/Manifest
21 @@ -5,6 +5,4 @@ DIST php-7.0.28.tar.xz 11917836 BLAKE2B 8110b0486b0556abf2249d7cbdbd245249f32e23
22 DIST php-7.1.13.tar.xz 12194780 BLAKE2B 0bac1cb3ec46cd4206d71b0d8ec3058fff455bc7e3febb33dcb8e14d5a8b16918d3e4679e0691b8ba29b95ab90be2a3dc3a73bade45c1ca4eaf692d6d3c2db3d SHA512 f5357ffcbcaab1ba03d70edc0f1329b530f9f9c7779ac57d6fd2bd0bb730162f8d107025e5ff66592077d1bf504ee6816ec0379f50ceb1fac36cea90b0fc4fa2
23 DIST php-7.1.14.tar.xz 12198612 BLAKE2B 6ceb307423f07dafb75992b021d94259452fa4f08a9122c6d5e0da95dca1bcd88c7795effabefa7bddd06b398eca8093881a5ddb6d66fa91fc63a56c3a0fa4cc SHA512 7604e490aef95ae9c87bc4230491328c4cbcce42653234906885f9aa323f867ea941a7dbe80424aa4c4872392559ff5fa2acf1605c402055b6e428e6fe79ece6
24 DIST php-7.1.15.tar.xz 12201380 BLAKE2B 4387382daf3883962eb0e47d86c983a65c293e89aa71239977bb1c6fdaa99b3a76eacb71a30f134fcc47f4ca6fea95687f3e405c1ecc7a737c8cf40489e8e7a3 SHA512 2b23795ffcb9d741adafe8a1e01e6988bb86ce7c6380bdbe822f8f6485e217ed2e95a27daf5ba11f0bf10317f1e1f4e37068e40d0bf322de5625d38b430d37c2
25 -DIST php-7.2.2.tar.xz 12022280 BLAKE2B 63daabcc37dc530524c9df58526690837b61ea71e9616bde22b3bb367b76504fa87f6cb976f120e57d6ccfe7ec6b3a1608d951ab3d68213fc401a6e1131e0e84 SHA512 36a3565161fc481307ac3e76c8d2ccc457c265bf510f085be1907835c7da7c747a0876502192d77bd664f94a584a1b149deee2600c650481fbedbf02d72d5fd0
26 -DIST php-7.2.3.tar.xz 12098236 BLAKE2B eb5f6618f31aef85db5f9010f0d000880b6f6e83314ba99dfad90c5d205cd2ac74ad4712681aae49b7315fab88a70c3bc93fdc7790f114b1ecab8cdf1c97ee4f SHA512 843d4ae46182eaec58beb583a321c55a6baddb0dbf1b77d7cf31953d816fc74813937576a87d0a18d388d256c5ec3f1c80065ec636e2f70d362384112b8c6c72
27 DIST php-7.2.4.tar.xz 12031892 BLAKE2B f76b3ccbfed4d309639ac5e35a12aa70a194f8cecde98634d7bff9123eb45ff3a4f0b3297149a44357bbc3287a9a3c1393d86b12bd53f38ff844db9498ee3452 SHA512 d1d0720f0d4bb28f7ce0ec7c859b14c1e74e9d0e7c73de6988d5ce737d7ccb7308c0a7a2651ee012c630be2cd53e6531505df0a03f0efbb6359176b446982244
28
29 diff --git a/dev-lang/php/php-7.2.2.ebuild b/dev-lang/php/php-7.2.2.ebuild
30 deleted file mode 100644
31 index 4db4d143dae..00000000000
32 --- a/dev-lang/php/php-7.2.2.ebuild
33 +++ /dev/null
34 @@ -1,733 +0,0 @@
35 -# Copyright 1999-2018 Gentoo Foundation
36 -# Distributed under the terms of the GNU General Public License v2
37 -
38 -EAPI=6
39 -
40 -inherit flag-o-matic versionator systemd
41 -
42 -DESCRIPTION="The PHP language runtime engine"
43 -HOMEPAGE="https://secure.php.net/"
44 -SRC_URI="https://secure.php.net/distributions/${P}.tar.xz"
45 -
46 -LICENSE="PHP-3.01
47 - BSD
48 - Zend-2.0
49 - bcmath? ( LGPL-2.1+ )
50 - fpm? ( BSD-2 )
51 - gd? ( gd )
52 - unicode? ( BSD-2 LGPL-2.1 )"
53 -
54 -SLOT="$(get_version_component_range 1-2)"
55 -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
56 -
57 -# We can build the following SAPIs in the given order
58 -SAPIS="embed cli cgi fpm apache2 phpdbg"
59 -
60 -# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
61 -IUSE="${IUSE}
62 - ${SAPIS/cli/+cli}
63 - threads"
64 -
65 -IUSE="${IUSE} acl argon2 bcmath berkdb bzip2 calendar cdb cjk
66 - coverage +ctype curl debug
67 - enchant exif +fileinfo +filter firebird
68 - flatfile ftp gd gdbm gmp +hash +iconv imap inifile
69 - intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl lmdb
70 - mhash mssql mysql mysqli nls
71 - oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
72 - readline recode selinux +session session-mm sharedmem
73 - +simplexml snmp soap sockets sodium spell sqlite ssl
74 - sysvipc systemd test tidy +tokenizer tokyocabinet truetype unicode wddx webp
75 - +xml xmlreader xmlwriter xmlrpc xpm xslt zip zip-encryption zlib"
76 -
77 -# The supported (that is, autodetected) versions of BDB are listed in
78 -# the ./configure script. Other versions *work*, but we need to stick to
79 -# the ones that can be detected to avoid a repeat of bug #564824.
80 -COMMON_DEPEND="
81 - >=app-eselect/eselect-php-0.9.1[apache2?,fpm?]
82 - >=dev-libs/libpcre-8.32[unicode]
83 - acl? ( sys-apps/acl )
84 - apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=]
85 - <www-servers/apache-2.4[threads=] ) )
86 - argon2? ( app-crypt/argon2:= )
87 - berkdb? ( || ( sys-libs/db:5.3
88 - sys-libs/db:5.1
89 - sys-libs/db:4.8
90 - sys-libs/db:4.7
91 - sys-libs/db:4.6
92 - sys-libs/db:4.5 ) )
93 - bzip2? ( app-arch/bzip2:0= )
94 - cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
95 - coverage? ( dev-util/lcov )
96 - curl? ( >=net-misc/curl-7.10.5 )
97 - enchant? ( app-text/enchant )
98 - firebird? ( dev-db/firebird )
99 - gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib )
100 - gdbm? ( >=sys-libs/gdbm-1.8.0:0= )
101 - gmp? ( dev-libs/gmp:0= )
102 - iconv? ( virtual/libiconv )
103 - imap? ( virtual/imap-c-client[kerberos=,ssl=] )
104 - intl? ( dev-libs/icu:= )
105 - iodbc? ( dev-db/libiodbc )
106 - kerberos? ( virtual/krb5 )
107 - ldap? ( >=net-nds/openldap-1.2.11 )
108 - ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 )
109 - libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) )
110 - lmdb? ( dev-db/lmdb:= )
111 - mssql? ( dev-db/freetds[mssql] )
112 - nls? ( sys-devel/gettext )
113 - oci8-instant-client? ( dev-db/oracle-instantclient-basic )
114 - odbc? ( >=dev-db/unixODBC-1.8.13 )
115 - postgres? ( dev-db/postgresql:* )
116 - qdbm? ( dev-db/qdbm )
117 - readline? ( sys-libs/readline:0= )
118 - recode? ( app-text/recode )
119 - session-mm? ( dev-libs/mm )
120 - simplexml? ( >=dev-libs/libxml2-2.6.8 )
121 - snmp? ( >=net-analyzer/net-snmp-5.2 )
122 - soap? ( >=dev-libs/libxml2-2.6.8 )
123 - sodium? ( dev-libs/libsodium:= )
124 - spell? ( >=app-text/aspell-0.50 )
125 - sqlite? ( >=dev-db/sqlite-3.7.6.3 )
126 - ssl? (
127 - !libressl? ( dev-libs/openssl:0= )
128 - libressl? ( dev-libs/libressl:0= )
129 - )
130 - tidy? ( || ( app-text/tidy-html5 app-text/htmltidy ) )
131 - tokyocabinet? ( dev-db/tokyocabinet )
132 - truetype? ( =media-libs/freetype-2* )
133 - unicode? ( dev-libs/oniguruma:= )
134 - wddx? ( >=dev-libs/libxml2-2.6.8 )
135 - webp? ( media-libs/libwebp:0= )
136 - xml? ( >=dev-libs/libxml2-2.6.8 )
137 - xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
138 - xmlreader? ( >=dev-libs/libxml2-2.6.8 )
139 - xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
140 - xpm? ( x11-libs/libXpm )
141 - xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
142 - zip? ( sys-libs/zlib:0= )
143 - zip-encryption? ( >=dev-libs/libzip-1.2.0:= )
144 - zlib? ( sys-libs/zlib:0= )
145 -"
146 -
147 -RDEPEND="${COMMON_DEPEND}
148 - virtual/mta
149 - fpm? (
150 - selinux? ( sec-policy/selinux-phpfpm )
151 - systemd? ( sys-apps/systemd ) )"
152 -
153 -# Bison isn't actually needed when building from a release tarball
154 -# However, the configure script will warn if it's absent or if you
155 -# have an incompatible version installed. See bug 593278.
156 -DEPEND="${COMMON_DEPEND}
157 - app-arch/xz-utils
158 - >=sys-devel/bison-3.0.1"
159 -
160 -# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
161 -REQUIRED_USE="
162 - || ( cli cgi fpm apache2 embed phpdbg )
163 - cli? ( ^^ ( readline libedit ) )
164 - truetype? ( gd )
165 - webp? ( gd )
166 - cjk? ( gd )
167 - exif? ( gd )
168 - xpm? ( gd )
169 - gd? ( zlib )
170 - simplexml? ( xml )
171 - soap? ( xml )
172 - wddx? ( xml )
173 - xmlrpc? ( || ( xml iconv ) )
174 - xmlreader? ( xml )
175 - xslt? ( xml )
176 - ldap-sasl? ( ldap )
177 - mhash? ( hash )
178 - phar? ( hash )
179 - qdbm? ( !gdbm )
180 - readline? ( !libedit )
181 - recode? ( !imap !mysqli !mysql )
182 - session-mm? ( session !threads )
183 - mysql? ( || ( mysqli pdo ) )
184 - zip-encryption? ( zip )
185 -"
186 -
187 -PHP_MV="$(get_major_version)"
188 -
189 -php_install_ini() {
190 - local phpsapi="${1}"
191 -
192 - # work out where we are installing the ini file
193 - php_set_ini_dir "${phpsapi}"
194 -
195 - # Always install the production INI file, bug 611214.
196 - local phpinisrc="php.ini-production-${phpsapi}"
197 - cp php.ini-production "${phpinisrc}" || die
198 -
199 - # default to /tmp for save_path, bug #282768
200 - sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die
201 -
202 - # Set the extension dir
203 - sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \
204 - -i "${phpinisrc}" || die
205 -
206 - # Set the include path to point to where we want to find PEAR packages
207 - sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die
208 -
209 - dodir "${PHP_INI_DIR#${EPREFIX}}"
210 - insinto "${PHP_INI_DIR#${EPREFIX}}"
211 - newins "${phpinisrc}" php.ini
212 -
213 - elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}"
214 - elog
215 -
216 - dodir "${PHP_EXT_INI_DIR#${EPREFIX}}"
217 - dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}"
218 -
219 - if use opcache; then
220 - elog "Adding opcache to $PHP_EXT_INI_DIR"
221 - echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \
222 - "${D}/${PHP_EXT_INI_DIR}"/opcache.ini
223 - dosym "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" \
224 - "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini"
225 - fi
226 -
227 - # SAPI-specific handling
228 - if [[ "${sapi}" == "fpm" ]] ; then
229 - einfo "Installing FPM config files php-fpm.conf and www.conf"
230 - insinto "${PHP_INI_DIR#${EPREFIX}}"
231 - doins sapi/fpm/php-fpm.conf
232 - insinto "${PHP_INI_DIR#${EPREFIX}}/fpm.d"
233 - doins sapi/fpm/www.conf
234 - fi
235 -
236 - dodoc php.ini-{development,production}
237 -}
238 -
239 -php_set_ini_dir() {
240 - PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}"
241 - PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
242 - PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
243 -}
244 -
245 -src_prepare() {
246 - default
247 -
248 - # In php-7.x, the FPM pool configuration files have been split off
249 - # of the main config. By default the pool config files go in
250 - # e.g. /etc/php-fpm.d, which isn't slotted. So here we move the
251 - # include directory to a subdirectory "fpm.d" of $PHP_INI_DIR. Later
252 - # we'll install the pool configuration file "www.conf" there.
253 - php_set_ini_dir fpm
254 - sed -i "s~^include=.*$~include=${PHP_INI_DIR}/fpm.d/*.conf~" \
255 - sapi/fpm/php-fpm.conf.in \
256 - || die 'failed to move the include directory in php-fpm.conf'
257 -}
258 -
259 -src_configure() {
260 - addpredict /usr/share/snmp/mibs/.index
261 - addpredict /var/lib/net-snmp/mib_indexes
262 -
263 - PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
264 -
265 - # The php-fpm config file wants localstatedir to be ${EPREFIX}/var
266 - # and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002.
267 - local our_conf=(
268 - --prefix="${PHP_DESTDIR}"
269 - --mandir="${PHP_DESTDIR}/man"
270 - --infodir="${PHP_DESTDIR}/info"
271 - --libdir="${PHP_DESTDIR}/lib"
272 - --with-libdir="$(get_libdir)"
273 - --localstatedir="${EPREFIX}/var"
274 - --without-pear
275 - $(use_enable threads maintainer-zts)
276 - )
277 -
278 - our_conf+=(
279 - $(use_with acl fpm-acl)
280 - $(use_with argon2 password-argon2 "${EPREFIX}/usr")
281 - $(use_enable bcmath bcmath)
282 - $(use_with bzip2 bz2 "${EPREFIX}/usr")
283 - $(use_enable calendar calendar)
284 - $(use_enable coverage gcov)
285 - $(use_enable ctype ctype)
286 - $(use_with curl curl "${EPREFIX}/usr")
287 - $(use_enable xml dom)
288 - $(use_with enchant enchant "${EPREFIX}/usr")
289 - $(use_enable exif exif)
290 - $(use_enable fileinfo fileinfo)
291 - $(use_enable filter filter)
292 - $(use_enable ftp ftp)
293 - $(use_with nls gettext "${EPREFIX}/usr")
294 - $(use_with gmp gmp "${EPREFIX}/usr")
295 - $(use_enable hash hash)
296 - $(use_with mhash mhash "${EPREFIX}/usr")
297 - $(use_with iconv iconv \
298 - $(use elibc_glibc || use elibc_musl || use elibc_FreeBSD || echo "${EPREFIX}/usr"))
299 - $(use_enable intl intl)
300 - $(use_enable ipv6 ipv6)
301 - $(use_enable json json)
302 - $(use_with kerberos kerberos "${EPREFIX}/usr")
303 - $(use_enable xml libxml)
304 - $(use_with xml libxml-dir "${EPREFIX}/usr")
305 - $(use_enable unicode mbstring)
306 - $(use_with unicode onig "${EPREFIX}/usr")
307 - $(use_with ssl openssl "${EPREFIX}/usr")
308 - $(use_with ssl openssl-dir "${EPREFIX}/usr")
309 - $(use_enable pcntl pcntl)
310 - $(use_enable phar phar)
311 - $(use_enable pdo pdo)
312 - $(use_enable opcache opcache)
313 - $(use_with postgres pgsql "${EPREFIX}/usr")
314 - $(use_enable posix posix)
315 - $(use_with spell pspell "${EPREFIX}/usr")
316 - $(use_with recode recode "${EPREFIX}/usr")
317 - $(use_enable simplexml simplexml)
318 - $(use_enable sharedmem shmop)
319 - $(use_with snmp snmp "${EPREFIX}/usr")
320 - $(use_enable soap soap)
321 - $(use_enable sockets sockets)
322 - $(use_with sodium sodium "${EPREFIX}/usr")
323 - $(use_with sqlite sqlite3 "${EPREFIX}/usr")
324 - $(use_enable sysvipc sysvmsg)
325 - $(use_enable sysvipc sysvsem)
326 - $(use_enable sysvipc sysvshm)
327 - $(use_with systemd fpm-systemd)
328 - $(use_with tidy tidy "${EPREFIX}/usr")
329 - $(use_enable tokenizer tokenizer)
330 - $(use_enable wddx wddx)
331 - $(use_enable xml xml)
332 - $(use_enable xmlreader xmlreader)
333 - $(use_enable xmlwriter xmlwriter)
334 - $(use_with xmlrpc xmlrpc)
335 - $(use_with xslt xsl "${EPREFIX}/usr")
336 - $(use_enable zip zip)
337 - $(use_with zip-encryption libzip "${EPREFIX}/usr")
338 - $(use_with zlib zlib "${EPREFIX}/usr")
339 - $(use_enable debug debug)
340 - )
341 -
342 - # DBA support
343 - if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
344 - || use qdbm || use lmdb || use tokyocabinet ; then
345 - our_conf+=( "--enable-dba${shared}" )
346 - fi
347 -
348 - # DBA drivers support
349 - our_conf+=(
350 - $(use_with cdb cdb)
351 - $(use_with berkdb db4 "${EPREFIX}/usr")
352 - $(use_enable flatfile flatfile)
353 - $(use_with gdbm gdbm "${EPREFIX}/usr")
354 - $(use_enable inifile inifile)
355 - $(use_with qdbm qdbm "${EPREFIX}/usr")
356 - $(use_with lmdb lmdb "${EPREFIX}/usr")
357 - )
358 -
359 - # Support for the GD graphics library
360 - our_conf+=(
361 - $(use_with truetype freetype-dir "${EPREFIX}/usr")
362 - $(use_enable cjk gd-jis-conv)
363 - $(use_with gd jpeg-dir "${EPREFIX}/usr")
364 - $(use_with gd png-dir "${EPREFIX}/usr")
365 - $(use_with xpm xpm-dir "${EPREFIX}/usr")
366 - )
367 - if use webp; then
368 - our_conf+=( --with-webp-dir="${EPREFIX}/usr" )
369 - fi
370 - # enable gd last, so configure can pick up the previous settings
371 - our_conf+=( $(use_with gd gd) )
372 -
373 - # IMAP support
374 - if use imap ; then
375 - our_conf+=(
376 - $(use_with imap imap "${EPREFIX}/usr")
377 - $(use_with ssl imap-ssl "${EPREFIX}/usr")
378 - )
379 - fi
380 -
381 - # Interbase/firebird support
382 - our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") )
383 -
384 - # LDAP support
385 - if use ldap ; then
386 - our_conf+=(
387 - $(use_with ldap ldap "${EPREFIX}/usr")
388 - $(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr")
389 - )
390 - fi
391 -
392 - # MySQL support
393 - local mysqllib="mysqlnd"
394 - local mysqlilib="mysqlnd"
395 -
396 - our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
397 -
398 - local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock"
399 - if use mysql || use mysqli ; then
400 - our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") )
401 - fi
402 -
403 - # ODBC support
404 - our_conf+=(
405 - $(use_with odbc unixODBC "${EPREFIX}/usr")
406 - $(use_with iodbc iodbc "${EPREFIX}/usr")
407 - )
408 -
409 - # Oracle support
410 - our_conf+=( $(use_with oci8-instant-client oci8) )
411 -
412 - # PDO support
413 - if use pdo ; then
414 - our_conf+=(
415 - $(use_with mssql pdo-dblib "${EPREFIX}/usr")
416 - $(use_with mysql pdo-mysql "${mysqllib}")
417 - $(use_with postgres pdo-pgsql)
418 - $(use_with sqlite pdo-sqlite "${EPREFIX}/usr")
419 - $(use_with firebird pdo-firebird "${EPREFIX}/usr")
420 - $(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr")
421 - $(use_with oci8-instant-client pdo-oci)
422 - )
423 - fi
424 -
425 - # readline/libedit support
426 - our_conf+=(
427 - $(use_with readline readline "${EPREFIX}/usr")
428 - $(use_with libedit libedit "${EPREFIX}/usr")
429 - )
430 -
431 - # Session support
432 - if use session ; then
433 - our_conf+=( $(use_with session-mm mm "${EPREFIX}/usr") )
434 - else
435 - our_conf+=( $(use_enable session session) )
436 - fi
437 -
438 - # Use pic for shared modules such as apache2's mod_php
439 - our_conf+=( --with-pic )
440 -
441 - # we use the system copy of pcre
442 - # --with-pcre-regex affects ext/pcre
443 - # --with-pcre-dir affects ext/filter and ext/zip
444 - # --with-pcre-valgrind cannot be enabled with system pcre
445 - # Many arches don't support pcre-jit
446 - our_conf+=(
447 - --with-pcre-regex="${EPREFIX}/usr"
448 - --with-pcre-dir="${EPREFIX}/usr"
449 - --without-pcre-valgrind
450 - --without-pcre-jit
451 - )
452 -
453 - # Catch CFLAGS problems
454 - # Fixes bug #14067.
455 - # Changed order to run it in reverse for bug #32022 and #12021.
456 - replace-cpu-flags "k6*" "i586"
457 -
458 - # Cache the ./configure test results between SAPIs.
459 - our_conf+=( --cache-file="${T}/config.cache" )
460 -
461 - # Support user-passed configuration parameters
462 - our_conf+=( ${EXTRA_ECONF:-} )
463 -
464 - # Support the Apache2 extras, they must be set globally for all
465 - # SAPIs to work correctly, especially for external PHP extensions
466 -
467 - mkdir -p "${WORKDIR}/sapis-build" || die
468 - for one_sapi in $SAPIS ; do
469 - use "${one_sapi}" || continue
470 - php_set_ini_dir "${one_sapi}"
471 -
472 - # The BUILD_DIR variable is used to determine where to output
473 - # the files that autotools creates. This was all originally
474 - # based on the autotools-utils eclass.
475 - BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}"
476 - cp -a "${S}" "${BUILD_DIR}" || die
477 - cd "${BUILD_DIR}" || die
478 -
479 - local sapi_conf=(
480 - --with-config-file-path="${PHP_INI_DIR}"
481 - --with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}"
482 - )
483 -
484 - for sapi in $SAPIS ; do
485 - case "$sapi" in
486 - cli|cgi|embed|fpm|phpdbg)
487 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
488 - sapi_conf+=( "--enable-${sapi}" )
489 - else
490 - sapi_conf+=( "--disable-${sapi}" )
491 - fi
492 - ;;
493 -
494 - apache2)
495 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
496 - sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" )
497 - else
498 - sapi_conf+=( --without-apxs2 )
499 - fi
500 - ;;
501 - esac
502 - done
503 -
504 - # Construct the $myeconfargs array by concatenating $our_conf
505 - # (the common args) and $sapi_conf (the SAPI-specific args).
506 - local myeconfargs=( "${our_conf[@]}" )
507 - myeconfargs+=( "${sapi_conf[@]}" )
508 -
509 - pushd "${BUILD_DIR}" > /dev/null || die
510 - econf "${myeconfargs[@]}"
511 - popd > /dev/null || die
512 - done
513 -}
514 -
515 -src_compile() {
516 - # snmp seems to run during src_compile, too (bug #324739)
517 - addpredict /usr/share/snmp/mibs/.index
518 - addpredict /var/lib/net-snmp/mib_indexes
519 -
520 - for sapi in ${SAPIS} ; do
521 - if use "${sapi}"; then
522 - cd "${WORKDIR}/sapis-build/$sapi" || \
523 - die "Failed to change dir to ${WORKDIR}/sapis-build/$1"
524 - emake
525 - fi
526 - done
527 -}
528 -
529 -src_install() {
530 - # see bug #324739 for what happens when we don't have that
531 - addpredict /usr/share/snmp/mibs/.index
532 -
533 - # grab the first SAPI that got built and install common files from there
534 - local first_sapi=""
535 - for sapi in $SAPIS ; do
536 - if use $sapi ; then
537 - first_sapi=$sapi
538 - break
539 - fi
540 - done
541 -
542 - # Makefile forgets to create this before trying to write to it...
543 - dodir "${PHP_DESTDIR#${EPREFIX}}/bin"
544 -
545 - # Install php environment (without any sapis)
546 - cd "${WORKDIR}/sapis-build/$first_sapi" || die
547 - emake INSTALL_ROOT="${D}" \
548 - install-build install-headers install-programs
549 -
550 - local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)"
551 -
552 - # Create the directory where we'll put version-specific php scripts
553 - keepdir "/usr/share/php${PHP_MV}"
554 -
555 - local sapi="", file=""
556 - local sapi_list=""
557 -
558 - for sapi in ${SAPIS}; do
559 - if use "${sapi}" ; then
560 - einfo "Installing SAPI: ${sapi}"
561 - cd "${WORKDIR}/sapis-build/${sapi}" || die
562 -
563 - if [[ "${sapi}" == "apache2" ]] ; then
564 - # We're specifically not using emake install-sapi as libtool
565 - # may cause unnecessary relink failures (see bug #351266)
566 - insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/"
567 - newins ".libs/libphp${PHP_MV}$(get_libname)" \
568 - "libphp${PHP_MV}$(get_libname)"
569 - keepdir "/usr/$(get_libdir)/apache2/modules"
570 - else
571 - # needed each time, php_install_ini would reset it
572 - local dest="${PHP_DESTDIR#${EPREFIX}}"
573 - into "${dest}"
574 - case "$sapi" in
575 - cli)
576 - source="sapi/cli/php"
577 - ;;
578 - cgi)
579 - source="sapi/cgi/php-cgi"
580 - ;;
581 - fpm)
582 - source="sapi/fpm/php-fpm"
583 - ;;
584 - embed)
585 - source="libs/libphp${PHP_MV}$(get_libname)"
586 - ;;
587 - phpdbg)
588 - source="sapi/phpdbg/phpdbg"
589 - ;;
590 - *)
591 - die "unhandled sapi in src_install"
592 - ;;
593 - esac
594 -
595 - if [[ "${source}" == *"$(get_libname)" ]]; then
596 - dolib.so "${source}"
597 - else
598 - dobin "${source}"
599 - local name="$(basename ${source})"
600 - dosym "${dest}/bin/${name}" "/usr/bin/${name}${SLOT}"
601 - fi
602 - fi
603 -
604 - php_install_ini "${sapi}"
605 -
606 - # construct correct SAPI string for php-config
607 - # thanks to ferringb for the bash voodoo
608 - if [[ "${sapi}" == "apache2" ]]; then
609 - sapi_list="${sapi_list:+${sapi_list} }apache2handler"
610 - else
611 - sapi_list="${sapi_list:+${sapi_list} }${sapi}"
612 - fi
613 - fi
614 - done
615 -
616 - # Installing opcache module
617 - if use opcache ; then
618 - into "${PHP_DESTDIR#${EPREFIX}}"
619 - dolib.so "modules/opcache$(get_libname)"
620 - fi
621 -
622 - # Install env.d files
623 - newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}"
624 - sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
625 - sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
626 -
627 - # set php-config variable correctly (bug #278439)
628 - sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \
629 - "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die
630 -
631 - if use fpm ; then
632 - if use systemd; then
633 - systemd_newunit "${FILESDIR}/php-fpm_at.service" \
634 - "php-fpm@${SLOT}.service"
635 - else
636 - systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \
637 - "php-fpm@${SLOT}.service"
638 - fi
639 - fi
640 -}
641 -
642 -src_test() {
643 - echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
644 - PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
645 - if [[ ! -x "${PHP_BIN}" ]] ; then
646 - ewarn "Test phase requires USE=cli, skipping"
647 - return
648 - else
649 - export TEST_PHP_EXECUTABLE="${PHP_BIN}"
650 - fi
651 -
652 - if [[ -x "${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" ]] ; then
653 - export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi"
654 - fi
655 -
656 - if [[ -x "${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" ]] ; then
657 - export TEST_PHPDBG_EXECUTABLE="${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg"
658 - fi
659 -
660 - REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \
661 - "session.save_path=${T}" \
662 - "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \
663 - "session.save_path=${T}"
664 -
665 - for name in ${EXPECTED_TEST_FAILURES}; do
666 - mv "${name}.out" "${name}.out.orig" 2>/dev/null || die
667 - done
668 -
669 - local failed="$(find -name '*.out')"
670 - if [[ ${failed} != "" ]] ; then
671 - ewarn "The following test cases failed unexpectedly:"
672 - for name in ${failed}; do
673 - ewarn " ${name/.out/}"
674 - done
675 - else
676 - einfo "No unexpected test failures, all fine"
677 - fi
678 -
679 - if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
680 - local passed=""
681 - for name in ${EXPECTED_TEST_FAILURES}; do
682 - [[ -f "${name}.diff" ]] && continue
683 - passed="${passed} ${name}"
684 - done
685 - if [[ ${passed} != "" ]] ; then
686 - einfo "The following test cases passed unexpectedly:"
687 - for name in ${passed}; do
688 - ewarn " ${passed}"
689 - done
690 - else
691 - einfo "None of the known-to-fail tests passed, all fine"
692 - fi
693 - fi
694 -}
695 -
696 -pkg_postinst() {
697 - # Output some general info to the user
698 - if use apache2 ; then
699 - elog
700 - elog "To enable PHP in apache, you will need to add \"-D PHP\" to"
701 - elog "your apache2 command. OpenRC users can append that string to"
702 - elog "APACHE2_OPTS in /etc/conf.d/apache2."
703 - elog
704 - elog "The apache module configuration file 70_mod_php.conf is"
705 - elog "provided (and maintained) by eselect-php."
706 - elog
707 - fi
708 -
709 - # Create the symlinks for php
710 - for m in ${SAPIS}; do
711 - [[ ${m} == 'embed' ]] && continue;
712 - if use $m ; then
713 - local ci=$(eselect php show $m)
714 - if [[ -z $ci ]]; then
715 - eselect php set $m php${SLOT} || die
716 - einfo "Switched ${m} to use php:${SLOT}"
717 - einfo
718 - elif [[ $ci != "php${SLOT}" ]] ; then
719 - elog "To switch $m to use php:${SLOT}, run"
720 - elog " eselect php set $m php${SLOT}"
721 - elog
722 - fi
723 - fi
724 - done
725 -
726 - # Remove dead symlinks for SAPIs that were just disabled. For
727 - # example, if the user has the cgi SAPI enabled, then he has an
728 - # eselect-php symlink for it. If he later reinstalls PHP with
729 - # USE="-cgi", that symlink will break. This call to eselect is
730 - # supposed to remove that dead link per bug 572436.
731 - eselect php cleanup || die
732 -
733 - if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then
734 - elog "To build extensions for this version of PHP, you will need to"
735 - elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable."
736 - elog
737 - fi
738 -
739 - # Warn about the removal of PHP_INI_VERSION if the user has it set.
740 - if [[ -n "${PHP_INI_VERSION}" ]]; then
741 - ewarn 'The PHP_INI_VERSION variable has been phased out. You may'
742 - ewarn 'remove it from your configuration at your convenience. See'
743 - ewarn
744 - ewarn ' https://bugs.gentoo.org/611214'
745 - ewarn
746 - ewarn 'for more information.'
747 - fi
748 -
749 - elog "For details on how version slotting works, please see"
750 - elog "the wiki:"
751 - elog
752 - elog " https://wiki.gentoo.org/wiki/PHP"
753 - elog
754 -}
755 -
756 -pkg_postrm() {
757 - # This serves two purposes. First, if we have just removed the last
758 - # installed version of PHP, then this will remove any dead symlinks
759 - # belonging to eselect-php. Second, if a user upgrades slots from
760 - # (say) 5.6 to 7.0 and depcleans the old slot, then this will update
761 - # his existing symlinks to point to the new 7.0 installation. The
762 - # latter is bug 432962.
763 - #
764 - # Note: the eselect-php package may not be installed at this point,
765 - # so we can't die() if this command fails.
766 - eselect php cleanup
767 -}
768
769 diff --git a/dev-lang/php/php-7.2.3.ebuild b/dev-lang/php/php-7.2.3.ebuild
770 deleted file mode 100644
771 index 5407f131e1a..00000000000
772 --- a/dev-lang/php/php-7.2.3.ebuild
773 +++ /dev/null
774 @@ -1,737 +0,0 @@
775 -# Copyright 1999-2018 Gentoo Foundation
776 -# Distributed under the terms of the GNU General Public License v2
777 -
778 -EAPI=6
779 -
780 -inherit flag-o-matic versionator systemd
781 -
782 -DESCRIPTION="The PHP language runtime engine"
783 -HOMEPAGE="https://secure.php.net/"
784 -SRC_URI="https://secure.php.net/distributions/${P}.tar.xz"
785 -
786 -LICENSE="PHP-3.01
787 - BSD
788 - Zend-2.0
789 - bcmath? ( LGPL-2.1+ )
790 - fpm? ( BSD-2 )
791 - gd? ( gd )
792 - unicode? ( BSD-2 LGPL-2.1 )"
793 -
794 -SLOT="$(get_version_component_range 1-2)"
795 -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"
796 -
797 -# We can build the following SAPIs in the given order
798 -SAPIS="embed cli cgi fpm apache2 phpdbg"
799 -
800 -# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
801 -IUSE="${IUSE}
802 - ${SAPIS/cli/+cli}
803 - threads"
804 -
805 -IUSE="${IUSE} acl argon2 bcmath berkdb bzip2 calendar cdb cjk
806 - coverage +ctype curl debug
807 - enchant exif +fileinfo +filter firebird
808 - flatfile ftp gd gdbm gmp +hash +iconv imap inifile
809 - intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl lmdb
810 - mhash mssql mysql mysqli nls
811 - oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
812 - readline recode selinux +session session-mm sharedmem
813 - +simplexml snmp soap sockets sodium spell sqlite ssl
814 - sysvipc systemd test tidy +tokenizer tokyocabinet truetype unicode wddx webp
815 - +xml xmlreader xmlwriter xmlrpc xpm xslt zip zip-encryption zlib"
816 -
817 -# The supported (that is, autodetected) versions of BDB are listed in
818 -# the ./configure script. Other versions *work*, but we need to stick to
819 -# the ones that can be detected to avoid a repeat of bug #564824.
820 -COMMON_DEPEND="
821 - >=app-eselect/eselect-php-0.9.1[apache2?,fpm?]
822 - >=dev-libs/libpcre-8.32[unicode]
823 - fpm? ( acl? ( sys-apps/acl ) )
824 - apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=]
825 - <www-servers/apache-2.4[threads=] ) )
826 - argon2? ( app-crypt/argon2:= )
827 - berkdb? ( || ( sys-libs/db:5.3
828 - sys-libs/db:5.1
829 - sys-libs/db:4.8
830 - sys-libs/db:4.7
831 - sys-libs/db:4.6
832 - sys-libs/db:4.5 ) )
833 - bzip2? ( app-arch/bzip2:0= )
834 - cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
835 - coverage? ( dev-util/lcov )
836 - curl? ( >=net-misc/curl-7.10.5 )
837 - enchant? ( app-text/enchant )
838 - firebird? ( dev-db/firebird )
839 - gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib )
840 - gdbm? ( >=sys-libs/gdbm-1.8.0:0= )
841 - gmp? ( dev-libs/gmp:0= )
842 - iconv? ( virtual/libiconv )
843 - imap? ( virtual/imap-c-client[kerberos=,ssl=] )
844 - intl? ( dev-libs/icu:= )
845 - iodbc? ( dev-db/libiodbc )
846 - kerberos? ( virtual/krb5 )
847 - ldap? ( >=net-nds/openldap-1.2.11 )
848 - ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 )
849 - libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) )
850 - lmdb? ( dev-db/lmdb:= )
851 - mssql? ( dev-db/freetds[mssql] )
852 - nls? ( sys-devel/gettext )
853 - oci8-instant-client? ( dev-db/oracle-instantclient-basic )
854 - odbc? ( >=dev-db/unixODBC-1.8.13 )
855 - postgres? ( dev-db/postgresql:* )
856 - qdbm? ( dev-db/qdbm )
857 - readline? ( sys-libs/readline:0= )
858 - recode? ( app-text/recode )
859 - session-mm? ( dev-libs/mm )
860 - simplexml? ( >=dev-libs/libxml2-2.6.8 )
861 - snmp? ( >=net-analyzer/net-snmp-5.2 )
862 - soap? ( >=dev-libs/libxml2-2.6.8 )
863 - sodium? ( dev-libs/libsodium:= )
864 - spell? ( >=app-text/aspell-0.50 )
865 - sqlite? ( >=dev-db/sqlite-3.7.6.3 )
866 - ssl? (
867 - !libressl? ( dev-libs/openssl:0= )
868 - libressl? ( dev-libs/libressl:0= )
869 - )
870 - tidy? ( || ( app-text/tidy-html5 app-text/htmltidy ) )
871 - tokyocabinet? ( dev-db/tokyocabinet )
872 - truetype? ( =media-libs/freetype-2* )
873 - unicode? ( dev-libs/oniguruma:= )
874 - wddx? ( >=dev-libs/libxml2-2.6.8 )
875 - webp? ( media-libs/libwebp:0= )
876 - xml? ( >=dev-libs/libxml2-2.6.8 )
877 - xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
878 - xmlreader? ( >=dev-libs/libxml2-2.6.8 )
879 - xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
880 - xpm? ( x11-libs/libXpm )
881 - xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
882 - zip? ( sys-libs/zlib:0= )
883 - zip-encryption? ( >=dev-libs/libzip-1.2.0:= )
884 - zlib? ( sys-libs/zlib:0= )
885 -"
886 -
887 -RDEPEND="${COMMON_DEPEND}
888 - virtual/mta
889 - fpm? (
890 - selinux? ( sec-policy/selinux-phpfpm )
891 - systemd? ( sys-apps/systemd ) )"
892 -
893 -# Bison isn't actually needed when building from a release tarball
894 -# However, the configure script will warn if it's absent or if you
895 -# have an incompatible version installed. See bug 593278.
896 -DEPEND="${COMMON_DEPEND}
897 - app-arch/xz-utils
898 - >=sys-devel/bison-3.0.1"
899 -
900 -# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
901 -REQUIRED_USE="
902 - || ( cli cgi fpm apache2 embed phpdbg )
903 - cli? ( ^^ ( readline libedit ) )
904 - truetype? ( gd )
905 - webp? ( gd )
906 - cjk? ( gd )
907 - exif? ( gd )
908 - xpm? ( gd )
909 - gd? ( zlib )
910 - simplexml? ( xml )
911 - soap? ( xml )
912 - wddx? ( xml )
913 - xmlrpc? ( || ( xml iconv ) )
914 - xmlreader? ( xml )
915 - xslt? ( xml )
916 - ldap-sasl? ( ldap )
917 - mhash? ( hash )
918 - phar? ( hash )
919 - qdbm? ( !gdbm )
920 - readline? ( !libedit )
921 - recode? ( !imap !mysqli !mysql )
922 - session-mm? ( session !threads )
923 - mysql? ( || ( mysqli pdo ) )
924 - zip-encryption? ( zip )
925 -"
926 -
927 -PHP_MV="$(get_major_version)"
928 -
929 -php_install_ini() {
930 - local phpsapi="${1}"
931 -
932 - # work out where we are installing the ini file
933 - php_set_ini_dir "${phpsapi}"
934 -
935 - # Always install the production INI file, bug 611214.
936 - local phpinisrc="php.ini-production-${phpsapi}"
937 - cp php.ini-production "${phpinisrc}" || die
938 -
939 - # default to /tmp for save_path, bug #282768
940 - sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die
941 -
942 - # Set the extension dir
943 - sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \
944 - -i "${phpinisrc}" || die
945 -
946 - # Set the include path to point to where we want to find PEAR packages
947 - sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die
948 -
949 - dodir "${PHP_INI_DIR#${EPREFIX}}"
950 - insinto "${PHP_INI_DIR#${EPREFIX}}"
951 - newins "${phpinisrc}" php.ini
952 -
953 - elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}"
954 - elog
955 -
956 - dodir "${PHP_EXT_INI_DIR#${EPREFIX}}"
957 - dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}"
958 -
959 - if use opcache; then
960 - elog "Adding opcache to $PHP_EXT_INI_DIR"
961 - echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \
962 - "${D}/${PHP_EXT_INI_DIR}"/opcache.ini
963 - dosym "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" \
964 - "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini"
965 - fi
966 -
967 - # SAPI-specific handling
968 - if [[ "${sapi}" == "fpm" ]] ; then
969 - einfo "Installing FPM config files php-fpm.conf and www.conf"
970 - insinto "${PHP_INI_DIR#${EPREFIX}}"
971 - doins sapi/fpm/php-fpm.conf
972 - insinto "${PHP_INI_DIR#${EPREFIX}}/fpm.d"
973 - doins sapi/fpm/www.conf
974 - fi
975 -
976 - dodoc php.ini-{development,production}
977 -}
978 -
979 -php_set_ini_dir() {
980 - PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}"
981 - PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
982 - PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
983 -}
984 -
985 -src_prepare() {
986 - default
987 -
988 - # In php-7.x, the FPM pool configuration files have been split off
989 - # of the main config. By default the pool config files go in
990 - # e.g. /etc/php-fpm.d, which isn't slotted. So here we move the
991 - # include directory to a subdirectory "fpm.d" of $PHP_INI_DIR. Later
992 - # we'll install the pool configuration file "www.conf" there.
993 - php_set_ini_dir fpm
994 - sed -i "s~^include=.*$~include=${PHP_INI_DIR}/fpm.d/*.conf~" \
995 - sapi/fpm/php-fpm.conf.in \
996 - || die 'failed to move the include directory in php-fpm.conf'
997 -}
998 -
999 -src_configure() {
1000 - addpredict /usr/share/snmp/mibs/.index
1001 - addpredict /var/lib/net-snmp/mib_indexes
1002 -
1003 - PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
1004 -
1005 - # The php-fpm config file wants localstatedir to be ${EPREFIX}/var
1006 - # and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002.
1007 - local our_conf=(
1008 - --prefix="${PHP_DESTDIR}"
1009 - --mandir="${PHP_DESTDIR}/man"
1010 - --infodir="${PHP_DESTDIR}/info"
1011 - --libdir="${PHP_DESTDIR}/lib"
1012 - --with-libdir="$(get_libdir)"
1013 - --localstatedir="${EPREFIX}/var"
1014 - --without-pear
1015 - $(use_enable threads maintainer-zts)
1016 - )
1017 -
1018 - our_conf+=(
1019 - $(use_with argon2 password-argon2 "${EPREFIX}/usr")
1020 - $(use_enable bcmath bcmath)
1021 - $(use_with bzip2 bz2 "${EPREFIX}/usr")
1022 - $(use_enable calendar calendar)
1023 - $(use_enable coverage gcov)
1024 - $(use_enable ctype ctype)
1025 - $(use_with curl curl "${EPREFIX}/usr")
1026 - $(use_enable xml dom)
1027 - $(use_with enchant enchant "${EPREFIX}/usr")
1028 - $(use_enable exif exif)
1029 - $(use_enable fileinfo fileinfo)
1030 - $(use_enable filter filter)
1031 - $(use_enable ftp ftp)
1032 - $(use_with nls gettext "${EPREFIX}/usr")
1033 - $(use_with gmp gmp "${EPREFIX}/usr")
1034 - $(use_enable hash hash)
1035 - $(use_with mhash mhash "${EPREFIX}/usr")
1036 - $(use_with iconv iconv \
1037 - $(use elibc_glibc || use elibc_musl || use elibc_FreeBSD || echo "${EPREFIX}/usr"))
1038 - $(use_enable intl intl)
1039 - $(use_enable ipv6 ipv6)
1040 - $(use_enable json json)
1041 - $(use_with kerberos kerberos "${EPREFIX}/usr")
1042 - $(use_enable xml libxml)
1043 - $(use_with xml libxml-dir "${EPREFIX}/usr")
1044 - $(use_enable unicode mbstring)
1045 - $(use_with unicode onig "${EPREFIX}/usr")
1046 - $(use_with ssl openssl "${EPREFIX}/usr")
1047 - $(use_with ssl openssl-dir "${EPREFIX}/usr")
1048 - $(use_enable pcntl pcntl)
1049 - $(use_enable phar phar)
1050 - $(use_enable pdo pdo)
1051 - $(use_enable opcache opcache)
1052 - $(use_with postgres pgsql "${EPREFIX}/usr")
1053 - $(use_enable posix posix)
1054 - $(use_with spell pspell "${EPREFIX}/usr")
1055 - $(use_with recode recode "${EPREFIX}/usr")
1056 - $(use_enable simplexml simplexml)
1057 - $(use_enable sharedmem shmop)
1058 - $(use_with snmp snmp "${EPREFIX}/usr")
1059 - $(use_enable soap soap)
1060 - $(use_enable sockets sockets)
1061 - $(use_with sodium sodium "${EPREFIX}/usr")
1062 - $(use_with sqlite sqlite3 "${EPREFIX}/usr")
1063 - $(use_enable sysvipc sysvmsg)
1064 - $(use_enable sysvipc sysvsem)
1065 - $(use_enable sysvipc sysvshm)
1066 - $(use_with tidy tidy "${EPREFIX}/usr")
1067 - $(use_enable tokenizer tokenizer)
1068 - $(use_enable wddx wddx)
1069 - $(use_enable xml xml)
1070 - $(use_enable xmlreader xmlreader)
1071 - $(use_enable xmlwriter xmlwriter)
1072 - $(use_with xmlrpc xmlrpc)
1073 - $(use_with xslt xsl "${EPREFIX}/usr")
1074 - $(use_enable zip zip)
1075 - $(use_with zip-encryption libzip "${EPREFIX}/usr")
1076 - $(use_with zlib zlib "${EPREFIX}/usr")
1077 - $(use_enable debug debug)
1078 - )
1079 -
1080 - # DBA support
1081 - if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
1082 - || use qdbm || use lmdb || use tokyocabinet ; then
1083 - our_conf+=( "--enable-dba${shared}" )
1084 - fi
1085 -
1086 - # DBA drivers support
1087 - our_conf+=(
1088 - $(use_with cdb cdb)
1089 - $(use_with berkdb db4 "${EPREFIX}/usr")
1090 - $(use_enable flatfile flatfile)
1091 - $(use_with gdbm gdbm "${EPREFIX}/usr")
1092 - $(use_enable inifile inifile)
1093 - $(use_with qdbm qdbm "${EPREFIX}/usr")
1094 - $(use_with lmdb lmdb "${EPREFIX}/usr")
1095 - )
1096 -
1097 - # Support for the GD graphics library
1098 - our_conf+=(
1099 - $(use_with truetype freetype-dir "${EPREFIX}/usr")
1100 - $(use_enable cjk gd-jis-conv)
1101 - $(use_with gd jpeg-dir "${EPREFIX}/usr")
1102 - $(use_with gd png-dir "${EPREFIX}/usr")
1103 - $(use_with xpm xpm-dir "${EPREFIX}/usr")
1104 - )
1105 - if use webp; then
1106 - our_conf+=( --with-webp-dir="${EPREFIX}/usr" )
1107 - fi
1108 - # enable gd last, so configure can pick up the previous settings
1109 - our_conf+=( $(use_with gd gd) )
1110 -
1111 - # IMAP support
1112 - if use imap ; then
1113 - our_conf+=(
1114 - $(use_with imap imap "${EPREFIX}/usr")
1115 - $(use_with ssl imap-ssl "${EPREFIX}/usr")
1116 - )
1117 - fi
1118 -
1119 - # Interbase/firebird support
1120 - our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") )
1121 -
1122 - # LDAP support
1123 - if use ldap ; then
1124 - our_conf+=(
1125 - $(use_with ldap ldap "${EPREFIX}/usr")
1126 - $(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr")
1127 - )
1128 - fi
1129 -
1130 - # MySQL support
1131 - local mysqllib="mysqlnd"
1132 - local mysqlilib="mysqlnd"
1133 -
1134 - our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
1135 -
1136 - local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock"
1137 - if use mysql || use mysqli ; then
1138 - our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") )
1139 - fi
1140 -
1141 - # ODBC support
1142 - our_conf+=(
1143 - $(use_with odbc unixODBC "${EPREFIX}/usr")
1144 - $(use_with iodbc iodbc "${EPREFIX}/usr")
1145 - )
1146 -
1147 - # Oracle support
1148 - our_conf+=( $(use_with oci8-instant-client oci8) )
1149 -
1150 - # PDO support
1151 - if use pdo ; then
1152 - our_conf+=(
1153 - $(use_with mssql pdo-dblib "${EPREFIX}/usr")
1154 - $(use_with mysql pdo-mysql "${mysqllib}")
1155 - $(use_with postgres pdo-pgsql)
1156 - $(use_with sqlite pdo-sqlite "${EPREFIX}/usr")
1157 - $(use_with firebird pdo-firebird "${EPREFIX}/usr")
1158 - $(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr")
1159 - $(use_with oci8-instant-client pdo-oci)
1160 - )
1161 - fi
1162 -
1163 - # readline/libedit support
1164 - our_conf+=(
1165 - $(use_with readline readline "${EPREFIX}/usr")
1166 - $(use_with libedit libedit "${EPREFIX}/usr")
1167 - )
1168 -
1169 - # Session support
1170 - if use session ; then
1171 - our_conf+=( $(use_with session-mm mm "${EPREFIX}/usr") )
1172 - else
1173 - our_conf+=( $(use_enable session session) )
1174 - fi
1175 -
1176 - # Use pic for shared modules such as apache2's mod_php
1177 - our_conf+=( --with-pic )
1178 -
1179 - # we use the system copy of pcre
1180 - # --with-pcre-regex affects ext/pcre
1181 - # --with-pcre-dir affects ext/filter and ext/zip
1182 - # --with-pcre-valgrind cannot be enabled with system pcre
1183 - # Many arches don't support pcre-jit
1184 - our_conf+=(
1185 - --with-pcre-regex="${EPREFIX}/usr"
1186 - --with-pcre-dir="${EPREFIX}/usr"
1187 - --without-pcre-valgrind
1188 - --without-pcre-jit
1189 - )
1190 -
1191 - # Catch CFLAGS problems
1192 - # Fixes bug #14067.
1193 - # Changed order to run it in reverse for bug #32022 and #12021.
1194 - replace-cpu-flags "k6*" "i586"
1195 -
1196 - # Cache the ./configure test results between SAPIs.
1197 - our_conf+=( --cache-file="${T}/config.cache" )
1198 -
1199 - # Support user-passed configuration parameters
1200 - our_conf+=( ${EXTRA_ECONF:-} )
1201 -
1202 - # Support the Apache2 extras, they must be set globally for all
1203 - # SAPIs to work correctly, especially for external PHP extensions
1204 -
1205 - mkdir -p "${WORKDIR}/sapis-build" || die
1206 - for one_sapi in $SAPIS ; do
1207 - use "${one_sapi}" || continue
1208 - php_set_ini_dir "${one_sapi}"
1209 -
1210 - # The BUILD_DIR variable is used to determine where to output
1211 - # the files that autotools creates. This was all originally
1212 - # based on the autotools-utils eclass.
1213 - BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}"
1214 - cp -a "${S}" "${BUILD_DIR}" || die
1215 - cd "${BUILD_DIR}" || die
1216 -
1217 - local sapi_conf=(
1218 - --with-config-file-path="${PHP_INI_DIR}"
1219 - --with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}"
1220 - )
1221 -
1222 - for sapi in $SAPIS ; do
1223 - case "$sapi" in
1224 - cli|cgi|embed|fpm|phpdbg)
1225 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
1226 - sapi_conf+=( "--enable-${sapi}" )
1227 - if [[ "fpm" == "${sapi}" ]] ; then
1228 - sapi_conf+=(
1229 - $(use_with acl fpm-acl)
1230 - $(use_with systemd fpm-systemd)
1231 - )
1232 - fi
1233 - else
1234 - sapi_conf+=( "--disable-${sapi}" )
1235 - fi
1236 - ;;
1237 -
1238 - apache2)
1239 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
1240 - sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" )
1241 - else
1242 - sapi_conf+=( --without-apxs2 )
1243 - fi
1244 - ;;
1245 - esac
1246 - done
1247 -
1248 - # Construct the $myeconfargs array by concatenating $our_conf
1249 - # (the common args) and $sapi_conf (the SAPI-specific args).
1250 - local myeconfargs=( "${our_conf[@]}" )
1251 - myeconfargs+=( "${sapi_conf[@]}" )
1252 -
1253 - pushd "${BUILD_DIR}" > /dev/null || die
1254 - econf "${myeconfargs[@]}"
1255 - popd > /dev/null || die
1256 - done
1257 -}
1258 -
1259 -src_compile() {
1260 - # snmp seems to run during src_compile, too (bug #324739)
1261 - addpredict /usr/share/snmp/mibs/.index
1262 - addpredict /var/lib/net-snmp/mib_indexes
1263 -
1264 - for sapi in ${SAPIS} ; do
1265 - if use "${sapi}"; then
1266 - cd "${WORKDIR}/sapis-build/$sapi" || \
1267 - die "Failed to change dir to ${WORKDIR}/sapis-build/$1"
1268 - emake
1269 - fi
1270 - done
1271 -}
1272 -
1273 -src_install() {
1274 - # see bug #324739 for what happens when we don't have that
1275 - addpredict /usr/share/snmp/mibs/.index
1276 -
1277 - # grab the first SAPI that got built and install common files from there
1278 - local first_sapi=""
1279 - for sapi in $SAPIS ; do
1280 - if use $sapi ; then
1281 - first_sapi=$sapi
1282 - break
1283 - fi
1284 - done
1285 -
1286 - # Makefile forgets to create this before trying to write to it...
1287 - dodir "${PHP_DESTDIR#${EPREFIX}}/bin"
1288 -
1289 - # Install php environment (without any sapis)
1290 - cd "${WORKDIR}/sapis-build/$first_sapi" || die
1291 - emake INSTALL_ROOT="${D}" \
1292 - install-build install-headers install-programs
1293 -
1294 - local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)"
1295 -
1296 - # Create the directory where we'll put version-specific php scripts
1297 - keepdir "/usr/share/php${PHP_MV}"
1298 -
1299 - local sapi="", file=""
1300 - local sapi_list=""
1301 -
1302 - for sapi in ${SAPIS}; do
1303 - if use "${sapi}" ; then
1304 - einfo "Installing SAPI: ${sapi}"
1305 - cd "${WORKDIR}/sapis-build/${sapi}" || die
1306 -
1307 - if [[ "${sapi}" == "apache2" ]] ; then
1308 - # We're specifically not using emake install-sapi as libtool
1309 - # may cause unnecessary relink failures (see bug #351266)
1310 - insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/"
1311 - newins ".libs/libphp${PHP_MV}$(get_libname)" \
1312 - "libphp${PHP_MV}$(get_libname)"
1313 - keepdir "/usr/$(get_libdir)/apache2/modules"
1314 - else
1315 - # needed each time, php_install_ini would reset it
1316 - local dest="${PHP_DESTDIR#${EPREFIX}}"
1317 - into "${dest}"
1318 - case "$sapi" in
1319 - cli)
1320 - source="sapi/cli/php"
1321 - ;;
1322 - cgi)
1323 - source="sapi/cgi/php-cgi"
1324 - ;;
1325 - fpm)
1326 - source="sapi/fpm/php-fpm"
1327 - ;;
1328 - embed)
1329 - source="libs/libphp${PHP_MV}$(get_libname)"
1330 - ;;
1331 - phpdbg)
1332 - source="sapi/phpdbg/phpdbg"
1333 - ;;
1334 - *)
1335 - die "unhandled sapi in src_install"
1336 - ;;
1337 - esac
1338 -
1339 - if [[ "${source}" == *"$(get_libname)" ]]; then
1340 - dolib.so "${source}"
1341 - else
1342 - dobin "${source}"
1343 - local name="$(basename ${source})"
1344 - dosym "${dest}/bin/${name}" "/usr/bin/${name}${SLOT}"
1345 - fi
1346 - fi
1347 -
1348 - php_install_ini "${sapi}"
1349 -
1350 - # construct correct SAPI string for php-config
1351 - # thanks to ferringb for the bash voodoo
1352 - if [[ "${sapi}" == "apache2" ]]; then
1353 - sapi_list="${sapi_list:+${sapi_list} }apache2handler"
1354 - else
1355 - sapi_list="${sapi_list:+${sapi_list} }${sapi}"
1356 - fi
1357 - fi
1358 - done
1359 -
1360 - # Installing opcache module
1361 - if use opcache ; then
1362 - into "${PHP_DESTDIR#${EPREFIX}}"
1363 - dolib.so "modules/opcache$(get_libname)"
1364 - fi
1365 -
1366 - # Install env.d files
1367 - newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}"
1368 - sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
1369 - sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
1370 -
1371 - # set php-config variable correctly (bug #278439)
1372 - sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \
1373 - "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die
1374 -
1375 - if use fpm ; then
1376 - if use systemd; then
1377 - systemd_newunit "${FILESDIR}/php-fpm_at.service" \
1378 - "php-fpm@${SLOT}.service"
1379 - else
1380 - systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \
1381 - "php-fpm@${SLOT}.service"
1382 - fi
1383 - fi
1384 -}
1385 -
1386 -src_test() {
1387 - echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
1388 - PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
1389 - if [[ ! -x "${PHP_BIN}" ]] ; then
1390 - ewarn "Test phase requires USE=cli, skipping"
1391 - return
1392 - else
1393 - export TEST_PHP_EXECUTABLE="${PHP_BIN}"
1394 - fi
1395 -
1396 - if [[ -x "${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" ]] ; then
1397 - export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi"
1398 - fi
1399 -
1400 - if [[ -x "${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" ]] ; then
1401 - export TEST_PHPDBG_EXECUTABLE="${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg"
1402 - fi
1403 -
1404 - REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \
1405 - "session.save_path=${T}" \
1406 - "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \
1407 - "session.save_path=${T}"
1408 -
1409 - for name in ${EXPECTED_TEST_FAILURES}; do
1410 - mv "${name}.out" "${name}.out.orig" 2>/dev/null || die
1411 - done
1412 -
1413 - local failed="$(find -name '*.out')"
1414 - if [[ ${failed} != "" ]] ; then
1415 - ewarn "The following test cases failed unexpectedly:"
1416 - for name in ${failed}; do
1417 - ewarn " ${name/.out/}"
1418 - done
1419 - else
1420 - einfo "No unexpected test failures, all fine"
1421 - fi
1422 -
1423 - if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
1424 - local passed=""
1425 - for name in ${EXPECTED_TEST_FAILURES}; do
1426 - [[ -f "${name}.diff" ]] && continue
1427 - passed="${passed} ${name}"
1428 - done
1429 - if [[ ${passed} != "" ]] ; then
1430 - einfo "The following test cases passed unexpectedly:"
1431 - for name in ${passed}; do
1432 - ewarn " ${passed}"
1433 - done
1434 - else
1435 - einfo "None of the known-to-fail tests passed, all fine"
1436 - fi
1437 - fi
1438 -}
1439 -
1440 -pkg_postinst() {
1441 - # Output some general info to the user
1442 - if use apache2 ; then
1443 - elog
1444 - elog "To enable PHP in apache, you will need to add \"-D PHP\" to"
1445 - elog "your apache2 command. OpenRC users can append that string to"
1446 - elog "APACHE2_OPTS in /etc/conf.d/apache2."
1447 - elog
1448 - elog "The apache module configuration file 70_mod_php.conf is"
1449 - elog "provided (and maintained) by eselect-php."
1450 - elog
1451 - fi
1452 -
1453 - # Create the symlinks for php
1454 - for m in ${SAPIS}; do
1455 - [[ ${m} == 'embed' ]] && continue;
1456 - if use $m ; then
1457 - local ci=$(eselect php show $m)
1458 - if [[ -z $ci ]]; then
1459 - eselect php set $m php${SLOT} || die
1460 - einfo "Switched ${m} to use php:${SLOT}"
1461 - einfo
1462 - elif [[ $ci != "php${SLOT}" ]] ; then
1463 - elog "To switch $m to use php:${SLOT}, run"
1464 - elog " eselect php set $m php${SLOT}"
1465 - elog
1466 - fi
1467 - fi
1468 - done
1469 -
1470 - # Remove dead symlinks for SAPIs that were just disabled. For
1471 - # example, if the user has the cgi SAPI enabled, then he has an
1472 - # eselect-php symlink for it. If he later reinstalls PHP with
1473 - # USE="-cgi", that symlink will break. This call to eselect is
1474 - # supposed to remove that dead link per bug 572436.
1475 - eselect php cleanup || die
1476 -
1477 - if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then
1478 - elog "To build extensions for this version of PHP, you will need to"
1479 - elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable."
1480 - elog
1481 - fi
1482 -
1483 - # Warn about the removal of PHP_INI_VERSION if the user has it set.
1484 - if [[ -n "${PHP_INI_VERSION}" ]]; then
1485 - ewarn 'The PHP_INI_VERSION variable has been phased out. You may'
1486 - ewarn 'remove it from your configuration at your convenience. See'
1487 - ewarn
1488 - ewarn ' https://bugs.gentoo.org/611214'
1489 - ewarn
1490 - ewarn 'for more information.'
1491 - fi
1492 -
1493 - elog "For details on how version slotting works, please see"
1494 - elog "the wiki:"
1495 - elog
1496 - elog " https://wiki.gentoo.org/wiki/PHP"
1497 - elog
1498 -}
1499 -
1500 -pkg_postrm() {
1501 - # This serves two purposes. First, if we have just removed the last
1502 - # installed version of PHP, then this will remove any dead symlinks
1503 - # belonging to eselect-php. Second, if a user upgrades slots from
1504 - # (say) 5.6 to 7.0 and depcleans the old slot, then this will update
1505 - # his existing symlinks to point to the new 7.0 installation. The
1506 - # latter is bug 432962.
1507 - #
1508 - # Note: the eselect-php package may not be installed at this point,
1509 - # so we can't die() if this command fails.
1510 - eselect php cleanup
1511 -}