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