31 |
31 |
threads"
|
32 |
32 |
|
33 |
33 |
IUSE="${IUSE} acl apparmor argon2 avif bcmath berkdb bzip2 calendar
|
34 |
|
cdb cjk coverage +ctype curl debug
|
|
34 |
cdb cjk +ctype curl debug
|
35 |
35 |
enchant exif ffi +fileinfo +filter firebird
|
36 |
36 |
+flatfile ftp gd gdbm gmp +iconv imap inifile
|
37 |
37 |
intl iodbc ipv6 +jit kerberos ldap ldap-sasl libedit lmdb
|
... | ... | |
39 |
39 |
oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
|
40 |
40 |
readline selinux +session session-mm sharedmem
|
41 |
41 |
+simplexml snmp soap sockets sodium spell sqlite ssl
|
42 |
|
sysvipc systemd test tidy +tokenizer tokyocabinet truetype unicode webp
|
43 |
|
+xml xmlreader xmlwriter xpm xslt zip zlib"
|
|
42 |
sysvipc systemd test tidy +tokenizer tokyocabinet truetype unicode
|
|
43 |
valgrind webp +xml xmlreader xmlwriter xpm xslt zip zlib"
|
44 |
44 |
|
45 |
45 |
# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
|
46 |
46 |
# The Oracle instant client provides its own incompatible ldap library.
|
... | ... | |
67 |
67 |
mysql? ( || ( mysqli pdo ) )
|
68 |
68 |
firebird? ( pdo )
|
69 |
69 |
mssql? ( pdo )
|
|
70 |
test? ( cli )
|
70 |
71 |
"
|
71 |
72 |
|
72 |
73 |
RESTRICT="!test? ( test )"
|
... | ... | |
78 |
79 |
>=app-eselect/eselect-php-0.9.7[apache2?,fpm?]
|
79 |
80 |
>=dev-libs/libpcre2-10.30[jit?,unicode]
|
80 |
81 |
virtual/libcrypt:=
|
81 |
|
fpm? ( acl? ( sys-apps/acl ) apparmor? ( sys-libs/libapparmor ) )
|
|
82 |
fpm? ( acl? ( sys-apps/acl ) apparmor? ( sys-libs/libapparmor ) selinux? ( sys-libs/libselinux ) )
|
82 |
83 |
apache2? ( www-servers/apache[apache2_modules_unixd(+),threads=] )
|
83 |
84 |
argon2? ( app-crypt/argon2:= )
|
84 |
85 |
avif? ( media-libs/libavif:= )
|
85 |
86 |
berkdb? ( || ( sys-libs/db:5.3 sys-libs/db:4.8 ) )
|
86 |
87 |
bzip2? ( app-arch/bzip2:0= )
|
87 |
88 |
cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
|
88 |
|
coverage? ( dev-util/lcov )
|
89 |
89 |
curl? ( >=net-misc/curl-7.29.0 )
|
90 |
90 |
enchant? ( app-text/enchant:2 )
|
91 |
91 |
ffi? ( >=dev-libs/libffi-3.0.11:= )
|
... | ... | |
118 |
118 |
tokyocabinet? ( dev-db/tokyocabinet )
|
119 |
119 |
truetype? ( =media-libs/freetype-2* )
|
120 |
120 |
unicode? ( dev-libs/oniguruma:= )
|
|
121 |
valgrind? ( dev-util/valgrind )
|
121 |
122 |
webp? ( media-libs/libwebp:0= )
|
122 |
123 |
xml? ( >=dev-libs/libxml2-2.9.0 )
|
123 |
124 |
xpm? ( x11-libs/libXpm )
|
... | ... | |
148 |
149 |
PATCHES=(
|
149 |
150 |
"${FILESDIR}/php-iodbc-header-location.patch"
|
150 |
151 |
"${FILESDIR}/php-capstone-optional.patch"
|
|
152 |
"${FILESDIR}/php-8.2.8-openssl-tests.patch"
|
151 |
153 |
)
|
152 |
154 |
|
153 |
155 |
php_install_ini() {
|
... | ... | |
224 |
226 |
eautoconf --force
|
225 |
227 |
eautoheader
|
226 |
228 |
|
227 |
|
# Remove false positive test failures
|
228 |
|
# stream_isatty fails due to portage redirects
|
229 |
|
# curl tests here fail for network sandbox issues
|
230 |
|
# session tests here fail because we set the session directory to $T
|
231 |
|
rm tests/output/stream_isatty_err.phpt \
|
232 |
|
tests/output/stream_isatty_out-err.phpt \
|
233 |
|
tests/output/stream_isatty_out.phpt \
|
234 |
|
ext/curl/tests/bug76675.phpt \
|
235 |
|
ext/curl/tests/bug77535.phpt \
|
236 |
|
ext/curl/tests/curl_error_basic.phpt \
|
237 |
|
ext/session/tests/bug74514.phpt \
|
238 |
|
ext/session/tests/bug74936.phpt || die
|
|
229 |
# missing skipif; fixed upstream already
|
|
230 |
rm sapi/cgi/tests/005.phpt || die
|
239 |
231 |
|
|
232 |
# These three get BORKED on no-ipv6 systems,
|
|
233 |
#
|
|
234 |
# https://github.com/php/php-src/pull/11651
|
|
235 |
#
|
|
236 |
rm ext/sockets/tests/mcast_ipv6_recv.phpt \
|
|
237 |
ext/sockets/tests/mcast_ipv6_recv_limited.phpt \
|
|
238 |
ext/sockets/tests/mcast_ipv6_send.phpt \
|
|
239 |
|| die
|
|
240 |
|
|
241 |
# fails in a network sandbox,
|
|
242 |
#
|
|
243 |
# https://github.com/php/php-src/issues/11662
|
|
244 |
#
|
|
245 |
rm ext/sockets/tests/bug63000.phpt || die
|
|
246 |
|
|
247 |
# expected output needs to be updated,
|
|
248 |
#
|
|
249 |
# https://github.com/php/php-src/pull/11648
|
|
250 |
#
|
|
251 |
rm ext/dba/tests/dba_tcadb.phpt || die
|
|
252 |
|
|
253 |
# Two IMAP tests missing SKIPIFs,
|
|
254 |
#
|
|
255 |
# https://github.com/php/php-src/pull/11654
|
|
256 |
#
|
|
257 |
rm ext/imap/tests/imap_mutf7_to_utf8.phpt \
|
|
258 |
ext/imap/tests/imap_utf8_to_mutf7_basic.phpt \
|
|
259 |
|| die
|
|
260 |
|
|
261 |
# broken upstream with icu-73.x,
|
|
262 |
#
|
|
263 |
# https://github.com/php/php-src/issues/11128
|
|
264 |
#
|
|
265 |
rm ext/intl/tests/calendar_clear_variation1.phpt || die
|
|
266 |
|
|
267 |
# overly sensitive to INI values; fixes sent upstream:
|
|
268 |
#
|
|
269 |
# https://github.com/php/php-src/pull/11631
|
|
270 |
#
|
|
271 |
rm ext/session/tests/{bug74514,bug74936,gh7787}.phpt || die
|
|
272 |
|
|
273 |
# This is sensitive to the current "nice" level:
|
|
274 |
#
|
|
275 |
# https://github.com/php/php-src/issues/11630
|
|
276 |
#
|
|
277 |
rm ext/standard/tests/general_functions/proc_nice_basic.phpt || die
|
|
278 |
|
|
279 |
# Tests ignoring the "-n" flag we pass to run-tests.php,
|
|
280 |
#
|
|
281 |
# https://github.com/php/php-src/pull/11669
|
|
282 |
#
|
|
283 |
rm ext/standard/tests/file/bug60120.phpt \
|
|
284 |
ext/standard/tests/general_functions/proc_open_null.phpt \
|
|
285 |
ext/standard/tests/general_functions/proc_open_redirect.phpt \
|
|
286 |
ext/standard/tests/general_functions/proc_open_sockets1.phpt \
|
|
287 |
ext/standard/tests/general_functions/proc_open_sockets2.phpt \
|
|
288 |
ext/standard/tests/general_functions/proc_open_sockets3.phpt \
|
|
289 |
ext/standard/tests/ini_info/php_ini_loaded_file.phpt \
|
|
290 |
sapi/cli/tests/016.phpt \
|
|
291 |
sapi/cli/tests/023.phpt \
|
|
292 |
sapi/cli/tests/bug65275.phpt \
|
|
293 |
sapi/cli/tests/bug74600.phpt \
|
|
294 |
sapi/cli/tests/bug78323.phpt \
|
|
295 |
|| die
|
|
296 |
|
|
297 |
# Same TEST_PHP_EXTRA_ARGS (-n) issue with this one, but it's
|
|
298 |
# already been fixed upstream.
|
|
299 |
rm sapi/cli/tests/017.phpt || die
|
|
300 |
|
|
301 |
# Most Oracle tests are borked,
|
|
302 |
#
|
|
303 |
# * https://github.com/php/php-src/issues/11804
|
|
304 |
# * https://github.com/php/php-src/pull/11820
|
|
305 |
# * https://github.com/php/php-src/issues/11819
|
|
306 |
#
|
|
307 |
rm ext/oci8/tests/*.phpt || die
|
240 |
308 |
}
|
241 |
309 |
|
242 |
310 |
src_configure() {
|
243 |
311 |
addpredict /usr/share/snmp/mibs/.index #nowarn
|
244 |
312 |
addpredict /var/lib/net-snmp/mib_indexes #nowarn
|
245 |
313 |
|
246 |
|
PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
|
247 |
|
|
248 |
314 |
# https://bugs.gentoo.org/866683, https://bugs.gentoo.org/913527
|
249 |
315 |
filter-lto
|
250 |
316 |
|
|
317 |
PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
|
|
318 |
|
|
319 |
# Don't allow ./configure to detect and use an existing version
|
|
320 |
# of PHP; this can lead to all sorts of weird unpredictability
|
|
321 |
# as in bug 900210.
|
|
322 |
export ac_cv_prog_PHP=""
|
|
323 |
|
251 |
324 |
# The php-fpm config file wants localstatedir to be ${EPREFIX}/var
|
252 |
325 |
# and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002.
|
253 |
326 |
local our_conf=(
|
... | ... | |
259 |
332 |
--localstatedir="${EPREFIX}/var"
|
260 |
333 |
--without-pear
|
261 |
334 |
--without-valgrind
|
|
335 |
--enable-ipv6
|
262 |
336 |
$(use_enable threads zts)
|
263 |
337 |
)
|
264 |
338 |
|
... | ... | |
269 |
343 |
$(use_enable bcmath)
|
270 |
344 |
$(use_with bzip2 bz2 "${EPREFIX}/usr")
|
271 |
345 |
$(use_enable calendar)
|
272 |
|
$(use_enable coverage gcov)
|
273 |
346 |
$(use_enable ctype)
|
274 |
347 |
$(use_with curl)
|
275 |
348 |
$(use_enable xml dom)
|
... | ... | |
296 |
369 |
$(use_enable opcache)
|
297 |
370 |
$(use_with postgres pgsql "${EPREFIX}/usr")
|
298 |
371 |
$(use_enable posix)
|
|
372 |
$(use_with selinux fpm-selinux)
|
299 |
373 |
$(use_with spell pspell "${EPREFIX}/usr")
|
300 |
374 |
$(use_enable simplexml)
|
301 |
375 |
$(use_enable sharedmem shmop)
|
... | ... | |
316 |
390 |
$(use_with zip)
|
317 |
391 |
$(use_with zlib zlib "${EPREFIX}/usr")
|
318 |
392 |
$(use_enable debug)
|
|
393 |
$(use_with valgrind)
|
319 |
394 |
)
|
320 |
395 |
|
321 |
396 |
# DBA support
|
... | ... | |
364 |
439 |
fi
|
365 |
440 |
|
366 |
441 |
# MySQL support
|
367 |
|
our_conf+=( $(use_with mysqli mysqli "mysqlnd") )
|
|
442 |
our_conf+=( $(use_with mysqli) )
|
368 |
443 |
|
369 |
444 |
local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock"
|
370 |
445 |
if use mysql || use mysqli ; then
|
... | ... | |
444 |
519 |
# Support the Apache2 extras, they must be set globally for all
|
445 |
520 |
# SAPIs to work correctly, especially for external PHP extensions
|
446 |
521 |
|
|
522 |
# Create separate build trees for each enabled SAPI. The upstream
|
|
523 |
# build system doesn't do this, but we have to do it to use a
|
|
524 |
# different php.ini for each SAPI (see --with-config-file-path and
|
|
525 |
# --with-config-file-scan-dir below). The path winds up define'd
|
|
526 |
# in main/build-defs.h which is included in main/php.h which is
|
|
527 |
# included by basically everything; so, avoiding a rebuild after
|
|
528 |
# changing it is not an easy job.
|
447 |
529 |
local one_sapi
|
448 |
530 |
local sapi
|
449 |
|
mkdir -p "${WORKDIR}/sapis-build" || die
|
|
531 |
mkdir "${WORKDIR}/sapis-build" || die
|
450 |
532 |
for one_sapi in $SAPIS ; do
|
451 |
533 |
use "${one_sapi}" || continue
|
452 |
534 |
php_set_ini_dir "${one_sapi}"
|
... | ... | |
456 |
538 |
# based on the autotools-utils eclass.
|
457 |
539 |
BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}"
|
458 |
540 |
cp -a "${S}" "${BUILD_DIR}" || die
|
459 |
|
cd "${BUILD_DIR}" || die
|
460 |
541 |
|
461 |
542 |
local sapi_conf=(
|
462 |
543 |
--with-config-file-path="${PHP_INI_DIR}"
|
... | ... | |
495 |
576 |
myeconfargs+=( "${sapi_conf[@]}" )
|
496 |
577 |
|
497 |
578 |
pushd "${BUILD_DIR}" > /dev/null || die
|
|
579 |
einfo "Running econf in ${BUILD_DIR}"
|
498 |
580 |
econf "${myeconfargs[@]}"
|
499 |
581 |
popd > /dev/null || die
|
500 |
582 |
done
|
... | ... | |
505 |
587 |
addpredict /usr/share/snmp/mibs/.index #nowarn
|
506 |
588 |
addpredict /var/lib/net-snmp/mib_indexes #nowarn
|
507 |
589 |
|
|
590 |
if use oci8-instant-client && use kerberos && use imap && use phar; then
|
|
591 |
# A conspiracy takes place when the first three of these flags
|
|
592 |
# are set together, causing the newly-built "php" to open
|
|
593 |
# /dev/urandom with mode rw when it starts. That's not actually
|
|
594 |
# a problem... unless you also have USE=phar, which runs that
|
|
595 |
# "php" to build some phar thingy in src_compile(). Later in
|
|
596 |
# src_test(), portage (at least) sets "addpredict /" so the
|
|
597 |
# problem does not repeat.
|
|
598 |
addpredict /dev/urandom #nowarn
|
|
599 |
fi
|
|
600 |
|
508 |
601 |
local sapi
|
509 |
602 |
for sapi in ${SAPIS} ; do
|
510 |
|
if use "${sapi}"; then
|
511 |
|
cd "${WORKDIR}/sapis-build/$sapi" || \
|
512 |
|
die "Failed to change dir to ${WORKDIR}/sapis-build/$1"
|
513 |
|
emake
|
514 |
|
fi
|
|
603 |
use "${sapi}" && emake -C "${WORKDIR}/sapis-build/${sapi}"
|
515 |
604 |
done
|
516 |
605 |
}
|
517 |
606 |
|
... | ... | |
634 |
723 |
}
|
635 |
724 |
|
636 |
725 |
src_test() {
|
637 |
|
echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
|
638 |
|
PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
|
639 |
|
if [[ ! -x "${PHP_BIN}" ]] ; then
|
640 |
|
ewarn "Test phase requires USE=cli, skipping"
|
641 |
|
return
|
642 |
|
else
|
643 |
|
export TEST_PHP_EXECUTABLE="${PHP_BIN}"
|
644 |
|
fi
|
|
726 |
export TEST_PHP_EXECUTABLE="${WORKDIR}/sapis-build/cli/sapi/cli/php"
|
|
727 |
|
|
728 |
# Sometimes when the sub-php launches a sub-sub-php, it uses these.
|
|
729 |
# Without an "-n" in all instances, the *live* php.ini can be loaded,
|
|
730 |
# pulling in *live* zend extensions. And those can be incompatible
|
|
731 |
# with the thing we just built.
|
|
732 |
export TEST_PHP_EXTRA_ARGS="-n"
|
645 |
733 |
|
646 |
734 |
if [[ -x "${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" ]] ; then
|
647 |
735 |
export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi"
|
... | ... | |
651 |
739 |
export TEST_PHPDBG_EXECUTABLE="${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg"
|
652 |
740 |
fi
|
653 |
741 |
|
654 |
|
SKIP_ONLINE_TESTS=1 REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \
|
655 |
|
"session.save_path=${T}" \
|
656 |
|
"${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \
|
657 |
|
"session.save_path=${T}"
|
658 |
|
|
659 |
|
for name in ${EXPECTED_TEST_FAILURES}; do
|
660 |
|
mv "${name}.out" "${name}.out.orig" 2>/dev/null || die
|
661 |
|
done
|
662 |
|
|
663 |
|
local failed="$(find -name '*.out')"
|
664 |
|
if [[ ${failed} != "" ]] ; then
|
665 |
|
ewarn "The following test cases failed unexpectedly:"
|
666 |
|
for name in ${failed}; do
|
667 |
|
ewarn " ${name/.out/}"
|
668 |
|
done
|
669 |
|
else
|
670 |
|
einfo "No unexpected test failures, all fine"
|
671 |
|
fi
|
672 |
|
|
673 |
|
if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
|
674 |
|
local passed=""
|
675 |
|
for name in ${EXPECTED_TEST_FAILURES}; do
|
676 |
|
[[ -f "${name}.diff" ]] && continue
|
677 |
|
passed="${passed} ${name}"
|
678 |
|
done
|
679 |
|
if [[ ${passed} != "" ]] ; then
|
680 |
|
einfo "The following test cases passed unexpectedly:"
|
681 |
|
for name in ${passed}; do
|
682 |
|
ewarn " ${passed}"
|
683 |
|
done
|
684 |
|
else
|
685 |
|
einfo "None of the known-to-fail tests passed, all fine"
|
686 |
|
fi
|
687 |
|
fi
|
|
742 |
# The sendmail override prevents ext/imap/tests/bug77020.phpt from
|
|
743 |
# actually trying to send mail, and will be fixed upstream soon:
|
|
744 |
#
|
|
745 |
# https://github.com/php/php-src/issues/11629
|
|
746 |
#
|
|
747 |
# The IO capture tests need to be disabled because they fail when
|
|
748 |
# std{in,out,err} are redirected (as they are within portage).
|
|
749 |
#
|
|
750 |
# One -n applies to the top-level "php", while the other applies
|
|
751 |
# to any sub-php that get invoked by the test runner.
|
|
752 |
SKIP_IO_CAPTURE_TESTS=1 SKIP_PERF_SENSITIVE=1 REPORT_EXIT_STATUS=1 \
|
|
753 |
"${TEST_PHP_EXECUTABLE}" -n \
|
|
754 |
"${WORKDIR}/sapis-build/cli/run-tests.php" --offline -n -q \
|
|
755 |
-d "session.save_path=${T}" \
|
|
756 |
-d "sendmail_path=echo >/dev/null" \
|
|
757 |
|| die "tests failed"
|
688 |
758 |
}
|
689 |
759 |
|
690 |
760 |
pkg_postinst() {
|