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