Gentoo Archives: gentoo-commits

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