Gentoo Archives: gentoo-commits

From: Michael Orlitzky <mjo@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/php/
Date: Tue, 01 Sep 2020 11:42:26
Message-Id: 1598960365.7476c2a596118d7287feb80a487f8e204f495334.mjo@gentoo
1 commit: 7476c2a596118d7287feb80a487f8e204f495334
2 Author: Michael Orlitzky <mjo <AT> gentoo <DOT> org>
3 AuthorDate: Tue Sep 1 11:39:25 2020 +0000
4 Commit: Michael Orlitzky <mjo <AT> gentoo <DOT> org>
5 CommitDate: Tue Sep 1 11:39:25 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7476c2a5
7
8 dev-lang/php: remove old versions vulnerable to CVE-2020-7068.
9
10 Bug: https://bugs.gentoo.org/736158
11 Package-Manager: Portage-2.3.103, Repoman-2.3.23
12 Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org>
13
14 dev-lang/php/Manifest | 8 -
15 dev-lang/php/php-7.2.31.ebuild | 759 --------------------------------------
16 dev-lang/php/php-7.2.32.ebuild | 759 --------------------------------------
17 dev-lang/php/php-7.3.18.ebuild | 760 ---------------------------------------
18 dev-lang/php/php-7.3.19.ebuild | 760 ---------------------------------------
19 dev-lang/php/php-7.3.20.ebuild | 760 ---------------------------------------
20 dev-lang/php/php-7.4.6.ebuild | 750 --------------------------------------
21 dev-lang/php/php-7.4.7.ebuild | 750 --------------------------------------
22 dev-lang/php/php-7.4.8-r1.ebuild | 750 --------------------------------------
23 9 files changed, 6056 deletions(-)
24
25 diff --git a/dev-lang/php/Manifest b/dev-lang/php/Manifest
26 index a95fa81e71b..715c9298ee8 100644
27 --- a/dev-lang/php/Manifest
28 +++ b/dev-lang/php/Manifest
29 @@ -1,11 +1,3 @@
30 -DIST php-7.2.31.tar.xz 12309936 BLAKE2B fc81f41dd4ec8695029bfe1993d76b1fdfe7f16d926f57302b9e85f3acd250967db9b9f0597c47589ae553d5faaaf0266e24b5b64247e017361d991bf96cd4de SHA512 b21c504d0af2c095e4ae5a62c810af96171b927a27ea4694f59555c0d47798d61c3491a92941099cd9c978b3b0f41852ca2cf745e42ee3d9a6d107a5a884c9ee
31 -DIST php-7.2.32.tar.xz 12251152 BLAKE2B ae4cf19c2c61ea149b423248feef31e34fa697e60782e8a4fdf9bee430703e9bd8251e4140042148aa73dfbf4d39d215be498d1273e1c68bf52a14e4126d2e1d SHA512 47e84f9f493951b33625e149291bcde87189ecb28636809b3ec6264ed17e85f842fa40f3a53754f7bf948a5a6963f8773d35f773760c0c2bf21a9dbd0314736e
32 DIST php-7.2.33.tar.xz 12310624 BLAKE2B 3eca6a2aee79b791abb6b0427496e6041b63800ac1aeea86b4465e9326fdcde5d7a69e6323902b6874f27cf6197b705397381319d0b5ff6f93605e791bf0eb86 SHA512 1c28e741fc6de88a33e1307bc88ba8dddf1ba767ce6eb9c1f0da35482c7d3ee1154831b997fa746340c4b7ec8de9196b21a9b1cf319c8e69eca2c92602ceee4a
33 -DIST php-7.3.18.tar.xz 12116280 BLAKE2B 73d82e4a22f29dbeec221ef3109592a40e559238a0093e80e8e10bcd7de64f3bd58dd6f0835ddf3d9c2323fc37d738301b07291ca11a84c70ddced172676bc20 SHA512 e626091c835f6d165ff48ae3be8ddf7a66b0a320c6d77dc98fb73235d560814c180112a9e5478a5b3b6bb01ed99a50f8025fdc3d1ef80cca59e04ac248f9b0bf
34 -DIST php-7.3.19.tar.xz 12117968 BLAKE2B 84172d2aad901cdca97a6f4c3405d3f4f25c72053ca09ef8a5c6ef93d35b23ac3a7771ff9f2c4ddd000512fe288f3fb25b17bb023f3fed16735f0d6ea5bda790 SHA512 f37800d9e1bf808ad1099f6190965cc75781e7bf6d2c341a7143aca435abc9974a2987cbfeb8c2b35805c946218343612906fde3cc84b195c2c586945869b760
35 -DIST php-7.3.20.tar.xz 12118188 BLAKE2B add1e0dcc264cd12ea9ee000becb83c42b2607c0c9ae828994856a183ae94e9a580226559ccfa28dece225ad9a1c6bd4989ada08f09bbc461b33f0b1b30b12ea SHA512 4d035e7420ceb64d912a1936db5d311c06c61d09c9d4665c27fba9709fe45b30d5771bb485fb24393d9ee689a0f7ddcbc577e9ee7a7b31341b0203f1b805b886
36 DIST php-7.3.21.tar.xz 12123192 BLAKE2B ff5fca092f6c4e92c009ade9f4bee01ec07686645a4844297cee0518f12b3ebc16a7322b64579d9ee2d3a3f7cd62ed9184d0afbe77dbcf2d24a11139242c88c5 SHA512 fc2b9a40c92a6e79522a49cd025e56c0a52c2c2bd3f7379aaf004ca6b67957cf4ad059c40a5daac45665710abd07962562870430338f700f573856d797df3ff4
37 -DIST php-7.4.6.tar.xz 10284824 BLAKE2B 83bbbb536e48c6ab6ef357283d2f99a0f1825fdbb1867598514dc87cb8a7181298aa1e6d45659b7a4343fdacdacbbfec9e4cca89f85fe53c9e48696e534da710 SHA512 786634d53ed100cc7638e64ca340efdd42405c258638f3f97fcd1816d4f0c643dc8d8b2b0f60d36904343dc8c2af7f9b8e4a652ea66ec2fe324290c72bc09c13
38 -DIST php-7.4.7.tar.xz 10286580 BLAKE2B fb297cc5847012e1d222479e00132c8838cb990a5face43620ced6fb82cabeb544c0de230e24e25ed5449b3050158e836743e514197180b40ebf240ceca45db6 SHA512 5b3ba690e610e0511675f06a10afe9edbcfa90b5b16956d22aab225cdf140b55e5a8a551e7b189d30404981c94c6921b8c4aed00102546cfa38784a719704b80
39 -DIST php-7.4.8.tar.xz 10281976 BLAKE2B c85dfacd259e78de69348c3af7c02c866622a414cbb78ef5f53aa739bcf150921c272b26f578f18734dc6f566f19f4d890b6a64aabf04ad9e6b53f11757c3b8a SHA512 cfb23eac731a0eabed83908d7c056a123cd9a73ccc091d92b8601366da4cd95ded8623156eaa0458405f23d8bb9dc244d117bd99876f916ef582e3966dc78b44
40 DIST php-7.4.9.tar.xz 10289560 BLAKE2B 0fd9d82539a46f7ce58857560f5aeb4be6dfe5f5a05f8b8c55c30d6000d19408b4ecc460c9135736298cdb8312ec958ab8358110b2b265bb8c185f80b1522dc6 SHA512 6179c2d867d6775d7f41785003c36d06ce620e7746ea7e6a4d275264e814a66d465776b47b04e2926ed1228cf58f2c15cdda74faf10372435c74ede7aeb79e18
41
42 diff --git a/dev-lang/php/php-7.2.31.ebuild b/dev-lang/php/php-7.2.31.ebuild
43 deleted file mode 100644
44 index 20ab7418c2a..00000000000
45 --- a/dev-lang/php/php-7.2.31.ebuild
46 +++ /dev/null
47 @@ -1,759 +0,0 @@
48 -# Copyright 1999-2020 Gentoo Authors
49 -# Distributed under the terms of the GNU General Public License v2
50 -
51 -EAPI="7"
52 -
53 -inherit flag-o-matic systemd autotools
54 -
55 -DESCRIPTION="The PHP language runtime engine"
56 -HOMEPAGE="https://www.php.net/"
57 -SRC_URI="https://www.php.net/distributions/${P}.tar.xz"
58 -
59 -LICENSE="PHP-3.01
60 - BSD
61 - Zend-2.0
62 - bcmath? ( LGPL-2.1+ )
63 - fpm? ( BSD-2 )
64 - gd? ( gd )
65 - unicode? ( BSD-2 LGPL-2.1 )"
66 -
67 -SLOT="$(ver_cut 1-2)"
68 -KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
69 -
70 -# We can build the following SAPIs in the given order
71 -SAPIS="embed cli cgi fpm apache2 phpdbg"
72 -
73 -# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
74 -IUSE="${IUSE}
75 - ${SAPIS/cli/+cli}
76 - threads"
77 -
78 -IUSE="${IUSE} acl argon2 bcmath berkdb bzip2 calendar cdb cjk
79 - coverage +ctype curl debug
80 - enchant exif +fileinfo +filter firebird
81 - +flatfile ftp gd gdbm gmp +hash +iconv imap inifile
82 - intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl lmdb
83 - mhash mssql mysql mysqli nls
84 - oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
85 - readline recode selinux +session session-mm sharedmem
86 - +simplexml snmp soap sockets sodium spell sqlite ssl
87 - sysvipc systemd test tidy +tokenizer tokyocabinet truetype unicode wddx webp
88 - +xml xmlreader xmlwriter xmlrpc xpm xslt zip zip-encryption zlib"
89 -
90 -# The supported (that is, autodetected) versions of BDB are listed in
91 -# the ./configure script. Other versions *work*, but we need to stick to
92 -# the ones that can be detected to avoid a repeat of bug #564824.
93 -COMMON_DEPEND="
94 - >=app-eselect/eselect-php-0.9.1[apache2?,fpm?]
95 - >=dev-libs/libpcre-8.32[unicode]
96 - fpm? ( acl? ( sys-apps/acl ) )
97 - apache2? ( www-servers/apache[apache2_modules_unixd(+),threads=] )
98 - argon2? ( app-crypt/argon2:= )
99 - berkdb? ( || ( sys-libs/db:5.3
100 - sys-libs/db:5.1
101 - sys-libs/db:4.8
102 - sys-libs/db:4.7
103 - sys-libs/db:4.6
104 - sys-libs/db:4.5 ) )
105 - bzip2? ( app-arch/bzip2:0= )
106 - cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
107 - coverage? ( dev-util/lcov )
108 - curl? ( >=net-misc/curl-7.10.5 )
109 - enchant? ( <app-text/enchant-2.0:0 )
110 - firebird? ( dev-db/firebird )
111 - gd? ( >=virtual/jpeg-0-r3:0 media-libs/libpng:0= sys-libs/zlib )
112 - gdbm? ( >=sys-libs/gdbm-1.8.0:0= )
113 - gmp? ( dev-libs/gmp:0= )
114 - iconv? ( virtual/libiconv )
115 - imap? ( >=virtual/imap-c-client-2[kerberos=,ssl=] )
116 - intl? ( dev-libs/icu:= )
117 - iodbc? ( dev-db/libiodbc )
118 - kerberos? ( virtual/krb5 )
119 - ldap? ( >=net-nds/openldap-1.2.11 )
120 - ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 )
121 - libedit? ( dev-libs/libedit )
122 - lmdb? ( dev-db/lmdb:= )
123 - mssql? ( dev-db/freetds[mssql] )
124 - nls? ( sys-devel/gettext )
125 - oci8-instant-client? ( dev-db/oracle-instantclient-basic )
126 - odbc? ( >=dev-db/unixODBC-1.8.13 )
127 - postgres? ( dev-db/postgresql:* )
128 - qdbm? ( dev-db/qdbm )
129 - readline? ( sys-libs/readline:0= )
130 - recode? ( app-text/recode )
131 - session-mm? ( dev-libs/mm )
132 - simplexml? ( >=dev-libs/libxml2-2.6.8 )
133 - snmp? ( >=net-analyzer/net-snmp-5.2 )
134 - soap? ( >=dev-libs/libxml2-2.6.8 )
135 - sodium? ( dev-libs/libsodium:= )
136 - spell? ( >=app-text/aspell-0.50 )
137 - sqlite? ( >=dev-db/sqlite-3.7.6.3 )
138 - ssl? (
139 - !libressl? ( dev-libs/openssl:0= )
140 - libressl? ( dev-libs/libressl:0= )
141 - )
142 - tidy? ( || ( app-text/tidy-html5 app-text/htmltidy ) )
143 - tokyocabinet? ( dev-db/tokyocabinet )
144 - truetype? ( =media-libs/freetype-2* )
145 - unicode? ( dev-libs/oniguruma:= )
146 - wddx? ( >=dev-libs/libxml2-2.6.8 )
147 - webp? ( media-libs/libwebp:0= )
148 - xml? ( >=dev-libs/libxml2-2.6.8 )
149 - xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
150 - xmlreader? ( >=dev-libs/libxml2-2.6.8 )
151 - xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
152 - xpm? ( x11-libs/libXpm )
153 - xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
154 - zip? ( sys-libs/zlib:0= )
155 - zip-encryption? ( >=dev-libs/libzip-1.2.0:= )
156 - zlib? ( sys-libs/zlib:0= )
157 -"
158 -
159 -RDEPEND="${COMMON_DEPEND}
160 - virtual/mta
161 - fpm? (
162 - selinux? ( sec-policy/selinux-phpfpm )
163 - systemd? ( sys-apps/systemd ) )"
164 -
165 -# Bison isn't actually needed when building from a release tarball
166 -# However, the configure script will warn if it's absent or if you
167 -# have an incompatible version installed. See bug 593278.
168 -DEPEND="${COMMON_DEPEND}
169 - app-arch/xz-utils
170 - >=sys-devel/bison-3.0.1"
171 -
172 -BDEPEND="virtual/pkgconfig"
173 -
174 -# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
175 -REQUIRED_USE="
176 - || ( cli cgi fpm apache2 embed phpdbg )
177 - cli? ( ^^ ( readline libedit ) )
178 - truetype? ( gd zlib )
179 - webp? ( gd zlib )
180 - cjk? ( gd zlib )
181 - exif? ( gd zlib )
182 - xpm? ( gd zlib )
183 - gd? ( zlib )
184 - simplexml? ( xml )
185 - soap? ( xml )
186 - wddx? ( xml )
187 - xmlrpc? ( || ( xml iconv ) )
188 - xmlreader? ( xml )
189 - xslt? ( xml )
190 - ldap-sasl? ( ldap )
191 - mhash? ( hash )
192 - phar? ( hash )
193 - qdbm? ( !gdbm )
194 - readline? ( !libedit )
195 - recode? ( !imap !mysqli !mysql )
196 - session-mm? ( session !threads )
197 - mysql? ( hash || ( mysqli pdo ) )
198 - mysqli? ( hash )
199 - zip-encryption? ( zip )
200 -"
201 -
202 -RESTRICT="!test? ( test )"
203 -
204 -PATCHES=(
205 - "${FILESDIR}/php-freetype-2.9.1.patch"
206 - "${FILESDIR}/php-7.2.13-intl-use-icu-namespace.patch"
207 -)
208 -
209 -PHP_MV="$(ver_cut 1)"
210 -
211 -php_install_ini() {
212 - local phpsapi="${1}"
213 -
214 - # work out where we are installing the ini file
215 - php_set_ini_dir "${phpsapi}"
216 -
217 - # Always install the production INI file, bug 611214.
218 - local phpinisrc="php.ini-production-${phpsapi}"
219 - cp php.ini-production "${phpinisrc}" || die
220 -
221 - # default to /tmp for save_path, bug #282768
222 - sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die
223 -
224 - # Set the extension dir
225 - sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \
226 - -i "${phpinisrc}" || die
227 -
228 - # Set the include path to point to where we want to find PEAR packages
229 - sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die
230 -
231 - insinto "${PHP_INI_DIR#${EPREFIX}}"
232 - newins "${phpinisrc}" php.ini
233 -
234 - elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}"
235 - elog
236 -
237 - dodir "${PHP_EXT_INI_DIR#${EPREFIX}}"
238 - dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}"
239 -
240 - if use opcache; then
241 - elog "Adding opcache to $PHP_EXT_INI_DIR"
242 - echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \
243 - "${D}/${PHP_EXT_INI_DIR}"/opcache.ini
244 - dosym "../ext/opcache.ini" \
245 - "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini"
246 - fi
247 -
248 - # SAPI-specific handling
249 - if [[ "${sapi}" == "fpm" ]] ; then
250 - einfo "Installing FPM config files php-fpm.conf and www.conf"
251 - insinto "${PHP_INI_DIR#${EPREFIX}}"
252 - doins sapi/fpm/php-fpm.conf
253 - insinto "${PHP_INI_DIR#${EPREFIX}}/fpm.d"
254 - doins sapi/fpm/www.conf
255 - fi
256 -
257 - dodoc php.ini-{development,production}
258 -}
259 -
260 -php_set_ini_dir() {
261 - PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}"
262 - PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
263 - PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
264 -}
265 -
266 -src_prepare() {
267 - default
268 -
269 - # In php-7.x, the FPM pool configuration files have been split off
270 - # of the main config. By default the pool config files go in
271 - # e.g. /etc/php-fpm.d, which isn't slotted. So here we move the
272 - # include directory to a subdirectory "fpm.d" of $PHP_INI_DIR. Later
273 - # we'll install the pool configuration file "www.conf" there.
274 - php_set_ini_dir fpm
275 - sed -i "s~^include=.*$~include=${PHP_INI_DIR}/fpm.d/*.conf~" \
276 - sapi/fpm/php-fpm.conf.in \
277 - || die 'failed to move the include directory in php-fpm.conf'
278 -
279 - # Bug 669566 - necessary so that build tools are updated for commands like pecl
280 - # Force rebuilding aclocal.m4
281 - rm -f aclocal.m4 || die "failed to remove aclocal.m4 in src_prepare"
282 - eautoreconf
283 -}
284 -
285 -src_configure() {
286 - addpredict /usr/share/snmp/mibs/.index #nowarn
287 - addpredict /var/lib/net-snmp/mib_indexes #nowarn
288 -
289 - PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
290 -
291 - # The php-fpm config file wants localstatedir to be ${EPREFIX}/var
292 - # and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002.
293 - local our_conf=(
294 - --prefix="${PHP_DESTDIR}"
295 - --mandir="${PHP_DESTDIR}/man"
296 - --infodir="${PHP_DESTDIR}/info"
297 - --libdir="${PHP_DESTDIR}/lib"
298 - --with-libdir="$(get_libdir)"
299 - --localstatedir="${EPREFIX}/var"
300 - --without-pear
301 - $(use_enable threads maintainer-zts)
302 - )
303 -
304 - our_conf+=(
305 - $(use_with argon2 password-argon2 "${EPREFIX}/usr")
306 - $(use_enable bcmath bcmath)
307 - $(use_with bzip2 bz2 "${EPREFIX}/usr")
308 - $(use_enable calendar calendar)
309 - $(use_enable coverage gcov)
310 - $(use_enable ctype ctype)
311 - $(use_with curl curl "${EPREFIX}/usr")
312 - $(use_enable xml dom)
313 - $(use_with enchant enchant "${EPREFIX}/usr")
314 - $(use_enable exif exif)
315 - $(use_enable fileinfo fileinfo)
316 - $(use_enable filter filter)
317 - $(use_enable ftp ftp)
318 - $(use_with nls gettext "${EPREFIX}/usr")
319 - $(use_with gmp gmp "${EPREFIX}/usr")
320 - $(use_enable hash hash)
321 - $(use_with mhash mhash "${EPREFIX}/usr")
322 - $(use_with iconv iconv \
323 - $(use elibc_glibc || use elibc_musl || use elibc_FreeBSD || echo "${EPREFIX}/usr"))
324 - $(use_enable intl intl)
325 - $(use_enable ipv6 ipv6)
326 - $(use_enable json json)
327 - $(use_with kerberos kerberos "${EPREFIX}/usr")
328 - $(use_enable xml libxml)
329 - $(use_with xml libxml-dir "${EPREFIX}/usr")
330 - $(use_enable unicode mbstring)
331 - $(use_with unicode onig "${EPREFIX}/usr")
332 - $(use_with ssl openssl "${EPREFIX}/usr")
333 - $(use_with ssl openssl-dir "${EPREFIX}/usr")
334 - $(use_enable pcntl pcntl)
335 - $(use_enable phar phar)
336 - $(use_enable pdo pdo)
337 - $(use_enable opcache opcache)
338 - $(use_with postgres pgsql "${EPREFIX}/usr")
339 - $(use_enable posix posix)
340 - $(use_with spell pspell "${EPREFIX}/usr")
341 - $(use_with recode recode "${EPREFIX}/usr")
342 - $(use_enable simplexml simplexml)
343 - $(use_enable sharedmem shmop)
344 - $(use_with snmp snmp "${EPREFIX}/usr")
345 - $(use_enable soap soap)
346 - $(use_enable sockets sockets)
347 - $(use_with sodium sodium "${EPREFIX}/usr")
348 - $(use_with sqlite sqlite3 "${EPREFIX}/usr")
349 - $(use_enable sysvipc sysvmsg)
350 - $(use_enable sysvipc sysvsem)
351 - $(use_enable sysvipc sysvshm)
352 - $(use_with tidy tidy "${EPREFIX}/usr")
353 - $(use_enable tokenizer tokenizer)
354 - $(use_enable wddx wddx)
355 - $(use_enable xml xml)
356 - $(use_enable xmlreader xmlreader)
357 - $(use_enable xmlwriter xmlwriter)
358 - $(use_with xmlrpc xmlrpc)
359 - $(use_with xslt xsl "${EPREFIX}/usr")
360 - $(use_enable zip zip)
361 - $(use_with zip-encryption libzip "${EPREFIX}/usr")
362 - $(use_with zlib zlib "${EPREFIX}/usr")
363 - $(use_enable debug debug)
364 - )
365 -
366 - # DBA support
367 - if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
368 - || use qdbm || use lmdb || use tokyocabinet ; then
369 - our_conf+=( "--enable-dba${shared}" )
370 - fi
371 -
372 - # DBA drivers support
373 - our_conf+=(
374 - $(use_with cdb cdb)
375 - $(use_with berkdb db4 "${EPREFIX}/usr")
376 - $(use_enable flatfile flatfile)
377 - $(use_with gdbm gdbm "${EPREFIX}/usr")
378 - $(use_enable inifile inifile)
379 - $(use_with qdbm qdbm "${EPREFIX}/usr")
380 - $(use_with lmdb lmdb "${EPREFIX}/usr")
381 - )
382 -
383 - # Support for the GD graphics library
384 - our_conf+=(
385 - $(use_with truetype freetype-dir "${EPREFIX}/usr")
386 - $(use_enable cjk gd-jis-conv)
387 - $(use_with gd jpeg-dir "${EPREFIX}/usr")
388 - $(use_with gd png-dir "${EPREFIX}/usr")
389 - $(use_with xpm xpm-dir "${EPREFIX}/usr")
390 - )
391 - if use webp; then
392 - our_conf+=( --with-webp-dir="${EPREFIX}/usr" )
393 - fi
394 - # enable gd last, so configure can pick up the previous settings
395 - our_conf+=( $(use_with gd gd) )
396 -
397 - # IMAP support
398 - if use imap ; then
399 - our_conf+=(
400 - $(use_with imap imap "${EPREFIX}/usr")
401 - $(use_with ssl imap-ssl "${EPREFIX}/usr")
402 - )
403 - fi
404 -
405 - # Interbase/firebird support
406 - our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") )
407 -
408 - # LDAP support
409 - if use ldap ; then
410 - our_conf+=(
411 - $(use_with ldap ldap "${EPREFIX}/usr")
412 - $(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr")
413 - )
414 - fi
415 -
416 - # MySQL support
417 - local mysqllib="mysqlnd"
418 - local mysqlilib="mysqlnd"
419 -
420 - our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
421 -
422 - local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock"
423 - if use mysql || use mysqli ; then
424 - our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") )
425 - fi
426 -
427 - # ODBC support
428 - our_conf+=(
429 - $(use_with odbc unixODBC "${EPREFIX}/usr")
430 - $(use_with iodbc iodbc "${EPREFIX}/usr")
431 - )
432 -
433 - # Oracle support
434 - our_conf+=( $(use_with oci8-instant-client oci8) )
435 -
436 - # PDO support
437 - if use pdo ; then
438 - our_conf+=(
439 - $(use_with mssql pdo-dblib "${EPREFIX}/usr")
440 - $(use_with mysql pdo-mysql "${mysqllib}")
441 - $(use_with postgres pdo-pgsql)
442 - $(use_with sqlite pdo-sqlite "${EPREFIX}/usr")
443 - $(use_with firebird pdo-firebird "${EPREFIX}/usr")
444 - $(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr")
445 - $(use_with oci8-instant-client pdo-oci)
446 - )
447 - fi
448 -
449 - # readline/libedit support
450 - our_conf+=(
451 - $(use_with readline readline "${EPREFIX}/usr")
452 - $(use_with libedit libedit "${EPREFIX}/usr")
453 - )
454 -
455 - # Session support
456 - if use session ; then
457 - our_conf+=( $(use_with session-mm mm "${EPREFIX}/usr") )
458 - else
459 - our_conf+=( $(use_enable session session) )
460 - fi
461 -
462 - # Use pic for shared modules such as apache2's mod_php
463 - our_conf+=( --with-pic )
464 -
465 - # we use the system copy of pcre
466 - # --with-pcre-regex affects ext/pcre
467 - # --with-pcre-dir affects ext/filter and ext/zip
468 - # --with-pcre-valgrind cannot be enabled with system pcre
469 - # Many arches don't support pcre-jit
470 - our_conf+=(
471 - --with-pcre-regex="${EPREFIX}/usr"
472 - --with-pcre-dir="${EPREFIX}/usr"
473 - --without-pcre-valgrind
474 - --without-pcre-jit
475 - )
476 -
477 - # Catch CFLAGS problems
478 - # Fixes bug #14067.
479 - # Changed order to run it in reverse for bug #32022 and #12021.
480 - replace-cpu-flags "k6*" "i586"
481 -
482 - # Cache the ./configure test results between SAPIs.
483 - our_conf+=( --cache-file="${T}/config.cache" )
484 -
485 - # Support user-passed configuration parameters
486 - our_conf+=( ${EXTRA_ECONF:-} )
487 -
488 - # Support the Apache2 extras, they must be set globally for all
489 - # SAPIs to work correctly, especially for external PHP extensions
490 -
491 - local one_sapi
492 - local sapi
493 - mkdir -p "${WORKDIR}/sapis-build" || die
494 - for one_sapi in $SAPIS ; do
495 - use "${one_sapi}" || continue
496 - php_set_ini_dir "${one_sapi}"
497 -
498 - # The BUILD_DIR variable is used to determine where to output
499 - # the files that autotools creates. This was all originally
500 - # based on the autotools-utils eclass.
501 - BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}"
502 - cp -a "${S}" "${BUILD_DIR}" || die
503 - cd "${BUILD_DIR}" || die
504 -
505 - local sapi_conf=(
506 - --with-config-file-path="${PHP_INI_DIR}"
507 - --with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}"
508 - )
509 -
510 - for sapi in $SAPIS ; do
511 - case "$sapi" in
512 - cli|cgi|embed|fpm|phpdbg)
513 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
514 - sapi_conf+=( "--enable-${sapi}" )
515 - if [[ "fpm" == "${sapi}" ]] ; then
516 - sapi_conf+=(
517 - $(use_with acl fpm-acl)
518 - $(use_with systemd fpm-systemd)
519 - )
520 - fi
521 - else
522 - sapi_conf+=( "--disable-${sapi}" )
523 - fi
524 - ;;
525 -
526 - apache2)
527 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
528 - sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" )
529 - else
530 - sapi_conf+=( --without-apxs2 )
531 - fi
532 - ;;
533 - esac
534 - done
535 -
536 - # Construct the $myeconfargs array by concatenating $our_conf
537 - # (the common args) and $sapi_conf (the SAPI-specific args).
538 - local myeconfargs=( "${our_conf[@]}" )
539 - myeconfargs+=( "${sapi_conf[@]}" )
540 -
541 - pushd "${BUILD_DIR}" > /dev/null || die
542 - econf "${myeconfargs[@]}"
543 - popd > /dev/null || die
544 - done
545 -}
546 -
547 -src_compile() {
548 - # snmp seems to run during src_compile, too (bug #324739)
549 - addpredict /usr/share/snmp/mibs/.index #nowarn
550 - addpredict /var/lib/net-snmp/mib_indexes #nowarn
551 -
552 - local sapi
553 - for sapi in ${SAPIS} ; do
554 - if use "${sapi}"; then
555 - cd "${WORKDIR}/sapis-build/$sapi" || \
556 - die "Failed to change dir to ${WORKDIR}/sapis-build/$1"
557 - emake
558 - fi
559 - done
560 -}
561 -
562 -src_install() {
563 - # see bug #324739 for what happens when we don't have that
564 - addpredict /usr/share/snmp/mibs/.index #nowarn
565 -
566 - # grab the first SAPI that got built and install common files from there
567 - local first_sapi="",sapi=""
568 - for sapi in $SAPIS ; do
569 - if use $sapi ; then
570 - first_sapi=$sapi
571 - break
572 - fi
573 - done
574 -
575 - # Makefile forgets to create this before trying to write to it...
576 - dodir "${PHP_DESTDIR#${EPREFIX}}/bin"
577 -
578 - # Install php environment (without any sapis)
579 - cd "${WORKDIR}/sapis-build/$first_sapi" || die
580 - emake INSTALL_ROOT="${D}" \
581 - install-build install-headers install-programs
582 -
583 - local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)"
584 -
585 - # Create the directory where we'll put version-specific php scripts
586 - keepdir "/usr/share/php${PHP_MV}"
587 -
588 - local file=""
589 - local sapi_list=""
590 -
591 - for sapi in ${SAPIS}; do
592 - if use "${sapi}" ; then
593 - einfo "Installing SAPI: ${sapi}"
594 - cd "${WORKDIR}/sapis-build/${sapi}" || die
595 -
596 - if [[ "${sapi}" == "apache2" ]] ; then
597 - # We're specifically not using emake install-sapi as libtool
598 - # may cause unnecessary relink failures (see bug #351266)
599 - insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/"
600 - newins ".libs/libphp${PHP_MV}$(get_libname)" \
601 - "libphp${PHP_MV}$(get_libname)"
602 - keepdir "/usr/$(get_libdir)/apache2/modules"
603 - else
604 - # needed each time, php_install_ini would reset it
605 - local dest="${PHP_DESTDIR#${EPREFIX}}"
606 - into "${dest}"
607 - case "$sapi" in
608 - cli)
609 - source="sapi/cli/php"
610 - # Install the "phar" archive utility.
611 - if use phar ; then
612 - emake INSTALL_ROOT="${D}" install-pharcmd
613 - dosym "..${dest#/usr}/bin/phar" "/usr/bin/phar${SLOT}"
614 - fi
615 - ;;
616 - cgi)
617 - source="sapi/cgi/php-cgi"
618 - ;;
619 - fpm)
620 - source="sapi/fpm/php-fpm"
621 - ;;
622 - embed)
623 - source="libs/libphp${PHP_MV}$(get_libname)"
624 - ;;
625 - phpdbg)
626 - source="sapi/phpdbg/phpdbg"
627 - ;;
628 - *)
629 - die "unhandled sapi in src_install"
630 - ;;
631 - esac
632 -
633 - if [[ "${source}" == *"$(get_libname)" ]]; then
634 - dolib.so "${source}"
635 - else
636 - dobin "${source}"
637 - local name="$(basename ${source})"
638 - dosym "..${dest#/usr}/bin/${name}" "/usr/bin/${name}${SLOT}"
639 - fi
640 - fi
641 -
642 - php_install_ini "${sapi}"
643 -
644 - # construct correct SAPI string for php-config
645 - # thanks to ferringb for the bash voodoo
646 - if [[ "${sapi}" == "apache2" ]]; then
647 - sapi_list="${sapi_list:+${sapi_list} }apache2handler"
648 - else
649 - sapi_list="${sapi_list:+${sapi_list} }${sapi}"
650 - fi
651 - fi
652 - done
653 -
654 - # Installing opcache module
655 - if use opcache ; then
656 - into "${PHP_DESTDIR#${EPREFIX}}"
657 - dolib.so "modules/opcache$(get_libname)"
658 - fi
659 -
660 - # Install env.d files
661 - newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}"
662 - sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
663 - sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
664 -
665 - # set php-config variable correctly (bug #278439)
666 - sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \
667 - "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die
668 -
669 - if use fpm ; then
670 - if use systemd; then
671 - systemd_newunit "${FILESDIR}/php-fpm_at.service" \
672 - "php-fpm@${SLOT}.service"
673 - else
674 - systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \
675 - "php-fpm@${SLOT}.service"
676 - fi
677 - fi
678 -}
679 -
680 -src_test() {
681 - echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
682 - PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
683 - if [[ ! -x "${PHP_BIN}" ]] ; then
684 - ewarn "Test phase requires USE=cli, skipping"
685 - return
686 - else
687 - export TEST_PHP_EXECUTABLE="${PHP_BIN}"
688 - fi
689 -
690 - if [[ -x "${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" ]] ; then
691 - export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi"
692 - fi
693 -
694 - if [[ -x "${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" ]] ; then
695 - export TEST_PHPDBG_EXECUTABLE="${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg"
696 - fi
697 -
698 - REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \
699 - "session.save_path=${T}" \
700 - "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \
701 - "session.save_path=${T}"
702 -
703 - for name in ${EXPECTED_TEST_FAILURES}; do
704 - mv "${name}.out" "${name}.out.orig" 2>/dev/null || die
705 - done
706 -
707 - local failed="$(find -name '*.out')"
708 - if [[ ${failed} != "" ]] ; then
709 - ewarn "The following test cases failed unexpectedly:"
710 - for name in ${failed}; do
711 - ewarn " ${name/.out/}"
712 - done
713 - else
714 - einfo "No unexpected test failures, all fine"
715 - fi
716 -
717 - if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
718 - local passed=""
719 - for name in ${EXPECTED_TEST_FAILURES}; do
720 - [[ -f "${name}.diff" ]] && continue
721 - passed="${passed} ${name}"
722 - done
723 - if [[ ${passed} != "" ]] ; then
724 - einfo "The following test cases passed unexpectedly:"
725 - for name in ${passed}; do
726 - ewarn " ${passed}"
727 - done
728 - else
729 - einfo "None of the known-to-fail tests passed, all fine"
730 - fi
731 - fi
732 -}
733 -
734 -pkg_postinst() {
735 - # Output some general info to the user
736 - if use apache2 ; then
737 - elog
738 - elog "To enable PHP in apache, you will need to add \"-D PHP\" to"
739 - elog "your apache2 command. OpenRC users can append that string to"
740 - elog "APACHE2_OPTS in /etc/conf.d/apache2."
741 - elog
742 - elog "The apache module configuration file 70_mod_php.conf is"
743 - elog "provided (and maintained) by eselect-php."
744 - elog
745 - fi
746 -
747 - # Create the symlinks for php
748 - local m
749 - for m in ${SAPIS}; do
750 - [[ ${m} == 'embed' ]] && continue;
751 - if use $m ; then
752 - local ci=$(eselect php show $m)
753 - if [[ -z $ci ]]; then
754 - eselect php set $m php${SLOT} || die
755 - einfo "Switched ${m} to use php:${SLOT}"
756 - einfo
757 - elif [[ $ci != "php${SLOT}" ]] ; then
758 - elog "To switch $m to use php:${SLOT}, run"
759 - elog " eselect php set $m php${SLOT}"
760 - elog
761 - fi
762 - fi
763 - done
764 -
765 - # Remove dead symlinks for SAPIs that were just disabled. For
766 - # example, if the user has the cgi SAPI enabled, then he has an
767 - # eselect-php symlink for it. If he later reinstalls PHP with
768 - # USE="-cgi", that symlink will break. This call to eselect is
769 - # supposed to remove that dead link per bug 572436.
770 - eselect php cleanup || die
771 -
772 - if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then
773 - elog "To build extensions for this version of PHP, you will need to"
774 - elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable."
775 - elog
776 - fi
777 -
778 - # Warn about the removal of PHP_INI_VERSION if the user has it set.
779 - if [[ -n "${PHP_INI_VERSION}" ]]; then
780 - ewarn 'The PHP_INI_VERSION variable has been phased out. You may'
781 - ewarn 'remove it from your configuration at your convenience. See'
782 - ewarn
783 - ewarn ' https://bugs.gentoo.org/611214'
784 - ewarn
785 - ewarn 'for more information.'
786 - fi
787 -
788 - elog "For details on how version slotting works, please see"
789 - elog "the wiki:"
790 - elog
791 - elog " https://wiki.gentoo.org/wiki/PHP"
792 - elog
793 -}
794 -
795 -pkg_postrm() {
796 - # This serves two purposes. First, if we have just removed the last
797 - # installed version of PHP, then this will remove any dead symlinks
798 - # belonging to eselect-php. Second, if a user upgrades slots from
799 - # (say) 5.6 to 7.0 and depcleans the old slot, then this will update
800 - # his existing symlinks to point to the new 7.0 installation. The
801 - # latter is bug 432962.
802 - #
803 - # Note: the eselect-php package may not be installed at this point,
804 - # so we can't die() if this command fails.
805 - eselect php cleanup
806 -}
807
808 diff --git a/dev-lang/php/php-7.2.32.ebuild b/dev-lang/php/php-7.2.32.ebuild
809 deleted file mode 100644
810 index 20ab7418c2a..00000000000
811 --- a/dev-lang/php/php-7.2.32.ebuild
812 +++ /dev/null
813 @@ -1,759 +0,0 @@
814 -# Copyright 1999-2020 Gentoo Authors
815 -# Distributed under the terms of the GNU General Public License v2
816 -
817 -EAPI="7"
818 -
819 -inherit flag-o-matic systemd autotools
820 -
821 -DESCRIPTION="The PHP language runtime engine"
822 -HOMEPAGE="https://www.php.net/"
823 -SRC_URI="https://www.php.net/distributions/${P}.tar.xz"
824 -
825 -LICENSE="PHP-3.01
826 - BSD
827 - Zend-2.0
828 - bcmath? ( LGPL-2.1+ )
829 - fpm? ( BSD-2 )
830 - gd? ( gd )
831 - unicode? ( BSD-2 LGPL-2.1 )"
832 -
833 -SLOT="$(ver_cut 1-2)"
834 -KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
835 -
836 -# We can build the following SAPIs in the given order
837 -SAPIS="embed cli cgi fpm apache2 phpdbg"
838 -
839 -# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
840 -IUSE="${IUSE}
841 - ${SAPIS/cli/+cli}
842 - threads"
843 -
844 -IUSE="${IUSE} acl argon2 bcmath berkdb bzip2 calendar cdb cjk
845 - coverage +ctype curl debug
846 - enchant exif +fileinfo +filter firebird
847 - +flatfile ftp gd gdbm gmp +hash +iconv imap inifile
848 - intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl lmdb
849 - mhash mssql mysql mysqli nls
850 - oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
851 - readline recode selinux +session session-mm sharedmem
852 - +simplexml snmp soap sockets sodium spell sqlite ssl
853 - sysvipc systemd test tidy +tokenizer tokyocabinet truetype unicode wddx webp
854 - +xml xmlreader xmlwriter xmlrpc xpm xslt zip zip-encryption zlib"
855 -
856 -# The supported (that is, autodetected) versions of BDB are listed in
857 -# the ./configure script. Other versions *work*, but we need to stick to
858 -# the ones that can be detected to avoid a repeat of bug #564824.
859 -COMMON_DEPEND="
860 - >=app-eselect/eselect-php-0.9.1[apache2?,fpm?]
861 - >=dev-libs/libpcre-8.32[unicode]
862 - fpm? ( acl? ( sys-apps/acl ) )
863 - apache2? ( www-servers/apache[apache2_modules_unixd(+),threads=] )
864 - argon2? ( app-crypt/argon2:= )
865 - berkdb? ( || ( sys-libs/db:5.3
866 - sys-libs/db:5.1
867 - sys-libs/db:4.8
868 - sys-libs/db:4.7
869 - sys-libs/db:4.6
870 - sys-libs/db:4.5 ) )
871 - bzip2? ( app-arch/bzip2:0= )
872 - cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
873 - coverage? ( dev-util/lcov )
874 - curl? ( >=net-misc/curl-7.10.5 )
875 - enchant? ( <app-text/enchant-2.0:0 )
876 - firebird? ( dev-db/firebird )
877 - gd? ( >=virtual/jpeg-0-r3:0 media-libs/libpng:0= sys-libs/zlib )
878 - gdbm? ( >=sys-libs/gdbm-1.8.0:0= )
879 - gmp? ( dev-libs/gmp:0= )
880 - iconv? ( virtual/libiconv )
881 - imap? ( >=virtual/imap-c-client-2[kerberos=,ssl=] )
882 - intl? ( dev-libs/icu:= )
883 - iodbc? ( dev-db/libiodbc )
884 - kerberos? ( virtual/krb5 )
885 - ldap? ( >=net-nds/openldap-1.2.11 )
886 - ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 )
887 - libedit? ( dev-libs/libedit )
888 - lmdb? ( dev-db/lmdb:= )
889 - mssql? ( dev-db/freetds[mssql] )
890 - nls? ( sys-devel/gettext )
891 - oci8-instant-client? ( dev-db/oracle-instantclient-basic )
892 - odbc? ( >=dev-db/unixODBC-1.8.13 )
893 - postgres? ( dev-db/postgresql:* )
894 - qdbm? ( dev-db/qdbm )
895 - readline? ( sys-libs/readline:0= )
896 - recode? ( app-text/recode )
897 - session-mm? ( dev-libs/mm )
898 - simplexml? ( >=dev-libs/libxml2-2.6.8 )
899 - snmp? ( >=net-analyzer/net-snmp-5.2 )
900 - soap? ( >=dev-libs/libxml2-2.6.8 )
901 - sodium? ( dev-libs/libsodium:= )
902 - spell? ( >=app-text/aspell-0.50 )
903 - sqlite? ( >=dev-db/sqlite-3.7.6.3 )
904 - ssl? (
905 - !libressl? ( dev-libs/openssl:0= )
906 - libressl? ( dev-libs/libressl:0= )
907 - )
908 - tidy? ( || ( app-text/tidy-html5 app-text/htmltidy ) )
909 - tokyocabinet? ( dev-db/tokyocabinet )
910 - truetype? ( =media-libs/freetype-2* )
911 - unicode? ( dev-libs/oniguruma:= )
912 - wddx? ( >=dev-libs/libxml2-2.6.8 )
913 - webp? ( media-libs/libwebp:0= )
914 - xml? ( >=dev-libs/libxml2-2.6.8 )
915 - xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
916 - xmlreader? ( >=dev-libs/libxml2-2.6.8 )
917 - xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
918 - xpm? ( x11-libs/libXpm )
919 - xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
920 - zip? ( sys-libs/zlib:0= )
921 - zip-encryption? ( >=dev-libs/libzip-1.2.0:= )
922 - zlib? ( sys-libs/zlib:0= )
923 -"
924 -
925 -RDEPEND="${COMMON_DEPEND}
926 - virtual/mta
927 - fpm? (
928 - selinux? ( sec-policy/selinux-phpfpm )
929 - systemd? ( sys-apps/systemd ) )"
930 -
931 -# Bison isn't actually needed when building from a release tarball
932 -# However, the configure script will warn if it's absent or if you
933 -# have an incompatible version installed. See bug 593278.
934 -DEPEND="${COMMON_DEPEND}
935 - app-arch/xz-utils
936 - >=sys-devel/bison-3.0.1"
937 -
938 -BDEPEND="virtual/pkgconfig"
939 -
940 -# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
941 -REQUIRED_USE="
942 - || ( cli cgi fpm apache2 embed phpdbg )
943 - cli? ( ^^ ( readline libedit ) )
944 - truetype? ( gd zlib )
945 - webp? ( gd zlib )
946 - cjk? ( gd zlib )
947 - exif? ( gd zlib )
948 - xpm? ( gd zlib )
949 - gd? ( zlib )
950 - simplexml? ( xml )
951 - soap? ( xml )
952 - wddx? ( xml )
953 - xmlrpc? ( || ( xml iconv ) )
954 - xmlreader? ( xml )
955 - xslt? ( xml )
956 - ldap-sasl? ( ldap )
957 - mhash? ( hash )
958 - phar? ( hash )
959 - qdbm? ( !gdbm )
960 - readline? ( !libedit )
961 - recode? ( !imap !mysqli !mysql )
962 - session-mm? ( session !threads )
963 - mysql? ( hash || ( mysqli pdo ) )
964 - mysqli? ( hash )
965 - zip-encryption? ( zip )
966 -"
967 -
968 -RESTRICT="!test? ( test )"
969 -
970 -PATCHES=(
971 - "${FILESDIR}/php-freetype-2.9.1.patch"
972 - "${FILESDIR}/php-7.2.13-intl-use-icu-namespace.patch"
973 -)
974 -
975 -PHP_MV="$(ver_cut 1)"
976 -
977 -php_install_ini() {
978 - local phpsapi="${1}"
979 -
980 - # work out where we are installing the ini file
981 - php_set_ini_dir "${phpsapi}"
982 -
983 - # Always install the production INI file, bug 611214.
984 - local phpinisrc="php.ini-production-${phpsapi}"
985 - cp php.ini-production "${phpinisrc}" || die
986 -
987 - # default to /tmp for save_path, bug #282768
988 - sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die
989 -
990 - # Set the extension dir
991 - sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \
992 - -i "${phpinisrc}" || die
993 -
994 - # Set the include path to point to where we want to find PEAR packages
995 - sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die
996 -
997 - insinto "${PHP_INI_DIR#${EPREFIX}}"
998 - newins "${phpinisrc}" php.ini
999 -
1000 - elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}"
1001 - elog
1002 -
1003 - dodir "${PHP_EXT_INI_DIR#${EPREFIX}}"
1004 - dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}"
1005 -
1006 - if use opcache; then
1007 - elog "Adding opcache to $PHP_EXT_INI_DIR"
1008 - echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \
1009 - "${D}/${PHP_EXT_INI_DIR}"/opcache.ini
1010 - dosym "../ext/opcache.ini" \
1011 - "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini"
1012 - fi
1013 -
1014 - # SAPI-specific handling
1015 - if [[ "${sapi}" == "fpm" ]] ; then
1016 - einfo "Installing FPM config files php-fpm.conf and www.conf"
1017 - insinto "${PHP_INI_DIR#${EPREFIX}}"
1018 - doins sapi/fpm/php-fpm.conf
1019 - insinto "${PHP_INI_DIR#${EPREFIX}}/fpm.d"
1020 - doins sapi/fpm/www.conf
1021 - fi
1022 -
1023 - dodoc php.ini-{development,production}
1024 -}
1025 -
1026 -php_set_ini_dir() {
1027 - PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}"
1028 - PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
1029 - PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
1030 -}
1031 -
1032 -src_prepare() {
1033 - default
1034 -
1035 - # In php-7.x, the FPM pool configuration files have been split off
1036 - # of the main config. By default the pool config files go in
1037 - # e.g. /etc/php-fpm.d, which isn't slotted. So here we move the
1038 - # include directory to a subdirectory "fpm.d" of $PHP_INI_DIR. Later
1039 - # we'll install the pool configuration file "www.conf" there.
1040 - php_set_ini_dir fpm
1041 - sed -i "s~^include=.*$~include=${PHP_INI_DIR}/fpm.d/*.conf~" \
1042 - sapi/fpm/php-fpm.conf.in \
1043 - || die 'failed to move the include directory in php-fpm.conf'
1044 -
1045 - # Bug 669566 - necessary so that build tools are updated for commands like pecl
1046 - # Force rebuilding aclocal.m4
1047 - rm -f aclocal.m4 || die "failed to remove aclocal.m4 in src_prepare"
1048 - eautoreconf
1049 -}
1050 -
1051 -src_configure() {
1052 - addpredict /usr/share/snmp/mibs/.index #nowarn
1053 - addpredict /var/lib/net-snmp/mib_indexes #nowarn
1054 -
1055 - PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
1056 -
1057 - # The php-fpm config file wants localstatedir to be ${EPREFIX}/var
1058 - # and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002.
1059 - local our_conf=(
1060 - --prefix="${PHP_DESTDIR}"
1061 - --mandir="${PHP_DESTDIR}/man"
1062 - --infodir="${PHP_DESTDIR}/info"
1063 - --libdir="${PHP_DESTDIR}/lib"
1064 - --with-libdir="$(get_libdir)"
1065 - --localstatedir="${EPREFIX}/var"
1066 - --without-pear
1067 - $(use_enable threads maintainer-zts)
1068 - )
1069 -
1070 - our_conf+=(
1071 - $(use_with argon2 password-argon2 "${EPREFIX}/usr")
1072 - $(use_enable bcmath bcmath)
1073 - $(use_with bzip2 bz2 "${EPREFIX}/usr")
1074 - $(use_enable calendar calendar)
1075 - $(use_enable coverage gcov)
1076 - $(use_enable ctype ctype)
1077 - $(use_with curl curl "${EPREFIX}/usr")
1078 - $(use_enable xml dom)
1079 - $(use_with enchant enchant "${EPREFIX}/usr")
1080 - $(use_enable exif exif)
1081 - $(use_enable fileinfo fileinfo)
1082 - $(use_enable filter filter)
1083 - $(use_enable ftp ftp)
1084 - $(use_with nls gettext "${EPREFIX}/usr")
1085 - $(use_with gmp gmp "${EPREFIX}/usr")
1086 - $(use_enable hash hash)
1087 - $(use_with mhash mhash "${EPREFIX}/usr")
1088 - $(use_with iconv iconv \
1089 - $(use elibc_glibc || use elibc_musl || use elibc_FreeBSD || echo "${EPREFIX}/usr"))
1090 - $(use_enable intl intl)
1091 - $(use_enable ipv6 ipv6)
1092 - $(use_enable json json)
1093 - $(use_with kerberos kerberos "${EPREFIX}/usr")
1094 - $(use_enable xml libxml)
1095 - $(use_with xml libxml-dir "${EPREFIX}/usr")
1096 - $(use_enable unicode mbstring)
1097 - $(use_with unicode onig "${EPREFIX}/usr")
1098 - $(use_with ssl openssl "${EPREFIX}/usr")
1099 - $(use_with ssl openssl-dir "${EPREFIX}/usr")
1100 - $(use_enable pcntl pcntl)
1101 - $(use_enable phar phar)
1102 - $(use_enable pdo pdo)
1103 - $(use_enable opcache opcache)
1104 - $(use_with postgres pgsql "${EPREFIX}/usr")
1105 - $(use_enable posix posix)
1106 - $(use_with spell pspell "${EPREFIX}/usr")
1107 - $(use_with recode recode "${EPREFIX}/usr")
1108 - $(use_enable simplexml simplexml)
1109 - $(use_enable sharedmem shmop)
1110 - $(use_with snmp snmp "${EPREFIX}/usr")
1111 - $(use_enable soap soap)
1112 - $(use_enable sockets sockets)
1113 - $(use_with sodium sodium "${EPREFIX}/usr")
1114 - $(use_with sqlite sqlite3 "${EPREFIX}/usr")
1115 - $(use_enable sysvipc sysvmsg)
1116 - $(use_enable sysvipc sysvsem)
1117 - $(use_enable sysvipc sysvshm)
1118 - $(use_with tidy tidy "${EPREFIX}/usr")
1119 - $(use_enable tokenizer tokenizer)
1120 - $(use_enable wddx wddx)
1121 - $(use_enable xml xml)
1122 - $(use_enable xmlreader xmlreader)
1123 - $(use_enable xmlwriter xmlwriter)
1124 - $(use_with xmlrpc xmlrpc)
1125 - $(use_with xslt xsl "${EPREFIX}/usr")
1126 - $(use_enable zip zip)
1127 - $(use_with zip-encryption libzip "${EPREFIX}/usr")
1128 - $(use_with zlib zlib "${EPREFIX}/usr")
1129 - $(use_enable debug debug)
1130 - )
1131 -
1132 - # DBA support
1133 - if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
1134 - || use qdbm || use lmdb || use tokyocabinet ; then
1135 - our_conf+=( "--enable-dba${shared}" )
1136 - fi
1137 -
1138 - # DBA drivers support
1139 - our_conf+=(
1140 - $(use_with cdb cdb)
1141 - $(use_with berkdb db4 "${EPREFIX}/usr")
1142 - $(use_enable flatfile flatfile)
1143 - $(use_with gdbm gdbm "${EPREFIX}/usr")
1144 - $(use_enable inifile inifile)
1145 - $(use_with qdbm qdbm "${EPREFIX}/usr")
1146 - $(use_with lmdb lmdb "${EPREFIX}/usr")
1147 - )
1148 -
1149 - # Support for the GD graphics library
1150 - our_conf+=(
1151 - $(use_with truetype freetype-dir "${EPREFIX}/usr")
1152 - $(use_enable cjk gd-jis-conv)
1153 - $(use_with gd jpeg-dir "${EPREFIX}/usr")
1154 - $(use_with gd png-dir "${EPREFIX}/usr")
1155 - $(use_with xpm xpm-dir "${EPREFIX}/usr")
1156 - )
1157 - if use webp; then
1158 - our_conf+=( --with-webp-dir="${EPREFIX}/usr" )
1159 - fi
1160 - # enable gd last, so configure can pick up the previous settings
1161 - our_conf+=( $(use_with gd gd) )
1162 -
1163 - # IMAP support
1164 - if use imap ; then
1165 - our_conf+=(
1166 - $(use_with imap imap "${EPREFIX}/usr")
1167 - $(use_with ssl imap-ssl "${EPREFIX}/usr")
1168 - )
1169 - fi
1170 -
1171 - # Interbase/firebird support
1172 - our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") )
1173 -
1174 - # LDAP support
1175 - if use ldap ; then
1176 - our_conf+=(
1177 - $(use_with ldap ldap "${EPREFIX}/usr")
1178 - $(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr")
1179 - )
1180 - fi
1181 -
1182 - # MySQL support
1183 - local mysqllib="mysqlnd"
1184 - local mysqlilib="mysqlnd"
1185 -
1186 - our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
1187 -
1188 - local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock"
1189 - if use mysql || use mysqli ; then
1190 - our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") )
1191 - fi
1192 -
1193 - # ODBC support
1194 - our_conf+=(
1195 - $(use_with odbc unixODBC "${EPREFIX}/usr")
1196 - $(use_with iodbc iodbc "${EPREFIX}/usr")
1197 - )
1198 -
1199 - # Oracle support
1200 - our_conf+=( $(use_with oci8-instant-client oci8) )
1201 -
1202 - # PDO support
1203 - if use pdo ; then
1204 - our_conf+=(
1205 - $(use_with mssql pdo-dblib "${EPREFIX}/usr")
1206 - $(use_with mysql pdo-mysql "${mysqllib}")
1207 - $(use_with postgres pdo-pgsql)
1208 - $(use_with sqlite pdo-sqlite "${EPREFIX}/usr")
1209 - $(use_with firebird pdo-firebird "${EPREFIX}/usr")
1210 - $(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr")
1211 - $(use_with oci8-instant-client pdo-oci)
1212 - )
1213 - fi
1214 -
1215 - # readline/libedit support
1216 - our_conf+=(
1217 - $(use_with readline readline "${EPREFIX}/usr")
1218 - $(use_with libedit libedit "${EPREFIX}/usr")
1219 - )
1220 -
1221 - # Session support
1222 - if use session ; then
1223 - our_conf+=( $(use_with session-mm mm "${EPREFIX}/usr") )
1224 - else
1225 - our_conf+=( $(use_enable session session) )
1226 - fi
1227 -
1228 - # Use pic for shared modules such as apache2's mod_php
1229 - our_conf+=( --with-pic )
1230 -
1231 - # we use the system copy of pcre
1232 - # --with-pcre-regex affects ext/pcre
1233 - # --with-pcre-dir affects ext/filter and ext/zip
1234 - # --with-pcre-valgrind cannot be enabled with system pcre
1235 - # Many arches don't support pcre-jit
1236 - our_conf+=(
1237 - --with-pcre-regex="${EPREFIX}/usr"
1238 - --with-pcre-dir="${EPREFIX}/usr"
1239 - --without-pcre-valgrind
1240 - --without-pcre-jit
1241 - )
1242 -
1243 - # Catch CFLAGS problems
1244 - # Fixes bug #14067.
1245 - # Changed order to run it in reverse for bug #32022 and #12021.
1246 - replace-cpu-flags "k6*" "i586"
1247 -
1248 - # Cache the ./configure test results between SAPIs.
1249 - our_conf+=( --cache-file="${T}/config.cache" )
1250 -
1251 - # Support user-passed configuration parameters
1252 - our_conf+=( ${EXTRA_ECONF:-} )
1253 -
1254 - # Support the Apache2 extras, they must be set globally for all
1255 - # SAPIs to work correctly, especially for external PHP extensions
1256 -
1257 - local one_sapi
1258 - local sapi
1259 - mkdir -p "${WORKDIR}/sapis-build" || die
1260 - for one_sapi in $SAPIS ; do
1261 - use "${one_sapi}" || continue
1262 - php_set_ini_dir "${one_sapi}"
1263 -
1264 - # The BUILD_DIR variable is used to determine where to output
1265 - # the files that autotools creates. This was all originally
1266 - # based on the autotools-utils eclass.
1267 - BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}"
1268 - cp -a "${S}" "${BUILD_DIR}" || die
1269 - cd "${BUILD_DIR}" || die
1270 -
1271 - local sapi_conf=(
1272 - --with-config-file-path="${PHP_INI_DIR}"
1273 - --with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}"
1274 - )
1275 -
1276 - for sapi in $SAPIS ; do
1277 - case "$sapi" in
1278 - cli|cgi|embed|fpm|phpdbg)
1279 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
1280 - sapi_conf+=( "--enable-${sapi}" )
1281 - if [[ "fpm" == "${sapi}" ]] ; then
1282 - sapi_conf+=(
1283 - $(use_with acl fpm-acl)
1284 - $(use_with systemd fpm-systemd)
1285 - )
1286 - fi
1287 - else
1288 - sapi_conf+=( "--disable-${sapi}" )
1289 - fi
1290 - ;;
1291 -
1292 - apache2)
1293 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
1294 - sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" )
1295 - else
1296 - sapi_conf+=( --without-apxs2 )
1297 - fi
1298 - ;;
1299 - esac
1300 - done
1301 -
1302 - # Construct the $myeconfargs array by concatenating $our_conf
1303 - # (the common args) and $sapi_conf (the SAPI-specific args).
1304 - local myeconfargs=( "${our_conf[@]}" )
1305 - myeconfargs+=( "${sapi_conf[@]}" )
1306 -
1307 - pushd "${BUILD_DIR}" > /dev/null || die
1308 - econf "${myeconfargs[@]}"
1309 - popd > /dev/null || die
1310 - done
1311 -}
1312 -
1313 -src_compile() {
1314 - # snmp seems to run during src_compile, too (bug #324739)
1315 - addpredict /usr/share/snmp/mibs/.index #nowarn
1316 - addpredict /var/lib/net-snmp/mib_indexes #nowarn
1317 -
1318 - local sapi
1319 - for sapi in ${SAPIS} ; do
1320 - if use "${sapi}"; then
1321 - cd "${WORKDIR}/sapis-build/$sapi" || \
1322 - die "Failed to change dir to ${WORKDIR}/sapis-build/$1"
1323 - emake
1324 - fi
1325 - done
1326 -}
1327 -
1328 -src_install() {
1329 - # see bug #324739 for what happens when we don't have that
1330 - addpredict /usr/share/snmp/mibs/.index #nowarn
1331 -
1332 - # grab the first SAPI that got built and install common files from there
1333 - local first_sapi="",sapi=""
1334 - for sapi in $SAPIS ; do
1335 - if use $sapi ; then
1336 - first_sapi=$sapi
1337 - break
1338 - fi
1339 - done
1340 -
1341 - # Makefile forgets to create this before trying to write to it...
1342 - dodir "${PHP_DESTDIR#${EPREFIX}}/bin"
1343 -
1344 - # Install php environment (without any sapis)
1345 - cd "${WORKDIR}/sapis-build/$first_sapi" || die
1346 - emake INSTALL_ROOT="${D}" \
1347 - install-build install-headers install-programs
1348 -
1349 - local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)"
1350 -
1351 - # Create the directory where we'll put version-specific php scripts
1352 - keepdir "/usr/share/php${PHP_MV}"
1353 -
1354 - local file=""
1355 - local sapi_list=""
1356 -
1357 - for sapi in ${SAPIS}; do
1358 - if use "${sapi}" ; then
1359 - einfo "Installing SAPI: ${sapi}"
1360 - cd "${WORKDIR}/sapis-build/${sapi}" || die
1361 -
1362 - if [[ "${sapi}" == "apache2" ]] ; then
1363 - # We're specifically not using emake install-sapi as libtool
1364 - # may cause unnecessary relink failures (see bug #351266)
1365 - insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/"
1366 - newins ".libs/libphp${PHP_MV}$(get_libname)" \
1367 - "libphp${PHP_MV}$(get_libname)"
1368 - keepdir "/usr/$(get_libdir)/apache2/modules"
1369 - else
1370 - # needed each time, php_install_ini would reset it
1371 - local dest="${PHP_DESTDIR#${EPREFIX}}"
1372 - into "${dest}"
1373 - case "$sapi" in
1374 - cli)
1375 - source="sapi/cli/php"
1376 - # Install the "phar" archive utility.
1377 - if use phar ; then
1378 - emake INSTALL_ROOT="${D}" install-pharcmd
1379 - dosym "..${dest#/usr}/bin/phar" "/usr/bin/phar${SLOT}"
1380 - fi
1381 - ;;
1382 - cgi)
1383 - source="sapi/cgi/php-cgi"
1384 - ;;
1385 - fpm)
1386 - source="sapi/fpm/php-fpm"
1387 - ;;
1388 - embed)
1389 - source="libs/libphp${PHP_MV}$(get_libname)"
1390 - ;;
1391 - phpdbg)
1392 - source="sapi/phpdbg/phpdbg"
1393 - ;;
1394 - *)
1395 - die "unhandled sapi in src_install"
1396 - ;;
1397 - esac
1398 -
1399 - if [[ "${source}" == *"$(get_libname)" ]]; then
1400 - dolib.so "${source}"
1401 - else
1402 - dobin "${source}"
1403 - local name="$(basename ${source})"
1404 - dosym "..${dest#/usr}/bin/${name}" "/usr/bin/${name}${SLOT}"
1405 - fi
1406 - fi
1407 -
1408 - php_install_ini "${sapi}"
1409 -
1410 - # construct correct SAPI string for php-config
1411 - # thanks to ferringb for the bash voodoo
1412 - if [[ "${sapi}" == "apache2" ]]; then
1413 - sapi_list="${sapi_list:+${sapi_list} }apache2handler"
1414 - else
1415 - sapi_list="${sapi_list:+${sapi_list} }${sapi}"
1416 - fi
1417 - fi
1418 - done
1419 -
1420 - # Installing opcache module
1421 - if use opcache ; then
1422 - into "${PHP_DESTDIR#${EPREFIX}}"
1423 - dolib.so "modules/opcache$(get_libname)"
1424 - fi
1425 -
1426 - # Install env.d files
1427 - newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}"
1428 - sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
1429 - sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
1430 -
1431 - # set php-config variable correctly (bug #278439)
1432 - sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \
1433 - "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die
1434 -
1435 - if use fpm ; then
1436 - if use systemd; then
1437 - systemd_newunit "${FILESDIR}/php-fpm_at.service" \
1438 - "php-fpm@${SLOT}.service"
1439 - else
1440 - systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \
1441 - "php-fpm@${SLOT}.service"
1442 - fi
1443 - fi
1444 -}
1445 -
1446 -src_test() {
1447 - echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
1448 - PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
1449 - if [[ ! -x "${PHP_BIN}" ]] ; then
1450 - ewarn "Test phase requires USE=cli, skipping"
1451 - return
1452 - else
1453 - export TEST_PHP_EXECUTABLE="${PHP_BIN}"
1454 - fi
1455 -
1456 - if [[ -x "${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" ]] ; then
1457 - export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi"
1458 - fi
1459 -
1460 - if [[ -x "${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" ]] ; then
1461 - export TEST_PHPDBG_EXECUTABLE="${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg"
1462 - fi
1463 -
1464 - REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \
1465 - "session.save_path=${T}" \
1466 - "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \
1467 - "session.save_path=${T}"
1468 -
1469 - for name in ${EXPECTED_TEST_FAILURES}; do
1470 - mv "${name}.out" "${name}.out.orig" 2>/dev/null || die
1471 - done
1472 -
1473 - local failed="$(find -name '*.out')"
1474 - if [[ ${failed} != "" ]] ; then
1475 - ewarn "The following test cases failed unexpectedly:"
1476 - for name in ${failed}; do
1477 - ewarn " ${name/.out/}"
1478 - done
1479 - else
1480 - einfo "No unexpected test failures, all fine"
1481 - fi
1482 -
1483 - if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
1484 - local passed=""
1485 - for name in ${EXPECTED_TEST_FAILURES}; do
1486 - [[ -f "${name}.diff" ]] && continue
1487 - passed="${passed} ${name}"
1488 - done
1489 - if [[ ${passed} != "" ]] ; then
1490 - einfo "The following test cases passed unexpectedly:"
1491 - for name in ${passed}; do
1492 - ewarn " ${passed}"
1493 - done
1494 - else
1495 - einfo "None of the known-to-fail tests passed, all fine"
1496 - fi
1497 - fi
1498 -}
1499 -
1500 -pkg_postinst() {
1501 - # Output some general info to the user
1502 - if use apache2 ; then
1503 - elog
1504 - elog "To enable PHP in apache, you will need to add \"-D PHP\" to"
1505 - elog "your apache2 command. OpenRC users can append that string to"
1506 - elog "APACHE2_OPTS in /etc/conf.d/apache2."
1507 - elog
1508 - elog "The apache module configuration file 70_mod_php.conf is"
1509 - elog "provided (and maintained) by eselect-php."
1510 - elog
1511 - fi
1512 -
1513 - # Create the symlinks for php
1514 - local m
1515 - for m in ${SAPIS}; do
1516 - [[ ${m} == 'embed' ]] && continue;
1517 - if use $m ; then
1518 - local ci=$(eselect php show $m)
1519 - if [[ -z $ci ]]; then
1520 - eselect php set $m php${SLOT} || die
1521 - einfo "Switched ${m} to use php:${SLOT}"
1522 - einfo
1523 - elif [[ $ci != "php${SLOT}" ]] ; then
1524 - elog "To switch $m to use php:${SLOT}, run"
1525 - elog " eselect php set $m php${SLOT}"
1526 - elog
1527 - fi
1528 - fi
1529 - done
1530 -
1531 - # Remove dead symlinks for SAPIs that were just disabled. For
1532 - # example, if the user has the cgi SAPI enabled, then he has an
1533 - # eselect-php symlink for it. If he later reinstalls PHP with
1534 - # USE="-cgi", that symlink will break. This call to eselect is
1535 - # supposed to remove that dead link per bug 572436.
1536 - eselect php cleanup || die
1537 -
1538 - if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then
1539 - elog "To build extensions for this version of PHP, you will need to"
1540 - elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable."
1541 - elog
1542 - fi
1543 -
1544 - # Warn about the removal of PHP_INI_VERSION if the user has it set.
1545 - if [[ -n "${PHP_INI_VERSION}" ]]; then
1546 - ewarn 'The PHP_INI_VERSION variable has been phased out. You may'
1547 - ewarn 'remove it from your configuration at your convenience. See'
1548 - ewarn
1549 - ewarn ' https://bugs.gentoo.org/611214'
1550 - ewarn
1551 - ewarn 'for more information.'
1552 - fi
1553 -
1554 - elog "For details on how version slotting works, please see"
1555 - elog "the wiki:"
1556 - elog
1557 - elog " https://wiki.gentoo.org/wiki/PHP"
1558 - elog
1559 -}
1560 -
1561 -pkg_postrm() {
1562 - # This serves two purposes. First, if we have just removed the last
1563 - # installed version of PHP, then this will remove any dead symlinks
1564 - # belonging to eselect-php. Second, if a user upgrades slots from
1565 - # (say) 5.6 to 7.0 and depcleans the old slot, then this will update
1566 - # his existing symlinks to point to the new 7.0 installation. The
1567 - # latter is bug 432962.
1568 - #
1569 - # Note: the eselect-php package may not be installed at this point,
1570 - # so we can't die() if this command fails.
1571 - eselect php cleanup
1572 -}
1573
1574 diff --git a/dev-lang/php/php-7.3.18.ebuild b/dev-lang/php/php-7.3.18.ebuild
1575 deleted file mode 100644
1576 index 4583dedfe50..00000000000
1577 --- a/dev-lang/php/php-7.3.18.ebuild
1578 +++ /dev/null
1579 @@ -1,760 +0,0 @@
1580 -# Copyright 1999-2020 Gentoo Authors
1581 -# Distributed under the terms of the GNU General Public License v2
1582 -
1583 -EAPI="7"
1584 -
1585 -inherit flag-o-matic systemd autotools
1586 -
1587 -MY_PV=${PV/_rc/RC}
1588 -DESCRIPTION="The PHP language runtime engine"
1589 -HOMEPAGE="https://www.php.net/"
1590 -SRC_URI="https://www.php.net/distributions/${P}.tar.xz"
1591 -
1592 -LICENSE="PHP-3.01
1593 - BSD
1594 - Zend-2.0
1595 - bcmath? ( LGPL-2.1+ )
1596 - fpm? ( BSD-2 )
1597 - gd? ( gd )
1598 - unicode? ( BSD-2 LGPL-2.1 )"
1599 -
1600 -SLOT="$(ver_cut 1-2)"
1601 -KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
1602 -
1603 -S="${WORKDIR}/${PN}-${MY_PV}"
1604 -
1605 -# We can build the following SAPIs in the given order
1606 -SAPIS="embed cli cgi fpm apache2 phpdbg"
1607 -
1608 -# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
1609 -IUSE="${IUSE}
1610 - ${SAPIS/cli/+cli}
1611 - threads"
1612 -
1613 -IUSE="${IUSE} acl argon2 bcmath berkdb bzip2 calendar cdb cjk
1614 - coverage +ctype curl debug
1615 - enchant exif +fileinfo +filter firebird
1616 - +flatfile ftp gd gdbm gmp +hash +iconv imap inifile
1617 - intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl lmdb
1618 - mhash mssql mysql mysqli nls
1619 - oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
1620 - readline recode selinux +session session-mm sharedmem
1621 - +simplexml snmp soap sockets sodium spell sqlite ssl
1622 - sysvipc systemd test tidy +tokenizer tokyocabinet truetype unicode wddx webp
1623 - +xml xmlreader xmlwriter xmlrpc xpm xslt zip zip-encryption zlib"
1624 -
1625 -# The supported (that is, autodetected) versions of BDB are listed in
1626 -# the ./configure script. Other versions *work*, but we need to stick to
1627 -# the ones that can be detected to avoid a repeat of bug #564824.
1628 -COMMON_DEPEND="
1629 - >=app-eselect/eselect-php-0.9.1[apache2?,fpm?]
1630 - >=dev-libs/libpcre2-10.30[unicode]
1631 - fpm? ( acl? ( sys-apps/acl ) )
1632 - apache2? ( www-servers/apache[apache2_modules_unixd(+),threads=] )
1633 - argon2? ( app-crypt/argon2:= )
1634 - berkdb? ( || ( sys-libs/db:5.3
1635 - sys-libs/db:5.1
1636 - sys-libs/db:4.8
1637 - sys-libs/db:4.7
1638 - sys-libs/db:4.6
1639 - sys-libs/db:4.5 ) )
1640 - bzip2? ( app-arch/bzip2:0= )
1641 - cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
1642 - coverage? ( dev-util/lcov )
1643 - curl? ( >=net-misc/curl-7.10.5 )
1644 - enchant? ( <app-text/enchant-2.0:0 )
1645 - firebird? ( dev-db/firebird )
1646 - gd? ( >=virtual/jpeg-0-r3:0 media-libs/libpng:0= >=sys-libs/zlib-1.2.0.4 )
1647 - gdbm? ( >=sys-libs/gdbm-1.8.0:0= )
1648 - gmp? ( dev-libs/gmp:0= )
1649 - iconv? ( virtual/libiconv )
1650 - imap? ( >=virtual/imap-c-client-2[kerberos=,ssl=] )
1651 - intl? ( dev-libs/icu:= )
1652 - iodbc? ( dev-db/libiodbc )
1653 - kerberos? ( virtual/krb5 )
1654 - ldap? ( >=net-nds/openldap-1.2.11 )
1655 - ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 )
1656 - libedit? ( dev-libs/libedit )
1657 - lmdb? ( dev-db/lmdb:= )
1658 - mssql? ( dev-db/freetds[mssql] )
1659 - nls? ( sys-devel/gettext )
1660 - oci8-instant-client? ( dev-db/oracle-instantclient-basic )
1661 - odbc? ( >=dev-db/unixODBC-1.8.13 )
1662 - postgres? ( dev-db/postgresql:* )
1663 - qdbm? ( dev-db/qdbm )
1664 - readline? ( sys-libs/readline:0= )
1665 - recode? ( app-text/recode )
1666 - session-mm? ( dev-libs/mm )
1667 - simplexml? ( >=dev-libs/libxml2-2.6.8 )
1668 - snmp? ( >=net-analyzer/net-snmp-5.2 )
1669 - soap? ( >=dev-libs/libxml2-2.6.8 )
1670 - sodium? ( dev-libs/libsodium:= )
1671 - spell? ( >=app-text/aspell-0.50 )
1672 - sqlite? ( >=dev-db/sqlite-3.7.6.3 )
1673 - ssl? (
1674 - !libressl? ( >=dev-libs/openssl-1.0.1:0= )
1675 - libressl? ( dev-libs/libressl:0= )
1676 - )
1677 - tidy? ( || ( app-text/tidy-html5 app-text/htmltidy ) )
1678 - tokyocabinet? ( dev-db/tokyocabinet )
1679 - truetype? ( =media-libs/freetype-2* )
1680 - unicode? ( dev-libs/oniguruma:= )
1681 - wddx? ( >=dev-libs/libxml2-2.6.8 )
1682 - webp? ( media-libs/libwebp:0= )
1683 - xml? ( >=dev-libs/libxml2-2.6.8 )
1684 - xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
1685 - xmlreader? ( >=dev-libs/libxml2-2.6.8 )
1686 - xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
1687 - xpm? ( x11-libs/libXpm )
1688 - xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
1689 - zip? ( >=sys-libs/zlib-1.2.0.4:0= )
1690 - zip-encryption? ( >=dev-libs/libzip-1.2.0:= )
1691 - zlib? ( >=sys-libs/zlib-1.2.0.4:0= )
1692 -"
1693 -
1694 -RDEPEND="${COMMON_DEPEND}
1695 - virtual/mta
1696 - fpm? (
1697 - selinux? ( sec-policy/selinux-phpfpm )
1698 - systemd? ( sys-apps/systemd ) )"
1699 -
1700 -# Bison isn't actually needed when building from a release tarball
1701 -# However, the configure script will warn if it's absent or if you
1702 -# have an incompatible version installed. See bug 593278.
1703 -DEPEND="${COMMON_DEPEND}
1704 - app-arch/xz-utils
1705 - >=sys-devel/bison-3.0.1"
1706 -
1707 -BDEPEND="virtual/pkgconfig"
1708 -
1709 -# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
1710 -REQUIRED_USE="
1711 - || ( cli cgi fpm apache2 embed phpdbg )
1712 - cli? ( ^^ ( readline libedit ) )
1713 - truetype? ( gd zlib )
1714 - webp? ( gd zlib )
1715 - cjk? ( gd zlib )
1716 - exif? ( gd zlib )
1717 - xpm? ( gd zlib )
1718 - gd? ( zlib )
1719 - simplexml? ( xml )
1720 - soap? ( xml )
1721 - wddx? ( xml )
1722 - xmlrpc? ( || ( xml iconv ) )
1723 - xmlreader? ( xml )
1724 - xslt? ( xml )
1725 - ldap-sasl? ( ldap )
1726 - mhash? ( hash )
1727 - phar? ( hash )
1728 - qdbm? ( !gdbm )
1729 - readline? ( !libedit )
1730 - recode? ( !imap !mysqli !mysql )
1731 - session-mm? ( session !threads )
1732 - mysql? ( || ( mysqli pdo ) )
1733 - zip-encryption? ( zip )
1734 -"
1735 -
1736 -RESTRICT="!test? ( test )"
1737 -
1738 -PATCHES=(
1739 - "${FILESDIR}/php-freetype-2.9.1.patch"
1740 -)
1741 -
1742 -PHP_MV="$(ver_cut 1)"
1743 -
1744 -php_install_ini() {
1745 - local phpsapi="${1}"
1746 -
1747 - # work out where we are installing the ini file
1748 - php_set_ini_dir "${phpsapi}"
1749 -
1750 - # Always install the production INI file, bug 611214.
1751 - local phpinisrc="php.ini-production-${phpsapi}"
1752 - cp php.ini-production "${phpinisrc}" || die
1753 -
1754 - # default to /tmp for save_path, bug #282768
1755 - sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die
1756 -
1757 - # Set the extension dir
1758 - sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \
1759 - -i "${phpinisrc}" || die
1760 -
1761 - # Set the include path to point to where we want to find PEAR packages
1762 - sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die
1763 -
1764 - insinto "${PHP_INI_DIR#${EPREFIX}}"
1765 - newins "${phpinisrc}" php.ini
1766 -
1767 - elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}"
1768 - elog
1769 -
1770 - dodir "${PHP_EXT_INI_DIR#${EPREFIX}}"
1771 - dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}"
1772 -
1773 - if use opcache; then
1774 - elog "Adding opcache to $PHP_EXT_INI_DIR"
1775 - echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \
1776 - "${D}/${PHP_EXT_INI_DIR}"/opcache.ini
1777 - dosym "../ext/opcache.ini" \
1778 - "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini"
1779 - fi
1780 -
1781 - # SAPI-specific handling
1782 - if [[ "${sapi}" == "fpm" ]] ; then
1783 - einfo "Installing FPM config files php-fpm.conf and www.conf"
1784 - insinto "${PHP_INI_DIR#${EPREFIX}}"
1785 - doins sapi/fpm/php-fpm.conf
1786 - insinto "${PHP_INI_DIR#${EPREFIX}}/fpm.d"
1787 - doins sapi/fpm/www.conf
1788 - fi
1789 -
1790 - dodoc php.ini-{development,production}
1791 -}
1792 -
1793 -php_set_ini_dir() {
1794 - PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}"
1795 - PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
1796 - PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
1797 -}
1798 -
1799 -src_prepare() {
1800 - default
1801 -
1802 - # In php-7.x, the FPM pool configuration files have been split off
1803 - # of the main config. By default the pool config files go in
1804 - # e.g. /etc/php-fpm.d, which isn't slotted. So here we move the
1805 - # include directory to a subdirectory "fpm.d" of $PHP_INI_DIR. Later
1806 - # we'll install the pool configuration file "www.conf" there.
1807 - php_set_ini_dir fpm
1808 - sed -i "s~^include=.*$~include=${PHP_INI_DIR}/fpm.d/*.conf~" \
1809 - sapi/fpm/php-fpm.conf.in \
1810 - || die 'failed to move the include directory in php-fpm.conf'
1811 -
1812 - # Bug 669566 - necessary so that build tools are updated for commands like pecl
1813 - # Force rebuilding aclocal.m4
1814 - rm -f aclocal.m4 || die "failed to remove aclocal.m4 in src_prepare"
1815 - eautoreconf
1816 -}
1817 -
1818 -src_configure() {
1819 - addpredict /usr/share/snmp/mibs/.index #nowarn
1820 - addpredict /var/lib/net-snmp/mib_indexes #nowarn
1821 -
1822 - PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
1823 -
1824 - # The php-fpm config file wants localstatedir to be ${EPREFIX}/var
1825 - # and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002.
1826 - local our_conf=(
1827 - --prefix="${PHP_DESTDIR}"
1828 - --mandir="${PHP_DESTDIR}/man"
1829 - --infodir="${PHP_DESTDIR}/info"
1830 - --libdir="${PHP_DESTDIR}/lib"
1831 - --with-libdir="$(get_libdir)"
1832 - --localstatedir="${EPREFIX}/var"
1833 - --without-pear
1834 - $(use_enable threads maintainer-zts)
1835 - )
1836 -
1837 - our_conf+=(
1838 - $(use_with argon2 password-argon2 "${EPREFIX}/usr")
1839 - $(use_enable bcmath bcmath)
1840 - $(use_with bzip2 bz2 "${EPREFIX}/usr")
1841 - $(use_enable calendar calendar)
1842 - $(use_enable coverage gcov)
1843 - $(use_enable ctype ctype)
1844 - $(use_with curl curl "${EPREFIX}/usr")
1845 - $(use_enable xml dom)
1846 - $(use_with enchant enchant "${EPREFIX}/usr")
1847 - $(use_enable exif exif)
1848 - $(use_enable fileinfo fileinfo)
1849 - $(use_enable filter filter)
1850 - $(use_enable ftp ftp)
1851 - $(use_with nls gettext "${EPREFIX}/usr")
1852 - $(use_with gmp gmp "${EPREFIX}/usr")
1853 - $(use_enable hash hash)
1854 - $(use_with mhash mhash "${EPREFIX}/usr")
1855 - $(use_with iconv iconv \
1856 - $(use elibc_glibc || use elibc_musl || use elibc_FreeBSD || echo "${EPREFIX}/usr"))
1857 - $(use_enable intl intl)
1858 - $(use_enable ipv6 ipv6)
1859 - $(use_enable json json)
1860 - $(use_with kerberos kerberos "${EPREFIX}/usr")
1861 - $(use_enable xml libxml)
1862 - $(use_with xml libxml-dir "${EPREFIX}/usr")
1863 - $(use_enable unicode mbstring)
1864 - $(use_with unicode onig "${EPREFIX}/usr")
1865 - $(use_with ssl openssl "${EPREFIX}/usr")
1866 - $(use_with ssl openssl-dir "${EPREFIX}/usr")
1867 - $(use_enable pcntl pcntl)
1868 - $(use_enable phar phar)
1869 - $(use_enable pdo pdo)
1870 - $(use_enable opcache opcache)
1871 - $(use_with postgres pgsql "${EPREFIX}/usr")
1872 - $(use_enable posix posix)
1873 - $(use_with spell pspell "${EPREFIX}/usr")
1874 - $(use_with recode recode "${EPREFIX}/usr")
1875 - $(use_enable simplexml simplexml)
1876 - $(use_enable sharedmem shmop)
1877 - $(use_with snmp snmp "${EPREFIX}/usr")
1878 - $(use_enable soap soap)
1879 - $(use_enable sockets sockets)
1880 - $(use_with sodium sodium "${EPREFIX}/usr")
1881 - $(use_with sqlite sqlite3 "${EPREFIX}/usr")
1882 - $(use_enable sysvipc sysvmsg)
1883 - $(use_enable sysvipc sysvsem)
1884 - $(use_enable sysvipc sysvshm)
1885 - $(use_with tidy tidy "${EPREFIX}/usr")
1886 - $(use_enable tokenizer tokenizer)
1887 - $(use_enable wddx wddx)
1888 - $(use_enable xml xml)
1889 - $(use_enable xmlreader xmlreader)
1890 - $(use_enable xmlwriter xmlwriter)
1891 - $(use_with xmlrpc xmlrpc)
1892 - $(use_with xslt xsl "${EPREFIX}/usr")
1893 - $(use_enable zip zip)
1894 - $(use_with zip-encryption libzip "${EPREFIX}/usr")
1895 - $(use_with zlib zlib "${EPREFIX}/usr")
1896 - $(use_enable debug debug)
1897 - )
1898 -
1899 - # DBA support
1900 - if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
1901 - || use qdbm || use lmdb || use tokyocabinet ; then
1902 - our_conf+=( "--enable-dba${shared}" )
1903 - fi
1904 -
1905 - # DBA drivers support
1906 - our_conf+=(
1907 - $(use_with cdb cdb)
1908 - $(use_with berkdb db4 "${EPREFIX}/usr")
1909 - $(use_enable flatfile flatfile)
1910 - $(use_with gdbm gdbm "${EPREFIX}/usr")
1911 - $(use_enable inifile inifile)
1912 - $(use_with qdbm qdbm "${EPREFIX}/usr")
1913 - $(use_with lmdb lmdb "${EPREFIX}/usr")
1914 - )
1915 -
1916 - # Support for the GD graphics library
1917 - our_conf+=(
1918 - $(use_with truetype freetype-dir "${EPREFIX}/usr")
1919 - $(use_enable cjk gd-jis-conv)
1920 - $(use_with gd jpeg-dir "${EPREFIX}/usr")
1921 - $(use_with gd png-dir "${EPREFIX}/usr")
1922 - $(use_with xpm xpm-dir "${EPREFIX}/usr")
1923 - )
1924 - if use webp; then
1925 - our_conf+=( --with-webp-dir="${EPREFIX}/usr" )
1926 - fi
1927 - # enable gd last, so configure can pick up the previous settings
1928 - our_conf+=( $(use_with gd gd) )
1929 -
1930 - # IMAP support
1931 - if use imap ; then
1932 - our_conf+=(
1933 - $(use_with imap imap "${EPREFIX}/usr")
1934 - $(use_with ssl imap-ssl "${EPREFIX}/usr")
1935 - )
1936 - fi
1937 -
1938 - # Interbase/firebird support
1939 - our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") )
1940 -
1941 - # LDAP support
1942 - if use ldap ; then
1943 - our_conf+=(
1944 - $(use_with ldap ldap "${EPREFIX}/usr")
1945 - $(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr")
1946 - )
1947 - fi
1948 -
1949 - # MySQL support
1950 - local mysqllib="mysqlnd"
1951 - local mysqlilib="mysqlnd"
1952 -
1953 - our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
1954 -
1955 - local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock"
1956 - if use mysql || use mysqli ; then
1957 - our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") )
1958 - fi
1959 -
1960 - # ODBC support
1961 - our_conf+=(
1962 - $(use_with odbc unixODBC "${EPREFIX}/usr")
1963 - $(use_with iodbc iodbc "${EPREFIX}/usr")
1964 - )
1965 -
1966 - # Oracle support
1967 - our_conf+=( $(use_with oci8-instant-client oci8) )
1968 -
1969 - # PDO support
1970 - if use pdo ; then
1971 - our_conf+=(
1972 - $(use_with mssql pdo-dblib "${EPREFIX}/usr")
1973 - $(use_with mysql pdo-mysql "${mysqllib}")
1974 - $(use_with postgres pdo-pgsql)
1975 - $(use_with sqlite pdo-sqlite "${EPREFIX}/usr")
1976 - $(use_with firebird pdo-firebird "${EPREFIX}/usr")
1977 - $(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr")
1978 - $(use_with oci8-instant-client pdo-oci)
1979 - )
1980 - fi
1981 -
1982 - # readline/libedit support
1983 - our_conf+=(
1984 - $(use_with readline readline "${EPREFIX}/usr")
1985 - $(use_with libedit libedit "${EPREFIX}/usr")
1986 - )
1987 -
1988 - # Session support
1989 - if use session ; then
1990 - our_conf+=( $(use_with session-mm mm "${EPREFIX}/usr") )
1991 - else
1992 - our_conf+=( $(use_enable session session) )
1993 - fi
1994 -
1995 - # Use pic for shared modules such as apache2's mod_php
1996 - our_conf+=( --with-pic )
1997 -
1998 - # we use the system copy of pcre
1999 - # --with-pcre-regex affects ext/pcre
2000 - # --with-pcre-dir affects ext/filter and ext/zip
2001 - # --with-pcre-valgrind cannot be enabled with system pcre
2002 - # Many arches don't support pcre-jit
2003 - our_conf+=(
2004 - --with-pcre-regex="${EPREFIX}/usr"
2005 - --with-pcre-dir="${EPREFIX}/usr"
2006 - --without-pcre-valgrind
2007 - --without-pcre-jit
2008 - )
2009 -
2010 - # Catch CFLAGS problems
2011 - # Fixes bug #14067.
2012 - # Changed order to run it in reverse for bug #32022 and #12021.
2013 - replace-cpu-flags "k6*" "i586"
2014 -
2015 - # Cache the ./configure test results between SAPIs.
2016 - our_conf+=( --cache-file="${T}/config.cache" )
2017 -
2018 - # Support user-passed configuration parameters
2019 - our_conf+=( ${EXTRA_ECONF:-} )
2020 -
2021 - # Support the Apache2 extras, they must be set globally for all
2022 - # SAPIs to work correctly, especially for external PHP extensions
2023 -
2024 - local one_sapi
2025 - local sapi
2026 - mkdir -p "${WORKDIR}/sapis-build" || die
2027 - for one_sapi in $SAPIS ; do
2028 - use "${one_sapi}" || continue
2029 - php_set_ini_dir "${one_sapi}"
2030 -
2031 - # The BUILD_DIR variable is used to determine where to output
2032 - # the files that autotools creates. This was all originally
2033 - # based on the autotools-utils eclass.
2034 - BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}"
2035 - cp -a "${S}" "${BUILD_DIR}" || die
2036 - cd "${BUILD_DIR}" || die
2037 -
2038 - local sapi_conf=(
2039 - --with-config-file-path="${PHP_INI_DIR}"
2040 - --with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}"
2041 - )
2042 -
2043 - for sapi in $SAPIS ; do
2044 - case "$sapi" in
2045 - cli|cgi|embed|fpm|phpdbg)
2046 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
2047 - sapi_conf+=( "--enable-${sapi}" )
2048 - if [[ "fpm" == "${sapi}" ]] ; then
2049 - sapi_conf+=(
2050 - $(use_with acl fpm-acl)
2051 - $(use_with systemd fpm-systemd)
2052 - )
2053 - fi
2054 - else
2055 - sapi_conf+=( "--disable-${sapi}" )
2056 - fi
2057 - ;;
2058 -
2059 - apache2)
2060 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
2061 - sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" )
2062 - else
2063 - sapi_conf+=( --without-apxs2 )
2064 - fi
2065 - ;;
2066 - esac
2067 - done
2068 -
2069 - # Construct the $myeconfargs array by concatenating $our_conf
2070 - # (the common args) and $sapi_conf (the SAPI-specific args).
2071 - local myeconfargs=( "${our_conf[@]}" )
2072 - myeconfargs+=( "${sapi_conf[@]}" )
2073 -
2074 - pushd "${BUILD_DIR}" > /dev/null || die
2075 - econf "${myeconfargs[@]}"
2076 - popd > /dev/null || die
2077 - done
2078 -}
2079 -
2080 -src_compile() {
2081 - # snmp seems to run during src_compile, too (bug #324739)
2082 - addpredict /usr/share/snmp/mibs/.index #nowarn
2083 - addpredict /var/lib/net-snmp/mib_indexes #nowarn
2084 -
2085 - local sapi
2086 - for sapi in ${SAPIS} ; do
2087 - if use "${sapi}"; then
2088 - cd "${WORKDIR}/sapis-build/$sapi" || \
2089 - die "Failed to change dir to ${WORKDIR}/sapis-build/$1"
2090 - emake
2091 - fi
2092 - done
2093 -}
2094 -
2095 -src_install() {
2096 - # see bug #324739 for what happens when we don't have that
2097 - addpredict /usr/share/snmp/mibs/.index #nowarn
2098 -
2099 - # grab the first SAPI that got built and install common files from there
2100 - local first_sapi="", sapi=""
2101 - for sapi in $SAPIS ; do
2102 - if use $sapi ; then
2103 - first_sapi=$sapi
2104 - break
2105 - fi
2106 - done
2107 -
2108 - # Makefile forgets to create this before trying to write to it...
2109 - dodir "${PHP_DESTDIR#${EPREFIX}}/bin"
2110 -
2111 - # Install php environment (without any sapis)
2112 - cd "${WORKDIR}/sapis-build/$first_sapi" || die
2113 - emake INSTALL_ROOT="${D}" \
2114 - install-build install-headers install-programs
2115 -
2116 - local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)"
2117 -
2118 - # Create the directory where we'll put version-specific php scripts
2119 - keepdir "/usr/share/php${PHP_MV}"
2120 -
2121 - local file=""
2122 - local sapi_list=""
2123 -
2124 - for sapi in ${SAPIS}; do
2125 - if use "${sapi}" ; then
2126 - einfo "Installing SAPI: ${sapi}"
2127 - cd "${WORKDIR}/sapis-build/${sapi}" || die
2128 -
2129 - if [[ "${sapi}" == "apache2" ]] ; then
2130 - # We're specifically not using emake install-sapi as libtool
2131 - # may cause unnecessary relink failures (see bug #351266)
2132 - insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/"
2133 - newins ".libs/libphp${PHP_MV}$(get_libname)" \
2134 - "libphp${PHP_MV}$(get_libname)"
2135 - keepdir "/usr/$(get_libdir)/apache2/modules"
2136 - else
2137 - # needed each time, php_install_ini would reset it
2138 - local dest="${PHP_DESTDIR#${EPREFIX}}"
2139 - into "${dest}"
2140 - case "$sapi" in
2141 - cli)
2142 - source="sapi/cli/php"
2143 - # Install the "phar" archive utility.
2144 - if use phar ; then
2145 - emake INSTALL_ROOT="${D}" install-pharcmd
2146 - dosym "..${dest#/usr}/bin/phar" "/usr/bin/phar${SLOT}"
2147 - fi
2148 - ;;
2149 - cgi)
2150 - source="sapi/cgi/php-cgi"
2151 - ;;
2152 - fpm)
2153 - source="sapi/fpm/php-fpm"
2154 - ;;
2155 - embed)
2156 - source="libs/libphp${PHP_MV}$(get_libname)"
2157 - ;;
2158 - phpdbg)
2159 - source="sapi/phpdbg/phpdbg"
2160 - ;;
2161 - *)
2162 - die "unhandled sapi in src_install"
2163 - ;;
2164 - esac
2165 -
2166 - if [[ "${source}" == *"$(get_libname)" ]]; then
2167 - dolib.so "${source}"
2168 - else
2169 - dobin "${source}"
2170 - local name="$(basename ${source})"
2171 - dosym "..${dest#/usr}/bin/${name}" "/usr/bin/${name}${SLOT}"
2172 - fi
2173 - fi
2174 -
2175 - php_install_ini "${sapi}"
2176 -
2177 - # construct correct SAPI string for php-config
2178 - # thanks to ferringb for the bash voodoo
2179 - if [[ "${sapi}" == "apache2" ]]; then
2180 - sapi_list="${sapi_list:+${sapi_list} }apache2handler"
2181 - else
2182 - sapi_list="${sapi_list:+${sapi_list} }${sapi}"
2183 - fi
2184 - fi
2185 - done
2186 -
2187 - # Installing opcache module
2188 - if use opcache ; then
2189 - into "${PHP_DESTDIR#${EPREFIX}}"
2190 - dolib.so "modules/opcache$(get_libname)"
2191 - fi
2192 -
2193 - # Install env.d files
2194 - newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}"
2195 - sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
2196 - sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
2197 -
2198 - # set php-config variable correctly (bug #278439)
2199 - sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \
2200 - "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die
2201 -
2202 - if use fpm ; then
2203 - if use systemd; then
2204 - systemd_newunit "${FILESDIR}/php-fpm_at.service" \
2205 - "php-fpm@${SLOT}.service"
2206 - else
2207 - systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \
2208 - "php-fpm@${SLOT}.service"
2209 - fi
2210 - fi
2211 -}
2212 -
2213 -src_test() {
2214 - echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
2215 - PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
2216 - if [[ ! -x "${PHP_BIN}" ]] ; then
2217 - ewarn "Test phase requires USE=cli, skipping"
2218 - return
2219 - else
2220 - export TEST_PHP_EXECUTABLE="${PHP_BIN}"
2221 - fi
2222 -
2223 - if [[ -x "${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" ]] ; then
2224 - export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi"
2225 - fi
2226 -
2227 - if [[ -x "${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" ]] ; then
2228 - export TEST_PHPDBG_EXECUTABLE="${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg"
2229 - fi
2230 -
2231 - REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \
2232 - "session.save_path=${T}" \
2233 - "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \
2234 - "session.save_path=${T}"
2235 -
2236 - for name in ${EXPECTED_TEST_FAILURES}; do
2237 - mv "${name}.out" "${name}.out.orig" 2>/dev/null || die
2238 - done
2239 -
2240 - local failed="$(find -name '*.out')"
2241 - if [[ ${failed} != "" ]] ; then
2242 - ewarn "The following test cases failed unexpectedly:"
2243 - for name in ${failed}; do
2244 - ewarn " ${name/.out/}"
2245 - done
2246 - else
2247 - einfo "No unexpected test failures, all fine"
2248 - fi
2249 -
2250 - if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
2251 - local passed=""
2252 - for name in ${EXPECTED_TEST_FAILURES}; do
2253 - [[ -f "${name}.diff" ]] && continue
2254 - passed="${passed} ${name}"
2255 - done
2256 - if [[ ${passed} != "" ]] ; then
2257 - einfo "The following test cases passed unexpectedly:"
2258 - for name in ${passed}; do
2259 - ewarn " ${passed}"
2260 - done
2261 - else
2262 - einfo "None of the known-to-fail tests passed, all fine"
2263 - fi
2264 - fi
2265 -}
2266 -
2267 -pkg_postinst() {
2268 - # Output some general info to the user
2269 - if use apache2 ; then
2270 - elog
2271 - elog "To enable PHP in apache, you will need to add \"-D PHP\" to"
2272 - elog "your apache2 command. OpenRC users can append that string to"
2273 - elog "APACHE2_OPTS in /etc/conf.d/apache2."
2274 - elog
2275 - elog "The apache module configuration file 70_mod_php.conf is"
2276 - elog "provided (and maintained) by eselect-php."
2277 - elog
2278 - fi
2279 -
2280 - # Create the symlinks for php
2281 - local m
2282 - for m in ${SAPIS}; do
2283 - [[ ${m} == 'embed' ]] && continue;
2284 - if use $m ; then
2285 - local ci=$(eselect php show $m)
2286 - if [[ -z $ci ]]; then
2287 - eselect php set $m php${SLOT} || die
2288 - einfo "Switched ${m} to use php:${SLOT}"
2289 - einfo
2290 - elif [[ $ci != "php${SLOT}" ]] ; then
2291 - elog "To switch $m to use php:${SLOT}, run"
2292 - elog " eselect php set $m php${SLOT}"
2293 - elog
2294 - fi
2295 - fi
2296 - done
2297 -
2298 - # Remove dead symlinks for SAPIs that were just disabled. For
2299 - # example, if the user has the cgi SAPI enabled, then he has an
2300 - # eselect-php symlink for it. If he later reinstalls PHP with
2301 - # USE="-cgi", that symlink will break. This call to eselect is
2302 - # supposed to remove that dead link per bug 572436.
2303 - eselect php cleanup || die
2304 -
2305 - if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then
2306 - elog "To build extensions for this version of PHP, you will need to"
2307 - elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable."
2308 - elog
2309 - fi
2310 -
2311 - # Warn about the removal of PHP_INI_VERSION if the user has it set.
2312 - if [[ -n "${PHP_INI_VERSION}" ]]; then
2313 - ewarn 'The PHP_INI_VERSION variable has been phased out. You may'
2314 - ewarn 'remove it from your configuration at your convenience. See'
2315 - ewarn
2316 - ewarn ' https://bugs.gentoo.org/611214'
2317 - ewarn
2318 - ewarn 'for more information.'
2319 - fi
2320 -
2321 - elog "For details on how version slotting works, please see"
2322 - elog "the wiki:"
2323 - elog
2324 - elog " https://wiki.gentoo.org/wiki/PHP"
2325 - elog
2326 -}
2327 -
2328 -pkg_postrm() {
2329 - # This serves two purposes. First, if we have just removed the last
2330 - # installed version of PHP, then this will remove any dead symlinks
2331 - # belonging to eselect-php. Second, if a user upgrades slots from
2332 - # (say) 5.6 to 7.0 and depcleans the old slot, then this will update
2333 - # his existing symlinks to point to the new 7.0 installation. The
2334 - # latter is bug 432962.
2335 - #
2336 - # Note: the eselect-php package may not be installed at this point,
2337 - # so we can't die() if this command fails.
2338 - eselect php cleanup
2339 -}
2340
2341 diff --git a/dev-lang/php/php-7.3.19.ebuild b/dev-lang/php/php-7.3.19.ebuild
2342 deleted file mode 100644
2343 index 705d68d153f..00000000000
2344 --- a/dev-lang/php/php-7.3.19.ebuild
2345 +++ /dev/null
2346 @@ -1,760 +0,0 @@
2347 -# Copyright 1999-2020 Gentoo Authors
2348 -# Distributed under the terms of the GNU General Public License v2
2349 -
2350 -EAPI="7"
2351 -
2352 -inherit flag-o-matic systemd autotools
2353 -
2354 -MY_PV=${PV/_rc/RC}
2355 -DESCRIPTION="The PHP language runtime engine"
2356 -HOMEPAGE="https://www.php.net/"
2357 -SRC_URI="https://www.php.net/distributions/${P}.tar.xz"
2358 -
2359 -LICENSE="PHP-3.01
2360 - BSD
2361 - Zend-2.0
2362 - bcmath? ( LGPL-2.1+ )
2363 - fpm? ( BSD-2 )
2364 - gd? ( gd )
2365 - unicode? ( BSD-2 LGPL-2.1 )"
2366 -
2367 -SLOT="$(ver_cut 1-2)"
2368 -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
2369 -
2370 -S="${WORKDIR}/${PN}-${MY_PV}"
2371 -
2372 -# We can build the following SAPIs in the given order
2373 -SAPIS="embed cli cgi fpm apache2 phpdbg"
2374 -
2375 -# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
2376 -IUSE="${IUSE}
2377 - ${SAPIS/cli/+cli}
2378 - threads"
2379 -
2380 -IUSE="${IUSE} acl argon2 bcmath berkdb bzip2 calendar cdb cjk
2381 - coverage +ctype curl debug
2382 - enchant exif +fileinfo +filter firebird
2383 - +flatfile ftp gd gdbm gmp +hash +iconv imap inifile
2384 - intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl lmdb
2385 - mhash mssql mysql mysqli nls
2386 - oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
2387 - readline recode selinux +session session-mm sharedmem
2388 - +simplexml snmp soap sockets sodium spell sqlite ssl
2389 - sysvipc systemd test tidy +tokenizer tokyocabinet truetype unicode wddx webp
2390 - +xml xmlreader xmlwriter xmlrpc xpm xslt zip zip-encryption zlib"
2391 -
2392 -# The supported (that is, autodetected) versions of BDB are listed in
2393 -# the ./configure script. Other versions *work*, but we need to stick to
2394 -# the ones that can be detected to avoid a repeat of bug #564824.
2395 -COMMON_DEPEND="
2396 - >=app-eselect/eselect-php-0.9.1[apache2?,fpm?]
2397 - >=dev-libs/libpcre2-10.30[unicode]
2398 - fpm? ( acl? ( sys-apps/acl ) )
2399 - apache2? ( www-servers/apache[apache2_modules_unixd(+),threads=] )
2400 - argon2? ( app-crypt/argon2:= )
2401 - berkdb? ( || ( sys-libs/db:5.3
2402 - sys-libs/db:5.1
2403 - sys-libs/db:4.8
2404 - sys-libs/db:4.7
2405 - sys-libs/db:4.6
2406 - sys-libs/db:4.5 ) )
2407 - bzip2? ( app-arch/bzip2:0= )
2408 - cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
2409 - coverage? ( dev-util/lcov )
2410 - curl? ( >=net-misc/curl-7.10.5 )
2411 - enchant? ( <app-text/enchant-2.0:0 )
2412 - firebird? ( dev-db/firebird )
2413 - gd? ( >=virtual/jpeg-0-r3:0 media-libs/libpng:0= >=sys-libs/zlib-1.2.0.4 )
2414 - gdbm? ( >=sys-libs/gdbm-1.8.0:0= )
2415 - gmp? ( dev-libs/gmp:0= )
2416 - iconv? ( virtual/libiconv )
2417 - imap? ( >=virtual/imap-c-client-2[kerberos=,ssl=] )
2418 - intl? ( dev-libs/icu:= )
2419 - iodbc? ( dev-db/libiodbc )
2420 - kerberos? ( virtual/krb5 )
2421 - ldap? ( >=net-nds/openldap-1.2.11 )
2422 - ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 )
2423 - libedit? ( dev-libs/libedit )
2424 - lmdb? ( dev-db/lmdb:= )
2425 - mssql? ( dev-db/freetds[mssql] )
2426 - nls? ( sys-devel/gettext )
2427 - oci8-instant-client? ( dev-db/oracle-instantclient-basic )
2428 - odbc? ( >=dev-db/unixODBC-1.8.13 )
2429 - postgres? ( dev-db/postgresql:* )
2430 - qdbm? ( dev-db/qdbm )
2431 - readline? ( sys-libs/readline:0= )
2432 - recode? ( app-text/recode )
2433 - session-mm? ( dev-libs/mm )
2434 - simplexml? ( >=dev-libs/libxml2-2.6.8 )
2435 - snmp? ( >=net-analyzer/net-snmp-5.2 )
2436 - soap? ( >=dev-libs/libxml2-2.6.8 )
2437 - sodium? ( dev-libs/libsodium:= )
2438 - spell? ( >=app-text/aspell-0.50 )
2439 - sqlite? ( >=dev-db/sqlite-3.7.6.3 )
2440 - ssl? (
2441 - !libressl? ( >=dev-libs/openssl-1.0.1:0= )
2442 - libressl? ( dev-libs/libressl:0= )
2443 - )
2444 - tidy? ( || ( app-text/tidy-html5 app-text/htmltidy ) )
2445 - tokyocabinet? ( dev-db/tokyocabinet )
2446 - truetype? ( =media-libs/freetype-2* )
2447 - unicode? ( dev-libs/oniguruma:= )
2448 - wddx? ( >=dev-libs/libxml2-2.6.8 )
2449 - webp? ( media-libs/libwebp:0= )
2450 - xml? ( >=dev-libs/libxml2-2.6.8 )
2451 - xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
2452 - xmlreader? ( >=dev-libs/libxml2-2.6.8 )
2453 - xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
2454 - xpm? ( x11-libs/libXpm )
2455 - xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
2456 - zip? ( >=sys-libs/zlib-1.2.0.4:0= )
2457 - zip-encryption? ( >=dev-libs/libzip-1.2.0:= )
2458 - zlib? ( >=sys-libs/zlib-1.2.0.4:0= )
2459 -"
2460 -
2461 -RDEPEND="${COMMON_DEPEND}
2462 - virtual/mta
2463 - fpm? (
2464 - selinux? ( sec-policy/selinux-phpfpm )
2465 - systemd? ( sys-apps/systemd ) )"
2466 -
2467 -# Bison isn't actually needed when building from a release tarball
2468 -# However, the configure script will warn if it's absent or if you
2469 -# have an incompatible version installed. See bug 593278.
2470 -DEPEND="${COMMON_DEPEND}
2471 - app-arch/xz-utils
2472 - >=sys-devel/bison-3.0.1"
2473 -
2474 -BDEPEND="virtual/pkgconfig"
2475 -
2476 -# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
2477 -REQUIRED_USE="
2478 - || ( cli cgi fpm apache2 embed phpdbg )
2479 - cli? ( ^^ ( readline libedit ) )
2480 - truetype? ( gd zlib )
2481 - webp? ( gd zlib )
2482 - cjk? ( gd zlib )
2483 - exif? ( gd zlib )
2484 - xpm? ( gd zlib )
2485 - gd? ( zlib )
2486 - simplexml? ( xml )
2487 - soap? ( xml )
2488 - wddx? ( xml )
2489 - xmlrpc? ( || ( xml iconv ) )
2490 - xmlreader? ( xml )
2491 - xslt? ( xml )
2492 - ldap-sasl? ( ldap )
2493 - mhash? ( hash )
2494 - phar? ( hash )
2495 - qdbm? ( !gdbm )
2496 - readline? ( !libedit )
2497 - recode? ( !imap !mysqli !mysql )
2498 - session-mm? ( session !threads )
2499 - mysql? ( || ( mysqli pdo ) )
2500 - zip-encryption? ( zip )
2501 -"
2502 -
2503 -RESTRICT="!test? ( test )"
2504 -
2505 -PATCHES=(
2506 - "${FILESDIR}/php-freetype-2.9.1.patch"
2507 -)
2508 -
2509 -PHP_MV="$(ver_cut 1)"
2510 -
2511 -php_install_ini() {
2512 - local phpsapi="${1}"
2513 -
2514 - # work out where we are installing the ini file
2515 - php_set_ini_dir "${phpsapi}"
2516 -
2517 - # Always install the production INI file, bug 611214.
2518 - local phpinisrc="php.ini-production-${phpsapi}"
2519 - cp php.ini-production "${phpinisrc}" || die
2520 -
2521 - # default to /tmp for save_path, bug #282768
2522 - sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die
2523 -
2524 - # Set the extension dir
2525 - sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \
2526 - -i "${phpinisrc}" || die
2527 -
2528 - # Set the include path to point to where we want to find PEAR packages
2529 - sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die
2530 -
2531 - insinto "${PHP_INI_DIR#${EPREFIX}}"
2532 - newins "${phpinisrc}" php.ini
2533 -
2534 - elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}"
2535 - elog
2536 -
2537 - dodir "${PHP_EXT_INI_DIR#${EPREFIX}}"
2538 - dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}"
2539 -
2540 - if use opcache; then
2541 - elog "Adding opcache to $PHP_EXT_INI_DIR"
2542 - echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \
2543 - "${D}/${PHP_EXT_INI_DIR}"/opcache.ini
2544 - dosym "../ext/opcache.ini" \
2545 - "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini"
2546 - fi
2547 -
2548 - # SAPI-specific handling
2549 - if [[ "${sapi}" == "fpm" ]] ; then
2550 - einfo "Installing FPM config files php-fpm.conf and www.conf"
2551 - insinto "${PHP_INI_DIR#${EPREFIX}}"
2552 - doins sapi/fpm/php-fpm.conf
2553 - insinto "${PHP_INI_DIR#${EPREFIX}}/fpm.d"
2554 - doins sapi/fpm/www.conf
2555 - fi
2556 -
2557 - dodoc php.ini-{development,production}
2558 -}
2559 -
2560 -php_set_ini_dir() {
2561 - PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}"
2562 - PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
2563 - PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
2564 -}
2565 -
2566 -src_prepare() {
2567 - default
2568 -
2569 - # In php-7.x, the FPM pool configuration files have been split off
2570 - # of the main config. By default the pool config files go in
2571 - # e.g. /etc/php-fpm.d, which isn't slotted. So here we move the
2572 - # include directory to a subdirectory "fpm.d" of $PHP_INI_DIR. Later
2573 - # we'll install the pool configuration file "www.conf" there.
2574 - php_set_ini_dir fpm
2575 - sed -i "s~^include=.*$~include=${PHP_INI_DIR}/fpm.d/*.conf~" \
2576 - sapi/fpm/php-fpm.conf.in \
2577 - || die 'failed to move the include directory in php-fpm.conf'
2578 -
2579 - # Bug 669566 - necessary so that build tools are updated for commands like pecl
2580 - # Force rebuilding aclocal.m4
2581 - rm -f aclocal.m4 || die "failed to remove aclocal.m4 in src_prepare"
2582 - eautoreconf
2583 -}
2584 -
2585 -src_configure() {
2586 - addpredict /usr/share/snmp/mibs/.index #nowarn
2587 - addpredict /var/lib/net-snmp/mib_indexes #nowarn
2588 -
2589 - PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
2590 -
2591 - # The php-fpm config file wants localstatedir to be ${EPREFIX}/var
2592 - # and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002.
2593 - local our_conf=(
2594 - --prefix="${PHP_DESTDIR}"
2595 - --mandir="${PHP_DESTDIR}/man"
2596 - --infodir="${PHP_DESTDIR}/info"
2597 - --libdir="${PHP_DESTDIR}/lib"
2598 - --with-libdir="$(get_libdir)"
2599 - --localstatedir="${EPREFIX}/var"
2600 - --without-pear
2601 - $(use_enable threads maintainer-zts)
2602 - )
2603 -
2604 - our_conf+=(
2605 - $(use_with argon2 password-argon2 "${EPREFIX}/usr")
2606 - $(use_enable bcmath bcmath)
2607 - $(use_with bzip2 bz2 "${EPREFIX}/usr")
2608 - $(use_enable calendar calendar)
2609 - $(use_enable coverage gcov)
2610 - $(use_enable ctype ctype)
2611 - $(use_with curl curl "${EPREFIX}/usr")
2612 - $(use_enable xml dom)
2613 - $(use_with enchant enchant "${EPREFIX}/usr")
2614 - $(use_enable exif exif)
2615 - $(use_enable fileinfo fileinfo)
2616 - $(use_enable filter filter)
2617 - $(use_enable ftp ftp)
2618 - $(use_with nls gettext "${EPREFIX}/usr")
2619 - $(use_with gmp gmp "${EPREFIX}/usr")
2620 - $(use_enable hash hash)
2621 - $(use_with mhash mhash "${EPREFIX}/usr")
2622 - $(use_with iconv iconv \
2623 - $(use elibc_glibc || use elibc_musl || use elibc_FreeBSD || echo "${EPREFIX}/usr"))
2624 - $(use_enable intl intl)
2625 - $(use_enable ipv6 ipv6)
2626 - $(use_enable json json)
2627 - $(use_with kerberos kerberos "${EPREFIX}/usr")
2628 - $(use_enable xml libxml)
2629 - $(use_with xml libxml-dir "${EPREFIX}/usr")
2630 - $(use_enable unicode mbstring)
2631 - $(use_with unicode onig "${EPREFIX}/usr")
2632 - $(use_with ssl openssl "${EPREFIX}/usr")
2633 - $(use_with ssl openssl-dir "${EPREFIX}/usr")
2634 - $(use_enable pcntl pcntl)
2635 - $(use_enable phar phar)
2636 - $(use_enable pdo pdo)
2637 - $(use_enable opcache opcache)
2638 - $(use_with postgres pgsql "${EPREFIX}/usr")
2639 - $(use_enable posix posix)
2640 - $(use_with spell pspell "${EPREFIX}/usr")
2641 - $(use_with recode recode "${EPREFIX}/usr")
2642 - $(use_enable simplexml simplexml)
2643 - $(use_enable sharedmem shmop)
2644 - $(use_with snmp snmp "${EPREFIX}/usr")
2645 - $(use_enable soap soap)
2646 - $(use_enable sockets sockets)
2647 - $(use_with sodium sodium "${EPREFIX}/usr")
2648 - $(use_with sqlite sqlite3 "${EPREFIX}/usr")
2649 - $(use_enable sysvipc sysvmsg)
2650 - $(use_enable sysvipc sysvsem)
2651 - $(use_enable sysvipc sysvshm)
2652 - $(use_with tidy tidy "${EPREFIX}/usr")
2653 - $(use_enable tokenizer tokenizer)
2654 - $(use_enable wddx wddx)
2655 - $(use_enable xml xml)
2656 - $(use_enable xmlreader xmlreader)
2657 - $(use_enable xmlwriter xmlwriter)
2658 - $(use_with xmlrpc xmlrpc)
2659 - $(use_with xslt xsl "${EPREFIX}/usr")
2660 - $(use_enable zip zip)
2661 - $(use_with zip-encryption libzip "${EPREFIX}/usr")
2662 - $(use_with zlib zlib "${EPREFIX}/usr")
2663 - $(use_enable debug debug)
2664 - )
2665 -
2666 - # DBA support
2667 - if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
2668 - || use qdbm || use lmdb || use tokyocabinet ; then
2669 - our_conf+=( "--enable-dba${shared}" )
2670 - fi
2671 -
2672 - # DBA drivers support
2673 - our_conf+=(
2674 - $(use_with cdb cdb)
2675 - $(use_with berkdb db4 "${EPREFIX}/usr")
2676 - $(use_enable flatfile flatfile)
2677 - $(use_with gdbm gdbm "${EPREFIX}/usr")
2678 - $(use_enable inifile inifile)
2679 - $(use_with qdbm qdbm "${EPREFIX}/usr")
2680 - $(use_with lmdb lmdb "${EPREFIX}/usr")
2681 - )
2682 -
2683 - # Support for the GD graphics library
2684 - our_conf+=(
2685 - $(use_with truetype freetype-dir "${EPREFIX}/usr")
2686 - $(use_enable cjk gd-jis-conv)
2687 - $(use_with gd jpeg-dir "${EPREFIX}/usr")
2688 - $(use_with gd png-dir "${EPREFIX}/usr")
2689 - $(use_with xpm xpm-dir "${EPREFIX}/usr")
2690 - )
2691 - if use webp; then
2692 - our_conf+=( --with-webp-dir="${EPREFIX}/usr" )
2693 - fi
2694 - # enable gd last, so configure can pick up the previous settings
2695 - our_conf+=( $(use_with gd gd) )
2696 -
2697 - # IMAP support
2698 - if use imap ; then
2699 - our_conf+=(
2700 - $(use_with imap imap "${EPREFIX}/usr")
2701 - $(use_with ssl imap-ssl "${EPREFIX}/usr")
2702 - )
2703 - fi
2704 -
2705 - # Interbase/firebird support
2706 - our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") )
2707 -
2708 - # LDAP support
2709 - if use ldap ; then
2710 - our_conf+=(
2711 - $(use_with ldap ldap "${EPREFIX}/usr")
2712 - $(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr")
2713 - )
2714 - fi
2715 -
2716 - # MySQL support
2717 - local mysqllib="mysqlnd"
2718 - local mysqlilib="mysqlnd"
2719 -
2720 - our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
2721 -
2722 - local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock"
2723 - if use mysql || use mysqli ; then
2724 - our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") )
2725 - fi
2726 -
2727 - # ODBC support
2728 - our_conf+=(
2729 - $(use_with odbc unixODBC "${EPREFIX}/usr")
2730 - $(use_with iodbc iodbc "${EPREFIX}/usr")
2731 - )
2732 -
2733 - # Oracle support
2734 - our_conf+=( $(use_with oci8-instant-client oci8) )
2735 -
2736 - # PDO support
2737 - if use pdo ; then
2738 - our_conf+=(
2739 - $(use_with mssql pdo-dblib "${EPREFIX}/usr")
2740 - $(use_with mysql pdo-mysql "${mysqllib}")
2741 - $(use_with postgres pdo-pgsql)
2742 - $(use_with sqlite pdo-sqlite "${EPREFIX}/usr")
2743 - $(use_with firebird pdo-firebird "${EPREFIX}/usr")
2744 - $(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr")
2745 - $(use_with oci8-instant-client pdo-oci)
2746 - )
2747 - fi
2748 -
2749 - # readline/libedit support
2750 - our_conf+=(
2751 - $(use_with readline readline "${EPREFIX}/usr")
2752 - $(use_with libedit libedit "${EPREFIX}/usr")
2753 - )
2754 -
2755 - # Session support
2756 - if use session ; then
2757 - our_conf+=( $(use_with session-mm mm "${EPREFIX}/usr") )
2758 - else
2759 - our_conf+=( $(use_enable session session) )
2760 - fi
2761 -
2762 - # Use pic for shared modules such as apache2's mod_php
2763 - our_conf+=( --with-pic )
2764 -
2765 - # we use the system copy of pcre
2766 - # --with-pcre-regex affects ext/pcre
2767 - # --with-pcre-dir affects ext/filter and ext/zip
2768 - # --with-pcre-valgrind cannot be enabled with system pcre
2769 - # Many arches don't support pcre-jit
2770 - our_conf+=(
2771 - --with-pcre-regex="${EPREFIX}/usr"
2772 - --with-pcre-dir="${EPREFIX}/usr"
2773 - --without-pcre-valgrind
2774 - --without-pcre-jit
2775 - )
2776 -
2777 - # Catch CFLAGS problems
2778 - # Fixes bug #14067.
2779 - # Changed order to run it in reverse for bug #32022 and #12021.
2780 - replace-cpu-flags "k6*" "i586"
2781 -
2782 - # Cache the ./configure test results between SAPIs.
2783 - our_conf+=( --cache-file="${T}/config.cache" )
2784 -
2785 - # Support user-passed configuration parameters
2786 - our_conf+=( ${EXTRA_ECONF:-} )
2787 -
2788 - # Support the Apache2 extras, they must be set globally for all
2789 - # SAPIs to work correctly, especially for external PHP extensions
2790 -
2791 - local one_sapi
2792 - local sapi
2793 - mkdir -p "${WORKDIR}/sapis-build" || die
2794 - for one_sapi in $SAPIS ; do
2795 - use "${one_sapi}" || continue
2796 - php_set_ini_dir "${one_sapi}"
2797 -
2798 - # The BUILD_DIR variable is used to determine where to output
2799 - # the files that autotools creates. This was all originally
2800 - # based on the autotools-utils eclass.
2801 - BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}"
2802 - cp -a "${S}" "${BUILD_DIR}" || die
2803 - cd "${BUILD_DIR}" || die
2804 -
2805 - local sapi_conf=(
2806 - --with-config-file-path="${PHP_INI_DIR}"
2807 - --with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}"
2808 - )
2809 -
2810 - for sapi in $SAPIS ; do
2811 - case "$sapi" in
2812 - cli|cgi|embed|fpm|phpdbg)
2813 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
2814 - sapi_conf+=( "--enable-${sapi}" )
2815 - if [[ "fpm" == "${sapi}" ]] ; then
2816 - sapi_conf+=(
2817 - $(use_with acl fpm-acl)
2818 - $(use_with systemd fpm-systemd)
2819 - )
2820 - fi
2821 - else
2822 - sapi_conf+=( "--disable-${sapi}" )
2823 - fi
2824 - ;;
2825 -
2826 - apache2)
2827 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
2828 - sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" )
2829 - else
2830 - sapi_conf+=( --without-apxs2 )
2831 - fi
2832 - ;;
2833 - esac
2834 - done
2835 -
2836 - # Construct the $myeconfargs array by concatenating $our_conf
2837 - # (the common args) and $sapi_conf (the SAPI-specific args).
2838 - local myeconfargs=( "${our_conf[@]}" )
2839 - myeconfargs+=( "${sapi_conf[@]}" )
2840 -
2841 - pushd "${BUILD_DIR}" > /dev/null || die
2842 - econf "${myeconfargs[@]}"
2843 - popd > /dev/null || die
2844 - done
2845 -}
2846 -
2847 -src_compile() {
2848 - # snmp seems to run during src_compile, too (bug #324739)
2849 - addpredict /usr/share/snmp/mibs/.index #nowarn
2850 - addpredict /var/lib/net-snmp/mib_indexes #nowarn
2851 -
2852 - local sapi
2853 - for sapi in ${SAPIS} ; do
2854 - if use "${sapi}"; then
2855 - cd "${WORKDIR}/sapis-build/$sapi" || \
2856 - die "Failed to change dir to ${WORKDIR}/sapis-build/$1"
2857 - emake
2858 - fi
2859 - done
2860 -}
2861 -
2862 -src_install() {
2863 - # see bug #324739 for what happens when we don't have that
2864 - addpredict /usr/share/snmp/mibs/.index #nowarn
2865 -
2866 - # grab the first SAPI that got built and install common files from there
2867 - local first_sapi="", sapi=""
2868 - for sapi in $SAPIS ; do
2869 - if use $sapi ; then
2870 - first_sapi=$sapi
2871 - break
2872 - fi
2873 - done
2874 -
2875 - # Makefile forgets to create this before trying to write to it...
2876 - dodir "${PHP_DESTDIR#${EPREFIX}}/bin"
2877 -
2878 - # Install php environment (without any sapis)
2879 - cd "${WORKDIR}/sapis-build/$first_sapi" || die
2880 - emake INSTALL_ROOT="${D}" \
2881 - install-build install-headers install-programs
2882 -
2883 - local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)"
2884 -
2885 - # Create the directory where we'll put version-specific php scripts
2886 - keepdir "/usr/share/php${PHP_MV}"
2887 -
2888 - local file=""
2889 - local sapi_list=""
2890 -
2891 - for sapi in ${SAPIS}; do
2892 - if use "${sapi}" ; then
2893 - einfo "Installing SAPI: ${sapi}"
2894 - cd "${WORKDIR}/sapis-build/${sapi}" || die
2895 -
2896 - if [[ "${sapi}" == "apache2" ]] ; then
2897 - # We're specifically not using emake install-sapi as libtool
2898 - # may cause unnecessary relink failures (see bug #351266)
2899 - insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/"
2900 - newins ".libs/libphp${PHP_MV}$(get_libname)" \
2901 - "libphp${PHP_MV}$(get_libname)"
2902 - keepdir "/usr/$(get_libdir)/apache2/modules"
2903 - else
2904 - # needed each time, php_install_ini would reset it
2905 - local dest="${PHP_DESTDIR#${EPREFIX}}"
2906 - into "${dest}"
2907 - case "$sapi" in
2908 - cli)
2909 - source="sapi/cli/php"
2910 - # Install the "phar" archive utility.
2911 - if use phar ; then
2912 - emake INSTALL_ROOT="${D}" install-pharcmd
2913 - dosym "..${dest#/usr}/bin/phar" "/usr/bin/phar${SLOT}"
2914 - fi
2915 - ;;
2916 - cgi)
2917 - source="sapi/cgi/php-cgi"
2918 - ;;
2919 - fpm)
2920 - source="sapi/fpm/php-fpm"
2921 - ;;
2922 - embed)
2923 - source="libs/libphp${PHP_MV}$(get_libname)"
2924 - ;;
2925 - phpdbg)
2926 - source="sapi/phpdbg/phpdbg"
2927 - ;;
2928 - *)
2929 - die "unhandled sapi in src_install"
2930 - ;;
2931 - esac
2932 -
2933 - if [[ "${source}" == *"$(get_libname)" ]]; then
2934 - dolib.so "${source}"
2935 - else
2936 - dobin "${source}"
2937 - local name="$(basename ${source})"
2938 - dosym "..${dest#/usr}/bin/${name}" "/usr/bin/${name}${SLOT}"
2939 - fi
2940 - fi
2941 -
2942 - php_install_ini "${sapi}"
2943 -
2944 - # construct correct SAPI string for php-config
2945 - # thanks to ferringb for the bash voodoo
2946 - if [[ "${sapi}" == "apache2" ]]; then
2947 - sapi_list="${sapi_list:+${sapi_list} }apache2handler"
2948 - else
2949 - sapi_list="${sapi_list:+${sapi_list} }${sapi}"
2950 - fi
2951 - fi
2952 - done
2953 -
2954 - # Installing opcache module
2955 - if use opcache ; then
2956 - into "${PHP_DESTDIR#${EPREFIX}}"
2957 - dolib.so "modules/opcache$(get_libname)"
2958 - fi
2959 -
2960 - # Install env.d files
2961 - newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}"
2962 - sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
2963 - sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
2964 -
2965 - # set php-config variable correctly (bug #278439)
2966 - sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \
2967 - "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die
2968 -
2969 - if use fpm ; then
2970 - if use systemd; then
2971 - systemd_newunit "${FILESDIR}/php-fpm_at.service" \
2972 - "php-fpm@${SLOT}.service"
2973 - else
2974 - systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \
2975 - "php-fpm@${SLOT}.service"
2976 - fi
2977 - fi
2978 -}
2979 -
2980 -src_test() {
2981 - echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
2982 - PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
2983 - if [[ ! -x "${PHP_BIN}" ]] ; then
2984 - ewarn "Test phase requires USE=cli, skipping"
2985 - return
2986 - else
2987 - export TEST_PHP_EXECUTABLE="${PHP_BIN}"
2988 - fi
2989 -
2990 - if [[ -x "${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" ]] ; then
2991 - export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi"
2992 - fi
2993 -
2994 - if [[ -x "${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" ]] ; then
2995 - export TEST_PHPDBG_EXECUTABLE="${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg"
2996 - fi
2997 -
2998 - REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \
2999 - "session.save_path=${T}" \
3000 - "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \
3001 - "session.save_path=${T}"
3002 -
3003 - for name in ${EXPECTED_TEST_FAILURES}; do
3004 - mv "${name}.out" "${name}.out.orig" 2>/dev/null || die
3005 - done
3006 -
3007 - local failed="$(find -name '*.out')"
3008 - if [[ ${failed} != "" ]] ; then
3009 - ewarn "The following test cases failed unexpectedly:"
3010 - for name in ${failed}; do
3011 - ewarn " ${name/.out/}"
3012 - done
3013 - else
3014 - einfo "No unexpected test failures, all fine"
3015 - fi
3016 -
3017 - if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
3018 - local passed=""
3019 - for name in ${EXPECTED_TEST_FAILURES}; do
3020 - [[ -f "${name}.diff" ]] && continue
3021 - passed="${passed} ${name}"
3022 - done
3023 - if [[ ${passed} != "" ]] ; then
3024 - einfo "The following test cases passed unexpectedly:"
3025 - for name in ${passed}; do
3026 - ewarn " ${passed}"
3027 - done
3028 - else
3029 - einfo "None of the known-to-fail tests passed, all fine"
3030 - fi
3031 - fi
3032 -}
3033 -
3034 -pkg_postinst() {
3035 - # Output some general info to the user
3036 - if use apache2 ; then
3037 - elog
3038 - elog "To enable PHP in apache, you will need to add \"-D PHP\" to"
3039 - elog "your apache2 command. OpenRC users can append that string to"
3040 - elog "APACHE2_OPTS in /etc/conf.d/apache2."
3041 - elog
3042 - elog "The apache module configuration file 70_mod_php.conf is"
3043 - elog "provided (and maintained) by eselect-php."
3044 - elog
3045 - fi
3046 -
3047 - # Create the symlinks for php
3048 - local m
3049 - for m in ${SAPIS}; do
3050 - [[ ${m} == 'embed' ]] && continue;
3051 - if use $m ; then
3052 - local ci=$(eselect php show $m)
3053 - if [[ -z $ci ]]; then
3054 - eselect php set $m php${SLOT} || die
3055 - einfo "Switched ${m} to use php:${SLOT}"
3056 - einfo
3057 - elif [[ $ci != "php${SLOT}" ]] ; then
3058 - elog "To switch $m to use php:${SLOT}, run"
3059 - elog " eselect php set $m php${SLOT}"
3060 - elog
3061 - fi
3062 - fi
3063 - done
3064 -
3065 - # Remove dead symlinks for SAPIs that were just disabled. For
3066 - # example, if the user has the cgi SAPI enabled, then he has an
3067 - # eselect-php symlink for it. If he later reinstalls PHP with
3068 - # USE="-cgi", that symlink will break. This call to eselect is
3069 - # supposed to remove that dead link per bug 572436.
3070 - eselect php cleanup || die
3071 -
3072 - if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then
3073 - elog "To build extensions for this version of PHP, you will need to"
3074 - elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable."
3075 - elog
3076 - fi
3077 -
3078 - # Warn about the removal of PHP_INI_VERSION if the user has it set.
3079 - if [[ -n "${PHP_INI_VERSION}" ]]; then
3080 - ewarn 'The PHP_INI_VERSION variable has been phased out. You may'
3081 - ewarn 'remove it from your configuration at your convenience. See'
3082 - ewarn
3083 - ewarn ' https://bugs.gentoo.org/611214'
3084 - ewarn
3085 - ewarn 'for more information.'
3086 - fi
3087 -
3088 - elog "For details on how version slotting works, please see"
3089 - elog "the wiki:"
3090 - elog
3091 - elog " https://wiki.gentoo.org/wiki/PHP"
3092 - elog
3093 -}
3094 -
3095 -pkg_postrm() {
3096 - # This serves two purposes. First, if we have just removed the last
3097 - # installed version of PHP, then this will remove any dead symlinks
3098 - # belonging to eselect-php. Second, if a user upgrades slots from
3099 - # (say) 5.6 to 7.0 and depcleans the old slot, then this will update
3100 - # his existing symlinks to point to the new 7.0 installation. The
3101 - # latter is bug 432962.
3102 - #
3103 - # Note: the eselect-php package may not be installed at this point,
3104 - # so we can't die() if this command fails.
3105 - eselect php cleanup
3106 -}
3107
3108 diff --git a/dev-lang/php/php-7.3.20.ebuild b/dev-lang/php/php-7.3.20.ebuild
3109 deleted file mode 100644
3110 index 4583dedfe50..00000000000
3111 --- a/dev-lang/php/php-7.3.20.ebuild
3112 +++ /dev/null
3113 @@ -1,760 +0,0 @@
3114 -# Copyright 1999-2020 Gentoo Authors
3115 -# Distributed under the terms of the GNU General Public License v2
3116 -
3117 -EAPI="7"
3118 -
3119 -inherit flag-o-matic systemd autotools
3120 -
3121 -MY_PV=${PV/_rc/RC}
3122 -DESCRIPTION="The PHP language runtime engine"
3123 -HOMEPAGE="https://www.php.net/"
3124 -SRC_URI="https://www.php.net/distributions/${P}.tar.xz"
3125 -
3126 -LICENSE="PHP-3.01
3127 - BSD
3128 - Zend-2.0
3129 - bcmath? ( LGPL-2.1+ )
3130 - fpm? ( BSD-2 )
3131 - gd? ( gd )
3132 - unicode? ( BSD-2 LGPL-2.1 )"
3133 -
3134 -SLOT="$(ver_cut 1-2)"
3135 -KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
3136 -
3137 -S="${WORKDIR}/${PN}-${MY_PV}"
3138 -
3139 -# We can build the following SAPIs in the given order
3140 -SAPIS="embed cli cgi fpm apache2 phpdbg"
3141 -
3142 -# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
3143 -IUSE="${IUSE}
3144 - ${SAPIS/cli/+cli}
3145 - threads"
3146 -
3147 -IUSE="${IUSE} acl argon2 bcmath berkdb bzip2 calendar cdb cjk
3148 - coverage +ctype curl debug
3149 - enchant exif +fileinfo +filter firebird
3150 - +flatfile ftp gd gdbm gmp +hash +iconv imap inifile
3151 - intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl lmdb
3152 - mhash mssql mysql mysqli nls
3153 - oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
3154 - readline recode selinux +session session-mm sharedmem
3155 - +simplexml snmp soap sockets sodium spell sqlite ssl
3156 - sysvipc systemd test tidy +tokenizer tokyocabinet truetype unicode wddx webp
3157 - +xml xmlreader xmlwriter xmlrpc xpm xslt zip zip-encryption zlib"
3158 -
3159 -# The supported (that is, autodetected) versions of BDB are listed in
3160 -# the ./configure script. Other versions *work*, but we need to stick to
3161 -# the ones that can be detected to avoid a repeat of bug #564824.
3162 -COMMON_DEPEND="
3163 - >=app-eselect/eselect-php-0.9.1[apache2?,fpm?]
3164 - >=dev-libs/libpcre2-10.30[unicode]
3165 - fpm? ( acl? ( sys-apps/acl ) )
3166 - apache2? ( www-servers/apache[apache2_modules_unixd(+),threads=] )
3167 - argon2? ( app-crypt/argon2:= )
3168 - berkdb? ( || ( sys-libs/db:5.3
3169 - sys-libs/db:5.1
3170 - sys-libs/db:4.8
3171 - sys-libs/db:4.7
3172 - sys-libs/db:4.6
3173 - sys-libs/db:4.5 ) )
3174 - bzip2? ( app-arch/bzip2:0= )
3175 - cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
3176 - coverage? ( dev-util/lcov )
3177 - curl? ( >=net-misc/curl-7.10.5 )
3178 - enchant? ( <app-text/enchant-2.0:0 )
3179 - firebird? ( dev-db/firebird )
3180 - gd? ( >=virtual/jpeg-0-r3:0 media-libs/libpng:0= >=sys-libs/zlib-1.2.0.4 )
3181 - gdbm? ( >=sys-libs/gdbm-1.8.0:0= )
3182 - gmp? ( dev-libs/gmp:0= )
3183 - iconv? ( virtual/libiconv )
3184 - imap? ( >=virtual/imap-c-client-2[kerberos=,ssl=] )
3185 - intl? ( dev-libs/icu:= )
3186 - iodbc? ( dev-db/libiodbc )
3187 - kerberos? ( virtual/krb5 )
3188 - ldap? ( >=net-nds/openldap-1.2.11 )
3189 - ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 )
3190 - libedit? ( dev-libs/libedit )
3191 - lmdb? ( dev-db/lmdb:= )
3192 - mssql? ( dev-db/freetds[mssql] )
3193 - nls? ( sys-devel/gettext )
3194 - oci8-instant-client? ( dev-db/oracle-instantclient-basic )
3195 - odbc? ( >=dev-db/unixODBC-1.8.13 )
3196 - postgres? ( dev-db/postgresql:* )
3197 - qdbm? ( dev-db/qdbm )
3198 - readline? ( sys-libs/readline:0= )
3199 - recode? ( app-text/recode )
3200 - session-mm? ( dev-libs/mm )
3201 - simplexml? ( >=dev-libs/libxml2-2.6.8 )
3202 - snmp? ( >=net-analyzer/net-snmp-5.2 )
3203 - soap? ( >=dev-libs/libxml2-2.6.8 )
3204 - sodium? ( dev-libs/libsodium:= )
3205 - spell? ( >=app-text/aspell-0.50 )
3206 - sqlite? ( >=dev-db/sqlite-3.7.6.3 )
3207 - ssl? (
3208 - !libressl? ( >=dev-libs/openssl-1.0.1:0= )
3209 - libressl? ( dev-libs/libressl:0= )
3210 - )
3211 - tidy? ( || ( app-text/tidy-html5 app-text/htmltidy ) )
3212 - tokyocabinet? ( dev-db/tokyocabinet )
3213 - truetype? ( =media-libs/freetype-2* )
3214 - unicode? ( dev-libs/oniguruma:= )
3215 - wddx? ( >=dev-libs/libxml2-2.6.8 )
3216 - webp? ( media-libs/libwebp:0= )
3217 - xml? ( >=dev-libs/libxml2-2.6.8 )
3218 - xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
3219 - xmlreader? ( >=dev-libs/libxml2-2.6.8 )
3220 - xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
3221 - xpm? ( x11-libs/libXpm )
3222 - xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
3223 - zip? ( >=sys-libs/zlib-1.2.0.4:0= )
3224 - zip-encryption? ( >=dev-libs/libzip-1.2.0:= )
3225 - zlib? ( >=sys-libs/zlib-1.2.0.4:0= )
3226 -"
3227 -
3228 -RDEPEND="${COMMON_DEPEND}
3229 - virtual/mta
3230 - fpm? (
3231 - selinux? ( sec-policy/selinux-phpfpm )
3232 - systemd? ( sys-apps/systemd ) )"
3233 -
3234 -# Bison isn't actually needed when building from a release tarball
3235 -# However, the configure script will warn if it's absent or if you
3236 -# have an incompatible version installed. See bug 593278.
3237 -DEPEND="${COMMON_DEPEND}
3238 - app-arch/xz-utils
3239 - >=sys-devel/bison-3.0.1"
3240 -
3241 -BDEPEND="virtual/pkgconfig"
3242 -
3243 -# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
3244 -REQUIRED_USE="
3245 - || ( cli cgi fpm apache2 embed phpdbg )
3246 - cli? ( ^^ ( readline libedit ) )
3247 - truetype? ( gd zlib )
3248 - webp? ( gd zlib )
3249 - cjk? ( gd zlib )
3250 - exif? ( gd zlib )
3251 - xpm? ( gd zlib )
3252 - gd? ( zlib )
3253 - simplexml? ( xml )
3254 - soap? ( xml )
3255 - wddx? ( xml )
3256 - xmlrpc? ( || ( xml iconv ) )
3257 - xmlreader? ( xml )
3258 - xslt? ( xml )
3259 - ldap-sasl? ( ldap )
3260 - mhash? ( hash )
3261 - phar? ( hash )
3262 - qdbm? ( !gdbm )
3263 - readline? ( !libedit )
3264 - recode? ( !imap !mysqli !mysql )
3265 - session-mm? ( session !threads )
3266 - mysql? ( || ( mysqli pdo ) )
3267 - zip-encryption? ( zip )
3268 -"
3269 -
3270 -RESTRICT="!test? ( test )"
3271 -
3272 -PATCHES=(
3273 - "${FILESDIR}/php-freetype-2.9.1.patch"
3274 -)
3275 -
3276 -PHP_MV="$(ver_cut 1)"
3277 -
3278 -php_install_ini() {
3279 - local phpsapi="${1}"
3280 -
3281 - # work out where we are installing the ini file
3282 - php_set_ini_dir "${phpsapi}"
3283 -
3284 - # Always install the production INI file, bug 611214.
3285 - local phpinisrc="php.ini-production-${phpsapi}"
3286 - cp php.ini-production "${phpinisrc}" || die
3287 -
3288 - # default to /tmp for save_path, bug #282768
3289 - sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die
3290 -
3291 - # Set the extension dir
3292 - sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \
3293 - -i "${phpinisrc}" || die
3294 -
3295 - # Set the include path to point to where we want to find PEAR packages
3296 - sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die
3297 -
3298 - insinto "${PHP_INI_DIR#${EPREFIX}}"
3299 - newins "${phpinisrc}" php.ini
3300 -
3301 - elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}"
3302 - elog
3303 -
3304 - dodir "${PHP_EXT_INI_DIR#${EPREFIX}}"
3305 - dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}"
3306 -
3307 - if use opcache; then
3308 - elog "Adding opcache to $PHP_EXT_INI_DIR"
3309 - echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \
3310 - "${D}/${PHP_EXT_INI_DIR}"/opcache.ini
3311 - dosym "../ext/opcache.ini" \
3312 - "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini"
3313 - fi
3314 -
3315 - # SAPI-specific handling
3316 - if [[ "${sapi}" == "fpm" ]] ; then
3317 - einfo "Installing FPM config files php-fpm.conf and www.conf"
3318 - insinto "${PHP_INI_DIR#${EPREFIX}}"
3319 - doins sapi/fpm/php-fpm.conf
3320 - insinto "${PHP_INI_DIR#${EPREFIX}}/fpm.d"
3321 - doins sapi/fpm/www.conf
3322 - fi
3323 -
3324 - dodoc php.ini-{development,production}
3325 -}
3326 -
3327 -php_set_ini_dir() {
3328 - PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}"
3329 - PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
3330 - PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
3331 -}
3332 -
3333 -src_prepare() {
3334 - default
3335 -
3336 - # In php-7.x, the FPM pool configuration files have been split off
3337 - # of the main config. By default the pool config files go in
3338 - # e.g. /etc/php-fpm.d, which isn't slotted. So here we move the
3339 - # include directory to a subdirectory "fpm.d" of $PHP_INI_DIR. Later
3340 - # we'll install the pool configuration file "www.conf" there.
3341 - php_set_ini_dir fpm
3342 - sed -i "s~^include=.*$~include=${PHP_INI_DIR}/fpm.d/*.conf~" \
3343 - sapi/fpm/php-fpm.conf.in \
3344 - || die 'failed to move the include directory in php-fpm.conf'
3345 -
3346 - # Bug 669566 - necessary so that build tools are updated for commands like pecl
3347 - # Force rebuilding aclocal.m4
3348 - rm -f aclocal.m4 || die "failed to remove aclocal.m4 in src_prepare"
3349 - eautoreconf
3350 -}
3351 -
3352 -src_configure() {
3353 - addpredict /usr/share/snmp/mibs/.index #nowarn
3354 - addpredict /var/lib/net-snmp/mib_indexes #nowarn
3355 -
3356 - PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
3357 -
3358 - # The php-fpm config file wants localstatedir to be ${EPREFIX}/var
3359 - # and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002.
3360 - local our_conf=(
3361 - --prefix="${PHP_DESTDIR}"
3362 - --mandir="${PHP_DESTDIR}/man"
3363 - --infodir="${PHP_DESTDIR}/info"
3364 - --libdir="${PHP_DESTDIR}/lib"
3365 - --with-libdir="$(get_libdir)"
3366 - --localstatedir="${EPREFIX}/var"
3367 - --without-pear
3368 - $(use_enable threads maintainer-zts)
3369 - )
3370 -
3371 - our_conf+=(
3372 - $(use_with argon2 password-argon2 "${EPREFIX}/usr")
3373 - $(use_enable bcmath bcmath)
3374 - $(use_with bzip2 bz2 "${EPREFIX}/usr")
3375 - $(use_enable calendar calendar)
3376 - $(use_enable coverage gcov)
3377 - $(use_enable ctype ctype)
3378 - $(use_with curl curl "${EPREFIX}/usr")
3379 - $(use_enable xml dom)
3380 - $(use_with enchant enchant "${EPREFIX}/usr")
3381 - $(use_enable exif exif)
3382 - $(use_enable fileinfo fileinfo)
3383 - $(use_enable filter filter)
3384 - $(use_enable ftp ftp)
3385 - $(use_with nls gettext "${EPREFIX}/usr")
3386 - $(use_with gmp gmp "${EPREFIX}/usr")
3387 - $(use_enable hash hash)
3388 - $(use_with mhash mhash "${EPREFIX}/usr")
3389 - $(use_with iconv iconv \
3390 - $(use elibc_glibc || use elibc_musl || use elibc_FreeBSD || echo "${EPREFIX}/usr"))
3391 - $(use_enable intl intl)
3392 - $(use_enable ipv6 ipv6)
3393 - $(use_enable json json)
3394 - $(use_with kerberos kerberos "${EPREFIX}/usr")
3395 - $(use_enable xml libxml)
3396 - $(use_with xml libxml-dir "${EPREFIX}/usr")
3397 - $(use_enable unicode mbstring)
3398 - $(use_with unicode onig "${EPREFIX}/usr")
3399 - $(use_with ssl openssl "${EPREFIX}/usr")
3400 - $(use_with ssl openssl-dir "${EPREFIX}/usr")
3401 - $(use_enable pcntl pcntl)
3402 - $(use_enable phar phar)
3403 - $(use_enable pdo pdo)
3404 - $(use_enable opcache opcache)
3405 - $(use_with postgres pgsql "${EPREFIX}/usr")
3406 - $(use_enable posix posix)
3407 - $(use_with spell pspell "${EPREFIX}/usr")
3408 - $(use_with recode recode "${EPREFIX}/usr")
3409 - $(use_enable simplexml simplexml)
3410 - $(use_enable sharedmem shmop)
3411 - $(use_with snmp snmp "${EPREFIX}/usr")
3412 - $(use_enable soap soap)
3413 - $(use_enable sockets sockets)
3414 - $(use_with sodium sodium "${EPREFIX}/usr")
3415 - $(use_with sqlite sqlite3 "${EPREFIX}/usr")
3416 - $(use_enable sysvipc sysvmsg)
3417 - $(use_enable sysvipc sysvsem)
3418 - $(use_enable sysvipc sysvshm)
3419 - $(use_with tidy tidy "${EPREFIX}/usr")
3420 - $(use_enable tokenizer tokenizer)
3421 - $(use_enable wddx wddx)
3422 - $(use_enable xml xml)
3423 - $(use_enable xmlreader xmlreader)
3424 - $(use_enable xmlwriter xmlwriter)
3425 - $(use_with xmlrpc xmlrpc)
3426 - $(use_with xslt xsl "${EPREFIX}/usr")
3427 - $(use_enable zip zip)
3428 - $(use_with zip-encryption libzip "${EPREFIX}/usr")
3429 - $(use_with zlib zlib "${EPREFIX}/usr")
3430 - $(use_enable debug debug)
3431 - )
3432 -
3433 - # DBA support
3434 - if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
3435 - || use qdbm || use lmdb || use tokyocabinet ; then
3436 - our_conf+=( "--enable-dba${shared}" )
3437 - fi
3438 -
3439 - # DBA drivers support
3440 - our_conf+=(
3441 - $(use_with cdb cdb)
3442 - $(use_with berkdb db4 "${EPREFIX}/usr")
3443 - $(use_enable flatfile flatfile)
3444 - $(use_with gdbm gdbm "${EPREFIX}/usr")
3445 - $(use_enable inifile inifile)
3446 - $(use_with qdbm qdbm "${EPREFIX}/usr")
3447 - $(use_with lmdb lmdb "${EPREFIX}/usr")
3448 - )
3449 -
3450 - # Support for the GD graphics library
3451 - our_conf+=(
3452 - $(use_with truetype freetype-dir "${EPREFIX}/usr")
3453 - $(use_enable cjk gd-jis-conv)
3454 - $(use_with gd jpeg-dir "${EPREFIX}/usr")
3455 - $(use_with gd png-dir "${EPREFIX}/usr")
3456 - $(use_with xpm xpm-dir "${EPREFIX}/usr")
3457 - )
3458 - if use webp; then
3459 - our_conf+=( --with-webp-dir="${EPREFIX}/usr" )
3460 - fi
3461 - # enable gd last, so configure can pick up the previous settings
3462 - our_conf+=( $(use_with gd gd) )
3463 -
3464 - # IMAP support
3465 - if use imap ; then
3466 - our_conf+=(
3467 - $(use_with imap imap "${EPREFIX}/usr")
3468 - $(use_with ssl imap-ssl "${EPREFIX}/usr")
3469 - )
3470 - fi
3471 -
3472 - # Interbase/firebird support
3473 - our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") )
3474 -
3475 - # LDAP support
3476 - if use ldap ; then
3477 - our_conf+=(
3478 - $(use_with ldap ldap "${EPREFIX}/usr")
3479 - $(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr")
3480 - )
3481 - fi
3482 -
3483 - # MySQL support
3484 - local mysqllib="mysqlnd"
3485 - local mysqlilib="mysqlnd"
3486 -
3487 - our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
3488 -
3489 - local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock"
3490 - if use mysql || use mysqli ; then
3491 - our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") )
3492 - fi
3493 -
3494 - # ODBC support
3495 - our_conf+=(
3496 - $(use_with odbc unixODBC "${EPREFIX}/usr")
3497 - $(use_with iodbc iodbc "${EPREFIX}/usr")
3498 - )
3499 -
3500 - # Oracle support
3501 - our_conf+=( $(use_with oci8-instant-client oci8) )
3502 -
3503 - # PDO support
3504 - if use pdo ; then
3505 - our_conf+=(
3506 - $(use_with mssql pdo-dblib "${EPREFIX}/usr")
3507 - $(use_with mysql pdo-mysql "${mysqllib}")
3508 - $(use_with postgres pdo-pgsql)
3509 - $(use_with sqlite pdo-sqlite "${EPREFIX}/usr")
3510 - $(use_with firebird pdo-firebird "${EPREFIX}/usr")
3511 - $(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr")
3512 - $(use_with oci8-instant-client pdo-oci)
3513 - )
3514 - fi
3515 -
3516 - # readline/libedit support
3517 - our_conf+=(
3518 - $(use_with readline readline "${EPREFIX}/usr")
3519 - $(use_with libedit libedit "${EPREFIX}/usr")
3520 - )
3521 -
3522 - # Session support
3523 - if use session ; then
3524 - our_conf+=( $(use_with session-mm mm "${EPREFIX}/usr") )
3525 - else
3526 - our_conf+=( $(use_enable session session) )
3527 - fi
3528 -
3529 - # Use pic for shared modules such as apache2's mod_php
3530 - our_conf+=( --with-pic )
3531 -
3532 - # we use the system copy of pcre
3533 - # --with-pcre-regex affects ext/pcre
3534 - # --with-pcre-dir affects ext/filter and ext/zip
3535 - # --with-pcre-valgrind cannot be enabled with system pcre
3536 - # Many arches don't support pcre-jit
3537 - our_conf+=(
3538 - --with-pcre-regex="${EPREFIX}/usr"
3539 - --with-pcre-dir="${EPREFIX}/usr"
3540 - --without-pcre-valgrind
3541 - --without-pcre-jit
3542 - )
3543 -
3544 - # Catch CFLAGS problems
3545 - # Fixes bug #14067.
3546 - # Changed order to run it in reverse for bug #32022 and #12021.
3547 - replace-cpu-flags "k6*" "i586"
3548 -
3549 - # Cache the ./configure test results between SAPIs.
3550 - our_conf+=( --cache-file="${T}/config.cache" )
3551 -
3552 - # Support user-passed configuration parameters
3553 - our_conf+=( ${EXTRA_ECONF:-} )
3554 -
3555 - # Support the Apache2 extras, they must be set globally for all
3556 - # SAPIs to work correctly, especially for external PHP extensions
3557 -
3558 - local one_sapi
3559 - local sapi
3560 - mkdir -p "${WORKDIR}/sapis-build" || die
3561 - for one_sapi in $SAPIS ; do
3562 - use "${one_sapi}" || continue
3563 - php_set_ini_dir "${one_sapi}"
3564 -
3565 - # The BUILD_DIR variable is used to determine where to output
3566 - # the files that autotools creates. This was all originally
3567 - # based on the autotools-utils eclass.
3568 - BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}"
3569 - cp -a "${S}" "${BUILD_DIR}" || die
3570 - cd "${BUILD_DIR}" || die
3571 -
3572 - local sapi_conf=(
3573 - --with-config-file-path="${PHP_INI_DIR}"
3574 - --with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}"
3575 - )
3576 -
3577 - for sapi in $SAPIS ; do
3578 - case "$sapi" in
3579 - cli|cgi|embed|fpm|phpdbg)
3580 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
3581 - sapi_conf+=( "--enable-${sapi}" )
3582 - if [[ "fpm" == "${sapi}" ]] ; then
3583 - sapi_conf+=(
3584 - $(use_with acl fpm-acl)
3585 - $(use_with systemd fpm-systemd)
3586 - )
3587 - fi
3588 - else
3589 - sapi_conf+=( "--disable-${sapi}" )
3590 - fi
3591 - ;;
3592 -
3593 - apache2)
3594 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
3595 - sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" )
3596 - else
3597 - sapi_conf+=( --without-apxs2 )
3598 - fi
3599 - ;;
3600 - esac
3601 - done
3602 -
3603 - # Construct the $myeconfargs array by concatenating $our_conf
3604 - # (the common args) and $sapi_conf (the SAPI-specific args).
3605 - local myeconfargs=( "${our_conf[@]}" )
3606 - myeconfargs+=( "${sapi_conf[@]}" )
3607 -
3608 - pushd "${BUILD_DIR}" > /dev/null || die
3609 - econf "${myeconfargs[@]}"
3610 - popd > /dev/null || die
3611 - done
3612 -}
3613 -
3614 -src_compile() {
3615 - # snmp seems to run during src_compile, too (bug #324739)
3616 - addpredict /usr/share/snmp/mibs/.index #nowarn
3617 - addpredict /var/lib/net-snmp/mib_indexes #nowarn
3618 -
3619 - local sapi
3620 - for sapi in ${SAPIS} ; do
3621 - if use "${sapi}"; then
3622 - cd "${WORKDIR}/sapis-build/$sapi" || \
3623 - die "Failed to change dir to ${WORKDIR}/sapis-build/$1"
3624 - emake
3625 - fi
3626 - done
3627 -}
3628 -
3629 -src_install() {
3630 - # see bug #324739 for what happens when we don't have that
3631 - addpredict /usr/share/snmp/mibs/.index #nowarn
3632 -
3633 - # grab the first SAPI that got built and install common files from there
3634 - local first_sapi="", sapi=""
3635 - for sapi in $SAPIS ; do
3636 - if use $sapi ; then
3637 - first_sapi=$sapi
3638 - break
3639 - fi
3640 - done
3641 -
3642 - # Makefile forgets to create this before trying to write to it...
3643 - dodir "${PHP_DESTDIR#${EPREFIX}}/bin"
3644 -
3645 - # Install php environment (without any sapis)
3646 - cd "${WORKDIR}/sapis-build/$first_sapi" || die
3647 - emake INSTALL_ROOT="${D}" \
3648 - install-build install-headers install-programs
3649 -
3650 - local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)"
3651 -
3652 - # Create the directory where we'll put version-specific php scripts
3653 - keepdir "/usr/share/php${PHP_MV}"
3654 -
3655 - local file=""
3656 - local sapi_list=""
3657 -
3658 - for sapi in ${SAPIS}; do
3659 - if use "${sapi}" ; then
3660 - einfo "Installing SAPI: ${sapi}"
3661 - cd "${WORKDIR}/sapis-build/${sapi}" || die
3662 -
3663 - if [[ "${sapi}" == "apache2" ]] ; then
3664 - # We're specifically not using emake install-sapi as libtool
3665 - # may cause unnecessary relink failures (see bug #351266)
3666 - insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/"
3667 - newins ".libs/libphp${PHP_MV}$(get_libname)" \
3668 - "libphp${PHP_MV}$(get_libname)"
3669 - keepdir "/usr/$(get_libdir)/apache2/modules"
3670 - else
3671 - # needed each time, php_install_ini would reset it
3672 - local dest="${PHP_DESTDIR#${EPREFIX}}"
3673 - into "${dest}"
3674 - case "$sapi" in
3675 - cli)
3676 - source="sapi/cli/php"
3677 - # Install the "phar" archive utility.
3678 - if use phar ; then
3679 - emake INSTALL_ROOT="${D}" install-pharcmd
3680 - dosym "..${dest#/usr}/bin/phar" "/usr/bin/phar${SLOT}"
3681 - fi
3682 - ;;
3683 - cgi)
3684 - source="sapi/cgi/php-cgi"
3685 - ;;
3686 - fpm)
3687 - source="sapi/fpm/php-fpm"
3688 - ;;
3689 - embed)
3690 - source="libs/libphp${PHP_MV}$(get_libname)"
3691 - ;;
3692 - phpdbg)
3693 - source="sapi/phpdbg/phpdbg"
3694 - ;;
3695 - *)
3696 - die "unhandled sapi in src_install"
3697 - ;;
3698 - esac
3699 -
3700 - if [[ "${source}" == *"$(get_libname)" ]]; then
3701 - dolib.so "${source}"
3702 - else
3703 - dobin "${source}"
3704 - local name="$(basename ${source})"
3705 - dosym "..${dest#/usr}/bin/${name}" "/usr/bin/${name}${SLOT}"
3706 - fi
3707 - fi
3708 -
3709 - php_install_ini "${sapi}"
3710 -
3711 - # construct correct SAPI string for php-config
3712 - # thanks to ferringb for the bash voodoo
3713 - if [[ "${sapi}" == "apache2" ]]; then
3714 - sapi_list="${sapi_list:+${sapi_list} }apache2handler"
3715 - else
3716 - sapi_list="${sapi_list:+${sapi_list} }${sapi}"
3717 - fi
3718 - fi
3719 - done
3720 -
3721 - # Installing opcache module
3722 - if use opcache ; then
3723 - into "${PHP_DESTDIR#${EPREFIX}}"
3724 - dolib.so "modules/opcache$(get_libname)"
3725 - fi
3726 -
3727 - # Install env.d files
3728 - newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}"
3729 - sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
3730 - sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
3731 -
3732 - # set php-config variable correctly (bug #278439)
3733 - sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \
3734 - "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die
3735 -
3736 - if use fpm ; then
3737 - if use systemd; then
3738 - systemd_newunit "${FILESDIR}/php-fpm_at.service" \
3739 - "php-fpm@${SLOT}.service"
3740 - else
3741 - systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \
3742 - "php-fpm@${SLOT}.service"
3743 - fi
3744 - fi
3745 -}
3746 -
3747 -src_test() {
3748 - echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
3749 - PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
3750 - if [[ ! -x "${PHP_BIN}" ]] ; then
3751 - ewarn "Test phase requires USE=cli, skipping"
3752 - return
3753 - else
3754 - export TEST_PHP_EXECUTABLE="${PHP_BIN}"
3755 - fi
3756 -
3757 - if [[ -x "${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" ]] ; then
3758 - export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi"
3759 - fi
3760 -
3761 - if [[ -x "${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" ]] ; then
3762 - export TEST_PHPDBG_EXECUTABLE="${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg"
3763 - fi
3764 -
3765 - REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \
3766 - "session.save_path=${T}" \
3767 - "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \
3768 - "session.save_path=${T}"
3769 -
3770 - for name in ${EXPECTED_TEST_FAILURES}; do
3771 - mv "${name}.out" "${name}.out.orig" 2>/dev/null || die
3772 - done
3773 -
3774 - local failed="$(find -name '*.out')"
3775 - if [[ ${failed} != "" ]] ; then
3776 - ewarn "The following test cases failed unexpectedly:"
3777 - for name in ${failed}; do
3778 - ewarn " ${name/.out/}"
3779 - done
3780 - else
3781 - einfo "No unexpected test failures, all fine"
3782 - fi
3783 -
3784 - if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
3785 - local passed=""
3786 - for name in ${EXPECTED_TEST_FAILURES}; do
3787 - [[ -f "${name}.diff" ]] && continue
3788 - passed="${passed} ${name}"
3789 - done
3790 - if [[ ${passed} != "" ]] ; then
3791 - einfo "The following test cases passed unexpectedly:"
3792 - for name in ${passed}; do
3793 - ewarn " ${passed}"
3794 - done
3795 - else
3796 - einfo "None of the known-to-fail tests passed, all fine"
3797 - fi
3798 - fi
3799 -}
3800 -
3801 -pkg_postinst() {
3802 - # Output some general info to the user
3803 - if use apache2 ; then
3804 - elog
3805 - elog "To enable PHP in apache, you will need to add \"-D PHP\" to"
3806 - elog "your apache2 command. OpenRC users can append that string to"
3807 - elog "APACHE2_OPTS in /etc/conf.d/apache2."
3808 - elog
3809 - elog "The apache module configuration file 70_mod_php.conf is"
3810 - elog "provided (and maintained) by eselect-php."
3811 - elog
3812 - fi
3813 -
3814 - # Create the symlinks for php
3815 - local m
3816 - for m in ${SAPIS}; do
3817 - [[ ${m} == 'embed' ]] && continue;
3818 - if use $m ; then
3819 - local ci=$(eselect php show $m)
3820 - if [[ -z $ci ]]; then
3821 - eselect php set $m php${SLOT} || die
3822 - einfo "Switched ${m} to use php:${SLOT}"
3823 - einfo
3824 - elif [[ $ci != "php${SLOT}" ]] ; then
3825 - elog "To switch $m to use php:${SLOT}, run"
3826 - elog " eselect php set $m php${SLOT}"
3827 - elog
3828 - fi
3829 - fi
3830 - done
3831 -
3832 - # Remove dead symlinks for SAPIs that were just disabled. For
3833 - # example, if the user has the cgi SAPI enabled, then he has an
3834 - # eselect-php symlink for it. If he later reinstalls PHP with
3835 - # USE="-cgi", that symlink will break. This call to eselect is
3836 - # supposed to remove that dead link per bug 572436.
3837 - eselect php cleanup || die
3838 -
3839 - if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then
3840 - elog "To build extensions for this version of PHP, you will need to"
3841 - elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable."
3842 - elog
3843 - fi
3844 -
3845 - # Warn about the removal of PHP_INI_VERSION if the user has it set.
3846 - if [[ -n "${PHP_INI_VERSION}" ]]; then
3847 - ewarn 'The PHP_INI_VERSION variable has been phased out. You may'
3848 - ewarn 'remove it from your configuration at your convenience. See'
3849 - ewarn
3850 - ewarn ' https://bugs.gentoo.org/611214'
3851 - ewarn
3852 - ewarn 'for more information.'
3853 - fi
3854 -
3855 - elog "For details on how version slotting works, please see"
3856 - elog "the wiki:"
3857 - elog
3858 - elog " https://wiki.gentoo.org/wiki/PHP"
3859 - elog
3860 -}
3861 -
3862 -pkg_postrm() {
3863 - # This serves two purposes. First, if we have just removed the last
3864 - # installed version of PHP, then this will remove any dead symlinks
3865 - # belonging to eselect-php. Second, if a user upgrades slots from
3866 - # (say) 5.6 to 7.0 and depcleans the old slot, then this will update
3867 - # his existing symlinks to point to the new 7.0 installation. The
3868 - # latter is bug 432962.
3869 - #
3870 - # Note: the eselect-php package may not be installed at this point,
3871 - # so we can't die() if this command fails.
3872 - eselect php cleanup
3873 -}
3874
3875 diff --git a/dev-lang/php/php-7.4.6.ebuild b/dev-lang/php/php-7.4.6.ebuild
3876 deleted file mode 100644
3877 index b7203bdf290..00000000000
3878 --- a/dev-lang/php/php-7.4.6.ebuild
3879 +++ /dev/null
3880 @@ -1,750 +0,0 @@
3881 -# Copyright 1999-2020 Gentoo Authors
3882 -# Distributed under the terms of the GNU General Public License v2
3883 -
3884 -EAPI="7"
3885 -
3886 -WANT_AUTOMAKE="none"
3887 -
3888 -inherit flag-o-matic systemd autotools
3889 -
3890 -MY_PV=${PV/_rc/RC}
3891 -DESCRIPTION="The PHP language runtime engine"
3892 -HOMEPAGE="https://www.php.net/"
3893 -SRC_URI="https://www.php.net/distributions/${P}.tar.xz"
3894 -
3895 -LICENSE="PHP-3.01
3896 - BSD
3897 - Zend-2.0
3898 - bcmath? ( LGPL-2.1+ )
3899 - fpm? ( BSD-2 )
3900 - gd? ( gd )
3901 - unicode? ( BSD-2 LGPL-2.1 )"
3902 -
3903 -SLOT="$(ver_cut 1-2)"
3904 -KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
3905 -
3906 -S="${WORKDIR}/${PN}-${MY_PV}"
3907 -
3908 -# We can build the following SAPIs in the given order
3909 -SAPIS="embed cli cgi fpm apache2 phpdbg"
3910 -
3911 -# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
3912 -IUSE="${IUSE}
3913 - ${SAPIS/cli/+cli}
3914 - threads"
3915 -
3916 -IUSE="${IUSE} acl argon2 bcmath berkdb bzip2 calendar cdb cjk
3917 - coverage +ctype curl debug
3918 - enchant exif ffi +fileinfo +filter firebird
3919 - +flatfile ftp gd gdbm gmp +iconv imap inifile
3920 - intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl lmdb
3921 - mhash mssql mysql mysqli nls
3922 - oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
3923 - readline selinux +session session-mm sharedmem
3924 - +simplexml snmp soap sockets sodium spell sqlite ssl
3925 - sysvipc systemd test tidy +tokenizer tokyocabinet truetype unicode webp
3926 - +xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib"
3927 -
3928 -# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
3929 -REQUIRED_USE="
3930 - || ( cli cgi fpm apache2 embed phpdbg )
3931 - cli? ( ^^ ( readline libedit ) )
3932 - !cli? ( ?? ( readline libedit ) )
3933 - truetype? ( gd zlib )
3934 - webp? ( gd zlib )
3935 - cjk? ( gd zlib )
3936 - exif? ( gd zlib )
3937 - xpm? ( gd zlib )
3938 - gd? ( zlib )
3939 - simplexml? ( xml )
3940 - soap? ( xml )
3941 - xmlrpc? ( xml iconv )
3942 - xmlreader? ( xml )
3943 - xmlwriter? ( xml )
3944 - xslt? ( xml )
3945 - ldap-sasl? ( ldap )
3946 - qdbm? ( !gdbm )
3947 - session-mm? ( session !threads )
3948 - mysql? ( || ( mysqli pdo ) )
3949 - firebird? ( pdo )
3950 - mssql? ( pdo )
3951 -"
3952 -
3953 -RESTRICT="!test? ( test )"
3954 -
3955 -# The supported (that is, autodetected) versions of BDB are listed in
3956 -# the ./configure script. Other versions *work*, but we need to stick to
3957 -# the ones that can be detected to avoid a repeat of bug #564824.
3958 -COMMON_DEPEND="
3959 - >=app-eselect/eselect-php-0.9.1[apache2?,fpm?]
3960 - >=dev-libs/libpcre2-10.30[unicode]
3961 - fpm? ( acl? ( sys-apps/acl ) )
3962 - apache2? ( www-servers/apache[apache2_modules_unixd(+),threads=] )
3963 - argon2? ( app-crypt/argon2:= )
3964 - berkdb? ( || ( sys-libs/db:5.3
3965 - sys-libs/db:5.1
3966 - sys-libs/db:4.8
3967 - sys-libs/db:4.7
3968 - sys-libs/db:4.6
3969 - sys-libs/db:4.5 ) )
3970 - bzip2? ( app-arch/bzip2:0= )
3971 - cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
3972 - coverage? ( dev-util/lcov )
3973 - curl? ( >=net-misc/curl-7.10.5 )
3974 - enchant? ( <app-text/enchant-2.0:0 )
3975 - ffi? ( >=dev-libs/libffi-3.0.11 )
3976 - firebird? ( dev-db/firebird )
3977 - gd? ( >=virtual/jpeg-0-r3:0 media-libs/libpng:0= )
3978 - gdbm? ( >=sys-libs/gdbm-1.8.0:0= )
3979 - gmp? ( dev-libs/gmp:0= )
3980 - iconv? ( virtual/libiconv )
3981 - imap? ( >=virtual/imap-c-client-2[kerberos=,ssl=] )
3982 - intl? ( dev-libs/icu:= )
3983 - kerberos? ( virtual/krb5 )
3984 - ldap? ( >=net-nds/openldap-1.2.11 )
3985 - ldap-sasl? ( dev-libs/cyrus-sasl )
3986 - libedit? ( dev-libs/libedit )
3987 - lmdb? ( dev-db/lmdb:= )
3988 - mssql? ( dev-db/freetds[mssql] )
3989 - nls? ( sys-devel/gettext )
3990 - oci8-instant-client? ( dev-db/oracle-instantclient-basic )
3991 - odbc? ( iodbc? ( dev-db/libiodbc ) !iodbc? ( >=dev-db/unixODBC-1.8.13 ) )
3992 - postgres? ( dev-db/postgresql:* )
3993 - qdbm? ( dev-db/qdbm )
3994 - readline? ( sys-libs/readline:0= )
3995 - session-mm? ( dev-libs/mm )
3996 - snmp? ( >=net-analyzer/net-snmp-5.2 )
3997 - sodium? ( dev-libs/libsodium:= )
3998 - spell? ( >=app-text/aspell-0.50 )
3999 - sqlite? ( >=dev-db/sqlite-3.7.6.3 )
4000 - ssl? (
4001 - !libressl? ( >=dev-libs/openssl-1.0.1:0= )
4002 - libressl? ( dev-libs/libressl:0= )
4003 - )
4004 - tidy? ( || ( app-text/tidy-html5 app-text/htmltidy ) )
4005 - tokyocabinet? ( dev-db/tokyocabinet )
4006 - truetype? ( =media-libs/freetype-2* )
4007 - unicode? ( dev-libs/oniguruma:= )
4008 - webp? ( media-libs/libwebp:0= )
4009 - xml? ( >=dev-libs/libxml2-2.7.6 )
4010 - xpm? ( x11-libs/libXpm )
4011 - xslt? ( dev-libs/libxslt )
4012 - zip? ( >=dev-libs/libzip-1.2.0:= )
4013 - zlib? ( >=sys-libs/zlib-1.2.0.4:0= )
4014 -"
4015 -
4016 -RDEPEND="${COMMON_DEPEND}
4017 - virtual/mta
4018 - fpm? (
4019 - selinux? ( sec-policy/selinux-phpfpm )
4020 - systemd? ( sys-apps/systemd ) )"
4021 -
4022 -# Bison isn't actually needed when building from a release tarball
4023 -# However, the configure script will warn if it's absent or if you
4024 -# have an incompatible version installed. See bug 593278.
4025 -DEPEND="${COMMON_DEPEND}
4026 - app-arch/xz-utils
4027 - >=sys-devel/bison-3.0.1"
4028 -
4029 -BDEPEND="virtual/pkgconfig"
4030 -
4031 -PHP_MV="$(ver_cut 1)"
4032 -
4033 -PATCHES=( "${FILESDIR}/php-iodbc-header-location.patch" )
4034 -
4035 -php_install_ini() {
4036 - local phpsapi="${1}"
4037 -
4038 - # work out where we are installing the ini file
4039 - php_set_ini_dir "${phpsapi}"
4040 -
4041 - # Always install the production INI file, bug 611214.
4042 - local phpinisrc="php.ini-production-${phpsapi}"
4043 - cp php.ini-production "${phpinisrc}" || die
4044 -
4045 - # default to /tmp for save_path, bug #282768
4046 - sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die
4047 -
4048 - # Set the extension dir
4049 - sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \
4050 - -i "${phpinisrc}" || die
4051 -
4052 - # Set the include path to point to where we want to find PEAR packages
4053 - sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die
4054 -
4055 - insinto "${PHP_INI_DIR#${EPREFIX}}"
4056 - newins "${phpinisrc}" php.ini
4057 -
4058 - elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}"
4059 - elog
4060 -
4061 - dodir "${PHP_EXT_INI_DIR#${EPREFIX}}"
4062 - dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}"
4063 -
4064 - if use opcache; then
4065 - elog "Adding opcache to $PHP_EXT_INI_DIR"
4066 - echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \
4067 - "${D}/${PHP_EXT_INI_DIR}"/opcache.ini
4068 - dosym "../ext/opcache.ini" \
4069 - "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini"
4070 - fi
4071 -
4072 - # SAPI-specific handling
4073 - if [[ "${sapi}" == "fpm" ]] ; then
4074 - einfo "Installing FPM config files php-fpm.conf and www.conf"
4075 - insinto "${PHP_INI_DIR#${EPREFIX}}"
4076 - doins sapi/fpm/php-fpm.conf
4077 - insinto "${PHP_INI_DIR#${EPREFIX}}/fpm.d"
4078 - doins sapi/fpm/www.conf
4079 - fi
4080 -
4081 - dodoc php.ini-{development,production}
4082 -}
4083 -
4084 -php_set_ini_dir() {
4085 - PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}"
4086 - PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
4087 - PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
4088 -}
4089 -
4090 -src_prepare() {
4091 - default
4092 -
4093 - # In php-7.x, the FPM pool configuration files have been split off
4094 - # of the main config. By default the pool config files go in
4095 - # e.g. /etc/php-fpm.d, which isn't slotted. So here we move the
4096 - # include directory to a subdirectory "fpm.d" of $PHP_INI_DIR. Later
4097 - # we'll install the pool configuration file "www.conf" there.
4098 - php_set_ini_dir fpm
4099 - sed -i "s~^include=.*$~include=${PHP_INI_DIR}/fpm.d/*.conf~" \
4100 - sapi/fpm/php-fpm.conf.in \
4101 - || die 'failed to move the include directory in php-fpm.conf'
4102 -
4103 - # Emulate buildconf to support cross-compilation
4104 - rm -fr aclocal.m4 autom4te.cache config.cache \
4105 - configure main/php_config.h.in || die
4106 - eautoconf --force
4107 - eautoheader
4108 -}
4109 -
4110 -src_configure() {
4111 - addpredict /usr/share/snmp/mibs/.index #nowarn
4112 - addpredict /var/lib/net-snmp/mib_indexes #nowarn
4113 -
4114 - PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
4115 -
4116 - # The php-fpm config file wants localstatedir to be ${EPREFIX}/var
4117 - # and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002.
4118 - local our_conf=(
4119 - --prefix="${PHP_DESTDIR}"
4120 - --mandir="${PHP_DESTDIR}/man"
4121 - --infodir="${PHP_DESTDIR}/info"
4122 - --libdir="${PHP_DESTDIR}/lib"
4123 - --with-libdir="$(get_libdir)"
4124 - --localstatedir="${EPREFIX}/var"
4125 - --without-pear
4126 - $(use_enable threads maintainer-zts)
4127 - )
4128 -
4129 - our_conf+=(
4130 - $(use_with argon2 password-argon2 "${EPREFIX}/usr")
4131 - $(use_enable bcmath)
4132 - $(use_with bzip2 bz2 "${EPREFIX}/usr")
4133 - $(use_enable calendar)
4134 - $(use_enable coverage gcov)
4135 - $(use_enable ctype)
4136 - $(use_with curl)
4137 - $(use_enable xml dom)
4138 - $(use_with enchant)
4139 - $(use_enable exif)
4140 - $(use_with ffi)
4141 - $(use_enable fileinfo)
4142 - $(use_enable filter)
4143 - $(use_enable ftp)
4144 - $(use_with nls gettext "${EPREFIX}/usr")
4145 - $(use_with gmp gmp "${EPREFIX}/usr")
4146 - $(use_with mhash mhash "${EPREFIX}/usr")
4147 - $(use_with iconv iconv \
4148 - $(use elibc_glibc || use elibc_musl || use elibc_FreeBSD || echo "${EPREFIX}/usr"))
4149 - $(use_enable intl)
4150 - $(use_enable ipv6)
4151 - $(use_enable json)
4152 - $(use_with kerberos)
4153 - $(use_with xml libxml)
4154 - $(use_enable unicode mbstring)
4155 - $(use_with ssl openssl)
4156 - $(use_enable pcntl)
4157 - $(use_enable phar)
4158 - $(use_enable pdo)
4159 - $(use_enable opcache)
4160 - $(use_with postgres pgsql "${EPREFIX}/usr")
4161 - $(use_enable posix)
4162 - $(use_with spell pspell "${EPREFIX}/usr")
4163 - $(use_enable simplexml)
4164 - $(use_enable sharedmem shmop)
4165 - $(use_with snmp snmp "${EPREFIX}/usr")
4166 - $(use_enable soap)
4167 - $(use_enable sockets)
4168 - $(use_with sodium)
4169 - $(use_with sqlite sqlite3)
4170 - $(use_enable sysvipc sysvmsg)
4171 - $(use_enable sysvipc sysvsem)
4172 - $(use_enable sysvipc sysvshm)
4173 - $(use_with tidy tidy "${EPREFIX}/usr")
4174 - $(use_enable tokenizer)
4175 - $(use_enable xml)
4176 - $(use_enable xmlreader)
4177 - $(use_enable xmlwriter)
4178 - $(use_with xmlrpc)
4179 - $(use_with xslt xsl)
4180 - $(use_with zip)
4181 - $(use_with zlib zlib "${EPREFIX}/usr")
4182 - $(use_enable debug)
4183 - )
4184 -
4185 - # DBA support
4186 - if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
4187 - || use qdbm || use lmdb || use tokyocabinet ; then
4188 - our_conf+=( "--enable-dba" )
4189 - fi
4190 -
4191 - # DBA drivers support
4192 - our_conf+=(
4193 - $(use_with cdb)
4194 - $(use_with berkdb db4 "${EPREFIX}/usr")
4195 - $(use_enable flatfile)
4196 - $(use_with gdbm gdbm "${EPREFIX}/usr")
4197 - $(use_enable inifile)
4198 - $(use_with qdbm qdbm "${EPREFIX}/usr")
4199 - $(use_with tokyocabinet tcadb "${EPREFIX}/usr")
4200 - $(use_with lmdb lmdb "${EPREFIX}/usr")
4201 - )
4202 -
4203 - # Support for the GD graphics library
4204 - our_conf+=(
4205 - $(use_with truetype freetype)
4206 - $(use_enable cjk gd-jis-conv)
4207 - $(use_with gd jpeg)
4208 - $(use_with xpm)
4209 - $(use_with webp)
4210 - )
4211 - # enable gd last, so configure can pick up the previous settings
4212 - our_conf+=( $(use_enable gd) )
4213 -
4214 - # IMAP support
4215 - if use imap ; then
4216 - our_conf+=(
4217 - $(use_with imap imap "${EPREFIX}/usr")
4218 - $(use_with ssl imap-ssl "${EPREFIX}/usr")
4219 - )
4220 - fi
4221 -
4222 - # LDAP support
4223 - if use ldap ; then
4224 - our_conf+=(
4225 - $(use_with ldap ldap "${EPREFIX}/usr")
4226 - $(use_with ldap-sasl)
4227 - )
4228 - fi
4229 -
4230 - # MySQL support
4231 - local mysqllib="mysqlnd"
4232 - local mysqlilib="mysqlnd"
4233 -
4234 - our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
4235 -
4236 - local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock"
4237 - if use mysql || use mysqli ; then
4238 - our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") )
4239 - fi
4240 -
4241 - # ODBC support
4242 - if use odbc && use iodbc ; then
4243 - our_conf+=(
4244 - --without-unixODBC
4245 - --with-iodbc
4246 - $(use_with pdo pdo-odbc "iODBC,${EPREFIX}/usr")
4247 - )
4248 - elif use odbc ; then
4249 - our_conf+=(
4250 - --with-unixODBC="${EPREFIX}/usr"
4251 - --without-iodbc
4252 - $(use_with pdo pdo-odbc "unixODBC,${EPREFIX}/usr")
4253 - )
4254 - else
4255 - our_conf+=(
4256 - --without-unixODBC
4257 - --without-iodbc
4258 - --without-pdo-odbc
4259 - )
4260 - fi
4261 -
4262 - # Oracle support
4263 - our_conf+=( $(use_with oci8-instant-client oci8) )
4264 -
4265 - # PDO support
4266 - if use pdo ; then
4267 - our_conf+=(
4268 - $(use_with mssql pdo-dblib "${EPREFIX}/usr")
4269 - $(use_with mysql pdo-mysql "${mysqllib}")
4270 - $(use_with postgres pdo-pgsql)
4271 - $(use_with sqlite pdo-sqlite)
4272 - $(use_with firebird pdo-firebird "${EPREFIX}/usr")
4273 - $(use_with oci8-instant-client pdo-oci)
4274 - )
4275 - fi
4276 -
4277 - # readline/libedit support
4278 - our_conf+=(
4279 - $(use_with readline readline "${EPREFIX}/usr")
4280 - $(use_with libedit)
4281 - )
4282 -
4283 - # Session support
4284 - if use session ; then
4285 - our_conf+=( $(use_with session-mm mm "${EPREFIX}/usr") )
4286 - else
4287 - our_conf+=( $(use_enable session) )
4288 - fi
4289 -
4290 - # Use pic for shared modules such as apache2's mod_php
4291 - our_conf+=( --with-pic )
4292 -
4293 - # we use the system copy of pcre
4294 - # --with-external-pcre affects ext/pcre
4295 - # Many arches don't support pcre-jit
4296 - our_conf+=(
4297 - --with-external-pcre
4298 - --without-pcre-jit
4299 - )
4300 -
4301 - # Catch CFLAGS problems
4302 - # Fixes bug #14067.
4303 - # Changed order to run it in reverse for bug #32022 and #12021.
4304 - replace-cpu-flags "k6*" "i586"
4305 -
4306 - # Cache the ./configure test results between SAPIs.
4307 - our_conf+=( --cache-file="${T}/config.cache" )
4308 -
4309 - # Support user-passed configuration parameters
4310 - our_conf+=( ${EXTRA_ECONF:-} )
4311 -
4312 - # Support the Apache2 extras, they must be set globally for all
4313 - # SAPIs to work correctly, especially for external PHP extensions
4314 -
4315 - local one_sapi
4316 - local sapi
4317 - mkdir -p "${WORKDIR}/sapis-build" || die
4318 - for one_sapi in $SAPIS ; do
4319 - use "${one_sapi}" || continue
4320 - php_set_ini_dir "${one_sapi}"
4321 -
4322 - # The BUILD_DIR variable is used to determine where to output
4323 - # the files that autotools creates. This was all originally
4324 - # based on the autotools-utils eclass.
4325 - BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}"
4326 - cp -a "${S}" "${BUILD_DIR}" || die
4327 - cd "${BUILD_DIR}" || die
4328 -
4329 - local sapi_conf=(
4330 - --with-config-file-path="${PHP_INI_DIR}"
4331 - --with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}"
4332 - )
4333 -
4334 - for sapi in $SAPIS ; do
4335 - case "$sapi" in
4336 - cli|cgi|embed|fpm|phpdbg)
4337 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
4338 - sapi_conf+=( "--enable-${sapi}" )
4339 - if [[ "fpm" == "${sapi}" ]] ; then
4340 - sapi_conf+=(
4341 - $(use_with acl fpm-acl)
4342 - $(use_with systemd fpm-systemd)
4343 - )
4344 - fi
4345 - else
4346 - sapi_conf+=( "--disable-${sapi}" )
4347 - fi
4348 - ;;
4349 -
4350 - apache2)
4351 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
4352 - sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" )
4353 - else
4354 - sapi_conf+=( --without-apxs2 )
4355 - fi
4356 - ;;
4357 - esac
4358 - done
4359 -
4360 - # Construct the $myeconfargs array by concatenating $our_conf
4361 - # (the common args) and $sapi_conf (the SAPI-specific args).
4362 - local myeconfargs=( "${our_conf[@]}" )
4363 - myeconfargs+=( "${sapi_conf[@]}" )
4364 -
4365 - pushd "${BUILD_DIR}" > /dev/null || die
4366 - econf "${myeconfargs[@]}"
4367 - popd > /dev/null || die
4368 - done
4369 -}
4370 -
4371 -src_compile() {
4372 - # snmp seems to run during src_compile, too (bug #324739)
4373 - addpredict /usr/share/snmp/mibs/.index #nowarn
4374 - addpredict /var/lib/net-snmp/mib_indexes #nowarn
4375 -
4376 - local sapi
4377 - for sapi in ${SAPIS} ; do
4378 - if use "${sapi}"; then
4379 - cd "${WORKDIR}/sapis-build/$sapi" || \
4380 - die "Failed to change dir to ${WORKDIR}/sapis-build/$1"
4381 - emake
4382 - fi
4383 - done
4384 -}
4385 -
4386 -src_install() {
4387 - # see bug #324739 for what happens when we don't have that
4388 - addpredict /usr/share/snmp/mibs/.index #nowarn
4389 -
4390 - # grab the first SAPI that got built and install common files from there
4391 - local first_sapi="", sapi=""
4392 - for sapi in $SAPIS ; do
4393 - if use $sapi ; then
4394 - first_sapi=$sapi
4395 - break
4396 - fi
4397 - done
4398 -
4399 - # Makefile forgets to create this before trying to write to it...
4400 - dodir "${PHP_DESTDIR#${EPREFIX}}/bin"
4401 -
4402 - # Install php environment (without any sapis)
4403 - cd "${WORKDIR}/sapis-build/$first_sapi" || die
4404 - emake INSTALL_ROOT="${D}" \
4405 - install-build install-headers install-programs
4406 -
4407 - local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)"
4408 -
4409 - # Create the directory where we'll put version-specific php scripts
4410 - keepdir "/usr/share/php${PHP_MV}"
4411 -
4412 - local file=""
4413 - local sapi_list=""
4414 -
4415 - for sapi in ${SAPIS}; do
4416 - if use "${sapi}" ; then
4417 - einfo "Installing SAPI: ${sapi}"
4418 - cd "${WORKDIR}/sapis-build/${sapi}" || die
4419 -
4420 - if [[ "${sapi}" == "apache2" ]] ; then
4421 - # We're specifically not using emake install-sapi as libtool
4422 - # may cause unnecessary relink failures (see bug #351266)
4423 - insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/"
4424 - newins ".libs/libphp${PHP_MV}$(get_libname)" \
4425 - "libphp${PHP_MV}$(get_libname)"
4426 - keepdir "/usr/$(get_libdir)/apache2/modules"
4427 - else
4428 - # needed each time, php_install_ini would reset it
4429 - local dest="${PHP_DESTDIR#${EPREFIX}}"
4430 - into "${dest}"
4431 - case "$sapi" in
4432 - cli)
4433 - source="sapi/cli/php"
4434 - # Install the "phar" archive utility.
4435 - if use phar ; then
4436 - emake INSTALL_ROOT="${D}" install-pharcmd
4437 - dosym "..${dest#/usr}/bin/phar" "/usr/bin/phar${SLOT}"
4438 - fi
4439 - ;;
4440 - cgi)
4441 - source="sapi/cgi/php-cgi"
4442 - ;;
4443 - fpm)
4444 - source="sapi/fpm/php-fpm"
4445 - ;;
4446 - embed)
4447 - source="libs/libphp${PHP_MV}$(get_libname)"
4448 - ;;
4449 - phpdbg)
4450 - source="sapi/phpdbg/phpdbg"
4451 - ;;
4452 - *)
4453 - die "unhandled sapi in src_install"
4454 - ;;
4455 - esac
4456 -
4457 - if [[ "${source}" == *"$(get_libname)" ]]; then
4458 - dolib.so "${source}"
4459 - else
4460 - dobin "${source}"
4461 - local name="$(basename ${source})"
4462 - dosym "..${dest#/usr}/bin/${name}" "/usr/bin/${name}${SLOT}"
4463 - fi
4464 - fi
4465 -
4466 - php_install_ini "${sapi}"
4467 -
4468 - # construct correct SAPI string for php-config
4469 - # thanks to ferringb for the bash voodoo
4470 - if [[ "${sapi}" == "apache2" ]]; then
4471 - sapi_list="${sapi_list:+${sapi_list} }apache2handler"
4472 - else
4473 - sapi_list="${sapi_list:+${sapi_list} }${sapi}"
4474 - fi
4475 - fi
4476 - done
4477 -
4478 - # Installing opcache module
4479 - if use opcache ; then
4480 - into "${PHP_DESTDIR#${EPREFIX}}"
4481 - dolib.so "modules/opcache$(get_libname)"
4482 - fi
4483 -
4484 - # Install env.d files
4485 - newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}"
4486 - sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
4487 - sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
4488 -
4489 - # set php-config variable correctly (bug #278439)
4490 - sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \
4491 - "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die
4492 -
4493 - if use fpm ; then
4494 - if use systemd; then
4495 - systemd_newunit "${FILESDIR}/php-fpm_at.service" \
4496 - "php-fpm@${SLOT}.service"
4497 - else
4498 - systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \
4499 - "php-fpm@${SLOT}.service"
4500 - fi
4501 - fi
4502 -}
4503 -
4504 -src_test() {
4505 - echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
4506 - PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
4507 - if [[ ! -x "${PHP_BIN}" ]] ; then
4508 - ewarn "Test phase requires USE=cli, skipping"
4509 - return
4510 - else
4511 - export TEST_PHP_EXECUTABLE="${PHP_BIN}"
4512 - fi
4513 -
4514 - if [[ -x "${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" ]] ; then
4515 - export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi"
4516 - fi
4517 -
4518 - if [[ -x "${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" ]] ; then
4519 - export TEST_PHPDBG_EXECUTABLE="${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg"
4520 - fi
4521 -
4522 - REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \
4523 - "session.save_path=${T}" \
4524 - "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \
4525 - "session.save_path=${T}"
4526 -
4527 - for name in ${EXPECTED_TEST_FAILURES}; do
4528 - mv "${name}.out" "${name}.out.orig" 2>/dev/null || die
4529 - done
4530 -
4531 - local failed="$(find -name '*.out')"
4532 - if [[ ${failed} != "" ]] ; then
4533 - ewarn "The following test cases failed unexpectedly:"
4534 - for name in ${failed}; do
4535 - ewarn " ${name/.out/}"
4536 - done
4537 - else
4538 - einfo "No unexpected test failures, all fine"
4539 - fi
4540 -
4541 - if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
4542 - local passed=""
4543 - for name in ${EXPECTED_TEST_FAILURES}; do
4544 - [[ -f "${name}.diff" ]] && continue
4545 - passed="${passed} ${name}"
4546 - done
4547 - if [[ ${passed} != "" ]] ; then
4548 - einfo "The following test cases passed unexpectedly:"
4549 - for name in ${passed}; do
4550 - ewarn " ${passed}"
4551 - done
4552 - else
4553 - einfo "None of the known-to-fail tests passed, all fine"
4554 - fi
4555 - fi
4556 -}
4557 -
4558 -pkg_postinst() {
4559 - # Output some general info to the user
4560 - if use apache2 ; then
4561 - elog
4562 - elog "To enable PHP in apache, you will need to add \"-D PHP\" to"
4563 - elog "your apache2 command. OpenRC users can append that string to"
4564 - elog "APACHE2_OPTS in /etc/conf.d/apache2."
4565 - elog
4566 - elog "The apache module configuration file 70_mod_php.conf is"
4567 - elog "provided (and maintained) by eselect-php."
4568 - elog
4569 - fi
4570 -
4571 - # Create the symlinks for php
4572 - local m
4573 - for m in ${SAPIS}; do
4574 - [[ ${m} == 'embed' ]] && continue;
4575 - if use $m ; then
4576 - local ci=$(eselect php show $m)
4577 - if [[ -z $ci ]]; then
4578 - eselect php set $m php${SLOT} || die
4579 - einfo "Switched ${m} to use php:${SLOT}"
4580 - einfo
4581 - elif [[ $ci != "php${SLOT}" ]] ; then
4582 - elog "To switch $m to use php:${SLOT}, run"
4583 - elog " eselect php set $m php${SLOT}"
4584 - elog
4585 - fi
4586 - fi
4587 - done
4588 -
4589 - # Remove dead symlinks for SAPIs that were just disabled. For
4590 - # example, if the user has the cgi SAPI enabled, then he has an
4591 - # eselect-php symlink for it. If he later reinstalls PHP with
4592 - # USE="-cgi", that symlink will break. This call to eselect is
4593 - # supposed to remove that dead link per bug 572436.
4594 - eselect php cleanup || die
4595 -
4596 - if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then
4597 - elog "To build extensions for this version of PHP, you will need to"
4598 - elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable."
4599 - elog
4600 - fi
4601 -
4602 - # Warn about the removal of PHP_INI_VERSION if the user has it set.
4603 - if [[ -n "${PHP_INI_VERSION}" ]]; then
4604 - ewarn 'The PHP_INI_VERSION variable has been phased out. You may'
4605 - ewarn 'remove it from your configuration at your convenience. See'
4606 - ewarn
4607 - ewarn ' https://bugs.gentoo.org/611214'
4608 - ewarn
4609 - ewarn 'for more information.'
4610 - fi
4611 -
4612 - elog "For details on how version slotting works, please see"
4613 - elog "the wiki:"
4614 - elog
4615 - elog " https://wiki.gentoo.org/wiki/PHP"
4616 - elog
4617 -}
4618 -
4619 -pkg_postrm() {
4620 - # This serves two purposes. First, if we have just removed the last
4621 - # installed version of PHP, then this will remove any dead symlinks
4622 - # belonging to eselect-php. Second, if a user upgrades slots from
4623 - # (say) 5.6 to 7.0 and depcleans the old slot, then this will update
4624 - # his existing symlinks to point to the new 7.0 installation. The
4625 - # latter is bug 432962.
4626 - #
4627 - # Note: the eselect-php package may not be installed at this point,
4628 - # so we can't die() if this command fails.
4629 - eselect php cleanup
4630 -}
4631
4632 diff --git a/dev-lang/php/php-7.4.7.ebuild b/dev-lang/php/php-7.4.7.ebuild
4633 deleted file mode 100644
4634 index 3ac0d8c9ace..00000000000
4635 --- a/dev-lang/php/php-7.4.7.ebuild
4636 +++ /dev/null
4637 @@ -1,750 +0,0 @@
4638 -# Copyright 1999-2020 Gentoo Authors
4639 -# Distributed under the terms of the GNU General Public License v2
4640 -
4641 -EAPI="7"
4642 -
4643 -WANT_AUTOMAKE="none"
4644 -
4645 -inherit flag-o-matic systemd autotools
4646 -
4647 -MY_PV=${PV/_rc/RC}
4648 -DESCRIPTION="The PHP language runtime engine"
4649 -HOMEPAGE="https://www.php.net/"
4650 -SRC_URI="https://www.php.net/distributions/${P}.tar.xz"
4651 -
4652 -LICENSE="PHP-3.01
4653 - BSD
4654 - Zend-2.0
4655 - bcmath? ( LGPL-2.1+ )
4656 - fpm? ( BSD-2 )
4657 - gd? ( gd )
4658 - unicode? ( BSD-2 LGPL-2.1 )"
4659 -
4660 -SLOT="$(ver_cut 1-2)"
4661 -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
4662 -
4663 -S="${WORKDIR}/${PN}-${MY_PV}"
4664 -
4665 -# We can build the following SAPIs in the given order
4666 -SAPIS="embed cli cgi fpm apache2 phpdbg"
4667 -
4668 -# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
4669 -IUSE="${IUSE}
4670 - ${SAPIS/cli/+cli}
4671 - threads"
4672 -
4673 -IUSE="${IUSE} acl argon2 bcmath berkdb bzip2 calendar cdb cjk
4674 - coverage +ctype curl debug
4675 - enchant exif ffi +fileinfo +filter firebird
4676 - +flatfile ftp gd gdbm gmp +iconv imap inifile
4677 - intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl lmdb
4678 - mhash mssql mysql mysqli nls
4679 - oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
4680 - readline selinux +session session-mm sharedmem
4681 - +simplexml snmp soap sockets sodium spell sqlite ssl
4682 - sysvipc systemd test tidy +tokenizer tokyocabinet truetype unicode webp
4683 - +xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib"
4684 -
4685 -# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
4686 -REQUIRED_USE="
4687 - || ( cli cgi fpm apache2 embed phpdbg )
4688 - cli? ( ^^ ( readline libedit ) )
4689 - !cli? ( ?? ( readline libedit ) )
4690 - truetype? ( gd zlib )
4691 - webp? ( gd zlib )
4692 - cjk? ( gd zlib )
4693 - exif? ( gd zlib )
4694 - xpm? ( gd zlib )
4695 - gd? ( zlib )
4696 - simplexml? ( xml )
4697 - soap? ( xml )
4698 - xmlrpc? ( xml iconv )
4699 - xmlreader? ( xml )
4700 - xmlwriter? ( xml )
4701 - xslt? ( xml )
4702 - ldap-sasl? ( ldap )
4703 - qdbm? ( !gdbm )
4704 - session-mm? ( session !threads )
4705 - mysql? ( || ( mysqli pdo ) )
4706 - firebird? ( pdo )
4707 - mssql? ( pdo )
4708 -"
4709 -
4710 -RESTRICT="!test? ( test )"
4711 -
4712 -# The supported (that is, autodetected) versions of BDB are listed in
4713 -# the ./configure script. Other versions *work*, but we need to stick to
4714 -# the ones that can be detected to avoid a repeat of bug #564824.
4715 -COMMON_DEPEND="
4716 - >=app-eselect/eselect-php-0.9.1[apache2?,fpm?]
4717 - >=dev-libs/libpcre2-10.30[unicode]
4718 - fpm? ( acl? ( sys-apps/acl ) )
4719 - apache2? ( www-servers/apache[apache2_modules_unixd(+),threads=] )
4720 - argon2? ( app-crypt/argon2:= )
4721 - berkdb? ( || ( sys-libs/db:5.3
4722 - sys-libs/db:5.1
4723 - sys-libs/db:4.8
4724 - sys-libs/db:4.7
4725 - sys-libs/db:4.6
4726 - sys-libs/db:4.5 ) )
4727 - bzip2? ( app-arch/bzip2:0= )
4728 - cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
4729 - coverage? ( dev-util/lcov )
4730 - curl? ( >=net-misc/curl-7.10.5 )
4731 - enchant? ( <app-text/enchant-2.0:0 )
4732 - ffi? ( >=dev-libs/libffi-3.0.11 )
4733 - firebird? ( dev-db/firebird )
4734 - gd? ( >=virtual/jpeg-0-r3:0 media-libs/libpng:0= )
4735 - gdbm? ( >=sys-libs/gdbm-1.8.0:0= )
4736 - gmp? ( dev-libs/gmp:0= )
4737 - iconv? ( virtual/libiconv )
4738 - imap? ( >=virtual/imap-c-client-2[kerberos=,ssl=] )
4739 - intl? ( dev-libs/icu:= )
4740 - kerberos? ( virtual/krb5 )
4741 - ldap? ( >=net-nds/openldap-1.2.11 )
4742 - ldap-sasl? ( dev-libs/cyrus-sasl )
4743 - libedit? ( dev-libs/libedit )
4744 - lmdb? ( dev-db/lmdb:= )
4745 - mssql? ( dev-db/freetds[mssql] )
4746 - nls? ( sys-devel/gettext )
4747 - oci8-instant-client? ( dev-db/oracle-instantclient-basic )
4748 - odbc? ( iodbc? ( dev-db/libiodbc ) !iodbc? ( >=dev-db/unixODBC-1.8.13 ) )
4749 - postgres? ( dev-db/postgresql:* )
4750 - qdbm? ( dev-db/qdbm )
4751 - readline? ( sys-libs/readline:0= )
4752 - session-mm? ( dev-libs/mm )
4753 - snmp? ( >=net-analyzer/net-snmp-5.2 )
4754 - sodium? ( dev-libs/libsodium:= )
4755 - spell? ( >=app-text/aspell-0.50 )
4756 - sqlite? ( >=dev-db/sqlite-3.7.6.3 )
4757 - ssl? (
4758 - !libressl? ( >=dev-libs/openssl-1.0.1:0= )
4759 - libressl? ( dev-libs/libressl:0= )
4760 - )
4761 - tidy? ( || ( app-text/tidy-html5 app-text/htmltidy ) )
4762 - tokyocabinet? ( dev-db/tokyocabinet )
4763 - truetype? ( =media-libs/freetype-2* )
4764 - unicode? ( dev-libs/oniguruma:= )
4765 - webp? ( media-libs/libwebp:0= )
4766 - xml? ( >=dev-libs/libxml2-2.7.6 )
4767 - xpm? ( x11-libs/libXpm )
4768 - xslt? ( dev-libs/libxslt )
4769 - zip? ( >=dev-libs/libzip-1.2.0:= )
4770 - zlib? ( >=sys-libs/zlib-1.2.0.4:0= )
4771 -"
4772 -
4773 -RDEPEND="${COMMON_DEPEND}
4774 - virtual/mta
4775 - fpm? (
4776 - selinux? ( sec-policy/selinux-phpfpm )
4777 - systemd? ( sys-apps/systemd ) )"
4778 -
4779 -# Bison isn't actually needed when building from a release tarball
4780 -# However, the configure script will warn if it's absent or if you
4781 -# have an incompatible version installed. See bug 593278.
4782 -DEPEND="${COMMON_DEPEND}
4783 - app-arch/xz-utils
4784 - >=sys-devel/bison-3.0.1"
4785 -
4786 -BDEPEND="virtual/pkgconfig"
4787 -
4788 -PHP_MV="$(ver_cut 1)"
4789 -
4790 -PATCHES=( "${FILESDIR}/php-iodbc-header-location.patch" )
4791 -
4792 -php_install_ini() {
4793 - local phpsapi="${1}"
4794 -
4795 - # work out where we are installing the ini file
4796 - php_set_ini_dir "${phpsapi}"
4797 -
4798 - # Always install the production INI file, bug 611214.
4799 - local phpinisrc="php.ini-production-${phpsapi}"
4800 - cp php.ini-production "${phpinisrc}" || die
4801 -
4802 - # default to /tmp for save_path, bug #282768
4803 - sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die
4804 -
4805 - # Set the extension dir
4806 - sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \
4807 - -i "${phpinisrc}" || die
4808 -
4809 - # Set the include path to point to where we want to find PEAR packages
4810 - sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die
4811 -
4812 - insinto "${PHP_INI_DIR#${EPREFIX}}"
4813 - newins "${phpinisrc}" php.ini
4814 -
4815 - elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}"
4816 - elog
4817 -
4818 - dodir "${PHP_EXT_INI_DIR#${EPREFIX}}"
4819 - dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}"
4820 -
4821 - if use opcache; then
4822 - elog "Adding opcache to $PHP_EXT_INI_DIR"
4823 - echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \
4824 - "${D}/${PHP_EXT_INI_DIR}"/opcache.ini
4825 - dosym "../ext/opcache.ini" \
4826 - "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini"
4827 - fi
4828 -
4829 - # SAPI-specific handling
4830 - if [[ "${sapi}" == "fpm" ]] ; then
4831 - einfo "Installing FPM config files php-fpm.conf and www.conf"
4832 - insinto "${PHP_INI_DIR#${EPREFIX}}"
4833 - doins sapi/fpm/php-fpm.conf
4834 - insinto "${PHP_INI_DIR#${EPREFIX}}/fpm.d"
4835 - doins sapi/fpm/www.conf
4836 - fi
4837 -
4838 - dodoc php.ini-{development,production}
4839 -}
4840 -
4841 -php_set_ini_dir() {
4842 - PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}"
4843 - PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
4844 - PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
4845 -}
4846 -
4847 -src_prepare() {
4848 - default
4849 -
4850 - # In php-7.x, the FPM pool configuration files have been split off
4851 - # of the main config. By default the pool config files go in
4852 - # e.g. /etc/php-fpm.d, which isn't slotted. So here we move the
4853 - # include directory to a subdirectory "fpm.d" of $PHP_INI_DIR. Later
4854 - # we'll install the pool configuration file "www.conf" there.
4855 - php_set_ini_dir fpm
4856 - sed -i "s~^include=.*$~include=${PHP_INI_DIR}/fpm.d/*.conf~" \
4857 - sapi/fpm/php-fpm.conf.in \
4858 - || die 'failed to move the include directory in php-fpm.conf'
4859 -
4860 - # Emulate buildconf to support cross-compilation
4861 - rm -fr aclocal.m4 autom4te.cache config.cache \
4862 - configure main/php_config.h.in || die
4863 - eautoconf --force
4864 - eautoheader
4865 -}
4866 -
4867 -src_configure() {
4868 - addpredict /usr/share/snmp/mibs/.index #nowarn
4869 - addpredict /var/lib/net-snmp/mib_indexes #nowarn
4870 -
4871 - PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
4872 -
4873 - # The php-fpm config file wants localstatedir to be ${EPREFIX}/var
4874 - # and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002.
4875 - local our_conf=(
4876 - --prefix="${PHP_DESTDIR}"
4877 - --mandir="${PHP_DESTDIR}/man"
4878 - --infodir="${PHP_DESTDIR}/info"
4879 - --libdir="${PHP_DESTDIR}/lib"
4880 - --with-libdir="$(get_libdir)"
4881 - --localstatedir="${EPREFIX}/var"
4882 - --without-pear
4883 - $(use_enable threads maintainer-zts)
4884 - )
4885 -
4886 - our_conf+=(
4887 - $(use_with argon2 password-argon2 "${EPREFIX}/usr")
4888 - $(use_enable bcmath)
4889 - $(use_with bzip2 bz2 "${EPREFIX}/usr")
4890 - $(use_enable calendar)
4891 - $(use_enable coverage gcov)
4892 - $(use_enable ctype)
4893 - $(use_with curl)
4894 - $(use_enable xml dom)
4895 - $(use_with enchant)
4896 - $(use_enable exif)
4897 - $(use_with ffi)
4898 - $(use_enable fileinfo)
4899 - $(use_enable filter)
4900 - $(use_enable ftp)
4901 - $(use_with nls gettext "${EPREFIX}/usr")
4902 - $(use_with gmp gmp "${EPREFIX}/usr")
4903 - $(use_with mhash mhash "${EPREFIX}/usr")
4904 - $(use_with iconv iconv \
4905 - $(use elibc_glibc || use elibc_musl || use elibc_FreeBSD || echo "${EPREFIX}/usr"))
4906 - $(use_enable intl)
4907 - $(use_enable ipv6)
4908 - $(use_enable json)
4909 - $(use_with kerberos)
4910 - $(use_with xml libxml)
4911 - $(use_enable unicode mbstring)
4912 - $(use_with ssl openssl)
4913 - $(use_enable pcntl)
4914 - $(use_enable phar)
4915 - $(use_enable pdo)
4916 - $(use_enable opcache)
4917 - $(use_with postgres pgsql "${EPREFIX}/usr")
4918 - $(use_enable posix)
4919 - $(use_with spell pspell "${EPREFIX}/usr")
4920 - $(use_enable simplexml)
4921 - $(use_enable sharedmem shmop)
4922 - $(use_with snmp snmp "${EPREFIX}/usr")
4923 - $(use_enable soap)
4924 - $(use_enable sockets)
4925 - $(use_with sodium)
4926 - $(use_with sqlite sqlite3)
4927 - $(use_enable sysvipc sysvmsg)
4928 - $(use_enable sysvipc sysvsem)
4929 - $(use_enable sysvipc sysvshm)
4930 - $(use_with tidy tidy "${EPREFIX}/usr")
4931 - $(use_enable tokenizer)
4932 - $(use_enable xml)
4933 - $(use_enable xmlreader)
4934 - $(use_enable xmlwriter)
4935 - $(use_with xmlrpc)
4936 - $(use_with xslt xsl)
4937 - $(use_with zip)
4938 - $(use_with zlib zlib "${EPREFIX}/usr")
4939 - $(use_enable debug)
4940 - )
4941 -
4942 - # DBA support
4943 - if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
4944 - || use qdbm || use lmdb || use tokyocabinet ; then
4945 - our_conf+=( "--enable-dba" )
4946 - fi
4947 -
4948 - # DBA drivers support
4949 - our_conf+=(
4950 - $(use_with cdb)
4951 - $(use_with berkdb db4 "${EPREFIX}/usr")
4952 - $(use_enable flatfile)
4953 - $(use_with gdbm gdbm "${EPREFIX}/usr")
4954 - $(use_enable inifile)
4955 - $(use_with qdbm qdbm "${EPREFIX}/usr")
4956 - $(use_with tokyocabinet tcadb "${EPREFIX}/usr")
4957 - $(use_with lmdb lmdb "${EPREFIX}/usr")
4958 - )
4959 -
4960 - # Support for the GD graphics library
4961 - our_conf+=(
4962 - $(use_with truetype freetype)
4963 - $(use_enable cjk gd-jis-conv)
4964 - $(use_with gd jpeg)
4965 - $(use_with xpm)
4966 - $(use_with webp)
4967 - )
4968 - # enable gd last, so configure can pick up the previous settings
4969 - our_conf+=( $(use_enable gd) )
4970 -
4971 - # IMAP support
4972 - if use imap ; then
4973 - our_conf+=(
4974 - $(use_with imap imap "${EPREFIX}/usr")
4975 - $(use_with ssl imap-ssl "${EPREFIX}/usr")
4976 - )
4977 - fi
4978 -
4979 - # LDAP support
4980 - if use ldap ; then
4981 - our_conf+=(
4982 - $(use_with ldap ldap "${EPREFIX}/usr")
4983 - $(use_with ldap-sasl)
4984 - )
4985 - fi
4986 -
4987 - # MySQL support
4988 - local mysqllib="mysqlnd"
4989 - local mysqlilib="mysqlnd"
4990 -
4991 - our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
4992 -
4993 - local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock"
4994 - if use mysql || use mysqli ; then
4995 - our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") )
4996 - fi
4997 -
4998 - # ODBC support
4999 - if use odbc && use iodbc ; then
5000 - our_conf+=(
5001 - --without-unixODBC
5002 - --with-iodbc
5003 - $(use_with pdo pdo-odbc "iODBC,${EPREFIX}/usr")
5004 - )
5005 - elif use odbc ; then
5006 - our_conf+=(
5007 - --with-unixODBC="${EPREFIX}/usr"
5008 - --without-iodbc
5009 - $(use_with pdo pdo-odbc "unixODBC,${EPREFIX}/usr")
5010 - )
5011 - else
5012 - our_conf+=(
5013 - --without-unixODBC
5014 - --without-iodbc
5015 - --without-pdo-odbc
5016 - )
5017 - fi
5018 -
5019 - # Oracle support
5020 - our_conf+=( $(use_with oci8-instant-client oci8) )
5021 -
5022 - # PDO support
5023 - if use pdo ; then
5024 - our_conf+=(
5025 - $(use_with mssql pdo-dblib "${EPREFIX}/usr")
5026 - $(use_with mysql pdo-mysql "${mysqllib}")
5027 - $(use_with postgres pdo-pgsql)
5028 - $(use_with sqlite pdo-sqlite)
5029 - $(use_with firebird pdo-firebird "${EPREFIX}/usr")
5030 - $(use_with oci8-instant-client pdo-oci)
5031 - )
5032 - fi
5033 -
5034 - # readline/libedit support
5035 - our_conf+=(
5036 - $(use_with readline readline "${EPREFIX}/usr")
5037 - $(use_with libedit)
5038 - )
5039 -
5040 - # Session support
5041 - if use session ; then
5042 - our_conf+=( $(use_with session-mm mm "${EPREFIX}/usr") )
5043 - else
5044 - our_conf+=( $(use_enable session) )
5045 - fi
5046 -
5047 - # Use pic for shared modules such as apache2's mod_php
5048 - our_conf+=( --with-pic )
5049 -
5050 - # we use the system copy of pcre
5051 - # --with-external-pcre affects ext/pcre
5052 - # Many arches don't support pcre-jit
5053 - our_conf+=(
5054 - --with-external-pcre
5055 - --without-pcre-jit
5056 - )
5057 -
5058 - # Catch CFLAGS problems
5059 - # Fixes bug #14067.
5060 - # Changed order to run it in reverse for bug #32022 and #12021.
5061 - replace-cpu-flags "k6*" "i586"
5062 -
5063 - # Cache the ./configure test results between SAPIs.
5064 - our_conf+=( --cache-file="${T}/config.cache" )
5065 -
5066 - # Support user-passed configuration parameters
5067 - our_conf+=( ${EXTRA_ECONF:-} )
5068 -
5069 - # Support the Apache2 extras, they must be set globally for all
5070 - # SAPIs to work correctly, especially for external PHP extensions
5071 -
5072 - local one_sapi
5073 - local sapi
5074 - mkdir -p "${WORKDIR}/sapis-build" || die
5075 - for one_sapi in $SAPIS ; do
5076 - use "${one_sapi}" || continue
5077 - php_set_ini_dir "${one_sapi}"
5078 -
5079 - # The BUILD_DIR variable is used to determine where to output
5080 - # the files that autotools creates. This was all originally
5081 - # based on the autotools-utils eclass.
5082 - BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}"
5083 - cp -a "${S}" "${BUILD_DIR}" || die
5084 - cd "${BUILD_DIR}" || die
5085 -
5086 - local sapi_conf=(
5087 - --with-config-file-path="${PHP_INI_DIR}"
5088 - --with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}"
5089 - )
5090 -
5091 - for sapi in $SAPIS ; do
5092 - case "$sapi" in
5093 - cli|cgi|embed|fpm|phpdbg)
5094 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
5095 - sapi_conf+=( "--enable-${sapi}" )
5096 - if [[ "fpm" == "${sapi}" ]] ; then
5097 - sapi_conf+=(
5098 - $(use_with acl fpm-acl)
5099 - $(use_with systemd fpm-systemd)
5100 - )
5101 - fi
5102 - else
5103 - sapi_conf+=( "--disable-${sapi}" )
5104 - fi
5105 - ;;
5106 -
5107 - apache2)
5108 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
5109 - sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" )
5110 - else
5111 - sapi_conf+=( --without-apxs2 )
5112 - fi
5113 - ;;
5114 - esac
5115 - done
5116 -
5117 - # Construct the $myeconfargs array by concatenating $our_conf
5118 - # (the common args) and $sapi_conf (the SAPI-specific args).
5119 - local myeconfargs=( "${our_conf[@]}" )
5120 - myeconfargs+=( "${sapi_conf[@]}" )
5121 -
5122 - pushd "${BUILD_DIR}" > /dev/null || die
5123 - econf "${myeconfargs[@]}"
5124 - popd > /dev/null || die
5125 - done
5126 -}
5127 -
5128 -src_compile() {
5129 - # snmp seems to run during src_compile, too (bug #324739)
5130 - addpredict /usr/share/snmp/mibs/.index #nowarn
5131 - addpredict /var/lib/net-snmp/mib_indexes #nowarn
5132 -
5133 - local sapi
5134 - for sapi in ${SAPIS} ; do
5135 - if use "${sapi}"; then
5136 - cd "${WORKDIR}/sapis-build/$sapi" || \
5137 - die "Failed to change dir to ${WORKDIR}/sapis-build/$1"
5138 - emake
5139 - fi
5140 - done
5141 -}
5142 -
5143 -src_install() {
5144 - # see bug #324739 for what happens when we don't have that
5145 - addpredict /usr/share/snmp/mibs/.index #nowarn
5146 -
5147 - # grab the first SAPI that got built and install common files from there
5148 - local first_sapi="", sapi=""
5149 - for sapi in $SAPIS ; do
5150 - if use $sapi ; then
5151 - first_sapi=$sapi
5152 - break
5153 - fi
5154 - done
5155 -
5156 - # Makefile forgets to create this before trying to write to it...
5157 - dodir "${PHP_DESTDIR#${EPREFIX}}/bin"
5158 -
5159 - # Install php environment (without any sapis)
5160 - cd "${WORKDIR}/sapis-build/$first_sapi" || die
5161 - emake INSTALL_ROOT="${D}" \
5162 - install-build install-headers install-programs
5163 -
5164 - local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)"
5165 -
5166 - # Create the directory where we'll put version-specific php scripts
5167 - keepdir "/usr/share/php${PHP_MV}"
5168 -
5169 - local file=""
5170 - local sapi_list=""
5171 -
5172 - for sapi in ${SAPIS}; do
5173 - if use "${sapi}" ; then
5174 - einfo "Installing SAPI: ${sapi}"
5175 - cd "${WORKDIR}/sapis-build/${sapi}" || die
5176 -
5177 - if [[ "${sapi}" == "apache2" ]] ; then
5178 - # We're specifically not using emake install-sapi as libtool
5179 - # may cause unnecessary relink failures (see bug #351266)
5180 - insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/"
5181 - newins ".libs/libphp${PHP_MV}$(get_libname)" \
5182 - "libphp${PHP_MV}$(get_libname)"
5183 - keepdir "/usr/$(get_libdir)/apache2/modules"
5184 - else
5185 - # needed each time, php_install_ini would reset it
5186 - local dest="${PHP_DESTDIR#${EPREFIX}}"
5187 - into "${dest}"
5188 - case "$sapi" in
5189 - cli)
5190 - source="sapi/cli/php"
5191 - # Install the "phar" archive utility.
5192 - if use phar ; then
5193 - emake INSTALL_ROOT="${D}" install-pharcmd
5194 - dosym "..${dest#/usr}/bin/phar" "/usr/bin/phar${SLOT}"
5195 - fi
5196 - ;;
5197 - cgi)
5198 - source="sapi/cgi/php-cgi"
5199 - ;;
5200 - fpm)
5201 - source="sapi/fpm/php-fpm"
5202 - ;;
5203 - embed)
5204 - source="libs/libphp${PHP_MV}$(get_libname)"
5205 - ;;
5206 - phpdbg)
5207 - source="sapi/phpdbg/phpdbg"
5208 - ;;
5209 - *)
5210 - die "unhandled sapi in src_install"
5211 - ;;
5212 - esac
5213 -
5214 - if [[ "${source}" == *"$(get_libname)" ]]; then
5215 - dolib.so "${source}"
5216 - else
5217 - dobin "${source}"
5218 - local name="$(basename ${source})"
5219 - dosym "..${dest#/usr}/bin/${name}" "/usr/bin/${name}${SLOT}"
5220 - fi
5221 - fi
5222 -
5223 - php_install_ini "${sapi}"
5224 -
5225 - # construct correct SAPI string for php-config
5226 - # thanks to ferringb for the bash voodoo
5227 - if [[ "${sapi}" == "apache2" ]]; then
5228 - sapi_list="${sapi_list:+${sapi_list} }apache2handler"
5229 - else
5230 - sapi_list="${sapi_list:+${sapi_list} }${sapi}"
5231 - fi
5232 - fi
5233 - done
5234 -
5235 - # Installing opcache module
5236 - if use opcache ; then
5237 - into "${PHP_DESTDIR#${EPREFIX}}"
5238 - dolib.so "modules/opcache$(get_libname)"
5239 - fi
5240 -
5241 - # Install env.d files
5242 - newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}"
5243 - sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
5244 - sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
5245 -
5246 - # set php-config variable correctly (bug #278439)
5247 - sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \
5248 - "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die
5249 -
5250 - if use fpm ; then
5251 - if use systemd; then
5252 - systemd_newunit "${FILESDIR}/php-fpm_at.service" \
5253 - "php-fpm@${SLOT}.service"
5254 - else
5255 - systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \
5256 - "php-fpm@${SLOT}.service"
5257 - fi
5258 - fi
5259 -}
5260 -
5261 -src_test() {
5262 - echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
5263 - PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
5264 - if [[ ! -x "${PHP_BIN}" ]] ; then
5265 - ewarn "Test phase requires USE=cli, skipping"
5266 - return
5267 - else
5268 - export TEST_PHP_EXECUTABLE="${PHP_BIN}"
5269 - fi
5270 -
5271 - if [[ -x "${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" ]] ; then
5272 - export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi"
5273 - fi
5274 -
5275 - if [[ -x "${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" ]] ; then
5276 - export TEST_PHPDBG_EXECUTABLE="${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg"
5277 - fi
5278 -
5279 - REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \
5280 - "session.save_path=${T}" \
5281 - "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \
5282 - "session.save_path=${T}"
5283 -
5284 - for name in ${EXPECTED_TEST_FAILURES}; do
5285 - mv "${name}.out" "${name}.out.orig" 2>/dev/null || die
5286 - done
5287 -
5288 - local failed="$(find -name '*.out')"
5289 - if [[ ${failed} != "" ]] ; then
5290 - ewarn "The following test cases failed unexpectedly:"
5291 - for name in ${failed}; do
5292 - ewarn " ${name/.out/}"
5293 - done
5294 - else
5295 - einfo "No unexpected test failures, all fine"
5296 - fi
5297 -
5298 - if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
5299 - local passed=""
5300 - for name in ${EXPECTED_TEST_FAILURES}; do
5301 - [[ -f "${name}.diff" ]] && continue
5302 - passed="${passed} ${name}"
5303 - done
5304 - if [[ ${passed} != "" ]] ; then
5305 - einfo "The following test cases passed unexpectedly:"
5306 - for name in ${passed}; do
5307 - ewarn " ${passed}"
5308 - done
5309 - else
5310 - einfo "None of the known-to-fail tests passed, all fine"
5311 - fi
5312 - fi
5313 -}
5314 -
5315 -pkg_postinst() {
5316 - # Output some general info to the user
5317 - if use apache2 ; then
5318 - elog
5319 - elog "To enable PHP in apache, you will need to add \"-D PHP\" to"
5320 - elog "your apache2 command. OpenRC users can append that string to"
5321 - elog "APACHE2_OPTS in /etc/conf.d/apache2."
5322 - elog
5323 - elog "The apache module configuration file 70_mod_php.conf is"
5324 - elog "provided (and maintained) by eselect-php."
5325 - elog
5326 - fi
5327 -
5328 - # Create the symlinks for php
5329 - local m
5330 - for m in ${SAPIS}; do
5331 - [[ ${m} == 'embed' ]] && continue;
5332 - if use $m ; then
5333 - local ci=$(eselect php show $m)
5334 - if [[ -z $ci ]]; then
5335 - eselect php set $m php${SLOT} || die
5336 - einfo "Switched ${m} to use php:${SLOT}"
5337 - einfo
5338 - elif [[ $ci != "php${SLOT}" ]] ; then
5339 - elog "To switch $m to use php:${SLOT}, run"
5340 - elog " eselect php set $m php${SLOT}"
5341 - elog
5342 - fi
5343 - fi
5344 - done
5345 -
5346 - # Remove dead symlinks for SAPIs that were just disabled. For
5347 - # example, if the user has the cgi SAPI enabled, then he has an
5348 - # eselect-php symlink for it. If he later reinstalls PHP with
5349 - # USE="-cgi", that symlink will break. This call to eselect is
5350 - # supposed to remove that dead link per bug 572436.
5351 - eselect php cleanup || die
5352 -
5353 - if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then
5354 - elog "To build extensions for this version of PHP, you will need to"
5355 - elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable."
5356 - elog
5357 - fi
5358 -
5359 - # Warn about the removal of PHP_INI_VERSION if the user has it set.
5360 - if [[ -n "${PHP_INI_VERSION}" ]]; then
5361 - ewarn 'The PHP_INI_VERSION variable has been phased out. You may'
5362 - ewarn 'remove it from your configuration at your convenience. See'
5363 - ewarn
5364 - ewarn ' https://bugs.gentoo.org/611214'
5365 - ewarn
5366 - ewarn 'for more information.'
5367 - fi
5368 -
5369 - elog "For details on how version slotting works, please see"
5370 - elog "the wiki:"
5371 - elog
5372 - elog " https://wiki.gentoo.org/wiki/PHP"
5373 - elog
5374 -}
5375 -
5376 -pkg_postrm() {
5377 - # This serves two purposes. First, if we have just removed the last
5378 - # installed version of PHP, then this will remove any dead symlinks
5379 - # belonging to eselect-php. Second, if a user upgrades slots from
5380 - # (say) 5.6 to 7.0 and depcleans the old slot, then this will update
5381 - # his existing symlinks to point to the new 7.0 installation. The
5382 - # latter is bug 432962.
5383 - #
5384 - # Note: the eselect-php package may not be installed at this point,
5385 - # so we can't die() if this command fails.
5386 - eselect php cleanup
5387 -}
5388
5389 diff --git a/dev-lang/php/php-7.4.8-r1.ebuild b/dev-lang/php/php-7.4.8-r1.ebuild
5390 deleted file mode 100644
5391 index b7203bdf290..00000000000
5392 --- a/dev-lang/php/php-7.4.8-r1.ebuild
5393 +++ /dev/null
5394 @@ -1,750 +0,0 @@
5395 -# Copyright 1999-2020 Gentoo Authors
5396 -# Distributed under the terms of the GNU General Public License v2
5397 -
5398 -EAPI="7"
5399 -
5400 -WANT_AUTOMAKE="none"
5401 -
5402 -inherit flag-o-matic systemd autotools
5403 -
5404 -MY_PV=${PV/_rc/RC}
5405 -DESCRIPTION="The PHP language runtime engine"
5406 -HOMEPAGE="https://www.php.net/"
5407 -SRC_URI="https://www.php.net/distributions/${P}.tar.xz"
5408 -
5409 -LICENSE="PHP-3.01
5410 - BSD
5411 - Zend-2.0
5412 - bcmath? ( LGPL-2.1+ )
5413 - fpm? ( BSD-2 )
5414 - gd? ( gd )
5415 - unicode? ( BSD-2 LGPL-2.1 )"
5416 -
5417 -SLOT="$(ver_cut 1-2)"
5418 -KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
5419 -
5420 -S="${WORKDIR}/${PN}-${MY_PV}"
5421 -
5422 -# We can build the following SAPIs in the given order
5423 -SAPIS="embed cli cgi fpm apache2 phpdbg"
5424 -
5425 -# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
5426 -IUSE="${IUSE}
5427 - ${SAPIS/cli/+cli}
5428 - threads"
5429 -
5430 -IUSE="${IUSE} acl argon2 bcmath berkdb bzip2 calendar cdb cjk
5431 - coverage +ctype curl debug
5432 - enchant exif ffi +fileinfo +filter firebird
5433 - +flatfile ftp gd gdbm gmp +iconv imap inifile
5434 - intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl lmdb
5435 - mhash mssql mysql mysqli nls
5436 - oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
5437 - readline selinux +session session-mm sharedmem
5438 - +simplexml snmp soap sockets sodium spell sqlite ssl
5439 - sysvipc systemd test tidy +tokenizer tokyocabinet truetype unicode webp
5440 - +xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib"
5441 -
5442 -# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
5443 -REQUIRED_USE="
5444 - || ( cli cgi fpm apache2 embed phpdbg )
5445 - cli? ( ^^ ( readline libedit ) )
5446 - !cli? ( ?? ( readline libedit ) )
5447 - truetype? ( gd zlib )
5448 - webp? ( gd zlib )
5449 - cjk? ( gd zlib )
5450 - exif? ( gd zlib )
5451 - xpm? ( gd zlib )
5452 - gd? ( zlib )
5453 - simplexml? ( xml )
5454 - soap? ( xml )
5455 - xmlrpc? ( xml iconv )
5456 - xmlreader? ( xml )
5457 - xmlwriter? ( xml )
5458 - xslt? ( xml )
5459 - ldap-sasl? ( ldap )
5460 - qdbm? ( !gdbm )
5461 - session-mm? ( session !threads )
5462 - mysql? ( || ( mysqli pdo ) )
5463 - firebird? ( pdo )
5464 - mssql? ( pdo )
5465 -"
5466 -
5467 -RESTRICT="!test? ( test )"
5468 -
5469 -# The supported (that is, autodetected) versions of BDB are listed in
5470 -# the ./configure script. Other versions *work*, but we need to stick to
5471 -# the ones that can be detected to avoid a repeat of bug #564824.
5472 -COMMON_DEPEND="
5473 - >=app-eselect/eselect-php-0.9.1[apache2?,fpm?]
5474 - >=dev-libs/libpcre2-10.30[unicode]
5475 - fpm? ( acl? ( sys-apps/acl ) )
5476 - apache2? ( www-servers/apache[apache2_modules_unixd(+),threads=] )
5477 - argon2? ( app-crypt/argon2:= )
5478 - berkdb? ( || ( sys-libs/db:5.3
5479 - sys-libs/db:5.1
5480 - sys-libs/db:4.8
5481 - sys-libs/db:4.7
5482 - sys-libs/db:4.6
5483 - sys-libs/db:4.5 ) )
5484 - bzip2? ( app-arch/bzip2:0= )
5485 - cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
5486 - coverage? ( dev-util/lcov )
5487 - curl? ( >=net-misc/curl-7.10.5 )
5488 - enchant? ( <app-text/enchant-2.0:0 )
5489 - ffi? ( >=dev-libs/libffi-3.0.11 )
5490 - firebird? ( dev-db/firebird )
5491 - gd? ( >=virtual/jpeg-0-r3:0 media-libs/libpng:0= )
5492 - gdbm? ( >=sys-libs/gdbm-1.8.0:0= )
5493 - gmp? ( dev-libs/gmp:0= )
5494 - iconv? ( virtual/libiconv )
5495 - imap? ( >=virtual/imap-c-client-2[kerberos=,ssl=] )
5496 - intl? ( dev-libs/icu:= )
5497 - kerberos? ( virtual/krb5 )
5498 - ldap? ( >=net-nds/openldap-1.2.11 )
5499 - ldap-sasl? ( dev-libs/cyrus-sasl )
5500 - libedit? ( dev-libs/libedit )
5501 - lmdb? ( dev-db/lmdb:= )
5502 - mssql? ( dev-db/freetds[mssql] )
5503 - nls? ( sys-devel/gettext )
5504 - oci8-instant-client? ( dev-db/oracle-instantclient-basic )
5505 - odbc? ( iodbc? ( dev-db/libiodbc ) !iodbc? ( >=dev-db/unixODBC-1.8.13 ) )
5506 - postgres? ( dev-db/postgresql:* )
5507 - qdbm? ( dev-db/qdbm )
5508 - readline? ( sys-libs/readline:0= )
5509 - session-mm? ( dev-libs/mm )
5510 - snmp? ( >=net-analyzer/net-snmp-5.2 )
5511 - sodium? ( dev-libs/libsodium:= )
5512 - spell? ( >=app-text/aspell-0.50 )
5513 - sqlite? ( >=dev-db/sqlite-3.7.6.3 )
5514 - ssl? (
5515 - !libressl? ( >=dev-libs/openssl-1.0.1:0= )
5516 - libressl? ( dev-libs/libressl:0= )
5517 - )
5518 - tidy? ( || ( app-text/tidy-html5 app-text/htmltidy ) )
5519 - tokyocabinet? ( dev-db/tokyocabinet )
5520 - truetype? ( =media-libs/freetype-2* )
5521 - unicode? ( dev-libs/oniguruma:= )
5522 - webp? ( media-libs/libwebp:0= )
5523 - xml? ( >=dev-libs/libxml2-2.7.6 )
5524 - xpm? ( x11-libs/libXpm )
5525 - xslt? ( dev-libs/libxslt )
5526 - zip? ( >=dev-libs/libzip-1.2.0:= )
5527 - zlib? ( >=sys-libs/zlib-1.2.0.4:0= )
5528 -"
5529 -
5530 -RDEPEND="${COMMON_DEPEND}
5531 - virtual/mta
5532 - fpm? (
5533 - selinux? ( sec-policy/selinux-phpfpm )
5534 - systemd? ( sys-apps/systemd ) )"
5535 -
5536 -# Bison isn't actually needed when building from a release tarball
5537 -# However, the configure script will warn if it's absent or if you
5538 -# have an incompatible version installed. See bug 593278.
5539 -DEPEND="${COMMON_DEPEND}
5540 - app-arch/xz-utils
5541 - >=sys-devel/bison-3.0.1"
5542 -
5543 -BDEPEND="virtual/pkgconfig"
5544 -
5545 -PHP_MV="$(ver_cut 1)"
5546 -
5547 -PATCHES=( "${FILESDIR}/php-iodbc-header-location.patch" )
5548 -
5549 -php_install_ini() {
5550 - local phpsapi="${1}"
5551 -
5552 - # work out where we are installing the ini file
5553 - php_set_ini_dir "${phpsapi}"
5554 -
5555 - # Always install the production INI file, bug 611214.
5556 - local phpinisrc="php.ini-production-${phpsapi}"
5557 - cp php.ini-production "${phpinisrc}" || die
5558 -
5559 - # default to /tmp for save_path, bug #282768
5560 - sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die
5561 -
5562 - # Set the extension dir
5563 - sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \
5564 - -i "${phpinisrc}" || die
5565 -
5566 - # Set the include path to point to where we want to find PEAR packages
5567 - sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die
5568 -
5569 - insinto "${PHP_INI_DIR#${EPREFIX}}"
5570 - newins "${phpinisrc}" php.ini
5571 -
5572 - elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}"
5573 - elog
5574 -
5575 - dodir "${PHP_EXT_INI_DIR#${EPREFIX}}"
5576 - dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}"
5577 -
5578 - if use opcache; then
5579 - elog "Adding opcache to $PHP_EXT_INI_DIR"
5580 - echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \
5581 - "${D}/${PHP_EXT_INI_DIR}"/opcache.ini
5582 - dosym "../ext/opcache.ini" \
5583 - "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini"
5584 - fi
5585 -
5586 - # SAPI-specific handling
5587 - if [[ "${sapi}" == "fpm" ]] ; then
5588 - einfo "Installing FPM config files php-fpm.conf and www.conf"
5589 - insinto "${PHP_INI_DIR#${EPREFIX}}"
5590 - doins sapi/fpm/php-fpm.conf
5591 - insinto "${PHP_INI_DIR#${EPREFIX}}/fpm.d"
5592 - doins sapi/fpm/www.conf
5593 - fi
5594 -
5595 - dodoc php.ini-{development,production}
5596 -}
5597 -
5598 -php_set_ini_dir() {
5599 - PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}"
5600 - PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
5601 - PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
5602 -}
5603 -
5604 -src_prepare() {
5605 - default
5606 -
5607 - # In php-7.x, the FPM pool configuration files have been split off
5608 - # of the main config. By default the pool config files go in
5609 - # e.g. /etc/php-fpm.d, which isn't slotted. So here we move the
5610 - # include directory to a subdirectory "fpm.d" of $PHP_INI_DIR. Later
5611 - # we'll install the pool configuration file "www.conf" there.
5612 - php_set_ini_dir fpm
5613 - sed -i "s~^include=.*$~include=${PHP_INI_DIR}/fpm.d/*.conf~" \
5614 - sapi/fpm/php-fpm.conf.in \
5615 - || die 'failed to move the include directory in php-fpm.conf'
5616 -
5617 - # Emulate buildconf to support cross-compilation
5618 - rm -fr aclocal.m4 autom4te.cache config.cache \
5619 - configure main/php_config.h.in || die
5620 - eautoconf --force
5621 - eautoheader
5622 -}
5623 -
5624 -src_configure() {
5625 - addpredict /usr/share/snmp/mibs/.index #nowarn
5626 - addpredict /var/lib/net-snmp/mib_indexes #nowarn
5627 -
5628 - PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
5629 -
5630 - # The php-fpm config file wants localstatedir to be ${EPREFIX}/var
5631 - # and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002.
5632 - local our_conf=(
5633 - --prefix="${PHP_DESTDIR}"
5634 - --mandir="${PHP_DESTDIR}/man"
5635 - --infodir="${PHP_DESTDIR}/info"
5636 - --libdir="${PHP_DESTDIR}/lib"
5637 - --with-libdir="$(get_libdir)"
5638 - --localstatedir="${EPREFIX}/var"
5639 - --without-pear
5640 - $(use_enable threads maintainer-zts)
5641 - )
5642 -
5643 - our_conf+=(
5644 - $(use_with argon2 password-argon2 "${EPREFIX}/usr")
5645 - $(use_enable bcmath)
5646 - $(use_with bzip2 bz2 "${EPREFIX}/usr")
5647 - $(use_enable calendar)
5648 - $(use_enable coverage gcov)
5649 - $(use_enable ctype)
5650 - $(use_with curl)
5651 - $(use_enable xml dom)
5652 - $(use_with enchant)
5653 - $(use_enable exif)
5654 - $(use_with ffi)
5655 - $(use_enable fileinfo)
5656 - $(use_enable filter)
5657 - $(use_enable ftp)
5658 - $(use_with nls gettext "${EPREFIX}/usr")
5659 - $(use_with gmp gmp "${EPREFIX}/usr")
5660 - $(use_with mhash mhash "${EPREFIX}/usr")
5661 - $(use_with iconv iconv \
5662 - $(use elibc_glibc || use elibc_musl || use elibc_FreeBSD || echo "${EPREFIX}/usr"))
5663 - $(use_enable intl)
5664 - $(use_enable ipv6)
5665 - $(use_enable json)
5666 - $(use_with kerberos)
5667 - $(use_with xml libxml)
5668 - $(use_enable unicode mbstring)
5669 - $(use_with ssl openssl)
5670 - $(use_enable pcntl)
5671 - $(use_enable phar)
5672 - $(use_enable pdo)
5673 - $(use_enable opcache)
5674 - $(use_with postgres pgsql "${EPREFIX}/usr")
5675 - $(use_enable posix)
5676 - $(use_with spell pspell "${EPREFIX}/usr")
5677 - $(use_enable simplexml)
5678 - $(use_enable sharedmem shmop)
5679 - $(use_with snmp snmp "${EPREFIX}/usr")
5680 - $(use_enable soap)
5681 - $(use_enable sockets)
5682 - $(use_with sodium)
5683 - $(use_with sqlite sqlite3)
5684 - $(use_enable sysvipc sysvmsg)
5685 - $(use_enable sysvipc sysvsem)
5686 - $(use_enable sysvipc sysvshm)
5687 - $(use_with tidy tidy "${EPREFIX}/usr")
5688 - $(use_enable tokenizer)
5689 - $(use_enable xml)
5690 - $(use_enable xmlreader)
5691 - $(use_enable xmlwriter)
5692 - $(use_with xmlrpc)
5693 - $(use_with xslt xsl)
5694 - $(use_with zip)
5695 - $(use_with zlib zlib "${EPREFIX}/usr")
5696 - $(use_enable debug)
5697 - )
5698 -
5699 - # DBA support
5700 - if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
5701 - || use qdbm || use lmdb || use tokyocabinet ; then
5702 - our_conf+=( "--enable-dba" )
5703 - fi
5704 -
5705 - # DBA drivers support
5706 - our_conf+=(
5707 - $(use_with cdb)
5708 - $(use_with berkdb db4 "${EPREFIX}/usr")
5709 - $(use_enable flatfile)
5710 - $(use_with gdbm gdbm "${EPREFIX}/usr")
5711 - $(use_enable inifile)
5712 - $(use_with qdbm qdbm "${EPREFIX}/usr")
5713 - $(use_with tokyocabinet tcadb "${EPREFIX}/usr")
5714 - $(use_with lmdb lmdb "${EPREFIX}/usr")
5715 - )
5716 -
5717 - # Support for the GD graphics library
5718 - our_conf+=(
5719 - $(use_with truetype freetype)
5720 - $(use_enable cjk gd-jis-conv)
5721 - $(use_with gd jpeg)
5722 - $(use_with xpm)
5723 - $(use_with webp)
5724 - )
5725 - # enable gd last, so configure can pick up the previous settings
5726 - our_conf+=( $(use_enable gd) )
5727 -
5728 - # IMAP support
5729 - if use imap ; then
5730 - our_conf+=(
5731 - $(use_with imap imap "${EPREFIX}/usr")
5732 - $(use_with ssl imap-ssl "${EPREFIX}/usr")
5733 - )
5734 - fi
5735 -
5736 - # LDAP support
5737 - if use ldap ; then
5738 - our_conf+=(
5739 - $(use_with ldap ldap "${EPREFIX}/usr")
5740 - $(use_with ldap-sasl)
5741 - )
5742 - fi
5743 -
5744 - # MySQL support
5745 - local mysqllib="mysqlnd"
5746 - local mysqlilib="mysqlnd"
5747 -
5748 - our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
5749 -
5750 - local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock"
5751 - if use mysql || use mysqli ; then
5752 - our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") )
5753 - fi
5754 -
5755 - # ODBC support
5756 - if use odbc && use iodbc ; then
5757 - our_conf+=(
5758 - --without-unixODBC
5759 - --with-iodbc
5760 - $(use_with pdo pdo-odbc "iODBC,${EPREFIX}/usr")
5761 - )
5762 - elif use odbc ; then
5763 - our_conf+=(
5764 - --with-unixODBC="${EPREFIX}/usr"
5765 - --without-iodbc
5766 - $(use_with pdo pdo-odbc "unixODBC,${EPREFIX}/usr")
5767 - )
5768 - else
5769 - our_conf+=(
5770 - --without-unixODBC
5771 - --without-iodbc
5772 - --without-pdo-odbc
5773 - )
5774 - fi
5775 -
5776 - # Oracle support
5777 - our_conf+=( $(use_with oci8-instant-client oci8) )
5778 -
5779 - # PDO support
5780 - if use pdo ; then
5781 - our_conf+=(
5782 - $(use_with mssql pdo-dblib "${EPREFIX}/usr")
5783 - $(use_with mysql pdo-mysql "${mysqllib}")
5784 - $(use_with postgres pdo-pgsql)
5785 - $(use_with sqlite pdo-sqlite)
5786 - $(use_with firebird pdo-firebird "${EPREFIX}/usr")
5787 - $(use_with oci8-instant-client pdo-oci)
5788 - )
5789 - fi
5790 -
5791 - # readline/libedit support
5792 - our_conf+=(
5793 - $(use_with readline readline "${EPREFIX}/usr")
5794 - $(use_with libedit)
5795 - )
5796 -
5797 - # Session support
5798 - if use session ; then
5799 - our_conf+=( $(use_with session-mm mm "${EPREFIX}/usr") )
5800 - else
5801 - our_conf+=( $(use_enable session) )
5802 - fi
5803 -
5804 - # Use pic for shared modules such as apache2's mod_php
5805 - our_conf+=( --with-pic )
5806 -
5807 - # we use the system copy of pcre
5808 - # --with-external-pcre affects ext/pcre
5809 - # Many arches don't support pcre-jit
5810 - our_conf+=(
5811 - --with-external-pcre
5812 - --without-pcre-jit
5813 - )
5814 -
5815 - # Catch CFLAGS problems
5816 - # Fixes bug #14067.
5817 - # Changed order to run it in reverse for bug #32022 and #12021.
5818 - replace-cpu-flags "k6*" "i586"
5819 -
5820 - # Cache the ./configure test results between SAPIs.
5821 - our_conf+=( --cache-file="${T}/config.cache" )
5822 -
5823 - # Support user-passed configuration parameters
5824 - our_conf+=( ${EXTRA_ECONF:-} )
5825 -
5826 - # Support the Apache2 extras, they must be set globally for all
5827 - # SAPIs to work correctly, especially for external PHP extensions
5828 -
5829 - local one_sapi
5830 - local sapi
5831 - mkdir -p "${WORKDIR}/sapis-build" || die
5832 - for one_sapi in $SAPIS ; do
5833 - use "${one_sapi}" || continue
5834 - php_set_ini_dir "${one_sapi}"
5835 -
5836 - # The BUILD_DIR variable is used to determine where to output
5837 - # the files that autotools creates. This was all originally
5838 - # based on the autotools-utils eclass.
5839 - BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}"
5840 - cp -a "${S}" "${BUILD_DIR}" || die
5841 - cd "${BUILD_DIR}" || die
5842 -
5843 - local sapi_conf=(
5844 - --with-config-file-path="${PHP_INI_DIR}"
5845 - --with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}"
5846 - )
5847 -
5848 - for sapi in $SAPIS ; do
5849 - case "$sapi" in
5850 - cli|cgi|embed|fpm|phpdbg)
5851 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
5852 - sapi_conf+=( "--enable-${sapi}" )
5853 - if [[ "fpm" == "${sapi}" ]] ; then
5854 - sapi_conf+=(
5855 - $(use_with acl fpm-acl)
5856 - $(use_with systemd fpm-systemd)
5857 - )
5858 - fi
5859 - else
5860 - sapi_conf+=( "--disable-${sapi}" )
5861 - fi
5862 - ;;
5863 -
5864 - apache2)
5865 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
5866 - sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" )
5867 - else
5868 - sapi_conf+=( --without-apxs2 )
5869 - fi
5870 - ;;
5871 - esac
5872 - done
5873 -
5874 - # Construct the $myeconfargs array by concatenating $our_conf
5875 - # (the common args) and $sapi_conf (the SAPI-specific args).
5876 - local myeconfargs=( "${our_conf[@]}" )
5877 - myeconfargs+=( "${sapi_conf[@]}" )
5878 -
5879 - pushd "${BUILD_DIR}" > /dev/null || die
5880 - econf "${myeconfargs[@]}"
5881 - popd > /dev/null || die
5882 - done
5883 -}
5884 -
5885 -src_compile() {
5886 - # snmp seems to run during src_compile, too (bug #324739)
5887 - addpredict /usr/share/snmp/mibs/.index #nowarn
5888 - addpredict /var/lib/net-snmp/mib_indexes #nowarn
5889 -
5890 - local sapi
5891 - for sapi in ${SAPIS} ; do
5892 - if use "${sapi}"; then
5893 - cd "${WORKDIR}/sapis-build/$sapi" || \
5894 - die "Failed to change dir to ${WORKDIR}/sapis-build/$1"
5895 - emake
5896 - fi
5897 - done
5898 -}
5899 -
5900 -src_install() {
5901 - # see bug #324739 for what happens when we don't have that
5902 - addpredict /usr/share/snmp/mibs/.index #nowarn
5903 -
5904 - # grab the first SAPI that got built and install common files from there
5905 - local first_sapi="", sapi=""
5906 - for sapi in $SAPIS ; do
5907 - if use $sapi ; then
5908 - first_sapi=$sapi
5909 - break
5910 - fi
5911 - done
5912 -
5913 - # Makefile forgets to create this before trying to write to it...
5914 - dodir "${PHP_DESTDIR#${EPREFIX}}/bin"
5915 -
5916 - # Install php environment (without any sapis)
5917 - cd "${WORKDIR}/sapis-build/$first_sapi" || die
5918 - emake INSTALL_ROOT="${D}" \
5919 - install-build install-headers install-programs
5920 -
5921 - local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)"
5922 -
5923 - # Create the directory where we'll put version-specific php scripts
5924 - keepdir "/usr/share/php${PHP_MV}"
5925 -
5926 - local file=""
5927 - local sapi_list=""
5928 -
5929 - for sapi in ${SAPIS}; do
5930 - if use "${sapi}" ; then
5931 - einfo "Installing SAPI: ${sapi}"
5932 - cd "${WORKDIR}/sapis-build/${sapi}" || die
5933 -
5934 - if [[ "${sapi}" == "apache2" ]] ; then
5935 - # We're specifically not using emake install-sapi as libtool
5936 - # may cause unnecessary relink failures (see bug #351266)
5937 - insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/"
5938 - newins ".libs/libphp${PHP_MV}$(get_libname)" \
5939 - "libphp${PHP_MV}$(get_libname)"
5940 - keepdir "/usr/$(get_libdir)/apache2/modules"
5941 - else
5942 - # needed each time, php_install_ini would reset it
5943 - local dest="${PHP_DESTDIR#${EPREFIX}}"
5944 - into "${dest}"
5945 - case "$sapi" in
5946 - cli)
5947 - source="sapi/cli/php"
5948 - # Install the "phar" archive utility.
5949 - if use phar ; then
5950 - emake INSTALL_ROOT="${D}" install-pharcmd
5951 - dosym "..${dest#/usr}/bin/phar" "/usr/bin/phar${SLOT}"
5952 - fi
5953 - ;;
5954 - cgi)
5955 - source="sapi/cgi/php-cgi"
5956 - ;;
5957 - fpm)
5958 - source="sapi/fpm/php-fpm"
5959 - ;;
5960 - embed)
5961 - source="libs/libphp${PHP_MV}$(get_libname)"
5962 - ;;
5963 - phpdbg)
5964 - source="sapi/phpdbg/phpdbg"
5965 - ;;
5966 - *)
5967 - die "unhandled sapi in src_install"
5968 - ;;
5969 - esac
5970 -
5971 - if [[ "${source}" == *"$(get_libname)" ]]; then
5972 - dolib.so "${source}"
5973 - else
5974 - dobin "${source}"
5975 - local name="$(basename ${source})"
5976 - dosym "..${dest#/usr}/bin/${name}" "/usr/bin/${name}${SLOT}"
5977 - fi
5978 - fi
5979 -
5980 - php_install_ini "${sapi}"
5981 -
5982 - # construct correct SAPI string for php-config
5983 - # thanks to ferringb for the bash voodoo
5984 - if [[ "${sapi}" == "apache2" ]]; then
5985 - sapi_list="${sapi_list:+${sapi_list} }apache2handler"
5986 - else
5987 - sapi_list="${sapi_list:+${sapi_list} }${sapi}"
5988 - fi
5989 - fi
5990 - done
5991 -
5992 - # Installing opcache module
5993 - if use opcache ; then
5994 - into "${PHP_DESTDIR#${EPREFIX}}"
5995 - dolib.so "modules/opcache$(get_libname)"
5996 - fi
5997 -
5998 - # Install env.d files
5999 - newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}"
6000 - sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
6001 - sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
6002 -
6003 - # set php-config variable correctly (bug #278439)
6004 - sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \
6005 - "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die
6006 -
6007 - if use fpm ; then
6008 - if use systemd; then
6009 - systemd_newunit "${FILESDIR}/php-fpm_at.service" \
6010 - "php-fpm@${SLOT}.service"
6011 - else
6012 - systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \
6013 - "php-fpm@${SLOT}.service"
6014 - fi
6015 - fi
6016 -}
6017 -
6018 -src_test() {
6019 - echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
6020 - PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
6021 - if [[ ! -x "${PHP_BIN}" ]] ; then
6022 - ewarn "Test phase requires USE=cli, skipping"
6023 - return
6024 - else
6025 - export TEST_PHP_EXECUTABLE="${PHP_BIN}"
6026 - fi
6027 -
6028 - if [[ -x "${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" ]] ; then
6029 - export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi"
6030 - fi
6031 -
6032 - if [[ -x "${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" ]] ; then
6033 - export TEST_PHPDBG_EXECUTABLE="${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg"
6034 - fi
6035 -
6036 - REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \
6037 - "session.save_path=${T}" \
6038 - "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \
6039 - "session.save_path=${T}"
6040 -
6041 - for name in ${EXPECTED_TEST_FAILURES}; do
6042 - mv "${name}.out" "${name}.out.orig" 2>/dev/null || die
6043 - done
6044 -
6045 - local failed="$(find -name '*.out')"
6046 - if [[ ${failed} != "" ]] ; then
6047 - ewarn "The following test cases failed unexpectedly:"
6048 - for name in ${failed}; do
6049 - ewarn " ${name/.out/}"
6050 - done
6051 - else
6052 - einfo "No unexpected test failures, all fine"
6053 - fi
6054 -
6055 - if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
6056 - local passed=""
6057 - for name in ${EXPECTED_TEST_FAILURES}; do
6058 - [[ -f "${name}.diff" ]] && continue
6059 - passed="${passed} ${name}"
6060 - done
6061 - if [[ ${passed} != "" ]] ; then
6062 - einfo "The following test cases passed unexpectedly:"
6063 - for name in ${passed}; do
6064 - ewarn " ${passed}"
6065 - done
6066 - else
6067 - einfo "None of the known-to-fail tests passed, all fine"
6068 - fi
6069 - fi
6070 -}
6071 -
6072 -pkg_postinst() {
6073 - # Output some general info to the user
6074 - if use apache2 ; then
6075 - elog
6076 - elog "To enable PHP in apache, you will need to add \"-D PHP\" to"
6077 - elog "your apache2 command. OpenRC users can append that string to"
6078 - elog "APACHE2_OPTS in /etc/conf.d/apache2."
6079 - elog
6080 - elog "The apache module configuration file 70_mod_php.conf is"
6081 - elog "provided (and maintained) by eselect-php."
6082 - elog
6083 - fi
6084 -
6085 - # Create the symlinks for php
6086 - local m
6087 - for m in ${SAPIS}; do
6088 - [[ ${m} == 'embed' ]] && continue;
6089 - if use $m ; then
6090 - local ci=$(eselect php show $m)
6091 - if [[ -z $ci ]]; then
6092 - eselect php set $m php${SLOT} || die
6093 - einfo "Switched ${m} to use php:${SLOT}"
6094 - einfo
6095 - elif [[ $ci != "php${SLOT}" ]] ; then
6096 - elog "To switch $m to use php:${SLOT}, run"
6097 - elog " eselect php set $m php${SLOT}"
6098 - elog
6099 - fi
6100 - fi
6101 - done
6102 -
6103 - # Remove dead symlinks for SAPIs that were just disabled. For
6104 - # example, if the user has the cgi SAPI enabled, then he has an
6105 - # eselect-php symlink for it. If he later reinstalls PHP with
6106 - # USE="-cgi", that symlink will break. This call to eselect is
6107 - # supposed to remove that dead link per bug 572436.
6108 - eselect php cleanup || die
6109 -
6110 - if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then
6111 - elog "To build extensions for this version of PHP, you will need to"
6112 - elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable."
6113 - elog
6114 - fi
6115 -
6116 - # Warn about the removal of PHP_INI_VERSION if the user has it set.
6117 - if [[ -n "${PHP_INI_VERSION}" ]]; then
6118 - ewarn 'The PHP_INI_VERSION variable has been phased out. You may'
6119 - ewarn 'remove it from your configuration at your convenience. See'
6120 - ewarn
6121 - ewarn ' https://bugs.gentoo.org/611214'
6122 - ewarn
6123 - ewarn 'for more information.'
6124 - fi
6125 -
6126 - elog "For details on how version slotting works, please see"
6127 - elog "the wiki:"
6128 - elog
6129 - elog " https://wiki.gentoo.org/wiki/PHP"
6130 - elog
6131 -}
6132 -
6133 -pkg_postrm() {
6134 - # This serves two purposes. First, if we have just removed the last
6135 - # installed version of PHP, then this will remove any dead symlinks
6136 - # belonging to eselect-php. Second, if a user upgrades slots from
6137 - # (say) 5.6 to 7.0 and depcleans the old slot, then this will update
6138 - # his existing symlinks to point to the new 7.0 installation. The
6139 - # latter is bug 432962.
6140 - #
6141 - # Note: the eselect-php package may not be installed at this point,
6142 - # so we can't die() if this command fails.
6143 - eselect php cleanup
6144 -}