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: Sat, 15 Sep 2018 03:40:31
Message-Id: 1536982817.12dda45273e65cc67b42372938fd3987f5782db6.grknight@gentoo
1 commit: 12dda45273e65cc67b42372938fd3987f5782db6
2 Author: Brian Evans <grknight <AT> gentoo <DOT> org>
3 AuthorDate: Sat Sep 15 03:39:46 2018 +0000
4 Commit: Brian Evans <grknight <AT> gentoo <DOT> org>
5 CommitDate: Sat Sep 15 03:40:17 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=12dda452
7
8 dev-lang/php: Drop old
9
10 Package-Manager: Portage-2.3.49, Repoman-2.3.10
11
12 dev-lang/php/Manifest | 6 -
13 dev-lang/php/php-5.6.37.ebuild | 777 ------------------------------------
14 dev-lang/php/php-7.0.31.ebuild | 751 ----------------------------------
15 dev-lang/php/php-7.1.20.ebuild | 728 ---------------------------------
16 dev-lang/php/php-7.1.21.ebuild | 728 ---------------------------------
17 dev-lang/php/php-7.2.9.ebuild | 740 ----------------------------------
18 dev-lang/php/php-7.3.0_beta2.ebuild | 743 ----------------------------------
19 7 files changed, 4473 deletions(-)
20
21 diff --git a/dev-lang/php/Manifest b/dev-lang/php/Manifest
22 index 9bb31f3f0e1..5087c7e8e2b 100644
23 --- a/dev-lang/php/Manifest
24 +++ b/dev-lang/php/Manifest
25 @@ -1,14 +1,8 @@
26 DIST php-5.6.36.tar.xz 12467560 BLAKE2B 8badaabc668ff3a4b1129f03605a1570729f8196d2e2539fe85bc42a628f2b24ea76c298b194e8466d9218ae98218243430c8d36d73fbd32b042dd6453510361 SHA512 807c68ab85b6685b19707bd18cfd46f3695b2dc67f9f17f85476634e4a80a036cb413ccae05ed5ba529eafe8df57ebf758dd664ed2942ec44f90a6e8b0172e5e
27 -DIST php-5.6.37.tar.xz 12467912 BLAKE2B e047a7eabf1279c2c0b1e290596aada5d4551bb23a1d8deae3f57fb613cfdd7ea1044a63f1d296737bda408626f42bef6744e1047617ae13ebfcd070a9d1c8b0 SHA512 1c2e64166b30d9a2dcccd29cf34e2b8ca851827ffda30ab690f41feef7bc7f49194bc79cdd373b4aaf1191779d78469b2a04b2e2215f06865b4f3b983cf9e062
28 DIST php-5.6.38.tar.xz 12467408 BLAKE2B d9ee47e193d80bce8a9ed6ffd3eb13e67ba6d1f597ece2803cd92fddc6245f46cdfe644d6cda12a6bb409b92c1fe748610cc5eb43dea0bf063fda81188ee8b3d SHA512 66c51a8e954b1496c0bad0a2864a2a1537dd1c1c573b553991d6d5bce85fc7bc340e56a21109bc5e9a03799e703204b980b569c95a5c0a1bddb01c8947e7a682
29 DIST php-7.0.30.tar.xz 12030228 BLAKE2B cc4c50d108fca68ee98b70a3007893d912d2343dd255faf52e41c1de04f590f427d9edad7b637177ccf1d9c62212ee6060baca13931c0aa14532df548ef159aa SHA512 1f0914ebda79247aa65ace63f6c8c4fcd850b21a82704f7b6482760259239cc5fee4cfd5aa2ed590b56822b4d69330ac472f46537e7f25d59e73ba63a48827c5
30 -DIST php-7.0.31.tar.xz 12029516 BLAKE2B afb3c831b11b3aa4d3660ccef5b97e8282da2ad9362477d79b3beff41ece3321e869aec8de08a999d16b03b23a654f799ba51f60ad727a1baebd373fe0b0f4aa SHA512 be09b810d63d0aa82ec193686f26cb2a76c16064f90a59ae5ade152cff196ece67a7e8bf1e640bf43913309c968c398231384b0b11be2b4429dd4672bcfce43e
31 DIST php-7.0.32.tar.xz 12030780 BLAKE2B 0c277eac4c931a6e30954cceb7feef8dea1c3ef4aebac91779b7e1a6f90f608faa93d1750a2dc8f354c73304e0f7a9b9ac17bb0d1da4768ddb68925752c11aef SHA512 4a7c9a6b91ad7da69303916202062d639e6f02dcd483e851a44d8c7a2efeb5c9a666097935ab60d700c4445f86a0c68df1515300c57af1cdb76528b54b757608
32 DIST php-7.1.18.tar.xz 12213396 BLAKE2B f851c6eb261b8b532e84e73e6f173deb6ac00cd5168a02db9811843540aeadc390a4c5416eb17749cc950bbb1eda1045f538e2b80e4734ea2c0c4e264776bffb SHA512 7eacbc3b98d8b668c90d5c93030263f47ba2e0d4d7820594662590b8b68670f734a2274ae476e3aeac7e030c4ef10411a80da3523383e87a6757e87597caee90
33 -DIST php-7.1.20.tar.xz 12227052 BLAKE2B c9872ffd1f8eb1a51a24d669965b0b908c3d233ad3eac86284e1edf7c6fa5e8099d5706bd1dd740cea039aeac2f66e60f96ccd15f1956eefe5635142b75857f1 SHA512 1f84ba63df45b0d32d704b74217b509807976e88ea953a330c06372491d6ca6e41891cf14bd16524b76f4b2f9007f1243845af7e652917de9325c022135ed9cf
34 -DIST php-7.1.21.tar.xz 12227636 BLAKE2B a7451d0f7d8d788ee9d2950170364bdd552dd35bf962b6591618dcda163ea26677c22e26342072b17573182bfd91b7f3f55cade3432c3e9800e36264ba72150a SHA512 92266ae2a1880a497e828ec8972fef6a1c20505a1eb39c77590d9469b2ae047c86d3e84c65871475e36fa3f7e9e872e25aca241b33c3d7ed8fa5dc8d511af2cf
35 DIST php-7.1.22.tar.xz 12227848 BLAKE2B 72fab94b1c7ecfd3479f6d6c9a76a9d8813f7789402664201615d79ab8b5bb26fb1b7273769c4898a36f0336e0ce4d50bf2f17b81ddb54acc9583e39623e3a5b SHA512 0fc0907d303711dbc4ba0a18618e3e73550c73d13988c769f8d50066017b1efe3feb0d22d5539f69271ea4e9532a3d997e22841cb59bdbf96313169e1c03538d
36 DIST php-7.2.10.tar.xz 12160864 BLAKE2B f1959a00622c1bd11fa87c61d152c802b307f0b9e89b51ed86b40086cda03eeb6652d47b59df8cc7c9b4e79ab687ae1292b978f453e9f07ac352d209b64c62d8 SHA512 aa90fce17034b2649012d66461626ae74c21ea938b1c71c7eb12419e562c641b432df87a7e900c245ad28df39624cf64a1b2f8ffb123608d94cd35e41f09c0fe
37 -DIST php-7.2.9.tar.xz 12126780 BLAKE2B 0c509e281190e07199b189d220884b75fe6a81c64c7fdf271208b1d7f209c641defbd14aaa4e33b5a286bae8d9b40a72473e903b4349a36eca44499bf49757fd SHA512 b898e78fcb4aeeb441395dcabe2e7686425487e32dffbf0e99393aedb917da87a744b23f0be557c45e447433c8058df6e53c34869fc2dcf874cc1af97ff8331f
38 DIST php-7.3.0RC1.tar.xz 11920364 BLAKE2B 82a7fa5359c4fb3e6b66249d1c45dad5275b251261d33d07d5c5e86360c1a32affa3d80145802d8dbf391f253d895d4107affcd773f1637c373240ce854606e3 SHA512 40f8fe3367fb42fe739888d1f2335e6326a7ca35c33b8ebc8de59fd5d35a2a7ab6866a6bd837b8a0eb41b89d3c7c3a49332850ff2e9a2b9d244665da91422725
39 -DIST php-7.3.0beta2.tar.xz 11902672 BLAKE2B a7400b149b99ca70b6b18d7651726445d6c4aae0a03ed8b8bd8c55ef75de592cc61f4aa26dd9e3e0c2629e130bde600fcefc064560a8cf5aa3d3f817408f78d9 SHA512 adfa1d4a38fd4080a37e643c67f6cce0b71538e08ce0be3c124bda5d2b681355cbd040b6fc44f357b1c3a5a8542621f8b983c33ac7cfc262ad93d07c1ab4db98
40
41 diff --git a/dev-lang/php/php-5.6.37.ebuild b/dev-lang/php/php-5.6.37.ebuild
42 deleted file mode 100644
43 index 56adfd72855..00000000000
44 --- a/dev-lang/php/php-5.6.37.ebuild
45 +++ /dev/null
46 @@ -1,777 +0,0 @@
47 -# Copyright 1999-2018 Gentoo Foundation
48 -# Distributed under the terms of the GNU General Public License v2
49 -
50 -EAPI=6
51 -
52 -inherit autotools flag-o-matic eapi7-ver systemd
53 -
54 -DESCRIPTION="The PHP language runtime engine"
55 -HOMEPAGE="https://secure.php.net/"
56 -SRC_URI="https://php.net/distributions/${P}.tar.xz"
57 -
58 -LICENSE="PHP-3.01
59 - BSD
60 - Zend-2.0
61 - bcmath? ( LGPL-2.1+ )
62 - fpm? ( BSD-2 )
63 - gd? ( gd )
64 - unicode? ( BSD-2 LGPL-2.1 )"
65 -
66 -SLOT="$(ver_cut 1-2)"
67 -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"
68 -
69 -# We can build the following SAPIs in the given order
70 -SAPIS="embed cli cgi fpm apache2"
71 -
72 -# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
73 -IUSE="${IUSE}
74 - ${SAPIS/cli/+cli}
75 - threads"
76 -
77 -IUSE="${IUSE} acl bcmath berkdb bzip2 calendar cdb cjk
78 - coverage crypt +ctype curl debug
79 - enchant exif +fileinfo +filter firebird
80 - flatfile ftp gd gdbm gmp +hash +iconv imap inifile
81 - intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl
82 - mhash mssql mysql libmysqlclient mysqli nls
83 - oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
84 - readline recode selinux +session sharedmem
85 - +simplexml snmp soap sockets spell sqlite ssl
86 - sybase-ct sysvipc systemd tidy +tokenizer truetype unicode vpx wddx
87 - +xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib"
88 -
89 -# The supported (that is, autodetected) versions of BDB are listed in
90 -# the ./configure script. Other versions *work*, but we need to stick to
91 -# the ones that can be detected to avoid a repeat of bug #564824.
92 -COMMON_DEPEND="
93 - >=app-eselect/eselect-php-0.9.1[apache2?,fpm?]
94 - >=dev-libs/libpcre-8.32[unicode]
95 - fpm? ( acl? ( sys-apps/acl ) )
96 - apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=]
97 - <www-servers/apache-2.4[threads=] ) )
98 - berkdb? ( || ( sys-libs/db:5.3
99 - sys-libs/db:5.1
100 - sys-libs/db:4.8
101 - sys-libs/db:4.7
102 - sys-libs/db:4.6
103 - sys-libs/db:4.5 ) )
104 - bzip2? ( app-arch/bzip2:0= )
105 - cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
106 - cjk? ( !gd? (
107 - virtual/jpeg:0
108 - media-libs/libpng:0=
109 - sys-libs/zlib:0=
110 - ) )
111 - coverage? ( dev-util/lcov )
112 - crypt? ( >=dev-libs/libmcrypt-2.4 )
113 - curl? ( >=net-misc/curl-7.10.5 )
114 - enchant? ( app-text/enchant )
115 - exif? ( !gd? (
116 - virtual/jpeg:0
117 - media-libs/libpng:0=
118 - sys-libs/zlib:0=
119 - ) )
120 - firebird? ( dev-db/firebird )
121 - gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib:0= )
122 - gdbm? ( >=sys-libs/gdbm-1.8.0:0= )
123 - gmp? ( dev-libs/gmp:0= )
124 - iconv? ( virtual/libiconv )
125 - imap? ( virtual/imap-c-client[kerberos=,ssl=] )
126 - intl? ( <dev-libs/icu-61.1:= )
127 - iodbc? ( dev-db/libiodbc )
128 - kerberos? ( virtual/krb5 )
129 - ldap? ( >=net-nds/openldap-1.2.11 )
130 - ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 )
131 - libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) )
132 - mssql? ( dev-db/freetds[mssql] )
133 - libmysqlclient? (
134 - mysql? ( virtual/libmysqlclient:= )
135 - mysqli? ( virtual/libmysqlclient:= )
136 - )
137 - nls? ( sys-devel/gettext )
138 - oci8-instant-client? ( dev-db/oracle-instantclient-basic )
139 - odbc? ( >=dev-db/unixODBC-1.8.13 )
140 - postgres? ( dev-db/postgresql:* )
141 - qdbm? ( dev-db/qdbm )
142 - readline? ( sys-libs/readline:0= )
143 - recode? ( app-text/recode )
144 - sharedmem? ( dev-libs/mm )
145 - simplexml? ( >=dev-libs/libxml2-2.6.8 )
146 - snmp? ( >=net-analyzer/net-snmp-5.2 )
147 - soap? ( >=dev-libs/libxml2-2.6.8 )
148 - spell? ( >=app-text/aspell-0.50 )
149 - sqlite? ( >=dev-db/sqlite-3.7.6.3 )
150 - ssl? (
151 - !libressl? ( dev-libs/openssl:0= )
152 - libressl? ( dev-libs/libressl:0= )
153 - )
154 - sybase-ct? ( dev-db/freetds )
155 - tidy? ( app-text/htmltidy )
156 - truetype? (
157 - =media-libs/freetype-2*
158 - >=media-libs/t1lib-5.0.0
159 - !gd? (
160 - virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib:0= )
161 - )
162 - unicode? ( dev-libs/oniguruma:= )
163 - vpx? ( media-libs/libvpx:0= )
164 - wddx? ( >=dev-libs/libxml2-2.6.8 )
165 - xml? ( >=dev-libs/libxml2-2.6.8 )
166 - xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
167 - xmlreader? ( >=dev-libs/libxml2-2.6.8 )
168 - xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
169 - xpm? (
170 - x11-libs/libXpm
171 - virtual/jpeg:0
172 - media-libs/libpng:0= sys-libs/zlib:0=
173 - )
174 - xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
175 - zip? ( sys-libs/zlib:0= )
176 - zlib? ( sys-libs/zlib:0= )
177 -"
178 -
179 -RDEPEND="${COMMON_DEPEND}
180 - virtual/mta
181 - fpm? (
182 - selinux? ( sec-policy/selinux-phpfpm )
183 - systemd? ( sys-apps/systemd ) )"
184 -
185 -DEPEND="${COMMON_DEPEND}
186 - app-arch/xz-utils
187 - >=sys-devel/bison-3.0.1
188 - sys-devel/flex
189 - >=sys-devel/m4-1.4.3
190 - >=sys-devel/libtool-1.5.18"
191 -
192 -# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
193 -REQUIRED_USE="
194 - || ( cli cgi fpm apache2 embed )
195 - cli? ( ^^ ( readline libedit ) )
196 - truetype? ( gd zlib )
197 - vpx? ( gd zlib )
198 - cjk? ( gd zlib )
199 - exif? ( gd zlib )
200 - xpm? ( gd zlib )
201 - gd? ( zlib )
202 - simplexml? ( xml )
203 - soap? ( xml )
204 - wddx? ( xml )
205 - xmlrpc? ( || ( xml iconv ) )
206 - xmlreader? ( xml )
207 - xslt? ( xml )
208 - ldap-sasl? ( ldap )
209 - mhash? ( hash )
210 - phar? ( hash )
211 - recode? ( !imap !mysql !mysqli !libmysqlclient )
212 - libmysqlclient? ( || (
213 - mysql
214 - mysqli
215 - pdo
216 - ) )
217 -
218 - qdbm? ( !gdbm )
219 - readline? ( !libedit )
220 - sharedmem? ( !threads )
221 -"
222 -
223 -PHP_MV="$(ver_cut 1)"
224 -
225 -php_install_ini() {
226 - local phpsapi="${1}"
227 -
228 - # work out where we are installing the ini file
229 - php_set_ini_dir "${phpsapi}"
230 -
231 - # Always install the production INI file, bug 611214.
232 - local phpinisrc="php.ini-production-${phpsapi}"
233 - cp php.ini-production "${phpinisrc}" || die
234 -
235 - # default to /tmp for save_path, bug #282768
236 - sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die
237 -
238 - # Set the extension dir
239 - sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \
240 - -i "${phpinisrc}" || die
241 -
242 - # Set the include path to point to where we want to find PEAR packages
243 - sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die
244 -
245 - dodir "${PHP_INI_DIR#${EPREFIX}}"
246 - insinto "${PHP_INI_DIR#${EPREFIX}}"
247 - newins "${phpinisrc}" php.ini
248 -
249 - elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}"
250 - elog
251 -
252 - dodir "${PHP_EXT_INI_DIR#${EPREFIX}}"
253 - dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}"
254 -
255 - if use opcache; then
256 - elog "Adding opcache to $PHP_EXT_INI_DIR"
257 - echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \
258 - "${D}/${PHP_EXT_INI_DIR}"/opcache.ini
259 - dosym "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" \
260 - "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini"
261 - fi
262 -
263 - # SAPI-specific handling
264 - if [[ "${sapi}" == "fpm" ]] ; then
265 - einfo "Installing FPM config file php-fpm.conf"
266 - insinto "${PHP_INI_DIR#${EPREFIX}}"
267 - doins sapi/fpm/php-fpm.conf
268 - fi
269 -
270 - dodoc php.ini-{development,production}
271 -}
272 -
273 -php_set_ini_dir() {
274 - PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}"
275 - PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
276 - PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
277 -}
278 -
279 -src_prepare() {
280 - eapply "${FILESDIR}/php-${SLOT}-no-bison-warnings.patch"
281 - eapply "${FILESDIR}/5.6-mbstring-oniguruma-6.8.patch"
282 - eapply "${FILESDIR}/php-freetype-2.9.1.patch"
283 -
284 - # Change PHP branding
285 - # Get the alpha/beta/rc version
286 - sed -re "s|^(PHP_EXTRA_VERSION=\").*(\")|\1-pl${PR/r/}-gentoo\2|g" \
287 - -i configure.in || die "Unable to change PHP branding"
288 -
289 - # Patch PHP to show Gentoo as the server platform
290 - sed -e 's/PHP_UNAME=`uname -a | xargs`/PHP_UNAME=`uname -s -n -r -v | xargs`/g' \
291 - -i configure.in || die "Failed to fix server platform name"
292 -
293 - # Prevent PHP from activating the Apache config,
294 - # as we will do that ourselves
295 - sed -i \
296 - -e "s,-i -a -n php${PHP_MV},-i -n php${PHP_MV},g" \
297 - -e "s,-i -A -n php${PHP_MV},-i -n php${PHP_MV},g" \
298 - configure sapi/apache2filter/config.m4 sapi/apache2handler/config.m4 \
299 - || die
300 -
301 - # Patch PHP to support heimdal instead of mit-krb5
302 - if has_version "app-crypt/heimdal" ; then
303 - sed -e 's|gssapi_krb5|gssapi|g' -i acinclude.m4 \
304 - || die "Failed to fix heimdal libname"
305 - sed -e 's|PHP_ADD_LIBRARY(k5crypto, 1, $1)||g' -i acinclude.m4 \
306 - || die "Failed to fix heimdal crypt library reference"
307 - fi
308 -
309 - eapply_user
310 -
311 - # Force rebuilding aclocal.m4
312 - rm -f aclocal.m4 || die "failed to remove aclocal.m4 in src_prepare"
313 - eautoreconf
314 -
315 - if [[ ${CHOST} == *-darwin* ]] ; then
316 - # http://bugs.php.net/bug.php?id=48795, bug #343481
317 - sed -i -e '/BUILD_CGI="\\$(CC)/s/CC/CXX/' configure || die
318 - fi
319 -}
320 -
321 -src_configure() {
322 - addpredict /usr/share/snmp/mibs/.index #nowarn
323 - addpredict /var/lib/net-snmp/mib_indexes #nowarn
324 -
325 - PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
326 -
327 - # The php-fpm config file wants localstatedir to be ${EPREFIX}/var
328 - # and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002.
329 - local our_conf=(
330 - --prefix="${PHP_DESTDIR}"
331 - --mandir="${PHP_DESTDIR}/man"
332 - --infodir="${PHP_DESTDIR}/info"
333 - --libdir="${PHP_DESTDIR}/lib"
334 - --with-libdir="$(get_libdir)"
335 - --localstatedir="${EPREFIX}/var"
336 - --without-pear
337 - $(use_enable threads maintainer-zts)
338 - )
339 -
340 - our_conf+=(
341 - $(use_enable bcmath bcmath)
342 - $(use_with bzip2 bz2 "${EPREFIX}/usr")
343 - $(use_enable calendar calendar)
344 - $(use_enable coverage gcov)
345 - $(use_enable ctype ctype)
346 - $(use_with curl curl "${EPREFIX}/usr")
347 - $(use_enable xml dom)
348 - $(use_with enchant enchant "${EPREFIX}/usr")
349 - $(use_enable exif exif)
350 - $(use_enable fileinfo fileinfo)
351 - $(use_enable filter filter)
352 - $(use_enable ftp ftp)
353 - $(use_with nls gettext "${EPREFIX}/usr")
354 - $(use_with gmp gmp "${EPREFIX}/usr")
355 - $(use_enable hash hash)
356 - $(use_with mhash mhash "${EPREFIX}/usr")
357 - $(use_with iconv iconv \
358 - $(use elibc_glibc || use elibc_musl || use elibc_FreeBSD || echo "${EPREFIX}/usr"))
359 - $(use_enable intl intl)
360 - $(use_enable ipv6 ipv6)
361 - $(use_enable json json)
362 - $(use_with kerberos kerberos "${EPREFIX}/usr")
363 - $(use_enable xml libxml)
364 - $(use_with xml libxml-dir "${EPREFIX}/usr")
365 - $(use_enable unicode mbstring)
366 - $(use_with crypt mcrypt "${EPREFIX}/usr")
367 - $(use_with mssql mssql "${EPREFIX}/usr")
368 - $(use_with unicode onig "${EPREFIX}/usr")
369 - $(use_with ssl openssl "${EPREFIX}/usr")
370 - $(use_with ssl openssl-dir "${EPREFIX}/usr")
371 - $(use_enable pcntl pcntl)
372 - $(use_enable phar phar)
373 - $(use_enable pdo pdo)
374 - $(use_enable opcache opcache)
375 - $(use_with postgres pgsql "${EPREFIX}/usr")
376 - $(use_enable posix posix)
377 - $(use_with spell pspell "${EPREFIX}/usr")
378 - $(use_with recode recode "${EPREFIX}/usr")
379 - $(use_enable simplexml simplexml)
380 - $(use_enable sharedmem shmop)
381 - $(use_with snmp snmp "${EPREFIX}/usr")
382 - $(use_enable soap soap)
383 - $(use_enable sockets sockets)
384 - $(use_with sqlite sqlite3 "${EPREFIX}/usr")
385 - $(use_with sybase-ct sybase-ct "${EPREFIX}/usr")
386 - $(use_enable sysvipc sysvmsg)
387 - $(use_enable sysvipc sysvsem)
388 - $(use_enable sysvipc sysvshm)
389 - $(use_with tidy tidy "${EPREFIX}/usr")
390 - $(use_enable tokenizer tokenizer)
391 - $(use_enable wddx wddx)
392 - $(use_enable xml xml)
393 - $(use_enable xmlreader xmlreader)
394 - $(use_enable xmlwriter xmlwriter)
395 - $(use_with xmlrpc xmlrpc)
396 - $(use_with xslt xsl "${EPREFIX}/usr")
397 - $(use_enable zip zip)
398 - $(use_with zlib zlib "${EPREFIX}/usr")
399 - $(use_enable debug debug)
400 - )
401 -
402 - # DBA support
403 - if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
404 - || use qdbm ; then
405 - our_conf+=( "--enable-dba${shared}" )
406 - fi
407 -
408 - # DBA drivers support
409 - our_conf+=(
410 - $(use_with cdb cdb)
411 - $(use_with berkdb db4 "${EPREFIX}/usr")
412 - $(use_enable flatfile flatfile)
413 - $(use_with gdbm gdbm "${EPREFIX}/usr")
414 - $(use_enable inifile inifile)
415 - $(use_with qdbm qdbm "${EPREFIX}/usr")
416 - )
417 -
418 - # Support for the GD graphics library
419 - our_conf+=(
420 - $(use_with truetype freetype-dir "${EPREFIX}/usr")
421 - $(use_with truetype t1lib "${EPREFIX}/usr")
422 - $(use_enable cjk gd-jis-conv)
423 - $(use_with gd jpeg-dir "${EPREFIX}/usr")
424 - $(use_with gd png-dir "${EPREFIX}/usr")
425 - $(use_with xpm xpm-dir "${EPREFIX}/usr")
426 - $(use_with vpx vpx-dir "${EPREFIX}/usr")
427 - )
428 - # enable gd last, so configure can pick up the previous settings
429 - our_conf+=( $(use_with gd gd) )
430 -
431 - # IMAP support
432 - if use imap ; then
433 - our_conf+=(
434 - $(use_with imap imap "${EPREFIX}/usr")
435 - $(use_with ssl imap-ssl "${EPREFIX}/usr")
436 - )
437 - fi
438 -
439 - # Interbase/firebird support
440 - our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") )
441 -
442 - # LDAP support
443 - if use ldap ; then
444 - our_conf+=(
445 - $(use_with ldap ldap "${EPREFIX}/usr")
446 - $(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr")
447 - )
448 - fi
449 -
450 - # MySQL support
451 - local mysqllib="mysqlnd"
452 - local mysqlilib="mysqlnd"
453 - use libmysqlclient && mysqllib="${EPREFIX}/usr"
454 - use libmysqlclient && mysqlilib="${EPREFIX}/usr/bin/mysql_config"
455 -
456 - our_conf+=( $(use_with mysql mysql "${mysqllib}") )
457 - our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
458 -
459 - local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock"
460 - if use mysql || use mysqli ; then
461 - our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") )
462 - fi
463 -
464 - # ODBC support
465 - our_conf+=(
466 - $(use_with odbc unixODBC "${EPREFIX}/usr")
467 - $(use_with iodbc iodbc "${EPREFIX}/usr")
468 - )
469 -
470 - # Oracle support
471 - our_conf+=( $(use_with oci8-instant-client oci8) )
472 -
473 - # PDO support
474 - if use pdo ; then
475 - our_conf+=(
476 - $(use_with mssql pdo-dblib)
477 - $(use_with mysql pdo-mysql "${mysqllib}")
478 - $(use_with postgres pdo-pgsql)
479 - $(use_with sqlite pdo-sqlite "${EPREFIX}/usr")
480 - $(use_with firebird pdo-firebird "${EPREFIX}/usr")
481 - $(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr")
482 - $(use_with oci8-instant-client pdo-oci)
483 - )
484 - fi
485 -
486 - # readline/libedit support
487 - our_conf+=(
488 - $(use_with readline readline "${EPREFIX}/usr")
489 - $(use_with libedit libedit "${EPREFIX}/usr")
490 - )
491 -
492 - # Session support
493 - if use session ; then
494 - our_conf+=( $(use_with sharedmem mm "${EPREFIX}/usr") )
495 - else
496 - our_conf+=( $(use_enable session session) )
497 - fi
498 -
499 - # Use pic for shared modules such as apache2's mod_php
500 - our_conf+=( --with-pic )
501 -
502 - # we use the system copy of pcre
503 - # --with-pcre-regex affects ext/pcre
504 - # --with-pcre-dir affects ext/filter and ext/zip
505 - our_conf+=(
506 - --with-pcre-regex="${EPREFIX}/usr"
507 - --with-pcre-dir="${EPREFIX}/usr"
508 - )
509 -
510 - # Catch CFLAGS problems
511 - # Fixes bug #14067.
512 - # Changed order to run it in reverse for bug #32022 and #12021.
513 - replace-cpu-flags "k6*" "i586"
514 -
515 - # Cache the ./configure test results between SAPIs.
516 - our_conf+=( --cache-file="${T}/config.cache" )
517 -
518 - # Support user-passed configuration parameters
519 - our_conf+=( ${EXTRA_ECONF:-} )
520 -
521 - # Support the Apache2 extras, they must be set globally for all
522 - # SAPIs to work correctly, especially for external PHP extensions
523 -
524 - mkdir -p "${WORKDIR}/sapis-build" || die
525 - for one_sapi in $SAPIS ; do
526 - use "${one_sapi}" || continue
527 - php_set_ini_dir "${one_sapi}"
528 -
529 - # The BUILD_DIR variable is used to determine where to output
530 - # the files that autotools creates. This was all originally
531 - # based on the autotools-utils eclass.
532 - BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}"
533 - cp -a "${S}" "${BUILD_DIR}" || die
534 - cd "${BUILD_DIR}" || die
535 -
536 - local sapi_conf=(
537 - --with-config-file-path="${PHP_INI_DIR}"
538 - --with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}"
539 - )
540 -
541 - for sapi in $SAPIS ; do
542 - case "$sapi" in
543 - cli|cgi|embed|fpm)
544 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
545 - sapi_conf+=( "--enable-${sapi}" )
546 - if [[ "fpm" == "${sapi}" ]] ; then
547 - sapi_conf+=(
548 - $(use_with acl fpm-acl)
549 - $(use_with systemd fpm-systemd)
550 - )
551 - fi
552 - else
553 - sapi_conf+=( "--disable-${sapi}" )
554 - fi
555 - ;;
556 -
557 - apache2)
558 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
559 - sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" )
560 - else
561 - sapi_conf+=( --without-apxs2 )
562 - fi
563 - ;;
564 - esac
565 - done
566 -
567 - # Construct the $myeconfargs array by concatenating $our_conf
568 - # (the common args) and $sapi_conf (the SAPI-specific args).
569 - local myeconfargs=( "${our_conf[@]}" )
570 - myeconfargs+=( "${sapi_conf[@]}" )
571 -
572 - pushd "${BUILD_DIR}" > /dev/null || die
573 - econf "${myeconfargs[@]}"
574 - popd > /dev/null || die
575 - done
576 -}
577 -
578 -src_compile() {
579 - # snmp seems to run during src_compile, too (bug #324739)
580 - addpredict /usr/share/snmp/mibs/.index #nowarn
581 - addpredict /var/lib/net-snmp/mib_indexes #nowarn
582 -
583 - for sapi in ${SAPIS} ; do
584 - if use "${sapi}"; then
585 - cd "${WORKDIR}/sapis-build/$sapi" || \
586 - die "Failed to change dir to ${WORKDIR}/sapis-build/$1"
587 - emake
588 - fi
589 - done
590 -}
591 -
592 -src_install() {
593 - # see bug #324739 for what happens when we don't have that
594 - addpredict /usr/share/snmp/mibs/.index #nowarn
595 -
596 - # grab the first SAPI that got built and install common files from there
597 - local first_sapi=""
598 - for sapi in $SAPIS ; do
599 - if use $sapi ; then
600 - first_sapi=$sapi
601 - break
602 - fi
603 - done
604 -
605 - # Makefile forgets to create this before trying to write to it...
606 - dodir "${PHP_DESTDIR#${EPREFIX}}/bin"
607 -
608 - # Install php environment (without any sapis)
609 - cd "${WORKDIR}/sapis-build/$first_sapi" || die
610 - emake INSTALL_ROOT="${D}" \
611 - install-build install-headers install-programs
612 -
613 - local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)"
614 -
615 - # Create the directory where we'll put version-specific php scripts
616 - keepdir "/usr/share/php${PHP_MV}"
617 -
618 - local sapi="", file=""
619 - local sapi_list=""
620 -
621 - for sapi in ${SAPIS}; do
622 - if use "${sapi}" ; then
623 - einfo "Installing SAPI: ${sapi}"
624 - cd "${WORKDIR}/sapis-build/${sapi}" || die
625 -
626 - if [[ "${sapi}" == "apache2" ]] ; then
627 - # We're specifically not using emake install-sapi as libtool
628 - # may cause unnecessary relink failures (see bug #351266)
629 - insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/"
630 - newins ".libs/libphp5$(get_libname)" \
631 - "libphp${PHP_MV}$(get_libname)"
632 - keepdir "/usr/$(get_libdir)/apache2/modules"
633 - else
634 - # needed each time, php_install_ini would reset it
635 - local dest="${PHP_DESTDIR#${EPREFIX}}"
636 - into "${dest}"
637 - case "$sapi" in
638 - cli)
639 - source="sapi/cli/php"
640 - ;;
641 - cgi)
642 - source="sapi/cgi/php-cgi"
643 - ;;
644 - fpm)
645 - source="sapi/fpm/php-fpm"
646 - ;;
647 - embed)
648 - source="libs/libphp${PHP_MV}$(get_libname)"
649 - ;;
650 - *)
651 - die "unhandled sapi in src_install"
652 - ;;
653 - esac
654 -
655 - if [[ "${source}" == *"$(get_libname)" ]]; then
656 - dolib.so "${source}"
657 - else
658 - dobin "${source}"
659 - local name="$(basename ${source})"
660 - dosym "${dest}/bin/${name}" "/usr/bin/${name}${SLOT}"
661 - fi
662 - fi
663 -
664 - php_install_ini "${sapi}"
665 -
666 - # construct correct SAPI string for php-config
667 - # thanks to ferringb for the bash voodoo
668 - if [[ "${sapi}" == "apache2" ]]; then
669 - sapi_list="${sapi_list:+${sapi_list} }apache2handler"
670 - else
671 - sapi_list="${sapi_list:+${sapi_list} }${sapi}"
672 - fi
673 - fi
674 - done
675 -
676 - # Installing opcache module
677 - if use opcache ; then
678 - into "${PHP_DESTDIR#${EPREFIX}}"
679 - dolib.so "modules/opcache$(get_libname)"
680 - fi
681 -
682 - # Install env.d files
683 - newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}"
684 - sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
685 - sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
686 -
687 - # set php-config variable correctly (bug #278439)
688 - sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \
689 - "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die
690 -
691 - if use fpm ; then
692 - if use systemd; then
693 - systemd_newunit "${FILESDIR}/php-fpm_at.service" \
694 - "php-fpm@${SLOT}.service"
695 - else
696 - systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \
697 - "php-fpm@${SLOT}.service"
698 - fi
699 - fi
700 -}
701 -
702 -src_test() {
703 - echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
704 - PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
705 - if [[ ! -x "${PHP_BIN}" ]] ; then
706 - ewarn "Test phase requires USE=cli, skipping"
707 - return
708 - else
709 - export TEST_PHP_EXECUTABLE="${PHP_BIN}"
710 - fi
711 -
712 - if [[ -x "${WORKDIR}/sapis/cgi/php-cgi" ]] ; then
713 - export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis/cgi/php-cgi"
714 - fi
715 -
716 - REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \
717 - "session.save_path=${T}" \
718 - "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \
719 - "session.save_path=${T}"
720 -
721 - for name in ${EXPECTED_TEST_FAILURES}; do
722 - mv "${name}.out" "${name}.out.orig" 2>/dev/null || die
723 - done
724 -
725 - local failed="$(find -name '*.out')"
726 - if [[ ${failed} != "" ]] ; then
727 - ewarn "The following test cases failed unexpectedly:"
728 - for name in ${failed}; do
729 - ewarn " ${name/.out/}"
730 - done
731 - else
732 - einfo "No unexpected test failures, all fine"
733 - fi
734 -
735 - if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
736 - local passed=""
737 - for name in ${EXPECTED_TEST_FAILURES}; do
738 - [[ -f "${name}.diff" ]] && continue
739 - passed="${passed} ${name}"
740 - done
741 - if [[ ${passed} != "" ]] ; then
742 - einfo "The following test cases passed unexpectedly:"
743 - for name in ${passed}; do
744 - ewarn " ${passed}"
745 - done
746 - else
747 - einfo "None of the known-to-fail tests passed, all fine"
748 - fi
749 - fi
750 -}
751 -
752 -pkg_postinst() {
753 - # Output some general info to the user
754 - if use apache2 ; then
755 - elog
756 - elog "To enable PHP in apache, you will need to add \"-D PHP\" to"
757 - elog "your apache2 command. OpenRC users can append that string to"
758 - elog "APACHE2_OPTS in /etc/conf.d/apache2."
759 - elog
760 - elog "The apache module configuration file 70_mod_php.conf is"
761 - elog "provided (and maintained) by eselect-php."
762 - elog
763 - fi
764 -
765 - # Create the symlinks for php
766 - for m in ${SAPIS}; do
767 - [[ ${m} == 'embed' ]] && continue;
768 - if use $m ; then
769 - local ci=$(eselect php show $m)
770 - if [[ -z $ci ]]; then
771 - eselect php set $m php${SLOT} || die
772 - einfo "Switched ${m} to use php:${SLOT}"
773 - einfo
774 - elif [[ $ci != "php${SLOT}" ]] ; then
775 - elog "To switch $m to use php:${SLOT}, run"
776 - elog " eselect php set $m php${SLOT}"
777 - elog
778 - fi
779 - fi
780 - done
781 -
782 - # Remove dead symlinks for SAPIs that were just disabled. For
783 - # example, if the user has the cgi SAPI enabled, then he has an
784 - # eselect-php symlink for it. If he later reinstalls PHP with
785 - # USE="-cgi", that symlink will break. This call to eselect is
786 - # supposed to remove that dead link per bug 572436.
787 - eselect php cleanup || die
788 -
789 - if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then
790 - elog "To build extensions for this version of PHP, you will need to"
791 - elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable."
792 - elog
793 - fi
794 -
795 - # Warn about the removal of PHP_INI_VERSION if the user has it set.
796 - if [[ -n "${PHP_INI_VERSION}" ]]; then
797 - ewarn 'The PHP_INI_VERSION variable has been phased out. You may'
798 - ewarn 'remove it from your configuration at your convenience. See'
799 - ewarn
800 - ewarn ' https://bugs.gentoo.org/611214'
801 - ewarn
802 - ewarn 'for more information.'
803 - fi
804 -
805 - elog "For details on how version slotting works, please see"
806 - elog "the wiki:"
807 - elog
808 - elog " https://wiki.gentoo.org/wiki/PHP"
809 - elog
810 -}
811 -
812 -pkg_postrm() {
813 - # This serves two purposes. First, if we have just removed the last
814 - # installed version of PHP, then this will remove any dead symlinks
815 - # belonging to eselect-php. Second, if a user upgrades slots from
816 - # (say) 5.6 to 7.0 and depcleans the old slot, then this will update
817 - # his existing symlinks to point to the new 7.0 installation. The
818 - # latter is bug 432962.
819 - #
820 - # Note: the eselect-php package may not be installed at this point,
821 - # so we can't die() if this command fails.
822 - eselect php cleanup
823 -}
824
825 diff --git a/dev-lang/php/php-7.0.31.ebuild b/dev-lang/php/php-7.0.31.ebuild
826 deleted file mode 100644
827 index aeaedb772a1..00000000000
828 --- a/dev-lang/php/php-7.0.31.ebuild
829 +++ /dev/null
830 @@ -1,751 +0,0 @@
831 -# Copyright 1999-2018 Gentoo Foundation
832 -# Distributed under the terms of the GNU General Public License v2
833 -
834 -EAPI=6
835 -
836 -inherit flag-o-matic eapi7-ver systemd
837 -
838 -DESCRIPTION="The PHP language runtime engine"
839 -HOMEPAGE="https://secure.php.net/"
840 -SRC_URI="https://secure.php.net/distributions/${P}.tar.xz"
841 -
842 -LICENSE="PHP-3.01
843 - BSD
844 - Zend-2.0
845 - bcmath? ( LGPL-2.1+ )
846 - fpm? ( BSD-2 )
847 - gd? ( gd )
848 - unicode? ( BSD-2 LGPL-2.1 )"
849 -
850 -SLOT="$(ver_cut 1-2)"
851 -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"
852 -
853 -# We can build the following SAPIs in the given order
854 -SAPIS="embed cli cgi fpm apache2 phpdbg"
855 -
856 -# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
857 -IUSE="${IUSE}
858 - ${SAPIS/cli/+cli}
859 - threads"
860 -
861 -IUSE="${IUSE} acl bcmath berkdb bzip2 calendar cdb cjk
862 - coverage crypt +ctype curl debug
863 - enchant exif +fileinfo +filter firebird
864 - flatfile ftp gd gdbm gmp +hash +iconv imap inifile
865 - intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl
866 - mhash mssql mysql mysqli nls
867 - oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
868 - readline recode selinux +session sharedmem
869 - +simplexml snmp soap sockets spell sqlite ssl
870 - sysvipc systemd tidy +tokenizer truetype unicode wddx webp
871 - +xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib"
872 -
873 -# The supported (that is, autodetected) versions of BDB are listed in
874 -# the ./configure script. Other versions *work*, but we need to stick to
875 -# the ones that can be detected to avoid a repeat of bug #564824.
876 -COMMON_DEPEND="
877 - >=app-eselect/eselect-php-0.9.1[apache2?,fpm?]
878 - >=dev-libs/libpcre-8.32[unicode]
879 - fpm? ( acl? ( sys-apps/acl ) )
880 - apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=]
881 - <www-servers/apache-2.4[threads=] ) )
882 - berkdb? ( || ( sys-libs/db:5.3
883 - sys-libs/db:5.1
884 - sys-libs/db:4.8
885 - sys-libs/db:4.7
886 - sys-libs/db:4.6
887 - sys-libs/db:4.5 ) )
888 - bzip2? ( app-arch/bzip2:0= )
889 - cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
890 - cjk? ( !gd? (
891 - virtual/jpeg:0
892 - media-libs/libpng:0=
893 - sys-libs/zlib:0=
894 - ) )
895 - coverage? ( dev-util/lcov )
896 - crypt? ( >=dev-libs/libmcrypt-2.4 )
897 - curl? ( >=net-misc/curl-7.10.5 )
898 - enchant? ( app-text/enchant )
899 - exif? ( !gd? (
900 - virtual/jpeg:0
901 - media-libs/libpng:0=
902 - sys-libs/zlib:0=
903 - ) )
904 - firebird? ( dev-db/firebird )
905 - gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib:0= )
906 - gdbm? ( >=sys-libs/gdbm-1.8.0:0= )
907 - gmp? ( dev-libs/gmp:0= )
908 - iconv? ( virtual/libiconv )
909 - imap? ( virtual/imap-c-client[kerberos=,ssl=] )
910 - intl? ( <dev-libs/icu-61.1:= )
911 - iodbc? ( dev-db/libiodbc )
912 - kerberos? ( virtual/krb5 )
913 - ldap? ( >=net-nds/openldap-1.2.11 )
914 - ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 )
915 - libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) )
916 - mssql? ( dev-db/freetds[mssql] )
917 - nls? ( sys-devel/gettext )
918 - oci8-instant-client? ( dev-db/oracle-instantclient-basic )
919 - odbc? ( >=dev-db/unixODBC-1.8.13 )
920 - postgres? ( dev-db/postgresql:* )
921 - qdbm? ( dev-db/qdbm )
922 - readline? ( sys-libs/readline:0= )
923 - recode? ( app-text/recode )
924 - sharedmem? ( dev-libs/mm )
925 - simplexml? ( >=dev-libs/libxml2-2.6.8 )
926 - snmp? ( >=net-analyzer/net-snmp-5.2 )
927 - soap? ( >=dev-libs/libxml2-2.6.8 )
928 - spell? ( >=app-text/aspell-0.50 )
929 - sqlite? ( >=dev-db/sqlite-3.7.6.3 )
930 - ssl? (
931 - !libressl? ( dev-libs/openssl:0= )
932 - libressl? ( dev-libs/libressl:0= )
933 - )
934 - tidy? ( app-text/htmltidy )
935 - truetype? (
936 - =media-libs/freetype-2*
937 - !gd? (
938 - virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib:0= )
939 - )
940 - unicode? ( dev-libs/oniguruma:= )
941 - wddx? ( >=dev-libs/libxml2-2.6.8 )
942 - webp? ( media-libs/libwebp:0= )
943 - xml? ( >=dev-libs/libxml2-2.6.8 )
944 - xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
945 - xmlreader? ( >=dev-libs/libxml2-2.6.8 )
946 - xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
947 - xpm? (
948 - x11-libs/libXpm
949 - virtual/jpeg:0
950 - media-libs/libpng:0= sys-libs/zlib:0=
951 - )
952 - xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
953 - zip? ( sys-libs/zlib:0= )
954 - zlib? ( sys-libs/zlib:0= )
955 -"
956 -
957 -RDEPEND="${COMMON_DEPEND}
958 - virtual/mta
959 - fpm? (
960 - selinux? ( sec-policy/selinux-phpfpm )
961 - systemd? ( sys-apps/systemd ) )"
962 -
963 -DEPEND="${COMMON_DEPEND}
964 - app-arch/xz-utils
965 - >=sys-devel/bison-3.0.1
966 - sys-devel/flex
967 - >=sys-devel/m4-1.4.3
968 - >=sys-devel/libtool-1.5.18"
969 -
970 -# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
971 -REQUIRED_USE="
972 - || ( cli cgi fpm apache2 embed phpdbg )
973 - cli? ( ^^ ( readline libedit ) )
974 - truetype? ( gd zlib )
975 - webp? ( gd zlib )
976 - cjk? ( gd zlib )
977 - exif? ( gd zlib )
978 - xpm? ( gd zlib )
979 - gd? ( zlib )
980 - simplexml? ( xml )
981 - soap? ( xml )
982 - wddx? ( xml )
983 - xmlrpc? ( || ( xml iconv ) )
984 - xmlreader? ( xml )
985 - xslt? ( xml )
986 - ldap-sasl? ( ldap )
987 - mhash? ( hash )
988 - phar? ( hash )
989 - qdbm? ( !gdbm )
990 - readline? ( !libedit )
991 - recode? ( !imap !mysqli !mysql )
992 - sharedmem? ( !threads )
993 - mysql? ( || ( mysqli pdo ) )
994 -"
995 -
996 -PATCHES=(
997 - "${FILESDIR}/mbstring-oniguruma-6.8.patch"
998 - # hopefully upstream will include the same version check fixes in upcoming releases
999 - # patch added 20180429
1000 - "${FILESDIR}/libressl-compatibility.patch"
1001 - "${FILESDIR}/php-freetype-2.9.1.patch"
1002 -)
1003 -
1004 -PHP_MV="$(ver_cut 1)"
1005 -
1006 -php_install_ini() {
1007 - local phpsapi="${1}"
1008 -
1009 - # work out where we are installing the ini file
1010 - php_set_ini_dir "${phpsapi}"
1011 -
1012 - # Always install the production INI file, bug 611214.
1013 - local phpinisrc="php.ini-production-${phpsapi}"
1014 - cp php.ini-production "${phpinisrc}" || die
1015 -
1016 - # default to /tmp for save_path, bug #282768
1017 - sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die
1018 -
1019 - # Set the extension dir
1020 - sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \
1021 - -i "${phpinisrc}" || die
1022 -
1023 - # Set the include path to point to where we want to find PEAR packages
1024 - sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die
1025 -
1026 - dodir "${PHP_INI_DIR#${EPREFIX}}"
1027 - insinto "${PHP_INI_DIR#${EPREFIX}}"
1028 - newins "${phpinisrc}" php.ini
1029 -
1030 - elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}"
1031 - elog
1032 -
1033 - dodir "${PHP_EXT_INI_DIR#${EPREFIX}}"
1034 - dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}"
1035 -
1036 - if use opcache; then
1037 - elog "Adding opcache to $PHP_EXT_INI_DIR"
1038 - echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \
1039 - "${D}/${PHP_EXT_INI_DIR}"/opcache.ini
1040 - dosym "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" \
1041 - "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini"
1042 - fi
1043 -
1044 - # SAPI-specific handling
1045 - if [[ "${sapi}" == "fpm" ]] ; then
1046 - einfo "Installing FPM config files php-fpm.conf and www.conf"
1047 - insinto "${PHP_INI_DIR#${EPREFIX}}"
1048 - doins sapi/fpm/php-fpm.conf
1049 - insinto "${PHP_INI_DIR#${EPREFIX}}/fpm.d"
1050 - doins sapi/fpm/www.conf
1051 - fi
1052 -
1053 - dodoc php.ini-{development,production}
1054 -}
1055 -
1056 -php_set_ini_dir() {
1057 - PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}"
1058 - PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
1059 - PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
1060 -}
1061 -
1062 -src_prepare() {
1063 - default
1064 -
1065 - # In php-7.x, the FPM pool configuration files have been split off
1066 - # of the main config. By default the pool config files go in
1067 - # e.g. /etc/php-fpm.d, which isn't slotted. So here we move the
1068 - # include directory to a subdirectory "fpm.d" of $PHP_INI_DIR. Later
1069 - # we'll install the pool configuration file "www.conf" there.
1070 - php_set_ini_dir fpm
1071 - sed -i "s~^include=.*$~include=${PHP_INI_DIR}/fpm.d/*.conf~" \
1072 - sapi/fpm/php-fpm.conf.in \
1073 - || die 'failed to move the include directory in php-fpm.conf'
1074 -}
1075 -
1076 -src_configure() {
1077 - addpredict /usr/share/snmp/mibs/.index #nowarn
1078 - addpredict /var/lib/net-snmp/mib_indexes #nowarn
1079 -
1080 - PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
1081 -
1082 - # The php-fpm config file wants localstatedir to be ${EPREFIX}/var
1083 - # and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002.
1084 - local our_conf=(
1085 - --prefix="${PHP_DESTDIR}"
1086 - --mandir="${PHP_DESTDIR}/man"
1087 - --infodir="${PHP_DESTDIR}/info"
1088 - --libdir="${PHP_DESTDIR}/lib"
1089 - --with-libdir="$(get_libdir)"
1090 - --localstatedir="${EPREFIX}/var"
1091 - --without-pear
1092 - $(use_enable threads maintainer-zts)
1093 - )
1094 -
1095 - our_conf+=(
1096 - $(use_enable bcmath bcmath)
1097 - $(use_with bzip2 bz2 "${EPREFIX}/usr")
1098 - $(use_enable calendar calendar)
1099 - $(use_enable coverage gcov)
1100 - $(use_enable ctype ctype)
1101 - $(use_with curl curl "${EPREFIX}/usr")
1102 - $(use_enable xml dom)
1103 - $(use_with enchant enchant "${EPREFIX}/usr")
1104 - $(use_enable exif exif)
1105 - $(use_enable fileinfo fileinfo)
1106 - $(use_enable filter filter)
1107 - $(use_enable ftp ftp)
1108 - $(use_with nls gettext "${EPREFIX}/usr")
1109 - $(use_with gmp gmp "${EPREFIX}/usr")
1110 - $(use_enable hash hash)
1111 - $(use_with mhash mhash "${EPREFIX}/usr")
1112 - $(use_with iconv iconv \
1113 - $(use elibc_glibc || use elibc_musl || use elibc_FreeBSD || echo "${EPREFIX}/usr"))
1114 - $(use_enable intl intl)
1115 - $(use_enable ipv6 ipv6)
1116 - $(use_enable json json)
1117 - $(use_with kerberos kerberos "${EPREFIX}/usr")
1118 - $(use_enable xml libxml)
1119 - $(use_with xml libxml-dir "${EPREFIX}/usr")
1120 - $(use_enable unicode mbstring)
1121 - $(use_with crypt mcrypt "${EPREFIX}/usr")
1122 - $(use_with unicode onig "${EPREFIX}/usr")
1123 - $(use_with ssl openssl "${EPREFIX}/usr")
1124 - $(use_with ssl openssl-dir "${EPREFIX}/usr")
1125 - $(use_enable pcntl pcntl)
1126 - $(use_enable phar phar)
1127 - $(use_enable pdo pdo)
1128 - $(use_enable opcache opcache)
1129 - $(use_with postgres pgsql "${EPREFIX}/usr")
1130 - $(use_enable posix posix)
1131 - $(use_with spell pspell "${EPREFIX}/usr")
1132 - $(use_with recode recode "${EPREFIX}/usr")
1133 - $(use_enable simplexml simplexml)
1134 - $(use_enable sharedmem shmop)
1135 - $(use_with snmp snmp "${EPREFIX}/usr")
1136 - $(use_enable soap soap)
1137 - $(use_enable sockets sockets)
1138 - $(use_with sqlite sqlite3 "${EPREFIX}/usr")
1139 - $(use_enable sysvipc sysvmsg)
1140 - $(use_enable sysvipc sysvsem)
1141 - $(use_enable sysvipc sysvshm)
1142 - $(use_with tidy tidy "${EPREFIX}/usr")
1143 - $(use_enable tokenizer tokenizer)
1144 - $(use_enable wddx wddx)
1145 - $(use_enable xml xml)
1146 - $(use_enable xmlreader xmlreader)
1147 - $(use_enable xmlwriter xmlwriter)
1148 - $(use_with xmlrpc xmlrpc)
1149 - $(use_with xslt xsl "${EPREFIX}/usr")
1150 - $(use_enable zip zip)
1151 - $(use_with zlib zlib "${EPREFIX}/usr")
1152 - $(use_enable debug debug)
1153 - )
1154 -
1155 - # DBA support
1156 - if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
1157 - || use qdbm ; then
1158 - our_conf+=( "--enable-dba${shared}" )
1159 - fi
1160 -
1161 - # DBA drivers support
1162 - our_conf+=(
1163 - $(use_with cdb cdb)
1164 - $(use_with berkdb db4 "${EPREFIX}/usr")
1165 - $(use_enable flatfile flatfile)
1166 - $(use_with gdbm gdbm "${EPREFIX}/usr")
1167 - $(use_enable inifile inifile)
1168 - $(use_with qdbm qdbm "${EPREFIX}/usr")
1169 - )
1170 -
1171 - # Support for the GD graphics library
1172 - our_conf+=(
1173 - $(use_with truetype freetype-dir "${EPREFIX}/usr")
1174 - $(use_enable cjk gd-jis-conv)
1175 - $(use_with gd jpeg-dir "${EPREFIX}/usr")
1176 - $(use_with gd png-dir "${EPREFIX}/usr")
1177 - $(use_with xpm xpm-dir "${EPREFIX}/usr")
1178 - )
1179 - if use webp; then
1180 - our_conf+=( --with-webp-dir="${EPREFIX}/usr" )
1181 - fi
1182 - # enable gd last, so configure can pick up the previous settings
1183 - our_conf+=( $(use_with gd gd) )
1184 -
1185 - # IMAP support
1186 - if use imap ; then
1187 - our_conf+=(
1188 - $(use_with imap imap "${EPREFIX}/usr")
1189 - $(use_with ssl imap-ssl "${EPREFIX}/usr")
1190 - )
1191 - fi
1192 -
1193 - # Interbase/firebird support
1194 - our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") )
1195 -
1196 - # LDAP support
1197 - if use ldap ; then
1198 - our_conf+=(
1199 - $(use_with ldap ldap "${EPREFIX}/usr")
1200 - $(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr")
1201 - )
1202 - fi
1203 -
1204 - # MySQL support
1205 - local mysqllib="mysqlnd"
1206 - local mysqlilib="mysqlnd"
1207 -
1208 - our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
1209 -
1210 - local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock"
1211 - if use mysql || use mysqli ; then
1212 - our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") )
1213 - fi
1214 -
1215 - # ODBC support
1216 - our_conf+=(
1217 - $(use_with odbc unixODBC "${EPREFIX}/usr")
1218 - $(use_with iodbc iodbc "${EPREFIX}/usr")
1219 - )
1220 -
1221 - # Oracle support
1222 - our_conf+=( $(use_with oci8-instant-client oci8) )
1223 -
1224 - # PDO support
1225 - if use pdo ; then
1226 - our_conf+=(
1227 - $(use_with mssql pdo-dblib "${EPREFIX}/usr")
1228 - $(use_with mysql pdo-mysql "${mysqllib}")
1229 - $(use_with postgres pdo-pgsql)
1230 - $(use_with sqlite pdo-sqlite "${EPREFIX}/usr")
1231 - $(use_with firebird pdo-firebird "${EPREFIX}/usr")
1232 - $(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr")
1233 - $(use_with oci8-instant-client pdo-oci)
1234 - )
1235 - fi
1236 -
1237 - # readline/libedit support
1238 - our_conf+=(
1239 - $(use_with readline readline "${EPREFIX}/usr")
1240 - $(use_with libedit libedit "${EPREFIX}/usr")
1241 - )
1242 -
1243 - # Session support
1244 - if use session ; then
1245 - our_conf+=( $(use_with sharedmem mm "${EPREFIX}/usr") )
1246 - else
1247 - our_conf+=( $(use_enable session session) )
1248 - fi
1249 -
1250 - # Use pic for shared modules such as apache2's mod_php
1251 - our_conf+=( --with-pic )
1252 -
1253 - # we use the system copy of pcre
1254 - # --with-pcre-regex affects ext/pcre
1255 - # --with-pcre-dir affects ext/filter and ext/zip
1256 - our_conf+=(
1257 - --with-pcre-regex="${EPREFIX}/usr"
1258 - --with-pcre-dir="${EPREFIX}/usr"
1259 - )
1260 -
1261 - # Catch CFLAGS problems
1262 - # Fixes bug #14067.
1263 - # Changed order to run it in reverse for bug #32022 and #12021.
1264 - replace-cpu-flags "k6*" "i586"
1265 -
1266 - # Cache the ./configure test results between SAPIs.
1267 - our_conf+=( --cache-file="${T}/config.cache" )
1268 -
1269 - # Support user-passed configuration parameters
1270 - our_conf+=( ${EXTRA_ECONF:-} )
1271 -
1272 - # Support the Apache2 extras, they must be set globally for all
1273 - # SAPIs to work correctly, especially for external PHP extensions
1274 -
1275 - mkdir -p "${WORKDIR}/sapis-build" || die
1276 - for one_sapi in $SAPIS ; do
1277 - use "${one_sapi}" || continue
1278 - php_set_ini_dir "${one_sapi}"
1279 -
1280 - # The BUILD_DIR variable is used to determine where to output
1281 - # the files that autotools creates. This was all originally
1282 - # based on the autotools-utils eclass.
1283 - BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}"
1284 - cp -a "${S}" "${BUILD_DIR}" || die
1285 - cd "${BUILD_DIR}" || die
1286 -
1287 - local sapi_conf=(
1288 - --with-config-file-path="${PHP_INI_DIR}"
1289 - --with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}"
1290 - )
1291 -
1292 - for sapi in $SAPIS ; do
1293 - case "$sapi" in
1294 - cli|cgi|embed|fpm|phpdbg)
1295 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
1296 - sapi_conf+=( "--enable-${sapi}" )
1297 - if [[ "fpm" == "${sapi}" ]] ; then
1298 - sapi_conf+=(
1299 - $(use_with acl fpm-acl)
1300 - $(use_with systemd fpm-systemd)
1301 - )
1302 - fi
1303 - else
1304 - sapi_conf+=( "--disable-${sapi}" )
1305 - fi
1306 - ;;
1307 -
1308 - apache2)
1309 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
1310 - sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" )
1311 - else
1312 - sapi_conf+=( --without-apxs2 )
1313 - fi
1314 - ;;
1315 - esac
1316 - done
1317 -
1318 - # Construct the $myeconfargs array by concatenating $our_conf
1319 - # (the common args) and $sapi_conf (the SAPI-specific args).
1320 - local myeconfargs=( "${our_conf[@]}" )
1321 - myeconfargs+=( "${sapi_conf[@]}" )
1322 -
1323 - pushd "${BUILD_DIR}" > /dev/null || die
1324 - econf "${myeconfargs[@]}"
1325 - popd > /dev/null || die
1326 - done
1327 -}
1328 -
1329 -src_compile() {
1330 - # snmp seems to run during src_compile, too (bug #324739)
1331 - addpredict /usr/share/snmp/mibs/.index #nowarn
1332 - addpredict /var/lib/net-snmp/mib_indexes #nowarn
1333 -
1334 - for sapi in ${SAPIS} ; do
1335 - if use "${sapi}"; then
1336 - cd "${WORKDIR}/sapis-build/$sapi" || \
1337 - die "Failed to change dir to ${WORKDIR}/sapis-build/$1"
1338 - emake
1339 - fi
1340 - done
1341 -}
1342 -
1343 -src_install() {
1344 - # see bug #324739 for what happens when we don't have that
1345 - addpredict /usr/share/snmp/mibs/.index #nowarn
1346 -
1347 - # grab the first SAPI that got built and install common files from there
1348 - local first_sapi=""
1349 - for sapi in $SAPIS ; do
1350 - if use $sapi ; then
1351 - first_sapi=$sapi
1352 - break
1353 - fi
1354 - done
1355 -
1356 - # Makefile forgets to create this before trying to write to it...
1357 - dodir "${PHP_DESTDIR#${EPREFIX}}/bin"
1358 -
1359 - # Install php environment (without any sapis)
1360 - cd "${WORKDIR}/sapis-build/$first_sapi" || die
1361 - emake INSTALL_ROOT="${D}" \
1362 - install-build install-headers install-programs
1363 -
1364 - local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)"
1365 -
1366 - # Create the directory where we'll put version-specific php scripts
1367 - keepdir "/usr/share/php${PHP_MV}"
1368 -
1369 - local sapi="", file=""
1370 - local sapi_list=""
1371 -
1372 - for sapi in ${SAPIS}; do
1373 - if use "${sapi}" ; then
1374 - einfo "Installing SAPI: ${sapi}"
1375 - cd "${WORKDIR}/sapis-build/${sapi}" || die
1376 -
1377 - if [[ "${sapi}" == "apache2" ]] ; then
1378 - # We're specifically not using emake install-sapi as libtool
1379 - # may cause unnecessary relink failures (see bug #351266)
1380 - insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/"
1381 - newins ".libs/libphp${PHP_MV}$(get_libname)" \
1382 - "libphp${PHP_MV}$(get_libname)"
1383 - keepdir "/usr/$(get_libdir)/apache2/modules"
1384 - else
1385 - # needed each time, php_install_ini would reset it
1386 - local dest="${PHP_DESTDIR#${EPREFIX}}"
1387 - into "${dest}"
1388 - case "$sapi" in
1389 - cli)
1390 - source="sapi/cli/php"
1391 - ;;
1392 - cgi)
1393 - source="sapi/cgi/php-cgi"
1394 - ;;
1395 - fpm)
1396 - source="sapi/fpm/php-fpm"
1397 - ;;
1398 - embed)
1399 - source="libs/libphp${PHP_MV}$(get_libname)"
1400 - ;;
1401 - phpdbg)
1402 - source="sapi/phpdbg/phpdbg"
1403 - ;;
1404 - *)
1405 - die "unhandled sapi in src_install"
1406 - ;;
1407 - esac
1408 -
1409 - if [[ "${source}" == *"$(get_libname)" ]]; then
1410 - dolib.so "${source}"
1411 - else
1412 - dobin "${source}"
1413 - local name="$(basename ${source})"
1414 - dosym "${dest}/bin/${name}" "/usr/bin/${name}${SLOT}"
1415 - fi
1416 - fi
1417 -
1418 - php_install_ini "${sapi}"
1419 -
1420 - # construct correct SAPI string for php-config
1421 - # thanks to ferringb for the bash voodoo
1422 - if [[ "${sapi}" == "apache2" ]]; then
1423 - sapi_list="${sapi_list:+${sapi_list} }apache2handler"
1424 - else
1425 - sapi_list="${sapi_list:+${sapi_list} }${sapi}"
1426 - fi
1427 - fi
1428 - done
1429 -
1430 - # Installing opcache module
1431 - if use opcache ; then
1432 - into "${PHP_DESTDIR#${EPREFIX}}"
1433 - dolib.so "modules/opcache$(get_libname)"
1434 - fi
1435 -
1436 - # Install env.d files
1437 - newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}"
1438 - sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
1439 - sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
1440 -
1441 - # set php-config variable correctly (bug #278439)
1442 - sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \
1443 - "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die
1444 -
1445 - if use fpm ; then
1446 - if use systemd; then
1447 - systemd_newunit "${FILESDIR}/php-fpm_at.service" \
1448 - "php-fpm@${SLOT}.service"
1449 - else
1450 - systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \
1451 - "php-fpm@${SLOT}.service"
1452 - fi
1453 - fi
1454 -}
1455 -
1456 -src_test() {
1457 - echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
1458 - PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
1459 - if [[ ! -x "${PHP_BIN}" ]] ; then
1460 - ewarn "Test phase requires USE=cli, skipping"
1461 - return
1462 - else
1463 - export TEST_PHP_EXECUTABLE="${PHP_BIN}"
1464 - fi
1465 -
1466 - if [[ -x "${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" ]] ; then
1467 - export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi"
1468 - fi
1469 -
1470 - if [[ -x "${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" ]] ; then
1471 - export TEST_PHPDBG_EXECUTABLE="${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg"
1472 - fi
1473 -
1474 - REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \
1475 - "session.save_path=${T}" \
1476 - "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \
1477 - "session.save_path=${T}"
1478 -
1479 - for name in ${EXPECTED_TEST_FAILURES}; do
1480 - mv "${name}.out" "${name}.out.orig" 2>/dev/null || die
1481 - done
1482 -
1483 - local failed="$(find -name '*.out')"
1484 - if [[ ${failed} != "" ]] ; then
1485 - ewarn "The following test cases failed unexpectedly:"
1486 - for name in ${failed}; do
1487 - ewarn " ${name/.out/}"
1488 - done
1489 - else
1490 - einfo "No unexpected test failures, all fine"
1491 - fi
1492 -
1493 - if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
1494 - local passed=""
1495 - for name in ${EXPECTED_TEST_FAILURES}; do
1496 - [[ -f "${name}.diff" ]] && continue
1497 - passed="${passed} ${name}"
1498 - done
1499 - if [[ ${passed} != "" ]] ; then
1500 - einfo "The following test cases passed unexpectedly:"
1501 - for name in ${passed}; do
1502 - ewarn " ${passed}"
1503 - done
1504 - else
1505 - einfo "None of the known-to-fail tests passed, all fine"
1506 - fi
1507 - fi
1508 -}
1509 -
1510 -pkg_postinst() {
1511 - # Output some general info to the user
1512 - if use apache2 ; then
1513 - elog
1514 - elog "To enable PHP in apache, you will need to add \"-D PHP\" to"
1515 - elog "your apache2 command. OpenRC users can append that string to"
1516 - elog "APACHE2_OPTS in /etc/conf.d/apache2."
1517 - elog
1518 - elog "The apache module configuration file 70_mod_php.conf is"
1519 - elog "provided (and maintained) by eselect-php."
1520 - elog
1521 - fi
1522 -
1523 - # Create the symlinks for php
1524 - for m in ${SAPIS}; do
1525 - [[ ${m} == 'embed' ]] && continue;
1526 - if use $m ; then
1527 - local ci=$(eselect php show $m)
1528 - if [[ -z $ci ]]; then
1529 - eselect php set $m php${SLOT} || die
1530 - einfo "Switched ${m} to use php:${SLOT}"
1531 - einfo
1532 - elif [[ $ci != "php${SLOT}" ]] ; then
1533 - elog "To switch $m to use php:${SLOT}, run"
1534 - elog " eselect php set $m php${SLOT}"
1535 - elog
1536 - fi
1537 - fi
1538 - done
1539 -
1540 - # Remove dead symlinks for SAPIs that were just disabled. For
1541 - # example, if the user has the cgi SAPI enabled, then he has an
1542 - # eselect-php symlink for it. If he later reinstalls PHP with
1543 - # USE="-cgi", that symlink will break. This call to eselect is
1544 - # supposed to remove that dead link per bug 572436.
1545 - eselect php cleanup || die
1546 -
1547 - if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then
1548 - elog "To build extensions for this version of PHP, you will need to"
1549 - elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable."
1550 - elog
1551 - fi
1552 -
1553 - # Warn about the removal of PHP_INI_VERSION if the user has it set.
1554 - if [[ -n "${PHP_INI_VERSION}" ]]; then
1555 - ewarn 'The PHP_INI_VERSION variable has been phased out. You may'
1556 - ewarn 'remove it from your configuration at your convenience. See'
1557 - ewarn
1558 - ewarn ' https://bugs.gentoo.org/611214'
1559 - ewarn
1560 - ewarn 'for more information.'
1561 - fi
1562 -
1563 - elog "For details on how version slotting works, please see"
1564 - elog "the wiki:"
1565 - elog
1566 - elog " https://wiki.gentoo.org/wiki/PHP"
1567 - elog
1568 -}
1569 -
1570 -pkg_postrm() {
1571 - # This serves two purposes. First, if we have just removed the last
1572 - # installed version of PHP, then this will remove any dead symlinks
1573 - # belonging to eselect-php. Second, if a user upgrades slots from
1574 - # (say) 5.6 to 7.0 and depcleans the old slot, then this will update
1575 - # his existing symlinks to point to the new 7.0 installation. The
1576 - # latter is bug 432962.
1577 - #
1578 - # Note: the eselect-php package may not be installed at this point,
1579 - # so we can't die() if this command fails.
1580 - eselect php cleanup
1581 -}
1582
1583 diff --git a/dev-lang/php/php-7.1.20.ebuild b/dev-lang/php/php-7.1.20.ebuild
1584 deleted file mode 100644
1585 index 46badcaed5f..00000000000
1586 --- a/dev-lang/php/php-7.1.20.ebuild
1587 +++ /dev/null
1588 @@ -1,728 +0,0 @@
1589 -# Copyright 1999-2018 Gentoo Foundation
1590 -# Distributed under the terms of the GNU General Public License v2
1591 -
1592 -EAPI=6
1593 -
1594 -inherit flag-o-matic eapi7-ver systemd
1595 -
1596 -DESCRIPTION="The PHP language runtime engine"
1597 -HOMEPAGE="https://secure.php.net/"
1598 -SRC_URI="https://secure.php.net/distributions/${P}.tar.xz"
1599 -
1600 -LICENSE="PHP-3.01
1601 - BSD
1602 - Zend-2.0
1603 - bcmath? ( LGPL-2.1+ )
1604 - fpm? ( BSD-2 )
1605 - gd? ( gd )
1606 - unicode? ( BSD-2 LGPL-2.1 )"
1607 -
1608 -SLOT="$(ver_cut 1-2)"
1609 -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"
1610 -
1611 -# We can build the following SAPIs in the given order
1612 -SAPIS="embed cli cgi fpm apache2 phpdbg"
1613 -
1614 -# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
1615 -IUSE="${IUSE}
1616 - ${SAPIS/cli/+cli}
1617 - threads"
1618 -
1619 -IUSE="${IUSE} acl bcmath berkdb bzip2 calendar cdb cjk
1620 - coverage crypt +ctype curl debug
1621 - enchant exif +fileinfo +filter firebird
1622 - flatfile ftp gd gdbm gmp +hash +iconv imap inifile
1623 - intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl
1624 - mhash mssql mysql mysqli nls
1625 - oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
1626 - readline recode selinux +session session-mm sharedmem
1627 - +simplexml snmp soap sockets spell sqlite ssl
1628 - sysvipc systemd test tidy +tokenizer truetype unicode wddx webp
1629 - +xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib"
1630 -
1631 -# The supported (that is, autodetected) versions of BDB are listed in
1632 -# the ./configure script. Other versions *work*, but we need to stick to
1633 -# the ones that can be detected to avoid a repeat of bug #564824.
1634 -COMMON_DEPEND="
1635 - >=app-eselect/eselect-php-0.9.1[apache2?,fpm?]
1636 - >=dev-libs/libpcre-8.32[unicode]
1637 - fpm? ( acl? ( sys-apps/acl ) )
1638 - apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=]
1639 - <www-servers/apache-2.4[threads=] ) )
1640 - berkdb? ( || ( sys-libs/db:5.3
1641 - sys-libs/db:5.1
1642 - sys-libs/db:4.8
1643 - sys-libs/db:4.7
1644 - sys-libs/db:4.6
1645 - sys-libs/db:4.5 ) )
1646 - bzip2? ( app-arch/bzip2:0= )
1647 - cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
1648 - coverage? ( dev-util/lcov )
1649 - crypt? ( >=dev-libs/libmcrypt-2.4 )
1650 - curl? ( >=net-misc/curl-7.10.5 )
1651 - enchant? ( app-text/enchant )
1652 - firebird? ( dev-db/firebird )
1653 - gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib )
1654 - gdbm? ( >=sys-libs/gdbm-1.8.0:0= )
1655 - gmp? ( dev-libs/gmp:0= )
1656 - iconv? ( virtual/libiconv )
1657 - imap? ( virtual/imap-c-client[kerberos=,ssl=] )
1658 - intl? ( dev-libs/icu:= )
1659 - iodbc? ( dev-db/libiodbc )
1660 - kerberos? ( virtual/krb5 )
1661 - ldap? ( >=net-nds/openldap-1.2.11 )
1662 - ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 )
1663 - libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) )
1664 - mssql? ( dev-db/freetds[mssql] )
1665 - nls? ( sys-devel/gettext )
1666 - oci8-instant-client? ( dev-db/oracle-instantclient-basic )
1667 - odbc? ( >=dev-db/unixODBC-1.8.13 )
1668 - postgres? ( dev-db/postgresql:* )
1669 - qdbm? ( dev-db/qdbm )
1670 - readline? ( sys-libs/readline:0= )
1671 - recode? ( app-text/recode )
1672 - session-mm? ( dev-libs/mm )
1673 - simplexml? ( >=dev-libs/libxml2-2.6.8 )
1674 - snmp? ( >=net-analyzer/net-snmp-5.2 )
1675 - soap? ( >=dev-libs/libxml2-2.6.8 )
1676 - spell? ( >=app-text/aspell-0.50 )
1677 - sqlite? ( >=dev-db/sqlite-3.7.6.3 )
1678 - ssl? (
1679 - !libressl? ( dev-libs/openssl:0= )
1680 - libressl? ( dev-libs/libressl:0= )
1681 - )
1682 - tidy? ( || ( app-text/tidy-html5 app-text/htmltidy ) )
1683 - truetype? ( =media-libs/freetype-2* )
1684 - unicode? ( dev-libs/oniguruma:= )
1685 - wddx? ( >=dev-libs/libxml2-2.6.8 )
1686 - webp? ( media-libs/libwebp:0= )
1687 - xml? ( >=dev-libs/libxml2-2.6.8 )
1688 - xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
1689 - xmlreader? ( >=dev-libs/libxml2-2.6.8 )
1690 - xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
1691 - xpm? ( x11-libs/libXpm )
1692 - xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
1693 - zip? ( sys-libs/zlib:0= )
1694 - zlib? ( sys-libs/zlib:0= )
1695 -"
1696 -
1697 -RDEPEND="${COMMON_DEPEND}
1698 - virtual/mta
1699 - fpm? (
1700 - selinux? ( sec-policy/selinux-phpfpm )
1701 - systemd? ( sys-apps/systemd ) )"
1702 -
1703 -# Bison isn't actually needed when building from a release tarball
1704 -# However, the configure script will warn if it's absent or if you
1705 -# have an incompatible version installed. See bug 593278.
1706 -DEPEND="${COMMON_DEPEND}
1707 - app-arch/xz-utils
1708 - >=sys-devel/bison-3.0.1"
1709 -
1710 -# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
1711 -REQUIRED_USE="
1712 - || ( cli cgi fpm apache2 embed phpdbg )
1713 - cli? ( ^^ ( readline libedit ) )
1714 - truetype? ( gd zlib )
1715 - webp? ( gd zlib )
1716 - cjk? ( gd zlib )
1717 - exif? ( gd zlib )
1718 - xpm? ( gd zlib )
1719 - gd? ( zlib )
1720 - simplexml? ( xml )
1721 - soap? ( xml )
1722 - wddx? ( xml )
1723 - xmlrpc? ( || ( xml iconv ) )
1724 - xmlreader? ( xml )
1725 - xslt? ( xml )
1726 - ldap-sasl? ( ldap )
1727 - mhash? ( hash )
1728 - phar? ( hash )
1729 - qdbm? ( !gdbm )
1730 - readline? ( !libedit )
1731 - recode? ( !imap !mysqli !mysql )
1732 - session-mm? ( session !threads )
1733 - mysql? ( || ( mysqli pdo ) )
1734 -"
1735 -PATCHES=(
1736 - "${FILESDIR}/php-freetype-2.9.1.patch"
1737 -)
1738 -
1739 -PHP_MV="$(ver_cut 1)"
1740 -
1741 -php_install_ini() {
1742 - local phpsapi="${1}"
1743 -
1744 - # work out where we are installing the ini file
1745 - php_set_ini_dir "${phpsapi}"
1746 -
1747 - # Always install the production INI file, bug 611214.
1748 - local phpinisrc="php.ini-production-${phpsapi}"
1749 - cp php.ini-production "${phpinisrc}" || die
1750 -
1751 - # default to /tmp for save_path, bug #282768
1752 - sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die
1753 -
1754 - # Set the extension dir
1755 - sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \
1756 - -i "${phpinisrc}" || die
1757 -
1758 - # Set the include path to point to where we want to find PEAR packages
1759 - sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die
1760 -
1761 - dodir "${PHP_INI_DIR#${EPREFIX}}"
1762 - insinto "${PHP_INI_DIR#${EPREFIX}}"
1763 - newins "${phpinisrc}" php.ini
1764 -
1765 - elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}"
1766 - elog
1767 -
1768 - dodir "${PHP_EXT_INI_DIR#${EPREFIX}}"
1769 - dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}"
1770 -
1771 - if use opcache; then
1772 - elog "Adding opcache to $PHP_EXT_INI_DIR"
1773 - echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \
1774 - "${D}/${PHP_EXT_INI_DIR}"/opcache.ini
1775 - dosym "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" \
1776 - "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini"
1777 - fi
1778 -
1779 - # SAPI-specific handling
1780 - if [[ "${sapi}" == "fpm" ]] ; then
1781 - einfo "Installing FPM config files php-fpm.conf and www.conf"
1782 - insinto "${PHP_INI_DIR#${EPREFIX}}"
1783 - doins sapi/fpm/php-fpm.conf
1784 - insinto "${PHP_INI_DIR#${EPREFIX}}/fpm.d"
1785 - doins sapi/fpm/www.conf
1786 - fi
1787 -
1788 - dodoc php.ini-{development,production}
1789 -}
1790 -
1791 -php_set_ini_dir() {
1792 - PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}"
1793 - PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
1794 - PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
1795 -}
1796 -
1797 -src_prepare() {
1798 - default
1799 -
1800 - # In php-7.x, the FPM pool configuration files have been split off
1801 - # of the main config. By default the pool config files go in
1802 - # e.g. /etc/php-fpm.d, which isn't slotted. So here we move the
1803 - # include directory to a subdirectory "fpm.d" of $PHP_INI_DIR. Later
1804 - # we'll install the pool configuration file "www.conf" there.
1805 - php_set_ini_dir fpm
1806 - sed -i "s~^include=.*$~include=${PHP_INI_DIR}/fpm.d/*.conf~" \
1807 - sapi/fpm/php-fpm.conf.in \
1808 - || die 'failed to move the include directory in php-fpm.conf'
1809 -}
1810 -
1811 -src_configure() {
1812 - addpredict /usr/share/snmp/mibs/.index #nowarn
1813 - addpredict /var/lib/net-snmp/mib_indexes #nowarn
1814 -
1815 - PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
1816 -
1817 - # The php-fpm config file wants localstatedir to be ${EPREFIX}/var
1818 - # and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002.
1819 - local our_conf=(
1820 - --prefix="${PHP_DESTDIR}"
1821 - --mandir="${PHP_DESTDIR}/man"
1822 - --infodir="${PHP_DESTDIR}/info"
1823 - --libdir="${PHP_DESTDIR}/lib"
1824 - --with-libdir="$(get_libdir)"
1825 - --localstatedir="${EPREFIX}/var"
1826 - --without-pear
1827 - $(use_enable threads maintainer-zts)
1828 - )
1829 -
1830 - our_conf+=(
1831 - $(use_enable bcmath bcmath)
1832 - $(use_with bzip2 bz2 "${EPREFIX}/usr")
1833 - $(use_enable calendar calendar)
1834 - $(use_enable coverage gcov)
1835 - $(use_enable ctype ctype)
1836 - $(use_with curl curl "${EPREFIX}/usr")
1837 - $(use_enable xml dom)
1838 - $(use_with enchant enchant "${EPREFIX}/usr")
1839 - $(use_enable exif exif)
1840 - $(use_enable fileinfo fileinfo)
1841 - $(use_enable filter filter)
1842 - $(use_enable ftp ftp)
1843 - $(use_with nls gettext "${EPREFIX}/usr")
1844 - $(use_with gmp gmp "${EPREFIX}/usr")
1845 - $(use_enable hash hash)
1846 - $(use_with mhash mhash "${EPREFIX}/usr")
1847 - $(use_with iconv iconv \
1848 - $(use elibc_glibc || use elibc_musl || use elibc_FreeBSD || echo "${EPREFIX}/usr"))
1849 - $(use_enable intl intl)
1850 - $(use_enable ipv6 ipv6)
1851 - $(use_enable json json)
1852 - $(use_with kerberos kerberos "${EPREFIX}/usr")
1853 - $(use_enable xml libxml)
1854 - $(use_with xml libxml-dir "${EPREFIX}/usr")
1855 - $(use_enable unicode mbstring)
1856 - $(use_with crypt mcrypt "${EPREFIX}/usr")
1857 - $(use_with unicode onig "${EPREFIX}/usr")
1858 - $(use_with ssl openssl "${EPREFIX}/usr")
1859 - $(use_with ssl openssl-dir "${EPREFIX}/usr")
1860 - $(use_enable pcntl pcntl)
1861 - $(use_enable phar phar)
1862 - $(use_enable pdo pdo)
1863 - $(use_enable opcache opcache)
1864 - $(use_with postgres pgsql "${EPREFIX}/usr")
1865 - $(use_enable posix posix)
1866 - $(use_with spell pspell "${EPREFIX}/usr")
1867 - $(use_with recode recode "${EPREFIX}/usr")
1868 - $(use_enable simplexml simplexml)
1869 - $(use_enable sharedmem shmop)
1870 - $(use_with snmp snmp "${EPREFIX}/usr")
1871 - $(use_enable soap soap)
1872 - $(use_enable sockets sockets)
1873 - $(use_with sqlite sqlite3 "${EPREFIX}/usr")
1874 - $(use_enable sysvipc sysvmsg)
1875 - $(use_enable sysvipc sysvsem)
1876 - $(use_enable sysvipc sysvshm)
1877 - $(use_with tidy tidy "${EPREFIX}/usr")
1878 - $(use_enable tokenizer tokenizer)
1879 - $(use_enable wddx wddx)
1880 - $(use_enable xml xml)
1881 - $(use_enable xmlreader xmlreader)
1882 - $(use_enable xmlwriter xmlwriter)
1883 - $(use_with xmlrpc xmlrpc)
1884 - $(use_with xslt xsl "${EPREFIX}/usr")
1885 - $(use_enable zip zip)
1886 - $(use_with zlib zlib "${EPREFIX}/usr")
1887 - $(use_enable debug debug)
1888 - )
1889 -
1890 - # DBA support
1891 - if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
1892 - || use qdbm ; then
1893 - our_conf+=( "--enable-dba${shared}" )
1894 - fi
1895 -
1896 - # DBA drivers support
1897 - our_conf+=(
1898 - $(use_with cdb cdb)
1899 - $(use_with berkdb db4 "${EPREFIX}/usr")
1900 - $(use_enable flatfile flatfile)
1901 - $(use_with gdbm gdbm "${EPREFIX}/usr")
1902 - $(use_enable inifile inifile)
1903 - $(use_with qdbm qdbm "${EPREFIX}/usr")
1904 - )
1905 -
1906 - # Support for the GD graphics library
1907 - our_conf+=(
1908 - $(use_with truetype freetype-dir "${EPREFIX}/usr")
1909 - $(use_enable cjk gd-jis-conv)
1910 - $(use_with gd jpeg-dir "${EPREFIX}/usr")
1911 - $(use_with gd png-dir "${EPREFIX}/usr")
1912 - $(use_with xpm xpm-dir "${EPREFIX}/usr")
1913 - )
1914 - if use webp; then
1915 - our_conf+=( --with-webp-dir="${EPREFIX}/usr" )
1916 - fi
1917 - # enable gd last, so configure can pick up the previous settings
1918 - our_conf+=( $(use_with gd gd) )
1919 -
1920 - # IMAP support
1921 - if use imap ; then
1922 - our_conf+=(
1923 - $(use_with imap imap "${EPREFIX}/usr")
1924 - $(use_with ssl imap-ssl "${EPREFIX}/usr")
1925 - )
1926 - fi
1927 -
1928 - # Interbase/firebird support
1929 - our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") )
1930 -
1931 - # LDAP support
1932 - if use ldap ; then
1933 - our_conf+=(
1934 - $(use_with ldap ldap "${EPREFIX}/usr")
1935 - $(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr")
1936 - )
1937 - fi
1938 -
1939 - # MySQL support
1940 - local mysqllib="mysqlnd"
1941 - local mysqlilib="mysqlnd"
1942 -
1943 - our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
1944 -
1945 - local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock"
1946 - if use mysql || use mysqli ; then
1947 - our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") )
1948 - fi
1949 -
1950 - # ODBC support
1951 - our_conf+=(
1952 - $(use_with odbc unixODBC "${EPREFIX}/usr")
1953 - $(use_with iodbc iodbc "${EPREFIX}/usr")
1954 - )
1955 -
1956 - # Oracle support
1957 - our_conf+=( $(use_with oci8-instant-client oci8) )
1958 -
1959 - # PDO support
1960 - if use pdo ; then
1961 - our_conf+=(
1962 - $(use_with mssql pdo-dblib "${EPREFIX}/usr")
1963 - $(use_with mysql pdo-mysql "${mysqllib}")
1964 - $(use_with postgres pdo-pgsql)
1965 - $(use_with sqlite pdo-sqlite "${EPREFIX}/usr")
1966 - $(use_with firebird pdo-firebird "${EPREFIX}/usr")
1967 - $(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr")
1968 - $(use_with oci8-instant-client pdo-oci)
1969 - )
1970 - fi
1971 -
1972 - # readline/libedit support
1973 - our_conf+=(
1974 - $(use_with readline readline "${EPREFIX}/usr")
1975 - $(use_with libedit libedit "${EPREFIX}/usr")
1976 - )
1977 -
1978 - # Session support
1979 - if use session ; then
1980 - our_conf+=( $(use_with session-mm mm "${EPREFIX}/usr") )
1981 - else
1982 - our_conf+=( $(use_enable session session) )
1983 - fi
1984 -
1985 - # Use pic for shared modules such as apache2's mod_php
1986 - our_conf+=( --with-pic )
1987 -
1988 - # we use the system copy of pcre
1989 - # --with-pcre-regex affects ext/pcre
1990 - # --with-pcre-dir affects ext/filter and ext/zip
1991 - our_conf+=(
1992 - --with-pcre-regex="${EPREFIX}/usr"
1993 - --with-pcre-dir="${EPREFIX}/usr"
1994 - )
1995 -
1996 - # Catch CFLAGS problems
1997 - # Fixes bug #14067.
1998 - # Changed order to run it in reverse for bug #32022 and #12021.
1999 - replace-cpu-flags "k6*" "i586"
2000 -
2001 - # Cache the ./configure test results between SAPIs.
2002 - our_conf+=( --cache-file="${T}/config.cache" )
2003 -
2004 - # Support user-passed configuration parameters
2005 - our_conf+=( ${EXTRA_ECONF:-} )
2006 -
2007 - # Support the Apache2 extras, they must be set globally for all
2008 - # SAPIs to work correctly, especially for external PHP extensions
2009 -
2010 - mkdir -p "${WORKDIR}/sapis-build" || die
2011 - for one_sapi in $SAPIS ; do
2012 - use "${one_sapi}" || continue
2013 - php_set_ini_dir "${one_sapi}"
2014 -
2015 - # The BUILD_DIR variable is used to determine where to output
2016 - # the files that autotools creates. This was all originally
2017 - # based on the autotools-utils eclass.
2018 - BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}"
2019 - cp -a "${S}" "${BUILD_DIR}" || die
2020 - cd "${BUILD_DIR}" || die
2021 -
2022 - local sapi_conf=(
2023 - --with-config-file-path="${PHP_INI_DIR}"
2024 - --with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}"
2025 - )
2026 -
2027 - for sapi in $SAPIS ; do
2028 - case "$sapi" in
2029 - cli|cgi|embed|fpm|phpdbg)
2030 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
2031 - sapi_conf+=( "--enable-${sapi}" )
2032 - if [[ "fpm" == "${sapi}" ]] ; then
2033 - sapi_conf+=(
2034 - $(use_with acl fpm-acl)
2035 - $(use_with systemd fpm-systemd)
2036 - )
2037 - fi
2038 - else
2039 - sapi_conf+=( "--disable-${sapi}" )
2040 - fi
2041 - ;;
2042 -
2043 - apache2)
2044 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
2045 - sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" )
2046 - else
2047 - sapi_conf+=( --without-apxs2 )
2048 - fi
2049 - ;;
2050 - esac
2051 - done
2052 -
2053 - # Construct the $myeconfargs array by concatenating $our_conf
2054 - # (the common args) and $sapi_conf (the SAPI-specific args).
2055 - local myeconfargs=( "${our_conf[@]}" )
2056 - myeconfargs+=( "${sapi_conf[@]}" )
2057 -
2058 - pushd "${BUILD_DIR}" > /dev/null || die
2059 - econf "${myeconfargs[@]}"
2060 - popd > /dev/null || die
2061 - done
2062 -}
2063 -
2064 -src_compile() {
2065 - # snmp seems to run during src_compile, too (bug #324739)
2066 - addpredict /usr/share/snmp/mibs/.index #nowarn
2067 - addpredict /var/lib/net-snmp/mib_indexes #nowarn
2068 -
2069 - for sapi in ${SAPIS} ; do
2070 - if use "${sapi}"; then
2071 - cd "${WORKDIR}/sapis-build/$sapi" || \
2072 - die "Failed to change dir to ${WORKDIR}/sapis-build/$1"
2073 - emake
2074 - fi
2075 - done
2076 -}
2077 -
2078 -src_install() {
2079 - # see bug #324739 for what happens when we don't have that
2080 - addpredict /usr/share/snmp/mibs/.index #nowarn
2081 -
2082 - # grab the first SAPI that got built and install common files from there
2083 - local first_sapi=""
2084 - for sapi in $SAPIS ; do
2085 - if use $sapi ; then
2086 - first_sapi=$sapi
2087 - break
2088 - fi
2089 - done
2090 -
2091 - # Makefile forgets to create this before trying to write to it...
2092 - dodir "${PHP_DESTDIR#${EPREFIX}}/bin"
2093 -
2094 - # Install php environment (without any sapis)
2095 - cd "${WORKDIR}/sapis-build/$first_sapi" || die
2096 - emake INSTALL_ROOT="${D}" \
2097 - install-build install-headers install-programs
2098 -
2099 - local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)"
2100 -
2101 - # Create the directory where we'll put version-specific php scripts
2102 - keepdir "/usr/share/php${PHP_MV}"
2103 -
2104 - local sapi="", file=""
2105 - local sapi_list=""
2106 -
2107 - for sapi in ${SAPIS}; do
2108 - if use "${sapi}" ; then
2109 - einfo "Installing SAPI: ${sapi}"
2110 - cd "${WORKDIR}/sapis-build/${sapi}" || die
2111 -
2112 - if [[ "${sapi}" == "apache2" ]] ; then
2113 - # We're specifically not using emake install-sapi as libtool
2114 - # may cause unnecessary relink failures (see bug #351266)
2115 - insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/"
2116 - newins ".libs/libphp${PHP_MV}$(get_libname)" \
2117 - "libphp${PHP_MV}$(get_libname)"
2118 - keepdir "/usr/$(get_libdir)/apache2/modules"
2119 - else
2120 - # needed each time, php_install_ini would reset it
2121 - local dest="${PHP_DESTDIR#${EPREFIX}}"
2122 - into "${dest}"
2123 - case "$sapi" in
2124 - cli)
2125 - source="sapi/cli/php"
2126 - ;;
2127 - cgi)
2128 - source="sapi/cgi/php-cgi"
2129 - ;;
2130 - fpm)
2131 - source="sapi/fpm/php-fpm"
2132 - ;;
2133 - embed)
2134 - source="libs/libphp${PHP_MV}$(get_libname)"
2135 - ;;
2136 - phpdbg)
2137 - source="sapi/phpdbg/phpdbg"
2138 - ;;
2139 - *)
2140 - die "unhandled sapi in src_install"
2141 - ;;
2142 - esac
2143 -
2144 - if [[ "${source}" == *"$(get_libname)" ]]; then
2145 - dolib.so "${source}"
2146 - else
2147 - dobin "${source}"
2148 - local name="$(basename ${source})"
2149 - dosym "${dest}/bin/${name}" "/usr/bin/${name}${SLOT}"
2150 - fi
2151 - fi
2152 -
2153 - php_install_ini "${sapi}"
2154 -
2155 - # construct correct SAPI string for php-config
2156 - # thanks to ferringb for the bash voodoo
2157 - if [[ "${sapi}" == "apache2" ]]; then
2158 - sapi_list="${sapi_list:+${sapi_list} }apache2handler"
2159 - else
2160 - sapi_list="${sapi_list:+${sapi_list} }${sapi}"
2161 - fi
2162 - fi
2163 - done
2164 -
2165 - # Installing opcache module
2166 - if use opcache ; then
2167 - into "${PHP_DESTDIR#${EPREFIX}}"
2168 - dolib.so "modules/opcache$(get_libname)"
2169 - fi
2170 -
2171 - # Install env.d files
2172 - newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}"
2173 - sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
2174 - sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
2175 -
2176 - # set php-config variable correctly (bug #278439)
2177 - sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \
2178 - "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die
2179 -
2180 - if use fpm ; then
2181 - if use systemd; then
2182 - systemd_newunit "${FILESDIR}/php-fpm_at.service" \
2183 - "php-fpm@${SLOT}.service"
2184 - else
2185 - systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \
2186 - "php-fpm@${SLOT}.service"
2187 - fi
2188 - fi
2189 -}
2190 -
2191 -src_test() {
2192 - echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
2193 - PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
2194 - if [[ ! -x "${PHP_BIN}" ]] ; then
2195 - ewarn "Test phase requires USE=cli, skipping"
2196 - return
2197 - else
2198 - export TEST_PHP_EXECUTABLE="${PHP_BIN}"
2199 - fi
2200 -
2201 - if [[ -x "${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" ]] ; then
2202 - export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi"
2203 - fi
2204 -
2205 - if [[ -x "${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" ]] ; then
2206 - export TEST_PHPDBG_EXECUTABLE="${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg"
2207 - fi
2208 -
2209 - REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \
2210 - "session.save_path=${T}" \
2211 - "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \
2212 - "session.save_path=${T}"
2213 -
2214 - for name in ${EXPECTED_TEST_FAILURES}; do
2215 - mv "${name}.out" "${name}.out.orig" 2>/dev/null || die
2216 - done
2217 -
2218 - local failed="$(find -name '*.out')"
2219 - if [[ ${failed} != "" ]] ; then
2220 - ewarn "The following test cases failed unexpectedly:"
2221 - for name in ${failed}; do
2222 - ewarn " ${name/.out/}"
2223 - done
2224 - else
2225 - einfo "No unexpected test failures, all fine"
2226 - fi
2227 -
2228 - if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
2229 - local passed=""
2230 - for name in ${EXPECTED_TEST_FAILURES}; do
2231 - [[ -f "${name}.diff" ]] && continue
2232 - passed="${passed} ${name}"
2233 - done
2234 - if [[ ${passed} != "" ]] ; then
2235 - einfo "The following test cases passed unexpectedly:"
2236 - for name in ${passed}; do
2237 - ewarn " ${passed}"
2238 - done
2239 - else
2240 - einfo "None of the known-to-fail tests passed, all fine"
2241 - fi
2242 - fi
2243 -}
2244 -
2245 -pkg_postinst() {
2246 - # Output some general info to the user
2247 - if use apache2 ; then
2248 - elog
2249 - elog "To enable PHP in apache, you will need to add \"-D PHP\" to"
2250 - elog "your apache2 command. OpenRC users can append that string to"
2251 - elog "APACHE2_OPTS in /etc/conf.d/apache2."
2252 - elog
2253 - elog "The apache module configuration file 70_mod_php.conf is"
2254 - elog "provided (and maintained) by eselect-php."
2255 - elog
2256 - fi
2257 -
2258 - # Create the symlinks for php
2259 - for m in ${SAPIS}; do
2260 - [[ ${m} == 'embed' ]] && continue;
2261 - if use $m ; then
2262 - local ci=$(eselect php show $m)
2263 - if [[ -z $ci ]]; then
2264 - eselect php set $m php${SLOT} || die
2265 - einfo "Switched ${m} to use php:${SLOT}"
2266 - einfo
2267 - elif [[ $ci != "php${SLOT}" ]] ; then
2268 - elog "To switch $m to use php:${SLOT}, run"
2269 - elog " eselect php set $m php${SLOT}"
2270 - elog
2271 - fi
2272 - fi
2273 - done
2274 -
2275 - # Remove dead symlinks for SAPIs that were just disabled. For
2276 - # example, if the user has the cgi SAPI enabled, then he has an
2277 - # eselect-php symlink for it. If he later reinstalls PHP with
2278 - # USE="-cgi", that symlink will break. This call to eselect is
2279 - # supposed to remove that dead link per bug 572436.
2280 - eselect php cleanup || die
2281 -
2282 - if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then
2283 - elog "To build extensions for this version of PHP, you will need to"
2284 - elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable."
2285 - elog
2286 - fi
2287 -
2288 - # Warn about the removal of PHP_INI_VERSION if the user has it set.
2289 - if [[ -n "${PHP_INI_VERSION}" ]]; then
2290 - ewarn 'The PHP_INI_VERSION variable has been phased out. You may'
2291 - ewarn 'remove it from your configuration at your convenience. See'
2292 - ewarn
2293 - ewarn ' https://bugs.gentoo.org/611214'
2294 - ewarn
2295 - ewarn 'for more information.'
2296 - fi
2297 -
2298 - elog "For details on how version slotting works, please see"
2299 - elog "the wiki:"
2300 - elog
2301 - elog " https://wiki.gentoo.org/wiki/PHP"
2302 - elog
2303 -}
2304 -
2305 -pkg_postrm() {
2306 - # This serves two purposes. First, if we have just removed the last
2307 - # installed version of PHP, then this will remove any dead symlinks
2308 - # belonging to eselect-php. Second, if a user upgrades slots from
2309 - # (say) 5.6 to 7.0 and depcleans the old slot, then this will update
2310 - # his existing symlinks to point to the new 7.0 installation. The
2311 - # latter is bug 432962.
2312 - #
2313 - # Note: the eselect-php package may not be installed at this point,
2314 - # so we can't die() if this command fails.
2315 - eselect php cleanup
2316 -}
2317
2318 diff --git a/dev-lang/php/php-7.1.21.ebuild b/dev-lang/php/php-7.1.21.ebuild
2319 deleted file mode 100644
2320 index 46badcaed5f..00000000000
2321 --- a/dev-lang/php/php-7.1.21.ebuild
2322 +++ /dev/null
2323 @@ -1,728 +0,0 @@
2324 -# Copyright 1999-2018 Gentoo Foundation
2325 -# Distributed under the terms of the GNU General Public License v2
2326 -
2327 -EAPI=6
2328 -
2329 -inherit flag-o-matic eapi7-ver systemd
2330 -
2331 -DESCRIPTION="The PHP language runtime engine"
2332 -HOMEPAGE="https://secure.php.net/"
2333 -SRC_URI="https://secure.php.net/distributions/${P}.tar.xz"
2334 -
2335 -LICENSE="PHP-3.01
2336 - BSD
2337 - Zend-2.0
2338 - bcmath? ( LGPL-2.1+ )
2339 - fpm? ( BSD-2 )
2340 - gd? ( gd )
2341 - unicode? ( BSD-2 LGPL-2.1 )"
2342 -
2343 -SLOT="$(ver_cut 1-2)"
2344 -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"
2345 -
2346 -# We can build the following SAPIs in the given order
2347 -SAPIS="embed cli cgi fpm apache2 phpdbg"
2348 -
2349 -# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
2350 -IUSE="${IUSE}
2351 - ${SAPIS/cli/+cli}
2352 - threads"
2353 -
2354 -IUSE="${IUSE} acl bcmath berkdb bzip2 calendar cdb cjk
2355 - coverage crypt +ctype curl debug
2356 - enchant exif +fileinfo +filter firebird
2357 - flatfile ftp gd gdbm gmp +hash +iconv imap inifile
2358 - intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl
2359 - mhash mssql mysql mysqli nls
2360 - oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
2361 - readline recode selinux +session session-mm sharedmem
2362 - +simplexml snmp soap sockets spell sqlite ssl
2363 - sysvipc systemd test tidy +tokenizer truetype unicode wddx webp
2364 - +xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib"
2365 -
2366 -# The supported (that is, autodetected) versions of BDB are listed in
2367 -# the ./configure script. Other versions *work*, but we need to stick to
2368 -# the ones that can be detected to avoid a repeat of bug #564824.
2369 -COMMON_DEPEND="
2370 - >=app-eselect/eselect-php-0.9.1[apache2?,fpm?]
2371 - >=dev-libs/libpcre-8.32[unicode]
2372 - fpm? ( acl? ( sys-apps/acl ) )
2373 - apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=]
2374 - <www-servers/apache-2.4[threads=] ) )
2375 - berkdb? ( || ( sys-libs/db:5.3
2376 - sys-libs/db:5.1
2377 - sys-libs/db:4.8
2378 - sys-libs/db:4.7
2379 - sys-libs/db:4.6
2380 - sys-libs/db:4.5 ) )
2381 - bzip2? ( app-arch/bzip2:0= )
2382 - cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
2383 - coverage? ( dev-util/lcov )
2384 - crypt? ( >=dev-libs/libmcrypt-2.4 )
2385 - curl? ( >=net-misc/curl-7.10.5 )
2386 - enchant? ( app-text/enchant )
2387 - firebird? ( dev-db/firebird )
2388 - gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib )
2389 - gdbm? ( >=sys-libs/gdbm-1.8.0:0= )
2390 - gmp? ( dev-libs/gmp:0= )
2391 - iconv? ( virtual/libiconv )
2392 - imap? ( virtual/imap-c-client[kerberos=,ssl=] )
2393 - intl? ( dev-libs/icu:= )
2394 - iodbc? ( dev-db/libiodbc )
2395 - kerberos? ( virtual/krb5 )
2396 - ldap? ( >=net-nds/openldap-1.2.11 )
2397 - ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 )
2398 - libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) )
2399 - mssql? ( dev-db/freetds[mssql] )
2400 - nls? ( sys-devel/gettext )
2401 - oci8-instant-client? ( dev-db/oracle-instantclient-basic )
2402 - odbc? ( >=dev-db/unixODBC-1.8.13 )
2403 - postgres? ( dev-db/postgresql:* )
2404 - qdbm? ( dev-db/qdbm )
2405 - readline? ( sys-libs/readline:0= )
2406 - recode? ( app-text/recode )
2407 - session-mm? ( dev-libs/mm )
2408 - simplexml? ( >=dev-libs/libxml2-2.6.8 )
2409 - snmp? ( >=net-analyzer/net-snmp-5.2 )
2410 - soap? ( >=dev-libs/libxml2-2.6.8 )
2411 - spell? ( >=app-text/aspell-0.50 )
2412 - sqlite? ( >=dev-db/sqlite-3.7.6.3 )
2413 - ssl? (
2414 - !libressl? ( dev-libs/openssl:0= )
2415 - libressl? ( dev-libs/libressl:0= )
2416 - )
2417 - tidy? ( || ( app-text/tidy-html5 app-text/htmltidy ) )
2418 - truetype? ( =media-libs/freetype-2* )
2419 - unicode? ( dev-libs/oniguruma:= )
2420 - wddx? ( >=dev-libs/libxml2-2.6.8 )
2421 - webp? ( media-libs/libwebp:0= )
2422 - xml? ( >=dev-libs/libxml2-2.6.8 )
2423 - xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
2424 - xmlreader? ( >=dev-libs/libxml2-2.6.8 )
2425 - xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
2426 - xpm? ( x11-libs/libXpm )
2427 - xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
2428 - zip? ( sys-libs/zlib:0= )
2429 - zlib? ( sys-libs/zlib:0= )
2430 -"
2431 -
2432 -RDEPEND="${COMMON_DEPEND}
2433 - virtual/mta
2434 - fpm? (
2435 - selinux? ( sec-policy/selinux-phpfpm )
2436 - systemd? ( sys-apps/systemd ) )"
2437 -
2438 -# Bison isn't actually needed when building from a release tarball
2439 -# However, the configure script will warn if it's absent or if you
2440 -# have an incompatible version installed. See bug 593278.
2441 -DEPEND="${COMMON_DEPEND}
2442 - app-arch/xz-utils
2443 - >=sys-devel/bison-3.0.1"
2444 -
2445 -# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
2446 -REQUIRED_USE="
2447 - || ( cli cgi fpm apache2 embed phpdbg )
2448 - cli? ( ^^ ( readline libedit ) )
2449 - truetype? ( gd zlib )
2450 - webp? ( gd zlib )
2451 - cjk? ( gd zlib )
2452 - exif? ( gd zlib )
2453 - xpm? ( gd zlib )
2454 - gd? ( zlib )
2455 - simplexml? ( xml )
2456 - soap? ( xml )
2457 - wddx? ( xml )
2458 - xmlrpc? ( || ( xml iconv ) )
2459 - xmlreader? ( xml )
2460 - xslt? ( xml )
2461 - ldap-sasl? ( ldap )
2462 - mhash? ( hash )
2463 - phar? ( hash )
2464 - qdbm? ( !gdbm )
2465 - readline? ( !libedit )
2466 - recode? ( !imap !mysqli !mysql )
2467 - session-mm? ( session !threads )
2468 - mysql? ( || ( mysqli pdo ) )
2469 -"
2470 -PATCHES=(
2471 - "${FILESDIR}/php-freetype-2.9.1.patch"
2472 -)
2473 -
2474 -PHP_MV="$(ver_cut 1)"
2475 -
2476 -php_install_ini() {
2477 - local phpsapi="${1}"
2478 -
2479 - # work out where we are installing the ini file
2480 - php_set_ini_dir "${phpsapi}"
2481 -
2482 - # Always install the production INI file, bug 611214.
2483 - local phpinisrc="php.ini-production-${phpsapi}"
2484 - cp php.ini-production "${phpinisrc}" || die
2485 -
2486 - # default to /tmp for save_path, bug #282768
2487 - sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die
2488 -
2489 - # Set the extension dir
2490 - sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \
2491 - -i "${phpinisrc}" || die
2492 -
2493 - # Set the include path to point to where we want to find PEAR packages
2494 - sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die
2495 -
2496 - dodir "${PHP_INI_DIR#${EPREFIX}}"
2497 - insinto "${PHP_INI_DIR#${EPREFIX}}"
2498 - newins "${phpinisrc}" php.ini
2499 -
2500 - elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}"
2501 - elog
2502 -
2503 - dodir "${PHP_EXT_INI_DIR#${EPREFIX}}"
2504 - dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}"
2505 -
2506 - if use opcache; then
2507 - elog "Adding opcache to $PHP_EXT_INI_DIR"
2508 - echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \
2509 - "${D}/${PHP_EXT_INI_DIR}"/opcache.ini
2510 - dosym "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" \
2511 - "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini"
2512 - fi
2513 -
2514 - # SAPI-specific handling
2515 - if [[ "${sapi}" == "fpm" ]] ; then
2516 - einfo "Installing FPM config files php-fpm.conf and www.conf"
2517 - insinto "${PHP_INI_DIR#${EPREFIX}}"
2518 - doins sapi/fpm/php-fpm.conf
2519 - insinto "${PHP_INI_DIR#${EPREFIX}}/fpm.d"
2520 - doins sapi/fpm/www.conf
2521 - fi
2522 -
2523 - dodoc php.ini-{development,production}
2524 -}
2525 -
2526 -php_set_ini_dir() {
2527 - PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}"
2528 - PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
2529 - PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
2530 -}
2531 -
2532 -src_prepare() {
2533 - default
2534 -
2535 - # In php-7.x, the FPM pool configuration files have been split off
2536 - # of the main config. By default the pool config files go in
2537 - # e.g. /etc/php-fpm.d, which isn't slotted. So here we move the
2538 - # include directory to a subdirectory "fpm.d" of $PHP_INI_DIR. Later
2539 - # we'll install the pool configuration file "www.conf" there.
2540 - php_set_ini_dir fpm
2541 - sed -i "s~^include=.*$~include=${PHP_INI_DIR}/fpm.d/*.conf~" \
2542 - sapi/fpm/php-fpm.conf.in \
2543 - || die 'failed to move the include directory in php-fpm.conf'
2544 -}
2545 -
2546 -src_configure() {
2547 - addpredict /usr/share/snmp/mibs/.index #nowarn
2548 - addpredict /var/lib/net-snmp/mib_indexes #nowarn
2549 -
2550 - PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
2551 -
2552 - # The php-fpm config file wants localstatedir to be ${EPREFIX}/var
2553 - # and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002.
2554 - local our_conf=(
2555 - --prefix="${PHP_DESTDIR}"
2556 - --mandir="${PHP_DESTDIR}/man"
2557 - --infodir="${PHP_DESTDIR}/info"
2558 - --libdir="${PHP_DESTDIR}/lib"
2559 - --with-libdir="$(get_libdir)"
2560 - --localstatedir="${EPREFIX}/var"
2561 - --without-pear
2562 - $(use_enable threads maintainer-zts)
2563 - )
2564 -
2565 - our_conf+=(
2566 - $(use_enable bcmath bcmath)
2567 - $(use_with bzip2 bz2 "${EPREFIX}/usr")
2568 - $(use_enable calendar calendar)
2569 - $(use_enable coverage gcov)
2570 - $(use_enable ctype ctype)
2571 - $(use_with curl curl "${EPREFIX}/usr")
2572 - $(use_enable xml dom)
2573 - $(use_with enchant enchant "${EPREFIX}/usr")
2574 - $(use_enable exif exif)
2575 - $(use_enable fileinfo fileinfo)
2576 - $(use_enable filter filter)
2577 - $(use_enable ftp ftp)
2578 - $(use_with nls gettext "${EPREFIX}/usr")
2579 - $(use_with gmp gmp "${EPREFIX}/usr")
2580 - $(use_enable hash hash)
2581 - $(use_with mhash mhash "${EPREFIX}/usr")
2582 - $(use_with iconv iconv \
2583 - $(use elibc_glibc || use elibc_musl || use elibc_FreeBSD || echo "${EPREFIX}/usr"))
2584 - $(use_enable intl intl)
2585 - $(use_enable ipv6 ipv6)
2586 - $(use_enable json json)
2587 - $(use_with kerberos kerberos "${EPREFIX}/usr")
2588 - $(use_enable xml libxml)
2589 - $(use_with xml libxml-dir "${EPREFIX}/usr")
2590 - $(use_enable unicode mbstring)
2591 - $(use_with crypt mcrypt "${EPREFIX}/usr")
2592 - $(use_with unicode onig "${EPREFIX}/usr")
2593 - $(use_with ssl openssl "${EPREFIX}/usr")
2594 - $(use_with ssl openssl-dir "${EPREFIX}/usr")
2595 - $(use_enable pcntl pcntl)
2596 - $(use_enable phar phar)
2597 - $(use_enable pdo pdo)
2598 - $(use_enable opcache opcache)
2599 - $(use_with postgres pgsql "${EPREFIX}/usr")
2600 - $(use_enable posix posix)
2601 - $(use_with spell pspell "${EPREFIX}/usr")
2602 - $(use_with recode recode "${EPREFIX}/usr")
2603 - $(use_enable simplexml simplexml)
2604 - $(use_enable sharedmem shmop)
2605 - $(use_with snmp snmp "${EPREFIX}/usr")
2606 - $(use_enable soap soap)
2607 - $(use_enable sockets sockets)
2608 - $(use_with sqlite sqlite3 "${EPREFIX}/usr")
2609 - $(use_enable sysvipc sysvmsg)
2610 - $(use_enable sysvipc sysvsem)
2611 - $(use_enable sysvipc sysvshm)
2612 - $(use_with tidy tidy "${EPREFIX}/usr")
2613 - $(use_enable tokenizer tokenizer)
2614 - $(use_enable wddx wddx)
2615 - $(use_enable xml xml)
2616 - $(use_enable xmlreader xmlreader)
2617 - $(use_enable xmlwriter xmlwriter)
2618 - $(use_with xmlrpc xmlrpc)
2619 - $(use_with xslt xsl "${EPREFIX}/usr")
2620 - $(use_enable zip zip)
2621 - $(use_with zlib zlib "${EPREFIX}/usr")
2622 - $(use_enable debug debug)
2623 - )
2624 -
2625 - # DBA support
2626 - if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
2627 - || use qdbm ; then
2628 - our_conf+=( "--enable-dba${shared}" )
2629 - fi
2630 -
2631 - # DBA drivers support
2632 - our_conf+=(
2633 - $(use_with cdb cdb)
2634 - $(use_with berkdb db4 "${EPREFIX}/usr")
2635 - $(use_enable flatfile flatfile)
2636 - $(use_with gdbm gdbm "${EPREFIX}/usr")
2637 - $(use_enable inifile inifile)
2638 - $(use_with qdbm qdbm "${EPREFIX}/usr")
2639 - )
2640 -
2641 - # Support for the GD graphics library
2642 - our_conf+=(
2643 - $(use_with truetype freetype-dir "${EPREFIX}/usr")
2644 - $(use_enable cjk gd-jis-conv)
2645 - $(use_with gd jpeg-dir "${EPREFIX}/usr")
2646 - $(use_with gd png-dir "${EPREFIX}/usr")
2647 - $(use_with xpm xpm-dir "${EPREFIX}/usr")
2648 - )
2649 - if use webp; then
2650 - our_conf+=( --with-webp-dir="${EPREFIX}/usr" )
2651 - fi
2652 - # enable gd last, so configure can pick up the previous settings
2653 - our_conf+=( $(use_with gd gd) )
2654 -
2655 - # IMAP support
2656 - if use imap ; then
2657 - our_conf+=(
2658 - $(use_with imap imap "${EPREFIX}/usr")
2659 - $(use_with ssl imap-ssl "${EPREFIX}/usr")
2660 - )
2661 - fi
2662 -
2663 - # Interbase/firebird support
2664 - our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") )
2665 -
2666 - # LDAP support
2667 - if use ldap ; then
2668 - our_conf+=(
2669 - $(use_with ldap ldap "${EPREFIX}/usr")
2670 - $(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr")
2671 - )
2672 - fi
2673 -
2674 - # MySQL support
2675 - local mysqllib="mysqlnd"
2676 - local mysqlilib="mysqlnd"
2677 -
2678 - our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
2679 -
2680 - local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock"
2681 - if use mysql || use mysqli ; then
2682 - our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") )
2683 - fi
2684 -
2685 - # ODBC support
2686 - our_conf+=(
2687 - $(use_with odbc unixODBC "${EPREFIX}/usr")
2688 - $(use_with iodbc iodbc "${EPREFIX}/usr")
2689 - )
2690 -
2691 - # Oracle support
2692 - our_conf+=( $(use_with oci8-instant-client oci8) )
2693 -
2694 - # PDO support
2695 - if use pdo ; then
2696 - our_conf+=(
2697 - $(use_with mssql pdo-dblib "${EPREFIX}/usr")
2698 - $(use_with mysql pdo-mysql "${mysqllib}")
2699 - $(use_with postgres pdo-pgsql)
2700 - $(use_with sqlite pdo-sqlite "${EPREFIX}/usr")
2701 - $(use_with firebird pdo-firebird "${EPREFIX}/usr")
2702 - $(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr")
2703 - $(use_with oci8-instant-client pdo-oci)
2704 - )
2705 - fi
2706 -
2707 - # readline/libedit support
2708 - our_conf+=(
2709 - $(use_with readline readline "${EPREFIX}/usr")
2710 - $(use_with libedit libedit "${EPREFIX}/usr")
2711 - )
2712 -
2713 - # Session support
2714 - if use session ; then
2715 - our_conf+=( $(use_with session-mm mm "${EPREFIX}/usr") )
2716 - else
2717 - our_conf+=( $(use_enable session session) )
2718 - fi
2719 -
2720 - # Use pic for shared modules such as apache2's mod_php
2721 - our_conf+=( --with-pic )
2722 -
2723 - # we use the system copy of pcre
2724 - # --with-pcre-regex affects ext/pcre
2725 - # --with-pcre-dir affects ext/filter and ext/zip
2726 - our_conf+=(
2727 - --with-pcre-regex="${EPREFIX}/usr"
2728 - --with-pcre-dir="${EPREFIX}/usr"
2729 - )
2730 -
2731 - # Catch CFLAGS problems
2732 - # Fixes bug #14067.
2733 - # Changed order to run it in reverse for bug #32022 and #12021.
2734 - replace-cpu-flags "k6*" "i586"
2735 -
2736 - # Cache the ./configure test results between SAPIs.
2737 - our_conf+=( --cache-file="${T}/config.cache" )
2738 -
2739 - # Support user-passed configuration parameters
2740 - our_conf+=( ${EXTRA_ECONF:-} )
2741 -
2742 - # Support the Apache2 extras, they must be set globally for all
2743 - # SAPIs to work correctly, especially for external PHP extensions
2744 -
2745 - mkdir -p "${WORKDIR}/sapis-build" || die
2746 - for one_sapi in $SAPIS ; do
2747 - use "${one_sapi}" || continue
2748 - php_set_ini_dir "${one_sapi}"
2749 -
2750 - # The BUILD_DIR variable is used to determine where to output
2751 - # the files that autotools creates. This was all originally
2752 - # based on the autotools-utils eclass.
2753 - BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}"
2754 - cp -a "${S}" "${BUILD_DIR}" || die
2755 - cd "${BUILD_DIR}" || die
2756 -
2757 - local sapi_conf=(
2758 - --with-config-file-path="${PHP_INI_DIR}"
2759 - --with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}"
2760 - )
2761 -
2762 - for sapi in $SAPIS ; do
2763 - case "$sapi" in
2764 - cli|cgi|embed|fpm|phpdbg)
2765 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
2766 - sapi_conf+=( "--enable-${sapi}" )
2767 - if [[ "fpm" == "${sapi}" ]] ; then
2768 - sapi_conf+=(
2769 - $(use_with acl fpm-acl)
2770 - $(use_with systemd fpm-systemd)
2771 - )
2772 - fi
2773 - else
2774 - sapi_conf+=( "--disable-${sapi}" )
2775 - fi
2776 - ;;
2777 -
2778 - apache2)
2779 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
2780 - sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" )
2781 - else
2782 - sapi_conf+=( --without-apxs2 )
2783 - fi
2784 - ;;
2785 - esac
2786 - done
2787 -
2788 - # Construct the $myeconfargs array by concatenating $our_conf
2789 - # (the common args) and $sapi_conf (the SAPI-specific args).
2790 - local myeconfargs=( "${our_conf[@]}" )
2791 - myeconfargs+=( "${sapi_conf[@]}" )
2792 -
2793 - pushd "${BUILD_DIR}" > /dev/null || die
2794 - econf "${myeconfargs[@]}"
2795 - popd > /dev/null || die
2796 - done
2797 -}
2798 -
2799 -src_compile() {
2800 - # snmp seems to run during src_compile, too (bug #324739)
2801 - addpredict /usr/share/snmp/mibs/.index #nowarn
2802 - addpredict /var/lib/net-snmp/mib_indexes #nowarn
2803 -
2804 - for sapi in ${SAPIS} ; do
2805 - if use "${sapi}"; then
2806 - cd "${WORKDIR}/sapis-build/$sapi" || \
2807 - die "Failed to change dir to ${WORKDIR}/sapis-build/$1"
2808 - emake
2809 - fi
2810 - done
2811 -}
2812 -
2813 -src_install() {
2814 - # see bug #324739 for what happens when we don't have that
2815 - addpredict /usr/share/snmp/mibs/.index #nowarn
2816 -
2817 - # grab the first SAPI that got built and install common files from there
2818 - local first_sapi=""
2819 - for sapi in $SAPIS ; do
2820 - if use $sapi ; then
2821 - first_sapi=$sapi
2822 - break
2823 - fi
2824 - done
2825 -
2826 - # Makefile forgets to create this before trying to write to it...
2827 - dodir "${PHP_DESTDIR#${EPREFIX}}/bin"
2828 -
2829 - # Install php environment (without any sapis)
2830 - cd "${WORKDIR}/sapis-build/$first_sapi" || die
2831 - emake INSTALL_ROOT="${D}" \
2832 - install-build install-headers install-programs
2833 -
2834 - local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)"
2835 -
2836 - # Create the directory where we'll put version-specific php scripts
2837 - keepdir "/usr/share/php${PHP_MV}"
2838 -
2839 - local sapi="", file=""
2840 - local sapi_list=""
2841 -
2842 - for sapi in ${SAPIS}; do
2843 - if use "${sapi}" ; then
2844 - einfo "Installing SAPI: ${sapi}"
2845 - cd "${WORKDIR}/sapis-build/${sapi}" || die
2846 -
2847 - if [[ "${sapi}" == "apache2" ]] ; then
2848 - # We're specifically not using emake install-sapi as libtool
2849 - # may cause unnecessary relink failures (see bug #351266)
2850 - insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/"
2851 - newins ".libs/libphp${PHP_MV}$(get_libname)" \
2852 - "libphp${PHP_MV}$(get_libname)"
2853 - keepdir "/usr/$(get_libdir)/apache2/modules"
2854 - else
2855 - # needed each time, php_install_ini would reset it
2856 - local dest="${PHP_DESTDIR#${EPREFIX}}"
2857 - into "${dest}"
2858 - case "$sapi" in
2859 - cli)
2860 - source="sapi/cli/php"
2861 - ;;
2862 - cgi)
2863 - source="sapi/cgi/php-cgi"
2864 - ;;
2865 - fpm)
2866 - source="sapi/fpm/php-fpm"
2867 - ;;
2868 - embed)
2869 - source="libs/libphp${PHP_MV}$(get_libname)"
2870 - ;;
2871 - phpdbg)
2872 - source="sapi/phpdbg/phpdbg"
2873 - ;;
2874 - *)
2875 - die "unhandled sapi in src_install"
2876 - ;;
2877 - esac
2878 -
2879 - if [[ "${source}" == *"$(get_libname)" ]]; then
2880 - dolib.so "${source}"
2881 - else
2882 - dobin "${source}"
2883 - local name="$(basename ${source})"
2884 - dosym "${dest}/bin/${name}" "/usr/bin/${name}${SLOT}"
2885 - fi
2886 - fi
2887 -
2888 - php_install_ini "${sapi}"
2889 -
2890 - # construct correct SAPI string for php-config
2891 - # thanks to ferringb for the bash voodoo
2892 - if [[ "${sapi}" == "apache2" ]]; then
2893 - sapi_list="${sapi_list:+${sapi_list} }apache2handler"
2894 - else
2895 - sapi_list="${sapi_list:+${sapi_list} }${sapi}"
2896 - fi
2897 - fi
2898 - done
2899 -
2900 - # Installing opcache module
2901 - if use opcache ; then
2902 - into "${PHP_DESTDIR#${EPREFIX}}"
2903 - dolib.so "modules/opcache$(get_libname)"
2904 - fi
2905 -
2906 - # Install env.d files
2907 - newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}"
2908 - sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
2909 - sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
2910 -
2911 - # set php-config variable correctly (bug #278439)
2912 - sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \
2913 - "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die
2914 -
2915 - if use fpm ; then
2916 - if use systemd; then
2917 - systemd_newunit "${FILESDIR}/php-fpm_at.service" \
2918 - "php-fpm@${SLOT}.service"
2919 - else
2920 - systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \
2921 - "php-fpm@${SLOT}.service"
2922 - fi
2923 - fi
2924 -}
2925 -
2926 -src_test() {
2927 - echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
2928 - PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
2929 - if [[ ! -x "${PHP_BIN}" ]] ; then
2930 - ewarn "Test phase requires USE=cli, skipping"
2931 - return
2932 - else
2933 - export TEST_PHP_EXECUTABLE="${PHP_BIN}"
2934 - fi
2935 -
2936 - if [[ -x "${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" ]] ; then
2937 - export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi"
2938 - fi
2939 -
2940 - if [[ -x "${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" ]] ; then
2941 - export TEST_PHPDBG_EXECUTABLE="${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg"
2942 - fi
2943 -
2944 - REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \
2945 - "session.save_path=${T}" \
2946 - "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \
2947 - "session.save_path=${T}"
2948 -
2949 - for name in ${EXPECTED_TEST_FAILURES}; do
2950 - mv "${name}.out" "${name}.out.orig" 2>/dev/null || die
2951 - done
2952 -
2953 - local failed="$(find -name '*.out')"
2954 - if [[ ${failed} != "" ]] ; then
2955 - ewarn "The following test cases failed unexpectedly:"
2956 - for name in ${failed}; do
2957 - ewarn " ${name/.out/}"
2958 - done
2959 - else
2960 - einfo "No unexpected test failures, all fine"
2961 - fi
2962 -
2963 - if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
2964 - local passed=""
2965 - for name in ${EXPECTED_TEST_FAILURES}; do
2966 - [[ -f "${name}.diff" ]] && continue
2967 - passed="${passed} ${name}"
2968 - done
2969 - if [[ ${passed} != "" ]] ; then
2970 - einfo "The following test cases passed unexpectedly:"
2971 - for name in ${passed}; do
2972 - ewarn " ${passed}"
2973 - done
2974 - else
2975 - einfo "None of the known-to-fail tests passed, all fine"
2976 - fi
2977 - fi
2978 -}
2979 -
2980 -pkg_postinst() {
2981 - # Output some general info to the user
2982 - if use apache2 ; then
2983 - elog
2984 - elog "To enable PHP in apache, you will need to add \"-D PHP\" to"
2985 - elog "your apache2 command. OpenRC users can append that string to"
2986 - elog "APACHE2_OPTS in /etc/conf.d/apache2."
2987 - elog
2988 - elog "The apache module configuration file 70_mod_php.conf is"
2989 - elog "provided (and maintained) by eselect-php."
2990 - elog
2991 - fi
2992 -
2993 - # Create the symlinks for php
2994 - for m in ${SAPIS}; do
2995 - [[ ${m} == 'embed' ]] && continue;
2996 - if use $m ; then
2997 - local ci=$(eselect php show $m)
2998 - if [[ -z $ci ]]; then
2999 - eselect php set $m php${SLOT} || die
3000 - einfo "Switched ${m} to use php:${SLOT}"
3001 - einfo
3002 - elif [[ $ci != "php${SLOT}" ]] ; then
3003 - elog "To switch $m to use php:${SLOT}, run"
3004 - elog " eselect php set $m php${SLOT}"
3005 - elog
3006 - fi
3007 - fi
3008 - done
3009 -
3010 - # Remove dead symlinks for SAPIs that were just disabled. For
3011 - # example, if the user has the cgi SAPI enabled, then he has an
3012 - # eselect-php symlink for it. If he later reinstalls PHP with
3013 - # USE="-cgi", that symlink will break. This call to eselect is
3014 - # supposed to remove that dead link per bug 572436.
3015 - eselect php cleanup || die
3016 -
3017 - if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then
3018 - elog "To build extensions for this version of PHP, you will need to"
3019 - elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable."
3020 - elog
3021 - fi
3022 -
3023 - # Warn about the removal of PHP_INI_VERSION if the user has it set.
3024 - if [[ -n "${PHP_INI_VERSION}" ]]; then
3025 - ewarn 'The PHP_INI_VERSION variable has been phased out. You may'
3026 - ewarn 'remove it from your configuration at your convenience. See'
3027 - ewarn
3028 - ewarn ' https://bugs.gentoo.org/611214'
3029 - ewarn
3030 - ewarn 'for more information.'
3031 - fi
3032 -
3033 - elog "For details on how version slotting works, please see"
3034 - elog "the wiki:"
3035 - elog
3036 - elog " https://wiki.gentoo.org/wiki/PHP"
3037 - elog
3038 -}
3039 -
3040 -pkg_postrm() {
3041 - # This serves two purposes. First, if we have just removed the last
3042 - # installed version of PHP, then this will remove any dead symlinks
3043 - # belonging to eselect-php. Second, if a user upgrades slots from
3044 - # (say) 5.6 to 7.0 and depcleans the old slot, then this will update
3045 - # his existing symlinks to point to the new 7.0 installation. The
3046 - # latter is bug 432962.
3047 - #
3048 - # Note: the eselect-php package may not be installed at this point,
3049 - # so we can't die() if this command fails.
3050 - eselect php cleanup
3051 -}
3052
3053 diff --git a/dev-lang/php/php-7.2.9.ebuild b/dev-lang/php/php-7.2.9.ebuild
3054 deleted file mode 100644
3055 index fb1c7c8293c..00000000000
3056 --- a/dev-lang/php/php-7.2.9.ebuild
3057 +++ /dev/null
3058 @@ -1,740 +0,0 @@
3059 -# Copyright 1999-2018 Gentoo Foundation
3060 -# Distributed under the terms of the GNU General Public License v2
3061 -
3062 -EAPI=6
3063 -
3064 -inherit flag-o-matic eapi7-ver systemd
3065 -
3066 -DESCRIPTION="The PHP language runtime engine"
3067 -HOMEPAGE="https://secure.php.net/"
3068 -SRC_URI="https://secure.php.net/distributions/${P}.tar.xz"
3069 -
3070 -LICENSE="PHP-3.01
3071 - BSD
3072 - Zend-2.0
3073 - bcmath? ( LGPL-2.1+ )
3074 - fpm? ( BSD-2 )
3075 - gd? ( gd )
3076 - unicode? ( BSD-2 LGPL-2.1 )"
3077 -
3078 -SLOT="$(ver_cut 1-2)"
3079 -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"
3080 -
3081 -# We can build the following SAPIs in the given order
3082 -SAPIS="embed cli cgi fpm apache2 phpdbg"
3083 -
3084 -# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
3085 -IUSE="${IUSE}
3086 - ${SAPIS/cli/+cli}
3087 - threads"
3088 -
3089 -IUSE="${IUSE} acl argon2 bcmath berkdb bzip2 calendar cdb cjk
3090 - coverage +ctype curl debug
3091 - enchant exif +fileinfo +filter firebird
3092 - flatfile ftp gd gdbm gmp +hash +iconv imap inifile
3093 - intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl lmdb
3094 - mhash mssql mysql mysqli nls
3095 - oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
3096 - readline recode selinux +session session-mm sharedmem
3097 - +simplexml snmp soap sockets sodium spell sqlite ssl
3098 - sysvipc systemd test tidy +tokenizer tokyocabinet truetype unicode wddx webp
3099 - +xml xmlreader xmlwriter xmlrpc xpm xslt zip zip-encryption zlib"
3100 -
3101 -# The supported (that is, autodetected) versions of BDB are listed in
3102 -# the ./configure script. Other versions *work*, but we need to stick to
3103 -# the ones that can be detected to avoid a repeat of bug #564824.
3104 -COMMON_DEPEND="
3105 - >=app-eselect/eselect-php-0.9.1[apache2?,fpm?]
3106 - >=dev-libs/libpcre-8.32[unicode]
3107 - fpm? ( acl? ( sys-apps/acl ) )
3108 - apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=]
3109 - <www-servers/apache-2.4[threads=] ) )
3110 - argon2? ( app-crypt/argon2:= )
3111 - berkdb? ( || ( sys-libs/db:5.3
3112 - sys-libs/db:5.1
3113 - sys-libs/db:4.8
3114 - sys-libs/db:4.7
3115 - sys-libs/db:4.6
3116 - sys-libs/db:4.5 ) )
3117 - bzip2? ( app-arch/bzip2:0= )
3118 - cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
3119 - coverage? ( dev-util/lcov )
3120 - curl? ( >=net-misc/curl-7.10.5 )
3121 - enchant? ( app-text/enchant )
3122 - firebird? ( dev-db/firebird )
3123 - gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib )
3124 - gdbm? ( >=sys-libs/gdbm-1.8.0:0= )
3125 - gmp? ( dev-libs/gmp:0= )
3126 - iconv? ( virtual/libiconv )
3127 - imap? ( virtual/imap-c-client[kerberos=,ssl=] )
3128 - intl? ( dev-libs/icu:= )
3129 - iodbc? ( dev-db/libiodbc )
3130 - kerberos? ( virtual/krb5 )
3131 - ldap? ( >=net-nds/openldap-1.2.11 )
3132 - ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 )
3133 - libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) )
3134 - lmdb? ( dev-db/lmdb:= )
3135 - mssql? ( dev-db/freetds[mssql] )
3136 - nls? ( sys-devel/gettext )
3137 - oci8-instant-client? ( dev-db/oracle-instantclient-basic )
3138 - odbc? ( >=dev-db/unixODBC-1.8.13 )
3139 - postgres? ( dev-db/postgresql:* )
3140 - qdbm? ( dev-db/qdbm )
3141 - readline? ( sys-libs/readline:0= )
3142 - recode? ( app-text/recode )
3143 - session-mm? ( dev-libs/mm )
3144 - simplexml? ( >=dev-libs/libxml2-2.6.8 )
3145 - snmp? ( >=net-analyzer/net-snmp-5.2 )
3146 - soap? ( >=dev-libs/libxml2-2.6.8 )
3147 - sodium? ( dev-libs/libsodium:= )
3148 - spell? ( >=app-text/aspell-0.50 )
3149 - sqlite? ( >=dev-db/sqlite-3.7.6.3 )
3150 - ssl? (
3151 - !libressl? ( dev-libs/openssl:0= )
3152 - libressl? ( dev-libs/libressl:0= )
3153 - )
3154 - tidy? ( || ( app-text/tidy-html5 app-text/htmltidy ) )
3155 - tokyocabinet? ( dev-db/tokyocabinet )
3156 - truetype? ( =media-libs/freetype-2* )
3157 - unicode? ( dev-libs/oniguruma:= )
3158 - wddx? ( >=dev-libs/libxml2-2.6.8 )
3159 - webp? ( media-libs/libwebp:0= )
3160 - xml? ( >=dev-libs/libxml2-2.6.8 )
3161 - xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
3162 - xmlreader? ( >=dev-libs/libxml2-2.6.8 )
3163 - xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
3164 - xpm? ( x11-libs/libXpm )
3165 - xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
3166 - zip? ( sys-libs/zlib:0= )
3167 - zip-encryption? ( >=dev-libs/libzip-1.2.0:= )
3168 - zlib? ( sys-libs/zlib:0= )
3169 -"
3170 -
3171 -RDEPEND="${COMMON_DEPEND}
3172 - virtual/mta
3173 - fpm? (
3174 - selinux? ( sec-policy/selinux-phpfpm )
3175 - systemd? ( sys-apps/systemd ) )"
3176 -
3177 -# Bison isn't actually needed when building from a release tarball
3178 -# However, the configure script will warn if it's absent or if you
3179 -# have an incompatible version installed. See bug 593278.
3180 -DEPEND="${COMMON_DEPEND}
3181 - app-arch/xz-utils
3182 - >=sys-devel/bison-3.0.1"
3183 -
3184 -# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
3185 -REQUIRED_USE="
3186 - || ( cli cgi fpm apache2 embed phpdbg )
3187 - cli? ( ^^ ( readline libedit ) )
3188 - truetype? ( gd zlib )
3189 - webp? ( gd zlib )
3190 - cjk? ( gd zlib )
3191 - exif? ( gd zlib )
3192 - xpm? ( gd zlib )
3193 - gd? ( zlib )
3194 - simplexml? ( xml )
3195 - soap? ( xml )
3196 - wddx? ( xml )
3197 - xmlrpc? ( || ( xml iconv ) )
3198 - xmlreader? ( xml )
3199 - xslt? ( xml )
3200 - ldap-sasl? ( ldap )
3201 - mhash? ( hash )
3202 - phar? ( hash )
3203 - qdbm? ( !gdbm )
3204 - readline? ( !libedit )
3205 - recode? ( !imap !mysqli !mysql )
3206 - session-mm? ( session !threads )
3207 - mysql? ( || ( mysqli pdo ) )
3208 - zip-encryption? ( zip )
3209 -"
3210 -PATCHES=(
3211 - "${FILESDIR}/php-freetype-2.9.1.patch"
3212 -)
3213 -
3214 -PHP_MV="$(ver_cut 1)"
3215 -
3216 -php_install_ini() {
3217 - local phpsapi="${1}"
3218 -
3219 - # work out where we are installing the ini file
3220 - php_set_ini_dir "${phpsapi}"
3221 -
3222 - # Always install the production INI file, bug 611214.
3223 - local phpinisrc="php.ini-production-${phpsapi}"
3224 - cp php.ini-production "${phpinisrc}" || die
3225 -
3226 - # default to /tmp for save_path, bug #282768
3227 - sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die
3228 -
3229 - # Set the extension dir
3230 - sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \
3231 - -i "${phpinisrc}" || die
3232 -
3233 - # Set the include path to point to where we want to find PEAR packages
3234 - sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die
3235 -
3236 - dodir "${PHP_INI_DIR#${EPREFIX}}"
3237 - insinto "${PHP_INI_DIR#${EPREFIX}}"
3238 - newins "${phpinisrc}" php.ini
3239 -
3240 - elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}"
3241 - elog
3242 -
3243 - dodir "${PHP_EXT_INI_DIR#${EPREFIX}}"
3244 - dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}"
3245 -
3246 - if use opcache; then
3247 - elog "Adding opcache to $PHP_EXT_INI_DIR"
3248 - echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \
3249 - "${D}/${PHP_EXT_INI_DIR}"/opcache.ini
3250 - dosym "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" \
3251 - "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini"
3252 - fi
3253 -
3254 - # SAPI-specific handling
3255 - if [[ "${sapi}" == "fpm" ]] ; then
3256 - einfo "Installing FPM config files php-fpm.conf and www.conf"
3257 - insinto "${PHP_INI_DIR#${EPREFIX}}"
3258 - doins sapi/fpm/php-fpm.conf
3259 - insinto "${PHP_INI_DIR#${EPREFIX}}/fpm.d"
3260 - doins sapi/fpm/www.conf
3261 - fi
3262 -
3263 - dodoc php.ini-{development,production}
3264 -}
3265 -
3266 -php_set_ini_dir() {
3267 - PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}"
3268 - PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
3269 - PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
3270 -}
3271 -
3272 -src_prepare() {
3273 - default
3274 -
3275 - # In php-7.x, the FPM pool configuration files have been split off
3276 - # of the main config. By default the pool config files go in
3277 - # e.g. /etc/php-fpm.d, which isn't slotted. So here we move the
3278 - # include directory to a subdirectory "fpm.d" of $PHP_INI_DIR. Later
3279 - # we'll install the pool configuration file "www.conf" there.
3280 - php_set_ini_dir fpm
3281 - sed -i "s~^include=.*$~include=${PHP_INI_DIR}/fpm.d/*.conf~" \
3282 - sapi/fpm/php-fpm.conf.in \
3283 - || die 'failed to move the include directory in php-fpm.conf'
3284 -}
3285 -
3286 -src_configure() {
3287 - addpredict /usr/share/snmp/mibs/.index #nowarn
3288 - addpredict /var/lib/net-snmp/mib_indexes #nowarn
3289 -
3290 - PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
3291 -
3292 - # The php-fpm config file wants localstatedir to be ${EPREFIX}/var
3293 - # and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002.
3294 - local our_conf=(
3295 - --prefix="${PHP_DESTDIR}"
3296 - --mandir="${PHP_DESTDIR}/man"
3297 - --infodir="${PHP_DESTDIR}/info"
3298 - --libdir="${PHP_DESTDIR}/lib"
3299 - --with-libdir="$(get_libdir)"
3300 - --localstatedir="${EPREFIX}/var"
3301 - --without-pear
3302 - $(use_enable threads maintainer-zts)
3303 - )
3304 -
3305 - our_conf+=(
3306 - $(use_with argon2 password-argon2 "${EPREFIX}/usr")
3307 - $(use_enable bcmath bcmath)
3308 - $(use_with bzip2 bz2 "${EPREFIX}/usr")
3309 - $(use_enable calendar calendar)
3310 - $(use_enable coverage gcov)
3311 - $(use_enable ctype ctype)
3312 - $(use_with curl curl "${EPREFIX}/usr")
3313 - $(use_enable xml dom)
3314 - $(use_with enchant enchant "${EPREFIX}/usr")
3315 - $(use_enable exif exif)
3316 - $(use_enable fileinfo fileinfo)
3317 - $(use_enable filter filter)
3318 - $(use_enable ftp ftp)
3319 - $(use_with nls gettext "${EPREFIX}/usr")
3320 - $(use_with gmp gmp "${EPREFIX}/usr")
3321 - $(use_enable hash hash)
3322 - $(use_with mhash mhash "${EPREFIX}/usr")
3323 - $(use_with iconv iconv \
3324 - $(use elibc_glibc || use elibc_musl || use elibc_FreeBSD || echo "${EPREFIX}/usr"))
3325 - $(use_enable intl intl)
3326 - $(use_enable ipv6 ipv6)
3327 - $(use_enable json json)
3328 - $(use_with kerberos kerberos "${EPREFIX}/usr")
3329 - $(use_enable xml libxml)
3330 - $(use_with xml libxml-dir "${EPREFIX}/usr")
3331 - $(use_enable unicode mbstring)
3332 - $(use_with unicode onig "${EPREFIX}/usr")
3333 - $(use_with ssl openssl "${EPREFIX}/usr")
3334 - $(use_with ssl openssl-dir "${EPREFIX}/usr")
3335 - $(use_enable pcntl pcntl)
3336 - $(use_enable phar phar)
3337 - $(use_enable pdo pdo)
3338 - $(use_enable opcache opcache)
3339 - $(use_with postgres pgsql "${EPREFIX}/usr")
3340 - $(use_enable posix posix)
3341 - $(use_with spell pspell "${EPREFIX}/usr")
3342 - $(use_with recode recode "${EPREFIX}/usr")
3343 - $(use_enable simplexml simplexml)
3344 - $(use_enable sharedmem shmop)
3345 - $(use_with snmp snmp "${EPREFIX}/usr")
3346 - $(use_enable soap soap)
3347 - $(use_enable sockets sockets)
3348 - $(use_with sodium sodium "${EPREFIX}/usr")
3349 - $(use_with sqlite sqlite3 "${EPREFIX}/usr")
3350 - $(use_enable sysvipc sysvmsg)
3351 - $(use_enable sysvipc sysvsem)
3352 - $(use_enable sysvipc sysvshm)
3353 - $(use_with tidy tidy "${EPREFIX}/usr")
3354 - $(use_enable tokenizer tokenizer)
3355 - $(use_enable wddx wddx)
3356 - $(use_enable xml xml)
3357 - $(use_enable xmlreader xmlreader)
3358 - $(use_enable xmlwriter xmlwriter)
3359 - $(use_with xmlrpc xmlrpc)
3360 - $(use_with xslt xsl "${EPREFIX}/usr")
3361 - $(use_enable zip zip)
3362 - $(use_with zip-encryption libzip "${EPREFIX}/usr")
3363 - $(use_with zlib zlib "${EPREFIX}/usr")
3364 - $(use_enable debug debug)
3365 - )
3366 -
3367 - # DBA support
3368 - if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
3369 - || use qdbm || use lmdb || use tokyocabinet ; then
3370 - our_conf+=( "--enable-dba${shared}" )
3371 - fi
3372 -
3373 - # DBA drivers support
3374 - our_conf+=(
3375 - $(use_with cdb cdb)
3376 - $(use_with berkdb db4 "${EPREFIX}/usr")
3377 - $(use_enable flatfile flatfile)
3378 - $(use_with gdbm gdbm "${EPREFIX}/usr")
3379 - $(use_enable inifile inifile)
3380 - $(use_with qdbm qdbm "${EPREFIX}/usr")
3381 - $(use_with lmdb lmdb "${EPREFIX}/usr")
3382 - )
3383 -
3384 - # Support for the GD graphics library
3385 - our_conf+=(
3386 - $(use_with truetype freetype-dir "${EPREFIX}/usr")
3387 - $(use_enable cjk gd-jis-conv)
3388 - $(use_with gd jpeg-dir "${EPREFIX}/usr")
3389 - $(use_with gd png-dir "${EPREFIX}/usr")
3390 - $(use_with xpm xpm-dir "${EPREFIX}/usr")
3391 - )
3392 - if use webp; then
3393 - our_conf+=( --with-webp-dir="${EPREFIX}/usr" )
3394 - fi
3395 - # enable gd last, so configure can pick up the previous settings
3396 - our_conf+=( $(use_with gd gd) )
3397 -
3398 - # IMAP support
3399 - if use imap ; then
3400 - our_conf+=(
3401 - $(use_with imap imap "${EPREFIX}/usr")
3402 - $(use_with ssl imap-ssl "${EPREFIX}/usr")
3403 - )
3404 - fi
3405 -
3406 - # Interbase/firebird support
3407 - our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") )
3408 -
3409 - # LDAP support
3410 - if use ldap ; then
3411 - our_conf+=(
3412 - $(use_with ldap ldap "${EPREFIX}/usr")
3413 - $(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr")
3414 - )
3415 - fi
3416 -
3417 - # MySQL support
3418 - local mysqllib="mysqlnd"
3419 - local mysqlilib="mysqlnd"
3420 -
3421 - our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
3422 -
3423 - local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock"
3424 - if use mysql || use mysqli ; then
3425 - our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") )
3426 - fi
3427 -
3428 - # ODBC support
3429 - our_conf+=(
3430 - $(use_with odbc unixODBC "${EPREFIX}/usr")
3431 - $(use_with iodbc iodbc "${EPREFIX}/usr")
3432 - )
3433 -
3434 - # Oracle support
3435 - our_conf+=( $(use_with oci8-instant-client oci8) )
3436 -
3437 - # PDO support
3438 - if use pdo ; then
3439 - our_conf+=(
3440 - $(use_with mssql pdo-dblib "${EPREFIX}/usr")
3441 - $(use_with mysql pdo-mysql "${mysqllib}")
3442 - $(use_with postgres pdo-pgsql)
3443 - $(use_with sqlite pdo-sqlite "${EPREFIX}/usr")
3444 - $(use_with firebird pdo-firebird "${EPREFIX}/usr")
3445 - $(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr")
3446 - $(use_with oci8-instant-client pdo-oci)
3447 - )
3448 - fi
3449 -
3450 - # readline/libedit support
3451 - our_conf+=(
3452 - $(use_with readline readline "${EPREFIX}/usr")
3453 - $(use_with libedit libedit "${EPREFIX}/usr")
3454 - )
3455 -
3456 - # Session support
3457 - if use session ; then
3458 - our_conf+=( $(use_with session-mm mm "${EPREFIX}/usr") )
3459 - else
3460 - our_conf+=( $(use_enable session session) )
3461 - fi
3462 -
3463 - # Use pic for shared modules such as apache2's mod_php
3464 - our_conf+=( --with-pic )
3465 -
3466 - # we use the system copy of pcre
3467 - # --with-pcre-regex affects ext/pcre
3468 - # --with-pcre-dir affects ext/filter and ext/zip
3469 - # --with-pcre-valgrind cannot be enabled with system pcre
3470 - # Many arches don't support pcre-jit
3471 - our_conf+=(
3472 - --with-pcre-regex="${EPREFIX}/usr"
3473 - --with-pcre-dir="${EPREFIX}/usr"
3474 - --without-pcre-valgrind
3475 - --without-pcre-jit
3476 - )
3477 -
3478 - # Catch CFLAGS problems
3479 - # Fixes bug #14067.
3480 - # Changed order to run it in reverse for bug #32022 and #12021.
3481 - replace-cpu-flags "k6*" "i586"
3482 -
3483 - # Cache the ./configure test results between SAPIs.
3484 - our_conf+=( --cache-file="${T}/config.cache" )
3485 -
3486 - # Support user-passed configuration parameters
3487 - our_conf+=( ${EXTRA_ECONF:-} )
3488 -
3489 - # Support the Apache2 extras, they must be set globally for all
3490 - # SAPIs to work correctly, especially for external PHP extensions
3491 -
3492 - mkdir -p "${WORKDIR}/sapis-build" || die
3493 - for one_sapi in $SAPIS ; do
3494 - use "${one_sapi}" || continue
3495 - php_set_ini_dir "${one_sapi}"
3496 -
3497 - # The BUILD_DIR variable is used to determine where to output
3498 - # the files that autotools creates. This was all originally
3499 - # based on the autotools-utils eclass.
3500 - BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}"
3501 - cp -a "${S}" "${BUILD_DIR}" || die
3502 - cd "${BUILD_DIR}" || die
3503 -
3504 - local sapi_conf=(
3505 - --with-config-file-path="${PHP_INI_DIR}"
3506 - --with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}"
3507 - )
3508 -
3509 - for sapi in $SAPIS ; do
3510 - case "$sapi" in
3511 - cli|cgi|embed|fpm|phpdbg)
3512 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
3513 - sapi_conf+=( "--enable-${sapi}" )
3514 - if [[ "fpm" == "${sapi}" ]] ; then
3515 - sapi_conf+=(
3516 - $(use_with acl fpm-acl)
3517 - $(use_with systemd fpm-systemd)
3518 - )
3519 - fi
3520 - else
3521 - sapi_conf+=( "--disable-${sapi}" )
3522 - fi
3523 - ;;
3524 -
3525 - apache2)
3526 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
3527 - sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" )
3528 - else
3529 - sapi_conf+=( --without-apxs2 )
3530 - fi
3531 - ;;
3532 - esac
3533 - done
3534 -
3535 - # Construct the $myeconfargs array by concatenating $our_conf
3536 - # (the common args) and $sapi_conf (the SAPI-specific args).
3537 - local myeconfargs=( "${our_conf[@]}" )
3538 - myeconfargs+=( "${sapi_conf[@]}" )
3539 -
3540 - pushd "${BUILD_DIR}" > /dev/null || die
3541 - econf "${myeconfargs[@]}"
3542 - popd > /dev/null || die
3543 - done
3544 -}
3545 -
3546 -src_compile() {
3547 - # snmp seems to run during src_compile, too (bug #324739)
3548 - addpredict /usr/share/snmp/mibs/.index #nowarn
3549 - addpredict /var/lib/net-snmp/mib_indexes #nowarn
3550 -
3551 - for sapi in ${SAPIS} ; do
3552 - if use "${sapi}"; then
3553 - cd "${WORKDIR}/sapis-build/$sapi" || \
3554 - die "Failed to change dir to ${WORKDIR}/sapis-build/$1"
3555 - emake
3556 - fi
3557 - done
3558 -}
3559 -
3560 -src_install() {
3561 - # see bug #324739 for what happens when we don't have that
3562 - addpredict /usr/share/snmp/mibs/.index #nowarn
3563 -
3564 - # grab the first SAPI that got built and install common files from there
3565 - local first_sapi=""
3566 - for sapi in $SAPIS ; do
3567 - if use $sapi ; then
3568 - first_sapi=$sapi
3569 - break
3570 - fi
3571 - done
3572 -
3573 - # Makefile forgets to create this before trying to write to it...
3574 - dodir "${PHP_DESTDIR#${EPREFIX}}/bin"
3575 -
3576 - # Install php environment (without any sapis)
3577 - cd "${WORKDIR}/sapis-build/$first_sapi" || die
3578 - emake INSTALL_ROOT="${D}" \
3579 - install-build install-headers install-programs
3580 -
3581 - local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)"
3582 -
3583 - # Create the directory where we'll put version-specific php scripts
3584 - keepdir "/usr/share/php${PHP_MV}"
3585 -
3586 - local sapi="", file=""
3587 - local sapi_list=""
3588 -
3589 - for sapi in ${SAPIS}; do
3590 - if use "${sapi}" ; then
3591 - einfo "Installing SAPI: ${sapi}"
3592 - cd "${WORKDIR}/sapis-build/${sapi}" || die
3593 -
3594 - if [[ "${sapi}" == "apache2" ]] ; then
3595 - # We're specifically not using emake install-sapi as libtool
3596 - # may cause unnecessary relink failures (see bug #351266)
3597 - insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/"
3598 - newins ".libs/libphp${PHP_MV}$(get_libname)" \
3599 - "libphp${PHP_MV}$(get_libname)"
3600 - keepdir "/usr/$(get_libdir)/apache2/modules"
3601 - else
3602 - # needed each time, php_install_ini would reset it
3603 - local dest="${PHP_DESTDIR#${EPREFIX}}"
3604 - into "${dest}"
3605 - case "$sapi" in
3606 - cli)
3607 - source="sapi/cli/php"
3608 - ;;
3609 - cgi)
3610 - source="sapi/cgi/php-cgi"
3611 - ;;
3612 - fpm)
3613 - source="sapi/fpm/php-fpm"
3614 - ;;
3615 - embed)
3616 - source="libs/libphp${PHP_MV}$(get_libname)"
3617 - ;;
3618 - phpdbg)
3619 - source="sapi/phpdbg/phpdbg"
3620 - ;;
3621 - *)
3622 - die "unhandled sapi in src_install"
3623 - ;;
3624 - esac
3625 -
3626 - if [[ "${source}" == *"$(get_libname)" ]]; then
3627 - dolib.so "${source}"
3628 - else
3629 - dobin "${source}"
3630 - local name="$(basename ${source})"
3631 - dosym "${dest}/bin/${name}" "/usr/bin/${name}${SLOT}"
3632 - fi
3633 - fi
3634 -
3635 - php_install_ini "${sapi}"
3636 -
3637 - # construct correct SAPI string for php-config
3638 - # thanks to ferringb for the bash voodoo
3639 - if [[ "${sapi}" == "apache2" ]]; then
3640 - sapi_list="${sapi_list:+${sapi_list} }apache2handler"
3641 - else
3642 - sapi_list="${sapi_list:+${sapi_list} }${sapi}"
3643 - fi
3644 - fi
3645 - done
3646 -
3647 - # Installing opcache module
3648 - if use opcache ; then
3649 - into "${PHP_DESTDIR#${EPREFIX}}"
3650 - dolib.so "modules/opcache$(get_libname)"
3651 - fi
3652 -
3653 - # Install env.d files
3654 - newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}"
3655 - sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
3656 - sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
3657 -
3658 - # set php-config variable correctly (bug #278439)
3659 - sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \
3660 - "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die
3661 -
3662 - if use fpm ; then
3663 - if use systemd; then
3664 - systemd_newunit "${FILESDIR}/php-fpm_at.service" \
3665 - "php-fpm@${SLOT}.service"
3666 - else
3667 - systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \
3668 - "php-fpm@${SLOT}.service"
3669 - fi
3670 - fi
3671 -}
3672 -
3673 -src_test() {
3674 - echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
3675 - PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
3676 - if [[ ! -x "${PHP_BIN}" ]] ; then
3677 - ewarn "Test phase requires USE=cli, skipping"
3678 - return
3679 - else
3680 - export TEST_PHP_EXECUTABLE="${PHP_BIN}"
3681 - fi
3682 -
3683 - if [[ -x "${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" ]] ; then
3684 - export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi"
3685 - fi
3686 -
3687 - if [[ -x "${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" ]] ; then
3688 - export TEST_PHPDBG_EXECUTABLE="${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg"
3689 - fi
3690 -
3691 - REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \
3692 - "session.save_path=${T}" \
3693 - "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \
3694 - "session.save_path=${T}"
3695 -
3696 - for name in ${EXPECTED_TEST_FAILURES}; do
3697 - mv "${name}.out" "${name}.out.orig" 2>/dev/null || die
3698 - done
3699 -
3700 - local failed="$(find -name '*.out')"
3701 - if [[ ${failed} != "" ]] ; then
3702 - ewarn "The following test cases failed unexpectedly:"
3703 - for name in ${failed}; do
3704 - ewarn " ${name/.out/}"
3705 - done
3706 - else
3707 - einfo "No unexpected test failures, all fine"
3708 - fi
3709 -
3710 - if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
3711 - local passed=""
3712 - for name in ${EXPECTED_TEST_FAILURES}; do
3713 - [[ -f "${name}.diff" ]] && continue
3714 - passed="${passed} ${name}"
3715 - done
3716 - if [[ ${passed} != "" ]] ; then
3717 - einfo "The following test cases passed unexpectedly:"
3718 - for name in ${passed}; do
3719 - ewarn " ${passed}"
3720 - done
3721 - else
3722 - einfo "None of the known-to-fail tests passed, all fine"
3723 - fi
3724 - fi
3725 -}
3726 -
3727 -pkg_postinst() {
3728 - # Output some general info to the user
3729 - if use apache2 ; then
3730 - elog
3731 - elog "To enable PHP in apache, you will need to add \"-D PHP\" to"
3732 - elog "your apache2 command. OpenRC users can append that string to"
3733 - elog "APACHE2_OPTS in /etc/conf.d/apache2."
3734 - elog
3735 - elog "The apache module configuration file 70_mod_php.conf is"
3736 - elog "provided (and maintained) by eselect-php."
3737 - elog
3738 - fi
3739 -
3740 - # Create the symlinks for php
3741 - for m in ${SAPIS}; do
3742 - [[ ${m} == 'embed' ]] && continue;
3743 - if use $m ; then
3744 - local ci=$(eselect php show $m)
3745 - if [[ -z $ci ]]; then
3746 - eselect php set $m php${SLOT} || die
3747 - einfo "Switched ${m} to use php:${SLOT}"
3748 - einfo
3749 - elif [[ $ci != "php${SLOT}" ]] ; then
3750 - elog "To switch $m to use php:${SLOT}, run"
3751 - elog " eselect php set $m php${SLOT}"
3752 - elog
3753 - fi
3754 - fi
3755 - done
3756 -
3757 - # Remove dead symlinks for SAPIs that were just disabled. For
3758 - # example, if the user has the cgi SAPI enabled, then he has an
3759 - # eselect-php symlink for it. If he later reinstalls PHP with
3760 - # USE="-cgi", that symlink will break. This call to eselect is
3761 - # supposed to remove that dead link per bug 572436.
3762 - eselect php cleanup || die
3763 -
3764 - if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then
3765 - elog "To build extensions for this version of PHP, you will need to"
3766 - elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable."
3767 - elog
3768 - fi
3769 -
3770 - # Warn about the removal of PHP_INI_VERSION if the user has it set.
3771 - if [[ -n "${PHP_INI_VERSION}" ]]; then
3772 - ewarn 'The PHP_INI_VERSION variable has been phased out. You may'
3773 - ewarn 'remove it from your configuration at your convenience. See'
3774 - ewarn
3775 - ewarn ' https://bugs.gentoo.org/611214'
3776 - ewarn
3777 - ewarn 'for more information.'
3778 - fi
3779 -
3780 - elog "For details on how version slotting works, please see"
3781 - elog "the wiki:"
3782 - elog
3783 - elog " https://wiki.gentoo.org/wiki/PHP"
3784 - elog
3785 -}
3786 -
3787 -pkg_postrm() {
3788 - # This serves two purposes. First, if we have just removed the last
3789 - # installed version of PHP, then this will remove any dead symlinks
3790 - # belonging to eselect-php. Second, if a user upgrades slots from
3791 - # (say) 5.6 to 7.0 and depcleans the old slot, then this will update
3792 - # his existing symlinks to point to the new 7.0 installation. The
3793 - # latter is bug 432962.
3794 - #
3795 - # Note: the eselect-php package may not be installed at this point,
3796 - # so we can't die() if this command fails.
3797 - eselect php cleanup
3798 -}
3799
3800 diff --git a/dev-lang/php/php-7.3.0_beta2.ebuild b/dev-lang/php/php-7.3.0_beta2.ebuild
3801 deleted file mode 100644
3802 index 4b015508db9..00000000000
3803 --- a/dev-lang/php/php-7.3.0_beta2.ebuild
3804 +++ /dev/null
3805 @@ -1,743 +0,0 @@
3806 -# Copyright 1999-2018 Gentoo Foundation
3807 -# Distributed under the terms of the GNU General Public License v2
3808 -
3809 -EAPI=6
3810 -
3811 -inherit flag-o-matic eapi7-ver systemd
3812 -
3813 -MY_PV=${PV/_/}
3814 -DESCRIPTION="The PHP language runtime engine"
3815 -HOMEPAGE="https://secure.php.net/"
3816 -SRC_URI="https://downloads.php.net/~cmb/${PN}-${MY_PV}.tar.xz"
3817 -
3818 -LICENSE="PHP-3.01
3819 - BSD
3820 - Zend-2.0
3821 - bcmath? ( LGPL-2.1+ )
3822 - fpm? ( BSD-2 )
3823 - gd? ( gd )
3824 - unicode? ( BSD-2 LGPL-2.1 )"
3825 -
3826 -SLOT="$(ver_cut 1-2)"
3827 -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"
3828 -
3829 -S="${WORKDIR}/${PN}-${MY_PV}"
3830 -
3831 -# We can build the following SAPIs in the given order
3832 -SAPIS="embed cli cgi fpm apache2 phpdbg"
3833 -
3834 -# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
3835 -IUSE="${IUSE}
3836 - ${SAPIS/cli/+cli}
3837 - threads"
3838 -
3839 -IUSE="${IUSE} acl argon2 bcmath berkdb bzip2 calendar cdb cjk
3840 - coverage +ctype curl debug
3841 - enchant exif +fileinfo +filter firebird
3842 - flatfile ftp gd gdbm gmp +hash +iconv imap inifile
3843 - intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl lmdb
3844 - mhash mssql mysql mysqli nls
3845 - oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
3846 - readline recode selinux +session session-mm sharedmem
3847 - +simplexml snmp soap sockets sodium spell sqlite ssl
3848 - sysvipc systemd test tidy +tokenizer tokyocabinet truetype unicode wddx webp
3849 - +xml xmlreader xmlwriter xmlrpc xpm xslt zip zip-encryption zlib"
3850 -
3851 -# The supported (that is, autodetected) versions of BDB are listed in
3852 -# the ./configure script. Other versions *work*, but we need to stick to
3853 -# the ones that can be detected to avoid a repeat of bug #564824.
3854 -COMMON_DEPEND="
3855 - >=app-eselect/eselect-php-0.9.1[apache2?,fpm?]
3856 - >=dev-libs/libpcre2-10.30[unicode]
3857 - fpm? ( acl? ( sys-apps/acl ) )
3858 - apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=]
3859 - <www-servers/apache-2.4[threads=] ) )
3860 - argon2? ( app-crypt/argon2:= )
3861 - berkdb? ( || ( sys-libs/db:5.3
3862 - sys-libs/db:5.1
3863 - sys-libs/db:4.8
3864 - sys-libs/db:4.7
3865 - sys-libs/db:4.6
3866 - sys-libs/db:4.5 ) )
3867 - bzip2? ( app-arch/bzip2:0= )
3868 - cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
3869 - coverage? ( dev-util/lcov )
3870 - curl? ( >=net-misc/curl-7.10.5 )
3871 - enchant? ( app-text/enchant )
3872 - firebird? ( dev-db/firebird )
3873 - gd? ( virtual/jpeg:0 media-libs/libpng:0= >=sys-libs/zlib-1.2.0.4 )
3874 - gdbm? ( >=sys-libs/gdbm-1.8.0:0= )
3875 - gmp? ( dev-libs/gmp:0= )
3876 - iconv? ( virtual/libiconv )
3877 - imap? ( virtual/imap-c-client[kerberos=,ssl=] )
3878 - intl? ( dev-libs/icu:= )
3879 - iodbc? ( dev-db/libiodbc )
3880 - kerberos? ( virtual/krb5 )
3881 - ldap? ( >=net-nds/openldap-1.2.11 )
3882 - ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 )
3883 - libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) )
3884 - lmdb? ( dev-db/lmdb:= )
3885 - mssql? ( dev-db/freetds[mssql] )
3886 - nls? ( sys-devel/gettext )
3887 - oci8-instant-client? ( dev-db/oracle-instantclient-basic )
3888 - odbc? ( >=dev-db/unixODBC-1.8.13 )
3889 - postgres? ( dev-db/postgresql:* )
3890 - qdbm? ( dev-db/qdbm )
3891 - readline? ( sys-libs/readline:0= )
3892 - recode? ( app-text/recode )
3893 - session-mm? ( dev-libs/mm )
3894 - simplexml? ( >=dev-libs/libxml2-2.6.8 )
3895 - snmp? ( >=net-analyzer/net-snmp-5.2 )
3896 - soap? ( >=dev-libs/libxml2-2.6.8 )
3897 - sodium? ( dev-libs/libsodium:= )
3898 - spell? ( >=app-text/aspell-0.50 )
3899 - sqlite? ( >=dev-db/sqlite-3.7.6.3 )
3900 - ssl? (
3901 - !libressl? ( >=dev-libs/openssl-1.0.1:0= )
3902 - libressl? ( dev-libs/libressl:0= )
3903 - )
3904 - tidy? ( || ( app-text/tidy-html5 app-text/htmltidy ) )
3905 - tokyocabinet? ( dev-db/tokyocabinet )
3906 - truetype? ( =media-libs/freetype-2* )
3907 - unicode? ( dev-libs/oniguruma:= )
3908 - wddx? ( >=dev-libs/libxml2-2.6.8 )
3909 - webp? ( media-libs/libwebp:0= )
3910 - xml? ( >=dev-libs/libxml2-2.6.8 )
3911 - xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
3912 - xmlreader? ( >=dev-libs/libxml2-2.6.8 )
3913 - xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
3914 - xpm? ( x11-libs/libXpm )
3915 - xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
3916 - zip? ( >=sys-libs/zlib-1.2.0.4:0= )
3917 - zip-encryption? ( >=dev-libs/libzip-1.2.0:= )
3918 - zlib? ( >=sys-libs/zlib-1.2.0.4:0= )
3919 -"
3920 -
3921 -RDEPEND="${COMMON_DEPEND}
3922 - virtual/mta
3923 - fpm? (
3924 - selinux? ( sec-policy/selinux-phpfpm )
3925 - systemd? ( sys-apps/systemd ) )"
3926 -
3927 -# Bison isn't actually needed when building from a release tarball
3928 -# However, the configure script will warn if it's absent or if you
3929 -# have an incompatible version installed. See bug 593278.
3930 -DEPEND="${COMMON_DEPEND}
3931 - app-arch/xz-utils
3932 - >=sys-devel/bison-3.0.1"
3933 -
3934 -# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
3935 -REQUIRED_USE="
3936 - || ( cli cgi fpm apache2 embed phpdbg )
3937 - cli? ( ^^ ( readline libedit ) )
3938 - truetype? ( gd zlib )
3939 - webp? ( gd zlib )
3940 - cjk? ( gd zlib )
3941 - exif? ( gd zlib )
3942 - xpm? ( gd zlib )
3943 - gd? ( zlib )
3944 - simplexml? ( xml )
3945 - soap? ( xml )
3946 - wddx? ( xml )
3947 - xmlrpc? ( || ( xml iconv ) )
3948 - xmlreader? ( xml )
3949 - xslt? ( xml )
3950 - ldap-sasl? ( ldap )
3951 - mhash? ( hash )
3952 - phar? ( hash )
3953 - qdbm? ( !gdbm )
3954 - readline? ( !libedit )
3955 - recode? ( !imap !mysqli !mysql )
3956 - session-mm? ( session !threads )
3957 - mysql? ( || ( mysqli pdo ) )
3958 - zip-encryption? ( zip )
3959 -"
3960 -PATCHES=(
3961 - "${FILESDIR}/php-freetype-2.9.1.patch"
3962 -)
3963 -
3964 -PHP_MV="$(ver_cut 1)"
3965 -
3966 -php_install_ini() {
3967 - local phpsapi="${1}"
3968 -
3969 - # work out where we are installing the ini file
3970 - php_set_ini_dir "${phpsapi}"
3971 -
3972 - # Always install the production INI file, bug 611214.
3973 - local phpinisrc="php.ini-production-${phpsapi}"
3974 - cp php.ini-production "${phpinisrc}" || die
3975 -
3976 - # default to /tmp for save_path, bug #282768
3977 - sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die
3978 -
3979 - # Set the extension dir
3980 - sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \
3981 - -i "${phpinisrc}" || die
3982 -
3983 - # Set the include path to point to where we want to find PEAR packages
3984 - sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die
3985 -
3986 - dodir "${PHP_INI_DIR#${EPREFIX}}"
3987 - insinto "${PHP_INI_DIR#${EPREFIX}}"
3988 - newins "${phpinisrc}" php.ini
3989 -
3990 - elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}"
3991 - elog
3992 -
3993 - dodir "${PHP_EXT_INI_DIR#${EPREFIX}}"
3994 - dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}"
3995 -
3996 - if use opcache; then
3997 - elog "Adding opcache to $PHP_EXT_INI_DIR"
3998 - echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \
3999 - "${D}/${PHP_EXT_INI_DIR}"/opcache.ini
4000 - dosym "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" \
4001 - "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini"
4002 - fi
4003 -
4004 - # SAPI-specific handling
4005 - if [[ "${sapi}" == "fpm" ]] ; then
4006 - einfo "Installing FPM config files php-fpm.conf and www.conf"
4007 - insinto "${PHP_INI_DIR#${EPREFIX}}"
4008 - doins sapi/fpm/php-fpm.conf
4009 - insinto "${PHP_INI_DIR#${EPREFIX}}/fpm.d"
4010 - doins sapi/fpm/www.conf
4011 - fi
4012 -
4013 - dodoc php.ini-{development,production}
4014 -}
4015 -
4016 -php_set_ini_dir() {
4017 - PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}"
4018 - PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
4019 - PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
4020 -}
4021 -
4022 -src_prepare() {
4023 - default
4024 -
4025 - # In php-7.x, the FPM pool configuration files have been split off
4026 - # of the main config. By default the pool config files go in
4027 - # e.g. /etc/php-fpm.d, which isn't slotted. So here we move the
4028 - # include directory to a subdirectory "fpm.d" of $PHP_INI_DIR. Later
4029 - # we'll install the pool configuration file "www.conf" there.
4030 - php_set_ini_dir fpm
4031 - sed -i "s~^include=.*$~include=${PHP_INI_DIR}/fpm.d/*.conf~" \
4032 - sapi/fpm/php-fpm.conf.in \
4033 - || die 'failed to move the include directory in php-fpm.conf'
4034 -}
4035 -
4036 -src_configure() {
4037 - addpredict /usr/share/snmp/mibs/.index #nowarn
4038 - addpredict /var/lib/net-snmp/mib_indexes #nowarn
4039 -
4040 - PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
4041 -
4042 - # The php-fpm config file wants localstatedir to be ${EPREFIX}/var
4043 - # and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002.
4044 - local our_conf=(
4045 - --prefix="${PHP_DESTDIR}"
4046 - --mandir="${PHP_DESTDIR}/man"
4047 - --infodir="${PHP_DESTDIR}/info"
4048 - --libdir="${PHP_DESTDIR}/lib"
4049 - --with-libdir="$(get_libdir)"
4050 - --localstatedir="${EPREFIX}/var"
4051 - --without-pear
4052 - $(use_enable threads maintainer-zts)
4053 - )
4054 -
4055 - our_conf+=(
4056 - $(use_with argon2 password-argon2 "${EPREFIX}/usr")
4057 - $(use_enable bcmath bcmath)
4058 - $(use_with bzip2 bz2 "${EPREFIX}/usr")
4059 - $(use_enable calendar calendar)
4060 - $(use_enable coverage gcov)
4061 - $(use_enable ctype ctype)
4062 - $(use_with curl curl "${EPREFIX}/usr")
4063 - $(use_enable xml dom)
4064 - $(use_with enchant enchant "${EPREFIX}/usr")
4065 - $(use_enable exif exif)
4066 - $(use_enable fileinfo fileinfo)
4067 - $(use_enable filter filter)
4068 - $(use_enable ftp ftp)
4069 - $(use_with nls gettext "${EPREFIX}/usr")
4070 - $(use_with gmp gmp "${EPREFIX}/usr")
4071 - $(use_enable hash hash)
4072 - $(use_with mhash mhash "${EPREFIX}/usr")
4073 - $(use_with iconv iconv \
4074 - $(use elibc_glibc || use elibc_musl || use elibc_FreeBSD || echo "${EPREFIX}/usr"))
4075 - $(use_enable intl intl)
4076 - $(use_enable ipv6 ipv6)
4077 - $(use_enable json json)
4078 - $(use_with kerberos kerberos "${EPREFIX}/usr")
4079 - $(use_enable xml libxml)
4080 - $(use_with xml libxml-dir "${EPREFIX}/usr")
4081 - $(use_enable unicode mbstring)
4082 - $(use_with unicode onig "${EPREFIX}/usr")
4083 - $(use_with ssl openssl "${EPREFIX}/usr")
4084 - $(use_with ssl openssl-dir "${EPREFIX}/usr")
4085 - $(use_enable pcntl pcntl)
4086 - $(use_enable phar phar)
4087 - $(use_enable pdo pdo)
4088 - $(use_enable opcache opcache)
4089 - $(use_with postgres pgsql "${EPREFIX}/usr")
4090 - $(use_enable posix posix)
4091 - $(use_with spell pspell "${EPREFIX}/usr")
4092 - $(use_with recode recode "${EPREFIX}/usr")
4093 - $(use_enable simplexml simplexml)
4094 - $(use_enable sharedmem shmop)
4095 - $(use_with snmp snmp "${EPREFIX}/usr")
4096 - $(use_enable soap soap)
4097 - $(use_enable sockets sockets)
4098 - $(use_with sodium sodium "${EPREFIX}/usr")
4099 - $(use_with sqlite sqlite3 "${EPREFIX}/usr")
4100 - $(use_enable sysvipc sysvmsg)
4101 - $(use_enable sysvipc sysvsem)
4102 - $(use_enable sysvipc sysvshm)
4103 - $(use_with tidy tidy "${EPREFIX}/usr")
4104 - $(use_enable tokenizer tokenizer)
4105 - $(use_enable wddx wddx)
4106 - $(use_enable xml xml)
4107 - $(use_enable xmlreader xmlreader)
4108 - $(use_enable xmlwriter xmlwriter)
4109 - $(use_with xmlrpc xmlrpc)
4110 - $(use_with xslt xsl "${EPREFIX}/usr")
4111 - $(use_enable zip zip)
4112 - $(use_with zip-encryption libzip "${EPREFIX}/usr")
4113 - $(use_with zlib zlib "${EPREFIX}/usr")
4114 - $(use_enable debug debug)
4115 - )
4116 -
4117 - # DBA support
4118 - if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
4119 - || use qdbm || use lmdb || use tokyocabinet ; then
4120 - our_conf+=( "--enable-dba${shared}" )
4121 - fi
4122 -
4123 - # DBA drivers support
4124 - our_conf+=(
4125 - $(use_with cdb cdb)
4126 - $(use_with berkdb db4 "${EPREFIX}/usr")
4127 - $(use_enable flatfile flatfile)
4128 - $(use_with gdbm gdbm "${EPREFIX}/usr")
4129 - $(use_enable inifile inifile)
4130 - $(use_with qdbm qdbm "${EPREFIX}/usr")
4131 - $(use_with lmdb lmdb "${EPREFIX}/usr")
4132 - )
4133 -
4134 - # Support for the GD graphics library
4135 - our_conf+=(
4136 - $(use_with truetype freetype-dir "${EPREFIX}/usr")
4137 - $(use_enable cjk gd-jis-conv)
4138 - $(use_with gd jpeg-dir "${EPREFIX}/usr")
4139 - $(use_with gd png-dir "${EPREFIX}/usr")
4140 - $(use_with xpm xpm-dir "${EPREFIX}/usr")
4141 - )
4142 - if use webp; then
4143 - our_conf+=( --with-webp-dir="${EPREFIX}/usr" )
4144 - fi
4145 - # enable gd last, so configure can pick up the previous settings
4146 - our_conf+=( $(use_with gd gd) )
4147 -
4148 - # IMAP support
4149 - if use imap ; then
4150 - our_conf+=(
4151 - $(use_with imap imap "${EPREFIX}/usr")
4152 - $(use_with ssl imap-ssl "${EPREFIX}/usr")
4153 - )
4154 - fi
4155 -
4156 - # Interbase/firebird support
4157 - our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") )
4158 -
4159 - # LDAP support
4160 - if use ldap ; then
4161 - our_conf+=(
4162 - $(use_with ldap ldap "${EPREFIX}/usr")
4163 - $(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr")
4164 - )
4165 - fi
4166 -
4167 - # MySQL support
4168 - local mysqllib="mysqlnd"
4169 - local mysqlilib="mysqlnd"
4170 -
4171 - our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
4172 -
4173 - local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock"
4174 - if use mysql || use mysqli ; then
4175 - our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") )
4176 - fi
4177 -
4178 - # ODBC support
4179 - our_conf+=(
4180 - $(use_with odbc unixODBC "${EPREFIX}/usr")
4181 - $(use_with iodbc iodbc "${EPREFIX}/usr")
4182 - )
4183 -
4184 - # Oracle support
4185 - our_conf+=( $(use_with oci8-instant-client oci8) )
4186 -
4187 - # PDO support
4188 - if use pdo ; then
4189 - our_conf+=(
4190 - $(use_with mssql pdo-dblib "${EPREFIX}/usr")
4191 - $(use_with mysql pdo-mysql "${mysqllib}")
4192 - $(use_with postgres pdo-pgsql)
4193 - $(use_with sqlite pdo-sqlite "${EPREFIX}/usr")
4194 - $(use_with firebird pdo-firebird "${EPREFIX}/usr")
4195 - $(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr")
4196 - $(use_with oci8-instant-client pdo-oci)
4197 - )
4198 - fi
4199 -
4200 - # readline/libedit support
4201 - our_conf+=(
4202 - $(use_with readline readline "${EPREFIX}/usr")
4203 - $(use_with libedit libedit "${EPREFIX}/usr")
4204 - )
4205 -
4206 - # Session support
4207 - if use session ; then
4208 - our_conf+=( $(use_with session-mm mm "${EPREFIX}/usr") )
4209 - else
4210 - our_conf+=( $(use_enable session session) )
4211 - fi
4212 -
4213 - # Use pic for shared modules such as apache2's mod_php
4214 - our_conf+=( --with-pic )
4215 -
4216 - # we use the system copy of pcre
4217 - # --with-pcre-regex affects ext/pcre
4218 - # --with-pcre-dir affects ext/filter and ext/zip
4219 - # --with-pcre-valgrind cannot be enabled with system pcre
4220 - # Many arches don't support pcre-jit
4221 - our_conf+=(
4222 - --with-pcre-regex="${EPREFIX}/usr"
4223 - --with-pcre-dir="${EPREFIX}/usr"
4224 - --without-pcre-valgrind
4225 - --without-pcre-jit
4226 - )
4227 -
4228 - # Catch CFLAGS problems
4229 - # Fixes bug #14067.
4230 - # Changed order to run it in reverse for bug #32022 and #12021.
4231 - replace-cpu-flags "k6*" "i586"
4232 -
4233 - # Cache the ./configure test results between SAPIs.
4234 - our_conf+=( --cache-file="${T}/config.cache" )
4235 -
4236 - # Support user-passed configuration parameters
4237 - our_conf+=( ${EXTRA_ECONF:-} )
4238 -
4239 - # Support the Apache2 extras, they must be set globally for all
4240 - # SAPIs to work correctly, especially for external PHP extensions
4241 -
4242 - mkdir -p "${WORKDIR}/sapis-build" || die
4243 - for one_sapi in $SAPIS ; do
4244 - use "${one_sapi}" || continue
4245 - php_set_ini_dir "${one_sapi}"
4246 -
4247 - # The BUILD_DIR variable is used to determine where to output
4248 - # the files that autotools creates. This was all originally
4249 - # based on the autotools-utils eclass.
4250 - BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}"
4251 - cp -a "${S}" "${BUILD_DIR}" || die
4252 - cd "${BUILD_DIR}" || die
4253 -
4254 - local sapi_conf=(
4255 - --with-config-file-path="${PHP_INI_DIR}"
4256 - --with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}"
4257 - )
4258 -
4259 - for sapi in $SAPIS ; do
4260 - case "$sapi" in
4261 - cli|cgi|embed|fpm|phpdbg)
4262 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
4263 - sapi_conf+=( "--enable-${sapi}" )
4264 - if [[ "fpm" == "${sapi}" ]] ; then
4265 - sapi_conf+=(
4266 - $(use_with acl fpm-acl)
4267 - $(use_with systemd fpm-systemd)
4268 - )
4269 - fi
4270 - else
4271 - sapi_conf+=( "--disable-${sapi}" )
4272 - fi
4273 - ;;
4274 -
4275 - apache2)
4276 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
4277 - sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" )
4278 - else
4279 - sapi_conf+=( --without-apxs2 )
4280 - fi
4281 - ;;
4282 - esac
4283 - done
4284 -
4285 - # Construct the $myeconfargs array by concatenating $our_conf
4286 - # (the common args) and $sapi_conf (the SAPI-specific args).
4287 - local myeconfargs=( "${our_conf[@]}" )
4288 - myeconfargs+=( "${sapi_conf[@]}" )
4289 -
4290 - pushd "${BUILD_DIR}" > /dev/null || die
4291 - econf "${myeconfargs[@]}"
4292 - popd > /dev/null || die
4293 - done
4294 -}
4295 -
4296 -src_compile() {
4297 - # snmp seems to run during src_compile, too (bug #324739)
4298 - addpredict /usr/share/snmp/mibs/.index #nowarn
4299 - addpredict /var/lib/net-snmp/mib_indexes #nowarn
4300 -
4301 - for sapi in ${SAPIS} ; do
4302 - if use "${sapi}"; then
4303 - cd "${WORKDIR}/sapis-build/$sapi" || \
4304 - die "Failed to change dir to ${WORKDIR}/sapis-build/$1"
4305 - emake
4306 - fi
4307 - done
4308 -}
4309 -
4310 -src_install() {
4311 - # see bug #324739 for what happens when we don't have that
4312 - addpredict /usr/share/snmp/mibs/.index #nowarn
4313 -
4314 - # grab the first SAPI that got built and install common files from there
4315 - local first_sapi=""
4316 - for sapi in $SAPIS ; do
4317 - if use $sapi ; then
4318 - first_sapi=$sapi
4319 - break
4320 - fi
4321 - done
4322 -
4323 - # Makefile forgets to create this before trying to write to it...
4324 - dodir "${PHP_DESTDIR#${EPREFIX}}/bin"
4325 -
4326 - # Install php environment (without any sapis)
4327 - cd "${WORKDIR}/sapis-build/$first_sapi" || die
4328 - emake INSTALL_ROOT="${D}" \
4329 - install-build install-headers install-programs
4330 -
4331 - local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)"
4332 -
4333 - # Create the directory where we'll put version-specific php scripts
4334 - keepdir "/usr/share/php${PHP_MV}"
4335 -
4336 - local sapi="", file=""
4337 - local sapi_list=""
4338 -
4339 - for sapi in ${SAPIS}; do
4340 - if use "${sapi}" ; then
4341 - einfo "Installing SAPI: ${sapi}"
4342 - cd "${WORKDIR}/sapis-build/${sapi}" || die
4343 -
4344 - if [[ "${sapi}" == "apache2" ]] ; then
4345 - # We're specifically not using emake install-sapi as libtool
4346 - # may cause unnecessary relink failures (see bug #351266)
4347 - insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/"
4348 - newins ".libs/libphp${PHP_MV}$(get_libname)" \
4349 - "libphp${PHP_MV}$(get_libname)"
4350 - keepdir "/usr/$(get_libdir)/apache2/modules"
4351 - else
4352 - # needed each time, php_install_ini would reset it
4353 - local dest="${PHP_DESTDIR#${EPREFIX}}"
4354 - into "${dest}"
4355 - case "$sapi" in
4356 - cli)
4357 - source="sapi/cli/php"
4358 - ;;
4359 - cgi)
4360 - source="sapi/cgi/php-cgi"
4361 - ;;
4362 - fpm)
4363 - source="sapi/fpm/php-fpm"
4364 - ;;
4365 - embed)
4366 - source="libs/libphp${PHP_MV}$(get_libname)"
4367 - ;;
4368 - phpdbg)
4369 - source="sapi/phpdbg/phpdbg"
4370 - ;;
4371 - *)
4372 - die "unhandled sapi in src_install"
4373 - ;;
4374 - esac
4375 -
4376 - if [[ "${source}" == *"$(get_libname)" ]]; then
4377 - dolib.so "${source}"
4378 - else
4379 - dobin "${source}"
4380 - local name="$(basename ${source})"
4381 - dosym "${dest}/bin/${name}" "/usr/bin/${name}${SLOT}"
4382 - fi
4383 - fi
4384 -
4385 - php_install_ini "${sapi}"
4386 -
4387 - # construct correct SAPI string for php-config
4388 - # thanks to ferringb for the bash voodoo
4389 - if [[ "${sapi}" == "apache2" ]]; then
4390 - sapi_list="${sapi_list:+${sapi_list} }apache2handler"
4391 - else
4392 - sapi_list="${sapi_list:+${sapi_list} }${sapi}"
4393 - fi
4394 - fi
4395 - done
4396 -
4397 - # Installing opcache module
4398 - if use opcache ; then
4399 - into "${PHP_DESTDIR#${EPREFIX}}"
4400 - dolib.so "modules/opcache$(get_libname)"
4401 - fi
4402 -
4403 - # Install env.d files
4404 - newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}"
4405 - sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
4406 - sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
4407 -
4408 - # set php-config variable correctly (bug #278439)
4409 - sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \
4410 - "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die
4411 -
4412 - if use fpm ; then
4413 - if use systemd; then
4414 - systemd_newunit "${FILESDIR}/php-fpm_at.service" \
4415 - "php-fpm@${SLOT}.service"
4416 - else
4417 - systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \
4418 - "php-fpm@${SLOT}.service"
4419 - fi
4420 - fi
4421 -}
4422 -
4423 -src_test() {
4424 - echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
4425 - PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
4426 - if [[ ! -x "${PHP_BIN}" ]] ; then
4427 - ewarn "Test phase requires USE=cli, skipping"
4428 - return
4429 - else
4430 - export TEST_PHP_EXECUTABLE="${PHP_BIN}"
4431 - fi
4432 -
4433 - if [[ -x "${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" ]] ; then
4434 - export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi"
4435 - fi
4436 -
4437 - if [[ -x "${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" ]] ; then
4438 - export TEST_PHPDBG_EXECUTABLE="${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg"
4439 - fi
4440 -
4441 - REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \
4442 - "session.save_path=${T}" \
4443 - "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \
4444 - "session.save_path=${T}"
4445 -
4446 - for name in ${EXPECTED_TEST_FAILURES}; do
4447 - mv "${name}.out" "${name}.out.orig" 2>/dev/null || die
4448 - done
4449 -
4450 - local failed="$(find -name '*.out')"
4451 - if [[ ${failed} != "" ]] ; then
4452 - ewarn "The following test cases failed unexpectedly:"
4453 - for name in ${failed}; do
4454 - ewarn " ${name/.out/}"
4455 - done
4456 - else
4457 - einfo "No unexpected test failures, all fine"
4458 - fi
4459 -
4460 - if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
4461 - local passed=""
4462 - for name in ${EXPECTED_TEST_FAILURES}; do
4463 - [[ -f "${name}.diff" ]] && continue
4464 - passed="${passed} ${name}"
4465 - done
4466 - if [[ ${passed} != "" ]] ; then
4467 - einfo "The following test cases passed unexpectedly:"
4468 - for name in ${passed}; do
4469 - ewarn " ${passed}"
4470 - done
4471 - else
4472 - einfo "None of the known-to-fail tests passed, all fine"
4473 - fi
4474 - fi
4475 -}
4476 -
4477 -pkg_postinst() {
4478 - # Output some general info to the user
4479 - if use apache2 ; then
4480 - elog
4481 - elog "To enable PHP in apache, you will need to add \"-D PHP\" to"
4482 - elog "your apache2 command. OpenRC users can append that string to"
4483 - elog "APACHE2_OPTS in /etc/conf.d/apache2."
4484 - elog
4485 - elog "The apache module configuration file 70_mod_php.conf is"
4486 - elog "provided (and maintained) by eselect-php."
4487 - elog
4488 - fi
4489 -
4490 - # Create the symlinks for php
4491 - for m in ${SAPIS}; do
4492 - [[ ${m} == 'embed' ]] && continue;
4493 - if use $m ; then
4494 - local ci=$(eselect php show $m)
4495 - if [[ -z $ci ]]; then
4496 - eselect php set $m php${SLOT} || die
4497 - einfo "Switched ${m} to use php:${SLOT}"
4498 - einfo
4499 - elif [[ $ci != "php${SLOT}" ]] ; then
4500 - elog "To switch $m to use php:${SLOT}, run"
4501 - elog " eselect php set $m php${SLOT}"
4502 - elog
4503 - fi
4504 - fi
4505 - done
4506 -
4507 - # Remove dead symlinks for SAPIs that were just disabled. For
4508 - # example, if the user has the cgi SAPI enabled, then he has an
4509 - # eselect-php symlink for it. If he later reinstalls PHP with
4510 - # USE="-cgi", that symlink will break. This call to eselect is
4511 - # supposed to remove that dead link per bug 572436.
4512 - eselect php cleanup || die
4513 -
4514 - if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then
4515 - elog "To build extensions for this version of PHP, you will need to"
4516 - elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable."
4517 - elog
4518 - fi
4519 -
4520 - # Warn about the removal of PHP_INI_VERSION if the user has it set.
4521 - if [[ -n "${PHP_INI_VERSION}" ]]; then
4522 - ewarn 'The PHP_INI_VERSION variable has been phased out. You may'
4523 - ewarn 'remove it from your configuration at your convenience. See'
4524 - ewarn
4525 - ewarn ' https://bugs.gentoo.org/611214'
4526 - ewarn
4527 - ewarn 'for more information.'
4528 - fi
4529 -
4530 - elog "For details on how version slotting works, please see"
4531 - elog "the wiki:"
4532 - elog
4533 - elog " https://wiki.gentoo.org/wiki/PHP"
4534 - elog
4535 -}
4536 -
4537 -pkg_postrm() {
4538 - # This serves two purposes. First, if we have just removed the last
4539 - # installed version of PHP, then this will remove any dead symlinks
4540 - # belonging to eselect-php. Second, if a user upgrades slots from
4541 - # (say) 5.6 to 7.0 and depcleans the old slot, then this will update
4542 - # his existing symlinks to point to the new 7.0 installation. The
4543 - # latter is bug 432962.
4544 - #
4545 - # Note: the eselect-php package may not be installed at this point,
4546 - # so we can't die() if this command fails.
4547 - eselect php cleanup
4548 -}