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