Gentoo Archives: gentoo-commits

From: Brian Evans <grknight@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/php/
Date: Thu, 14 Nov 2019 19:51:22
Message-Id: 1573761029.3bb9c52d57dd7694ae6695b844d3bb16fb1bc733.grknight@gentoo
1 commit: 3bb9c52d57dd7694ae6695b844d3bb16fb1bc733
2 Author: Brian Evans <grknight <AT> gentoo <DOT> org>
3 AuthorDate: Thu Nov 14 19:50:29 2019 +0000
4 Commit: Brian Evans <grknight <AT> gentoo <DOT> org>
5 CommitDate: Thu Nov 14 19:50:29 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3bb9c52d
7
8 dev-lang/php: Security cleanup for vulnerable versions
9
10 Bug: https://bugs.gentoo.org/698452
11 Package-Manager: Portage-2.3.79, Repoman-2.3.18
12 Signed-off-by: Brian Evans <grknight <AT> gentoo.org>
13
14 dev-lang/php/Manifest | 3 -
15 dev-lang/php/php-7.1.32.ebuild | 736 ----------------------------------------
16 dev-lang/php/php-7.2.22.ebuild | 748 ----------------------------------------
17 dev-lang/php/php-7.3.9.ebuild | 749 -----------------------------------------
18 4 files changed, 2236 deletions(-)
19
20 diff --git a/dev-lang/php/Manifest b/dev-lang/php/Manifest
21 index 75306a88041..646dcb0641f 100644
22 --- a/dev-lang/php/Manifest
23 +++ b/dev-lang/php/Manifest
24 @@ -1,9 +1,6 @@
25 DIST php-5.6.40.tar.xz 12472236 BLAKE2B f41147eaec9b15e965540f9e871691cc88848dd619bae6af85e7bba0130b71ce91bad5cdbbadbb537c42df83369f5c731007339a9d9e21e689e913c135201afc SHA512 997b5a952a60cf9166671cc91fcc34c674dd62bfd5cb0a9cdf3fdf2d088b5d19943d94c1cf193f8ab71fc4957d9a9a4c7c2fb8826f937501c1c0a0858f10e329
26 -DIST php-7.1.32.tar.xz 12369916 BLAKE2B 26f3756bfa15d8caa9f99f48526eabe66cb389d0ecf534700dcf9e2514de12c1b9d45c634b8e5ce07d1e28cce4c5b5a9cda7780013a7af070fd5e3d250a92616 SHA512 090dd6d79514f97be125e86d741094c149250a11a4f7d5f8dd08e028ae5f0b347afc58787b2002cc7b183d08a56562042e33ef7f1eeb060aafaf6fef67646ab1
27 DIST php-7.1.33.tar.xz 12370228 BLAKE2B 610f501c1729ca3f5fa6f104b9f229046cf1e497f2fdc1194b80b4a5f9ca7f799dc6a458de34dd7a87976b7252ba2f548a8d689e4b2a45c025f1807ab8489f12 SHA512 ed37a79e3402c767f20e55c1cbe27957cc78240eafc719fffccd7d29ae10a45112aa0f29082f56133cd9c25f2750e9e57246d95b4f38d766f49bd29d1397eb1d
28 -DIST php-7.2.22.tar.xz 12271632 BLAKE2B be3089066ba1c25c479eedaf3e6dd8f7773a6d87a16ce49d8c5379bc9b25d073b497004ccb219795bcfdc3af1310570f94f109754120c254ea5bbaaf1a5e953f SHA512 526dbcc03726d6e2f146adbdf8d89f0c8acb2575a3c21e5ef14ae256f29447d82154e0b1869c0143d831f81c2da0d943957c51144fb458457d3681cdfbc6d49b
29 DIST php-7.2.24.tar.xz 12302284 BLAKE2B 3c864e72d9fce1f13295385e20708a632087b2e4ffdc9e0012191cb2e17a3530f26797ad03c595bea60cccf850fe17028f2a379e50f32bd4db82530e0fcd727f SHA512 39597b8328cb4d5284288bdce8dd9c7ef8446e46914de93203700efaf67f85ad5b69df777bea14eef9160b233fb79bcb60f6750c0df011bbf610b62a524689e3
30 DIST php-7.3.11.tar.xz 12092412 BLAKE2B 0f326b85756cfb5ca96a43d7bfbe8aebd3bb9e9ede06734fb00dc3551372d53befba9e87f5f6a0b0b9e62d35a2eedacd1fa500e1eeff908e05ff52be730c61b4 SHA512 150cb202efc4cc1df042a2cbb9368a2d29aefd1d0cf1a0b0bd7238ba5cb6c4b828e23f2d42b4ecd77dd54f73141a33fc3b36ca0764320e9ba470c9549a7f0291
31 -DIST php-7.3.9.tar.xz 12064244 BLAKE2B 2837463a74a0ccffc1a2193f9fbce78c98c15dd60214cb5d5d704aed7d74449696c3a516e86f440aed9ff3dc2ed8e7bbebcaf0a1268afa55aca2b642e958abf1 SHA512 017d2ae3cd499a7f6ee30111baf0a119e2f404919575acc5ae91fa6e53a303c9d1b5d165205eec3943c3547ff8759e21fbccc62845e3269176f6fc0f2ba88490
32 DIST php-7.4.0RC6.tar.xz 10229764 BLAKE2B e1de007b6b63fee878ccb0d8ea1d1c067210e93978076a7d4925d6d0902ebe514b1238a00e9f662130183f474395500f3335b91e7ebca381a864b7654582f9a1 SHA512 2f20f3b78bbb4df8e59da6d4c2eb18ec22c4bf49d3b7e6f497600f13669fdd4e7ebbf98a7e75948eaa6e9c72bbb160b2b8c91c564268cdc01570560bad682c05
33 DIST php-patches-7.1.31bp.tar.bz2 37219 BLAKE2B 4f3ead2f69adf00ac1317371172c8adbb823f597cd8e3cafe7044d6a46671437fd2e5eaef4309a6fd5825123394044543284d3cbe892c918353a5b07c12b7401 SHA512 eb52679d035ceb4124c8e9175024f4f753e20d139479af4a57e01de941991716b2ce37f6190242c1bec46fd5305bad1f91613b04ee849a0d94f4a33ce013781e
34
35 diff --git a/dev-lang/php/php-7.1.32.ebuild b/dev-lang/php/php-7.1.32.ebuild
36 deleted file mode 100644
37 index d6b54b2cba3..00000000000
38 --- a/dev-lang/php/php-7.1.32.ebuild
39 +++ /dev/null
40 @@ -1,736 +0,0 @@
41 -# Copyright 1999-2019 Gentoo Authors
42 -# Distributed under the terms of the GNU General Public License v2
43 -
44 -EAPI="7"
45 -
46 -inherit flag-o-matic systemd autotools
47 -
48 -DESCRIPTION="The PHP language runtime engine"
49 -HOMEPAGE="https://php.net/"
50 -SRC_URI="https://php.net/distributions/${P}.tar.xz"
51 -
52 -LICENSE="PHP-3.01
53 - BSD
54 - Zend-2.0
55 - bcmath? ( LGPL-2.1+ )
56 - fpm? ( BSD-2 )
57 - gd? ( gd )
58 - unicode? ( BSD-2 LGPL-2.1 )"
59 -
60 -SLOT="$(ver_cut 1-2)"
61 -KEYWORDS="~alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
62 -
63 -# We can build the following SAPIs in the given order
64 -SAPIS="embed cli cgi fpm apache2 phpdbg"
65 -
66 -# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
67 -IUSE="${IUSE}
68 - ${SAPIS/cli/+cli}
69 - threads"
70 -
71 -IUSE="${IUSE} acl bcmath berkdb bzip2 calendar cdb cjk
72 - coverage crypt +ctype curl debug
73 - enchant exif +fileinfo +filter firebird
74 - +flatfile ftp gd gdbm gmp +hash +iconv imap inifile
75 - intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl
76 - mhash mssql mysql mysqli nls
77 - oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
78 - readline recode selinux +session session-mm sharedmem
79 - +simplexml snmp soap sockets spell sqlite ssl
80 - sysvipc systemd test tidy +tokenizer truetype unicode wddx webp
81 - +xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib"
82 -
83 -# The supported (that is, autodetected) versions of BDB are listed in
84 -# the ./configure script. Other versions *work*, but we need to stick to
85 -# the ones that can be detected to avoid a repeat of bug #564824.
86 -COMMON_DEPEND="
87 - >=app-eselect/eselect-php-0.9.1[apache2?,fpm?]
88 - >=dev-libs/libpcre-8.32[unicode]
89 - fpm? ( acl? ( sys-apps/acl ) )
90 - apache2? ( www-servers/apache[apache2_modules_unixd(+),threads=] )
91 - berkdb? ( || ( sys-libs/db:5.3
92 - sys-libs/db:5.1
93 - sys-libs/db:4.8
94 - sys-libs/db:4.7
95 - sys-libs/db:4.6
96 - sys-libs/db:4.5 ) )
97 - bzip2? ( app-arch/bzip2:0= )
98 - cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
99 - coverage? ( dev-util/lcov )
100 - crypt? ( >=dev-libs/libmcrypt-2.4 )
101 - curl? ( >=net-misc/curl-7.10.5 )
102 - enchant? ( <app-text/enchant-2.0:0 )
103 - firebird? ( dev-db/firebird )
104 - gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib )
105 - gdbm? ( >=sys-libs/gdbm-1.8.0:0= )
106 - gmp? ( dev-libs/gmp:0= )
107 - iconv? ( virtual/libiconv )
108 - imap? ( virtual/imap-c-client[kerberos=,ssl=] )
109 - intl? ( dev-libs/icu:= )
110 - iodbc? ( dev-db/libiodbc )
111 - kerberos? ( virtual/krb5 )
112 - ldap? ( >=net-nds/openldap-1.2.11 )
113 - ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 )
114 - libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) )
115 - mssql? ( dev-db/freetds[mssql] )
116 - nls? ( sys-devel/gettext )
117 - oci8-instant-client? ( dev-db/oracle-instantclient-basic )
118 - odbc? ( >=dev-db/unixODBC-1.8.13 )
119 - postgres? ( dev-db/postgresql:* )
120 - qdbm? ( dev-db/qdbm )
121 - readline? ( sys-libs/readline:0= )
122 - recode? ( app-text/recode )
123 - session-mm? ( dev-libs/mm )
124 - simplexml? ( >=dev-libs/libxml2-2.6.8 )
125 - snmp? ( >=net-analyzer/net-snmp-5.2 )
126 - soap? ( >=dev-libs/libxml2-2.6.8 )
127 - spell? ( >=app-text/aspell-0.50 )
128 - sqlite? ( >=dev-db/sqlite-3.7.6.3 )
129 - ssl? (
130 - !libressl? ( dev-libs/openssl:0= )
131 - libressl? ( dev-libs/libressl:0= )
132 - )
133 - tidy? ( || ( app-text/tidy-html5 app-text/htmltidy ) )
134 - truetype? ( =media-libs/freetype-2* )
135 - unicode? ( dev-libs/oniguruma:= )
136 - wddx? ( >=dev-libs/libxml2-2.6.8 )
137 - webp? ( media-libs/libwebp:0= )
138 - xml? ( >=dev-libs/libxml2-2.6.8 )
139 - xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
140 - xmlreader? ( >=dev-libs/libxml2-2.6.8 )
141 - xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
142 - xpm? ( x11-libs/libXpm )
143 - xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
144 - zip? ( sys-libs/zlib:0= )
145 - zlib? ( sys-libs/zlib:0= )
146 -"
147 -
148 -RDEPEND="${COMMON_DEPEND}
149 - virtual/mta
150 - fpm? (
151 - selinux? ( sec-policy/selinux-phpfpm )
152 - systemd? ( sys-apps/systemd ) )"
153 -
154 -# Bison isn't actually needed when building from a release tarball
155 -# However, the configure script will warn if it's absent or if you
156 -# have an incompatible version installed. See bug 593278.
157 -DEPEND="${COMMON_DEPEND}
158 - app-arch/xz-utils
159 - >=sys-devel/bison-3.0.1"
160 -
161 -BDEPEND="virtual/pkgconfig"
162 -
163 -# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
164 -REQUIRED_USE="
165 - || ( cli cgi fpm apache2 embed phpdbg )
166 - cli? ( ^^ ( readline libedit ) )
167 - truetype? ( gd zlib )
168 - webp? ( gd zlib )
169 - cjk? ( gd zlib )
170 - exif? ( gd zlib )
171 - xpm? ( gd zlib )
172 - gd? ( zlib )
173 - simplexml? ( xml )
174 - soap? ( xml )
175 - wddx? ( xml )
176 - xmlrpc? ( || ( xml iconv ) )
177 - xmlreader? ( xml )
178 - xslt? ( xml )
179 - ldap-sasl? ( ldap )
180 - mhash? ( hash )
181 - phar? ( hash )
182 - qdbm? ( !gdbm )
183 - readline? ( !libedit )
184 - recode? ( !imap !mysqli !mysql )
185 - session-mm? ( session !threads )
186 - mysql? ( hash || ( mysqli pdo ) )
187 - mysqli? ( hash )
188 -"
189 -PATCHES=(
190 - "${FILESDIR}/php-freetype-2.9.1.patch"
191 - "${FILESDIR}/php-7.1.25-intl-use-icu-namespace.patch"
192 -)
193 -
194 -PHP_MV="$(ver_cut 1)"
195 -
196 -php_install_ini() {
197 - local phpsapi="${1}"
198 -
199 - # work out where we are installing the ini file
200 - php_set_ini_dir "${phpsapi}"
201 -
202 - # Always install the production INI file, bug 611214.
203 - local phpinisrc="php.ini-production-${phpsapi}"
204 - cp php.ini-production "${phpinisrc}" || die
205 -
206 - # default to /tmp for save_path, bug #282768
207 - sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die
208 -
209 - # Set the extension dir
210 - sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \
211 - -i "${phpinisrc}" || die
212 -
213 - # Set the include path to point to where we want to find PEAR packages
214 - sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die
215 -
216 - dodir "${PHP_INI_DIR#${EPREFIX}}"
217 - insinto "${PHP_INI_DIR#${EPREFIX}}"
218 - newins "${phpinisrc}" php.ini
219 -
220 - elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}"
221 - elog
222 -
223 - dodir "${PHP_EXT_INI_DIR#${EPREFIX}}"
224 - dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}"
225 -
226 - if use opcache; then
227 - elog "Adding opcache to $PHP_EXT_INI_DIR"
228 - echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \
229 - "${D}/${PHP_EXT_INI_DIR}"/opcache.ini
230 - dosym "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" \
231 - "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini"
232 - fi
233 -
234 - # SAPI-specific handling
235 - if [[ "${sapi}" == "fpm" ]] ; then
236 - einfo "Installing FPM config files php-fpm.conf and www.conf"
237 - insinto "${PHP_INI_DIR#${EPREFIX}}"
238 - doins sapi/fpm/php-fpm.conf
239 - insinto "${PHP_INI_DIR#${EPREFIX}}/fpm.d"
240 - doins sapi/fpm/www.conf
241 - fi
242 -
243 - dodoc php.ini-{development,production}
244 -}
245 -
246 -php_set_ini_dir() {
247 - PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}"
248 - PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
249 - PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
250 -}
251 -
252 -src_prepare() {
253 - default
254 -
255 - # In php-7.x, the FPM pool configuration files have been split off
256 - # of the main config. By default the pool config files go in
257 - # e.g. /etc/php-fpm.d, which isn't slotted. So here we move the
258 - # include directory to a subdirectory "fpm.d" of $PHP_INI_DIR. Later
259 - # we'll install the pool configuration file "www.conf" there.
260 - php_set_ini_dir fpm
261 - sed -i "s~^include=.*$~include=${PHP_INI_DIR}/fpm.d/*.conf~" \
262 - sapi/fpm/php-fpm.conf.in \
263 - || die 'failed to move the include directory in php-fpm.conf'
264 -
265 - # Bug 669566 - necessary so that build tools are updated for commands like pecl
266 - # Force rebuilding aclocal.m4
267 - rm -f aclocal.m4 || die "failed to remove aclocal.m4 in src_prepare"
268 - eautoreconf
269 -}
270 -
271 -src_configure() {
272 - addpredict /usr/share/snmp/mibs/.index #nowarn
273 - addpredict /var/lib/net-snmp/mib_indexes #nowarn
274 -
275 - PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
276 -
277 - # The php-fpm config file wants localstatedir to be ${EPREFIX}/var
278 - # and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002.
279 - local our_conf=(
280 - --prefix="${PHP_DESTDIR}"
281 - --mandir="${PHP_DESTDIR}/man"
282 - --infodir="${PHP_DESTDIR}/info"
283 - --libdir="${PHP_DESTDIR}/lib"
284 - --with-libdir="$(get_libdir)"
285 - --localstatedir="${EPREFIX}/var"
286 - --without-pear
287 - $(use_enable threads maintainer-zts)
288 - )
289 -
290 - our_conf+=(
291 - $(use_enable bcmath bcmath)
292 - $(use_with bzip2 bz2 "${EPREFIX}/usr")
293 - $(use_enable calendar calendar)
294 - $(use_enable coverage gcov)
295 - $(use_enable ctype ctype)
296 - $(use_with curl curl "${EPREFIX}/usr")
297 - $(use_enable xml dom)
298 - $(use_with enchant enchant "${EPREFIX}/usr")
299 - $(use_enable exif exif)
300 - $(use_enable fileinfo fileinfo)
301 - $(use_enable filter filter)
302 - $(use_enable ftp ftp)
303 - $(use_with nls gettext "${EPREFIX}/usr")
304 - $(use_with gmp gmp "${EPREFIX}/usr")
305 - $(use_enable hash hash)
306 - $(use_with mhash mhash "${EPREFIX}/usr")
307 - $(use_with iconv iconv \
308 - $(use elibc_glibc || use elibc_musl || use elibc_FreeBSD || echo "${EPREFIX}/usr"))
309 - $(use_enable intl intl)
310 - $(use_enable ipv6 ipv6)
311 - $(use_enable json json)
312 - $(use_with kerberos kerberos "${EPREFIX}/usr")
313 - $(use_enable xml libxml)
314 - $(use_with xml libxml-dir "${EPREFIX}/usr")
315 - $(use_enable unicode mbstring)
316 - $(use_with crypt mcrypt "${EPREFIX}/usr")
317 - $(use_with unicode onig "${EPREFIX}/usr")
318 - $(use_with ssl openssl "${EPREFIX}/usr")
319 - $(use_with ssl openssl-dir "${EPREFIX}/usr")
320 - $(use_enable pcntl pcntl)
321 - $(use_enable phar phar)
322 - $(use_enable pdo pdo)
323 - $(use_enable opcache opcache)
324 - $(use_with postgres pgsql "${EPREFIX}/usr")
325 - $(use_enable posix posix)
326 - $(use_with spell pspell "${EPREFIX}/usr")
327 - $(use_with recode recode "${EPREFIX}/usr")
328 - $(use_enable simplexml simplexml)
329 - $(use_enable sharedmem shmop)
330 - $(use_with snmp snmp "${EPREFIX}/usr")
331 - $(use_enable soap soap)
332 - $(use_enable sockets sockets)
333 - $(use_with sqlite sqlite3 "${EPREFIX}/usr")
334 - $(use_enable sysvipc sysvmsg)
335 - $(use_enable sysvipc sysvsem)
336 - $(use_enable sysvipc sysvshm)
337 - $(use_with tidy tidy "${EPREFIX}/usr")
338 - $(use_enable tokenizer tokenizer)
339 - $(use_enable wddx wddx)
340 - $(use_enable xml xml)
341 - $(use_enable xmlreader xmlreader)
342 - $(use_enable xmlwriter xmlwriter)
343 - $(use_with xmlrpc xmlrpc)
344 - $(use_with xslt xsl "${EPREFIX}/usr")
345 - $(use_enable zip zip)
346 - $(use_with zlib zlib "${EPREFIX}/usr")
347 - $(use_enable debug debug)
348 - )
349 -
350 - # DBA support
351 - if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
352 - || use qdbm ; then
353 - our_conf+=( "--enable-dba${shared}" )
354 - fi
355 -
356 - # DBA drivers support
357 - our_conf+=(
358 - $(use_with cdb cdb)
359 - $(use_with berkdb db4 "${EPREFIX}/usr")
360 - $(use_enable flatfile flatfile)
361 - $(use_with gdbm gdbm "${EPREFIX}/usr")
362 - $(use_enable inifile inifile)
363 - $(use_with qdbm qdbm "${EPREFIX}/usr")
364 - )
365 -
366 - # Support for the GD graphics library
367 - our_conf+=(
368 - $(use_with truetype freetype-dir "${EPREFIX}/usr")
369 - $(use_enable cjk gd-jis-conv)
370 - $(use_with gd jpeg-dir "${EPREFIX}/usr")
371 - $(use_with gd png-dir "${EPREFIX}/usr")
372 - $(use_with xpm xpm-dir "${EPREFIX}/usr")
373 - )
374 - if use webp; then
375 - our_conf+=( --with-webp-dir="${EPREFIX}/usr" )
376 - fi
377 - # enable gd last, so configure can pick up the previous settings
378 - our_conf+=( $(use_with gd gd) )
379 -
380 - # IMAP support
381 - if use imap ; then
382 - our_conf+=(
383 - $(use_with imap imap "${EPREFIX}/usr")
384 - $(use_with ssl imap-ssl "${EPREFIX}/usr")
385 - )
386 - fi
387 -
388 - # Interbase/firebird support
389 - our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") )
390 -
391 - # LDAP support
392 - if use ldap ; then
393 - our_conf+=(
394 - $(use_with ldap ldap "${EPREFIX}/usr")
395 - $(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr")
396 - )
397 - fi
398 -
399 - # MySQL support
400 - local mysqllib="mysqlnd"
401 - local mysqlilib="mysqlnd"
402 -
403 - our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
404 -
405 - local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock"
406 - if use mysql || use mysqli ; then
407 - our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") )
408 - fi
409 -
410 - # ODBC support
411 - our_conf+=(
412 - $(use_with odbc unixODBC "${EPREFIX}/usr")
413 - $(use_with iodbc iodbc "${EPREFIX}/usr")
414 - )
415 -
416 - # Oracle support
417 - our_conf+=( $(use_with oci8-instant-client oci8) )
418 -
419 - # PDO support
420 - if use pdo ; then
421 - our_conf+=(
422 - $(use_with mssql pdo-dblib "${EPREFIX}/usr")
423 - $(use_with mysql pdo-mysql "${mysqllib}")
424 - $(use_with postgres pdo-pgsql)
425 - $(use_with sqlite pdo-sqlite "${EPREFIX}/usr")
426 - $(use_with firebird pdo-firebird "${EPREFIX}/usr")
427 - $(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr")
428 - $(use_with oci8-instant-client pdo-oci)
429 - )
430 - fi
431 -
432 - # readline/libedit support
433 - our_conf+=(
434 - $(use_with readline readline "${EPREFIX}/usr")
435 - $(use_with libedit libedit "${EPREFIX}/usr")
436 - )
437 -
438 - # Session support
439 - if use session ; then
440 - our_conf+=( $(use_with session-mm mm "${EPREFIX}/usr") )
441 - else
442 - our_conf+=( $(use_enable session session) )
443 - fi
444 -
445 - # Use pic for shared modules such as apache2's mod_php
446 - our_conf+=( --with-pic )
447 -
448 - # we use the system copy of pcre
449 - # --with-pcre-regex affects ext/pcre
450 - # --with-pcre-dir affects ext/filter and ext/zip
451 - our_conf+=(
452 - --with-pcre-regex="${EPREFIX}/usr"
453 - --with-pcre-dir="${EPREFIX}/usr"
454 - )
455 -
456 - # Catch CFLAGS problems
457 - # Fixes bug #14067.
458 - # Changed order to run it in reverse for bug #32022 and #12021.
459 - replace-cpu-flags "k6*" "i586"
460 -
461 - # Cache the ./configure test results between SAPIs.
462 - our_conf+=( --cache-file="${T}/config.cache" )
463 -
464 - # Support user-passed configuration parameters
465 - our_conf+=( ${EXTRA_ECONF:-} )
466 -
467 - # Support the Apache2 extras, they must be set globally for all
468 - # SAPIs to work correctly, especially for external PHP extensions
469 -
470 - mkdir -p "${WORKDIR}/sapis-build" || die
471 - for one_sapi in $SAPIS ; do
472 - use "${one_sapi}" || continue
473 - php_set_ini_dir "${one_sapi}"
474 -
475 - # The BUILD_DIR variable is used to determine where to output
476 - # the files that autotools creates. This was all originally
477 - # based on the autotools-utils eclass.
478 - BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}"
479 - cp -a "${S}" "${BUILD_DIR}" || die
480 - cd "${BUILD_DIR}" || die
481 -
482 - local sapi_conf=(
483 - --with-config-file-path="${PHP_INI_DIR}"
484 - --with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}"
485 - )
486 -
487 - for sapi in $SAPIS ; do
488 - case "$sapi" in
489 - cli|cgi|embed|fpm|phpdbg)
490 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
491 - sapi_conf+=( "--enable-${sapi}" )
492 - if [[ "fpm" == "${sapi}" ]] ; then
493 - sapi_conf+=(
494 - $(use_with acl fpm-acl)
495 - $(use_with systemd fpm-systemd)
496 - )
497 - fi
498 - else
499 - sapi_conf+=( "--disable-${sapi}" )
500 - fi
501 - ;;
502 -
503 - apache2)
504 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
505 - sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" )
506 - else
507 - sapi_conf+=( --without-apxs2 )
508 - fi
509 - ;;
510 - esac
511 - done
512 -
513 - # Construct the $myeconfargs array by concatenating $our_conf
514 - # (the common args) and $sapi_conf (the SAPI-specific args).
515 - local myeconfargs=( "${our_conf[@]}" )
516 - myeconfargs+=( "${sapi_conf[@]}" )
517 -
518 - pushd "${BUILD_DIR}" > /dev/null || die
519 - econf "${myeconfargs[@]}"
520 - popd > /dev/null || die
521 - done
522 -}
523 -
524 -src_compile() {
525 - # snmp seems to run during src_compile, too (bug #324739)
526 - addpredict /usr/share/snmp/mibs/.index #nowarn
527 - addpredict /var/lib/net-snmp/mib_indexes #nowarn
528 -
529 - for sapi in ${SAPIS} ; do
530 - if use "${sapi}"; then
531 - cd "${WORKDIR}/sapis-build/$sapi" || \
532 - die "Failed to change dir to ${WORKDIR}/sapis-build/$1"
533 - emake
534 - fi
535 - done
536 -}
537 -
538 -src_install() {
539 - # see bug #324739 for what happens when we don't have that
540 - addpredict /usr/share/snmp/mibs/.index #nowarn
541 -
542 - # grab the first SAPI that got built and install common files from there
543 - local first_sapi=""
544 - for sapi in $SAPIS ; do
545 - if use $sapi ; then
546 - first_sapi=$sapi
547 - break
548 - fi
549 - done
550 -
551 - # Makefile forgets to create this before trying to write to it...
552 - dodir "${PHP_DESTDIR#${EPREFIX}}/bin"
553 -
554 - # Install php environment (without any sapis)
555 - cd "${WORKDIR}/sapis-build/$first_sapi" || die
556 - emake INSTALL_ROOT="${D}" \
557 - install-build install-headers install-programs
558 -
559 - local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)"
560 -
561 - # Create the directory where we'll put version-specific php scripts
562 - keepdir "/usr/share/php${PHP_MV}"
563 -
564 - local sapi="", file=""
565 - local sapi_list=""
566 -
567 - for sapi in ${SAPIS}; do
568 - if use "${sapi}" ; then
569 - einfo "Installing SAPI: ${sapi}"
570 - cd "${WORKDIR}/sapis-build/${sapi}" || die
571 -
572 - if [[ "${sapi}" == "apache2" ]] ; then
573 - # We're specifically not using emake install-sapi as libtool
574 - # may cause unnecessary relink failures (see bug #351266)
575 - insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/"
576 - newins ".libs/libphp${PHP_MV}$(get_libname)" \
577 - "libphp${PHP_MV}$(get_libname)"
578 - keepdir "/usr/$(get_libdir)/apache2/modules"
579 - else
580 - # needed each time, php_install_ini would reset it
581 - local dest="${PHP_DESTDIR#${EPREFIX}}"
582 - into "${dest}"
583 - case "$sapi" in
584 - cli)
585 - source="sapi/cli/php"
586 - ;;
587 - cgi)
588 - source="sapi/cgi/php-cgi"
589 - ;;
590 - fpm)
591 - source="sapi/fpm/php-fpm"
592 - ;;
593 - embed)
594 - source="libs/libphp${PHP_MV}$(get_libname)"
595 - ;;
596 - phpdbg)
597 - source="sapi/phpdbg/phpdbg"
598 - ;;
599 - *)
600 - die "unhandled sapi in src_install"
601 - ;;
602 - esac
603 -
604 - if [[ "${source}" == *"$(get_libname)" ]]; then
605 - dolib.so "${source}"
606 - else
607 - dobin "${source}"
608 - local name="$(basename ${source})"
609 - dosym "${dest}/bin/${name}" "/usr/bin/${name}${SLOT}"
610 - fi
611 - fi
612 -
613 - php_install_ini "${sapi}"
614 -
615 - # construct correct SAPI string for php-config
616 - # thanks to ferringb for the bash voodoo
617 - if [[ "${sapi}" == "apache2" ]]; then
618 - sapi_list="${sapi_list:+${sapi_list} }apache2handler"
619 - else
620 - sapi_list="${sapi_list:+${sapi_list} }${sapi}"
621 - fi
622 - fi
623 - done
624 -
625 - # Installing opcache module
626 - if use opcache ; then
627 - into "${PHP_DESTDIR#${EPREFIX}}"
628 - dolib.so "modules/opcache$(get_libname)"
629 - fi
630 -
631 - # Install env.d files
632 - newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}"
633 - sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
634 - sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
635 -
636 - # set php-config variable correctly (bug #278439)
637 - sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \
638 - "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die
639 -
640 - if use fpm ; then
641 - if use systemd; then
642 - systemd_newunit "${FILESDIR}/php-fpm_at.service" \
643 - "php-fpm@${SLOT}.service"
644 - else
645 - systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \
646 - "php-fpm@${SLOT}.service"
647 - fi
648 - fi
649 -}
650 -
651 -src_test() {
652 - echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
653 - PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
654 - if [[ ! -x "${PHP_BIN}" ]] ; then
655 - ewarn "Test phase requires USE=cli, skipping"
656 - return
657 - else
658 - export TEST_PHP_EXECUTABLE="${PHP_BIN}"
659 - fi
660 -
661 - if [[ -x "${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" ]] ; then
662 - export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi"
663 - fi
664 -
665 - if [[ -x "${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" ]] ; then
666 - export TEST_PHPDBG_EXECUTABLE="${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg"
667 - fi
668 -
669 - REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \
670 - "session.save_path=${T}" \
671 - "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \
672 - "session.save_path=${T}"
673 -
674 - for name in ${EXPECTED_TEST_FAILURES}; do
675 - mv "${name}.out" "${name}.out.orig" 2>/dev/null || die
676 - done
677 -
678 - local failed="$(find -name '*.out')"
679 - if [[ ${failed} != "" ]] ; then
680 - ewarn "The following test cases failed unexpectedly:"
681 - for name in ${failed}; do
682 - ewarn " ${name/.out/}"
683 - done
684 - else
685 - einfo "No unexpected test failures, all fine"
686 - fi
687 -
688 - if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
689 - local passed=""
690 - for name in ${EXPECTED_TEST_FAILURES}; do
691 - [[ -f "${name}.diff" ]] && continue
692 - passed="${passed} ${name}"
693 - done
694 - if [[ ${passed} != "" ]] ; then
695 - einfo "The following test cases passed unexpectedly:"
696 - for name in ${passed}; do
697 - ewarn " ${passed}"
698 - done
699 - else
700 - einfo "None of the known-to-fail tests passed, all fine"
701 - fi
702 - fi
703 -}
704 -
705 -pkg_postinst() {
706 - # Output some general info to the user
707 - if use apache2 ; then
708 - elog
709 - elog "To enable PHP in apache, you will need to add \"-D PHP\" to"
710 - elog "your apache2 command. OpenRC users can append that string to"
711 - elog "APACHE2_OPTS in /etc/conf.d/apache2."
712 - elog
713 - elog "The apache module configuration file 70_mod_php.conf is"
714 - elog "provided (and maintained) by eselect-php."
715 - elog
716 - fi
717 -
718 - # Create the symlinks for php
719 - for m in ${SAPIS}; do
720 - [[ ${m} == 'embed' ]] && continue;
721 - if use $m ; then
722 - local ci=$(eselect php show $m)
723 - if [[ -z $ci ]]; then
724 - eselect php set $m php${SLOT} || die
725 - einfo "Switched ${m} to use php:${SLOT}"
726 - einfo
727 - elif [[ $ci != "php${SLOT}" ]] ; then
728 - elog "To switch $m to use php:${SLOT}, run"
729 - elog " eselect php set $m php${SLOT}"
730 - elog
731 - fi
732 - fi
733 - done
734 -
735 - # Remove dead symlinks for SAPIs that were just disabled. For
736 - # example, if the user has the cgi SAPI enabled, then he has an
737 - # eselect-php symlink for it. If he later reinstalls PHP with
738 - # USE="-cgi", that symlink will break. This call to eselect is
739 - # supposed to remove that dead link per bug 572436.
740 - eselect php cleanup || die
741 -
742 - if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then
743 - elog "To build extensions for this version of PHP, you will need to"
744 - elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable."
745 - elog
746 - fi
747 -
748 - # Warn about the removal of PHP_INI_VERSION if the user has it set.
749 - if [[ -n "${PHP_INI_VERSION}" ]]; then
750 - ewarn 'The PHP_INI_VERSION variable has been phased out. You may'
751 - ewarn 'remove it from your configuration at your convenience. See'
752 - ewarn
753 - ewarn ' https://bugs.gentoo.org/611214'
754 - ewarn
755 - ewarn 'for more information.'
756 - fi
757 -
758 - elog "For details on how version slotting works, please see"
759 - elog "the wiki:"
760 - elog
761 - elog " https://wiki.gentoo.org/wiki/PHP"
762 - elog
763 -}
764 -
765 -pkg_postrm() {
766 - # This serves two purposes. First, if we have just removed the last
767 - # installed version of PHP, then this will remove any dead symlinks
768 - # belonging to eselect-php. Second, if a user upgrades slots from
769 - # (say) 5.6 to 7.0 and depcleans the old slot, then this will update
770 - # his existing symlinks to point to the new 7.0 installation. The
771 - # latter is bug 432962.
772 - #
773 - # Note: the eselect-php package may not be installed at this point,
774 - # so we can't die() if this command fails.
775 - eselect php cleanup
776 -}
777
778 diff --git a/dev-lang/php/php-7.2.22.ebuild b/dev-lang/php/php-7.2.22.ebuild
779 deleted file mode 100644
780 index f47ed4aaf95..00000000000
781 --- a/dev-lang/php/php-7.2.22.ebuild
782 +++ /dev/null
783 @@ -1,748 +0,0 @@
784 -# Copyright 1999-2019 Gentoo Authors
785 -# Distributed under the terms of the GNU General Public License v2
786 -
787 -EAPI="7"
788 -
789 -inherit flag-o-matic systemd autotools
790 -
791 -DESCRIPTION="The PHP language runtime engine"
792 -HOMEPAGE="https://php.net/"
793 -SRC_URI="https://php.net/distributions/${P}.tar.xz"
794 -
795 -LICENSE="PHP-3.01
796 - BSD
797 - Zend-2.0
798 - bcmath? ( LGPL-2.1+ )
799 - fpm? ( BSD-2 )
800 - gd? ( gd )
801 - unicode? ( BSD-2 LGPL-2.1 )"
802 -
803 -SLOT="$(ver_cut 1-2)"
804 -KEYWORDS="~alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
805 -
806 -# We can build the following SAPIs in the given order
807 -SAPIS="embed cli cgi fpm apache2 phpdbg"
808 -
809 -# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
810 -IUSE="${IUSE}
811 - ${SAPIS/cli/+cli}
812 - threads"
813 -
814 -IUSE="${IUSE} acl argon2 bcmath berkdb bzip2 calendar cdb cjk
815 - coverage +ctype curl debug
816 - enchant exif +fileinfo +filter firebird
817 - +flatfile ftp gd gdbm gmp +hash +iconv imap inifile
818 - intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl lmdb
819 - mhash mssql mysql mysqli nls
820 - oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
821 - readline recode selinux +session session-mm sharedmem
822 - +simplexml snmp soap sockets sodium spell sqlite ssl
823 - sysvipc systemd test tidy +tokenizer tokyocabinet truetype unicode wddx webp
824 - +xml xmlreader xmlwriter xmlrpc xpm xslt zip zip-encryption zlib"
825 -
826 -# The supported (that is, autodetected) versions of BDB are listed in
827 -# the ./configure script. Other versions *work*, but we need to stick to
828 -# the ones that can be detected to avoid a repeat of bug #564824.
829 -COMMON_DEPEND="
830 - >=app-eselect/eselect-php-0.9.1[apache2?,fpm?]
831 - >=dev-libs/libpcre-8.32[unicode]
832 - fpm? ( acl? ( sys-apps/acl ) )
833 - apache2? ( www-servers/apache[apache2_modules_unixd(+),threads=] )
834 - argon2? ( app-crypt/argon2:= )
835 - berkdb? ( || ( sys-libs/db:5.3
836 - sys-libs/db:5.1
837 - sys-libs/db:4.8
838 - sys-libs/db:4.7
839 - sys-libs/db:4.6
840 - sys-libs/db:4.5 ) )
841 - bzip2? ( app-arch/bzip2:0= )
842 - cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
843 - coverage? ( dev-util/lcov )
844 - curl? ( >=net-misc/curl-7.10.5 )
845 - enchant? ( <app-text/enchant-2.0:0 )
846 - firebird? ( dev-db/firebird )
847 - gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib )
848 - gdbm? ( >=sys-libs/gdbm-1.8.0:0= )
849 - gmp? ( dev-libs/gmp:0= )
850 - iconv? ( virtual/libiconv )
851 - imap? ( virtual/imap-c-client[kerberos=,ssl=] )
852 - intl? ( dev-libs/icu:= )
853 - iodbc? ( dev-db/libiodbc )
854 - kerberos? ( virtual/krb5 )
855 - ldap? ( >=net-nds/openldap-1.2.11 )
856 - ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 )
857 - libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) )
858 - lmdb? ( dev-db/lmdb:= )
859 - mssql? ( dev-db/freetds[mssql] )
860 - nls? ( sys-devel/gettext )
861 - oci8-instant-client? ( dev-db/oracle-instantclient-basic )
862 - odbc? ( >=dev-db/unixODBC-1.8.13 )
863 - postgres? ( dev-db/postgresql:* )
864 - qdbm? ( dev-db/qdbm )
865 - readline? ( sys-libs/readline:0= )
866 - recode? ( app-text/recode )
867 - session-mm? ( dev-libs/mm )
868 - simplexml? ( >=dev-libs/libxml2-2.6.8 )
869 - snmp? ( >=net-analyzer/net-snmp-5.2 )
870 - soap? ( >=dev-libs/libxml2-2.6.8 )
871 - sodium? ( dev-libs/libsodium:= )
872 - spell? ( >=app-text/aspell-0.50 )
873 - sqlite? ( >=dev-db/sqlite-3.7.6.3 )
874 - ssl? (
875 - !libressl? ( dev-libs/openssl:0= )
876 - libressl? ( dev-libs/libressl:0= )
877 - )
878 - tidy? ( || ( app-text/tidy-html5 app-text/htmltidy ) )
879 - tokyocabinet? ( dev-db/tokyocabinet )
880 - truetype? ( =media-libs/freetype-2* )
881 - unicode? ( dev-libs/oniguruma:= )
882 - wddx? ( >=dev-libs/libxml2-2.6.8 )
883 - webp? ( media-libs/libwebp:0= )
884 - xml? ( >=dev-libs/libxml2-2.6.8 )
885 - xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
886 - xmlreader? ( >=dev-libs/libxml2-2.6.8 )
887 - xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
888 - xpm? ( x11-libs/libXpm )
889 - xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
890 - zip? ( sys-libs/zlib:0= )
891 - zip-encryption? ( >=dev-libs/libzip-1.2.0:= )
892 - zlib? ( sys-libs/zlib:0= )
893 -"
894 -
895 -RDEPEND="${COMMON_DEPEND}
896 - virtual/mta
897 - fpm? (
898 - selinux? ( sec-policy/selinux-phpfpm )
899 - systemd? ( sys-apps/systemd ) )"
900 -
901 -# Bison isn't actually needed when building from a release tarball
902 -# However, the configure script will warn if it's absent or if you
903 -# have an incompatible version installed. See bug 593278.
904 -DEPEND="${COMMON_DEPEND}
905 - app-arch/xz-utils
906 - >=sys-devel/bison-3.0.1"
907 -
908 -BDEPEND="virtual/pkgconfig"
909 -
910 -# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
911 -REQUIRED_USE="
912 - || ( cli cgi fpm apache2 embed phpdbg )
913 - cli? ( ^^ ( readline libedit ) )
914 - truetype? ( gd zlib )
915 - webp? ( gd zlib )
916 - cjk? ( gd zlib )
917 - exif? ( gd zlib )
918 - xpm? ( gd zlib )
919 - gd? ( zlib )
920 - simplexml? ( xml )
921 - soap? ( xml )
922 - wddx? ( xml )
923 - xmlrpc? ( || ( xml iconv ) )
924 - xmlreader? ( xml )
925 - xslt? ( xml )
926 - ldap-sasl? ( ldap )
927 - mhash? ( hash )
928 - phar? ( hash )
929 - qdbm? ( !gdbm )
930 - readline? ( !libedit )
931 - recode? ( !imap !mysqli !mysql )
932 - session-mm? ( session !threads )
933 - mysql? ( hash || ( mysqli pdo ) )
934 - mysqli? ( hash )
935 - zip-encryption? ( zip )
936 -"
937 -PATCHES=(
938 - "${FILESDIR}/php-freetype-2.9.1.patch"
939 - "${FILESDIR}/php-7.2.13-intl-use-icu-namespace.patch"
940 -)
941 -RESTRICT="!test? ( test )"
942 -PHP_MV="$(ver_cut 1)"
943 -
944 -php_install_ini() {
945 - local phpsapi="${1}"
946 -
947 - # work out where we are installing the ini file
948 - php_set_ini_dir "${phpsapi}"
949 -
950 - # Always install the production INI file, bug 611214.
951 - local phpinisrc="php.ini-production-${phpsapi}"
952 - cp php.ini-production "${phpinisrc}" || die
953 -
954 - # default to /tmp for save_path, bug #282768
955 - sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die
956 -
957 - # Set the extension dir
958 - sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \
959 - -i "${phpinisrc}" || die
960 -
961 - # Set the include path to point to where we want to find PEAR packages
962 - sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die
963 -
964 - dodir "${PHP_INI_DIR#${EPREFIX}}"
965 - insinto "${PHP_INI_DIR#${EPREFIX}}"
966 - newins "${phpinisrc}" php.ini
967 -
968 - elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}"
969 - elog
970 -
971 - dodir "${PHP_EXT_INI_DIR#${EPREFIX}}"
972 - dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}"
973 -
974 - if use opcache; then
975 - elog "Adding opcache to $PHP_EXT_INI_DIR"
976 - echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \
977 - "${D}/${PHP_EXT_INI_DIR}"/opcache.ini
978 - dosym "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" \
979 - "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini"
980 - fi
981 -
982 - # SAPI-specific handling
983 - if [[ "${sapi}" == "fpm" ]] ; then
984 - einfo "Installing FPM config files php-fpm.conf and www.conf"
985 - insinto "${PHP_INI_DIR#${EPREFIX}}"
986 - doins sapi/fpm/php-fpm.conf
987 - insinto "${PHP_INI_DIR#${EPREFIX}}/fpm.d"
988 - doins sapi/fpm/www.conf
989 - fi
990 -
991 - dodoc php.ini-{development,production}
992 -}
993 -
994 -php_set_ini_dir() {
995 - PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}"
996 - PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
997 - PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
998 -}
999 -
1000 -src_prepare() {
1001 - default
1002 -
1003 - # In php-7.x, the FPM pool configuration files have been split off
1004 - # of the main config. By default the pool config files go in
1005 - # e.g. /etc/php-fpm.d, which isn't slotted. So here we move the
1006 - # include directory to a subdirectory "fpm.d" of $PHP_INI_DIR. Later
1007 - # we'll install the pool configuration file "www.conf" there.
1008 - php_set_ini_dir fpm
1009 - sed -i "s~^include=.*$~include=${PHP_INI_DIR}/fpm.d/*.conf~" \
1010 - sapi/fpm/php-fpm.conf.in \
1011 - || die 'failed to move the include directory in php-fpm.conf'
1012 -
1013 - # Bug 669566 - necessary so that build tools are updated for commands like pecl
1014 - # Force rebuilding aclocal.m4
1015 - rm -f aclocal.m4 || die "failed to remove aclocal.m4 in src_prepare"
1016 - eautoreconf
1017 -}
1018 -
1019 -src_configure() {
1020 - addpredict /usr/share/snmp/mibs/.index #nowarn
1021 - addpredict /var/lib/net-snmp/mib_indexes #nowarn
1022 -
1023 - PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
1024 -
1025 - # The php-fpm config file wants localstatedir to be ${EPREFIX}/var
1026 - # and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002.
1027 - local our_conf=(
1028 - --prefix="${PHP_DESTDIR}"
1029 - --mandir="${PHP_DESTDIR}/man"
1030 - --infodir="${PHP_DESTDIR}/info"
1031 - --libdir="${PHP_DESTDIR}/lib"
1032 - --with-libdir="$(get_libdir)"
1033 - --localstatedir="${EPREFIX}/var"
1034 - --without-pear
1035 - $(use_enable threads maintainer-zts)
1036 - )
1037 -
1038 - our_conf+=(
1039 - $(use_with argon2 password-argon2 "${EPREFIX}/usr")
1040 - $(use_enable bcmath bcmath)
1041 - $(use_with bzip2 bz2 "${EPREFIX}/usr")
1042 - $(use_enable calendar calendar)
1043 - $(use_enable coverage gcov)
1044 - $(use_enable ctype ctype)
1045 - $(use_with curl curl "${EPREFIX}/usr")
1046 - $(use_enable xml dom)
1047 - $(use_with enchant enchant "${EPREFIX}/usr")
1048 - $(use_enable exif exif)
1049 - $(use_enable fileinfo fileinfo)
1050 - $(use_enable filter filter)
1051 - $(use_enable ftp ftp)
1052 - $(use_with nls gettext "${EPREFIX}/usr")
1053 - $(use_with gmp gmp "${EPREFIX}/usr")
1054 - $(use_enable hash hash)
1055 - $(use_with mhash mhash "${EPREFIX}/usr")
1056 - $(use_with iconv iconv \
1057 - $(use elibc_glibc || use elibc_musl || use elibc_FreeBSD || echo "${EPREFIX}/usr"))
1058 - $(use_enable intl intl)
1059 - $(use_enable ipv6 ipv6)
1060 - $(use_enable json json)
1061 - $(use_with kerberos kerberos "${EPREFIX}/usr")
1062 - $(use_enable xml libxml)
1063 - $(use_with xml libxml-dir "${EPREFIX}/usr")
1064 - $(use_enable unicode mbstring)
1065 - $(use_with unicode onig "${EPREFIX}/usr")
1066 - $(use_with ssl openssl "${EPREFIX}/usr")
1067 - $(use_with ssl openssl-dir "${EPREFIX}/usr")
1068 - $(use_enable pcntl pcntl)
1069 - $(use_enable phar phar)
1070 - $(use_enable pdo pdo)
1071 - $(use_enable opcache opcache)
1072 - $(use_with postgres pgsql "${EPREFIX}/usr")
1073 - $(use_enable posix posix)
1074 - $(use_with spell pspell "${EPREFIX}/usr")
1075 - $(use_with recode recode "${EPREFIX}/usr")
1076 - $(use_enable simplexml simplexml)
1077 - $(use_enable sharedmem shmop)
1078 - $(use_with snmp snmp "${EPREFIX}/usr")
1079 - $(use_enable soap soap)
1080 - $(use_enable sockets sockets)
1081 - $(use_with sodium sodium "${EPREFIX}/usr")
1082 - $(use_with sqlite sqlite3 "${EPREFIX}/usr")
1083 - $(use_enable sysvipc sysvmsg)
1084 - $(use_enable sysvipc sysvsem)
1085 - $(use_enable sysvipc sysvshm)
1086 - $(use_with tidy tidy "${EPREFIX}/usr")
1087 - $(use_enable tokenizer tokenizer)
1088 - $(use_enable wddx wddx)
1089 - $(use_enable xml xml)
1090 - $(use_enable xmlreader xmlreader)
1091 - $(use_enable xmlwriter xmlwriter)
1092 - $(use_with xmlrpc xmlrpc)
1093 - $(use_with xslt xsl "${EPREFIX}/usr")
1094 - $(use_enable zip zip)
1095 - $(use_with zip-encryption libzip "${EPREFIX}/usr")
1096 - $(use_with zlib zlib "${EPREFIX}/usr")
1097 - $(use_enable debug debug)
1098 - )
1099 -
1100 - # DBA support
1101 - if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
1102 - || use qdbm || use lmdb || use tokyocabinet ; then
1103 - our_conf+=( "--enable-dba${shared}" )
1104 - fi
1105 -
1106 - # DBA drivers support
1107 - our_conf+=(
1108 - $(use_with cdb cdb)
1109 - $(use_with berkdb db4 "${EPREFIX}/usr")
1110 - $(use_enable flatfile flatfile)
1111 - $(use_with gdbm gdbm "${EPREFIX}/usr")
1112 - $(use_enable inifile inifile)
1113 - $(use_with qdbm qdbm "${EPREFIX}/usr")
1114 - $(use_with lmdb lmdb "${EPREFIX}/usr")
1115 - )
1116 -
1117 - # Support for the GD graphics library
1118 - our_conf+=(
1119 - $(use_with truetype freetype-dir "${EPREFIX}/usr")
1120 - $(use_enable cjk gd-jis-conv)
1121 - $(use_with gd jpeg-dir "${EPREFIX}/usr")
1122 - $(use_with gd png-dir "${EPREFIX}/usr")
1123 - $(use_with xpm xpm-dir "${EPREFIX}/usr")
1124 - )
1125 - if use webp; then
1126 - our_conf+=( --with-webp-dir="${EPREFIX}/usr" )
1127 - fi
1128 - # enable gd last, so configure can pick up the previous settings
1129 - our_conf+=( $(use_with gd gd) )
1130 -
1131 - # IMAP support
1132 - if use imap ; then
1133 - our_conf+=(
1134 - $(use_with imap imap "${EPREFIX}/usr")
1135 - $(use_with ssl imap-ssl "${EPREFIX}/usr")
1136 - )
1137 - fi
1138 -
1139 - # Interbase/firebird support
1140 - our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") )
1141 -
1142 - # LDAP support
1143 - if use ldap ; then
1144 - our_conf+=(
1145 - $(use_with ldap ldap "${EPREFIX}/usr")
1146 - $(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr")
1147 - )
1148 - fi
1149 -
1150 - # MySQL support
1151 - local mysqllib="mysqlnd"
1152 - local mysqlilib="mysqlnd"
1153 -
1154 - our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
1155 -
1156 - local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock"
1157 - if use mysql || use mysqli ; then
1158 - our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") )
1159 - fi
1160 -
1161 - # ODBC support
1162 - our_conf+=(
1163 - $(use_with odbc unixODBC "${EPREFIX}/usr")
1164 - $(use_with iodbc iodbc "${EPREFIX}/usr")
1165 - )
1166 -
1167 - # Oracle support
1168 - our_conf+=( $(use_with oci8-instant-client oci8) )
1169 -
1170 - # PDO support
1171 - if use pdo ; then
1172 - our_conf+=(
1173 - $(use_with mssql pdo-dblib "${EPREFIX}/usr")
1174 - $(use_with mysql pdo-mysql "${mysqllib}")
1175 - $(use_with postgres pdo-pgsql)
1176 - $(use_with sqlite pdo-sqlite "${EPREFIX}/usr")
1177 - $(use_with firebird pdo-firebird "${EPREFIX}/usr")
1178 - $(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr")
1179 - $(use_with oci8-instant-client pdo-oci)
1180 - )
1181 - fi
1182 -
1183 - # readline/libedit support
1184 - our_conf+=(
1185 - $(use_with readline readline "${EPREFIX}/usr")
1186 - $(use_with libedit libedit "${EPREFIX}/usr")
1187 - )
1188 -
1189 - # Session support
1190 - if use session ; then
1191 - our_conf+=( $(use_with session-mm mm "${EPREFIX}/usr") )
1192 - else
1193 - our_conf+=( $(use_enable session session) )
1194 - fi
1195 -
1196 - # Use pic for shared modules such as apache2's mod_php
1197 - our_conf+=( --with-pic )
1198 -
1199 - # we use the system copy of pcre
1200 - # --with-pcre-regex affects ext/pcre
1201 - # --with-pcre-dir affects ext/filter and ext/zip
1202 - # --with-pcre-valgrind cannot be enabled with system pcre
1203 - # Many arches don't support pcre-jit
1204 - our_conf+=(
1205 - --with-pcre-regex="${EPREFIX}/usr"
1206 - --with-pcre-dir="${EPREFIX}/usr"
1207 - --without-pcre-valgrind
1208 - --without-pcre-jit
1209 - )
1210 -
1211 - # Catch CFLAGS problems
1212 - # Fixes bug #14067.
1213 - # Changed order to run it in reverse for bug #32022 and #12021.
1214 - replace-cpu-flags "k6*" "i586"
1215 -
1216 - # Cache the ./configure test results between SAPIs.
1217 - our_conf+=( --cache-file="${T}/config.cache" )
1218 -
1219 - # Support user-passed configuration parameters
1220 - our_conf+=( ${EXTRA_ECONF:-} )
1221 -
1222 - # Support the Apache2 extras, they must be set globally for all
1223 - # SAPIs to work correctly, especially for external PHP extensions
1224 -
1225 - mkdir -p "${WORKDIR}/sapis-build" || die
1226 - for one_sapi in $SAPIS ; do
1227 - use "${one_sapi}" || continue
1228 - php_set_ini_dir "${one_sapi}"
1229 -
1230 - # The BUILD_DIR variable is used to determine where to output
1231 - # the files that autotools creates. This was all originally
1232 - # based on the autotools-utils eclass.
1233 - BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}"
1234 - cp -a "${S}" "${BUILD_DIR}" || die
1235 - cd "${BUILD_DIR}" || die
1236 -
1237 - local sapi_conf=(
1238 - --with-config-file-path="${PHP_INI_DIR}"
1239 - --with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}"
1240 - )
1241 -
1242 - for sapi in $SAPIS ; do
1243 - case "$sapi" in
1244 - cli|cgi|embed|fpm|phpdbg)
1245 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
1246 - sapi_conf+=( "--enable-${sapi}" )
1247 - if [[ "fpm" == "${sapi}" ]] ; then
1248 - sapi_conf+=(
1249 - $(use_with acl fpm-acl)
1250 - $(use_with systemd fpm-systemd)
1251 - )
1252 - fi
1253 - else
1254 - sapi_conf+=( "--disable-${sapi}" )
1255 - fi
1256 - ;;
1257 -
1258 - apache2)
1259 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
1260 - sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" )
1261 - else
1262 - sapi_conf+=( --without-apxs2 )
1263 - fi
1264 - ;;
1265 - esac
1266 - done
1267 -
1268 - # Construct the $myeconfargs array by concatenating $our_conf
1269 - # (the common args) and $sapi_conf (the SAPI-specific args).
1270 - local myeconfargs=( "${our_conf[@]}" )
1271 - myeconfargs+=( "${sapi_conf[@]}" )
1272 -
1273 - pushd "${BUILD_DIR}" > /dev/null || die
1274 - econf "${myeconfargs[@]}"
1275 - popd > /dev/null || die
1276 - done
1277 -}
1278 -
1279 -src_compile() {
1280 - # snmp seems to run during src_compile, too (bug #324739)
1281 - addpredict /usr/share/snmp/mibs/.index #nowarn
1282 - addpredict /var/lib/net-snmp/mib_indexes #nowarn
1283 -
1284 - for sapi in ${SAPIS} ; do
1285 - if use "${sapi}"; then
1286 - cd "${WORKDIR}/sapis-build/$sapi" || \
1287 - die "Failed to change dir to ${WORKDIR}/sapis-build/$1"
1288 - emake
1289 - fi
1290 - done
1291 -}
1292 -
1293 -src_install() {
1294 - # see bug #324739 for what happens when we don't have that
1295 - addpredict /usr/share/snmp/mibs/.index #nowarn
1296 -
1297 - # grab the first SAPI that got built and install common files from there
1298 - local first_sapi=""
1299 - for sapi in $SAPIS ; do
1300 - if use $sapi ; then
1301 - first_sapi=$sapi
1302 - break
1303 - fi
1304 - done
1305 -
1306 - # Makefile forgets to create this before trying to write to it...
1307 - dodir "${PHP_DESTDIR#${EPREFIX}}/bin"
1308 -
1309 - # Install php environment (without any sapis)
1310 - cd "${WORKDIR}/sapis-build/$first_sapi" || die
1311 - emake INSTALL_ROOT="${D}" \
1312 - install-build install-headers install-programs
1313 -
1314 - local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)"
1315 -
1316 - # Create the directory where we'll put version-specific php scripts
1317 - keepdir "/usr/share/php${PHP_MV}"
1318 -
1319 - local sapi="", file=""
1320 - local sapi_list=""
1321 -
1322 - for sapi in ${SAPIS}; do
1323 - if use "${sapi}" ; then
1324 - einfo "Installing SAPI: ${sapi}"
1325 - cd "${WORKDIR}/sapis-build/${sapi}" || die
1326 -
1327 - if [[ "${sapi}" == "apache2" ]] ; then
1328 - # We're specifically not using emake install-sapi as libtool
1329 - # may cause unnecessary relink failures (see bug #351266)
1330 - insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/"
1331 - newins ".libs/libphp${PHP_MV}$(get_libname)" \
1332 - "libphp${PHP_MV}$(get_libname)"
1333 - keepdir "/usr/$(get_libdir)/apache2/modules"
1334 - else
1335 - # needed each time, php_install_ini would reset it
1336 - local dest="${PHP_DESTDIR#${EPREFIX}}"
1337 - into "${dest}"
1338 - case "$sapi" in
1339 - cli)
1340 - source="sapi/cli/php"
1341 - ;;
1342 - cgi)
1343 - source="sapi/cgi/php-cgi"
1344 - ;;
1345 - fpm)
1346 - source="sapi/fpm/php-fpm"
1347 - ;;
1348 - embed)
1349 - source="libs/libphp${PHP_MV}$(get_libname)"
1350 - ;;
1351 - phpdbg)
1352 - source="sapi/phpdbg/phpdbg"
1353 - ;;
1354 - *)
1355 - die "unhandled sapi in src_install"
1356 - ;;
1357 - esac
1358 -
1359 - if [[ "${source}" == *"$(get_libname)" ]]; then
1360 - dolib.so "${source}"
1361 - else
1362 - dobin "${source}"
1363 - local name="$(basename ${source})"
1364 - dosym "${dest}/bin/${name}" "/usr/bin/${name}${SLOT}"
1365 - fi
1366 - fi
1367 -
1368 - php_install_ini "${sapi}"
1369 -
1370 - # construct correct SAPI string for php-config
1371 - # thanks to ferringb for the bash voodoo
1372 - if [[ "${sapi}" == "apache2" ]]; then
1373 - sapi_list="${sapi_list:+${sapi_list} }apache2handler"
1374 - else
1375 - sapi_list="${sapi_list:+${sapi_list} }${sapi}"
1376 - fi
1377 - fi
1378 - done
1379 -
1380 - # Installing opcache module
1381 - if use opcache ; then
1382 - into "${PHP_DESTDIR#${EPREFIX}}"
1383 - dolib.so "modules/opcache$(get_libname)"
1384 - fi
1385 -
1386 - # Install env.d files
1387 - newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}"
1388 - sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
1389 - sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
1390 -
1391 - # set php-config variable correctly (bug #278439)
1392 - sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \
1393 - "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die
1394 -
1395 - if use fpm ; then
1396 - if use systemd; then
1397 - systemd_newunit "${FILESDIR}/php-fpm_at.service" \
1398 - "php-fpm@${SLOT}.service"
1399 - else
1400 - systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \
1401 - "php-fpm@${SLOT}.service"
1402 - fi
1403 - fi
1404 -}
1405 -
1406 -src_test() {
1407 - echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
1408 - PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
1409 - if [[ ! -x "${PHP_BIN}" ]] ; then
1410 - ewarn "Test phase requires USE=cli, skipping"
1411 - return
1412 - else
1413 - export TEST_PHP_EXECUTABLE="${PHP_BIN}"
1414 - fi
1415 -
1416 - if [[ -x "${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" ]] ; then
1417 - export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi"
1418 - fi
1419 -
1420 - if [[ -x "${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" ]] ; then
1421 - export TEST_PHPDBG_EXECUTABLE="${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg"
1422 - fi
1423 -
1424 - REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \
1425 - "session.save_path=${T}" \
1426 - "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \
1427 - "session.save_path=${T}"
1428 -
1429 - for name in ${EXPECTED_TEST_FAILURES}; do
1430 - mv "${name}.out" "${name}.out.orig" 2>/dev/null || die
1431 - done
1432 -
1433 - local failed="$(find -name '*.out')"
1434 - if [[ ${failed} != "" ]] ; then
1435 - ewarn "The following test cases failed unexpectedly:"
1436 - for name in ${failed}; do
1437 - ewarn " ${name/.out/}"
1438 - done
1439 - else
1440 - einfo "No unexpected test failures, all fine"
1441 - fi
1442 -
1443 - if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
1444 - local passed=""
1445 - for name in ${EXPECTED_TEST_FAILURES}; do
1446 - [[ -f "${name}.diff" ]] && continue
1447 - passed="${passed} ${name}"
1448 - done
1449 - if [[ ${passed} != "" ]] ; then
1450 - einfo "The following test cases passed unexpectedly:"
1451 - for name in ${passed}; do
1452 - ewarn " ${passed}"
1453 - done
1454 - else
1455 - einfo "None of the known-to-fail tests passed, all fine"
1456 - fi
1457 - fi
1458 -}
1459 -
1460 -pkg_postinst() {
1461 - # Output some general info to the user
1462 - if use apache2 ; then
1463 - elog
1464 - elog "To enable PHP in apache, you will need to add \"-D PHP\" to"
1465 - elog "your apache2 command. OpenRC users can append that string to"
1466 - elog "APACHE2_OPTS in /etc/conf.d/apache2."
1467 - elog
1468 - elog "The apache module configuration file 70_mod_php.conf is"
1469 - elog "provided (and maintained) by eselect-php."
1470 - elog
1471 - fi
1472 -
1473 - # Create the symlinks for php
1474 - for m in ${SAPIS}; do
1475 - [[ ${m} == 'embed' ]] && continue;
1476 - if use $m ; then
1477 - local ci=$(eselect php show $m)
1478 - if [[ -z $ci ]]; then
1479 - eselect php set $m php${SLOT} || die
1480 - einfo "Switched ${m} to use php:${SLOT}"
1481 - einfo
1482 - elif [[ $ci != "php${SLOT}" ]] ; then
1483 - elog "To switch $m to use php:${SLOT}, run"
1484 - elog " eselect php set $m php${SLOT}"
1485 - elog
1486 - fi
1487 - fi
1488 - done
1489 -
1490 - # Remove dead symlinks for SAPIs that were just disabled. For
1491 - # example, if the user has the cgi SAPI enabled, then he has an
1492 - # eselect-php symlink for it. If he later reinstalls PHP with
1493 - # USE="-cgi", that symlink will break. This call to eselect is
1494 - # supposed to remove that dead link per bug 572436.
1495 - eselect php cleanup || die
1496 -
1497 - if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then
1498 - elog "To build extensions for this version of PHP, you will need to"
1499 - elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable."
1500 - elog
1501 - fi
1502 -
1503 - # Warn about the removal of PHP_INI_VERSION if the user has it set.
1504 - if [[ -n "${PHP_INI_VERSION}" ]]; then
1505 - ewarn 'The PHP_INI_VERSION variable has been phased out. You may'
1506 - ewarn 'remove it from your configuration at your convenience. See'
1507 - ewarn
1508 - ewarn ' https://bugs.gentoo.org/611214'
1509 - ewarn
1510 - ewarn 'for more information.'
1511 - fi
1512 -
1513 - elog "For details on how version slotting works, please see"
1514 - elog "the wiki:"
1515 - elog
1516 - elog " https://wiki.gentoo.org/wiki/PHP"
1517 - elog
1518 -}
1519 -
1520 -pkg_postrm() {
1521 - # This serves two purposes. First, if we have just removed the last
1522 - # installed version of PHP, then this will remove any dead symlinks
1523 - # belonging to eselect-php. Second, if a user upgrades slots from
1524 - # (say) 5.6 to 7.0 and depcleans the old slot, then this will update
1525 - # his existing symlinks to point to the new 7.0 installation. The
1526 - # latter is bug 432962.
1527 - #
1528 - # Note: the eselect-php package may not be installed at this point,
1529 - # so we can't die() if this command fails.
1530 - eselect php cleanup
1531 -}
1532
1533 diff --git a/dev-lang/php/php-7.3.9.ebuild b/dev-lang/php/php-7.3.9.ebuild
1534 deleted file mode 100644
1535 index c0862291df3..00000000000
1536 --- a/dev-lang/php/php-7.3.9.ebuild
1537 +++ /dev/null
1538 @@ -1,749 +0,0 @@
1539 -# Copyright 1999-2019 Gentoo Authors
1540 -# Distributed under the terms of the GNU General Public License v2
1541 -
1542 -EAPI="7"
1543 -
1544 -inherit flag-o-matic systemd autotools
1545 -
1546 -MY_PV=${PV/_rc/RC}
1547 -DESCRIPTION="The PHP language runtime engine"
1548 -HOMEPAGE="https://php.net/"
1549 -SRC_URI="https://php.net/distributions/${P}.tar.xz"
1550 -
1551 -LICENSE="PHP-3.01
1552 - BSD
1553 - Zend-2.0
1554 - bcmath? ( LGPL-2.1+ )
1555 - fpm? ( BSD-2 )
1556 - gd? ( gd )
1557 - unicode? ( BSD-2 LGPL-2.1 )"
1558 -
1559 -SLOT="$(ver_cut 1-2)"
1560 -KEYWORDS="~alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
1561 -
1562 -S="${WORKDIR}/${PN}-${MY_PV}"
1563 -
1564 -# We can build the following SAPIs in the given order
1565 -SAPIS="embed cli cgi fpm apache2 phpdbg"
1566 -
1567 -# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
1568 -IUSE="${IUSE}
1569 - ${SAPIS/cli/+cli}
1570 - threads"
1571 -
1572 -IUSE="${IUSE} acl argon2 bcmath berkdb bzip2 calendar cdb cjk
1573 - coverage +ctype curl debug
1574 - enchant exif +fileinfo +filter firebird
1575 - +flatfile ftp gd gdbm gmp +hash +iconv imap inifile
1576 - intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl lmdb
1577 - mhash mssql mysql mysqli nls
1578 - oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
1579 - readline recode selinux +session session-mm sharedmem
1580 - +simplexml snmp soap sockets sodium spell sqlite ssl
1581 - sysvipc systemd test tidy +tokenizer tokyocabinet truetype unicode wddx webp
1582 - +xml xmlreader xmlwriter xmlrpc xpm xslt zip zip-encryption zlib"
1583 -
1584 -# The supported (that is, autodetected) versions of BDB are listed in
1585 -# the ./configure script. Other versions *work*, but we need to stick to
1586 -# the ones that can be detected to avoid a repeat of bug #564824.
1587 -COMMON_DEPEND="
1588 - >=app-eselect/eselect-php-0.9.1[apache2?,fpm?]
1589 - >=dev-libs/libpcre2-10.30[unicode]
1590 - fpm? ( acl? ( sys-apps/acl ) )
1591 - apache2? ( www-servers/apache[apache2_modules_unixd(+),threads=] )
1592 - argon2? ( app-crypt/argon2:= )
1593 - berkdb? ( || ( sys-libs/db:5.3
1594 - sys-libs/db:5.1
1595 - sys-libs/db:4.8
1596 - sys-libs/db:4.7
1597 - sys-libs/db:4.6
1598 - sys-libs/db:4.5 ) )
1599 - bzip2? ( app-arch/bzip2:0= )
1600 - cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
1601 - coverage? ( dev-util/lcov )
1602 - curl? ( >=net-misc/curl-7.10.5 )
1603 - enchant? ( <app-text/enchant-2.0:0 )
1604 - firebird? ( dev-db/firebird )
1605 - gd? ( virtual/jpeg:0 media-libs/libpng:0= >=sys-libs/zlib-1.2.0.4 )
1606 - gdbm? ( >=sys-libs/gdbm-1.8.0:0= )
1607 - gmp? ( dev-libs/gmp:0= )
1608 - iconv? ( virtual/libiconv )
1609 - imap? ( virtual/imap-c-client[kerberos=,ssl=] )
1610 - intl? ( dev-libs/icu:= )
1611 - iodbc? ( dev-db/libiodbc )
1612 - kerberos? ( virtual/krb5 )
1613 - ldap? ( >=net-nds/openldap-1.2.11 )
1614 - ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 )
1615 - libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) )
1616 - lmdb? ( dev-db/lmdb:= )
1617 - mssql? ( dev-db/freetds[mssql] )
1618 - nls? ( sys-devel/gettext )
1619 - oci8-instant-client? ( dev-db/oracle-instantclient-basic )
1620 - odbc? ( >=dev-db/unixODBC-1.8.13 )
1621 - postgres? ( dev-db/postgresql:* )
1622 - qdbm? ( dev-db/qdbm )
1623 - readline? ( sys-libs/readline:0= )
1624 - recode? ( app-text/recode )
1625 - session-mm? ( dev-libs/mm )
1626 - simplexml? ( >=dev-libs/libxml2-2.6.8 )
1627 - snmp? ( >=net-analyzer/net-snmp-5.2 )
1628 - soap? ( >=dev-libs/libxml2-2.6.8 )
1629 - sodium? ( dev-libs/libsodium:= )
1630 - spell? ( >=app-text/aspell-0.50 )
1631 - sqlite? ( >=dev-db/sqlite-3.7.6.3 )
1632 - ssl? (
1633 - !libressl? ( >=dev-libs/openssl-1.0.1:0= )
1634 - libressl? ( dev-libs/libressl:0= )
1635 - )
1636 - tidy? ( || ( app-text/tidy-html5 app-text/htmltidy ) )
1637 - tokyocabinet? ( dev-db/tokyocabinet )
1638 - truetype? ( =media-libs/freetype-2* )
1639 - unicode? ( dev-libs/oniguruma:= )
1640 - wddx? ( >=dev-libs/libxml2-2.6.8 )
1641 - webp? ( media-libs/libwebp:0= )
1642 - xml? ( >=dev-libs/libxml2-2.6.8 )
1643 - xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
1644 - xmlreader? ( >=dev-libs/libxml2-2.6.8 )
1645 - xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
1646 - xpm? ( x11-libs/libXpm )
1647 - xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
1648 - zip? ( >=sys-libs/zlib-1.2.0.4:0= )
1649 - zip-encryption? ( >=dev-libs/libzip-1.2.0:= )
1650 - zlib? ( >=sys-libs/zlib-1.2.0.4:0= )
1651 -"
1652 -
1653 -RDEPEND="${COMMON_DEPEND}
1654 - virtual/mta
1655 - fpm? (
1656 - selinux? ( sec-policy/selinux-phpfpm )
1657 - systemd? ( sys-apps/systemd ) )"
1658 -
1659 -# Bison isn't actually needed when building from a release tarball
1660 -# However, the configure script will warn if it's absent or if you
1661 -# have an incompatible version installed. See bug 593278.
1662 -DEPEND="${COMMON_DEPEND}
1663 - app-arch/xz-utils
1664 - >=sys-devel/bison-3.0.1"
1665 -
1666 -BDEPEND="virtual/pkgconfig"
1667 -
1668 -# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
1669 -REQUIRED_USE="
1670 - || ( cli cgi fpm apache2 embed phpdbg )
1671 - cli? ( ^^ ( readline libedit ) )
1672 - truetype? ( gd zlib )
1673 - webp? ( gd zlib )
1674 - cjk? ( gd zlib )
1675 - exif? ( gd zlib )
1676 - xpm? ( gd zlib )
1677 - gd? ( zlib )
1678 - simplexml? ( xml )
1679 - soap? ( xml )
1680 - wddx? ( xml )
1681 - xmlrpc? ( || ( xml iconv ) )
1682 - xmlreader? ( xml )
1683 - xslt? ( xml )
1684 - ldap-sasl? ( ldap )
1685 - mhash? ( hash )
1686 - phar? ( hash )
1687 - qdbm? ( !gdbm )
1688 - readline? ( !libedit )
1689 - recode? ( !imap !mysqli !mysql )
1690 - session-mm? ( session !threads )
1691 - mysql? ( || ( mysqli pdo ) )
1692 - zip-encryption? ( zip )
1693 -"
1694 -PATCHES=(
1695 - "${FILESDIR}/php-freetype-2.9.1.patch"
1696 -)
1697 -
1698 -PHP_MV="$(ver_cut 1)"
1699 -
1700 -php_install_ini() {
1701 - local phpsapi="${1}"
1702 -
1703 - # work out where we are installing the ini file
1704 - php_set_ini_dir "${phpsapi}"
1705 -
1706 - # Always install the production INI file, bug 611214.
1707 - local phpinisrc="php.ini-production-${phpsapi}"
1708 - cp php.ini-production "${phpinisrc}" || die
1709 -
1710 - # default to /tmp for save_path, bug #282768
1711 - sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die
1712 -
1713 - # Set the extension dir
1714 - sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \
1715 - -i "${phpinisrc}" || die
1716 -
1717 - # Set the include path to point to where we want to find PEAR packages
1718 - sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die
1719 -
1720 - dodir "${PHP_INI_DIR#${EPREFIX}}"
1721 - insinto "${PHP_INI_DIR#${EPREFIX}}"
1722 - newins "${phpinisrc}" php.ini
1723 -
1724 - elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}"
1725 - elog
1726 -
1727 - dodir "${PHP_EXT_INI_DIR#${EPREFIX}}"
1728 - dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}"
1729 -
1730 - if use opcache; then
1731 - elog "Adding opcache to $PHP_EXT_INI_DIR"
1732 - echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \
1733 - "${D}/${PHP_EXT_INI_DIR}"/opcache.ini
1734 - dosym "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" \
1735 - "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini"
1736 - fi
1737 -
1738 - # SAPI-specific handling
1739 - if [[ "${sapi}" == "fpm" ]] ; then
1740 - einfo "Installing FPM config files php-fpm.conf and www.conf"
1741 - insinto "${PHP_INI_DIR#${EPREFIX}}"
1742 - doins sapi/fpm/php-fpm.conf
1743 - insinto "${PHP_INI_DIR#${EPREFIX}}/fpm.d"
1744 - doins sapi/fpm/www.conf
1745 - fi
1746 -
1747 - dodoc php.ini-{development,production}
1748 -}
1749 -
1750 -php_set_ini_dir() {
1751 - PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}"
1752 - PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
1753 - PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
1754 -}
1755 -
1756 -src_prepare() {
1757 - default
1758 -
1759 - # In php-7.x, the FPM pool configuration files have been split off
1760 - # of the main config. By default the pool config files go in
1761 - # e.g. /etc/php-fpm.d, which isn't slotted. So here we move the
1762 - # include directory to a subdirectory "fpm.d" of $PHP_INI_DIR. Later
1763 - # we'll install the pool configuration file "www.conf" there.
1764 - php_set_ini_dir fpm
1765 - sed -i "s~^include=.*$~include=${PHP_INI_DIR}/fpm.d/*.conf~" \
1766 - sapi/fpm/php-fpm.conf.in \
1767 - || die 'failed to move the include directory in php-fpm.conf'
1768 -
1769 - # Bug 669566 - necessary so that build tools are updated for commands like pecl
1770 - # Force rebuilding aclocal.m4
1771 - rm -f aclocal.m4 || die "failed to remove aclocal.m4 in src_prepare"
1772 - eautoreconf
1773 -}
1774 -
1775 -src_configure() {
1776 - addpredict /usr/share/snmp/mibs/.index #nowarn
1777 - addpredict /var/lib/net-snmp/mib_indexes #nowarn
1778 -
1779 - PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
1780 -
1781 - # The php-fpm config file wants localstatedir to be ${EPREFIX}/var
1782 - # and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002.
1783 - local our_conf=(
1784 - --prefix="${PHP_DESTDIR}"
1785 - --mandir="${PHP_DESTDIR}/man"
1786 - --infodir="${PHP_DESTDIR}/info"
1787 - --libdir="${PHP_DESTDIR}/lib"
1788 - --with-libdir="$(get_libdir)"
1789 - --localstatedir="${EPREFIX}/var"
1790 - --without-pear
1791 - $(use_enable threads maintainer-zts)
1792 - )
1793 -
1794 - our_conf+=(
1795 - $(use_with argon2 password-argon2 "${EPREFIX}/usr")
1796 - $(use_enable bcmath bcmath)
1797 - $(use_with bzip2 bz2 "${EPREFIX}/usr")
1798 - $(use_enable calendar calendar)
1799 - $(use_enable coverage gcov)
1800 - $(use_enable ctype ctype)
1801 - $(use_with curl curl "${EPREFIX}/usr")
1802 - $(use_enable xml dom)
1803 - $(use_with enchant enchant "${EPREFIX}/usr")
1804 - $(use_enable exif exif)
1805 - $(use_enable fileinfo fileinfo)
1806 - $(use_enable filter filter)
1807 - $(use_enable ftp ftp)
1808 - $(use_with nls gettext "${EPREFIX}/usr")
1809 - $(use_with gmp gmp "${EPREFIX}/usr")
1810 - $(use_enable hash hash)
1811 - $(use_with mhash mhash "${EPREFIX}/usr")
1812 - $(use_with iconv iconv \
1813 - $(use elibc_glibc || use elibc_musl || use elibc_FreeBSD || echo "${EPREFIX}/usr"))
1814 - $(use_enable intl intl)
1815 - $(use_enable ipv6 ipv6)
1816 - $(use_enable json json)
1817 - $(use_with kerberos kerberos "${EPREFIX}/usr")
1818 - $(use_enable xml libxml)
1819 - $(use_with xml libxml-dir "${EPREFIX}/usr")
1820 - $(use_enable unicode mbstring)
1821 - $(use_with unicode onig "${EPREFIX}/usr")
1822 - $(use_with ssl openssl "${EPREFIX}/usr")
1823 - $(use_with ssl openssl-dir "${EPREFIX}/usr")
1824 - $(use_enable pcntl pcntl)
1825 - $(use_enable phar phar)
1826 - $(use_enable pdo pdo)
1827 - $(use_enable opcache opcache)
1828 - $(use_with postgres pgsql "${EPREFIX}/usr")
1829 - $(use_enable posix posix)
1830 - $(use_with spell pspell "${EPREFIX}/usr")
1831 - $(use_with recode recode "${EPREFIX}/usr")
1832 - $(use_enable simplexml simplexml)
1833 - $(use_enable sharedmem shmop)
1834 - $(use_with snmp snmp "${EPREFIX}/usr")
1835 - $(use_enable soap soap)
1836 - $(use_enable sockets sockets)
1837 - $(use_with sodium sodium "${EPREFIX}/usr")
1838 - $(use_with sqlite sqlite3 "${EPREFIX}/usr")
1839 - $(use_enable sysvipc sysvmsg)
1840 - $(use_enable sysvipc sysvsem)
1841 - $(use_enable sysvipc sysvshm)
1842 - $(use_with tidy tidy "${EPREFIX}/usr")
1843 - $(use_enable tokenizer tokenizer)
1844 - $(use_enable wddx wddx)
1845 - $(use_enable xml xml)
1846 - $(use_enable xmlreader xmlreader)
1847 - $(use_enable xmlwriter xmlwriter)
1848 - $(use_with xmlrpc xmlrpc)
1849 - $(use_with xslt xsl "${EPREFIX}/usr")
1850 - $(use_enable zip zip)
1851 - $(use_with zip-encryption libzip "${EPREFIX}/usr")
1852 - $(use_with zlib zlib "${EPREFIX}/usr")
1853 - $(use_enable debug debug)
1854 - )
1855 -
1856 - # DBA support
1857 - if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
1858 - || use qdbm || use lmdb || use tokyocabinet ; then
1859 - our_conf+=( "--enable-dba${shared}" )
1860 - fi
1861 -
1862 - # DBA drivers support
1863 - our_conf+=(
1864 - $(use_with cdb cdb)
1865 - $(use_with berkdb db4 "${EPREFIX}/usr")
1866 - $(use_enable flatfile flatfile)
1867 - $(use_with gdbm gdbm "${EPREFIX}/usr")
1868 - $(use_enable inifile inifile)
1869 - $(use_with qdbm qdbm "${EPREFIX}/usr")
1870 - $(use_with lmdb lmdb "${EPREFIX}/usr")
1871 - )
1872 -
1873 - # Support for the GD graphics library
1874 - our_conf+=(
1875 - $(use_with truetype freetype-dir "${EPREFIX}/usr")
1876 - $(use_enable cjk gd-jis-conv)
1877 - $(use_with gd jpeg-dir "${EPREFIX}/usr")
1878 - $(use_with gd png-dir "${EPREFIX}/usr")
1879 - $(use_with xpm xpm-dir "${EPREFIX}/usr")
1880 - )
1881 - if use webp; then
1882 - our_conf+=( --with-webp-dir="${EPREFIX}/usr" )
1883 - fi
1884 - # enable gd last, so configure can pick up the previous settings
1885 - our_conf+=( $(use_with gd gd) )
1886 -
1887 - # IMAP support
1888 - if use imap ; then
1889 - our_conf+=(
1890 - $(use_with imap imap "${EPREFIX}/usr")
1891 - $(use_with ssl imap-ssl "${EPREFIX}/usr")
1892 - )
1893 - fi
1894 -
1895 - # Interbase/firebird support
1896 - our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") )
1897 -
1898 - # LDAP support
1899 - if use ldap ; then
1900 - our_conf+=(
1901 - $(use_with ldap ldap "${EPREFIX}/usr")
1902 - $(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr")
1903 - )
1904 - fi
1905 -
1906 - # MySQL support
1907 - local mysqllib="mysqlnd"
1908 - local mysqlilib="mysqlnd"
1909 -
1910 - our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
1911 -
1912 - local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock"
1913 - if use mysql || use mysqli ; then
1914 - our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") )
1915 - fi
1916 -
1917 - # ODBC support
1918 - our_conf+=(
1919 - $(use_with odbc unixODBC "${EPREFIX}/usr")
1920 - $(use_with iodbc iodbc "${EPREFIX}/usr")
1921 - )
1922 -
1923 - # Oracle support
1924 - our_conf+=( $(use_with oci8-instant-client oci8) )
1925 -
1926 - # PDO support
1927 - if use pdo ; then
1928 - our_conf+=(
1929 - $(use_with mssql pdo-dblib "${EPREFIX}/usr")
1930 - $(use_with mysql pdo-mysql "${mysqllib}")
1931 - $(use_with postgres pdo-pgsql)
1932 - $(use_with sqlite pdo-sqlite "${EPREFIX}/usr")
1933 - $(use_with firebird pdo-firebird "${EPREFIX}/usr")
1934 - $(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr")
1935 - $(use_with oci8-instant-client pdo-oci)
1936 - )
1937 - fi
1938 -
1939 - # readline/libedit support
1940 - our_conf+=(
1941 - $(use_with readline readline "${EPREFIX}/usr")
1942 - $(use_with libedit libedit "${EPREFIX}/usr")
1943 - )
1944 -
1945 - # Session support
1946 - if use session ; then
1947 - our_conf+=( $(use_with session-mm mm "${EPREFIX}/usr") )
1948 - else
1949 - our_conf+=( $(use_enable session session) )
1950 - fi
1951 -
1952 - # Use pic for shared modules such as apache2's mod_php
1953 - our_conf+=( --with-pic )
1954 -
1955 - # we use the system copy of pcre
1956 - # --with-pcre-regex affects ext/pcre
1957 - # --with-pcre-dir affects ext/filter and ext/zip
1958 - # --with-pcre-valgrind cannot be enabled with system pcre
1959 - # Many arches don't support pcre-jit
1960 - our_conf+=(
1961 - --with-pcre-regex="${EPREFIX}/usr"
1962 - --with-pcre-dir="${EPREFIX}/usr"
1963 - --without-pcre-valgrind
1964 - --without-pcre-jit
1965 - )
1966 -
1967 - # Catch CFLAGS problems
1968 - # Fixes bug #14067.
1969 - # Changed order to run it in reverse for bug #32022 and #12021.
1970 - replace-cpu-flags "k6*" "i586"
1971 -
1972 - # Cache the ./configure test results between SAPIs.
1973 - our_conf+=( --cache-file="${T}/config.cache" )
1974 -
1975 - # Support user-passed configuration parameters
1976 - our_conf+=( ${EXTRA_ECONF:-} )
1977 -
1978 - # Support the Apache2 extras, they must be set globally for all
1979 - # SAPIs to work correctly, especially for external PHP extensions
1980 -
1981 - mkdir -p "${WORKDIR}/sapis-build" || die
1982 - for one_sapi in $SAPIS ; do
1983 - use "${one_sapi}" || continue
1984 - php_set_ini_dir "${one_sapi}"
1985 -
1986 - # The BUILD_DIR variable is used to determine where to output
1987 - # the files that autotools creates. This was all originally
1988 - # based on the autotools-utils eclass.
1989 - BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}"
1990 - cp -a "${S}" "${BUILD_DIR}" || die
1991 - cd "${BUILD_DIR}" || die
1992 -
1993 - local sapi_conf=(
1994 - --with-config-file-path="${PHP_INI_DIR}"
1995 - --with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}"
1996 - )
1997 -
1998 - for sapi in $SAPIS ; do
1999 - case "$sapi" in
2000 - cli|cgi|embed|fpm|phpdbg)
2001 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
2002 - sapi_conf+=( "--enable-${sapi}" )
2003 - if [[ "fpm" == "${sapi}" ]] ; then
2004 - sapi_conf+=(
2005 - $(use_with acl fpm-acl)
2006 - $(use_with systemd fpm-systemd)
2007 - )
2008 - fi
2009 - else
2010 - sapi_conf+=( "--disable-${sapi}" )
2011 - fi
2012 - ;;
2013 -
2014 - apache2)
2015 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
2016 - sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" )
2017 - else
2018 - sapi_conf+=( --without-apxs2 )
2019 - fi
2020 - ;;
2021 - esac
2022 - done
2023 -
2024 - # Construct the $myeconfargs array by concatenating $our_conf
2025 - # (the common args) and $sapi_conf (the SAPI-specific args).
2026 - local myeconfargs=( "${our_conf[@]}" )
2027 - myeconfargs+=( "${sapi_conf[@]}" )
2028 -
2029 - pushd "${BUILD_DIR}" > /dev/null || die
2030 - econf "${myeconfargs[@]}"
2031 - popd > /dev/null || die
2032 - done
2033 -}
2034 -
2035 -src_compile() {
2036 - # snmp seems to run during src_compile, too (bug #324739)
2037 - addpredict /usr/share/snmp/mibs/.index #nowarn
2038 - addpredict /var/lib/net-snmp/mib_indexes #nowarn
2039 -
2040 - for sapi in ${SAPIS} ; do
2041 - if use "${sapi}"; then
2042 - cd "${WORKDIR}/sapis-build/$sapi" || \
2043 - die "Failed to change dir to ${WORKDIR}/sapis-build/$1"
2044 - emake
2045 - fi
2046 - done
2047 -}
2048 -
2049 -src_install() {
2050 - # see bug #324739 for what happens when we don't have that
2051 - addpredict /usr/share/snmp/mibs/.index #nowarn
2052 -
2053 - # grab the first SAPI that got built and install common files from there
2054 - local first_sapi=""
2055 - for sapi in $SAPIS ; do
2056 - if use $sapi ; then
2057 - first_sapi=$sapi
2058 - break
2059 - fi
2060 - done
2061 -
2062 - # Makefile forgets to create this before trying to write to it...
2063 - dodir "${PHP_DESTDIR#${EPREFIX}}/bin"
2064 -
2065 - # Install php environment (without any sapis)
2066 - cd "${WORKDIR}/sapis-build/$first_sapi" || die
2067 - emake INSTALL_ROOT="${D}" \
2068 - install-build install-headers install-programs
2069 -
2070 - local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)"
2071 -
2072 - # Create the directory where we'll put version-specific php scripts
2073 - keepdir "/usr/share/php${PHP_MV}"
2074 -
2075 - local sapi="", file=""
2076 - local sapi_list=""
2077 -
2078 - for sapi in ${SAPIS}; do
2079 - if use "${sapi}" ; then
2080 - einfo "Installing SAPI: ${sapi}"
2081 - cd "${WORKDIR}/sapis-build/${sapi}" || die
2082 -
2083 - if [[ "${sapi}" == "apache2" ]] ; then
2084 - # We're specifically not using emake install-sapi as libtool
2085 - # may cause unnecessary relink failures (see bug #351266)
2086 - insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/"
2087 - newins ".libs/libphp${PHP_MV}$(get_libname)" \
2088 - "libphp${PHP_MV}$(get_libname)"
2089 - keepdir "/usr/$(get_libdir)/apache2/modules"
2090 - else
2091 - # needed each time, php_install_ini would reset it
2092 - local dest="${PHP_DESTDIR#${EPREFIX}}"
2093 - into "${dest}"
2094 - case "$sapi" in
2095 - cli)
2096 - source="sapi/cli/php"
2097 - ;;
2098 - cgi)
2099 - source="sapi/cgi/php-cgi"
2100 - ;;
2101 - fpm)
2102 - source="sapi/fpm/php-fpm"
2103 - ;;
2104 - embed)
2105 - source="libs/libphp${PHP_MV}$(get_libname)"
2106 - ;;
2107 - phpdbg)
2108 - source="sapi/phpdbg/phpdbg"
2109 - ;;
2110 - *)
2111 - die "unhandled sapi in src_install"
2112 - ;;
2113 - esac
2114 -
2115 - if [[ "${source}" == *"$(get_libname)" ]]; then
2116 - dolib.so "${source}"
2117 - else
2118 - dobin "${source}"
2119 - local name="$(basename ${source})"
2120 - dosym "${dest}/bin/${name}" "/usr/bin/${name}${SLOT}"
2121 - fi
2122 - fi
2123 -
2124 - php_install_ini "${sapi}"
2125 -
2126 - # construct correct SAPI string for php-config
2127 - # thanks to ferringb for the bash voodoo
2128 - if [[ "${sapi}" == "apache2" ]]; then
2129 - sapi_list="${sapi_list:+${sapi_list} }apache2handler"
2130 - else
2131 - sapi_list="${sapi_list:+${sapi_list} }${sapi}"
2132 - fi
2133 - fi
2134 - done
2135 -
2136 - # Installing opcache module
2137 - if use opcache ; then
2138 - into "${PHP_DESTDIR#${EPREFIX}}"
2139 - dolib.so "modules/opcache$(get_libname)"
2140 - fi
2141 -
2142 - # Install env.d files
2143 - newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}"
2144 - sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
2145 - sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
2146 -
2147 - # set php-config variable correctly (bug #278439)
2148 - sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \
2149 - "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die
2150 -
2151 - if use fpm ; then
2152 - if use systemd; then
2153 - systemd_newunit "${FILESDIR}/php-fpm_at.service" \
2154 - "php-fpm@${SLOT}.service"
2155 - else
2156 - systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \
2157 - "php-fpm@${SLOT}.service"
2158 - fi
2159 - fi
2160 -}
2161 -
2162 -src_test() {
2163 - echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
2164 - PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
2165 - if [[ ! -x "${PHP_BIN}" ]] ; then
2166 - ewarn "Test phase requires USE=cli, skipping"
2167 - return
2168 - else
2169 - export TEST_PHP_EXECUTABLE="${PHP_BIN}"
2170 - fi
2171 -
2172 - if [[ -x "${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" ]] ; then
2173 - export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi"
2174 - fi
2175 -
2176 - if [[ -x "${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" ]] ; then
2177 - export TEST_PHPDBG_EXECUTABLE="${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg"
2178 - fi
2179 -
2180 - REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \
2181 - "session.save_path=${T}" \
2182 - "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \
2183 - "session.save_path=${T}"
2184 -
2185 - for name in ${EXPECTED_TEST_FAILURES}; do
2186 - mv "${name}.out" "${name}.out.orig" 2>/dev/null || die
2187 - done
2188 -
2189 - local failed="$(find -name '*.out')"
2190 - if [[ ${failed} != "" ]] ; then
2191 - ewarn "The following test cases failed unexpectedly:"
2192 - for name in ${failed}; do
2193 - ewarn " ${name/.out/}"
2194 - done
2195 - else
2196 - einfo "No unexpected test failures, all fine"
2197 - fi
2198 -
2199 - if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
2200 - local passed=""
2201 - for name in ${EXPECTED_TEST_FAILURES}; do
2202 - [[ -f "${name}.diff" ]] && continue
2203 - passed="${passed} ${name}"
2204 - done
2205 - if [[ ${passed} != "" ]] ; then
2206 - einfo "The following test cases passed unexpectedly:"
2207 - for name in ${passed}; do
2208 - ewarn " ${passed}"
2209 - done
2210 - else
2211 - einfo "None of the known-to-fail tests passed, all fine"
2212 - fi
2213 - fi
2214 -}
2215 -
2216 -pkg_postinst() {
2217 - # Output some general info to the user
2218 - if use apache2 ; then
2219 - elog
2220 - elog "To enable PHP in apache, you will need to add \"-D PHP\" to"
2221 - elog "your apache2 command. OpenRC users can append that string to"
2222 - elog "APACHE2_OPTS in /etc/conf.d/apache2."
2223 - elog
2224 - elog "The apache module configuration file 70_mod_php.conf is"
2225 - elog "provided (and maintained) by eselect-php."
2226 - elog
2227 - fi
2228 -
2229 - # Create the symlinks for php
2230 - for m in ${SAPIS}; do
2231 - [[ ${m} == 'embed' ]] && continue;
2232 - if use $m ; then
2233 - local ci=$(eselect php show $m)
2234 - if [[ -z $ci ]]; then
2235 - eselect php set $m php${SLOT} || die
2236 - einfo "Switched ${m} to use php:${SLOT}"
2237 - einfo
2238 - elif [[ $ci != "php${SLOT}" ]] ; then
2239 - elog "To switch $m to use php:${SLOT}, run"
2240 - elog " eselect php set $m php${SLOT}"
2241 - elog
2242 - fi
2243 - fi
2244 - done
2245 -
2246 - # Remove dead symlinks for SAPIs that were just disabled. For
2247 - # example, if the user has the cgi SAPI enabled, then he has an
2248 - # eselect-php symlink for it. If he later reinstalls PHP with
2249 - # USE="-cgi", that symlink will break. This call to eselect is
2250 - # supposed to remove that dead link per bug 572436.
2251 - eselect php cleanup || die
2252 -
2253 - if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then
2254 - elog "To build extensions for this version of PHP, you will need to"
2255 - elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable."
2256 - elog
2257 - fi
2258 -
2259 - # Warn about the removal of PHP_INI_VERSION if the user has it set.
2260 - if [[ -n "${PHP_INI_VERSION}" ]]; then
2261 - ewarn 'The PHP_INI_VERSION variable has been phased out. You may'
2262 - ewarn 'remove it from your configuration at your convenience. See'
2263 - ewarn
2264 - ewarn ' https://bugs.gentoo.org/611214'
2265 - ewarn
2266 - ewarn 'for more information.'
2267 - fi
2268 -
2269 - elog "For details on how version slotting works, please see"
2270 - elog "the wiki:"
2271 - elog
2272 - elog " https://wiki.gentoo.org/wiki/PHP"
2273 - elog
2274 -}
2275 -
2276 -pkg_postrm() {
2277 - # This serves two purposes. First, if we have just removed the last
2278 - # installed version of PHP, then this will remove any dead symlinks
2279 - # belonging to eselect-php. Second, if a user upgrades slots from
2280 - # (say) 5.6 to 7.0 and depcleans the old slot, then this will update
2281 - # his existing symlinks to point to the new 7.0 installation. The
2282 - # latter is bug 432962.
2283 - #
2284 - # Note: the eselect-php package may not be installed at this point,
2285 - # so we can't die() if this command fails.
2286 - eselect php cleanup
2287 -}