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