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