diff options
Diffstat (limited to 'dev-lang/php')
-rw-r--r-- | dev-lang/php/Manifest | 6 | ||||
-rw-r--r-- | dev-lang/php/php-8.2.28.ebuild | 2 | ||||
-rw-r--r-- | dev-lang/php/php-8.4.5.ebuild (renamed from dev-lang/php/php-8.1.30.ebuild) | 368 |
3 files changed, 192 insertions, 184 deletions
diff --git a/dev-lang/php/Manifest b/dev-lang/php/Manifest index 5aacdc8a428d..f14bc6f9d4e0 100644 --- a/dev-lang/php/Manifest +++ b/dev-lang/php/Manifest @@ -12,12 +12,12 @@ AUX php-capstone-optional.patch 2497 BLAKE2B f23236130be88d28d933d5482f1925c4e32 AUX php-fpm_at-simple.service 316 BLAKE2B 0ba10f3e3b004fbf14956e1e4f04f59b8a127e6717fe6b92c09b9f931033a11551c75fbbee9010f6b694c5a8758ca0eec9eed457ae304ba0dea8f2c256c3b8d4 SHA512 7367a3f8d3874f8e0c76f331ba613a0250db02f60ad9f87affaf448dcb5bc34bcecb91d88f415764a12b24b46ae3d1b738a002af9f77a4b707e916e83a0021fd AUX php-fpm_at.service 317 BLAKE2B f13fc38fcc0575a8517ee8d07b120efda37eabd2355061d0fdc303604c6b02ad42d7301180d86c977d5e585f5dd685343c592e37a6e0f44933707be79e0b77e0 SHA512 27982f9e2d958bfa75c89c7d3531e48d17fc388b1cdcbc8e09051b236b1184ee2baabdfcc567c19d9fcd067d4b3b86f171015616d8da42fccdabd89432d865e8 AUX php-iodbc-header-location.patch 481 BLAKE2B 9ea6a5d529dc7a8c78eeee800900372bc14309a05e352b2838da32e1384b61b507fdb623c9400094aa5b637eb1a87da92c72600eff79b18b8989ef90af56a0fa SHA512 86469f657d8807f005c28fd2149770c881add8f243fdfea087956c7987277597fe400a7af23f624f26da270356604717ed9cd04771154d7cf2ffe7237972372b -DIST php-8.1.30.tar.xz 11850340 BLAKE2B 9053c57814f53ff694ea6cf1a87253e4f8f7c5af6965a85109eca143abd8dd6c733c7f70d1c6cdc34db8932dd7e9e8289cebce37eef385ea51dc0cd8a71267ef SHA512 cdca1c1671362272bf6c2abf45d097b42ca06c0abf962ee814bf478f8b346f274f42a1b1aa6603cdd59a1978a8b9d1971b589706f2909b6ea34594de0edaee1e DIST php-8.2.24.tar.xz 12110000 BLAKE2B 0f5c47350b8914f87cfbee932ea2e24d29635a0bdfed111b02e81d05574ff973f657d077858c20497bdc380285305d6c0f632eee1bbc9358f84004019108e368 SHA512 19016bfb955892a9999f01a619ab26035afe1cfb6488c7d1774d6745b703afb99e59032728ab811024413757e50163cdc32b0e95fda7e1d4243deb96568c7e79 DIST php-8.2.28.tar.xz 12147756 BLAKE2B eb2c5ad888f98b217d553efaa5f9832c791d7dcb73e90c1f0a45b536f3cbfd8f76c0606f993ca39492e43f587f5c0be1f1adac80c3ae7281527b8b381176f3bb SHA512 af2a4f43da756a78f762dbd2b9e589e52864c7069fd55a6a2b900e32a08728a7d69b80577dc79b5d4a86993846a2232b809b75ae415344935610a3934b10c6ba DIST php-8.3.19.tar.xz 12560852 BLAKE2B 19fb3ee207939b497ef65960a3b691beddaecfc70c2d408a9249e048605c2a3b4eb26da362c4e8283318c03c6464ba66537eafef854615db267886ff7a6351a0 SHA512 2872639f6a6de1680540da5a2df43db7ceeb7e25690b6f66d73373779ee3f9b0c2fe74aeeb7181749c9738b64f8d41b8a6f496751778c1df10b7f9aab43f21f7 -EBUILD php-8.1.30.ebuild 22586 BLAKE2B a35ef5ea9b28ea0c0d40082aa7a9750158477f173c4eae88bb2ef4a44687a329c5152879e9759a02df8c6ad12cdb8e6762b0750cae3cd04102e3bc0acf0826ad SHA512 f383cca672b5a647e52d1def2537411f3e44d791fcafc62a665a2d1a9aed779d116f4d4b5323b7a510b03a9296677462e53277b34e48efeb86fb76f61bccc40c +DIST php-8.4.5.tar.xz 13604056 BLAKE2B d15b53abe74a1d22f17e8b799639daa66e6989b466e68cf045eb0ebe90a6b2f27190a40ead401b70a94f829ff3e860763e7c3945e3c2c5899aa2973d7e298b79 SHA512 02dc98ae1b8450eff1510bad40c790c1b0e79cb89cd63f40a43a0e538b7b19a70650105d01d6710bc4ecc1bc193f066c995f572f3b57f901f958db5a1f97c97c EBUILD php-8.2.24.ebuild 26595 BLAKE2B 62bff19d9e738b5e8da960d6fc8d41ff35723356017ef048e7a45d54e07b62a43dcd632837f3917654e5600097fe2c50d2247137c693bf20627773fc6054fb36 SHA512 3df0a5705098463bedd5362af4b4ec1c06797932c1c3ad666fd6be115c601409ec3cdec75342e7da520966a17e3a4db30f975a5dbc6ff2d762a0234e639720ff -EBUILD php-8.2.28.ebuild 26827 BLAKE2B eb64e3338a6ad134f8a8dc11b66b85164f15de59010207c426fcbbc6839a6529aecc6ee97e556ed5a6e12f58848bee81f6eef900859e2e8477b916b3f8af7975 SHA512 f17a796d5748e6045faf8650d2cc65dc67937052f4e8f6fc23bc20dbfccd0f89268bf051a088a333f1f6dd72cd206a526b3a93f047cb26aa63edc1982912820d +EBUILD php-8.2.28.ebuild 26822 BLAKE2B 94e3f32d40b96aad82e917606b39c916752a6d77336f3dc9b9ba38306c279691a0b889395d5ee206bfd3397da4c768359babe26c7cf5f28b28e404e6eca421ff SHA512 0cf4881f8c4b05eea0311507e0207ca0e35209ead489197712d3a252573124b6d4751f1b073fb6c33b02d65aad796eb03408d1551e1f6bc49d91f3c42235f9f4 EBUILD php-8.3.19.ebuild 24512 BLAKE2B 2c29b88c098f403a2de3b2645dbf3390a1a4691c98f965764f2b541096d7ae1cf4ea35082f82688bde6a300311388de9c60bbd8727a180ebddc162ddc06ee4da SHA512 95fd342e2f708ccbefca98edf71c9eddec3532a5297506c17841f3bb22af034be0ee84d3daa50bf0d9c1c20088a1ad9cb216735bc8b6830abbfb7b0146b4f90f +EBUILD php-8.4.5.ebuild 23664 BLAKE2B 42d0e49f58b797bc3f8834ee25d9c057e195de92094fe6c59324c16fb51c01641e038da28a89a776ed20bb849602b7f707d91afb2bec0ea438186334a98c6589 SHA512 fbf5f499e171f1965fb83aea339a7ddcea6eafe52d0aa1395d4bd46b6dfa3636e48348a2f81b299228fda603a5f942f68fde04d44a31761a6a5eecf257d88d8b MISC metadata.xml 4249 BLAKE2B 11f9270fbc0cae280ec3ec62c9e6acfc643f4c7952822537664e8bcdbdfed64805b0e83fcbfb83111123745fadf64b276b51e1e27c9b5eb38ef8ffc30965d12b SHA512 39c59d31de21a66ca55a4816bebd901c8f2b28b7d1340605845c535cc979bca4d8641280bf45782d5d3eb94820e054e7f52491a23a4d1cf692774e11becc55c1 diff --git a/dev-lang/php/php-8.2.28.ebuild b/dev-lang/php/php-8.2.28.ebuild index d7612d5e8ebb..13bf39dea366 100644 --- a/dev-lang/php/php-8.2.28.ebuild +++ b/dev-lang/php/php-8.2.28.ebuild @@ -20,7 +20,7 @@ LICENSE="PHP-3.01 unicode? ( BSD-2 LGPL-2.1 )" SLOT="$(ver_cut 1-2)" -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos" +KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~mips ~ppc ppc64 ~riscv ~s390 sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos" # We can build the following SAPIs in the given order SAPIS="embed cli cgi fpm apache2 phpdbg" diff --git a/dev-lang/php/php-8.1.30.ebuild b/dev-lang/php/php-8.4.5.ebuild index 3a8fb7290eb3..59e9a92dbefa 100644 --- a/dev-lang/php/php-8.1.30.ebuild +++ b/dev-lang/php/php-8.4.5.ebuild @@ -1,11 +1,11 @@ -# Copyright 1999-2024 Gentoo Authors +# Copyright 1999-2025 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 WANT_AUTOMAKE="none" - -inherit flag-o-matic multilib systemd autotools +POSTGRES_COMPAT=( {15..17} ) +inherit autotools flag-o-matic multilib postgres systemd DESCRIPTION="The PHP language runtime engine" HOMEPAGE="https://www.php.net/" @@ -16,11 +16,10 @@ LICENSE="PHP-3.01 Zend-2.0 bcmath? ( LGPL-2.1+ ) fpm? ( BSD-2 ) - gd? ( gd ) unicode? ( BSD-2 LGPL-2.1 )" SLOT="$(ver_cut 1-2)" -KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos" # We can build the following SAPIs in the given order SAPIS="embed cli cgi fpm apache2 phpdbg" @@ -31,29 +30,22 @@ IUSE="${IUSE} threads" IUSE="${IUSE} acl apparmor argon2 avif bcmath berkdb bzip2 calendar - cdb cjk coverage +ctype curl debug - enchant exif ffi +fileinfo +filter firebird - +flatfile ftp gd gdbm gmp +iconv imap inifile - intl iodbc ipv6 +jit kerberos ldap ldap-sasl libedit lmdb + capstone cdb +ctype curl debug + enchant exif ffi +fileinfo +filter + +flatfile ftp gd gdbm gmp +iconv inifile + intl iodbc ipv6 +jit jpeg ldap ldap-sasl libedit lmdb mhash mssql mysql mysqli nls - oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm - readline selinux +session session-mm sharedmem + odbc +opcache +opcache-jit pcntl pdo +phar +posix postgres png + qdbm readline selinux +session session-mm sharedmem +simplexml snmp soap sockets sodium spell sqlite ssl - sysvipc systemd test tidy +tokenizer tokyocabinet truetype unicode webp - +xml xmlreader xmlwriter xpm xslt zip zlib" + sysvipc systemd test tidy +tokenizer tokyocabinet truetype unicode + valgrind webp +xml xmlreader xmlwriter xpm xslt zip zlib" # Without USE=readline or libedit, the interactive "php -a" CLI will hang. -# The Oracle instant client provides its own incompatible ldap library. REQUIRED_USE=" || ( cli cgi fpm apache2 embed phpdbg ) - avif? ( gd zlib ) cli? ( ^^ ( readline libedit ) ) !cli? ( ?? ( readline libedit ) ) - truetype? ( gd zlib ) - webp? ( gd zlib ) - cjk? ( gd zlib ) - exif? ( gd zlib ) - xpm? ( gd zlib ) gd? ( zlib ) simplexml? ( xml ) soap? ( xml ) @@ -61,12 +53,12 @@ REQUIRED_USE=" xmlwriter? ( xml ) xslt? ( xml ) ldap-sasl? ( ldap ) - oci8-instant-client? ( !ldap ) qdbm? ( !gdbm ) session-mm? ( session !threads ) mysql? ( || ( mysqli pdo ) ) - firebird? ( pdo ) mssql? ( pdo ) + test? ( cli ) + postgres? ( ${POSTGRES_REQ_USE} ) " RESTRICT="!test? ( test )" @@ -75,58 +67,54 @@ RESTRICT="!test? ( test )" # the ./configure script. Other versions *work*, but we need to stick to # the ones that can be detected to avoid a repeat of bug #564824. COMMON_DEPEND=" - >=app-eselect/eselect-php-0.9.7[apache2?,fpm?] - >=dev-libs/libpcre2-10.30[jit?,unicode] + app-eselect/eselect-php[apache2?,fpm?] + dev-libs/libpcre2[jit?,unicode] virtual/libcrypt:= - fpm? ( acl? ( sys-apps/acl ) apparmor? ( sys-libs/libapparmor ) ) + fpm? ( acl? ( sys-apps/acl ) apparmor? ( sys-libs/libapparmor ) selinux? ( sys-libs/libselinux ) ) apache2? ( www-servers/apache[apache2_modules_unixd(+),threads=] ) argon2? ( app-crypt/argon2:= ) - avif? ( media-libs/libavif:= ) berkdb? ( || ( sys-libs/db:5.3 sys-libs/db:4.8 ) ) bzip2? ( app-arch/bzip2:0= ) + capstone? ( dev-libs/capstone ) cdb? ( || ( dev-db/cdb dev-db/tinycdb ) ) - coverage? ( dev-util/lcov ) - curl? ( >=net-misc/curl-7.29.0 ) + curl? ( net-misc/curl ) enchant? ( app-text/enchant:2 ) - ffi? ( >=dev-libs/libffi-3.0.11:= ) - firebird? ( dev-db/firebird ) - gd? ( media-libs/libjpeg-turbo:0= media-libs/libpng:0= ) - gdbm? ( >=sys-libs/gdbm-1.8.0:0= ) + ffi? ( dev-libs/libffi:= ) + gd? ( + >=media-libs/gd-2.3.3-r4[avif?,jpeg?,png?,truetype?,webp?,xpm?] + ) + gdbm? ( sys-libs/gdbm:0= ) gmp? ( dev-libs/gmp:0= ) iconv? ( virtual/libiconv ) - imap? ( net-libs/c-client[kerberos=,ssl=] ) intl? ( dev-libs/icu:= ) - kerberos? ( virtual/krb5 ) - ldap? ( >=net-nds/openldap-1.2.11:= ) + ldap? ( net-nds/openldap:= ) ldap-sasl? ( dev-libs/cyrus-sasl ) libedit? ( dev-libs/libedit ) lmdb? ( dev-db/lmdb:= ) mssql? ( dev-db/freetds[mssql] ) nls? ( sys-devel/gettext ) - oci8-instant-client? ( dev-db/oracle-instantclient[sdk] ) - odbc? ( iodbc? ( dev-db/libiodbc ) !iodbc? ( >=dev-db/unixODBC-1.8.13 ) ) - postgres? ( >=dev-db/postgresql-9.1:* ) + odbc? ( iodbc? ( dev-db/libiodbc ) !iodbc? ( dev-db/unixODBC ) ) + postgres? ( ${POSTGRES_DEP} ) qdbm? ( dev-db/qdbm ) readline? ( sys-libs/readline:0= ) session-mm? ( dev-libs/mm ) - snmp? ( >=net-analyzer/net-snmp-5.2 ) + snmp? ( net-analyzer/net-snmp ) sodium? ( dev-libs/libsodium:=[-minimal(-)] ) - spell? ( >=app-text/aspell-0.50 ) - sqlite? ( >=dev-db/sqlite-3.7.6.3 ) - ssl? ( >=dev-libs/openssl-1.0.2:0= ) + spell? ( app-text/aspell ) + sqlite? ( dev-db/sqlite ) + ssl? ( dev-libs/openssl:0= ) tidy? ( app-text/htmltidy ) tokyocabinet? ( dev-db/tokyocabinet ) - truetype? ( =media-libs/freetype-2* ) + truetype? ( media-libs/freetype ) unicode? ( dev-libs/oniguruma:= ) - webp? ( media-libs/libwebp:0= ) - xml? ( >=dev-libs/libxml2-2.9.0 ) - xpm? ( x11-libs/libXpm ) + valgrind? ( dev-debug/valgrind ) + xml? ( >=dev-libs/libxml2-2.12.5 ) xslt? ( dev-libs/libxslt ) - zip? ( >=dev-libs/libzip-1.2.0:= ) - zlib? ( >=sys-libs/zlib-1.2.0.4:0= ) + zip? ( dev-libs/libzip:= ) + zlib? ( sys-libs/zlib:0= ) " -IDEPEND=">=app-eselect/eselect-php-0.9.7[apache2?,fpm?]" +IDEPEND="app-eselect/eselect-php[apache2?,fpm?]" RDEPEND="${COMMON_DEPEND} virtual/mta @@ -139,22 +127,17 @@ RDEPEND="${COMMON_DEPEND} # have an incompatible version installed. See bug 593278. DEPEND="${COMMON_DEPEND} app-arch/xz-utils - >=sys-devel/bison-3.0.1" + sys-devel/bison" BDEPEND="virtual/pkgconfig" -PHP_MV="$(ver_cut 1)" - PATCHES=( - "${FILESDIR}/php-iodbc-header-location.patch" - "${FILESDIR}/php-capstone-optional.patch" - "${FILESDIR}/php-8.1.27-gcc14-libxml.patch" - "${FILESDIR}/php-8.1.27-implicit-decls.patch" - "${FILESDIR}/fix-musl-llvm.patch" - "${FILESDIR}/php-8.1.29-gcc14-intl.patch" + "${FILESDIR}/php-bug75457-pcre2-backport.patch" ) -# ARM/Windows functions that are expected to be undefined. +PHP_MV="$(ver_cut 1)" + +# ARM/Windows functions (bug 923335) QA_CONFIG_IMPL_DECL_SKIP=( __crc32d _controlfp @@ -177,15 +160,14 @@ php_install_ini() { local phpinisrc="php.ini-production-${phpsapi}" cp php.ini-production "${phpinisrc}" || die - # default to /tmp for save_path, bug #282768 - sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die - - # Set the extension dir - sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \ - -i "${phpinisrc}" || die - - # Set the include path to point to where we want to find PEAR packages - sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die + # Set the include path to point to where we want to find PEAR + # packages + local sed_src='^;include_path = ".:/php.*' + local include_path="." + include_path+=":${EPREFIX}/usr/share/php${PHP_MV}" + include_path+=":${EPREFIX}/usr/share/php" + local sed_dst="include_path = \"${include_path}\"" + sed -e "s|${sed_src}|${sed_dst}|" -i "${phpinisrc}" || die insinto "${PHP_INI_DIR#${EPREFIX}}" newins "${phpinisrc}" php.ini @@ -198,7 +180,7 @@ php_install_ini() { if use opcache; then elog "Adding opcache to $PHP_EXT_INI_DIR" - echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \ + echo "zend_extension = opcache.so" >> \ "${D}/${PHP_EXT_INI_DIR}"/opcache.ini dosym "../ext/opcache.ini" \ "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini" @@ -222,10 +204,14 @@ php_set_ini_dir() { PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active" } +pkg_setup() { + use postgres && postgres_pkg_setup +} + src_prepare() { default - # In php-7.x, the FPM pool configuration files have been split off + # In php-8.x, the FPM pool configuration files have been split off # of the main config. By default the pool config files go in # e.g. /etc/php-fpm.d, which isn't slotted. So here we move the # include directory to a subdirectory "fpm.d" of $PHP_INI_DIR. Later @@ -235,36 +221,72 @@ src_prepare() { sapi/fpm/php-fpm.conf.in \ || die 'failed to move the include directory in php-fpm.conf' - # Emulate buildconf to support cross-compilation - rm -fr aclocal.m4 autom4te.cache config.cache \ - configure main/php_config.h.in || die + # fails in a network sandbox, + # + # https://github.com/php/php-src/issues/11662 + # + rm ext/sockets/tests/bug63000.phpt || die + + # Tests ignoring the "-n" flag we pass to run-tests.php, + # + # https://github.com/php/php-src/pull/11669 + # + rm ext/standard/tests/file/bug60120.phpt \ + ext/standard/tests/general_functions/proc_open_null.phpt \ + ext/standard/tests/general_functions/proc_open_redirect.phpt \ + ext/standard/tests/general_functions/proc_open_sockets1.phpt \ + ext/standard/tests/general_functions/proc_open_sockets2.phpt \ + ext/standard/tests/general_functions/proc_open_sockets3.phpt \ + ext/standard/tests/ini_info/php_ini_loaded_file.phpt \ + sapi/cli/tests/016.phpt \ + sapi/cli/tests/023.phpt \ + sapi/cli/tests/bug65275.phpt \ + sapi/cli/tests/bug74600.phpt \ + sapi/cli/tests/bug78323.phpt \ + || die + + # Most tests failing with an external libgd have been fixed, + # but there are a few stragglers: + # + # * https://github.com/php/php-src/issues/11252 + # + rm ext/gd/tests/bug43073.phpt \ + ext/gd/tests/bug48732.phpt \ + ext/gd/tests/bug48732-mb.phpt \ + ext/gd/tests/bug48801.phpt \ + ext/gd/tests/bug48801-mb.phpt \ + ext/gd/tests/bug53504.phpt \ + ext/gd/tests/bug65148.phpt \ + ext/gd/tests/bug73272.phpt \ + || die + + # Test currently fails in the sandbox and the test for this variant + # might be broken Upstream discusses removing the test again. + # + # - https://github.com/php/php-src/commit/930624899bb996efc2f6a24b992ede90 + # + rm ext/standard/tests/file/bug72666_variation3.phpt || die + + # One-off, somebody forgot to update a version constant + rm ext/reflection/tests/ReflectionZendExtension.phpt || die + eautoconf --force - eautoheader - - # Remove false positive test failures - # stream_isatty fails due to portage redirects - # curl tests here fail for network sandbox issues - # session tests here fail because we set the session directory to $T - rm tests/output/stream_isatty_err.phpt \ - tests/output/stream_isatty_out-err.phpt \ - tests/output/stream_isatty_out.phpt \ - ext/curl/tests/bug76675.phpt \ - ext/curl/tests/bug77535.phpt \ - ext/curl/tests/curl_error_basic.phpt \ - ext/session/tests/bug74514.phpt \ - ext/session/tests/bug74936.phpt \ - ext/fileinfo/tests/bug78987.phpt || die } src_configure() { addpredict /usr/share/snmp/mibs/.index #nowarn addpredict /var/lib/net-snmp/mib_indexes #nowarn - PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}" - # https://bugs.gentoo.org/866683, https://bugs.gentoo.org/913527 filter-lto + PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}" + + # Don't allow ./configure to detect and use an existing version + # of PHP; this can lead to all sorts of weird unpredictability + # as in bug 900210. + export ac_cv_prog_PHP="" + # The php-fpm config file wants localstatedir to be ${EPREFIX}/var # and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002. local our_conf=( @@ -276,6 +298,7 @@ src_configure() { --localstatedir="${EPREFIX}/var" --without-pear --without-valgrind + --with-external-libcrypt $(use_enable threads zts) ) @@ -286,11 +309,10 @@ src_configure() { our_conf+=( $(use_with apparmor fpm-apparmor) $(use_with argon2 password-argon2 "${EPREFIX}/usr") - $(use_with avif) $(use_enable bcmath) $(use_with bzip2 bz2 "${EPREFIX}/usr") $(use_enable calendar) - $(use_enable coverage gcov) + $(use_with capstone) $(use_enable ctype) $(use_with curl) $(use_enable xml dom) @@ -307,7 +329,6 @@ src_configure() { $(use elibc_glibc || use elibc_musl || echo "${EPREFIX}/usr")) $(use_enable intl) $(use_enable ipv6) - $(use_with kerberos) $(use_with xml libxml) $(use_enable unicode mbstring) $(use_with ssl openssl) @@ -315,9 +336,10 @@ src_configure() { $(use_enable phar) $(use_enable pdo) $(use_enable opcache) - $(use_with postgres pgsql "${EPREFIX}/usr") + $(use_enable opcache-jit) + $(use_with postgres pgsql "$("${PG_CONFIG:-true}" --bindir)/..") $(use_enable posix) - $(use_with spell pspell "${EPREFIX}/usr") + $(use_with selinux fpm-selinux) $(use_enable simplexml) $(use_enable sharedmem shmop) $(use_with snmp snmp "${EPREFIX}/usr") @@ -337,6 +359,18 @@ src_configure() { $(use_with zip) $(use_with zlib zlib "${EPREFIX}/usr") $(use_enable debug) + $(use_with valgrind) + ) + + # Override autoconf cache variables for libcrypt algorithms.These + # otherwise cannot be detected when cross-compiling. Bug 931884. + our_conf+=( + ac_cv_crypt_blowfish=yes + ac_cv_crypt_des=yes + ac_cv_crypt_ext_des=yes + ac_cv_crypt_md5=yes + ac_cv_crypt_sha512=yes + ac_cv_crypt_sha256=yes ) # DBA support @@ -357,24 +391,20 @@ src_configure() { $(use_with lmdb lmdb "${EPREFIX}/usr") ) - # Support for the GD graphics library + # Use the system copy of GD. The autoconf cache variable overrides + # allow cross-compilation to proceed since the corresponding + # features cannot be detected by running a program. our_conf+=( - $(use_with truetype freetype) - $(use_enable cjk gd-jis-conv) - $(use_with gd jpeg) - $(use_with xpm) - $(use_with webp) + $(use_enable gd gd) + $(use_with gd external-gd) + php_cv_lib_gd_gdImageCreateFromAvif=$(usex avif) + php_cv_lib_gd_gdImageCreateFromBmp=yes + php_cv_lib_gd_gdImageCreateFromJpeg=$(usex jpeg) + php_cv_lib_gd_gdImageCreateFromPng=$(usex png) + php_cv_lib_gd_gdImageCreateFromTga=yes + php_cv_lib_gd_gdImageCreateFromWebp=$(usex webp) + php_cv_lib_gd_gdImageCreateFromXpm=$(usex xpm) ) - # enable gd last, so configure can pick up the previous settings - our_conf+=( $(use_enable gd) ) - - # IMAP support - if use imap ; then - our_conf+=( - $(use_with imap imap "${EPREFIX}/usr") - $(use_with ssl imap-ssl "${EPREFIX}/usr") - ) - fi # LDAP support if use ldap ; then @@ -385,7 +415,7 @@ src_configure() { fi # MySQL support - our_conf+=( $(use_with mysqli mysqli "mysqlnd") ) + our_conf+=( $(use_with mysqli) ) local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock" if use mysql || use mysqli ; then @@ -394,10 +424,22 @@ src_configure() { # ODBC support if use odbc && use iodbc ; then + # Obtain the correct -l and -I flags for the actual build from + # pkg-config. We use the "generic" library type to avoid the + # (wrong) hard-coded include dir for iodbc. + # + # We set the pdo_odbc_def_incdir variable because the + # ./configure script checks for the headers using "test -f" and + # ignores your CFLAGS... and pdo_odbc_def_libdir prevents the + # build system from appending a nonsense -L flag. + local iodbc_ldflags=$(pkg-config --libs libiodbc) + local iodbc_cflags=$(pkg-config --cflags libiodbc) our_conf+=( + pdo_odbc_def_libdir="${EPREFIX}/usr/$(get_libdir)" + pdo_odbc_def_incdir="${EPREFIX}/usr/include/iodbc" --without-unixODBC --with-iodbc - $(use_with pdo pdo-odbc "iODBC,${EPREFIX}/usr") + $(use_with pdo pdo-odbc "generic,,iodbc,${iodbc_ldlags},${iodbc_cflags}") ) elif use odbc ; then our_conf+=( @@ -413,9 +455,6 @@ src_configure() { ) fi - # Oracle support - our_conf+=( $(use_with oci8-instant-client oci8) ) - # PDO support if use pdo ; then our_conf+=( @@ -423,8 +462,6 @@ src_configure() { $(use_with mysql pdo-mysql "mysqlnd") $(use_with postgres pdo-pgsql) $(use_with sqlite pdo-sqlite) - $(use_with firebird pdo-firebird "${EPREFIX}/usr") - $(use_with oci8-instant-client pdo-oci) ) fi @@ -465,9 +502,20 @@ src_configure() { # Support the Apache2 extras, they must be set globally for all # SAPIs to work correctly, especially for external PHP extensions + # Create separate build trees for each enabled SAPI. The upstream + # build system doesn't do this, but we have to do it to use a + # different php.ini for each SAPI (see --with-config-file-path and + # --with-config-file-scan-dir below). The path winds up define'd + # in main/build-defs.h which is included in main/php.h which is + # included by basically everything; so, avoiding a rebuild after + # changing it is not an easy job. + # + # The upstream build system also does not support building the + # apache2 and embed SAPIs at the same time, presumably because they + # both produce a libphp.so. local one_sapi local sapi - mkdir -p "${WORKDIR}/sapis-build" || die + mkdir "${WORKDIR}/sapis-build" || die for one_sapi in $SAPIS ; do use "${one_sapi}" || continue php_set_ini_dir "${one_sapi}" @@ -477,7 +525,6 @@ src_configure() { # based on the autotools-utils eclass. BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}" cp -a "${S}" "${BUILD_DIR}" || die - cd "${BUILD_DIR}" || die local sapi_conf=( --with-config-file-path="${PHP_INI_DIR}" @@ -516,6 +563,7 @@ src_configure() { myeconfargs+=( "${sapi_conf[@]}" ) pushd "${BUILD_DIR}" > /dev/null || die + einfo "Running econf in ${BUILD_DIR}" econf "${myeconfargs[@]}" popd > /dev/null || die done @@ -528,11 +576,7 @@ src_compile() { local sapi for sapi in ${SAPIS} ; do - if use "${sapi}"; then - cd "${WORKDIR}/sapis-build/$sapi" || \ - die "Failed to change dir to ${WORKDIR}/sapis-build/$1" - emake - fi + use "${sapi}" && emake -C "${WORKDIR}/sapis-build/${sapi}" done } @@ -549,20 +593,15 @@ src_install() { fi done - # Makefile forgets to create this before trying to write to it... - dodir "${PHP_DESTDIR#${EPREFIX}}/bin" - - # Install php environment (without any sapis) + # Install SAPI-independent targets cd "${WORKDIR}/sapis-build/$first_sapi" || die emake INSTALL_ROOT="${D}" \ install-build install-headers install-programs - - local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)" + use opcache && emake INSTALL_ROOT="${D}" install-modules # Create the directory where we'll put version-specific php scripts keepdir "/usr/share/php${PHP_MV}" - local file="" local sapi_list="" for sapi in ${SAPIS}; do @@ -628,12 +667,6 @@ src_install() { fi done - # Installing opcache module - if use opcache ; then - into "${PHP_DESTDIR#${EPREFIX}}" - dolib.so "modules/opcache$(get_libname)" - fi - # Install env.d files newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}" sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die @@ -655,14 +688,13 @@ src_install() { } src_test() { - echo ">>> Test phase [test]: ${CATEGORY}/${PF}" - PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php" - if [[ ! -x "${PHP_BIN}" ]] ; then - ewarn "Test phase requires USE=cli, skipping" - return - else - export TEST_PHP_EXECUTABLE="${PHP_BIN}" - fi + export TEST_PHP_EXECUTABLE="${WORKDIR}/sapis-build/cli/sapi/cli/php" + + # Sometimes when the sub-php launches a sub-sub-php, it uses these. + # Without an "-n" in all instances, the *live* php.ini can be loaded, + # pulling in *live* zend extensions. And those can be incompatible + # with the thing we just built. + export TEST_PHP_EXTRA_ARGS="-n" if [[ -x "${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" ]] ; then export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" @@ -672,40 +704,16 @@ src_test() { export TEST_PHPDBG_EXECUTABLE="${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" fi - SKIP_ONLINE_TESTS=1 REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \ - "session.save_path=${T}" \ - "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \ - "session.save_path=${T}" - - for name in ${EXPECTED_TEST_FAILURES}; do - mv "${name}.out" "${name}.out.orig" 2>/dev/null || die - done - - local failed="$(find -name '*.out')" - if [[ ${failed} != "" ]] ; then - ewarn "The following test cases failed unexpectedly:" - for name in ${failed}; do - ewarn " ${name/.out/}" - done - else - einfo "No unexpected test failures, all fine" - fi - - if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then - local passed="" - for name in ${EXPECTED_TEST_FAILURES}; do - [[ -f "${name}.diff" ]] && continue - passed="${passed} ${name}" - done - if [[ ${passed} != "" ]] ; then - einfo "The following test cases passed unexpectedly:" - for name in ${passed}; do - ewarn " ${passed}" - done - else - einfo "None of the known-to-fail tests passed, all fine" - fi - fi + # The IO capture tests need to be disabled because they fail when + # std{in,out,err} are redirected (as they are within portage). + # + # One -n applies to the top-level "php", while the other applies + # to any sub-php that get invoked by the test runner. + SKIP_IO_CAPTURE_TESTS=1 SKIP_PERF_SENSITIVE=1 REPORT_EXIT_STATUS=1 \ + "${TEST_PHP_EXECUTABLE}" -n \ + "${WORKDIR}/sapis-build/cli/run-tests.php" --offline -n -q \ + -d "session.save_path=${T}" \ + || die "tests failed" } pkg_postinst() { |