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