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