Gentoo Archives: gentoo-commits

From: Brian Evans <grknight@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/php/
Date: Thu, 02 May 2019 16:43:08
Message-Id: 1556815378.45f7d97304137387d39dba9bd901a1221e0cb163.grknight@gentoo
1 commit: 45f7d97304137387d39dba9bd901a1221e0cb163
2 Author: Brian Evans <grknight <AT> gentoo <DOT> org>
3 AuthorDate: Thu May 2 16:42:15 2019 +0000
4 Commit: Brian Evans <grknight <AT> gentoo <DOT> org>
5 CommitDate: Thu May 2 16:42:58 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=45f7d973
7
8 dev-lang/php: Drop old 7.2 version
9
10 Package-Manager: Portage-2.3.66, Repoman-2.3.12
11 Signed-off-by: Brian Evans <grknight <AT> gentoo.org>
12
13 dev-lang/php/Manifest | 1 -
14 dev-lang/php/php-7.2.17.ebuild | 749 -----------------------------------------
15 2 files changed, 750 deletions(-)
16
17 diff --git a/dev-lang/php/Manifest b/dev-lang/php/Manifest
18 index f9cfadf7bb2..143f994dfd8 100644
19 --- a/dev-lang/php/Manifest
20 +++ b/dev-lang/php/Manifest
21 @@ -2,7 +2,6 @@ DIST php-5.6.40.tar.xz 12472236 BLAKE2B f41147eaec9b15e965540f9e871691cc88848dd6
22 DIST php-7.1.27.tar.xz 12219868 BLAKE2B 9de4902504e50b53aab28eac2252aa79302541352b1323a17e68cc58e22cd3b6108b3f7d6ba4779a7f87a561442cf3c44c5660418a354d3b48b6df270a761f8b SHA512 a7019788b02f624e19f804cb0c34578443fc2e0a582a32e72d1340f3cd7bb866631497fe61d18f31f92bad5aa7667847e21bd3916fcdd6f04a3b8f88c805f544
23 DIST php-7.1.28.tar.xz 12222508 BLAKE2B 1e52632f801a717ea7020665da11536ba7ab21ea0e5d5ccf147003cb9a87878053ebabf5f4cdd0810207de1e2ebdd683d7afefd72aa5be521c5690130a72b349 SHA512 fcf983adb7669b83ff3aee33f9d18328f8f36b304bc51bfd1f13a7493365e98204c63214fe4add157dffa44d5407b257dee7247168a14efa36dcfa70d4909a6e
24 DIST php-7.2.16.tar.xz 12166372 BLAKE2B c59ac69b717a8ee88f229baa94c43f9ee1d9c7161c767a95c3a9719ee70cdc9b61aaff75504aca09bba10d224d9a717cb7c985060b6912491857a003e6cbc349 SHA512 cd2ea3c68d7ed20317800f4b838b0dd9ae2fde508c79662b296dacdacf6c7e35b6ef30a6564516d7b22e82749a6e9e2ffcfd95b05cd79a9f227fbfaf9e25bc31
25 -DIST php-7.2.17.tar.xz 12144120 BLAKE2B 5e49af74b9e049962c21b30e77b89db36e376b1fe580118b5bc598fcc42421b8a4ed3b1be3de9ab2a9fc483b3e54acaaf268518b045e808f4a8e4d9c64a2204d SHA512 52451a13bdb480e599a8d0baf3b76303cfec0bc2057166607ae1b0cf423a16361c059bd4df85f7c435715c86d7252399cb1744e435f0adb50bada0e40804c302
26 DIST php-7.2.18.tar.xz 12172696 BLAKE2B c23f4dffe60ad48b53de1c565ecb4f378f5d3daccde98ec8d9bddcfce8bd1a48a75061a72d0094d0db6719a3c0a96cae25ce0ef0fbfadc28fbeff27b332c8107 SHA512 b38034aa13867496009903ba64e4e8bf3216307a9ff1dade60a1477671ecf7bceb5062b349f6997d9af414d58d46ea7bb3f9855e372c230f4a6cff26ad9985d6
27 DIST php-7.3.5.tar.xz 11981356 BLAKE2B f0ea69358519458d1e48f598f3af808f560d824f417995ea80fc63c8610fb04144a471cee7941802b29eaf24b233b506baa4fff390e57292335f88c434b8dc46 SHA512 3231947b01333987568ec3304bebf0c089a23cd6bc4a7139683bd36b2490fef13ed494108b645d40d5ab55f65990004445ba04af48393a9a508cfa7379ba81d3
28 DIST php-patches-20190307-r1.tar.xz 20796 BLAKE2B 251f0d8b222e4a6a339a3b1d4aff39fab8bd7203ec34295b7316a366a7d0015bb9e6665614005949da9decbca53aa9ac0aab63845638a6b4d3d462eabff4ea35 SHA512 d7a412ec1bc6002c458c6bc3cb53faf4e95a852a6cdad337f6a81a978dd56ba72801cccbe866857d6c5b7e95dfe558878133e44a4e9f9b6efd38e679acc82af9
29
30 diff --git a/dev-lang/php/php-7.2.17.ebuild b/dev-lang/php/php-7.2.17.ebuild
31 deleted file mode 100644
32 index 2d85e9d999e..00000000000
33 --- a/dev-lang/php/php-7.2.17.ebuild
34 +++ /dev/null
35 @@ -1,749 +0,0 @@
36 -# Copyright 1999-2019 Gentoo Authors
37 -# Distributed under the terms of the GNU General Public License v2
38 -
39 -EAPI="7"
40 -
41 -inherit flag-o-matic systemd autotools
42 -
43 -DESCRIPTION="The PHP language runtime engine"
44 -HOMEPAGE="https://php.net/"
45 -SRC_URI="https://php.net/distributions/${P}.tar.xz"
46 -
47 -LICENSE="PHP-3.01
48 - BSD
49 - Zend-2.0
50 - bcmath? ( LGPL-2.1+ )
51 - fpm? ( BSD-2 )
52 - gd? ( gd )
53 - unicode? ( BSD-2 LGPL-2.1 )"
54 -
55 -SLOT="$(ver_cut 1-2)"
56 -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"
57 -
58 -# We can build the following SAPIs in the given order
59 -SAPIS="embed cli cgi fpm apache2 phpdbg"
60 -
61 -# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
62 -IUSE="${IUSE}
63 - ${SAPIS/cli/+cli}
64 - threads"
65 -
66 -IUSE="${IUSE} acl argon2 bcmath berkdb bzip2 calendar cdb cjk
67 - coverage +ctype curl debug
68 - enchant exif +fileinfo +filter firebird
69 - flatfile ftp gd gdbm gmp +hash +iconv imap inifile
70 - intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl lmdb
71 - mhash mssql mysql mysqli nls
72 - oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
73 - readline recode selinux +session session-mm sharedmem
74 - +simplexml snmp soap sockets sodium spell sqlite ssl
75 - sysvipc systemd test tidy +tokenizer tokyocabinet truetype unicode wddx webp
76 - +xml xmlreader xmlwriter xmlrpc xpm xslt zip zip-encryption zlib"
77 -
78 -# The supported (that is, autodetected) versions of BDB are listed in
79 -# the ./configure script. Other versions *work*, but we need to stick to
80 -# the ones that can be detected to avoid a repeat of bug #564824.
81 -COMMON_DEPEND="
82 - >=app-eselect/eselect-php-0.9.1[apache2?,fpm?]
83 - >=dev-libs/libpcre-8.32[unicode]
84 - fpm? ( acl? ( sys-apps/acl ) )
85 - apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=]
86 - <www-servers/apache-2.4[threads=] ) )
87 - argon2? ( app-crypt/argon2:= )
88 - berkdb? ( || ( sys-libs/db:5.3
89 - sys-libs/db:5.1
90 - sys-libs/db:4.8
91 - sys-libs/db:4.7
92 - sys-libs/db:4.6
93 - sys-libs/db:4.5 ) )
94 - bzip2? ( app-arch/bzip2:0= )
95 - cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
96 - coverage? ( dev-util/lcov )
97 - curl? ( >=net-misc/curl-7.10.5 )
98 - enchant? ( <app-text/enchant-2.0:0 )
99 - firebird? ( dev-db/firebird )
100 - gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib )
101 - gdbm? ( >=sys-libs/gdbm-1.8.0:0= )
102 - gmp? ( dev-libs/gmp:0= )
103 - iconv? ( virtual/libiconv )
104 - imap? ( virtual/imap-c-client[kerberos=,ssl=] )
105 - intl? ( dev-libs/icu:= )
106 - iodbc? ( dev-db/libiodbc )
107 - kerberos? ( virtual/krb5 )
108 - ldap? ( >=net-nds/openldap-1.2.11 )
109 - ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 )
110 - libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) )
111 - lmdb? ( dev-db/lmdb:= )
112 - mssql? ( dev-db/freetds[mssql] )
113 - nls? ( sys-devel/gettext )
114 - oci8-instant-client? ( dev-db/oracle-instantclient-basic )
115 - odbc? ( >=dev-db/unixODBC-1.8.13 )
116 - postgres? ( dev-db/postgresql:* )
117 - qdbm? ( dev-db/qdbm )
118 - readline? ( sys-libs/readline:0= )
119 - recode? ( app-text/recode )
120 - session-mm? ( dev-libs/mm )
121 - simplexml? ( >=dev-libs/libxml2-2.6.8 )
122 - snmp? ( >=net-analyzer/net-snmp-5.2 )
123 - soap? ( >=dev-libs/libxml2-2.6.8 )
124 - sodium? ( dev-libs/libsodium:= )
125 - spell? ( >=app-text/aspell-0.50 )
126 - sqlite? ( >=dev-db/sqlite-3.7.6.3 )
127 - ssl? (
128 - !libressl? ( dev-libs/openssl:0= )
129 - libressl? ( dev-libs/libressl:0= )
130 - )
131 - tidy? ( || ( app-text/tidy-html5 app-text/htmltidy ) )
132 - tokyocabinet? ( dev-db/tokyocabinet )
133 - truetype? ( =media-libs/freetype-2* )
134 - unicode? ( dev-libs/oniguruma:= )
135 - wddx? ( >=dev-libs/libxml2-2.6.8 )
136 - webp? ( media-libs/libwebp:0= )
137 - xml? ( >=dev-libs/libxml2-2.6.8 )
138 - xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
139 - xmlreader? ( >=dev-libs/libxml2-2.6.8 )
140 - xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
141 - xpm? ( x11-libs/libXpm )
142 - xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
143 - zip? ( sys-libs/zlib:0= )
144 - zip-encryption? ( >=dev-libs/libzip-1.2.0:= )
145 - zlib? ( sys-libs/zlib:0= )
146 -"
147 -
148 -RDEPEND="${COMMON_DEPEND}
149 - virtual/mta
150 - fpm? (
151 - selinux? ( sec-policy/selinux-phpfpm )
152 - systemd? ( sys-apps/systemd ) )"
153 -
154 -# Bison isn't actually needed when building from a release tarball
155 -# However, the configure script will warn if it's absent or if you
156 -# have an incompatible version installed. See bug 593278.
157 -DEPEND="${COMMON_DEPEND}
158 - app-arch/xz-utils
159 - >=sys-devel/bison-3.0.1"
160 -
161 -BDEPEND="virtual/pkgconfig"
162 -
163 -# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
164 -REQUIRED_USE="
165 - || ( cli cgi fpm apache2 embed phpdbg )
166 - cli? ( ^^ ( readline libedit ) )
167 - truetype? ( gd zlib )
168 - webp? ( gd zlib )
169 - cjk? ( gd zlib )
170 - exif? ( gd zlib )
171 - xpm? ( gd zlib )
172 - gd? ( zlib )
173 - simplexml? ( xml )
174 - soap? ( xml )
175 - wddx? ( xml )
176 - xmlrpc? ( || ( xml iconv ) )
177 - xmlreader? ( xml )
178 - xslt? ( xml )
179 - ldap-sasl? ( ldap )
180 - mhash? ( hash )
181 - phar? ( hash )
182 - qdbm? ( !gdbm )
183 - readline? ( !libedit )
184 - recode? ( !imap !mysqli !mysql )
185 - session-mm? ( session !threads )
186 - mysql? ( hash || ( mysqli pdo ) )
187 - mysqli? ( hash )
188 - zip-encryption? ( zip )
189 -"
190 -PATCHES=(
191 - "${FILESDIR}/php-freetype-2.9.1.patch"
192 - "${FILESDIR}/php-7.2.13-intl-use-icu-namespace.patch"
193 -)
194 -
195 -PHP_MV="$(ver_cut 1)"
196 -
197 -php_install_ini() {
198 - local phpsapi="${1}"
199 -
200 - # work out where we are installing the ini file
201 - php_set_ini_dir "${phpsapi}"
202 -
203 - # Always install the production INI file, bug 611214.
204 - local phpinisrc="php.ini-production-${phpsapi}"
205 - cp php.ini-production "${phpinisrc}" || die
206 -
207 - # default to /tmp for save_path, bug #282768
208 - sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die
209 -
210 - # Set the extension dir
211 - sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \
212 - -i "${phpinisrc}" || die
213 -
214 - # Set the include path to point to where we want to find PEAR packages
215 - sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die
216 -
217 - dodir "${PHP_INI_DIR#${EPREFIX}}"
218 - insinto "${PHP_INI_DIR#${EPREFIX}}"
219 - newins "${phpinisrc}" php.ini
220 -
221 - elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}"
222 - elog
223 -
224 - dodir "${PHP_EXT_INI_DIR#${EPREFIX}}"
225 - dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}"
226 -
227 - if use opcache; then
228 - elog "Adding opcache to $PHP_EXT_INI_DIR"
229 - echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \
230 - "${D}/${PHP_EXT_INI_DIR}"/opcache.ini
231 - dosym "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" \
232 - "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini"
233 - fi
234 -
235 - # SAPI-specific handling
236 - if [[ "${sapi}" == "fpm" ]] ; then
237 - einfo "Installing FPM config files php-fpm.conf and www.conf"
238 - insinto "${PHP_INI_DIR#${EPREFIX}}"
239 - doins sapi/fpm/php-fpm.conf
240 - insinto "${PHP_INI_DIR#${EPREFIX}}/fpm.d"
241 - doins sapi/fpm/www.conf
242 - fi
243 -
244 - dodoc php.ini-{development,production}
245 -}
246 -
247 -php_set_ini_dir() {
248 - PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}"
249 - PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
250 - PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
251 -}
252 -
253 -src_prepare() {
254 - default
255 -
256 - # In php-7.x, the FPM pool configuration files have been split off
257 - # of the main config. By default the pool config files go in
258 - # e.g. /etc/php-fpm.d, which isn't slotted. So here we move the
259 - # include directory to a subdirectory "fpm.d" of $PHP_INI_DIR. Later
260 - # we'll install the pool configuration file "www.conf" there.
261 - php_set_ini_dir fpm
262 - sed -i "s~^include=.*$~include=${PHP_INI_DIR}/fpm.d/*.conf~" \
263 - sapi/fpm/php-fpm.conf.in \
264 - || die 'failed to move the include directory in php-fpm.conf'
265 -
266 - # Bug 669566 - necessary so that build tools are updated for commands like pecl
267 - # Force rebuilding aclocal.m4
268 - rm -f aclocal.m4 || die "failed to remove aclocal.m4 in src_prepare"
269 - eautoreconf
270 -}
271 -
272 -src_configure() {
273 - addpredict /usr/share/snmp/mibs/.index #nowarn
274 - addpredict /var/lib/net-snmp/mib_indexes #nowarn
275 -
276 - PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
277 -
278 - # The php-fpm config file wants localstatedir to be ${EPREFIX}/var
279 - # and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002.
280 - local our_conf=(
281 - --prefix="${PHP_DESTDIR}"
282 - --mandir="${PHP_DESTDIR}/man"
283 - --infodir="${PHP_DESTDIR}/info"
284 - --libdir="${PHP_DESTDIR}/lib"
285 - --with-libdir="$(get_libdir)"
286 - --localstatedir="${EPREFIX}/var"
287 - --without-pear
288 - $(use_enable threads maintainer-zts)
289 - )
290 -
291 - our_conf+=(
292 - $(use_with argon2 password-argon2 "${EPREFIX}/usr")
293 - $(use_enable bcmath bcmath)
294 - $(use_with bzip2 bz2 "${EPREFIX}/usr")
295 - $(use_enable calendar calendar)
296 - $(use_enable coverage gcov)
297 - $(use_enable ctype ctype)
298 - $(use_with curl curl "${EPREFIX}/usr")
299 - $(use_enable xml dom)
300 - $(use_with enchant enchant "${EPREFIX}/usr")
301 - $(use_enable exif exif)
302 - $(use_enable fileinfo fileinfo)
303 - $(use_enable filter filter)
304 - $(use_enable ftp ftp)
305 - $(use_with nls gettext "${EPREFIX}/usr")
306 - $(use_with gmp gmp "${EPREFIX}/usr")
307 - $(use_enable hash hash)
308 - $(use_with mhash mhash "${EPREFIX}/usr")
309 - $(use_with iconv iconv \
310 - $(use elibc_glibc || use elibc_musl || use elibc_FreeBSD || echo "${EPREFIX}/usr"))
311 - $(use_enable intl intl)
312 - $(use_enable ipv6 ipv6)
313 - $(use_enable json json)
314 - $(use_with kerberos kerberos "${EPREFIX}/usr")
315 - $(use_enable xml libxml)
316 - $(use_with xml libxml-dir "${EPREFIX}/usr")
317 - $(use_enable unicode mbstring)
318 - $(use_with unicode onig "${EPREFIX}/usr")
319 - $(use_with ssl openssl "${EPREFIX}/usr")
320 - $(use_with ssl openssl-dir "${EPREFIX}/usr")
321 - $(use_enable pcntl pcntl)
322 - $(use_enable phar phar)
323 - $(use_enable pdo pdo)
324 - $(use_enable opcache opcache)
325 - $(use_with postgres pgsql "${EPREFIX}/usr")
326 - $(use_enable posix posix)
327 - $(use_with spell pspell "${EPREFIX}/usr")
328 - $(use_with recode recode "${EPREFIX}/usr")
329 - $(use_enable simplexml simplexml)
330 - $(use_enable sharedmem shmop)
331 - $(use_with snmp snmp "${EPREFIX}/usr")
332 - $(use_enable soap soap)
333 - $(use_enable sockets sockets)
334 - $(use_with sodium sodium "${EPREFIX}/usr")
335 - $(use_with sqlite sqlite3 "${EPREFIX}/usr")
336 - $(use_enable sysvipc sysvmsg)
337 - $(use_enable sysvipc sysvsem)
338 - $(use_enable sysvipc sysvshm)
339 - $(use_with tidy tidy "${EPREFIX}/usr")
340 - $(use_enable tokenizer tokenizer)
341 - $(use_enable wddx wddx)
342 - $(use_enable xml xml)
343 - $(use_enable xmlreader xmlreader)
344 - $(use_enable xmlwriter xmlwriter)
345 - $(use_with xmlrpc xmlrpc)
346 - $(use_with xslt xsl "${EPREFIX}/usr")
347 - $(use_enable zip zip)
348 - $(use_with zip-encryption libzip "${EPREFIX}/usr")
349 - $(use_with zlib zlib "${EPREFIX}/usr")
350 - $(use_enable debug debug)
351 - )
352 -
353 - # DBA support
354 - if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
355 - || use qdbm || use lmdb || use tokyocabinet ; then
356 - our_conf+=( "--enable-dba${shared}" )
357 - fi
358 -
359 - # DBA drivers support
360 - our_conf+=(
361 - $(use_with cdb cdb)
362 - $(use_with berkdb db4 "${EPREFIX}/usr")
363 - $(use_enable flatfile flatfile)
364 - $(use_with gdbm gdbm "${EPREFIX}/usr")
365 - $(use_enable inifile inifile)
366 - $(use_with qdbm qdbm "${EPREFIX}/usr")
367 - $(use_with lmdb lmdb "${EPREFIX}/usr")
368 - )
369 -
370 - # Support for the GD graphics library
371 - our_conf+=(
372 - $(use_with truetype freetype-dir "${EPREFIX}/usr")
373 - $(use_enable cjk gd-jis-conv)
374 - $(use_with gd jpeg-dir "${EPREFIX}/usr")
375 - $(use_with gd png-dir "${EPREFIX}/usr")
376 - $(use_with xpm xpm-dir "${EPREFIX}/usr")
377 - )
378 - if use webp; then
379 - our_conf+=( --with-webp-dir="${EPREFIX}/usr" )
380 - fi
381 - # enable gd last, so configure can pick up the previous settings
382 - our_conf+=( $(use_with gd gd) )
383 -
384 - # IMAP support
385 - if use imap ; then
386 - our_conf+=(
387 - $(use_with imap imap "${EPREFIX}/usr")
388 - $(use_with ssl imap-ssl "${EPREFIX}/usr")
389 - )
390 - fi
391 -
392 - # Interbase/firebird support
393 - our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") )
394 -
395 - # LDAP support
396 - if use ldap ; then
397 - our_conf+=(
398 - $(use_with ldap ldap "${EPREFIX}/usr")
399 - $(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr")
400 - )
401 - fi
402 -
403 - # MySQL support
404 - local mysqllib="mysqlnd"
405 - local mysqlilib="mysqlnd"
406 -
407 - our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
408 -
409 - local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock"
410 - if use mysql || use mysqli ; then
411 - our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") )
412 - fi
413 -
414 - # ODBC support
415 - our_conf+=(
416 - $(use_with odbc unixODBC "${EPREFIX}/usr")
417 - $(use_with iodbc iodbc "${EPREFIX}/usr")
418 - )
419 -
420 - # Oracle support
421 - our_conf+=( $(use_with oci8-instant-client oci8) )
422 -
423 - # PDO support
424 - if use pdo ; then
425 - our_conf+=(
426 - $(use_with mssql pdo-dblib "${EPREFIX}/usr")
427 - $(use_with mysql pdo-mysql "${mysqllib}")
428 - $(use_with postgres pdo-pgsql)
429 - $(use_with sqlite pdo-sqlite "${EPREFIX}/usr")
430 - $(use_with firebird pdo-firebird "${EPREFIX}/usr")
431 - $(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr")
432 - $(use_with oci8-instant-client pdo-oci)
433 - )
434 - fi
435 -
436 - # readline/libedit support
437 - our_conf+=(
438 - $(use_with readline readline "${EPREFIX}/usr")
439 - $(use_with libedit libedit "${EPREFIX}/usr")
440 - )
441 -
442 - # Session support
443 - if use session ; then
444 - our_conf+=( $(use_with session-mm mm "${EPREFIX}/usr") )
445 - else
446 - our_conf+=( $(use_enable session session) )
447 - fi
448 -
449 - # Use pic for shared modules such as apache2's mod_php
450 - our_conf+=( --with-pic )
451 -
452 - # we use the system copy of pcre
453 - # --with-pcre-regex affects ext/pcre
454 - # --with-pcre-dir affects ext/filter and ext/zip
455 - # --with-pcre-valgrind cannot be enabled with system pcre
456 - # Many arches don't support pcre-jit
457 - our_conf+=(
458 - --with-pcre-regex="${EPREFIX}/usr"
459 - --with-pcre-dir="${EPREFIX}/usr"
460 - --without-pcre-valgrind
461 - --without-pcre-jit
462 - )
463 -
464 - # Catch CFLAGS problems
465 - # Fixes bug #14067.
466 - # Changed order to run it in reverse for bug #32022 and #12021.
467 - replace-cpu-flags "k6*" "i586"
468 -
469 - # Cache the ./configure test results between SAPIs.
470 - our_conf+=( --cache-file="${T}/config.cache" )
471 -
472 - # Support user-passed configuration parameters
473 - our_conf+=( ${EXTRA_ECONF:-} )
474 -
475 - # Support the Apache2 extras, they must be set globally for all
476 - # SAPIs to work correctly, especially for external PHP extensions
477 -
478 - mkdir -p "${WORKDIR}/sapis-build" || die
479 - for one_sapi in $SAPIS ; do
480 - use "${one_sapi}" || continue
481 - php_set_ini_dir "${one_sapi}"
482 -
483 - # The BUILD_DIR variable is used to determine where to output
484 - # the files that autotools creates. This was all originally
485 - # based on the autotools-utils eclass.
486 - BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}"
487 - cp -a "${S}" "${BUILD_DIR}" || die
488 - cd "${BUILD_DIR}" || die
489 -
490 - local sapi_conf=(
491 - --with-config-file-path="${PHP_INI_DIR}"
492 - --with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}"
493 - )
494 -
495 - for sapi in $SAPIS ; do
496 - case "$sapi" in
497 - cli|cgi|embed|fpm|phpdbg)
498 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
499 - sapi_conf+=( "--enable-${sapi}" )
500 - if [[ "fpm" == "${sapi}" ]] ; then
501 - sapi_conf+=(
502 - $(use_with acl fpm-acl)
503 - $(use_with systemd fpm-systemd)
504 - )
505 - fi
506 - else
507 - sapi_conf+=( "--disable-${sapi}" )
508 - fi
509 - ;;
510 -
511 - apache2)
512 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
513 - sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" )
514 - else
515 - sapi_conf+=( --without-apxs2 )
516 - fi
517 - ;;
518 - esac
519 - done
520 -
521 - # Construct the $myeconfargs array by concatenating $our_conf
522 - # (the common args) and $sapi_conf (the SAPI-specific args).
523 - local myeconfargs=( "${our_conf[@]}" )
524 - myeconfargs+=( "${sapi_conf[@]}" )
525 -
526 - pushd "${BUILD_DIR}" > /dev/null || die
527 - econf "${myeconfargs[@]}"
528 - popd > /dev/null || die
529 - done
530 -}
531 -
532 -src_compile() {
533 - # snmp seems to run during src_compile, too (bug #324739)
534 - addpredict /usr/share/snmp/mibs/.index #nowarn
535 - addpredict /var/lib/net-snmp/mib_indexes #nowarn
536 -
537 - for sapi in ${SAPIS} ; do
538 - if use "${sapi}"; then
539 - cd "${WORKDIR}/sapis-build/$sapi" || \
540 - die "Failed to change dir to ${WORKDIR}/sapis-build/$1"
541 - emake
542 - fi
543 - done
544 -}
545 -
546 -src_install() {
547 - # see bug #324739 for what happens when we don't have that
548 - addpredict /usr/share/snmp/mibs/.index #nowarn
549 -
550 - # grab the first SAPI that got built and install common files from there
551 - local first_sapi=""
552 - for sapi in $SAPIS ; do
553 - if use $sapi ; then
554 - first_sapi=$sapi
555 - break
556 - fi
557 - done
558 -
559 - # Makefile forgets to create this before trying to write to it...
560 - dodir "${PHP_DESTDIR#${EPREFIX}}/bin"
561 -
562 - # Install php environment (without any sapis)
563 - cd "${WORKDIR}/sapis-build/$first_sapi" || die
564 - emake INSTALL_ROOT="${D}" \
565 - install-build install-headers install-programs
566 -
567 - local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)"
568 -
569 - # Create the directory where we'll put version-specific php scripts
570 - keepdir "/usr/share/php${PHP_MV}"
571 -
572 - local sapi="", file=""
573 - local sapi_list=""
574 -
575 - for sapi in ${SAPIS}; do
576 - if use "${sapi}" ; then
577 - einfo "Installing SAPI: ${sapi}"
578 - cd "${WORKDIR}/sapis-build/${sapi}" || die
579 -
580 - if [[ "${sapi}" == "apache2" ]] ; then
581 - # We're specifically not using emake install-sapi as libtool
582 - # may cause unnecessary relink failures (see bug #351266)
583 - insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/"
584 - newins ".libs/libphp${PHP_MV}$(get_libname)" \
585 - "libphp${PHP_MV}$(get_libname)"
586 - keepdir "/usr/$(get_libdir)/apache2/modules"
587 - else
588 - # needed each time, php_install_ini would reset it
589 - local dest="${PHP_DESTDIR#${EPREFIX}}"
590 - into "${dest}"
591 - case "$sapi" in
592 - cli)
593 - source="sapi/cli/php"
594 - ;;
595 - cgi)
596 - source="sapi/cgi/php-cgi"
597 - ;;
598 - fpm)
599 - source="sapi/fpm/php-fpm"
600 - ;;
601 - embed)
602 - source="libs/libphp${PHP_MV}$(get_libname)"
603 - ;;
604 - phpdbg)
605 - source="sapi/phpdbg/phpdbg"
606 - ;;
607 - *)
608 - die "unhandled sapi in src_install"
609 - ;;
610 - esac
611 -
612 - if [[ "${source}" == *"$(get_libname)" ]]; then
613 - dolib.so "${source}"
614 - else
615 - dobin "${source}"
616 - local name="$(basename ${source})"
617 - dosym "${dest}/bin/${name}" "/usr/bin/${name}${SLOT}"
618 - fi
619 - fi
620 -
621 - php_install_ini "${sapi}"
622 -
623 - # construct correct SAPI string for php-config
624 - # thanks to ferringb for the bash voodoo
625 - if [[ "${sapi}" == "apache2" ]]; then
626 - sapi_list="${sapi_list:+${sapi_list} }apache2handler"
627 - else
628 - sapi_list="${sapi_list:+${sapi_list} }${sapi}"
629 - fi
630 - fi
631 - done
632 -
633 - # Installing opcache module
634 - if use opcache ; then
635 - into "${PHP_DESTDIR#${EPREFIX}}"
636 - dolib.so "modules/opcache$(get_libname)"
637 - fi
638 -
639 - # Install env.d files
640 - newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}"
641 - sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
642 - sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
643 -
644 - # set php-config variable correctly (bug #278439)
645 - sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \
646 - "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die
647 -
648 - if use fpm ; then
649 - if use systemd; then
650 - systemd_newunit "${FILESDIR}/php-fpm_at.service" \
651 - "php-fpm@${SLOT}.service"
652 - else
653 - systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \
654 - "php-fpm@${SLOT}.service"
655 - fi
656 - fi
657 -}
658 -
659 -src_test() {
660 - echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
661 - PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
662 - if [[ ! -x "${PHP_BIN}" ]] ; then
663 - ewarn "Test phase requires USE=cli, skipping"
664 - return
665 - else
666 - export TEST_PHP_EXECUTABLE="${PHP_BIN}"
667 - fi
668 -
669 - if [[ -x "${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" ]] ; then
670 - export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi"
671 - fi
672 -
673 - if [[ -x "${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" ]] ; then
674 - export TEST_PHPDBG_EXECUTABLE="${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg"
675 - fi
676 -
677 - REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \
678 - "session.save_path=${T}" \
679 - "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \
680 - "session.save_path=${T}"
681 -
682 - for name in ${EXPECTED_TEST_FAILURES}; do
683 - mv "${name}.out" "${name}.out.orig" 2>/dev/null || die
684 - done
685 -
686 - local failed="$(find -name '*.out')"
687 - if [[ ${failed} != "" ]] ; then
688 - ewarn "The following test cases failed unexpectedly:"
689 - for name in ${failed}; do
690 - ewarn " ${name/.out/}"
691 - done
692 - else
693 - einfo "No unexpected test failures, all fine"
694 - fi
695 -
696 - if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
697 - local passed=""
698 - for name in ${EXPECTED_TEST_FAILURES}; do
699 - [[ -f "${name}.diff" ]] && continue
700 - passed="${passed} ${name}"
701 - done
702 - if [[ ${passed} != "" ]] ; then
703 - einfo "The following test cases passed unexpectedly:"
704 - for name in ${passed}; do
705 - ewarn " ${passed}"
706 - done
707 - else
708 - einfo "None of the known-to-fail tests passed, all fine"
709 - fi
710 - fi
711 -}
712 -
713 -pkg_postinst() {
714 - # Output some general info to the user
715 - if use apache2 ; then
716 - elog
717 - elog "To enable PHP in apache, you will need to add \"-D PHP\" to"
718 - elog "your apache2 command. OpenRC users can append that string to"
719 - elog "APACHE2_OPTS in /etc/conf.d/apache2."
720 - elog
721 - elog "The apache module configuration file 70_mod_php.conf is"
722 - elog "provided (and maintained) by eselect-php."
723 - elog
724 - fi
725 -
726 - # Create the symlinks for php
727 - for m in ${SAPIS}; do
728 - [[ ${m} == 'embed' ]] && continue;
729 - if use $m ; then
730 - local ci=$(eselect php show $m)
731 - if [[ -z $ci ]]; then
732 - eselect php set $m php${SLOT} || die
733 - einfo "Switched ${m} to use php:${SLOT}"
734 - einfo
735 - elif [[ $ci != "php${SLOT}" ]] ; then
736 - elog "To switch $m to use php:${SLOT}, run"
737 - elog " eselect php set $m php${SLOT}"
738 - elog
739 - fi
740 - fi
741 - done
742 -
743 - # Remove dead symlinks for SAPIs that were just disabled. For
744 - # example, if the user has the cgi SAPI enabled, then he has an
745 - # eselect-php symlink for it. If he later reinstalls PHP with
746 - # USE="-cgi", that symlink will break. This call to eselect is
747 - # supposed to remove that dead link per bug 572436.
748 - eselect php cleanup || die
749 -
750 - if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then
751 - elog "To build extensions for this version of PHP, you will need to"
752 - elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable."
753 - elog
754 - fi
755 -
756 - # Warn about the removal of PHP_INI_VERSION if the user has it set.
757 - if [[ -n "${PHP_INI_VERSION}" ]]; then
758 - ewarn 'The PHP_INI_VERSION variable has been phased out. You may'
759 - ewarn 'remove it from your configuration at your convenience. See'
760 - ewarn
761 - ewarn ' https://bugs.gentoo.org/611214'
762 - ewarn
763 - ewarn 'for more information.'
764 - fi
765 -
766 - elog "For details on how version slotting works, please see"
767 - elog "the wiki:"
768 - elog
769 - elog " https://wiki.gentoo.org/wiki/PHP"
770 - elog
771 -}
772 -
773 -pkg_postrm() {
774 - # This serves two purposes. First, if we have just removed the last
775 - # installed version of PHP, then this will remove any dead symlinks
776 - # belonging to eselect-php. Second, if a user upgrades slots from
777 - # (say) 5.6 to 7.0 and depcleans the old slot, then this will update
778 - # his existing symlinks to point to the new 7.0 installation. The
779 - # latter is bug 432962.
780 - #
781 - # Note: the eselect-php package may not be installed at this point,
782 - # so we can't die() if this command fails.
783 - eselect php cleanup
784 -}