From 39cf9c5c49469d4a3168620ab74b1648c87e205e Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Fri, 8 Dec 2023 17:08:32 +0000 Subject: gentoo auto-resync : 08:12:2023 - 17:08:32 --- dev-lang/Manifest.gz | Bin 21162 -> 21162 bytes dev-lang/eisl/Manifest | 1 - dev-lang/eisl/files/eisl-2.85-Makefile.patch | 32 - dev-lang/php/Manifest | 4 +- dev-lang/php/php-8.2.13-r1.ebuild | 835 +++++++++++++++++++++++++++ dev-lang/php/php-8.2.13.ebuild | 835 --------------------------- dev-lang/php/php-8.3.0-r1.ebuild | 790 +++++++++++++++++++++++++ dev-lang/php/php-8.3.0.ebuild | 790 ------------------------- dev-lang/rust-bin/Manifest | 30 + dev-lang/rust-bin/rust-bin-1.74.1.ebuild | 240 ++++++++ dev-lang/rust/Manifest | 31 + dev-lang/rust/rust-1.74.1.ebuild | 760 ++++++++++++++++++++++++ 12 files changed, 2688 insertions(+), 1660 deletions(-) delete mode 100644 dev-lang/eisl/files/eisl-2.85-Makefile.patch create mode 100644 dev-lang/php/php-8.2.13-r1.ebuild delete mode 100644 dev-lang/php/php-8.2.13.ebuild create mode 100644 dev-lang/php/php-8.3.0-r1.ebuild delete mode 100644 dev-lang/php/php-8.3.0.ebuild create mode 100644 dev-lang/rust-bin/rust-bin-1.74.1.ebuild create mode 100644 dev-lang/rust/rust-1.74.1.ebuild (limited to 'dev-lang') diff --git a/dev-lang/Manifest.gz b/dev-lang/Manifest.gz index 1f3fbc95e1f2..5cbac1889d27 100644 Binary files a/dev-lang/Manifest.gz and b/dev-lang/Manifest.gz differ diff --git a/dev-lang/eisl/Manifest b/dev-lang/eisl/Manifest index 4dba9ae45b7a..8485b6026c82 100644 --- a/dev-lang/eisl/Manifest +++ b/dev-lang/eisl/Manifest @@ -1,4 +1,3 @@ -AUX eisl-2.85-Makefile.patch 987 BLAKE2B b5823a4579915fb7785548622f5d3fbbd968d8b4a20467cb0cbc01dd9ce9f137d324126056a13174bf70b4d787277a4580c7485d86e603217cd8e290160525e4 SHA512 c25e8d084294ef757c3b51f0c640e3b994a4cec0aebda930cf3059e628aaeb3a4bdbd709d3079f3f800159adda61e200ff28aa0314cfe81da4f5cadbef8165e2 AUX eisl-3.60-Makefile.patch 883 BLAKE2B 42419e7db0c5b960e218e821cd53d11caaa1a48d74c3e3d810c387e7e74f4fb2699d1cc54fc59c4201664a35384288c1f43e9910cabca9747f2522f2dc3aa364 SHA512 de22e920debb00b2988b8cd9d63c50c7c43d680c5b668f32dd9841a50875f7a857f5c320a00311f4d4adbff857298bf1e25f19f6a0baa7f0cba81ac63aaacd0f DIST eisl-3.60.tar.gz 2429781 BLAKE2B 7a5752df5682444fb3a1381030e1c73a1859021d9d18a5c2f0afc257012ef12d169c952044202f6f591965cbee4caab269ee362d317d6f87d09077d1f217857d SHA512 400e2a6e8c3de9fe97a240adbab6ec61ccff69a1b407443b7c832b357a390d16cef1090494f314cd3d16278cca131695345b8c6e0fe51e658c45dd3bea20e4f6 EBUILD eisl-3.60.ebuild 1004 BLAKE2B b47477b37133e7b91f34ba399c58f97b1c1346aa58da8781c577f43a22ef3b811bb0ebd00455611f6aaae33fc49f66bc7e7e9fe9d7a682497ad6c6399881b627 SHA512 6b9d2d6bc287049685b9d7a1b51d9e9ae61fd324ab448676606b0043ae0be246c4ac1c5d072f0917b7e6ba5df17c96a45a91c9e44aea5d14ac8f513e341dc123 diff --git a/dev-lang/eisl/files/eisl-2.85-Makefile.patch b/dev-lang/eisl/files/eisl-2.85-Makefile.patch deleted file mode 100644 index 61cd83f7da77..000000000000 --- a/dev-lang/eisl/files/eisl-2.85-Makefile.patch +++ /dev/null @@ -1,32 +0,0 @@ ---- a/makefile -+++ b/makefile -@@ -38,7 +38,7 @@ else - endif - endif - endif --CFLAGS += $(INCS) -g -Wall -Wextra -D_FORTIFY_SOURCE=2 $(CURSES_CFLAGS) -U_XOPEN_SOURCE -D_XOPEN_SOURCE=700 -D_XOPEN_SOURCE_EXTENDED -Inana/src -+CFLAGS += $(INCS) -g -Wall -Wextra $(CURSES_CFLAGS) -U_XOPEN_SOURCE -D_XOPEN_SOURCE=700 -D_XOPEN_SOURCE_EXTENDED -Inana/src - DFLAGS := --preview=all --de -w --O3 --release --betterC - SRC_CII := cii/src/except.c cii/src/fmt.c cii/src/str.c cii/src/text.c - SRC_D := dextension.d disl.d -@@ -68,7 +68,7 @@ ifeq ($(DEBUG),1) - LDFLAGS += -fsanitize=undefined - endif - else -- CFLAGS += -O3 -flto -DNDEBUG=1 -DWITHOUT_NANA=1 -+ CFLAGS += -DNDEBUG=1 -DWITHOUT_NANA=1 - SRC_CII += cii/src/mem.c - endif - OBJ_CII := $(SRC_CII:.c=.o) -@@ -86,11 +86,8 @@ ifeq ($(shell uname -n),raspberrypi) - CFLAGS += -D__rpi__ - endif - ifneq ($(DEBUG),1) -- LDFLAGS += -flto - ifeq ($(shell uname),Darwin) - LDFLAGS += -Wl,-S,-x -- else -- LDFLAGS += -s - endif - endif - PREFIX := /usr/local diff --git a/dev-lang/php/Manifest b/dev-lang/php/Manifest index cf22fc8c29c4..e40c9a22be49 100644 --- a/dev-lang/php/Manifest +++ b/dev-lang/php/Manifest @@ -10,6 +10,6 @@ DIST php-8.2.13.tar.xz 12069092 BLAKE2B 24da2de8cb00bb2aac485360a14f75d6ce3df1ba DIST php-8.3.0.tar.xz 12431612 BLAKE2B c6c01b28edea15f05e8894bf69a9f4ea3ea6fb0a2bd70d9417ce9473d57636e08e19f62cac1dfee66d153e5aee4f1b99035ccc14bba1e41712971321deee264f SHA512 8758bb0789787dda04f3d4a175f4d4a0bffadc8c3d272fefa000d6fd7b0c0a7096347c829c1ddfb3b60cf6300803d68ba6d8379f2a343e02d935ba77d01c5cf1 EBUILD php-8.1.20-r1.ebuild 21910 BLAKE2B e6a524d34d9a13d561d759ef67a9b5e54d7de24102802deb4446d1caa6d997dd9b5e31960abc0a05a80c5f41d2d10cad1abb5f982e90cc9e80f58ef13bd1eff5 SHA512 45fefb29283621baa9796d454bd104e070bce921f64c1627fa46bc238faf17019d8f9a251222e7f1ef51d1de3fbc61c49a84da0ce93b290852c63fa27463205d EBUILD php-8.1.26.ebuild 21996 BLAKE2B cf5c46780aae16a099cf97b803a18e06229976395b96c96781a5c7f7a6678b8f76f70e466e5ab419471f0c83a587ac0d1ea7d0b438cc2c90ff9008335147af33 SHA512 707a40a4ba96d6b8ea5e423a1ebde2b54c9b33eb2a6dc8b1134fb2748f4563b39f38aff96117ec4b27ee9294af03db8a0de0b4d7c41e831839eaef1b3fa2bd95 -EBUILD php-8.2.13.ebuild 24912 BLAKE2B 0f38f8e0dd461b7a51481475f43d66a9944ca6be59eeede85ff76dd32b9e5fc156216bf7e9fa4a9310bdcd5a04d750009696c0769a9efd8689c75b400b95af31 SHA512 645af95fd27febc95b455fa34b726d8f6d03411af264afa6528e1de5ed7df7cb293b8ebf224406be4e708eb0048ebc99dc9aae08e2ef6f3b0c0c9fdb532a4c3d -EBUILD php-8.3.0.ebuild 23387 BLAKE2B 008bec87be45e6cba2b3d29b8c214d31054cbc3a6697bf3a64945652163f0bf66cb1f7905a0222af4d0ff6dab6f9ff36c72efc42a2f0cf571b3022678db0547e SHA512 2b11ed5dd60baaa4490db3ec8b7e4e747b614a9d146ba3d41ebbf21e85ebba74fe79981d349517e8747495314690bcfc0e1f39d744a2355e240112ab25618914 +EBUILD php-8.2.13-r1.ebuild 24923 BLAKE2B d44c57115009b0c901f365195a0676890b99ec6ec266d55e0c2c670ac245b03bc9ec7d982b831b48b070a012dff42f5c7f6e5db880eeb84fa4aa32df1f312ccd SHA512 c17b442f9a7ace656c2ffe123d6c7f638623ac9ca921463e2bdf2def6413adb8475c3070660d9ed8eebe175a2b5cb2742408ab260b60a9a62e894fe070b31c2d +EBUILD php-8.3.0-r1.ebuild 23398 BLAKE2B f219fa5d391261000d07677191927356b573bdd04033c558121c707eb7a2d45ff5c128999e5057af29edb08943e8f930af4a4b45eb24157bf953c41013e10532 SHA512 4d4329810a685501a721cb7db0e54b05986bafff98c90e8e0c5516627cf4d6fc0b43b15bbb2a7f259913b19f68c1ad9ea50cbf5a309a8c76cb3fb821fda204f8 MISC metadata.xml 3892 BLAKE2B 69f96654884695b15fd3caf260a8e9d7e1b1e004c7d72bba340e093dd981d1fed5c00dfb547fea3d58be8f1516e52a01a966abbbfb90f10bd9dc14421e18bd8f SHA512 f7d93f5213aceb33e95ad883ed7015b6ab22eef5b0749e137aad2ecb8fc5187a9aca2b7f095421ff12d6102d5087fc2280e6c3ced12eda14e9bda8f3241b29a5 diff --git a/dev-lang/php/php-8.2.13-r1.ebuild b/dev-lang/php/php-8.2.13-r1.ebuild new file mode 100644 index 000000000000..a0aadbfbb272 --- /dev/null +++ b/dev-lang/php/php-8.2.13-r1.ebuild @@ -0,0 +1,835 @@ +# Copyright 1999-2023 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 + +DESCRIPTION="The PHP language runtime engine" +HOMEPAGE="https://www.php.net/" +SRC_URI="https://www.php.net/distributions/${P}.tar.xz" + +LICENSE="PHP-3.01 + BSD + 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 ~ia64 ~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" + +# SAPIs and SAPI-specific USE flags (cli SAPI is default on): +IUSE="${IUSE} + ${SAPIS/cli/+cli} + threads" + +IUSE="${IUSE} acl apparmor argon2 avif bcmath berkdb bzip2 calendar + cdb cjk +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 + mhash mssql mysql mysqli nls + oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm + readline selinux +session session-mm sharedmem + +simplexml snmp soap sockets sodium spell sqlite ssl + 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 ) + xmlreader? ( xml ) + 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 ) +" + +RESTRICT="!test? ( test )" + +# The supported (that is, autodetected) versions of BDB are listed in +# 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] + virtual/libcrypt:= + 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= ) + cdb? ( || ( dev-db/cdb dev-db/tinycdb ) ) + curl? ( >=net-misc/curl-7.29.0 ) + 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= ) + 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-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:* ) + qdbm? ( dev-db/qdbm ) + readline? ( sys-libs/readline:0= ) + session-mm? ( dev-libs/mm ) + snmp? ( >=net-analyzer/net-snmp-5.2 ) + 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= ) + tidy? ( app-text/htmltidy ) + tokyocabinet? ( dev-db/tokyocabinet ) + truetype? ( =media-libs/freetype-2* ) + unicode? ( dev-libs/oniguruma:= ) + valgrind? ( dev-util/valgrind ) + webp? ( media-libs/libwebp:0= ) + xml? ( >=dev-libs/libxml2-2.9.0 ) + xpm? ( x11-libs/libXpm ) + xslt? ( dev-libs/libxslt ) + zip? ( >=dev-libs/libzip-1.2.0:= ) + zlib? ( >=sys-libs/zlib-1.2.0.4:0= ) +" + +IDEPEND=">=app-eselect/eselect-php-0.9.7[apache2?,fpm?]" + +RDEPEND="${COMMON_DEPEND} + virtual/mta + fpm? ( + selinux? ( sec-policy/selinux-phpfpm ) + systemd? ( sys-apps/systemd ) )" + +# Bison isn't actually needed when building from a release tarball +# However, the configure script will warn if it's absent or if you +# have an incompatible version installed. See bug 593278. +DEPEND="${COMMON_DEPEND} + app-arch/xz-utils + >=sys-devel/bison-3.0.1" + +BDEPEND="virtual/pkgconfig" + +PHP_MV="$(ver_cut 1)" + +PATCHES=( + "${FILESDIR}/php-iodbc-header-location.patch" + "${FILESDIR}/php-capstone-optional.patch" + "${FILESDIR}/php-8.2.8-openssl-tests.patch" +) + +php_install_ini() { + local phpsapi="${1}" + + # work out where we are installing the ini file + php_set_ini_dir "${phpsapi}" + + # Always install the production INI file, bug 611214. + 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 + + insinto "${PHP_INI_DIR#${EPREFIX}}" + newins "${phpinisrc}" php.ini + + elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}" + elog + + dodir "${PHP_EXT_INI_DIR#${EPREFIX}}" + dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}" + + if use opcache; then + elog "Adding opcache to $PHP_EXT_INI_DIR" + echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \ + "${D}/${PHP_EXT_INI_DIR}"/opcache.ini + dosym "../ext/opcache.ini" \ + "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini" + fi + + # SAPI-specific handling + if [[ "${sapi}" == "fpm" ]] ; then + einfo "Installing FPM config files php-fpm.conf and www.conf" + insinto "${PHP_INI_DIR#${EPREFIX}}" + doins sapi/fpm/php-fpm.conf + insinto "${PHP_INI_DIR#${EPREFIX}}/fpm.d" + doins sapi/fpm/www.conf + fi + + dodoc php.ini-{development,production} +} + +php_set_ini_dir() { + PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}" + PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext" + PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active" +} + +src_prepare() { + default + + # In php-7.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 + # we'll install the pool configuration file "www.conf" there. + php_set_ini_dir fpm + sed -i "s~^include=.*$~include=${PHP_INI_DIR}/fpm.d/*.conf~" \ + 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 + eautoconf --force + eautoheader + + # missing skipif; fixed upstream already + rm sapi/cgi/tests/005.phpt || die + + # These three get BORKED on no-ipv6 systems, + # + # https://github.com/php/php-src/pull/11651 + # + rm ext/sockets/tests/mcast_ipv6_recv.phpt \ + ext/sockets/tests/mcast_ipv6_recv_limited.phpt \ + ext/sockets/tests/mcast_ipv6_send.phpt \ + || die + + # fails in a network sandbox, + # + # https://github.com/php/php-src/issues/11662 + # + rm ext/sockets/tests/bug63000.phpt || die + + # expected output needs to be updated, + # + # https://github.com/php/php-src/pull/11648 + # + rm ext/dba/tests/dba_tcadb.phpt || die + + # Two IMAP tests missing SKIPIFs, + # + # https://github.com/php/php-src/pull/11654 + # + rm ext/imap/tests/imap_mutf7_to_utf8.phpt \ + ext/imap/tests/imap_utf8_to_mutf7_basic.phpt \ + || die + + # broken upstream with icu-73.x, + # + # https://github.com/php/php-src/issues/11128 + # + rm ext/intl/tests/calendar_clear_variation1.phpt || die + + # overly sensitive to INI values; fixes sent upstream: + # + # https://github.com/php/php-src/pull/11631 + # + rm ext/session/tests/{bug74514,bug74936,gh7787}.phpt || die + + # This is sensitive to the current "nice" level: + # + # https://github.com/php/php-src/issues/11630 + # + rm ext/standard/tests/general_functions/proc_nice_basic.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 + + # Same TEST_PHP_EXTRA_ARGS (-n) issue with this one, but it's + # already been fixed upstream. + rm sapi/cli/tests/017.phpt || die + + # Most Oracle tests are borked, + # + # * https://github.com/php/php-src/issues/11804 + # * https://github.com/php/php-src/pull/11820 + # * https://github.com/php/php-src/issues/11819 + # + rm ext/oci8/tests/*.phpt || die + + # https://github.com/php/php-src/issues/12801 + rm ext/pcre/tests/gh11374.phpt || die +} + +src_configure() { + addpredict /usr/share/snmp/mibs/.index #nowarn + addpredict /var/lib/net-snmp/mib_indexes #nowarn + + # 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=( + --prefix="${PHP_DESTDIR}" + --mandir="${PHP_DESTDIR}/man" + --infodir="${PHP_DESTDIR}/info" + --libdir="${PHP_DESTDIR}/lib" + --with-libdir="$(get_libdir)" + --localstatedir="${EPREFIX}/var" + --without-pear + --without-valgrind + --with-external-libcrypt + $(use_enable threads zts) + ) + + 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 ctype) + $(use_with curl) + $(use_enable xml dom) + $(use_with enchant) + $(use_enable exif) + $(use_with ffi) + $(use_enable fileinfo) + $(use_enable filter) + $(use_enable ftp) + $(use_with nls gettext "${EPREFIX}/usr") + $(use_with gmp gmp "${EPREFIX}/usr") + $(use_with mhash mhash "${EPREFIX}/usr") + $(use_with iconv iconv \ + $(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) + $(use_enable pcntl) + $(use_enable phar) + $(use_enable pdo) + $(use_enable opcache) + $(use_with postgres pgsql "${EPREFIX}/usr") + $(use_enable posix) + $(use_with selinux fpm-selinux) + $(use_with spell pspell "${EPREFIX}/usr") + $(use_enable simplexml) + $(use_enable sharedmem shmop) + $(use_with snmp snmp "${EPREFIX}/usr") + $(use_enable soap) + $(use_enable sockets) + $(use_with sodium) + $(use_with sqlite sqlite3) + $(use_enable sysvipc sysvmsg) + $(use_enable sysvipc sysvsem) + $(use_enable sysvipc sysvshm) + $(use_with tidy tidy "${EPREFIX}/usr") + $(use_enable tokenizer) + $(use_enable xml) + $(use_enable xmlreader) + $(use_enable xmlwriter) + $(use_with xslt xsl) + $(use_with zip) + $(use_with zlib zlib "${EPREFIX}/usr") + $(use_enable debug) + $(use_with valgrind) + ) + + # DBA support + if use cdb || use berkdb || use flatfile || use gdbm || use inifile \ + || use qdbm || use lmdb || use tokyocabinet ; then + our_conf+=( "--enable-dba" ) + fi + + # DBA drivers support + our_conf+=( + $(use_with cdb) + $(use_with berkdb db4 "${EPREFIX}/usr") + $(use_enable flatfile) + $(use_with gdbm gdbm "${EPREFIX}/usr") + $(use_enable inifile) + $(use_with qdbm qdbm "${EPREFIX}/usr") + $(use_with tokyocabinet tcadb "${EPREFIX}/usr") + $(use_with lmdb lmdb "${EPREFIX}/usr") + ) + + # Support for the GD graphics library + our_conf+=( + $(use_with truetype freetype) + $(use_enable cjk gd-jis-conv) + $(use_with gd jpeg) + $(use_with xpm) + $(use_with webp) + ) + # 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 + our_conf+=( + $(use_with ldap ldap "${EPREFIX}/usr") + $(use_with ldap-sasl) + ) + fi + + # MySQL support + our_conf+=( $(use_with mysqli) ) + + local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock" + if use mysql || use mysqli ; then + our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") ) + fi + + # ODBC support + if use odbc && use iodbc ; then + our_conf+=( + --without-unixODBC + --with-iodbc + $(use_with pdo pdo-odbc "iODBC,${EPREFIX}/usr") + ) + elif use odbc ; then + our_conf+=( + --with-unixODBC="${EPREFIX}/usr" + --without-iodbc + $(use_with pdo pdo-odbc "unixODBC,${EPREFIX}/usr") + ) + else + our_conf+=( + --without-unixODBC + --without-iodbc + --without-pdo-odbc + ) + fi + + # Oracle support + our_conf+=( $(use_with oci8-instant-client oci8) ) + + # PDO support + if use pdo ; then + our_conf+=( + $(use_with mssql pdo-dblib "${EPREFIX}/usr") + $(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 + + # readline/libedit support + our_conf+=( + $(use_with readline readline "${EPREFIX}/usr") + $(use_with libedit) + ) + + # Session support + if use session ; then + our_conf+=( $(use_with session-mm mm "${EPREFIX}/usr") ) + else + our_conf+=( $(use_enable session) ) + fi + + # Use pic for shared modules such as apache2's mod_php + our_conf+=( --with-pic ) + + # we use the system copy of pcre + # --with-external-pcre affects ext/pcre + our_conf+=( + --with-external-pcre + $(use_with jit pcre-jit) + ) + + # Catch CFLAGS problems + # Fixes bug #14067. + # Changed order to run it in reverse for bug #32022 and #12021. + replace-cpu-flags "k6*" "i586" + + # Cache the ./configure test results between SAPIs. + our_conf+=( --cache-file="${T}/config.cache" ) + + # Support user-passed configuration parameters + our_conf+=( ${EXTRA_ECONF:-} ) + + # 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. + local one_sapi + local sapi + mkdir "${WORKDIR}/sapis-build" || die + for one_sapi in $SAPIS ; do + use "${one_sapi}" || continue + php_set_ini_dir "${one_sapi}" + + # The BUILD_DIR variable is used to determine where to output + # the files that autotools creates. This was all originally + # based on the autotools-utils eclass. + BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}" + cp -a "${S}" "${BUILD_DIR}" || die + + local sapi_conf=( + --with-config-file-path="${PHP_INI_DIR}" + --with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}" + ) + + for sapi in $SAPIS ; do + case "$sapi" in + cli|cgi|embed|fpm|phpdbg) + if [[ "${one_sapi}" == "${sapi}" ]] ; then + sapi_conf+=( "--enable-${sapi}" ) + if [[ "fpm" == "${sapi}" ]] ; then + sapi_conf+=( + $(use_with acl fpm-acl) + $(use_with systemd fpm-systemd) + ) + fi + else + sapi_conf+=( "--disable-${sapi}" ) + fi + ;; + + apache2) + if [[ "${one_sapi}" == "${sapi}" ]] ; then + sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" ) + else + sapi_conf+=( --without-apxs2 ) + fi + ;; + esac + done + + # Construct the $myeconfargs array by concatenating $our_conf + # (the common args) and $sapi_conf (the SAPI-specific args). + local myeconfargs=( "${our_conf[@]}" ) + myeconfargs+=( "${sapi_conf[@]}" ) + + pushd "${BUILD_DIR}" > /dev/null || die + einfo "Running econf in ${BUILD_DIR}" + econf "${myeconfargs[@]}" + popd > /dev/null || die + done +} + +src_compile() { + # snmp seems to run during src_compile, too (bug #324739) + addpredict /usr/share/snmp/mibs/.index #nowarn + addpredict /var/lib/net-snmp/mib_indexes #nowarn + + if use oci8-instant-client && use kerberos && use imap && use phar; then + # A conspiracy takes place when the first three of these flags + # are set together, causing the newly-built "php" to open + # /dev/urandom with mode rw when it starts. That's not actually + # a problem... unless you also have USE=phar, which runs that + # "php" to build some phar thingy in src_compile(). Later in + # src_test(), portage (at least) sets "addpredict /" so the + # problem does not repeat. + addpredict /dev/urandom #nowarn + fi + + local sapi + for sapi in ${SAPIS} ; do + use "${sapi}" && emake -C "${WORKDIR}/sapis-build/${sapi}" + done +} + +src_install() { + # see bug #324739 for what happens when we don't have that + addpredict /usr/share/snmp/mibs/.index #nowarn + + # grab the first SAPI that got built and install common files from there + local first_sapi="", sapi="" + for sapi in $SAPIS ; do + if use $sapi ; then + first_sapi=$sapi + break + fi + done + + # Makefile forgets to create this before trying to write to it... + dodir "${PHP_DESTDIR#${EPREFIX}}/bin" + + # Install php environment (without any sapis) + 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)" + + # 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 + if use "${sapi}" ; then + einfo "Installing SAPI: ${sapi}" + cd "${WORKDIR}/sapis-build/${sapi}" || die + + if [[ "${sapi}" == "apache2" ]] ; then + # We're specifically not using emake install-sapi as libtool + # may cause unnecessary relink failures (see bug #351266) + insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/" + newins ".libs/libphp$(get_libname)" \ + "libphp${PHP_MV}$(get_libname)" + keepdir "/usr/$(get_libdir)/apache2/modules" + else + # needed each time, php_install_ini would reset it + local dest="${PHP_DESTDIR#${EPREFIX}}" + into "${dest}" + case "$sapi" in + cli) + source="sapi/cli/php" + # Install the "phar" archive utility. + if use phar ; then + emake INSTALL_ROOT="${D}" install-pharcmd + dosym "..${dest#/usr}/bin/phar" "/usr/bin/phar${SLOT}" + fi + ;; + cgi) + source="sapi/cgi/php-cgi" + ;; + fpm) + source="sapi/fpm/php-fpm" + ;; + embed) + source="libs/libphp$(get_libname)" + ;; + phpdbg) + source="sapi/phpdbg/phpdbg" + ;; + *) + die "unhandled sapi in src_install" + ;; + esac + + if [[ "${source}" == *"$(get_libname)" ]]; then + dolib.so "${source}" + else + dobin "${source}" + local name="$(basename ${source})" + dosym "..${dest#/usr}/bin/${name}" "/usr/bin/${name}${SLOT}" + fi + fi + + php_install_ini "${sapi}" + + # construct correct SAPI string for php-config + # thanks to ferringb for the bash voodoo + if [[ "${sapi}" == "apache2" ]]; then + sapi_list="${sapi_list:+${sapi_list} }apache2handler" + else + sapi_list="${sapi_list:+${sapi_list} }${sapi}" + fi + 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 + sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die + + # set php-config variable correctly (bug #278439) + sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \ + "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die + + if use fpm ; then + if use systemd; then + systemd_newunit "${FILESDIR}/php-fpm_at.service" \ + "php-fpm@${SLOT}.service" + else + systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \ + "php-fpm@${SLOT}.service" + fi + fi +} + +src_test() { + 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" + fi + + if [[ -x "${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" ]] ; then + export TEST_PHPDBG_EXECUTABLE="${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" + fi + + # The sendmail override prevents ext/imap/tests/bug77020.phpt from + # actually trying to send mail, and will be fixed upstream soon: + # + # https://github.com/php/php-src/issues/11629 + # + # 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}" \ + -d "sendmail_path=echo >/dev/null" \ + || die "tests failed" +} + +pkg_postinst() { + # Output some general info to the user + if use apache2 ; then + elog + elog "To enable PHP in apache, you will need to add \"-D PHP\" to" + elog "your apache2 command. OpenRC users can append that string to" + elog "APACHE2_OPTS in /etc/conf.d/apache2." + elog + elog "The apache module configuration file 70_mod_php.conf is" + elog "provided (and maintained) by eselect-php." + elog + fi + + # Create the symlinks for php + local m + for m in ${SAPIS}; do + [[ ${m} == 'embed' ]] && continue; + if use $m ; then + local ci=$(eselect php show $m) + if [[ -z $ci ]]; then + eselect php set $m php${SLOT} || die + einfo "Switched ${m} to use php:${SLOT}" + einfo + elif [[ $ci != "php${SLOT}" ]] ; then + elog "To switch $m to use php:${SLOT}, run" + elog " eselect php set $m php${SLOT}" + elog + fi + fi + done + + # Remove dead symlinks for SAPIs that were just disabled. For + # example, if the user has the cgi SAPI enabled, then he has an + # eselect-php symlink for it. If he later reinstalls PHP with + # USE="-cgi", that symlink will break. This call to eselect is + # supposed to remove that dead link per bug 572436. + eselect php cleanup || die + + if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then + elog "To build extensions for this version of PHP, you will need to" + elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable." + elog + fi + + # Warn about the removal of PHP_INI_VERSION if the user has it set. + if [[ -n "${PHP_INI_VERSION}" ]]; then + ewarn 'The PHP_INI_VERSION variable has been phased out. You may' + ewarn 'remove it from your configuration at your convenience. See' + ewarn + ewarn ' https://bugs.gentoo.org/611214' + ewarn + ewarn 'for more information.' + fi + + elog "For details on how version slotting works, please see" + elog "the wiki:" + elog + elog " https://wiki.gentoo.org/wiki/PHP" + elog +} + +pkg_postrm() { + # This serves two purposes. First, if we have just removed the last + # installed version of PHP, then this will remove any dead symlinks + # belonging to eselect-php. Second, if a user upgrades slots from + # (say) 5.6 to 7.0 and depcleans the old slot, then this will update + # his existing symlinks to point to the new 7.0 installation. The + # latter is bug 432962. + # + # Note: the eselect-php package may not be installed at this point, + # so we can't die() if this command fails. + eselect php cleanup +} diff --git a/dev-lang/php/php-8.2.13.ebuild b/dev-lang/php/php-8.2.13.ebuild deleted file mode 100644 index 7d6a005d1c10..000000000000 --- a/dev-lang/php/php-8.2.13.ebuild +++ /dev/null @@ -1,835 +0,0 @@ -# Copyright 1999-2023 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 - -DESCRIPTION="The PHP language runtime engine" -HOMEPAGE="https://www.php.net/" -SRC_URI="https://www.php.net/distributions/${P}.tar.xz" - -LICENSE="PHP-3.01 - BSD - 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 ~ia64 ~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" - -# SAPIs and SAPI-specific USE flags (cli SAPI is default on): -IUSE="${IUSE} - ${SAPIS/cli/+cli} - threads" - -IUSE="${IUSE} acl apparmor argon2 avif bcmath berkdb bzip2 calendar - cdb cjk +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 - mhash mssql mysql mysqli nls - oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm - readline selinux +session session-mm sharedmem - +simplexml snmp soap sockets sodium spell sqlite ssl - 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 ) - xmlreader? ( xml ) - 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 ) -" - -RESTRICT="!test? ( test )" - -# The supported (that is, autodetected) versions of BDB are listed in -# 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] - virtual/libcrypt:= - 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= ) - cdb? ( || ( dev-db/cdb dev-db/tinycdb ) ) - curl? ( >=net-misc/curl-7.29.0 ) - 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= ) - 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-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:* ) - qdbm? ( dev-db/qdbm ) - readline? ( sys-libs/readline:0= ) - session-mm? ( dev-libs/mm ) - snmp? ( >=net-analyzer/net-snmp-5.2 ) - 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= ) - tidy? ( app-text/htmltidy ) - tokyocabinet? ( dev-db/tokyocabinet ) - truetype? ( =media-libs/freetype-2* ) - unicode? ( dev-libs/oniguruma:= ) - valgrind? ( dev-util/valgrind ) - webp? ( media-libs/libwebp:0= ) - xml? ( >=dev-libs/libxml2-2.9.0 ) - xpm? ( x11-libs/libXpm ) - xslt? ( dev-libs/libxslt ) - zip? ( >=dev-libs/libzip-1.2.0:= ) - zlib? ( >=sys-libs/zlib-1.2.0.4:0= ) -" - -IDEPEND=">=app-eselect/eselect-php-0.9.7[apache2?,fpm?]" - -RDEPEND="${COMMON_DEPEND} - virtual/mta - fpm? ( - selinux? ( sec-policy/selinux-phpfpm ) - systemd? ( sys-apps/systemd ) )" - -# Bison isn't actually needed when building from a release tarball -# However, the configure script will warn if it's absent or if you -# have an incompatible version installed. See bug 593278. -DEPEND="${COMMON_DEPEND} - app-arch/xz-utils - >=sys-devel/bison-3.0.1" - -BDEPEND="virtual/pkgconfig" - -PHP_MV="$(ver_cut 1)" - -PATCHES=( - "${FILESDIR}/php-iodbc-header-location.patch" - "${FILESDIR}/php-capstone-optional.patch" - "${FILESDIR}/php-8.2.8-openssl-tests.patch" -) - -php_install_ini() { - local phpsapi="${1}" - - # work out where we are installing the ini file - php_set_ini_dir "${phpsapi}" - - # Always install the production INI file, bug 611214. - 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 - - insinto "${PHP_INI_DIR#${EPREFIX}}" - newins "${phpinisrc}" php.ini - - elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}" - elog - - dodir "${PHP_EXT_INI_DIR#${EPREFIX}}" - dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}" - - if use opcache; then - elog "Adding opcache to $PHP_EXT_INI_DIR" - echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \ - "${D}/${PHP_EXT_INI_DIR}"/opcache.ini - dosym "../ext/opcache.ini" \ - "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini" - fi - - # SAPI-specific handling - if [[ "${sapi}" == "fpm" ]] ; then - einfo "Installing FPM config files php-fpm.conf and www.conf" - insinto "${PHP_INI_DIR#${EPREFIX}}" - doins sapi/fpm/php-fpm.conf - insinto "${PHP_INI_DIR#${EPREFIX}}/fpm.d" - doins sapi/fpm/www.conf - fi - - dodoc php.ini-{development,production} -} - -php_set_ini_dir() { - PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}" - PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext" - PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active" -} - -src_prepare() { - default - - # In php-7.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 - # we'll install the pool configuration file "www.conf" there. - php_set_ini_dir fpm - sed -i "s~^include=.*$~include=${PHP_INI_DIR}/fpm.d/*.conf~" \ - 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 - eautoconf --force - eautoheader - - # missing skipif; fixed upstream already - rm sapi/cgi/tests/005.phpt || die - - # These three get BORKED on no-ipv6 systems, - # - # https://github.com/php/php-src/pull/11651 - # - rm ext/sockets/tests/mcast_ipv6_recv.phpt \ - ext/sockets/tests/mcast_ipv6_recv_limited.phpt \ - ext/sockets/tests/mcast_ipv6_send.phpt \ - || die - - # fails in a network sandbox, - # - # https://github.com/php/php-src/issues/11662 - # - rm ext/sockets/tests/bug63000.phpt || die - - # expected output needs to be updated, - # - # https://github.com/php/php-src/pull/11648 - # - rm ext/dba/tests/dba_tcadb.phpt || die - - # Two IMAP tests missing SKIPIFs, - # - # https://github.com/php/php-src/pull/11654 - # - rm ext/imap/tests/imap_mutf7_to_utf8.phpt \ - ext/imap/tests/imap_utf8_to_mutf7_basic.phpt \ - || die - - # broken upstream with icu-73.x, - # - # https://github.com/php/php-src/issues/11128 - # - rm ext/intl/tests/calendar_clear_variation1.phpt || die - - # overly sensitive to INI values; fixes sent upstream: - # - # https://github.com/php/php-src/pull/11631 - # - rm ext/session/tests/{bug74514,bug74936,gh7787}.phpt || die - - # This is sensitive to the current "nice" level: - # - # https://github.com/php/php-src/issues/11630 - # - rm ext/standard/tests/general_functions/proc_nice_basic.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 - - # Same TEST_PHP_EXTRA_ARGS (-n) issue with this one, but it's - # already been fixed upstream. - rm sapi/cli/tests/017.phpt || die - - # Most Oracle tests are borked, - # - # * https://github.com/php/php-src/issues/11804 - # * https://github.com/php/php-src/pull/11820 - # * https://github.com/php/php-src/issues/11819 - # - rm ext/oci8/tests/*.phpt || die - - # https://github.com/php/php-src/issues/12801 - rm ext/pcre/tests/gh11374.phpt || die -} - -src_configure() { - addpredict /usr/share/snmp/mibs/.index #nowarn - addpredict /var/lib/net-snmp/mib_indexes #nowarn - - # 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=( - --prefix="${PHP_DESTDIR}" - --mandir="${PHP_DESTDIR}/man" - --infodir="${PHP_DESTDIR}/info" - --libdir="${PHP_DESTDIR}/lib" - --with-libdir="$(get_libdir)" - --localstatedir="${EPREFIX}/var" - --without-pear - --without-valgrind - --enable-ipv6 - $(use_enable threads zts) - ) - - 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 ctype) - $(use_with curl) - $(use_enable xml dom) - $(use_with enchant) - $(use_enable exif) - $(use_with ffi) - $(use_enable fileinfo) - $(use_enable filter) - $(use_enable ftp) - $(use_with nls gettext "${EPREFIX}/usr") - $(use_with gmp gmp "${EPREFIX}/usr") - $(use_with mhash mhash "${EPREFIX}/usr") - $(use_with iconv iconv \ - $(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) - $(use_enable pcntl) - $(use_enable phar) - $(use_enable pdo) - $(use_enable opcache) - $(use_with postgres pgsql "${EPREFIX}/usr") - $(use_enable posix) - $(use_with selinux fpm-selinux) - $(use_with spell pspell "${EPREFIX}/usr") - $(use_enable simplexml) - $(use_enable sharedmem shmop) - $(use_with snmp snmp "${EPREFIX}/usr") - $(use_enable soap) - $(use_enable sockets) - $(use_with sodium) - $(use_with sqlite sqlite3) - $(use_enable sysvipc sysvmsg) - $(use_enable sysvipc sysvsem) - $(use_enable sysvipc sysvshm) - $(use_with tidy tidy "${EPREFIX}/usr") - $(use_enable tokenizer) - $(use_enable xml) - $(use_enable xmlreader) - $(use_enable xmlwriter) - $(use_with xslt xsl) - $(use_with zip) - $(use_with zlib zlib "${EPREFIX}/usr") - $(use_enable debug) - $(use_with valgrind) - ) - - # DBA support - if use cdb || use berkdb || use flatfile || use gdbm || use inifile \ - || use qdbm || use lmdb || use tokyocabinet ; then - our_conf+=( "--enable-dba" ) - fi - - # DBA drivers support - our_conf+=( - $(use_with cdb) - $(use_with berkdb db4 "${EPREFIX}/usr") - $(use_enable flatfile) - $(use_with gdbm gdbm "${EPREFIX}/usr") - $(use_enable inifile) - $(use_with qdbm qdbm "${EPREFIX}/usr") - $(use_with tokyocabinet tcadb "${EPREFIX}/usr") - $(use_with lmdb lmdb "${EPREFIX}/usr") - ) - - # Support for the GD graphics library - our_conf+=( - $(use_with truetype freetype) - $(use_enable cjk gd-jis-conv) - $(use_with gd jpeg) - $(use_with xpm) - $(use_with webp) - ) - # 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 - our_conf+=( - $(use_with ldap ldap "${EPREFIX}/usr") - $(use_with ldap-sasl) - ) - fi - - # MySQL support - our_conf+=( $(use_with mysqli) ) - - local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock" - if use mysql || use mysqli ; then - our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") ) - fi - - # ODBC support - if use odbc && use iodbc ; then - our_conf+=( - --without-unixODBC - --with-iodbc - $(use_with pdo pdo-odbc "iODBC,${EPREFIX}/usr") - ) - elif use odbc ; then - our_conf+=( - --with-unixODBC="${EPREFIX}/usr" - --without-iodbc - $(use_with pdo pdo-odbc "unixODBC,${EPREFIX}/usr") - ) - else - our_conf+=( - --without-unixODBC - --without-iodbc - --without-pdo-odbc - ) - fi - - # Oracle support - our_conf+=( $(use_with oci8-instant-client oci8) ) - - # PDO support - if use pdo ; then - our_conf+=( - $(use_with mssql pdo-dblib "${EPREFIX}/usr") - $(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 - - # readline/libedit support - our_conf+=( - $(use_with readline readline "${EPREFIX}/usr") - $(use_with libedit) - ) - - # Session support - if use session ; then - our_conf+=( $(use_with session-mm mm "${EPREFIX}/usr") ) - else - our_conf+=( $(use_enable session) ) - fi - - # Use pic for shared modules such as apache2's mod_php - our_conf+=( --with-pic ) - - # we use the system copy of pcre - # --with-external-pcre affects ext/pcre - our_conf+=( - --with-external-pcre - $(use_with jit pcre-jit) - ) - - # Catch CFLAGS problems - # Fixes bug #14067. - # Changed order to run it in reverse for bug #32022 and #12021. - replace-cpu-flags "k6*" "i586" - - # Cache the ./configure test results between SAPIs. - our_conf+=( --cache-file="${T}/config.cache" ) - - # Support user-passed configuration parameters - our_conf+=( ${EXTRA_ECONF:-} ) - - # 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. - local one_sapi - local sapi - mkdir "${WORKDIR}/sapis-build" || die - for one_sapi in $SAPIS ; do - use "${one_sapi}" || continue - php_set_ini_dir "${one_sapi}" - - # The BUILD_DIR variable is used to determine where to output - # the files that autotools creates. This was all originally - # based on the autotools-utils eclass. - BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}" - cp -a "${S}" "${BUILD_DIR}" || die - - local sapi_conf=( - --with-config-file-path="${PHP_INI_DIR}" - --with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}" - ) - - for sapi in $SAPIS ; do - case "$sapi" in - cli|cgi|embed|fpm|phpdbg) - if [[ "${one_sapi}" == "${sapi}" ]] ; then - sapi_conf+=( "--enable-${sapi}" ) - if [[ "fpm" == "${sapi}" ]] ; then - sapi_conf+=( - $(use_with acl fpm-acl) - $(use_with systemd fpm-systemd) - ) - fi - else - sapi_conf+=( "--disable-${sapi}" ) - fi - ;; - - apache2) - if [[ "${one_sapi}" == "${sapi}" ]] ; then - sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" ) - else - sapi_conf+=( --without-apxs2 ) - fi - ;; - esac - done - - # Construct the $myeconfargs array by concatenating $our_conf - # (the common args) and $sapi_conf (the SAPI-specific args). - local myeconfargs=( "${our_conf[@]}" ) - myeconfargs+=( "${sapi_conf[@]}" ) - - pushd "${BUILD_DIR}" > /dev/null || die - einfo "Running econf in ${BUILD_DIR}" - econf "${myeconfargs[@]}" - popd > /dev/null || die - done -} - -src_compile() { - # snmp seems to run during src_compile, too (bug #324739) - addpredict /usr/share/snmp/mibs/.index #nowarn - addpredict /var/lib/net-snmp/mib_indexes #nowarn - - if use oci8-instant-client && use kerberos && use imap && use phar; then - # A conspiracy takes place when the first three of these flags - # are set together, causing the newly-built "php" to open - # /dev/urandom with mode rw when it starts. That's not actually - # a problem... unless you also have USE=phar, which runs that - # "php" to build some phar thingy in src_compile(). Later in - # src_test(), portage (at least) sets "addpredict /" so the - # problem does not repeat. - addpredict /dev/urandom #nowarn - fi - - local sapi - for sapi in ${SAPIS} ; do - use "${sapi}" && emake -C "${WORKDIR}/sapis-build/${sapi}" - done -} - -src_install() { - # see bug #324739 for what happens when we don't have that - addpredict /usr/share/snmp/mibs/.index #nowarn - - # grab the first SAPI that got built and install common files from there - local first_sapi="", sapi="" - for sapi in $SAPIS ; do - if use $sapi ; then - first_sapi=$sapi - break - fi - done - - # Makefile forgets to create this before trying to write to it... - dodir "${PHP_DESTDIR#${EPREFIX}}/bin" - - # Install php environment (without any sapis) - 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)" - - # 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 - if use "${sapi}" ; then - einfo "Installing SAPI: ${sapi}" - cd "${WORKDIR}/sapis-build/${sapi}" || die - - if [[ "${sapi}" == "apache2" ]] ; then - # We're specifically not using emake install-sapi as libtool - # may cause unnecessary relink failures (see bug #351266) - insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/" - newins ".libs/libphp$(get_libname)" \ - "libphp${PHP_MV}$(get_libname)" - keepdir "/usr/$(get_libdir)/apache2/modules" - else - # needed each time, php_install_ini would reset it - local dest="${PHP_DESTDIR#${EPREFIX}}" - into "${dest}" - case "$sapi" in - cli) - source="sapi/cli/php" - # Install the "phar" archive utility. - if use phar ; then - emake INSTALL_ROOT="${D}" install-pharcmd - dosym "..${dest#/usr}/bin/phar" "/usr/bin/phar${SLOT}" - fi - ;; - cgi) - source="sapi/cgi/php-cgi" - ;; - fpm) - source="sapi/fpm/php-fpm" - ;; - embed) - source="libs/libphp$(get_libname)" - ;; - phpdbg) - source="sapi/phpdbg/phpdbg" - ;; - *) - die "unhandled sapi in src_install" - ;; - esac - - if [[ "${source}" == *"$(get_libname)" ]]; then - dolib.so "${source}" - else - dobin "${source}" - local name="$(basename ${source})" - dosym "..${dest#/usr}/bin/${name}" "/usr/bin/${name}${SLOT}" - fi - fi - - php_install_ini "${sapi}" - - # construct correct SAPI string for php-config - # thanks to ferringb for the bash voodoo - if [[ "${sapi}" == "apache2" ]]; then - sapi_list="${sapi_list:+${sapi_list} }apache2handler" - else - sapi_list="${sapi_list:+${sapi_list} }${sapi}" - fi - 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 - sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die - - # set php-config variable correctly (bug #278439) - sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \ - "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die - - if use fpm ; then - if use systemd; then - systemd_newunit "${FILESDIR}/php-fpm_at.service" \ - "php-fpm@${SLOT}.service" - else - systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \ - "php-fpm@${SLOT}.service" - fi - fi -} - -src_test() { - 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" - fi - - if [[ -x "${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" ]] ; then - export TEST_PHPDBG_EXECUTABLE="${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" - fi - - # The sendmail override prevents ext/imap/tests/bug77020.phpt from - # actually trying to send mail, and will be fixed upstream soon: - # - # https://github.com/php/php-src/issues/11629 - # - # 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}" \ - -d "sendmail_path=echo >/dev/null" \ - || die "tests failed" -} - -pkg_postinst() { - # Output some general info to the user - if use apache2 ; then - elog - elog "To enable PHP in apache, you will need to add \"-D PHP\" to" - elog "your apache2 command. OpenRC users can append that string to" - elog "APACHE2_OPTS in /etc/conf.d/apache2." - elog - elog "The apache module configuration file 70_mod_php.conf is" - elog "provided (and maintained) by eselect-php." - elog - fi - - # Create the symlinks for php - local m - for m in ${SAPIS}; do - [[ ${m} == 'embed' ]] && continue; - if use $m ; then - local ci=$(eselect php show $m) - if [[ -z $ci ]]; then - eselect php set $m php${SLOT} || die - einfo "Switched ${m} to use php:${SLOT}" - einfo - elif [[ $ci != "php${SLOT}" ]] ; then - elog "To switch $m to use php:${SLOT}, run" - elog " eselect php set $m php${SLOT}" - elog - fi - fi - done - - # Remove dead symlinks for SAPIs that were just disabled. For - # example, if the user has the cgi SAPI enabled, then he has an - # eselect-php symlink for it. If he later reinstalls PHP with - # USE="-cgi", that symlink will break. This call to eselect is - # supposed to remove that dead link per bug 572436. - eselect php cleanup || die - - if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then - elog "To build extensions for this version of PHP, you will need to" - elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable." - elog - fi - - # Warn about the removal of PHP_INI_VERSION if the user has it set. - if [[ -n "${PHP_INI_VERSION}" ]]; then - ewarn 'The PHP_INI_VERSION variable has been phased out. You may' - ewarn 'remove it from your configuration at your convenience. See' - ewarn - ewarn ' https://bugs.gentoo.org/611214' - ewarn - ewarn 'for more information.' - fi - - elog "For details on how version slotting works, please see" - elog "the wiki:" - elog - elog " https://wiki.gentoo.org/wiki/PHP" - elog -} - -pkg_postrm() { - # This serves two purposes. First, if we have just removed the last - # installed version of PHP, then this will remove any dead symlinks - # belonging to eselect-php. Second, if a user upgrades slots from - # (say) 5.6 to 7.0 and depcleans the old slot, then this will update - # his existing symlinks to point to the new 7.0 installation. The - # latter is bug 432962. - # - # Note: the eselect-php package may not be installed at this point, - # so we can't die() if this command fails. - eselect php cleanup -} diff --git a/dev-lang/php/php-8.3.0-r1.ebuild b/dev-lang/php/php-8.3.0-r1.ebuild new file mode 100644 index 000000000000..c694a628967e --- /dev/null +++ b/dev-lang/php/php-8.3.0-r1.ebuild @@ -0,0 +1,790 @@ +# Copyright 1999-2023 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 + +DESCRIPTION="The PHP language runtime engine" +HOMEPAGE="https://www.php.net/" +SRC_URI="https://www.php.net/distributions/${P}.tar.xz" + +LICENSE="PHP-3.01 + BSD + Zend-2.0 + bcmath? ( LGPL-2.1+ ) + fpm? ( BSD-2 ) + gd? ( gd ) + unicode? ( BSD-2 LGPL-2.1 )" + +SLOT="$(ver_cut 1-2)" +KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~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" + +# SAPIs and SAPI-specific USE flags (cli SAPI is default on): +IUSE="${IUSE} + ${SAPIS/cli/+cli} + threads" + +IUSE="${IUSE} acl apparmor argon2 avif bcmath berkdb bzip2 calendar + capstone cdb cjk +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 + mhash mssql mysql mysqli nls + oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm + readline selinux +session session-mm sharedmem + +simplexml snmp soap sockets sodium spell sqlite ssl + 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 ) + xmlreader? ( xml ) + 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 ) +" + +RESTRICT="!test? ( test )" + +# The supported (that is, autodetected) versions of BDB are listed in +# 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[apache2?,fpm?] + dev-libs/libpcre2[jit?,unicode] + virtual/libcrypt:= + 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 ) ) + curl? ( net-misc/curl ) + enchant? ( app-text/enchant:2 ) + ffi? ( dev-libs/libffi:= ) + firebird? ( dev-db/firebird ) + gd? ( media-libs/libjpeg-turbo:0= media-libs/libpng:0= ) + 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:= ) + 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 ) ) + postgres? ( dev-db/postgresql:* ) + qdbm? ( dev-db/qdbm ) + readline? ( sys-libs/readline:0= ) + session-mm? ( dev-libs/mm ) + snmp? ( net-analyzer/net-snmp ) + sodium? ( dev-libs/libsodium:=[-minimal] ) + 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 ) + unicode? ( dev-libs/oniguruma:= ) + valgrind? ( dev-util/valgrind ) + webp? ( media-libs/libwebp:0= ) + xml? ( dev-libs/libxml2 ) + xpm? ( x11-libs/libXpm ) + xslt? ( dev-libs/libxslt ) + zip? ( dev-libs/libzip:= ) + zlib? ( sys-libs/zlib:0= ) +" + +IDEPEND="app-eselect/eselect-php[apache2?,fpm?]" + +RDEPEND="${COMMON_DEPEND} + virtual/mta + fpm? ( + selinux? ( sec-policy/selinux-phpfpm ) + systemd? ( sys-apps/systemd ) )" + +# Bison isn't actually needed when building from a release tarball +# However, the configure script will warn if it's absent or if you +# have an incompatible version installed. See bug 593278. +DEPEND="${COMMON_DEPEND} + app-arch/xz-utils + sys-devel/bison" + +BDEPEND="virtual/pkgconfig" + +PHP_MV="$(ver_cut 1)" + +PATCHES=( + "${FILESDIR}/php-iodbc-header-location.patch" +) + +php_install_ini() { + local phpsapi="${1}" + + # work out where we are installing the ini file + php_set_ini_dir "${phpsapi}" + + # Always install the production INI file, bug 611214. + local phpinisrc="php.ini-production-${phpsapi}" + cp php.ini-production "${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 + 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 + + elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}" + elog + + dodir "${PHP_EXT_INI_DIR#${EPREFIX}}" + dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}" + + if use opcache; then + elog "Adding opcache to $PHP_EXT_INI_DIR" + echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \ + "${D}/${PHP_EXT_INI_DIR}"/opcache.ini + dosym "../ext/opcache.ini" \ + "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini" + fi + + # SAPI-specific handling + if [[ "${sapi}" == "fpm" ]] ; then + einfo "Installing FPM config files php-fpm.conf and www.conf" + insinto "${PHP_INI_DIR#${EPREFIX}}" + doins sapi/fpm/php-fpm.conf + insinto "${PHP_INI_DIR#${EPREFIX}}/fpm.d" + doins sapi/fpm/www.conf + fi + + dodoc php.ini-{development,production} +} + +php_set_ini_dir() { + PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}" + PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext" + PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active" +} + +src_prepare() { + default + + # In php-7.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 + # we'll install the pool configuration file "www.conf" there. + php_set_ini_dir fpm + sed -i "s~^include=.*$~include=${PHP_INI_DIR}/fpm.d/*.conf~" \ + 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 + eautoconf --force + eautoheader + + # 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 Oracle tests are borked, + # + # * https://github.com/php/php-src/issues/11804 + # * https://github.com/php/php-src/pull/11820 + # * https://github.com/php/php-src/issues/11819 + # + rm ext/oci8/tests/*.phpt || die + + # https://github.com/php/php-src/issues/12801 + rm ext/pcre/tests/gh11374.phpt || die +} + +src_configure() { + addpredict /usr/share/snmp/mibs/.index #nowarn + addpredict /var/lib/net-snmp/mib_indexes #nowarn + + # 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=( + --prefix="${PHP_DESTDIR}" + --mandir="${PHP_DESTDIR}/man" + --infodir="${PHP_DESTDIR}/info" + --libdir="${PHP_DESTDIR}/lib" + --with-libdir="$(get_libdir)" + --localstatedir="${EPREFIX}/var" + --without-pear + --without-valgrind + --with-external-libcrypt + $(use_enable threads zts) + ) + + 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_with capstone) + $(use_enable ctype) + $(use_with curl) + $(use_enable xml dom) + $(use_with enchant) + $(use_enable exif) + $(use_with ffi) + $(use_enable fileinfo) + $(use_enable filter) + $(use_enable ftp) + $(use_with nls gettext "${EPREFIX}/usr") + $(use_with gmp gmp "${EPREFIX}/usr") + $(use_with mhash mhash "${EPREFIX}/usr") + $(use_with iconv iconv \ + $(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) + $(use_enable pcntl) + $(use_enable phar) + $(use_enable pdo) + $(use_enable opcache) + $(use_with postgres pgsql "${EPREFIX}/usr") + $(use_enable posix) + $(use_with selinux fpm-selinux) + $(use_with spell pspell "${EPREFIX}/usr") + $(use_enable simplexml) + $(use_enable sharedmem shmop) + $(use_with snmp snmp "${EPREFIX}/usr") + $(use_enable soap) + $(use_enable sockets) + $(use_with sodium) + $(use_with sqlite sqlite3) + $(use_enable sysvipc sysvmsg) + $(use_enable sysvipc sysvsem) + $(use_enable sysvipc sysvshm) + $(use_with tidy tidy "${EPREFIX}/usr") + $(use_enable tokenizer) + $(use_enable xml) + $(use_enable xmlreader) + $(use_enable xmlwriter) + $(use_with xslt xsl) + $(use_with zip) + $(use_with zlib zlib "${EPREFIX}/usr") + $(use_enable debug) + $(use_with valgrind) + ) + + # DBA support + if use cdb || use berkdb || use flatfile || use gdbm || use inifile \ + || use qdbm || use lmdb || use tokyocabinet ; then + our_conf+=( "--enable-dba" ) + fi + + # DBA drivers support + our_conf+=( + $(use_with cdb) + $(use_with berkdb db4 "${EPREFIX}/usr") + $(use_enable flatfile) + $(use_with gdbm gdbm "${EPREFIX}/usr") + $(use_enable inifile) + $(use_with qdbm qdbm "${EPREFIX}/usr") + $(use_with tokyocabinet tcadb "${EPREFIX}/usr") + $(use_with lmdb lmdb "${EPREFIX}/usr") + ) + + # Support for the GD graphics library + our_conf+=( + $(use_with truetype freetype) + $(use_enable cjk gd-jis-conv) + $(use_with gd jpeg) + $(use_with xpm) + $(use_with webp) + ) + # 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 + our_conf+=( + $(use_with ldap ldap "${EPREFIX}/usr") + $(use_with ldap-sasl) + ) + fi + + # MySQL support + our_conf+=( $(use_with mysqli) ) + + local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock" + if use mysql || use mysqli ; then + our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") ) + fi + + # ODBC support + if use odbc && use iodbc ; then + our_conf+=( + --without-unixODBC + --with-iodbc + $(use_with pdo pdo-odbc "iODBC,${EPREFIX}/usr") + ) + elif use odbc ; then + our_conf+=( + --with-unixODBC="${EPREFIX}/usr" + --without-iodbc + $(use_with pdo pdo-odbc "unixODBC,${EPREFIX}/usr") + ) + else + our_conf+=( + --without-unixODBC + --without-iodbc + --without-pdo-odbc + ) + fi + + # Oracle support + our_conf+=( $(use_with oci8-instant-client oci8) ) + + # PDO support + if use pdo ; then + our_conf+=( + $(use_with mssql pdo-dblib "${EPREFIX}/usr") + $(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 + + # readline/libedit support + our_conf+=( + $(use_with readline readline "${EPREFIX}/usr") + $(use_with libedit) + ) + + # Session support + if use session ; then + our_conf+=( $(use_with session-mm mm "${EPREFIX}/usr") ) + else + our_conf+=( $(use_enable session) ) + fi + + # Use pic for shared modules such as apache2's mod_php + our_conf+=( --with-pic ) + + # we use the system copy of pcre + # --with-external-pcre affects ext/pcre + our_conf+=( + --with-external-pcre + $(use_with jit pcre-jit) + ) + + # Catch CFLAGS problems + # Fixes bug #14067. + # Changed order to run it in reverse for bug #32022 and #12021. + replace-cpu-flags "k6*" "i586" + + # Cache the ./configure test results between SAPIs. + our_conf+=( --cache-file="${T}/config.cache" ) + + # Support user-passed configuration parameters + our_conf+=( ${EXTRA_ECONF:-} ) + + # 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. + local one_sapi + local sapi + mkdir "${WORKDIR}/sapis-build" || die + for one_sapi in $SAPIS ; do + use "${one_sapi}" || continue + php_set_ini_dir "${one_sapi}" + + # The BUILD_DIR variable is used to determine where to output + # the files that autotools creates. This was all originally + # based on the autotools-utils eclass. + BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}" + cp -a "${S}" "${BUILD_DIR}" || die + + local sapi_conf=( + --with-config-file-path="${PHP_INI_DIR}" + --with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}" + ) + + for sapi in $SAPIS ; do + case "$sapi" in + cli|cgi|embed|fpm|phpdbg) + if [[ "${one_sapi}" == "${sapi}" ]] ; then + sapi_conf+=( "--enable-${sapi}" ) + if [[ "fpm" == "${sapi}" ]] ; then + sapi_conf+=( + $(use_with acl fpm-acl) + $(use_with systemd fpm-systemd) + ) + fi + else + sapi_conf+=( "--disable-${sapi}" ) + fi + ;; + + apache2) + if [[ "${one_sapi}" == "${sapi}" ]] ; then + sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" ) + else + sapi_conf+=( --without-apxs2 ) + fi + ;; + esac + done + + # Construct the $myeconfargs array by concatenating $our_conf + # (the common args) and $sapi_conf (the SAPI-specific args). + local myeconfargs=( "${our_conf[@]}" ) + myeconfargs+=( "${sapi_conf[@]}" ) + + pushd "${BUILD_DIR}" > /dev/null || die + einfo "Running econf in ${BUILD_DIR}" + econf "${myeconfargs[@]}" + popd > /dev/null || die + done +} + +src_compile() { + # snmp seems to run during src_compile, too (bug #324739) + addpredict /usr/share/snmp/mibs/.index #nowarn + addpredict /var/lib/net-snmp/mib_indexes #nowarn + + if use oci8-instant-client && use kerberos && use imap && use phar; then + # A conspiracy takes place when the first three of these flags + # are set together, causing the newly-built "php" to open + # /dev/urandom with mode rw when it starts. That's not actually + # a problem... unless you also have USE=phar, which runs that + # "php" to build some phar thingy in src_compile(). Later in + # src_test(), portage (at least) sets "addpredict /" so the + # problem does not repeat. + addpredict /dev/urandom #nowarn + fi + + local sapi + for sapi in ${SAPIS} ; do + use "${sapi}" && emake -C "${WORKDIR}/sapis-build/${sapi}" + done +} + +src_install() { + # see bug #324739 for what happens when we don't have that + addpredict /usr/share/snmp/mibs/.index #nowarn + + # grab the first SAPI that got built and install common files from there + local first_sapi="", sapi="" + for sapi in $SAPIS ; do + if use $sapi ; then + first_sapi=$sapi + break + fi + done + + # Makefile forgets to create this before trying to write to it... + dodir "${PHP_DESTDIR#${EPREFIX}}/bin" + + # Install php environment (without any sapis) + 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)" + + # 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 + if use "${sapi}" ; then + einfo "Installing SAPI: ${sapi}" + cd "${WORKDIR}/sapis-build/${sapi}" || die + + if [[ "${sapi}" == "apache2" ]] ; then + # We're specifically not using emake install-sapi as libtool + # may cause unnecessary relink failures (see bug #351266) + insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/" + newins ".libs/libphp$(get_libname)" \ + "libphp${PHP_MV}$(get_libname)" + keepdir "/usr/$(get_libdir)/apache2/modules" + else + # needed each time, php_install_ini would reset it + local dest="${PHP_DESTDIR#${EPREFIX}}" + into "${dest}" + case "$sapi" in + cli) + source="sapi/cli/php" + # Install the "phar" archive utility. + if use phar ; then + emake INSTALL_ROOT="${D}" install-pharcmd + dosym "..${dest#/usr}/bin/phar" "/usr/bin/phar${SLOT}" + fi + ;; + cgi) + source="sapi/cgi/php-cgi" + ;; + fpm) + source="sapi/fpm/php-fpm" + ;; + embed) + source="libs/libphp$(get_libname)" + ;; + phpdbg) + source="sapi/phpdbg/phpdbg" + ;; + *) + die "unhandled sapi in src_install" + ;; + esac + + if [[ "${source}" == *"$(get_libname)" ]]; then + dolib.so "${source}" + else + dobin "${source}" + local name="$(basename ${source})" + dosym "..${dest#/usr}/bin/${name}" "/usr/bin/${name}${SLOT}" + fi + fi + + php_install_ini "${sapi}" + + # construct correct SAPI string for php-config + # thanks to ferringb for the bash voodoo + if [[ "${sapi}" == "apache2" ]]; then + sapi_list="${sapi_list:+${sapi_list} }apache2handler" + else + sapi_list="${sapi_list:+${sapi_list} }${sapi}" + fi + 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 + sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die + + # set php-config variable correctly (bug #278439) + sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \ + "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die + + if use fpm ; then + if use systemd; then + systemd_newunit "${FILESDIR}/php-fpm_at.service" \ + "php-fpm@${SLOT}.service" + else + systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \ + "php-fpm@${SLOT}.service" + fi + fi +} + +src_test() { + 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" + fi + + if [[ -x "${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" ]] ; then + export TEST_PHPDBG_EXECUTABLE="${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" + fi + + # The sendmail override prevents ext/imap/tests/bug77020.phpt from + # actually trying to send mail, and will be fixed upstream soon: + # + # https://github.com/php/php-src/issues/11629 + # + # 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}" \ + -d "sendmail_path=echo >/dev/null" \ + || die "tests failed" +} + +pkg_postinst() { + # Output some general info to the user + if use apache2 ; then + elog + elog "To enable PHP in apache, you will need to add \"-D PHP\" to" + elog "your apache2 command. OpenRC users can append that string to" + elog "APACHE2_OPTS in /etc/conf.d/apache2." + elog + elog "The apache module configuration file 70_mod_php.conf is" + elog "provided (and maintained) by eselect-php." + elog + fi + + # Create the symlinks for php + local m + for m in ${SAPIS}; do + [[ ${m} == 'embed' ]] && continue; + if use $m ; then + local ci=$(eselect php show $m) + if [[ -z $ci ]]; then + eselect php set $m php${SLOT} || die + einfo "Switched ${m} to use php:${SLOT}" + einfo + elif [[ $ci != "php${SLOT}" ]] ; then + elog "To switch $m to use php:${SLOT}, run" + elog " eselect php set $m php${SLOT}" + elog + fi + fi + done + + # Remove dead symlinks for SAPIs that were just disabled. For + # example, if the user has the cgi SAPI enabled, then he has an + # eselect-php symlink for it. If he later reinstalls PHP with + # USE="-cgi", that symlink will break. This call to eselect is + # supposed to remove that dead link per bug 572436. + eselect php cleanup || die + + if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then + elog "To build extensions for this version of PHP, you will need to" + elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable." + elog + fi + + # Warn about the removal of PHP_INI_VERSION if the user has it set. + if [[ -n "${PHP_INI_VERSION}" ]]; then + ewarn 'The PHP_INI_VERSION variable has been phased out. You may' + ewarn 'remove it from your configuration at your convenience. See' + ewarn + ewarn ' https://bugs.gentoo.org/611214' + ewarn + ewarn 'for more information.' + fi + + elog "For details on how version slotting works, please see" + elog "the wiki:" + elog + elog " https://wiki.gentoo.org/wiki/PHP" + elog +} + +pkg_postrm() { + # This serves two purposes. First, if we have just removed the last + # installed version of PHP, then this will remove any dead symlinks + # belonging to eselect-php. Second, if a user upgrades slots from + # (say) 5.6 to 7.0 and depcleans the old slot, then this will update + # his existing symlinks to point to the new 7.0 installation. The + # latter is bug 432962. + # + # Note: the eselect-php package may not be installed at this point, + # so we can't die() if this command fails. + eselect php cleanup +} diff --git a/dev-lang/php/php-8.3.0.ebuild b/dev-lang/php/php-8.3.0.ebuild deleted file mode 100644 index 195326a5aff5..000000000000 --- a/dev-lang/php/php-8.3.0.ebuild +++ /dev/null @@ -1,790 +0,0 @@ -# Copyright 1999-2023 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 - -DESCRIPTION="The PHP language runtime engine" -HOMEPAGE="https://www.php.net/" -SRC_URI="https://www.php.net/distributions/${P}.tar.xz" - -LICENSE="PHP-3.01 - BSD - Zend-2.0 - bcmath? ( LGPL-2.1+ ) - fpm? ( BSD-2 ) - gd? ( gd ) - unicode? ( BSD-2 LGPL-2.1 )" - -SLOT="$(ver_cut 1-2)" -KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~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" - -# SAPIs and SAPI-specific USE flags (cli SAPI is default on): -IUSE="${IUSE} - ${SAPIS/cli/+cli} - threads" - -IUSE="${IUSE} acl apparmor argon2 avif bcmath berkdb bzip2 calendar - capstone cdb cjk +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 - mhash mssql mysql mysqli nls - oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm - readline selinux +session session-mm sharedmem - +simplexml snmp soap sockets sodium spell sqlite ssl - 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 ) - xmlreader? ( xml ) - 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 ) -" - -RESTRICT="!test? ( test )" - -# The supported (that is, autodetected) versions of BDB are listed in -# 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[apache2?,fpm?] - dev-libs/libpcre2[jit?,unicode] - virtual/libcrypt:= - 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 ) ) - curl? ( net-misc/curl ) - enchant? ( app-text/enchant:2 ) - ffi? ( dev-libs/libffi:= ) - firebird? ( dev-db/firebird ) - gd? ( media-libs/libjpeg-turbo:0= media-libs/libpng:0= ) - 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:= ) - 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 ) ) - postgres? ( dev-db/postgresql:* ) - qdbm? ( dev-db/qdbm ) - readline? ( sys-libs/readline:0= ) - session-mm? ( dev-libs/mm ) - snmp? ( net-analyzer/net-snmp ) - sodium? ( dev-libs/libsodium:=[-minimal] ) - 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 ) - unicode? ( dev-libs/oniguruma:= ) - valgrind? ( dev-util/valgrind ) - webp? ( media-libs/libwebp:0= ) - xml? ( dev-libs/libxml2 ) - xpm? ( x11-libs/libXpm ) - xslt? ( dev-libs/libxslt ) - zip? ( dev-libs/libzip:= ) - zlib? ( sys-libs/zlib:0= ) -" - -IDEPEND="app-eselect/eselect-php[apache2?,fpm?]" - -RDEPEND="${COMMON_DEPEND} - virtual/mta - fpm? ( - selinux? ( sec-policy/selinux-phpfpm ) - systemd? ( sys-apps/systemd ) )" - -# Bison isn't actually needed when building from a release tarball -# However, the configure script will warn if it's absent or if you -# have an incompatible version installed. See bug 593278. -DEPEND="${COMMON_DEPEND} - app-arch/xz-utils - sys-devel/bison" - -BDEPEND="virtual/pkgconfig" - -PHP_MV="$(ver_cut 1)" - -PATCHES=( - "${FILESDIR}/php-iodbc-header-location.patch" -) - -php_install_ini() { - local phpsapi="${1}" - - # work out where we are installing the ini file - php_set_ini_dir "${phpsapi}" - - # Always install the production INI file, bug 611214. - local phpinisrc="php.ini-production-${phpsapi}" - cp php.ini-production "${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 - 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 - - elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}" - elog - - dodir "${PHP_EXT_INI_DIR#${EPREFIX}}" - dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}" - - if use opcache; then - elog "Adding opcache to $PHP_EXT_INI_DIR" - echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \ - "${D}/${PHP_EXT_INI_DIR}"/opcache.ini - dosym "../ext/opcache.ini" \ - "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini" - fi - - # SAPI-specific handling - if [[ "${sapi}" == "fpm" ]] ; then - einfo "Installing FPM config files php-fpm.conf and www.conf" - insinto "${PHP_INI_DIR#${EPREFIX}}" - doins sapi/fpm/php-fpm.conf - insinto "${PHP_INI_DIR#${EPREFIX}}/fpm.d" - doins sapi/fpm/www.conf - fi - - dodoc php.ini-{development,production} -} - -php_set_ini_dir() { - PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}" - PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext" - PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active" -} - -src_prepare() { - default - - # In php-7.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 - # we'll install the pool configuration file "www.conf" there. - php_set_ini_dir fpm - sed -i "s~^include=.*$~include=${PHP_INI_DIR}/fpm.d/*.conf~" \ - 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 - eautoconf --force - eautoheader - - # 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 Oracle tests are borked, - # - # * https://github.com/php/php-src/issues/11804 - # * https://github.com/php/php-src/pull/11820 - # * https://github.com/php/php-src/issues/11819 - # - rm ext/oci8/tests/*.phpt || die - - # https://github.com/php/php-src/issues/12801 - rm ext/pcre/tests/gh11374.phpt || die -} - -src_configure() { - addpredict /usr/share/snmp/mibs/.index #nowarn - addpredict /var/lib/net-snmp/mib_indexes #nowarn - - # 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=( - --prefix="${PHP_DESTDIR}" - --mandir="${PHP_DESTDIR}/man" - --infodir="${PHP_DESTDIR}/info" - --libdir="${PHP_DESTDIR}/lib" - --with-libdir="$(get_libdir)" - --localstatedir="${EPREFIX}/var" - --without-pear - --without-valgrind - --enable-ipv6 - $(use_enable threads zts) - ) - - 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_with capstone) - $(use_enable ctype) - $(use_with curl) - $(use_enable xml dom) - $(use_with enchant) - $(use_enable exif) - $(use_with ffi) - $(use_enable fileinfo) - $(use_enable filter) - $(use_enable ftp) - $(use_with nls gettext "${EPREFIX}/usr") - $(use_with gmp gmp "${EPREFIX}/usr") - $(use_with mhash mhash "${EPREFIX}/usr") - $(use_with iconv iconv \ - $(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) - $(use_enable pcntl) - $(use_enable phar) - $(use_enable pdo) - $(use_enable opcache) - $(use_with postgres pgsql "${EPREFIX}/usr") - $(use_enable posix) - $(use_with selinux fpm-selinux) - $(use_with spell pspell "${EPREFIX}/usr") - $(use_enable simplexml) - $(use_enable sharedmem shmop) - $(use_with snmp snmp "${EPREFIX}/usr") - $(use_enable soap) - $(use_enable sockets) - $(use_with sodium) - $(use_with sqlite sqlite3) - $(use_enable sysvipc sysvmsg) - $(use_enable sysvipc sysvsem) - $(use_enable sysvipc sysvshm) - $(use_with tidy tidy "${EPREFIX}/usr") - $(use_enable tokenizer) - $(use_enable xml) - $(use_enable xmlreader) - $(use_enable xmlwriter) - $(use_with xslt xsl) - $(use_with zip) - $(use_with zlib zlib "${EPREFIX}/usr") - $(use_enable debug) - $(use_with valgrind) - ) - - # DBA support - if use cdb || use berkdb || use flatfile || use gdbm || use inifile \ - || use qdbm || use lmdb || use tokyocabinet ; then - our_conf+=( "--enable-dba" ) - fi - - # DBA drivers support - our_conf+=( - $(use_with cdb) - $(use_with berkdb db4 "${EPREFIX}/usr") - $(use_enable flatfile) - $(use_with gdbm gdbm "${EPREFIX}/usr") - $(use_enable inifile) - $(use_with qdbm qdbm "${EPREFIX}/usr") - $(use_with tokyocabinet tcadb "${EPREFIX}/usr") - $(use_with lmdb lmdb "${EPREFIX}/usr") - ) - - # Support for the GD graphics library - our_conf+=( - $(use_with truetype freetype) - $(use_enable cjk gd-jis-conv) - $(use_with gd jpeg) - $(use_with xpm) - $(use_with webp) - ) - # 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 - our_conf+=( - $(use_with ldap ldap "${EPREFIX}/usr") - $(use_with ldap-sasl) - ) - fi - - # MySQL support - our_conf+=( $(use_with mysqli) ) - - local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock" - if use mysql || use mysqli ; then - our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") ) - fi - - # ODBC support - if use odbc && use iodbc ; then - our_conf+=( - --without-unixODBC - --with-iodbc - $(use_with pdo pdo-odbc "iODBC,${EPREFIX}/usr") - ) - elif use odbc ; then - our_conf+=( - --with-unixODBC="${EPREFIX}/usr" - --without-iodbc - $(use_with pdo pdo-odbc "unixODBC,${EPREFIX}/usr") - ) - else - our_conf+=( - --without-unixODBC - --without-iodbc - --without-pdo-odbc - ) - fi - - # Oracle support - our_conf+=( $(use_with oci8-instant-client oci8) ) - - # PDO support - if use pdo ; then - our_conf+=( - $(use_with mssql pdo-dblib "${EPREFIX}/usr") - $(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 - - # readline/libedit support - our_conf+=( - $(use_with readline readline "${EPREFIX}/usr") - $(use_with libedit) - ) - - # Session support - if use session ; then - our_conf+=( $(use_with session-mm mm "${EPREFIX}/usr") ) - else - our_conf+=( $(use_enable session) ) - fi - - # Use pic for shared modules such as apache2's mod_php - our_conf+=( --with-pic ) - - # we use the system copy of pcre - # --with-external-pcre affects ext/pcre - our_conf+=( - --with-external-pcre - $(use_with jit pcre-jit) - ) - - # Catch CFLAGS problems - # Fixes bug #14067. - # Changed order to run it in reverse for bug #32022 and #12021. - replace-cpu-flags "k6*" "i586" - - # Cache the ./configure test results between SAPIs. - our_conf+=( --cache-file="${T}/config.cache" ) - - # Support user-passed configuration parameters - our_conf+=( ${EXTRA_ECONF:-} ) - - # 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. - local one_sapi - local sapi - mkdir "${WORKDIR}/sapis-build" || die - for one_sapi in $SAPIS ; do - use "${one_sapi}" || continue - php_set_ini_dir "${one_sapi}" - - # The BUILD_DIR variable is used to determine where to output - # the files that autotools creates. This was all originally - # based on the autotools-utils eclass. - BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}" - cp -a "${S}" "${BUILD_DIR}" || die - - local sapi_conf=( - --with-config-file-path="${PHP_INI_DIR}" - --with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}" - ) - - for sapi in $SAPIS ; do - case "$sapi" in - cli|cgi|embed|fpm|phpdbg) - if [[ "${one_sapi}" == "${sapi}" ]] ; then - sapi_conf+=( "--enable-${sapi}" ) - if [[ "fpm" == "${sapi}" ]] ; then - sapi_conf+=( - $(use_with acl fpm-acl) - $(use_with systemd fpm-systemd) - ) - fi - else - sapi_conf+=( "--disable-${sapi}" ) - fi - ;; - - apache2) - if [[ "${one_sapi}" == "${sapi}" ]] ; then - sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" ) - else - sapi_conf+=( --without-apxs2 ) - fi - ;; - esac - done - - # Construct the $myeconfargs array by concatenating $our_conf - # (the common args) and $sapi_conf (the SAPI-specific args). - local myeconfargs=( "${our_conf[@]}" ) - myeconfargs+=( "${sapi_conf[@]}" ) - - pushd "${BUILD_DIR}" > /dev/null || die - einfo "Running econf in ${BUILD_DIR}" - econf "${myeconfargs[@]}" - popd > /dev/null || die - done -} - -src_compile() { - # snmp seems to run during src_compile, too (bug #324739) - addpredict /usr/share/snmp/mibs/.index #nowarn - addpredict /var/lib/net-snmp/mib_indexes #nowarn - - if use oci8-instant-client && use kerberos && use imap && use phar; then - # A conspiracy takes place when the first three of these flags - # are set together, causing the newly-built "php" to open - # /dev/urandom with mode rw when it starts. That's not actually - # a problem... unless you also have USE=phar, which runs that - # "php" to build some phar thingy in src_compile(). Later in - # src_test(), portage (at least) sets "addpredict /" so the - # problem does not repeat. - addpredict /dev/urandom #nowarn - fi - - local sapi - for sapi in ${SAPIS} ; do - use "${sapi}" && emake -C "${WORKDIR}/sapis-build/${sapi}" - done -} - -src_install() { - # see bug #324739 for what happens when we don't have that - addpredict /usr/share/snmp/mibs/.index #nowarn - - # grab the first SAPI that got built and install common files from there - local first_sapi="", sapi="" - for sapi in $SAPIS ; do - if use $sapi ; then - first_sapi=$sapi - break - fi - done - - # Makefile forgets to create this before trying to write to it... - dodir "${PHP_DESTDIR#${EPREFIX}}/bin" - - # Install php environment (without any sapis) - 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)" - - # 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 - if use "${sapi}" ; then - einfo "Installing SAPI: ${sapi}" - cd "${WORKDIR}/sapis-build/${sapi}" || die - - if [[ "${sapi}" == "apache2" ]] ; then - # We're specifically not using emake install-sapi as libtool - # may cause unnecessary relink failures (see bug #351266) - insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/" - newins ".libs/libphp$(get_libname)" \ - "libphp${PHP_MV}$(get_libname)" - keepdir "/usr/$(get_libdir)/apache2/modules" - else - # needed each time, php_install_ini would reset it - local dest="${PHP_DESTDIR#${EPREFIX}}" - into "${dest}" - case "$sapi" in - cli) - source="sapi/cli/php" - # Install the "phar" archive utility. - if use phar ; then - emake INSTALL_ROOT="${D}" install-pharcmd - dosym "..${dest#/usr}/bin/phar" "/usr/bin/phar${SLOT}" - fi - ;; - cgi) - source="sapi/cgi/php-cgi" - ;; - fpm) - source="sapi/fpm/php-fpm" - ;; - embed) - source="libs/libphp$(get_libname)" - ;; - phpdbg) - source="sapi/phpdbg/phpdbg" - ;; - *) - die "unhandled sapi in src_install" - ;; - esac - - if [[ "${source}" == *"$(get_libname)" ]]; then - dolib.so "${source}" - else - dobin "${source}" - local name="$(basename ${source})" - dosym "..${dest#/usr}/bin/${name}" "/usr/bin/${name}${SLOT}" - fi - fi - - php_install_ini "${sapi}" - - # construct correct SAPI string for php-config - # thanks to ferringb for the bash voodoo - if [[ "${sapi}" == "apache2" ]]; then - sapi_list="${sapi_list:+${sapi_list} }apache2handler" - else - sapi_list="${sapi_list:+${sapi_list} }${sapi}" - fi - 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 - sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die - - # set php-config variable correctly (bug #278439) - sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \ - "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die - - if use fpm ; then - if use systemd; then - systemd_newunit "${FILESDIR}/php-fpm_at.service" \ - "php-fpm@${SLOT}.service" - else - systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \ - "php-fpm@${SLOT}.service" - fi - fi -} - -src_test() { - 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" - fi - - if [[ -x "${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" ]] ; then - export TEST_PHPDBG_EXECUTABLE="${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" - fi - - # The sendmail override prevents ext/imap/tests/bug77020.phpt from - # actually trying to send mail, and will be fixed upstream soon: - # - # https://github.com/php/php-src/issues/11629 - # - # 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}" \ - -d "sendmail_path=echo >/dev/null" \ - || die "tests failed" -} - -pkg_postinst() { - # Output some general info to the user - if use apache2 ; then - elog - elog "To enable PHP in apache, you will need to add \"-D PHP\" to" - elog "your apache2 command. OpenRC users can append that string to" - elog "APACHE2_OPTS in /etc/conf.d/apache2." - elog - elog "The apache module configuration file 70_mod_php.conf is" - elog "provided (and maintained) by eselect-php." - elog - fi - - # Create the symlinks for php - local m - for m in ${SAPIS}; do - [[ ${m} == 'embed' ]] && continue; - if use $m ; then - local ci=$(eselect php show $m) - if [[ -z $ci ]]; then - eselect php set $m php${SLOT} || die - einfo "Switched ${m} to use php:${SLOT}" - einfo - elif [[ $ci != "php${SLOT}" ]] ; then - elog "To switch $m to use php:${SLOT}, run" - elog " eselect php set $m php${SLOT}" - elog - fi - fi - done - - # Remove dead symlinks for SAPIs that were just disabled. For - # example, if the user has the cgi SAPI enabled, then he has an - # eselect-php symlink for it. If he later reinstalls PHP with - # USE="-cgi", that symlink will break. This call to eselect is - # supposed to remove that dead link per bug 572436. - eselect php cleanup || die - - if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then - elog "To build extensions for this version of PHP, you will need to" - elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable." - elog - fi - - # Warn about the removal of PHP_INI_VERSION if the user has it set. - if [[ -n "${PHP_INI_VERSION}" ]]; then - ewarn 'The PHP_INI_VERSION variable has been phased out. You may' - ewarn 'remove it from your configuration at your convenience. See' - ewarn - ewarn ' https://bugs.gentoo.org/611214' - ewarn - ewarn 'for more information.' - fi - - elog "For details on how version slotting works, please see" - elog "the wiki:" - elog - elog " https://wiki.gentoo.org/wiki/PHP" - elog -} - -pkg_postrm() { - # This serves two purposes. First, if we have just removed the last - # installed version of PHP, then this will remove any dead symlinks - # belonging to eselect-php. Second, if a user upgrades slots from - # (say) 5.6 to 7.0 and depcleans the old slot, then this will update - # his existing symlinks to point to the new 7.0 installation. The - # latter is bug 432962. - # - # Note: the eselect-php package may not be installed at this point, - # so we can't die() if this command fails. - eselect php cleanup -} diff --git a/dev-lang/rust-bin/Manifest b/dev-lang/rust-bin/Manifest index 547956fc18b8..c869ab70f596 100644 --- a/dev-lang/rust-bin/Manifest +++ b/dev-lang/rust-bin/Manifest @@ -340,6 +340,34 @@ DIST rust-1.73.0-x86_64-unknown-linux-gnu.tar.xz 161588916 BLAKE2B 10c1c57641e2a DIST rust-1.73.0-x86_64-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 22e68ec4e6bfa49c15344675abd20ef9449d928943dafc64bfa1cf78dd36ccbce4802af8d4adb84762194dabc512efa74655a93785c127e6942ebeca8f6e3303 SHA512 56e53a1047a23a7f37250a785de2422ee2a3a72fdedb9a02530b3cc1cd978370cbbfc0e67d75f3d537f48c6c78f91d3de949ac2c9392a79404609b169cedaa40 DIST rust-1.73.0-x86_64-unknown-linux-musl.tar.xz 236190528 BLAKE2B 062b54b31742bc846bdff63fb38be3a3a1f6d2f061da26cee6a0b089feee995fe3dbea536675495ed75d47d657c3d4bf04e36f6752f59f8308f7eb9a397d6e38 SHA512 abd01e0c98a8aa447d01613e24302ca81a8cce7d41179ed60834a39ed1942de0459add3c498a63f94bb1ee8662a2750b375b49894e3108da45f47d3a643cfdba DIST rust-1.73.0-x86_64-unknown-linux-musl.tar.xz.asc 801 BLAKE2B 9822879d0f14eb5387a623d111ed7a3b1ff038522c071608bd254c4b3479da8a1e9ed78c69c267c1156c45a9cbb2f7db00d123b85f28021a743d392d1cb65c75 SHA512 ff65fd3ca47afeb10f7434d8d4f91b6649739167639c3eadf178aa1339553c5316bd0bb393cd53fcce17c126dcf8db1f1dca6e87044b14762bb20ed8f5a500b7 +DIST rust-1.74.1-aarch64-unknown-linux-gnu.tar.xz 216291888 BLAKE2B 522c2f2b27f9ff81968d7aa536d2f909bca4e4ca6bb341c08227c87e7f25d9808ea6da74ae1bcf3a7bce4165f1d374fef21d352bff37b7241d19d50a624a08e2 SHA512 57486ce7f4ab8fa6f8091817790396df5b9cd31b4c9901b9969fe5407908458fb384423097ee27485c03dbd30d0cb15c3e8f0e5c15ef4ad17662d91685e8caad +DIST rust-1.74.1-aarch64-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B a60c4878f4441029f1f23e6a9a29046fa2d62c1aa8bf33c5ae4c0e986d67ea64688a3fd22bfdc01e99635cc567d87a94fc9ccdb8e512cc4dc8f0378d22eabbfc SHA512 3b2c3d1ccbe5d18c4b8bad62337ddec6306bc0ab654fd75962403f79b86f669ede6f8754327f8375cd4a12f74f3f4df4e183a85f8459de015e6543e17ca80767 +DIST rust-1.74.1-aarch64-unknown-linux-musl.tar.xz 196804076 BLAKE2B c866cef7698da867e8389bc6d460f67486e52822bec516256a8170380d8a2693732c18cc18729b980278fbe3c6fd2d21f1470fea449e66458d5481ac00728824 SHA512 54b9574f624dbb1b8399747e855eccca38dee76c2b59d71fbe41bfb05c1a784bc38d383e7aff0ffb0b8c2c5878bd0f8806e03d1a3c2a6bc4a1a9483d711641ce +DIST rust-1.74.1-aarch64-unknown-linux-musl.tar.xz.asc 801 BLAKE2B 3be239b8961901836a9431a3084e106651b08da7cada74e3ba8f69ad026e7bd88aff25dab307eaff81c85dc7b5477ce5085a56f2aaaa6fba20d6b3ac5db3829b SHA512 b7e09b1ca04732a04a9f0b63cd24d4cc88e26535c5974d00ed511b76c547fef1fce4f4105fdb3d60cd11dec6a579f55a97fa388085fcb8bb3f51f41d96db666f +DIST rust-1.74.1-arm-unknown-linux-gnueabi.tar.xz 180529732 BLAKE2B a61ecef80c1541df30b247b95d565d29222afd4915e32c64af67971e966ed1d4af3f28debddb2f21f16524013e20309f3226b3a18414fd1cf2311aaa07447570 SHA512 2f0e0ac1e10224e49cccd636c00463d009f1c99ffb742dd9774e3722e421f90d9ee207b78ae348a0c2f7703b9538c85db3fd2eca160e2098079fe061fb2006e4 +DIST rust-1.74.1-arm-unknown-linux-gnueabi.tar.xz.asc 801 BLAKE2B 72a01b04050ab3dcd841df10a08c8f9fb7a2c66000b3b035718e4b9cf4ed59ce7c3223f11f9f9ef3dee00260752b0ccae99e70eaa5f3a7e6d2d9457400eb74a3 SHA512 5b399b963c5a3fb0ae0b90523cfc02ea7bb5a5966a48355c937167ecc291c23f4ee8186f09952c913dadab2c9d29f2464e3aeaf077f03aa85964815d1cc27e89 +DIST rust-1.74.1-arm-unknown-linux-gnueabihf.tar.xz 180572504 BLAKE2B 9d94a722a432ddb86276b097fc54926a88b6d9be8e891c84ab43be5c5da0e8b9b9a50c6143959878a479833ec4b85227bddac42bdd391a285ff5c6478345b3f5 SHA512 80882828ebb0d1f609fadcad6e8678ade6dca57dff9c5967ed18b6efb508f4b843b020c83f0fa52f21e506353fbb9eaf7073263662dd75725e85484b9b171804 +DIST rust-1.74.1-arm-unknown-linux-gnueabihf.tar.xz.asc 801 BLAKE2B 4536b990d631d2e6874112e9dbba7cf3a618be577037ac37f2a11e0188eaadafcd552a21d8239d8560e0ab3308a5a2bd4d289055cb58a29aa5d11ba08cc7929a SHA512 6166bdc50e94eac125b66ad6b3d44d162515ce851d67fc93d312d0e16b5bd9e924cba35367d6bf89c223589c80bbb5562cd1c4e7c7b7bb5df51297f766f0b6db +DIST rust-1.74.1-armv7-unknown-linux-gnueabihf.tar.xz 184280672 BLAKE2B d5b409d2d287b95b4e5cff334c9f56a0f357be479d4dbf428b1c631a783eb694b857099f04b3fe7bd73e20372df3d5ea9afa9ec87d56600962fa1c43f822eaa3 SHA512 208c82013ba23716fcf2187cad300c35bdc5ee90a646e6dd2e1c72f3a5722dc21e7e5578f6a56f5644c0641b10fada7f837618e0b1ad68a71ba8efeff8a735bb +DIST rust-1.74.1-armv7-unknown-linux-gnueabihf.tar.xz.asc 801 BLAKE2B ef11fcfd18f023ea32aa48f09bebb967c0f1d738c04d4b407ec2955e67f364ae420899ffab3d177491d97102f28bb37eaa32615942fcb7e0c14a2823affa7538 SHA512 7f2a556b0bd294a4ac826e6d3f7b0fea161b36d9c87eb44270cf024d341ba4dfaa6899bf07a24ce3cb9ee37ad568b3b74d017681d386030c22515645444617b3 +DIST rust-1.74.1-i686-unknown-linux-gnu.tar.xz 211724720 BLAKE2B d48ba506d42406277c2d33cfc8d6c98775b58d7eb1c04cd9597dcf87d58116d1043468ddef3bd05e30fe3ead09df696c2f1d2143b9f0c5a244d51950a1c1c30b SHA512 ac0cd4f60f7f1c526bfc9aff310436764661c15789ba75dc3fd3b9454d357e805cd9fca49af4bb4c16136b72e6bf706d4a3b3957209e667832105adf8b7fa795 +DIST rust-1.74.1-i686-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B a89f1f8b7da7bc5598cb3ca9c257e8660592761ff4ca98221e160a14aa2a4ef55bae03c38c6ba898c432c5b6819045c29a3db41ef8c104694cd7d9e4d0857e10 SHA512 f2e29365922a18bb0a1d6f3664787b26b4950efcd5ca288f6ea3895c4c436c29d870a7aded83b6f6d9ad8603a7f5a1a5e1867df3a34de6c9252c1bbfa20b6034 +DIST rust-1.74.1-loongarch64-unknown-linux-gnu.tar.xz 161665796 BLAKE2B 2675081def9896306644c949c623643d999b3f608ef4745160a8f8c8d9de92c1762e4910dd2da44d07cef6ec9357dcfcf52d1a9291866ce2321c67698f0fc615 SHA512 fe43e4a65d47d1066f4b363b1b3e83029704ec61a13f052fd2f85a5da914c4d76dd2bfc9e58364f3e833a3b966ecc2c3ce3157480555911939497a5ace1e6a75 +DIST rust-1.74.1-loongarch64-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 85aaf2be268183b23b1e7917e062f3699634d4a0aa939951c9863e74b03d3d55ed5d6ef40def86352e82b32a95224009d27a557f8c432665dc299aa6d44bdd7c SHA512 a7633c018385ef65b3ef897e5b55769c3abf4178e1307ac81e3f18ec5dc72837a22635388a436861c5527aacd391da45b87de62f4a6284ed30630f00cc4b615c +DIST rust-1.74.1-powerpc-unknown-linux-gnu.tar.xz 176968064 BLAKE2B 5cd80269770368ad29b772aa40a34350ff11d3d931df82975506ab52604f8b12d1982ab420f9375d9758c829d89f18713317ae6c0d8a8cb37da1fc941ed20046 SHA512 2443cf5d22bb9bb0f435b3370f9bea2e1322e3f929b0dcf99bb2515a63215015701645e50af67045201256ccdfe3b1f8d0f713475e03c79a3bc5f3001299d382 +DIST rust-1.74.1-powerpc-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 0dbf00765b035a629cf044e64b5c4819bc1c7eecf919dcfab6db764aeea972a93382308e1815756016c22eeac22a0db75d4f584b7704ec57de9b984c1e52a2a9 SHA512 d1eb882c2faea41255b3d7241a441402f45d3ea177bc8853ad0e7d07a15f00ef0a2dec7390126cf3d24ee6b875aa11a26557368ee0ebcae63c7312761b118c89 +DIST rust-1.74.1-powerpc64-unknown-linux-gnu.tar.xz 176582892 BLAKE2B 21582bfe0011448b43cb7fa88fca9e98cd4a555ae1d147f86f7b33c8f5eb065bf7ed83f0b8bd44bee04c8d58a3116660a2e0edd85fa9af7000c3778365390487 SHA512 d95a2803a5c386c8575c242684688c078557976998c48b13f619f710cd4c29b962a1d257878fe2a1de16cf7002d885fe99fe6787e8a12837355dcd10b3a070a9 +DIST rust-1.74.1-powerpc64-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 7d5a67e75e37d1d0ca47e31fa71128b906bf135056cf775bf04bc9667b1bd92fe1eabe7890fd1328aaee9ba5dd1ea2de06dcccae88a1c8a1aaa3b9c68bc94832 SHA512 72caa7f82862c85561b27079c3c1ed31372ec31f9692474a43a91fd6dd84e1172db0dcf215be95d27569139dffb7207c0dbc2f80a9c7e19dc6aa19d960a7c7d0 +DIST rust-1.74.1-powerpc64le-unknown-linux-gnu.tar.xz 187570092 BLAKE2B 5319e9c159452264f9b1a5982541e3cbed2c3b7279f6942424621f75d1c7cc3e67cb85df1ad0e8d34bb6009cdeb8796879570611ebdee4791b7b269c4735c8a3 SHA512 62f0c8667a2b93a043b87fd455464e476c8c05c4ec693e0d0159fc7b75a14b45fbbd6510f92d4d99dde90d59e0c430f200e8795405849db2caa09de53fabab04 +DIST rust-1.74.1-powerpc64le-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 24b84c25550c8920eea2cef557f9980e3a8e18895eb08ee97837e61738f27e1e3d20a4926ee3f614c16c720044a0576da12957c15c7e9a6fb7b0facca62f33a6 SHA512 4cf7398718303920dee59ab43d391c09b81d636b04d760b759890b0231680a5a97d99bcf838b9f26529e5ed1980a94f4c58b2984096d86cdd5bdcb9d48c7a134 +DIST rust-1.74.1-riscv64gc-unknown-linux-gnu.tar.xz 181803248 BLAKE2B cd007830f59175b7e63e13688caf53a12d48aa2df9871dd24f5e412068864440a084baa9e927ee2bb6a008d4c586f19f149db9a9eabd6cfdc1e7ac9ec3ba4316 SHA512 3c05427de5214fd542a45ddef906fa179d487deec68a860776279d90ca644e1182cd98fa639b13df11cc2db495007abafd004a681ff13927bf6a7490c4fe494b +DIST rust-1.74.1-riscv64gc-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B d19edec415037449fa52b80a804fb505767803a805943d0acf1a9216964d7ec7ca108b3b578621f10c23c37cf71decac0a1451c49525d2d7850d52f18e883b95 SHA512 b00a20e466125faec270ffdddd3f96f07133488aa1c9e2e706e0408f3d7ad350812b2b5831226c77657bc5a8d4fc55e5bd13085ea9e33fab88e32b469f9c2179 +DIST rust-1.74.1-s390x-unknown-linux-gnu.tar.xz 200997424 BLAKE2B 31ba7d46ffc5388b5ebd4be9b2c74873ebaf6a8301d5211823a0677492de4e2ed0562971e41a3825dcbfe4311588091ce062fe1432ed441eb736d64c73f5f0c5 SHA512 76bfe267e4b6b59b823f29be175e9c63102f2dc5df060b9b7b5bca2a883c57c113416c531c9fcbf3ceaea0b8955ef864f572e64604b4b816c8e3b3d8d68c7ac1 +DIST rust-1.74.1-s390x-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 6ea21dedc092abab913973752e6875f6b5a437ea4107d6245d2104c443c8af0f4af64d06211305968fc14ed15a628cee6a5b86701a1da42fcb2ea5afd166bfa9 SHA512 e155a6e7936f649eba413fbb07516e21216fdf9183f02eaef040002e2ccaaedbb399003b00dded7d7b54507182296a54455eeeee4b0ab48aae77e7939678a233 +DIST rust-1.74.1-x86_64-unknown-linux-gnu.tar.xz 155438320 BLAKE2B e33ac5c6f913e0eba2f92d46fbac255ef3a06a77324cffb1994b713a1b114f008514fd4ad6d9e7fa2ee860e168d90c574b80769f585a6f1f36e0c57313056e82 SHA512 08fdce8c9b35ab30e67d7ba932a105edf3a8cddb618dc2e7c5928d01afd086018732dcb87d66d1cab4b1468bd6e0a516459e39beb0514f2b78dd418ce530ecaf +DIST rust-1.74.1-x86_64-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 5bcfcc084bb7c4e3e95fbd55a8a0d6b64565f50a64e203862b8607eeb6d74cb5d0a6e16b9100a96286b937452b87b56554235a39da2739e7c71933560dcee74f SHA512 e39b200fcef34fc359deb9b0c104853fd33714ca8c417274ff6e2aa5ed76dc98500365455edc4defb4f55172e33912674c2c657eaa40b3d8451e75b7a23b38ba +DIST rust-1.74.1-x86_64-unknown-linux-musl.tar.xz 235698028 BLAKE2B e392e83b7ccade6cddff9c964162836552f90b8f3fd821348bfc0f72137f99e0c29a82b45c74893d22e0a42861c9413b29b97a85802737bfe363b1e694fd4e81 SHA512 8fb65ea5538c4a0865ac75561bb8df71d3703f1d4ed603f51752844f1bea02a9a52858587f3ee776a5ec27e793762a1b7c9cd845bceedd8a313d7ce2ad476ca1 +DIST rust-1.74.1-x86_64-unknown-linux-musl.tar.xz.asc 801 BLAKE2B d410ff0019f43eca1dcf374803905921978e13c3c85a3597792a860056ffdaaad3a9503a0780080fa6ea8044cd542a2fec74b253b3b7838cb72be2385430dbc7 SHA512 68cbaa9828003431341b8d4a0b8451689c5eaac2a97633738c3f0eb957fd985e792b87a3a0d107f05d5bc59be9a08d047854b107cf2d2a23f31cd722251bfc4b DIST rust-src-1.65.0.tar.xz 2488012 BLAKE2B d48f5591e72e14084f2fb0d66c1365f1648060d514af23c0498e02adfd7223b1a79bd1f512859b058f9cabc4b88b9230d15960df7c30762a5263d1785b877a68 SHA512 247f822a9c2f16d1de29d1cf6fa7ff393b7c7fe01da66a7c0b4add6259d72403922b8b1bd1b511ed8a9cc0b2c12ff574945aa7fc76c731fba620b466bcdc2eac DIST rust-src-1.66.1.tar.xz 2512096 BLAKE2B 514b8f9170d8a0e9b9deeeda27c5b83c18b7f038cb27a867fc4df1a0375b5c492793e67d0f0a2c26354ed1b58c699e1ff3e19f536dec10fc8b8211325dd4999a SHA512 3b77e29bf0803278d46aa5a484a2d74f242bf7f1ce6f5a6d1e84107630aa238620c91459f385f1b9f1bfb67c593ea5a274950a4db2975307cabc3a009b89f157 DIST rust-src-1.67.1.tar.xz 2522656 BLAKE2B 28f67cbac3d09af16f572c102890b49ffb4c610ebf379cf48ff4d0107afbb39587d2bcb7c5a4f811542f84dc3157557c762b006a6e89c54cd121d22bb677a770 SHA512 839266d2046b12954fd46f258a975a37c81cb61b6d2d9a5905fd6c83961d97c197f1b467c881d5078f3725293eb73ca402b002af3f47b6f7d431828f01d49a15 @@ -350,6 +378,7 @@ DIST rust-src-1.71.0.tar.xz 2460128 BLAKE2B 3ab6c6cb76a7e18eb0ba085c45f8b1a8bba1 DIST rust-src-1.71.1.tar.xz 2460244 BLAKE2B e3a5b5bfb808310f96e760aab55310c7a790fa551d248c9c5dbb407e0a80653563d8df73a9e0973aa63d3286aad6c755b78098dd8db2dc1a2ed3cadb926b40e1 SHA512 659cc46e1ece2ddbcf5ab748bae48843bd36353cc633b59e4ac062d843af66919e8d5c39ccb72ebdbf94a0e26a8056ade6bd1c8fe9a936469bd405122a8ae35d DIST rust-src-1.72.0.tar.xz 2498224 BLAKE2B ff48a20736bffd5a8978c06c3681bcba70cdf08676f2229c30e2040debb505012051880ec751117c37ef622ca1a76a93492831085ac2a191ccffa01b294d23e3 SHA512 bb821ba1b6d3a023de3beef7e9700142f08cd20f50ce33f6ada59547f9d4fe0aae587e7f38aea00493cb0dfcded512db567f5e90e9f7f08ebfc0bcd686d1cf5b DIST rust-src-1.73.0.tar.xz 2512888 BLAKE2B 367b68ec0775f49844408d602164634a0bd526dfe1e469b1c8ba9ae5604cbbff2566eb770b7bfb81b2dae892ed1ae16b7441e438726198610ce181c98540955e SHA512 49f493ffd119a0b8b9f7b7f7e049543787eaf96d9beb272d46f2758a35fd648f6523c2edb28864a33fc66337aa07e80a6464ec806307da441a899be4f71bb554 +DIST rust-src-1.74.1.tar.xz 2544036 BLAKE2B d95431b69f102782f51878ff73ce8802cac6dab7909497c3231d1c479b95dc2a618cc6efd8bac9c6bd59a2b10dc6be05199f1e1bd74e45cc640ee52352c29268 SHA512 11467d0936193c5a5be8c2eba1aefe2b7028af48494698863de2c4057d68ce33dcee1fc66dc2d68b1d32f0202ce49e9b906727849de8f8d904dd07930e76d5a4 EBUILD rust-bin-1.65.0-r1.ebuild 6796 BLAKE2B 851c478c1300bf6ff3c251a8a262abcd0703b1172ebd52c4de3aba0dff9b01d23f7b30e244babcf8768a7351372d3c2f91a104f6630b53a175d271419cab25fa SHA512 41f1bb4eefb4f3ebd9c3344e1ef2cdca048fe3cc5e59f00f3417fb120971d821facf9da88f265f9bef81aa7c0f1bdc53d5b6ff8b0c74e9c55b452fa782566ad5 EBUILD rust-bin-1.66.1-r1.ebuild 6800 BLAKE2B f1b06a3293823dacf64dca6dc72668c576732c44bd6f791adee48ac8854c0e6cb8bf579894245da2c9359527fb080575f298dab58ddfc9bcb2c3d753db009ffb SHA512 af338f7bba38935827914bbced0dcd3e6fd0c4e581be7420fc8b1a5c578da2a6644c5c18707af94ac4fa1dd1190abb3829e26dde7ed772a128176de2853e8449 EBUILD rust-bin-1.67.1-r3.ebuild 6872 BLAKE2B b698b4bd6c518e599ea5e87aa5967cfdb8f307d9f0551be14ba645806b1139d3e05d3f4fdfaa5121b672c71da4a8f209e380573019052d4d9acad428e6283619 SHA512 22fa03e8df6c7e7c5527d2f0e10b12d768176fc39e456c78195f3cedadbc4f37713593ad999a8c036f96bf15766aaf70946a6c29b39251266081b71206746d86 @@ -360,4 +389,5 @@ EBUILD rust-bin-1.71.0.ebuild 6953 BLAKE2B 29cedf55007a31f3678c4588f5a0fd0149c9d EBUILD rust-bin-1.71.1.ebuild 6946 BLAKE2B 4451a141a5857f1a479ab13283a0b03f722dae79a228ad56364fe957cf22f0d3db540f793f772bd10d89d02ee9014027aa51cae457c2ff0fc15f43372d198902 SHA512 eb710d1355f7985883061aa401d249b03c9011d9a0eca244907180e17f50fea33c9f73ee2bd5ba36259559cc9f84a11d7e24ed8ea76aec1a1a3a4b31fdc209b7 EBUILD rust-bin-1.72.0.ebuild 7551 BLAKE2B 9b1f8f898f2e81927c8e9fa1c4969cb0cc5120e2a040dee6797c434725a64c5a30e3153cebc138b3a296e3e19423a6e290d0a8732d817c08ee8c9eddc501af8e SHA512 d7549428f9d564eea9d0a181ef2ba67f7f76946c07c479b92f628e549703040a7a69103f9208158bd8f90be5f1c0c6070776c2d8642f4b1ddc669c108eef41c1 EBUILD rust-bin-1.73.0.ebuild 7296 BLAKE2B 8d2e2ee3a6b077039a9656b6bf7c0529ecd52e37ab48bc37f2ecf3f3c05155f9b1732a289cf4540f96dfab423cbb3ffdb6029a2bc1db10fa46506e8ecc80f4aa SHA512 1f192b60e131d2d2eaf7490b8076001dc02e30d4f27890c5776f42cdcdd7c5d070c378384a72ad53dd7f9982dc97401449b66b3f577eadceaf1f478486dd6bf9 +EBUILD rust-bin-1.74.1.ebuild 7290 BLAKE2B faa6e7199a9c5e3f63e694add8afdc603942e01fd93b560a6cf9e13366d42db087916723cdc344e7df325c3ba2ca720a8cc32aea532af1b1939f9d5345f94ac6 SHA512 bc7a7c02d7fad00efd99bc81126b19736c3fa21844e28c38a8664f8c7ff760d7e0b0309fcd671be83209ea6f6a6febc028a6040fedee8afaf83d29afaa3dfa31 MISC metadata.xml 681 BLAKE2B 8826971e27f0332dac4d64d72030253f2f1743a2d6ca5c1c7ccb53d6d7b76758cc2529230d03db03c3e415478c34deb084a66966e542ca63ee4e73a064c2a1ff SHA512 a4ddffc0f3cc79ed9f7f9f871a813d5b6ec454ba3e69c2f36605a7882c1c8b2422221e4e82bd7b16ea9e3529019f5d023e948e5338b69774aff8201180092d92 diff --git a/dev-lang/rust-bin/rust-bin-1.74.1.ebuild b/dev-lang/rust-bin/rust-bin-1.74.1.ebuild new file mode 100644 index 000000000000..ed632c90f477 --- /dev/null +++ b/dev-lang/rust-bin/rust-bin-1.74.1.ebuild @@ -0,0 +1,240 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit multilib prefix rust-toolchain toolchain-funcs verify-sig multilib-minimal + +MY_P="rust-${PV}" +# curl -L static.rust-lang.org/dist/channel-rust-${PV}.toml 2>/dev/null | grep "xz_url.*rust-src" +MY_SRC_URI="${RUST_TOOLCHAIN_BASEURL%/}/2023-12-07/rust-src-${PV}.tar.xz" +GENTOO_BIN_BASEURI="https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}" # omit leading slash + +DESCRIPTION="Systems programming language from Mozilla" +HOMEPAGE="https://www.rust-lang.org/" +SRC_URI="$(rust_all_arch_uris ${MY_P}) + rust-src? ( ${MY_SRC_URI} ) +" +# Keep this separate to allow easy commenting out if not yet built +#SRC_URI+=" sparc? ( ${GENTOO_BIN_BASEURI}/${MY_P}-sparc64-unknown-linux-gnu.tar.xz ) " +#SRC_URI+=" mips? ( +# abi_mips_o32? ( +# big-endian? ( ${GENTOO_BIN_BASEURI}/${MY_P}-mips-unknown-linux-gnu.tar.xz ) +# !big-endian? ( ${GENTOO_BIN_BASEURI}/${MY_P}-mipsel-unknown-linux-gnu.tar.xz ) +# ) +# abi_mips_n64? ( +# big-endian? ( ${GENTOO_BIN_BASEURI}/${MY_P}-mips64-unknown-linux-gnuabi64.tar.xz ) +# !big-endian? ( ${GENTOO_BIN_BASEURI}/${MY_P}-mips64el-unknown-linux-gnuabi64.tar.xz ) +# ) +#)" + +LICENSE="|| ( MIT Apache-2.0 ) BSD BSD-1 BSD-2 BSD-4" +SLOT="stable" +KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~s390 ~x86" +IUSE="big-endian clippy cpu_flags_x86_sse2 doc prefix rust-analyzer rust-src rustfmt" + +DEPEND="" + +RDEPEND=" + >=app-eselect/eselect-rust-20190311 + dev-libs/openssl + sys-apps/lsb-release + sys-devel/gcc:* +" + +BDEPEND=" + prefix? ( dev-util/patchelf ) + verify-sig? ( sec-keys/openpgp-keys-rust ) +" + +REQUIRED_USE="x86? ( cpu_flags_x86_sse2 )" + +# stripping rust may break it (at least on x86_64) +# https://github.com/rust-lang/rust/issues/112286 +RESTRICT="strip" + +QA_PREBUILT=" + opt/${P}/bin/.* + opt/${P}/lib/.*.so + opt/${P}/libexec/.* + opt/${P}/lib/rustlib/.*/bin/.* + opt/${P}/lib/rustlib/.*/lib/.* +" + +# An rmeta file is custom binary format that contains the metadata for the crate. +# rmeta files do not support linking, since they do not contain compiled object files. +# so we can safely silence the warning for this QA check. +QA_EXECSTACK="opt/${P}/lib/rustlib/*/lib*.rlib:lib.rmeta" + +VERIFY_SIG_OPENPGP_KEY_PATH="/usr/share/openpgp-keys/rust.asc" + +pkg_pretend() { + if [[ "$(tc-is-softfloat)" != "no" ]] && [[ ${CHOST} == armv7* ]]; then + die "${CHOST} is not supported by upstream Rust. You must use a hard float version." + fi +} + +src_unpack() { + # sadly rust-src tarball does not have corresponding .asc file + # so do partial verification + if use verify-sig; then + for f in ${A}; do + if [[ -f ${DISTDIR}/${f}.asc ]]; then + verify-sig_verify_detached "${DISTDIR}/${f}" "${DISTDIR}/${f}.asc" + fi + done + fi + + default_src_unpack + + mv "${WORKDIR}/${MY_P}-$(rust_abi)" "${S}" || die +} + +patchelf_for_bin() { + local filetype=$(file -b ${1}) + if [[ ${filetype} == *ELF*interpreter* ]]; then + einfo "${1}'s interpreter changed" + patchelf ${1} --set-interpreter ${2} || die + elif [[ ${filetype} == *script* ]]; then + hprefixify ${1} + fi +} + +multilib_src_install() { + if multilib_is_native_abi; then + + # start native abi install + pushd "${S}" >/dev/null || die + local analysis std + analysis="$(grep 'analysis' ./components)" + std="$(grep 'std' ./components)" + local components="rustc,cargo,${std}" + use doc && components="${components},rust-docs" + use clippy && components="${components},clippy-preview" + use rustfmt && components="${components},rustfmt-preview" + use rust-analyzer && components="${components},rust-analyzer-preview,${analysis}" + # Rust component 'rust-src' is extracted from separate archive + if use rust-src; then + einfo "Combining rust and rust-src installers" + mv -v "${WORKDIR}/rust-src-${PV}/rust-src" "${S}" || die + echo rust-src >> ./components || die + components="${components},rust-src" + fi + ./install.sh \ + --components="${components}" \ + --disable-verify \ + --prefix="${ED}/opt/${P}" \ + --mandir="${ED}/opt/${P}/man" \ + --disable-ldconfig \ + || die + + if use prefix; then + local interpreter=$(patchelf --print-interpreter ${EPREFIX}/bin/bash) + ebegin "Changing interpreter to ${interpreter} for Gentoo prefix at ${ED}/opt/${P}/bin" + find "${ED}/opt/${P}/bin" -type f -print0 | \ + while IFS= read -r -d '' filename; do + patchelf_for_bin ${filename} ${interpreter} \; || die + done + eend $? + fi + + local symlinks=( + cargo + rustc + rustdoc + rust-gdb + rust-gdbgui + rust-lldb + ) + + use clippy && symlinks+=( clippy-driver cargo-clippy ) + use rustfmt && symlinks+=( rustfmt cargo-fmt ) + use rust-analyzer && symlinks+=( rust-analyzer ) + + einfo "installing eselect-rust symlinks and paths" + local i + for i in "${symlinks[@]}"; do + # we need realpath on /usr/bin/* symlink return version-appended binary path. + # so /usr/bin/rustc should point to /opt/rust-bin-/bin/rustc- + local ver_i="${i}-bin-${PV}" + ln -v "${ED}/opt/${P}/bin/${i}" "${ED}/opt/${P}/bin/${ver_i}" || die + dosym "../../opt/${P}/bin/${ver_i}" "/usr/bin/${ver_i}" + done + + # symlinks to switch components to active rust in eselect + dosym "../../../opt/${P}/lib" "/usr/lib/rust/lib-bin-${PV}" + dosym "../../../opt/${P}/man" "/usr/lib/rust/man-bin-${PV}" + dosym "../../opt/${P}/lib/rustlib" "/usr/lib/rustlib-bin-${PV}" + dosym "../../../opt/${P}/share/doc/rust" "/usr/share/doc/${P}" + + # make all capital underscored variable + local CARGO_TRIPLET="$(rust_abi)" + CARGO_TRIPLET="${CARGO_TRIPLET//-/_}" + CARGO_TRIPLET="${CARGO_TRIPLET^^}" + cat <<-_EOF_ > "${T}/50${P}" + LDPATH="${EPREFIX}/usr/lib/rust/lib" + MANPATH="${EPREFIX}/usr/lib/rust/man" + $(usev elibc_musl "CARGO_TARGET_${CARGO_TRIPLET}_RUSTFLAGS=\"-C target-feature=-crt-static\"") + _EOF_ + doenvd "${T}/50${P}" + + # note: eselect-rust adds EROOT to all paths below + cat <<-_EOF_ > "${T}/provider-${P}" + /usr/bin/cargo + /usr/bin/rustdoc + /usr/bin/rust-gdb + /usr/bin/rust-gdbgui + /usr/bin/rust-lldb + /usr/lib/rustlib + /usr/lib/rust/lib + /usr/lib/rust/man + /usr/share/doc/rust + _EOF_ + + if use clippy; then + echo /usr/bin/clippy-driver >> "${T}/provider-${P}" + echo /usr/bin/cargo-clippy >> "${T}/provider-${P}" + fi + if use rustfmt; then + echo /usr/bin/rustfmt >> "${T}/provider-${P}" + echo /usr/bin/cargo-fmt >> "${T}/provider-${P}" + fi + if use rust-analyzer; then + echo /usr/bin/rust-analyzer >> "${T}/provider-${P}" + fi + + insinto /etc/env.d/rust + doins "${T}/provider-${P}" + popd >/dev/null || die + #end native abi install + + else + local rust_target + rust_target="$(rust_abi $(get_abi_CHOST ${v##*.}))" + dodir "/opt/${P}/lib/rustlib" + cp -vr "${WORKDIR}/rust-${PV}-${rust_target}/rust-std-${rust_target}/lib/rustlib/${rust_target}"\ + "${ED}/opt/${P}/lib/rustlib" || die + fi + + # BUG: installs x86_64 binary on other arches + rm -f "${ED}/opt/${P}/lib/rustlib/"*/bin/rust-llvm-dwp || die +} + +pkg_postinst() { + eselect rust update + + elog "Rust installs a helper script for calling GDB now," + elog "for your convenience it is installed under /usr/bin/rust-gdb-bin-${PV}." + + if has_version app-editors/emacs; then + elog "install app-emacs/rust-mode to get emacs support for rust." + fi + + if has_version app-editors/gvim || has_version app-editors/vim; then + elog "install app-vim/rust-vim to get vim support for rust." + fi +} + +pkg_postrm() { + eselect rust cleanup +} diff --git a/dev-lang/rust/Manifest b/dev-lang/rust/Manifest index ca02b0cc511d..4f83eda186c1 100644 --- a/dev-lang/rust/Manifest +++ b/dev-lang/rust/Manifest @@ -275,6 +275,34 @@ DIST rust-1.72.0-x86_64-unknown-linux-gnu.tar.xz 163402880 BLAKE2B 0f498510f8bba DIST rust-1.72.0-x86_64-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 51083330fef8b0e9f4fafe71e3a08891bec9be8e1c2e64ef37cba463e99c13f44639981c8aae6c86d50c6a23c4846a4f056535dbcbf39a2d9096615862feff87 SHA512 284b74f87e192451ba95cc423089d64334f43da8c221f45acb683a088e7dfd783c488c7ed3fe68619aff4c245271cdcf4b1b8c5f0bef1f8c3d3af0ca13d394c4 DIST rust-1.72.0-x86_64-unknown-linux-musl.tar.xz 234831716 BLAKE2B 3ee1a5727ad120bcf173dcee3770e342f107777984b06782f5ae588a58e5da94ad4550b00c168ddbe84350605100558bc01e139763b5734cdea32545ee6ee41e SHA512 62d5967669164ce7e8b6815298d79380ca96cce5a6c8a67db84cd3d5fdb6825ba9d2a91d59c2185a93b1c26030ef017c63942dc7a363e742d0abf356bca6f1f5 DIST rust-1.72.0-x86_64-unknown-linux-musl.tar.xz.asc 801 BLAKE2B e04731dd5edfe93d17cb032d772917d49bd46f195738cefe2e685f42b9ba5148d120e8d71c627cae46a665235f14ac0b35aff58498ff92da7edfdc5d6e562773 SHA512 2ed245aa779c594f8d9cbcbf63e7c68165d600408a25288163ceebf78946210a36958a3df80c50b2006e11930e09ecec0eee233ff659a9d2ffc78c1b55d3b0fc +DIST rust-1.73.0-aarch64-unknown-linux-gnu.tar.xz 216033148 BLAKE2B 78bac094c78d68102cd5ca6a7bc9ac8a51ecd3e14cc5c66fefca0a0597b5ba439c22d69a323a6e7cafdfec60cadf0672c91ca5f85065ac8d7913c83437ec0256 SHA512 58198ebecaa4652e0477eed6ad2c29524e7a3e991ed437775281ce526c8485b2a1a49c75ac6fd5bdcc6cb997cee4d1b4d82fba49c03ad38bcafa764f5a9bdfb1 +DIST rust-1.73.0-aarch64-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B d4b85efab3aef10fd6940630ed3cbf6cca12961228482ce42cdbd4c0c185c55b9ccecb1ca386e7a5c02fa33b77685dc8e2d619ecdec0cb5afc7a01402be5a22e SHA512 b7392e301c00e2ee1be692e6b5a44fdadc4b442979bf8f09fe71f80d82b6f395d0505621ba8eb54fe6145812f7f9c0d2b278e474d6edde51a2318cf27f5080bc +DIST rust-1.73.0-aarch64-unknown-linux-musl.tar.xz 197525740 BLAKE2B ed84c438426bb0fc9a5a320731ae448f242b70a764d67e46e53a37f0e76262a183886e83fb27166e030740a27e6a79ef1c8f50bfc4a2c9c5d915ee5fa74a251f SHA512 b1a3007217dbb771e459b92a2ce0efca3babb34e9901cd44006d7c8ca92f48f67bdb877d3ec4710c58ad1645da4830a52cc2062b6b5a9827b8d57d508f4029a6 +DIST rust-1.73.0-aarch64-unknown-linux-musl.tar.xz.asc 801 BLAKE2B 2e2a965b37bdeec12fbe3f605c4bd10bb51adc7dd1c2e2d185b7306e8c75415d678b1bd83eb68e8a05099eb77958a928e867f87b0a4f05b5315b89869f120a64 SHA512 b65b08a68571cd0cf17f4469c1eb95868e00e6244e30ac0d3c30e0ad6abcaed143a7389002c0f90b2ddbd79b9c9c3856d66387f701a8d0eb9f1683ce456e4910 +DIST rust-1.73.0-arm-unknown-linux-gnueabi.tar.xz 180327600 BLAKE2B f28725f19259806f934298d2b6dde6bf59e5f8bc3ee0ad9b1cf0565a5383a31189170f26495b3103bbc9d86d2ac9b83147b3803508a53b96eebd214d2b0aff90 SHA512 27900c5faa9076db40cc85d973274a09ff44a76936312f905a3d9751d0b7480dc260ed3cec91a65bb78382c67208b28978e2079e28a47a25aa6279d09adcc045 +DIST rust-1.73.0-arm-unknown-linux-gnueabi.tar.xz.asc 801 BLAKE2B 03ad365e06dbaf30d4ca2d8d2d3066d4f956ba5426f2c5b601c3830d9b0741b3655d26eafb3853b41ab01dc377065ca330f9d6fcf89de066c50adb0c9c9fe3bd SHA512 ecef5fe8359d8dbf23337398c1cb90a269ae169a1cd08525361d6f39e0a24dd22c1819c7ee0fe3828431ad492af89d19bf8c3c7b111f7925831362e2050d1040 +DIST rust-1.73.0-arm-unknown-linux-gnueabihf.tar.xz 180870680 BLAKE2B fea49832d8eefa7545b76114874de3d653ed888f753b68cd7636b7a1462bb564e19bbe37a5f3b94cf9a06640bf81f6fcc97f224f0f3e1745eb19f99ae193d3af SHA512 3648672256182cf6c73e31a05af3084b996bf25e1ccad8b96d68501e57a4ae4cf57befdf84db27e3e1a9fa3af051117e94ffcefd14246794e7528020bc26f4d5 +DIST rust-1.73.0-arm-unknown-linux-gnueabihf.tar.xz.asc 801 BLAKE2B 7046fad305aabf192a1084328d739754bf76c27fd3f1efcc4be36047ef6c4bf899ef8ae7e3cb359e23578af4c9a25d4e1f453ed8695ba33c630d46351234de69 SHA512 7e046b79d4d0a1bee3c7c5f6b8e3020a342a39e9913a24ef672aa1d197e63905653acc24652b720a4b996029661503e2dfc3b678f297ce15c548281ed772ac23 +DIST rust-1.73.0-armv7-unknown-linux-gnueabihf.tar.xz 184898496 BLAKE2B d0b2ce03ce7ab5e2c843989958a00524fc59000f62dc07f9783f4b9f22c734b67b33e403e3300fe3350322e1ad2b59e64e41b339d5f5c258b29dcdd98dec9c61 SHA512 ca48bb9b683058321b0ae770faf2fd607e03ff5e9291626ccbeba707f5ef8c211c29b9ddf52dfa11958691a127f95dedb742010018bbd6be2fc1d7ddced44190 +DIST rust-1.73.0-armv7-unknown-linux-gnueabihf.tar.xz.asc 801 BLAKE2B 12e19ff5f586a7f67bf7e4f6ee96d919293500bbfb3bec306b412a423a3dafe94fe63939f371a644e1d3a1575a6a21df78f11ee63a8dbae9af3a2ce6b03d5104 SHA512 9e1f316abb8f7861fe1188aba1880732b957514fe58de3f10e340c430c1ce64e9627feec1a655335d33605cc6f5ee32830159a8215c5a233f25ebff18e2c7bf7 +DIST rust-1.73.0-i686-unknown-linux-gnu.tar.xz 209918920 BLAKE2B 545c48dce0e275228e260669d0f5b93977a9c7a02237d4ae9d84ed69236f5e412c5980e2c5823478949214c2b775c89c836bbd43e25406c20fbdc52cee328240 SHA512 a80742d14acc1d018ac35b77abba4491b5eafe28bc3173527c865b0e930572f2a92d4fc459db51c34600f8288b20b5790346b5f8e6fbdfcb080f1f14f44a2db4 +DIST rust-1.73.0-i686-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 9800a96cf8484b0370f343c2fdda0762bab534fa7551a7716e7665bc90b651207c471ef5e06b2d7acb766959155b5d593b375487b01cf65e980ebc721c3a4042 SHA512 dc0c25c270701ff6509bbff3fd173178ec8aa3e5cf606fe87b803e6f1279dde3571d22cf0c7f28bb0ba5410c08a491f9b9b937d0aa796c0ba30fe43f7e381c1e +DIST rust-1.73.0-loongarch64-unknown-linux-gnu.tar.xz 161763960 BLAKE2B 1ae7019055a4fb457733826750d2c20708e7d8bfeb8532ac1af5027387bd1f992c2ab1fe08d088b07581b0a81d7ea7ac8e44ff077887297a4d4da2a633089de0 SHA512 9840e1454506e3f0880e8113040eecd1b363bb78371386aa069271e18e70600f81e19358539785a3bd1ada7244b4830362e6f0b466798cda7647ed795072342d +DIST rust-1.73.0-loongarch64-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B cacbbd7793d6f693cf2c1211529cb4a0c888f3ed4d8674f610e034a7216fcf7f4ecc85331aaeaa89ec02c1412a62fdbda29a3bca6faa64dee0f8d419d055b41d SHA512 64b8594f2f19151927f5b74584822a78b15da97fc8f5e4823dfc222056a203ed68ced70cca915e1694ea6b36fdef5697e5b56062cb761a0d9557e5c08ec8ea07 +DIST rust-1.73.0-powerpc-unknown-linux-gnu.tar.xz 176694620 BLAKE2B e8b43ea4b9ad78ece530985afdeb140e0e960213272857cedcfe4e9262c190c7d26ce77d46fd113d2742cb159442c256a081bb6cf23e6977fa5ca8c6cf21ec30 SHA512 03f889dad45d1bd9ee4af52209af3d763ad5362cf1a617c86b050e0d2fe00c39edc716fc32a83c6e45c118b97d828c32f682ffec5b32f215d6694509a885772f +DIST rust-1.73.0-powerpc-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B e63cf87a2fb0584f2fc5c01a98dbb12bd9a7f4aace54a08505a0b4f9e7141705409d8bff1cd3a2d7cf40504ea274f29e11624ba050d56e4ec2a4e794fdf188f1 SHA512 a86db43be2a2fd92638e6355ac4117e707073fbb98631a8b41064e5b01e12bc1d2c594547778d9c99ec3e24c5c4dce6603cbfcb3715b11aef9d2c2758ee8b7d6 +DIST rust-1.73.0-powerpc64-unknown-linux-gnu.tar.xz 176165132 BLAKE2B 3750ef413de00047fa957ecc6c832995e072b58b78f994bdd6b8291583acd0a4ab54634d4e4778456bce6420135c83e9961aef5e615fd62806531686e33a31d8 SHA512 9f1a669f7d532a831df76292916493e1bcd4a56d95d3819c477898eb0510bc8760d008fc1e7d383927f8afbeff826b0598f9bc4067f692f530856c8e444f44df +DIST rust-1.73.0-powerpc64-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B a1c1db86107b48a554d815811b518f7b28abac90cd08920362643a538670e7859ce43d179de24551b5e4409e0a421029e66b8374b27ddd699ca68fe0f47b8904 SHA512 04604baa0f13693d4bc7a0729df7041a55c0cb9efa11ef511d29d2b5a50c3575867c1ecbb6a23a030dc014876bc9c02e370c8d0eb531249833fbb52dd964f2b4 +DIST rust-1.73.0-powerpc64le-unknown-linux-gnu.tar.xz 187628140 BLAKE2B 1ab716a7d2e536ca3447fc0aa2751d774259ea2e39ee3cc150bfe11967e57bd85b484cf050a39cba717a0552dabe6d1aa79ca7dc24abe4b43d4802fb9cc1bc85 SHA512 d6566978f47067b84715ef39756721ced5f5430d5c92f51b673db39d1e1666a8dd933e998d4fe3ccbc36ec47c62b4fe7e335c4e3b830d27571dcf9e534446d0d +DIST rust-1.73.0-powerpc64le-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 6b3a29cf580d750a17436036d6bdb2457cafde123c289205aa239457afa4de10b4b97c9f3ccc23cd296a1a388802ac4f696c71e45a2ff7c97d15d63f2a04cba3 SHA512 5840b7986e9472a4907ae01eee0c4a40664ce1a29ff159557766bcf50da773d246a74ffed2bc5bc735d255514e0daba55d10bdbf7d8d2c3a6aeebd704f3009b3 +DIST rust-1.73.0-riscv64gc-unknown-linux-gnu.tar.xz 182202208 BLAKE2B 836d89e6ce276d100edce8016f5a466b99e8aff2646be7e58dea2f38678e4fdb9b93fff1126573a112e19cdb32ee5290fa58df0e5cbb1c309e65927ae1439b52 SHA512 c49031996ecde5dfda4b8bf3869b37ecb51c89e3fb8f69d3d43d865bf2ed6dfa928f0239460f0f3c7b7168eedee9b5a957d956f39ad42fc7276fe64a649ee501 +DIST rust-1.73.0-riscv64gc-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 119d6cf2b0b4f8950d51aac6eb865619412e513c6c87f31702572cb2120a20cb23133a763036cbac0a9977a20dccfb58a8b034d19d13892ffbde05c01970ec92 SHA512 578c2576f66d0ad344549a94cf83f80551dbec7ecf2ff8616d81cd1eb3a7154b89701a05caf6a21649361ccdd1abfd37b33de935e91dba02dd914945de3930b5 +DIST rust-1.73.0-s390x-unknown-linux-gnu.tar.xz 201224624 BLAKE2B 5f9f28c5f511a3bd119233e4a2b882119b18a42a8c235bafc57f35e365496fe9d6d88c6278e014345f76a98a235ecec31335178a6b047e5b2188d391ba465e70 SHA512 e946192961623be1e3ab4b3e2c86f16f9fd716ee3ccf88137e6ed7ca92b9e8376552a9b46b48c127f6be76a1fc7b240d9b8db568390fd7d81605634ebb431ea4 +DIST rust-1.73.0-s390x-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B d05fc43c55e47b3a32e8be8f97b072961e920ed09d368968d1121dfaa0dc36e11ca61a0b03df2f708d0eff31a80367b5d465434b851da4c8ff00ce9ecd577bce SHA512 5950cfd08f49bfd0f1277e2f07e333e7188d65d6a61d738dbe586bde8f3647862ef6d6ca5f52d74f357ae3997f1554a2c7cd0399392cde7ec32b1f2aaf8a4c6b +DIST rust-1.73.0-x86_64-unknown-linux-gnu.tar.xz 161588916 BLAKE2B 10c1c57641e2ae076c55826985d8ef43034a3e4b6fd15d109f949e8bc655dfb16d45ce86482992cc2aa3f4000f3432b8be17019f9f5d29a92fb42c37cd7df72e SHA512 b70886b5ecac41a7e6ea85d1b2d1aa557a0395d3f8abe4b8d1ad91f3b32ac9ae73bebfd7a9c48ebef4141be041cf5bdfab8bdb78e1b4969afb439daca203d5a3 +DIST rust-1.73.0-x86_64-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 22e68ec4e6bfa49c15344675abd20ef9449d928943dafc64bfa1cf78dd36ccbce4802af8d4adb84762194dabc512efa74655a93785c127e6942ebeca8f6e3303 SHA512 56e53a1047a23a7f37250a785de2422ee2a3a72fdedb9a02530b3cc1cd978370cbbfc0e67d75f3d537f48c6c78f91d3de949ac2c9392a79404609b169cedaa40 +DIST rust-1.73.0-x86_64-unknown-linux-musl.tar.xz 236190528 BLAKE2B 062b54b31742bc846bdff63fb38be3a3a1f6d2f061da26cee6a0b089feee995fe3dbea536675495ed75d47d657c3d4bf04e36f6752f59f8308f7eb9a397d6e38 SHA512 abd01e0c98a8aa447d01613e24302ca81a8cce7d41179ed60834a39ed1942de0459add3c498a63f94bb1ee8662a2750b375b49894e3108da45f47d3a643cfdba +DIST rust-1.73.0-x86_64-unknown-linux-musl.tar.xz.asc 801 BLAKE2B 9822879d0f14eb5387a623d111ed7a3b1ff038522c071608bd254c4b3479da8a1e9ed78c69c267c1156c45a9cbb2f7db00d123b85f28021a743d392d1cb65c75 SHA512 ff65fd3ca47afeb10f7434d8d4f91b6649739167639c3eadf178aa1339553c5316bd0bb393cd53fcce17c126dcf8db1f1dca6e87044b14762bb20ed8f5a500b7 DIST rustc-1.65.0-src.tar.xz 139674928 BLAKE2B a218263fb67e306b153f5a6dae95b5ec653acaa5eb4b833862d6f0fd4685a8cec097dadc1b8a934e1bf6055672c7a617f9a0ad4a7dbf2e78084297f10b7ada04 SHA512 3d0369ed3028209c4ecb9b9e7b5f5e3a20be8cc05199675df4f091d62a96c0734bc1dbd7630928fe162792392ec6d0daf9ceed10771531ce022200c7b631e3be DIST rustc-1.65.0-src.tar.xz.asc 801 BLAKE2B 43ff92011cd6f7f34ce0495fa341379e5907d032ea90f91e533e5edaec6ad518aad50a9d8b2694074d6909ee96aa779403b16e95792e962e79c1b967542ae26f SHA512 75b9be53363022c81333117876cbcc573bbd4733edf767cbb164218644efb1a9c4bfc2aa73aaa1e39f248a84f1adacb1930a94a6e63f60093ff760fb9ae02efc DIST rustc-1.66.1-src.tar.xz 141692940 BLAKE2B 3fae45345998386fda1b11ec896fac4613b8e3f0092bc0df29c9685f4a4012c0bd1b600911c2d19bcfa8f5a84b8a3c39d4c9e062a62cd61925b59129e1cd72b9 SHA512 1944c024c603140d0a9236043a3bd1d0d211dd8d368d6d82a3a620f1ff43b29624755b0943f2b38b40a188c7eee77a840238ea757eaf435e2a3fa6a0e6b82832 @@ -295,6 +323,8 @@ DIST rustc-1.72.0-src.tar.xz 151630408 BLAKE2B 7b26e5a9335f9262567b2a6aaf3b8ad6d DIST rustc-1.72.0-src.tar.xz.asc 801 BLAKE2B 7f0c94f9961edd6ad48372ef768ac69e39b6b7ef0514dc099510d7b53b336d12ac20092e52fbff0c524a6dcfd8c9c69542ae081aaa16ffc3a7ac8fe2ae70e8f8 SHA512 6c8776ddb5050ce29538d9845156cdf370b99d09051fa8c42c68a4d71ff0a6163abc029ac1355af55f1b9b371549e98ebb7e76535d76b77be548fdf917ed6195 DIST rustc-1.73.0-src.tar.xz 154319536 BLAKE2B 077bdedb36fdbc30db3c6331ac6014615eb79393ad42e38488d037ba38eaa6542467d39b2a14228d0bf6717110f915bf6fdcf0074c6293f413720cc748316eff SHA512 75c59680a82cb9d076b9434744a1c65908524ef769293952f5d9c5779d9a9c6fa4d9aa0c7e7d6b7566a21a50a27cd6ae452b5283a4d4606b2fa1acc24dfd8e0c DIST rustc-1.73.0-src.tar.xz.asc 801 BLAKE2B fac2f8652e9a103e8a678b30222e1a505671253827d1d092c4964230a535a85e21cedf00b70f108ac5cb2db961b50e482223e8eaa5b0d585777dd43d80c5931e SHA512 e80ef6280c50522a575f040610184fcf5f45444db2534c6a334e66a69f3338b43d8b34cf035685f28d0e8f006427bbe413611c49fe028c9f72810d74ccfab15e +DIST rustc-1.74.1-src.tar.xz 155968724 BLAKE2B e05f2379ac94b286f85791a138e1928e5b5b5a7749f0981d82c40c2a12860f55bf96bb2f0e924e35a0f8b2447b13052d38adea909aaa3199105787bb5a4861b3 SHA512 14c7e7ed2f38ab60299d8c7d41d78f042b6b57ef822d577b5138e60bdde31cf141eccd4332a25bc5da3d58eb5313d63c1448b5dfe9e11b8055bb8ea133a9038d +DIST rustc-1.74.1-src.tar.xz.asc 801 BLAKE2B ddf73175b164233babf31ca3a381b03e20c0f36d017c1d5f85d6ab11f0986d861ab23b11c061e6b2444ced70c3d6a494cc3de4ec86f0deb221a805491bd75420 SHA512 9a96ff9ba9a4e2af4e267b2ec126fc0675c78d0eb767703daa2f28491c3d85c2ab00fbd8584390bf658812ec6c4ab6c57e43b386db59fd505bd3134a8873a09e EBUILD rust-1.65.0.ebuild 23820 BLAKE2B 4c78cdc4c9ca7a851c6a6456577bb76d4c2be5906f87fc3cb10a843817ccbee7bfe1b35d9208bbdedcf101aa9e3839567e0248a24e3c3d8b7c7d8c7336d12af7 SHA512 460af912c28ae035d148703f6a64a5724295a446ed494a04722c91c4867e973c8e1003f580dabb0f79f7bf3fa395fb8b0c2c22588c31da86b8e835ad8b83b169 EBUILD rust-1.66.1.ebuild 23715 BLAKE2B 7aa99dabcad11dcc2ce9a31a1e519c26c861d0e8e983f2c97e95ee4e1add8ae56cf5d324ed2409a524b66fcb1f91912b6dd881710a9cf0a4083aa6851ba3731c SHA512 352b20e9d558502545f6cc3a54095456d2011e08ad71454e8309c7e25eca0a6d6a67a2b28ce32a76943c3768a37d2690d0d41b80cd5a6a1e263cf3f99624a332 EBUILD rust-1.67.1-r1.ebuild 23182 BLAKE2B ac281280b68659795d76d224a628047684c66b4a60764f138ea61e1432e5d498edea933f1f2ce44effd8c469577d0441be5c832df54239299106b4509d679d09 SHA512 4a12840073a9081b1452481ea57ef97426901bf992697a69baaff3efa30587f5c627d34c120730037c9e5908db49ea183087f810df3e2fd1451a18e8540a68de @@ -305,4 +335,5 @@ EBUILD rust-1.71.0.ebuild 23414 BLAKE2B fc5507d020c65ba41017247142569db1cb9b33f9 EBUILD rust-1.71.1.ebuild 23428 BLAKE2B 0cac851a977717641b0eb3727ba70803b43211f2bdaf3c576315f1a36fbf87ed7e49a4c190f0a82895fd3f26b4e232a185ae4fc1e728a5999e4bd2070aad5499 SHA512 5a2712ec31f9c4fc1fe48983b2c18b5550ae3dc6f3f73ac6097701e1ab337f6d3cac82b4739601bcca088a04acce9b51e0caf0b51bc49194ace565c033dfbc75 EBUILD rust-1.72.0-r1.ebuild 23903 BLAKE2B 16a2866f924378bef29b7d1a0b12deead65e636fb9fb61ad42f8a685d524481d3c213507acfc4f3fa13a570a72c1184ba45a7baf13d01b63c2444f880cac7d15 SHA512 bde5b5b372371df5f6688e7902d05da90761fd17903843353b9233abb5792305179379d13a94f57517c45a8887223a655d5cd672738f8ca5190145bbc0e449dc EBUILD rust-1.73.0.ebuild 23810 BLAKE2B 27b14a0a081d2b344980340f0019a810e58fbddfd288e5303529387b1d8926c2ba3413ef54ba088ad688aabbff1301dce2a460913e35890002f47a744554b347 SHA512 7ae536e50cdef14425422cb3b09ee4846baa8f60c8504b7fb7106eb2aeaeaa3005b998e5de628e69a59936517c04d7b87e5b842fe2126db9d199b46781790c15 +EBUILD rust-1.74.1.ebuild 23870 BLAKE2B d3ad2577fcf2a3620bd6cc2370f1609b8cf93244538ae6b1a3c9e332f13a40d3af5ed481d0b0c53cfb7f7f7df2138db94eeb6ac7643a14f7a3d8afccc83d5a6b SHA512 a7a2d1e2d69ee7254f7344aee6e451cf5ce4a896d479c66abfb8d1fd0f5c370b2ea5a506b8a6a505b0615913d000d74368f4d18de1fd6f45633c0ca2b1b75ce7 MISC metadata.xml 1756 BLAKE2B fab29aa03373b0c47de798165a4cac03501da57e38b686917794a961c7e0491b87c7eabe2613883f7c05b6a5ea2ab225f409599e281b57c26ca8a2a22bbfa795 SHA512 a73f76a803fa7be46e30e87c939fab1ac5514daf15f5ef2800045bd30403a2fb2c69fd776becbc2bce61c67544228f7ddd4b87455982ad38dfb368c620bfb317 diff --git a/dev-lang/rust/rust-1.74.1.ebuild b/dev-lang/rust/rust-1.74.1.ebuild new file mode 100644 index 000000000000..0851f219f122 --- /dev/null +++ b/dev-lang/rust/rust-1.74.1.ebuild @@ -0,0 +1,760 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{9..12} ) + +inherit bash-completion-r1 check-reqs estack flag-o-matic llvm multiprocessing \ + multilib multilib-build python-any-r1 rust-toolchain toolchain-funcs verify-sig + +if [[ ${PV} = *beta* ]]; then + betaver=${PV//*beta} + BETA_SNAPSHOT="${betaver:0:4}-${betaver:4:2}-${betaver:6:2}" + MY_P="rustc-beta" + SLOT="beta/${PV}" + SRC="${BETA_SNAPSHOT}/rustc-beta-src.tar.xz -> rustc-${PV}-src.tar.xz" +else + ABI_VER="$(ver_cut 1-2)" + SLOT="stable/${ABI_VER}" + MY_P="rustc-${PV}" + SRC="${MY_P}-src.tar.xz" + KEYWORDS="~amd64 ~arm ~arm64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86" +fi + +RUST_STAGE0_VERSION="1.$(($(ver_cut 2) - 1)).0" + +DESCRIPTION="Systems programming language from Mozilla" +HOMEPAGE="https://www.rust-lang.org/" + +SRC_URI=" + https://static.rust-lang.org/dist/${SRC} + verify-sig? ( https://static.rust-lang.org/dist/${SRC}.asc ) + !system-bootstrap? ( $(rust_all_arch_uris rust-${RUST_STAGE0_VERSION}) ) +" + +# keep in sync with llvm ebuild of the same version as bundled one. +ALL_LLVM_TARGETS=( AArch64 AMDGPU ARC ARM AVR BPF CSKY DirectX Hexagon Lanai + LoongArch M68k Mips MSP430 NVPTX PowerPC RISCV Sparc SPIRV SystemZ VE + WebAssembly X86 XCore Xtensa ) +ALL_LLVM_TARGETS=( "${ALL_LLVM_TARGETS[@]/#/llvm_targets_}" ) +LLVM_TARGET_USEDEPS=${ALL_LLVM_TARGETS[@]/%/(-)?} + +LICENSE="|| ( MIT Apache-2.0 ) BSD BSD-1 BSD-2 BSD-4" + +IUSE="big-endian clippy cpu_flags_x86_sse2 debug dist doc llvm-libunwind +lto miri nightly parallel-compiler profiler rustfmt rust-analyzer rust-src system-bootstrap system-llvm test wasm ${ALL_LLVM_TARGETS[*]}" + +# Please keep the LLVM dependency block separate. Since LLVM is slotted, +# we need to *really* make sure we're not pulling more than one slot +# simultaneously. + +# How to use it: +# List all the working slots in LLVM_VALID_SLOTS, newest first. +LLVM_VALID_SLOTS=( 17 ) +LLVM_MAX_SLOT="${LLVM_VALID_SLOTS[0]}" + +# splitting usedeps needed to avoid CI/pkgcheck's UncheckableDep limitation +# (-) usedep needed because we may build with older llvm without that target +LLVM_DEPEND="|| ( " +for _s in ${LLVM_VALID_SLOTS[@]}; do + LLVM_DEPEND+=" ( " + for _x in ${ALL_LLVM_TARGETS[@]}; do + LLVM_DEPEND+=" + ${_x}? ( sys-devel/llvm:${_s}[${_x}(-)] ) + wasm? ( sys-devel/lld:${_s} )" + done + LLVM_DEPEND+=" )" +done +unset _s _x +LLVM_DEPEND+=" ) + /dev/null) ) + rustc_version=${rustc_version[0]#rust-bin-} + rustc_version=${rustc_version#rust-} + + [[ -z "${rustc_version}" ]] && die "Failed to determine rust version, check 'eselect rust' output" + + if ver_test "${rustc_version}" -lt "${rustc_wanted}" ; then + eerror "Rust >=${rustc_wanted} is required" + eerror "please run 'eselect rust' and set correct rust version" + die "selected rust version is too old" + elif ver_test "${rustc_version}" -ge "${rustc_toonew}" ; then + eerror "Rust <${rustc_toonew} is required" + eerror "please run 'eselect rust' and set correct rust version" + die "selected rust version is too new" + else + einfo "Using rust ${rustc_version} to build" + fi +} + +pre_build_checks() { + local M=8192 + # multiply requirements by 1.3 if we are doing x86-multilib + if use amd64; then + M=$(( $(usex abi_x86_32 13 10) * ${M} / 10 )) + fi + M=$(( $(usex clippy 128 0) + ${M} )) + M=$(( $(usex miri 128 0) + ${M} )) + M=$(( $(usex rustfmt 256 0) + ${M} )) + # add 2G if we compile llvm and 256M per llvm_target + if ! use system-llvm; then + M=$(( 2048 + ${M} )) + local ltarget + for ltarget in ${ALL_LLVM_TARGETS[@]}; do + M=$(( $(usex ${ltarget} 256 0) + ${M} )) + done + fi + M=$(( $(usex wasm 256 0) + ${M} )) + M=$(( $(usex debug 2 1) * ${M} )) + eshopts_push -s extglob + if is-flagq '-g?(gdb)?([1-9])'; then + M=$(( 15 * ${M} / 10 )) + fi + eshopts_pop + M=$(( $(usex system-bootstrap 0 1024) + ${M} )) + M=$(( $(usex doc 256 0) + ${M} )) + CHECKREQS_DISK_BUILD=${M}M check-reqs_pkg_${EBUILD_PHASE} +} + +llvm_check_deps() { + has_version -r "sys-devel/llvm:${LLVM_SLOT}[${LLVM_TARGET_USEDEPS// /,}]" +} + +# Is LLVM being linked against libc++? +is_libcxx_linked() { + local code='#include +#if defined(_LIBCPP_VERSION) + HAVE_LIBCXX +#endif +' + local out=$($(tc-getCXX) ${CXXFLAGS} ${CPPFLAGS} -x c++ -E -P - <<<"${code}") || return 1 + [[ ${out} == *HAVE_LIBCXX* ]] +} + +pkg_pretend() { + pre_build_checks +} + +pkg_setup() { + pre_build_checks + python-any-r1_pkg_setup + + export LIBGIT2_NO_PKG_CONFIG=1 #749381 + + use system-bootstrap && bootstrap_rust_version_check + + if use system-llvm; then + llvm_pkg_setup + + local llvm_config="$(get_llvm_prefix "${LLVM_MAX_SLOT}")/bin/llvm-config" + export LLVM_LINK_SHARED=1 + export RUSTFLAGS="${RUSTFLAGS} -Lnative=$("${llvm_config}" --libdir)" + fi +} + +esetup_unwind_hack() { + # https://bugs.gentoo.org/870280 + # this is a hack needed to bootstrap with libgcc_s linked tarball on llvm-libunwind system. + # it should trigger for internal bootstrap or system-bootstrap with rust-bin. + # the whole idea is for stage0 to bootstrap with fake libgcc_s. + # final stage will receive -L${T}/lib but not -lgcc_s args, producing clean compiler. + local fakelib="${T}/fakelib" + mkdir -p "${fakelib}" || die + # we need both symlinks, one for cargo runtime, other for linker. + ln -s "${ESYSROOT}/usr/lib/libunwind.so" "${fakelib}/libgcc_s.so.1" || die + ln -s "${ESYSROOT}/usr/lib/libunwind.so" "${fakelib}/libgcc_s.so" || die + export LD_LIBRARY_PATH="${fakelib}" + export RUSTFLAGS+=" -L${fakelib}" + # this is a literally magic variable that gets through cargo cache, without it some + # crates ignore RUSTFLAGS. + # this variable can not contain leading space. + export MAGIC_EXTRA_RUSTFLAGS+="${MAGIC_EXTRA_RUSTFLAGS:+ }-L${fakelib}" +} + +src_prepare() { + # Clear vendor checksums for crates that we patched to bump libc. + # NOTE: refresh this on each bump. + #for i in addr2line-0.20.0 bstr cranelift-jit crossbeam-channel elasticlunr-rs handlebars icu_locid libffi \ + # terminal_size tracing-tree; do + # clear_vendor_checksums "${i}" + #done + + if ! use system-bootstrap; then + has_version sys-devel/gcc || esetup_unwind_hack + local rust_stage0_root="${WORKDIR}"/rust-stage0 + local rust_stage0="rust-${RUST_STAGE0_VERSION}-$(rust_abi)" + + "${WORKDIR}/${rust_stage0}"/install.sh --disable-ldconfig \ + --without=rust-docs-json-preview,rust-docs --destdir="${rust_stage0_root}" --prefix=/ || die + fi + + default +} + +src_configure() { + filter-lto # https://bugs.gentoo.org/862109 https://bugs.gentoo.org/866231 + + local rust_target="" rust_targets="" arch_cflags + + # Collect rust target names to compile standard libs for all ABIs. + for v in $(multilib_get_enabled_abi_pairs); do + rust_targets+=",\"$(rust_abi $(get_abi_CHOST ${v##*.}))\"" + done + if use wasm; then + rust_targets+=",\"wasm32-unknown-unknown\"" + if use system-llvm; then + # un-hardcode rust-lld linker for this target + # https://bugs.gentoo.org/715348 + sed -i '/linker:/ s/rust-lld/wasm-ld/' compiler/rustc_target/src/spec/wasm_base.rs || die + fi + fi + rust_targets="${rust_targets#,}" + + # cargo and rustdoc are mandatory and should always be included + local tools='"cargo","rustdoc"' + use clippy && tools+=',"clippy"' + use miri && tools+=',"miri"' + use profiler && tools+=',"rust-demangler"' + use rustfmt && tools+=',"rustfmt"' + use rust-analyzer && tools+=',"rust-analyzer"' + use rust-src && tools+=',"src"' + + local rust_stage0_root + if use system-bootstrap; then + local printsysroot + printsysroot="$(rustc --print sysroot || die "Can't determine rust's sysroot")" + rust_stage0_root="${printsysroot}" + else + rust_stage0_root="${WORKDIR}"/rust-stage0 + fi + # in case of prefix it will be already prefixed, as --print sysroot returns full path + [[ -d ${rust_stage0_root} ]] || die "${rust_stage0_root} is not a directory" + + rust_target="$(rust_abi)" + + local cm_btype="$(usex debug DEBUG RELEASE)" + cat <<- _EOF_ > "${S}"/config.toml + changelog-seen = 2 + [llvm] + download-ci-llvm = false + optimize = $(toml_usex !debug) + release-debuginfo = $(toml_usex debug) + assertions = $(toml_usex debug) + ninja = true + targets = "${LLVM_TARGETS// /;}" + experimental-targets = "" + link-shared = $(toml_usex system-llvm) + $(if is_libcxx_linked; then + # https://bugs.gentoo.org/732632 + echo "use-libcxx = true" + echo "static-libstdcpp = false" + fi) + $(case "${rust_target}" in + i586-*-linux-*) + # https://github.com/rust-lang/rust/issues/93059 + echo 'cflags = "-fcf-protection=none"' + echo 'cxxflags = "-fcf-protection=none"' + echo 'ldflags = "-fcf-protection=none"' + ;; + *) + ;; + esac) + enable-warnings = false + [llvm.build-config] + CMAKE_VERBOSE_MAKEFILE = "ON" + CMAKE_C_FLAGS_${cm_btype} = "${CFLAGS}" + CMAKE_CXX_FLAGS_${cm_btype} = "${CXXFLAGS}" + CMAKE_EXE_LINKER_FLAGS_${cm_btype} = "${LDFLAGS}" + CMAKE_MODULE_LINKER_FLAGS_${cm_btype} = "${LDFLAGS}" + CMAKE_SHARED_LINKER_FLAGS_${cm_btype} = "${LDFLAGS}" + CMAKE_STATIC_LINKER_FLAGS_${cm_btype} = "${ARFLAGS}" + [build] + build-stage = 2 + test-stage = 2 + build = "${rust_target}" + host = ["${rust_target}"] + target = [${rust_targets}] + cargo = "${rust_stage0_root}/bin/cargo" + rustc = "${rust_stage0_root}/bin/rustc" + rustfmt = "${rust_stage0_root}/bin/rustfmt" + docs = $(toml_usex doc) + compiler-docs = false + submodules = false + python = "${EPYTHON}" + locked-deps = true + vendor = true + extended = true + tools = [${tools}] + verbose = 2 + sanitizers = false + profiler = $(toml_usex profiler) + cargo-native-static = false + [install] + prefix = "${EPREFIX}/usr/lib/${PN}/${PV}" + sysconfdir = "etc" + docdir = "share/doc/rust" + bindir = "bin" + libdir = "lib" + mandir = "share/man" + [rust] + # https://github.com/rust-lang/rust/issues/54872 + codegen-units-std = 1 + optimize = true + debug = $(toml_usex debug) + debug-assertions = $(toml_usex debug) + debug-assertions-std = $(toml_usex debug) + debuginfo-level = $(usex debug 2 0) + debuginfo-level-rustc = $(usex debug 2 0) + debuginfo-level-std = $(usex debug 2 0) + debuginfo-level-tools = $(usex debug 2 0) + debuginfo-level-tests = 0 + backtrace = true + incremental = false + default-linker = "$(tc-getCC)" + parallel-compiler = $(toml_usex parallel-compiler) + channel = "$(usex nightly nightly stable)" + description = "gentoo" + rpath = false + verbose-tests = true + optimize-tests = $(toml_usex !debug) + codegen-tests = true + dist-src = false + remap-debuginfo = true + lld = $(usex system-llvm false $(toml_usex wasm)) + # only deny warnings if doc+wasm are NOT requested, documenting stage0 wasm std fails without it + # https://github.com/rust-lang/rust/issues/74976 + # https://github.com/rust-lang/rust/issues/76526 + deny-warnings = $(usex wasm $(usex doc false true) true) + backtrace-on-ice = true + jemalloc = false + lto = "$(usex lto fat off)" + [dist] + src-tarball = false + compression-formats = ["xz"] + compression-profile = "balanced" + _EOF_ + + for v in $(multilib_get_enabled_abi_pairs); do + rust_target=$(rust_abi $(get_abi_CHOST ${v##*.})) + arch_cflags="$(get_abi_CFLAGS ${v##*.})" + + export CFLAGS_${rust_target//-/_}="${arch_cflags}" + + cat <<- _EOF_ >> "${S}"/config.toml + [target.${rust_target}] + ar = "$(tc-getAR)" + cc = "$(tc-getCC)" + cxx = "$(tc-getCXX)" + linker = "$(tc-getCC)" + ranlib = "$(tc-getRANLIB)" + llvm-libunwind = "$(usex llvm-libunwind $(usex system-llvm system in-tree) no)" + _EOF_ + if use system-llvm; then + cat <<- _EOF_ >> "${S}"/config.toml + llvm-config = "$(get_llvm_prefix "${LLVM_MAX_SLOT}")/bin/llvm-config" + _EOF_ + fi + # by default librustc_target/spec/linux_musl_base.rs sets base.crt_static_default = true; + # but we patch it and set to false here as well + if use elibc_musl; then + cat <<- _EOF_ >> "${S}"/config.toml + crt-static = false + _EOF_ + fi + done + if use wasm; then + cat <<- _EOF_ >> "${S}"/config.toml + [target.wasm32-unknown-unknown] + linker = "$(usex system-llvm lld rust-lld)" + # wasm target does not have profiler_builtins https://bugs.gentoo.org/848483 + profiler = false + _EOF_ + fi + + if [[ -n ${I_KNOW_WHAT_I_AM_DOING_CROSS} ]]; then # whitespace intentionally shifted below + # experimental cross support + # discussion: https://bugs.gentoo.org/679878 + # TODO: c*flags, clang, system-llvm, cargo.eclass target support + # it would be much better if we could split out stdlib + # complilation to separate ebuild and abuse CATEGORY to + # just install to /usr/lib/rustlib/ + + # extra targets defined as a bash array + # spec format: :: + # best place would be /etc/portage/env/dev-lang/rust + # Example: + # RUST_CROSS_TARGETS=( + # "AArch64:aarch64-unknown-linux-gnu:aarch64-unknown-linux-gnu" + # ) + # no extra hand holding is done, no target transformations, all + # values are passed as-is with just basic checks, so it's up to user to supply correct values + # valid rust targets can be obtained with + # rustc --print target-list + # matching cross toolchain has to be installed + # matching LLVM_TARGET has to be enabled for both rust and llvm (if using system one) + # only gcc toolchains installed with crossdev are checked for now. + + # BUG: we can't pass host flags to cross compiler, so just filter for now + # BUG: this should be more fine-grained. + filter-flags '-mcpu=*' '-march=*' '-mtune=*' + + local cross_target_spec + for cross_target_spec in "${RUST_CROSS_TARGETS[@]}";do + # extracts first element form :: + local cross_llvm_target="${cross_target_spec%%:*}" + # extracts toolchain triples, : + local cross_triples="${cross_target_spec#*:}" + # extracts first element after before : separator + local cross_rust_target="${cross_triples%%:*}" + # extracts last element after : separator + local cross_toolchain="${cross_triples##*:}" + use llvm_targets_${cross_llvm_target} || die "need llvm_targets_${cross_llvm_target} target enabled" + command -v ${cross_toolchain}-gcc > /dev/null 2>&1 || die "need ${cross_toolchain} cross toolchain" + + cat <<- _EOF_ >> "${S}"/config.toml + [target.${cross_rust_target}] + ar = "${cross_toolchain}-ar" + cc = "${cross_toolchain}-gcc" + cxx = "${cross_toolchain}-g++" + linker = "${cross_toolchain}-gcc" + ranlib = "${cross_toolchain}-ranlib" + _EOF_ + if use system-llvm; then + cat <<- _EOF_ >> "${S}"/config.toml + llvm-config = "$(get_llvm_prefix "${LLVM_MAX_SLOT}")/bin/llvm-config" + _EOF_ + fi + if [[ "${cross_toolchain}" == *-musl* ]]; then + cat <<- _EOF_ >> "${S}"/config.toml + musl-root = "$(${cross_toolchain}-gcc -print-sysroot)/usr" + _EOF_ + fi + + # append cross target to "normal" target list + # example 'target = ["powerpc64le-unknown-linux-gnu"]' + # becomes 'target = ["powerpc64le-unknown-linux-gnu","aarch64-unknown-linux-gnu"]' + + rust_targets="${rust_targets},\"${cross_rust_target}\"" + sed -i "/^target = \[/ s#\[.*\]#\[${rust_targets}\]#" config.toml || die + + ewarn + ewarn "Enabled ${cross_rust_target} rust target" + ewarn "Using ${cross_toolchain} cross toolchain" + ewarn + if ! has_version -b 'sys-devel/binutils[multitarget]' ; then + ewarn "'sys-devel/binutils[multitarget]' is not installed" + ewarn "'strip' will be unable to strip cross libraries" + ewarn "cross targets will be installed with full debug information" + ewarn "enable 'multitarget' USE flag for binutils to be able to strip object files" + ewarn + ewarn "Alternatively llvm-strip can be used, it supports stripping any target" + ewarn "define STRIP=\"llvm-strip\" to use it (experimental)" + ewarn + fi + done + fi # I_KNOW_WHAT_I_AM_DOING_CROSS + + einfo "Rust configured with the following flags:" + echo + echo RUSTFLAGS="\"${RUSTFLAGS}\"" + echo RUSTFLAGS_BOOTSTRAP="\"${RUSTFLAGS_BOOTSTRAP}\"" + echo RUSTFLAGS_NOT_BOOTSTRAP="\"${RUSTFLAGS_NOT_BOOTSTRAP}\"" + echo MAGIC_EXTRA_RUSTFLAGS="\"${MAGIC_EXTRA_RUSTFLAGS}\"" + env | grep "CARGO_TARGET_.*_RUSTFLAGS=" + env | grep "CFLAGS_.*" + echo + einfo "config.toml contents:" + cat "${S}"/config.toml || die + echo +} + +src_compile() { + RUST_BACKTRACE=1 "${EPYTHON}" ./x.py build -vvv --config="${S}"/config.toml -j$(makeopts_jobs) || die +} + +src_test() { + # https://rustc-dev-guide.rust-lang.org/tests/intro.html + + # those are basic and codegen tests. + local tests=( + codegen + codegen-units + compile-fail + incremental + mir-opt + pretty + run-make + ) + + # fails if llvm is not built with ALL targets. + # and known to fail with system llvm sometimes. + use system-llvm || tests+=( assembly ) + + # fragile/expensive/less important tests + # or tests that require extra builds + # TODO: instead of skipping, just make some nonfatal. + if [[ ${ERUST_RUN_EXTRA_TESTS:-no} != no ]]; then + tests+=( + rustdoc + rustdoc-js + rustdoc-js-std + rustdoc-ui + run-make-fulldeps + ui + ui-fulldeps + ) + fi + + local i failed=() + einfo "rust_src_test: enabled tests ${tests[@]/#/src/test/}" + for i in "${tests[@]}"; do + local t="src/test/${i}" + einfo "rust_src_test: running ${t}" + if ! RUST_BACKTRACE=1 "${EPYTHON}" ./x.py test -vv --config="${S}"/config.toml \ + -j$(makeopts_jobs) --no-doc --no-fail-fast "${t}" + then + failed+=( "${t}" ) + eerror "rust_src_test: ${t} failed" + fi + done + + if [[ ${#failed[@]} -ne 0 ]]; then + eerror "rust_src_test: failure summary: ${failed[@]}" + die "aborting due to test failures" + fi +} + +src_install() { + DESTDIR="${D}" "${EPYTHON}" ./x.py install -vv --config="${S}"/config.toml -j$(makeopts_jobs) || die + + # bug #689562, #689160 + rm -v "${ED}/usr/lib/${PN}/${PV}/etc/bash_completion.d/cargo" || die + rmdir -v "${ED}/usr/lib/${PN}/${PV}"/etc{/bash_completion.d,} || die + newbashcomp src/tools/cargo/src/etc/cargo.bashcomp.sh cargo + + local symlinks=( + cargo + rustc + rustdoc + rust-gdb + rust-gdbgui + rust-lldb + ) + + use clippy && symlinks+=( clippy-driver cargo-clippy ) + use miri && symlinks+=( miri cargo-miri ) + use profiler && symlinks+=( rust-demangler ) + use rustfmt && symlinks+=( rustfmt cargo-fmt ) + use rust-analyzer && symlinks+=( rust-analyzer ) + + einfo "installing eselect-rust symlinks and paths: ${symlinks[@]}" + local i + for i in "${symlinks[@]}"; do + # we need realpath on /usr/bin/* symlink return version-appended binary path. + # so /usr/bin/rustc should point to /usr/lib/rust//bin/rustc- + # need to fix eselect-rust to remove this hack. + local ver_i="${i}-${PV}" + if [[ -f "${ED}/usr/lib/${PN}/${PV}/bin/${i}" ]]; then + einfo "Installing ${i} symlink" + ln -v "${ED}/usr/lib/${PN}/${PV}/bin/${i}" "${ED}/usr/lib/${PN}/${PV}/bin/${ver_i}" || die + else + ewarn "${i} symlink requested, but source file not found" + ewarn "please report this" + fi + dosym "../lib/${PN}/${PV}/bin/${ver_i}" "/usr/bin/${ver_i}" + done + + # symlinks to switch components to active rust in eselect + dosym "${PV}/lib" "/usr/lib/${PN}/lib-${PV}" + dosym "${PV}/libexec" "/usr/lib/${PN}/libexec-${PV}" + dosym "${PV}/share/man" "/usr/lib/${PN}/man-${PV}" + dosym "rust/${PV}/lib/rustlib" "/usr/lib/rustlib-${PV}" + dosym "../../lib/${PN}/${PV}/share/doc/rust" "/usr/share/doc/${P}" + + newenvd - "50${P}" <<-_EOF_ + LDPATH="${EPREFIX}/usr/lib/rust/lib" + MANPATH="${EPREFIX}/usr/lib/rust/man" + _EOF_ + + rm -rf "${ED}/usr/lib/${PN}/${PV}"/*.old || die + rm -rf "${ED}/usr/lib/${PN}/${PV}/bin"/*.old || die + rm -rf "${ED}/usr/lib/${PN}/${PV}/doc"/*.old || die + + # note: eselect-rust adds EROOT to all paths below + cat <<-_EOF_ > "${T}/provider-${P}" + /usr/bin/cargo + /usr/bin/rustdoc + /usr/bin/rust-gdb + /usr/bin/rust-gdbgui + /usr/bin/rust-lldb + /usr/lib/rustlib + /usr/lib/rust/lib + /usr/lib/rust/libexec + /usr/lib/rust/man + /usr/share/doc/rust + _EOF_ + + if use clippy; then + echo /usr/bin/clippy-driver >> "${T}/provider-${P}" + echo /usr/bin/cargo-clippy >> "${T}/provider-${P}" + fi + if use miri; then + echo /usr/bin/miri >> "${T}/provider-${P}" + echo /usr/bin/cargo-miri >> "${T}/provider-${P}" + fi + if use profiler; then + echo /usr/bin/rust-demangler >> "${T}/provider-${P}" + fi + if use rustfmt; then + echo /usr/bin/rustfmt >> "${T}/provider-${P}" + echo /usr/bin/cargo-fmt >> "${T}/provider-${P}" + fi + if use rust-analyzer; then + echo /usr/bin/rust-analyzer >> "${T}/provider-${P}" + fi + + insinto /etc/env.d/rust + doins "${T}/provider-${P}" + + if use dist; then + insinto "/usr/lib/${PN}/${PV}/dist" + doins -r "${S}/build/dist/." + fi +} + +pkg_postinst() { + eselect rust update + + if has_version sys-devel/gdb || has_version dev-util/lldb; then + elog "Rust installs a helper script for calling GDB and LLDB," + elog "for your convenience it is installed under /usr/bin/rust-{gdb,lldb}-${PV}." + fi + + if has_version app-editors/emacs; then + elog "install app-emacs/rust-mode to get emacs support for rust." + fi + + if has_version app-editors/gvim || has_version app-editors/vim; then + elog "install app-vim/rust-vim to get vim support for rust." + fi +} + +pkg_postrm() { + eselect rust cleanup +} -- cgit v1.2.3