Sync with portage [Tue Sep 1 16:04:55 MSK 2020].

develop 1756
root 4 years ago
parent b7221b31b7
commit 9efab8d2f2

Binary file not shown.

Binary file not shown.

@ -10,7 +10,7 @@ SRC_URI="mirror://apache/httpd/httpd-${PV}.tar.bz2"
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ~ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc64-solaris ~x64-solaris"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc64-solaris ~x64-solaris"
IUSE="libressl ssl"
RESTRICT="test"

Binary file not shown.

@ -0,0 +1,20 @@
diff --git a/scd/app-openpgp.c b/scd/app-openpgp.c
index 8a1d30d5b..ccc360fc8 100644
--- a/scd/app-openpgp.c
+++ b/scd/app-openpgp.c
@@ -2357,10 +2357,15 @@ verify_chv2 (app_t app,
int rc;
char *pinvalue;
int pinlen;
+ int i;
if (app->did_chv2)
return 0; /* We already verified CHV2. */
+ /* Make sure we have load the public keys. */
+ for (i = 0; i < 3; i++)
+ get_public_key (app, i);
+
if (app->app_local->pk[1].key || app->app_local->pk[2].key)
{
rc = verify_a_chv (app, pincb, pincb_arg, 2, 0, &pinvalue, &pinlen);

@ -50,6 +50,7 @@ DOCS=(
PATCHES=(
"${FILESDIR}/${PN}-2.1.20-gpgscm-Use-shorter-socket-path-lengts-to-improve-tes.patch"
"${FILESDIR}/${P}-card-status.patch"
)
src_prepare() {

@ -11,7 +11,7 @@ SRC_URI="mirror://sourceforge/trousers/${PN}/${P}.tar.gz"
LICENSE="CPL-1.0 GPL-2"
SLOT="0"
KEYWORDS="amd64 arm arm64 ~m68k ~ppc ~ppc64 ~s390 x86"
KEYWORDS="amd64 arm arm64 ~m68k ~ppc ppc64 ~s390 x86"
IUSE="doc libressl selinux" # gtk
# gtk support presently does NOT compile.

Binary file not shown.

@ -13,7 +13,7 @@ SRC_URI="
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
KEYWORDS="~alpha ~amd64 arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
IUSE="nls"
RDEPEND="

@ -1,2 +1,3 @@
DIST uptimed-0.4.1.tar.gz 55162 BLAKE2B c281f922ed4fcf4f55571f1f1177451bf9f2e0fecfc87566610e1d24055969cd61543fcb0fdae4d0e6dc7a082c1b9013a08b72641d572a2475e9c7f5fd56deae SHA512 5dfe79aebab8c8daca3a3ec88d54e312446fc7cf8b54ef1414cbfcb3fb25053ef31235de4b42cb14fc7352965b77ca2875c753b97b4d61178792a5484715e23a
DIST uptimed-0.4.2.tar.gz 55339 BLAKE2B 120a3b1d6dc9518f7051af4d7e0f1bcf455f7dd989687fa8f5a40f160f2912c21d09298bbb9c676af5387d96890a98acf3f21b60e046a9548a735ca10dbc4006 SHA512 a18cc8580a4dc7db7f4d97d70e25d76e7b98b9d328a0fa4ece4176d40fc26589149d63ffc9d2638cc35003cf485b43ae6e115aa1821c662d77f234eb3c4c0a4f
DIST uptimed-0.4.3.tar.gz 55396 BLAKE2B bebea6559c436d2700df905b63fabd73b1c55463e8633409bc05cd16c7d110d8116f52e00d63879cfb2e0482f648bda04dcb5a1d5ff629699d2758dcc85ba53a SHA512 f9485224dfe7173bab135a87b047d749f9b61d3c29d50523126b585ae77e68837680fdb725a08fd7cad39f0b35b2da7a6923b8540700881f9638286ab5082260

@ -0,0 +1,61 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit autotools systemd
DESCRIPTION="System uptime record daemon that keeps track of your highest uptimes"
HOMEPAGE="https://github.com/rpodgorny/uptimed/"
SRC_URI="https://github.com/rpodgorny/uptimed/archive/v${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~mips ~ppc ~ppc64 ~sparc ~x86"
IUSE="static-libs"
RDEPEND="
acct-group/uptimed
acct-user/uptimed
"
DEPEND="${RDEPEND}"
BDEPEND="${RDEPEND}"
src_prepare() {
default
# fix configure.ac for >=automake-1.13 (bug #467582)
sed 's@AM_CONFIG_HEADER@AC_CONFIG_HEADERS@' -i configure.ac || die
eautoreconf
}
src_configure() {
econf $(use_enable static-libs static)
}
src_install() {
local DOCS=( ChangeLog README.md TODO AUTHORS CREDITS INSTALL.cgi sample-cgi/* )
default
find "${ED}" -type f -name '*.la' -delete || die
local spooldir="/var/spool/${PN}"
keepdir ${spooldir}
fowners uptimed:uptimed ${spooldir}
newinitd "${FILESDIR}"/${PN}.init-r1 uptimed
systemd_dounit "${FILESDIR}/${PN}.service"
}
pkg_postinst() {
local spooldir="/var/spool/${PN}"
if [[ -d "${spooldir}" ]] ; then
einfo "Fixing permissions in ${spooldir}"
find ${spooldir} -type f -links 1 \
\( -name records -o -name records.old \) \
| xargs --no-run-if-empty chown uptimed:uptimed || die
fi
echo
elog "Start uptimed with '/etc/init.d/uptimed start' (for openRC)"
elog "or systemctl start uptimed (for systemd)"
elog "To view your uptime records, use the command 'uprecords'."
echo
}

Binary file not shown.

@ -15,7 +15,7 @@ SRC_URI="ftp://ftp.lyx.org/pub/lyx/stable/2.3.x/${MY_P}.tar.xz
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~ppc ~ppc64 ~sparc ~x86 ~x64-macos ~x86-macos"
KEYWORDS="amd64 ~ppc ~ppc64 ~sparc ~x86 ~x64-macos ~x86-macos"
IUSE="aspell cups debug docbook dia dot enchant gnumeric html +hunspell +latex monolithic-build nls rcs rtf subversion svg l10n_he"
REQUIRED_USE="${PYTHON_REQUIRED_USE}"

Binary file not shown.

@ -0,0 +1 @@
DIST pgo-0.0.2.tar.gz 1758457 BLAKE2B b31b9c2d200fb925390881019b9c540e8c95454874fa60a8829b73000d27ed470686dd7150d8cdcc7267a7329fcb6883d7f9eee27c622c91c36cfb6648bdda56 SHA512 36435813dee1d6256888e3f845b0bd053d9b58ed1c810f7368e935ac8e58f209956b8d3b0cff5cca464d76d8cebe3f483dba692a47c2785dc626842a30758554

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>arzano@gentoo.org</email>
<name>Max Magorsch</name>
</maintainer>
<maintainer type="person">
<email>zlogene@gentoo.org</email>
<name>Mikle Kolyada</name>
</maintainer>
<longdescription>
pgo is a small command line interface for packages.gentoo.org. It is
using the graphql api of packages.gentoo.org to display information
about packages like: versions, metadata, dependencies, QA reports,
pull requests, bugs and the changelog. It's also able to display
information for maintainers, as a list of packages they are maintaining,
a list of outdated packages, or bugs related to the packages they are
maintaining.
</longdescription>
</pkgmetadata>

@ -0,0 +1,27 @@
# Copyright 2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit go-module
if [[ ${PV} == *9999* ]]; then
inherit git-r3
EGIT_REPO_URI="https://github.com/arzano/pgo"
else
SRC_URI="https://github.com/arzano/pgo/archive/v${PV}.tar.gz -> ${P}.tar.gz"
KEYWORDS="~amd64 ~x86"
fi
DESCRIPTION="A command line interface for packages.gentoo.org"
HOMEPAGE="https://github.com/arzano/pgo"
LICENSE="BSD-2"
SLOT="0"
src_compile() {
env GOBIN="${S}/bin" go build -mod=vendor || die "compile failed"
}
src_install() {
dobin pgo
}

@ -0,0 +1,27 @@
# Copyright 2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit go-module
if [[ ${PV} == *9999* ]]; then
inherit git-r3
EGIT_REPO_URI="https://github.com/arzano/pgo"
else
SRC_URI="https://github.com/arzano/pgo/archive/v${PV}.tar.gz -> ${P}.tar.gz"
KEYWORDS="~amd64 ~x86"
fi
DESCRIPTION="A command line interface for packages.gentoo.org"
HOMEPAGE="https://github.com/arzano/pgo"
LICENSE="BSD-2"
SLOT="0"
src_compile() {
env GOBIN="${S}/bin" go build -mod=vendor || die "compile failed"
}
src_install() {
dobin pgo
}

Binary file not shown.

@ -46,7 +46,7 @@ fi
LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv s390 sparc x86 ~ppc-aix ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~m68k ~mips ppc ~ppc64 ~riscv s390 sparc x86 ~ppc-aix ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
IUSE="afs bashlogger examples mem-scramble +net nls plugins +readline"
DEPEND="

@ -11,7 +11,7 @@ SRC_URI="http://gondor.apana.org.au/~herbert/dash/files/${P}.tar.gz"
LICENSE="BSD"
SLOT="0"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ~ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
IUSE="libedit static"
BDEPEND="virtual/pkgconfig"

Binary file not shown.

@ -1,11 +1,3 @@
DIST php-7.2.31.tar.xz 12309936 BLAKE2B fc81f41dd4ec8695029bfe1993d76b1fdfe7f16d926f57302b9e85f3acd250967db9b9f0597c47589ae553d5faaaf0266e24b5b64247e017361d991bf96cd4de SHA512 b21c504d0af2c095e4ae5a62c810af96171b927a27ea4694f59555c0d47798d61c3491a92941099cd9c978b3b0f41852ca2cf745e42ee3d9a6d107a5a884c9ee
DIST php-7.2.32.tar.xz 12251152 BLAKE2B ae4cf19c2c61ea149b423248feef31e34fa697e60782e8a4fdf9bee430703e9bd8251e4140042148aa73dfbf4d39d215be498d1273e1c68bf52a14e4126d2e1d SHA512 47e84f9f493951b33625e149291bcde87189ecb28636809b3ec6264ed17e85f842fa40f3a53754f7bf948a5a6963f8773d35f773760c0c2bf21a9dbd0314736e
DIST php-7.2.33.tar.xz 12310624 BLAKE2B 3eca6a2aee79b791abb6b0427496e6041b63800ac1aeea86b4465e9326fdcde5d7a69e6323902b6874f27cf6197b705397381319d0b5ff6f93605e791bf0eb86 SHA512 1c28e741fc6de88a33e1307bc88ba8dddf1ba767ce6eb9c1f0da35482c7d3ee1154831b997fa746340c4b7ec8de9196b21a9b1cf319c8e69eca2c92602ceee4a
DIST php-7.3.18.tar.xz 12116280 BLAKE2B 73d82e4a22f29dbeec221ef3109592a40e559238a0093e80e8e10bcd7de64f3bd58dd6f0835ddf3d9c2323fc37d738301b07291ca11a84c70ddced172676bc20 SHA512 e626091c835f6d165ff48ae3be8ddf7a66b0a320c6d77dc98fb73235d560814c180112a9e5478a5b3b6bb01ed99a50f8025fdc3d1ef80cca59e04ac248f9b0bf
DIST php-7.3.19.tar.xz 12117968 BLAKE2B 84172d2aad901cdca97a6f4c3405d3f4f25c72053ca09ef8a5c6ef93d35b23ac3a7771ff9f2c4ddd000512fe288f3fb25b17bb023f3fed16735f0d6ea5bda790 SHA512 f37800d9e1bf808ad1099f6190965cc75781e7bf6d2c341a7143aca435abc9974a2987cbfeb8c2b35805c946218343612906fde3cc84b195c2c586945869b760
DIST php-7.3.20.tar.xz 12118188 BLAKE2B add1e0dcc264cd12ea9ee000becb83c42b2607c0c9ae828994856a183ae94e9a580226559ccfa28dece225ad9a1c6bd4989ada08f09bbc461b33f0b1b30b12ea SHA512 4d035e7420ceb64d912a1936db5d311c06c61d09c9d4665c27fba9709fe45b30d5771bb485fb24393d9ee689a0f7ddcbc577e9ee7a7b31341b0203f1b805b886
DIST php-7.3.21.tar.xz 12123192 BLAKE2B ff5fca092f6c4e92c009ade9f4bee01ec07686645a4844297cee0518f12b3ebc16a7322b64579d9ee2d3a3f7cd62ed9184d0afbe77dbcf2d24a11139242c88c5 SHA512 fc2b9a40c92a6e79522a49cd025e56c0a52c2c2bd3f7379aaf004ca6b67957cf4ad059c40a5daac45665710abd07962562870430338f700f573856d797df3ff4
DIST php-7.4.6.tar.xz 10284824 BLAKE2B 83bbbb536e48c6ab6ef357283d2f99a0f1825fdbb1867598514dc87cb8a7181298aa1e6d45659b7a4343fdacdacbbfec9e4cca89f85fe53c9e48696e534da710 SHA512 786634d53ed100cc7638e64ca340efdd42405c258638f3f97fcd1816d4f0c643dc8d8b2b0f60d36904343dc8c2af7f9b8e4a652ea66ec2fe324290c72bc09c13
DIST php-7.4.7.tar.xz 10286580 BLAKE2B fb297cc5847012e1d222479e00132c8838cb990a5face43620ced6fb82cabeb544c0de230e24e25ed5449b3050158e836743e514197180b40ebf240ceca45db6 SHA512 5b3ba690e610e0511675f06a10afe9edbcfa90b5b16956d22aab225cdf140b55e5a8a551e7b189d30404981c94c6921b8c4aed00102546cfa38784a719704b80
DIST php-7.4.8.tar.xz 10281976 BLAKE2B c85dfacd259e78de69348c3af7c02c866622a414cbb78ef5f53aa739bcf150921c272b26f578f18734dc6f566f19f4d890b6a64aabf04ad9e6b53f11757c3b8a SHA512 cfb23eac731a0eabed83908d7c056a123cd9a73ccc091d92b8601366da4cd95ded8623156eaa0458405f23d8bb9dc244d117bd99876f916ef582e3966dc78b44
DIST php-7.4.9.tar.xz 10289560 BLAKE2B 0fd9d82539a46f7ce58857560f5aeb4be6dfe5f5a05f8b8c55c30d6000d19408b4ecc460c9135736298cdb8312ec958ab8358110b2b265bb8c185f80b1522dc6 SHA512 6179c2d867d6775d7f41785003c36d06ce620e7746ea7e6a4d275264e814a66d465776b47b04e2926ed1228cf58f2c15cdda74faf10372435c74ede7aeb79e18

@ -1,759 +0,0 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="7"
inherit flag-o-matic 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 ~mips ppc ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-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 argon2 bcmath berkdb bzip2 calendar cdb cjk
coverage +ctype curl debug
enchant exif +fileinfo +filter firebird
+flatfile ftp gd gdbm gmp +hash +iconv imap inifile
intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl lmdb
mhash mssql mysql mysqli nls
oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
readline recode selinux +session session-mm sharedmem
+simplexml snmp soap sockets sodium spell sqlite ssl
sysvipc systemd test tidy +tokenizer tokyocabinet truetype unicode wddx webp
+xml xmlreader xmlwriter xmlrpc xpm xslt zip zip-encryption zlib"
# 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.1[apache2?,fpm?]
>=dev-libs/libpcre-8.32[unicode]
fpm? ( acl? ( sys-apps/acl ) )
apache2? ( www-servers/apache[apache2_modules_unixd(+),threads=] )
argon2? ( app-crypt/argon2:= )
berkdb? ( || ( sys-libs/db:5.3
sys-libs/db:5.1
sys-libs/db:4.8
sys-libs/db:4.7
sys-libs/db:4.6
sys-libs/db:4.5 ) )
bzip2? ( app-arch/bzip2:0= )
cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
coverage? ( dev-util/lcov )
curl? ( >=net-misc/curl-7.10.5 )
enchant? ( <app-text/enchant-2.0:0 )
firebird? ( dev-db/firebird )
gd? ( >=virtual/jpeg-0-r3:0 media-libs/libpng:0= sys-libs/zlib )
gdbm? ( >=sys-libs/gdbm-1.8.0:0= )
gmp? ( dev-libs/gmp:0= )
iconv? ( virtual/libiconv )
imap? ( >=virtual/imap-c-client-2[kerberos=,ssl=] )
intl? ( dev-libs/icu:= )
iodbc? ( dev-db/libiodbc )
kerberos? ( virtual/krb5 )
ldap? ( >=net-nds/openldap-1.2.11 )
ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 )
libedit? ( dev-libs/libedit )
lmdb? ( dev-db/lmdb:= )
mssql? ( dev-db/freetds[mssql] )
nls? ( sys-devel/gettext )
oci8-instant-client? ( dev-db/oracle-instantclient-basic )
odbc? ( >=dev-db/unixODBC-1.8.13 )
postgres? ( dev-db/postgresql:* )
qdbm? ( dev-db/qdbm )
readline? ( sys-libs/readline:0= )
recode? ( app-text/recode )
session-mm? ( dev-libs/mm )
simplexml? ( >=dev-libs/libxml2-2.6.8 )
snmp? ( >=net-analyzer/net-snmp-5.2 )
soap? ( >=dev-libs/libxml2-2.6.8 )
sodium? ( dev-libs/libsodium:= )
spell? ( >=app-text/aspell-0.50 )
sqlite? ( >=dev-db/sqlite-3.7.6.3 )
ssl? (
!libressl? ( dev-libs/openssl:0= )
libressl? ( dev-libs/libressl:0= )
)
tidy? ( || ( app-text/tidy-html5 app-text/htmltidy ) )
tokyocabinet? ( dev-db/tokyocabinet )
truetype? ( =media-libs/freetype-2* )
unicode? ( dev-libs/oniguruma:= )
wddx? ( >=dev-libs/libxml2-2.6.8 )
webp? ( media-libs/libwebp:0= )
xml? ( >=dev-libs/libxml2-2.6.8 )
xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
xmlreader? ( >=dev-libs/libxml2-2.6.8 )
xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
xpm? ( x11-libs/libXpm )
xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
zip? ( sys-libs/zlib:0= )
zip-encryption? ( >=dev-libs/libzip-1.2.0:= )
zlib? ( sys-libs/zlib:0= )
"
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"
# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
REQUIRED_USE="
|| ( cli cgi fpm apache2 embed phpdbg )
cli? ( ^^ ( readline libedit ) )
truetype? ( gd zlib )
webp? ( gd zlib )
cjk? ( gd zlib )
exif? ( gd zlib )
xpm? ( gd zlib )
gd? ( zlib )
simplexml? ( xml )
soap? ( xml )
wddx? ( xml )
xmlrpc? ( || ( xml iconv ) )
xmlreader? ( xml )
xslt? ( xml )
ldap-sasl? ( ldap )
mhash? ( hash )
phar? ( hash )
qdbm? ( !gdbm )
readline? ( !libedit )
recode? ( !imap !mysqli !mysql )
session-mm? ( session !threads )
mysql? ( hash || ( mysqli pdo ) )
mysqli? ( hash )
zip-encryption? ( zip )
"
RESTRICT="!test? ( test )"
PATCHES=(
"${FILESDIR}/php-freetype-2.9.1.patch"
"${FILESDIR}/php-7.2.13-intl-use-icu-namespace.patch"
)
PHP_MV="$(ver_cut 1)"
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'
# Bug 669566 - necessary so that build tools are updated for commands like pecl
# Force rebuilding aclocal.m4
rm -f aclocal.m4 || die "failed to remove aclocal.m4 in src_prepare"
eautoreconf
}
src_configure() {
addpredict /usr/share/snmp/mibs/.index #nowarn
addpredict /var/lib/net-snmp/mib_indexes #nowarn
PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
# 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
$(use_enable threads maintainer-zts)
)
our_conf+=(
$(use_with argon2 password-argon2 "${EPREFIX}/usr")
$(use_enable bcmath bcmath)
$(use_with bzip2 bz2 "${EPREFIX}/usr")
$(use_enable calendar calendar)
$(use_enable coverage gcov)
$(use_enable ctype ctype)
$(use_with curl curl "${EPREFIX}/usr")
$(use_enable xml dom)
$(use_with enchant enchant "${EPREFIX}/usr")
$(use_enable exif exif)
$(use_enable fileinfo fileinfo)
$(use_enable filter filter)
$(use_enable ftp ftp)
$(use_with nls gettext "${EPREFIX}/usr")
$(use_with gmp gmp "${EPREFIX}/usr")
$(use_enable hash hash)
$(use_with mhash mhash "${EPREFIX}/usr")
$(use_with iconv iconv \
$(use elibc_glibc || use elibc_musl || use elibc_FreeBSD || echo "${EPREFIX}/usr"))
$(use_enable intl intl)
$(use_enable ipv6 ipv6)
$(use_enable json json)
$(use_with kerberos kerberos "${EPREFIX}/usr")
$(use_enable xml libxml)
$(use_with xml libxml-dir "${EPREFIX}/usr")
$(use_enable unicode mbstring)
$(use_with unicode onig "${EPREFIX}/usr")
$(use_with ssl openssl "${EPREFIX}/usr")
$(use_with ssl openssl-dir "${EPREFIX}/usr")
$(use_enable pcntl pcntl)
$(use_enable phar phar)
$(use_enable pdo pdo)
$(use_enable opcache opcache)
$(use_with postgres pgsql "${EPREFIX}/usr")
$(use_enable posix posix)
$(use_with spell pspell "${EPREFIX}/usr")
$(use_with recode recode "${EPREFIX}/usr")
$(use_enable simplexml simplexml)
$(use_enable sharedmem shmop)
$(use_with snmp snmp "${EPREFIX}/usr")
$(use_enable soap soap)
$(use_enable sockets sockets)
$(use_with sodium sodium "${EPREFIX}/usr")
$(use_with sqlite sqlite3 "${EPREFIX}/usr")
$(use_enable sysvipc sysvmsg)
$(use_enable sysvipc sysvsem)
$(use_enable sysvipc sysvshm)
$(use_with tidy tidy "${EPREFIX}/usr")
$(use_enable tokenizer tokenizer)
$(use_enable wddx wddx)
$(use_enable xml xml)
$(use_enable xmlreader xmlreader)
$(use_enable xmlwriter xmlwriter)
$(use_with xmlrpc xmlrpc)
$(use_with xslt xsl "${EPREFIX}/usr")
$(use_enable zip zip)
$(use_with zip-encryption libzip "${EPREFIX}/usr")
$(use_with zlib zlib "${EPREFIX}/usr")
$(use_enable debug debug)
)
# DBA support
if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
|| use qdbm || use lmdb || use tokyocabinet ; then
our_conf+=( "--enable-dba${shared}" )
fi
# DBA drivers support
our_conf+=(
$(use_with cdb cdb)
$(use_with berkdb db4 "${EPREFIX}/usr")
$(use_enable flatfile flatfile)
$(use_with gdbm gdbm "${EPREFIX}/usr")
$(use_enable inifile inifile)
$(use_with qdbm qdbm "${EPREFIX}/usr")
$(use_with lmdb lmdb "${EPREFIX}/usr")
)
# Support for the GD graphics library
our_conf+=(
$(use_with truetype freetype-dir "${EPREFIX}/usr")
$(use_enable cjk gd-jis-conv)
$(use_with gd jpeg-dir "${EPREFIX}/usr")
$(use_with gd png-dir "${EPREFIX}/usr")
$(use_with xpm xpm-dir "${EPREFIX}/usr")
)
if use webp; then
our_conf+=( --with-webp-dir="${EPREFIX}/usr" )
fi
# enable gd last, so configure can pick up the previous settings
our_conf+=( $(use_with gd gd) )
# IMAP support
if use imap ; then
our_conf+=(
$(use_with imap imap "${EPREFIX}/usr")
$(use_with ssl imap-ssl "${EPREFIX}/usr")
)
fi
# Interbase/firebird support
our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") )
# LDAP support
if use ldap ; then
our_conf+=(
$(use_with ldap ldap "${EPREFIX}/usr")
$(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr")
)
fi
# MySQL support
local mysqllib="mysqlnd"
local mysqlilib="mysqlnd"
our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
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
our_conf+=(
$(use_with odbc unixODBC "${EPREFIX}/usr")
$(use_with iodbc iodbc "${EPREFIX}/usr")
)
# 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 "${mysqllib}")
$(use_with postgres pdo-pgsql)
$(use_with sqlite pdo-sqlite "${EPREFIX}/usr")
$(use_with firebird pdo-firebird "${EPREFIX}/usr")
$(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr")
$(use_with oci8-instant-client pdo-oci)
)
fi
# readline/libedit support
our_conf+=(
$(use_with readline readline "${EPREFIX}/usr")
$(use_with libedit libedit "${EPREFIX}/usr")
)
# Session support
if use session ; then
our_conf+=( $(use_with session-mm mm "${EPREFIX}/usr") )
else
our_conf+=( $(use_enable session 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-pcre-regex affects ext/pcre
# --with-pcre-dir affects ext/filter and ext/zip
# --with-pcre-valgrind cannot be enabled with system pcre
# Many arches don't support pcre-jit
our_conf+=(
--with-pcre-regex="${EPREFIX}/usr"
--with-pcre-dir="${EPREFIX}/usr"
--without-pcre-valgrind
--without-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
local one_sapi
local sapi
mkdir -p "${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
cd "${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
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
local sapi
for sapi in ${SAPIS} ; do
if use "${sapi}"; then
cd "${WORKDIR}/sapis-build/$sapi" || \
die "Failed to change dir to ${WORKDIR}/sapis-build/$1"
emake
fi
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${PHP_MV}$(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${PHP_MV}$(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() {
echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
if [[ ! -x "${PHP_BIN}" ]] ; then
ewarn "Test phase requires USE=cli, skipping"
return
else
export TEST_PHP_EXECUTABLE="${PHP_BIN}"
fi
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
REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \
"session.save_path=${T}" \
"${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \
"session.save_path=${T}"
for name in ${EXPECTED_TEST_FAILURES}; do
mv "${name}.out" "${name}.out.orig" 2>/dev/null || die
done
local failed="$(find -name '*.out')"
if [[ ${failed} != "" ]] ; then
ewarn "The following test cases failed unexpectedly:"
for name in ${failed}; do
ewarn " ${name/.out/}"
done
else
einfo "No unexpected test failures, all fine"
fi
if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
local passed=""
for name in ${EXPECTED_TEST_FAILURES}; do
[[ -f "${name}.diff" ]] && continue
passed="${passed} ${name}"
done
if [[ ${passed} != "" ]] ; then
einfo "The following test cases passed unexpectedly:"
for name in ${passed}; do
ewarn " ${passed}"
done
else
einfo "None of the known-to-fail tests passed, all fine"
fi
fi
}
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
}

@ -1,759 +0,0 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="7"
inherit flag-o-matic 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 ~mips ppc ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-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 argon2 bcmath berkdb bzip2 calendar cdb cjk
coverage +ctype curl debug
enchant exif +fileinfo +filter firebird
+flatfile ftp gd gdbm gmp +hash +iconv imap inifile
intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl lmdb
mhash mssql mysql mysqli nls
oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
readline recode selinux +session session-mm sharedmem
+simplexml snmp soap sockets sodium spell sqlite ssl
sysvipc systemd test tidy +tokenizer tokyocabinet truetype unicode wddx webp
+xml xmlreader xmlwriter xmlrpc xpm xslt zip zip-encryption zlib"
# 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.1[apache2?,fpm?]
>=dev-libs/libpcre-8.32[unicode]
fpm? ( acl? ( sys-apps/acl ) )
apache2? ( www-servers/apache[apache2_modules_unixd(+),threads=] )
argon2? ( app-crypt/argon2:= )
berkdb? ( || ( sys-libs/db:5.3
sys-libs/db:5.1
sys-libs/db:4.8
sys-libs/db:4.7
sys-libs/db:4.6
sys-libs/db:4.5 ) )
bzip2? ( app-arch/bzip2:0= )
cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
coverage? ( dev-util/lcov )
curl? ( >=net-misc/curl-7.10.5 )
enchant? ( <app-text/enchant-2.0:0 )
firebird? ( dev-db/firebird )
gd? ( >=virtual/jpeg-0-r3:0 media-libs/libpng:0= sys-libs/zlib )
gdbm? ( >=sys-libs/gdbm-1.8.0:0= )
gmp? ( dev-libs/gmp:0= )
iconv? ( virtual/libiconv )
imap? ( >=virtual/imap-c-client-2[kerberos=,ssl=] )
intl? ( dev-libs/icu:= )
iodbc? ( dev-db/libiodbc )
kerberos? ( virtual/krb5 )
ldap? ( >=net-nds/openldap-1.2.11 )
ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 )
libedit? ( dev-libs/libedit )
lmdb? ( dev-db/lmdb:= )
mssql? ( dev-db/freetds[mssql] )
nls? ( sys-devel/gettext )
oci8-instant-client? ( dev-db/oracle-instantclient-basic )
odbc? ( >=dev-db/unixODBC-1.8.13 )
postgres? ( dev-db/postgresql:* )
qdbm? ( dev-db/qdbm )
readline? ( sys-libs/readline:0= )
recode? ( app-text/recode )
session-mm? ( dev-libs/mm )
simplexml? ( >=dev-libs/libxml2-2.6.8 )
snmp? ( >=net-analyzer/net-snmp-5.2 )
soap? ( >=dev-libs/libxml2-2.6.8 )
sodium? ( dev-libs/libsodium:= )
spell? ( >=app-text/aspell-0.50 )
sqlite? ( >=dev-db/sqlite-3.7.6.3 )
ssl? (
!libressl? ( dev-libs/openssl:0= )
libressl? ( dev-libs/libressl:0= )
)
tidy? ( || ( app-text/tidy-html5 app-text/htmltidy ) )
tokyocabinet? ( dev-db/tokyocabinet )
truetype? ( =media-libs/freetype-2* )
unicode? ( dev-libs/oniguruma:= )
wddx? ( >=dev-libs/libxml2-2.6.8 )
webp? ( media-libs/libwebp:0= )
xml? ( >=dev-libs/libxml2-2.6.8 )
xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
xmlreader? ( >=dev-libs/libxml2-2.6.8 )
xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
xpm? ( x11-libs/libXpm )
xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
zip? ( sys-libs/zlib:0= )
zip-encryption? ( >=dev-libs/libzip-1.2.0:= )
zlib? ( sys-libs/zlib:0= )
"
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"
# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
REQUIRED_USE="
|| ( cli cgi fpm apache2 embed phpdbg )
cli? ( ^^ ( readline libedit ) )
truetype? ( gd zlib )
webp? ( gd zlib )
cjk? ( gd zlib )
exif? ( gd zlib )
xpm? ( gd zlib )
gd? ( zlib )
simplexml? ( xml )
soap? ( xml )
wddx? ( xml )
xmlrpc? ( || ( xml iconv ) )
xmlreader? ( xml )
xslt? ( xml )
ldap-sasl? ( ldap )
mhash? ( hash )
phar? ( hash )
qdbm? ( !gdbm )
readline? ( !libedit )
recode? ( !imap !mysqli !mysql )
session-mm? ( session !threads )
mysql? ( hash || ( mysqli pdo ) )
mysqli? ( hash )
zip-encryption? ( zip )
"
RESTRICT="!test? ( test )"
PATCHES=(
"${FILESDIR}/php-freetype-2.9.1.patch"
"${FILESDIR}/php-7.2.13-intl-use-icu-namespace.patch"
)
PHP_MV="$(ver_cut 1)"
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'
# Bug 669566 - necessary so that build tools are updated for commands like pecl
# Force rebuilding aclocal.m4
rm -f aclocal.m4 || die "failed to remove aclocal.m4 in src_prepare"
eautoreconf
}
src_configure() {
addpredict /usr/share/snmp/mibs/.index #nowarn
addpredict /var/lib/net-snmp/mib_indexes #nowarn
PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
# 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
$(use_enable threads maintainer-zts)
)
our_conf+=(
$(use_with argon2 password-argon2 "${EPREFIX}/usr")
$(use_enable bcmath bcmath)
$(use_with bzip2 bz2 "${EPREFIX}/usr")
$(use_enable calendar calendar)
$(use_enable coverage gcov)
$(use_enable ctype ctype)
$(use_with curl curl "${EPREFIX}/usr")
$(use_enable xml dom)
$(use_with enchant enchant "${EPREFIX}/usr")
$(use_enable exif exif)
$(use_enable fileinfo fileinfo)
$(use_enable filter filter)
$(use_enable ftp ftp)
$(use_with nls gettext "${EPREFIX}/usr")
$(use_with gmp gmp "${EPREFIX}/usr")
$(use_enable hash hash)
$(use_with mhash mhash "${EPREFIX}/usr")
$(use_with iconv iconv \
$(use elibc_glibc || use elibc_musl || use elibc_FreeBSD || echo "${EPREFIX}/usr"))
$(use_enable intl intl)
$(use_enable ipv6 ipv6)
$(use_enable json json)
$(use_with kerberos kerberos "${EPREFIX}/usr")
$(use_enable xml libxml)
$(use_with xml libxml-dir "${EPREFIX}/usr")
$(use_enable unicode mbstring)
$(use_with unicode onig "${EPREFIX}/usr")
$(use_with ssl openssl "${EPREFIX}/usr")
$(use_with ssl openssl-dir "${EPREFIX}/usr")
$(use_enable pcntl pcntl)
$(use_enable phar phar)
$(use_enable pdo pdo)
$(use_enable opcache opcache)
$(use_with postgres pgsql "${EPREFIX}/usr")
$(use_enable posix posix)
$(use_with spell pspell "${EPREFIX}/usr")
$(use_with recode recode "${EPREFIX}/usr")
$(use_enable simplexml simplexml)
$(use_enable sharedmem shmop)
$(use_with snmp snmp "${EPREFIX}/usr")
$(use_enable soap soap)
$(use_enable sockets sockets)
$(use_with sodium sodium "${EPREFIX}/usr")
$(use_with sqlite sqlite3 "${EPREFIX}/usr")
$(use_enable sysvipc sysvmsg)
$(use_enable sysvipc sysvsem)
$(use_enable sysvipc sysvshm)
$(use_with tidy tidy "${EPREFIX}/usr")
$(use_enable tokenizer tokenizer)
$(use_enable wddx wddx)
$(use_enable xml xml)
$(use_enable xmlreader xmlreader)
$(use_enable xmlwriter xmlwriter)
$(use_with xmlrpc xmlrpc)
$(use_with xslt xsl "${EPREFIX}/usr")
$(use_enable zip zip)
$(use_with zip-encryption libzip "${EPREFIX}/usr")
$(use_with zlib zlib "${EPREFIX}/usr")
$(use_enable debug debug)
)
# DBA support
if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
|| use qdbm || use lmdb || use tokyocabinet ; then
our_conf+=( "--enable-dba${shared}" )
fi
# DBA drivers support
our_conf+=(
$(use_with cdb cdb)
$(use_with berkdb db4 "${EPREFIX}/usr")
$(use_enable flatfile flatfile)
$(use_with gdbm gdbm "${EPREFIX}/usr")
$(use_enable inifile inifile)
$(use_with qdbm qdbm "${EPREFIX}/usr")
$(use_with lmdb lmdb "${EPREFIX}/usr")
)
# Support for the GD graphics library
our_conf+=(
$(use_with truetype freetype-dir "${EPREFIX}/usr")
$(use_enable cjk gd-jis-conv)
$(use_with gd jpeg-dir "${EPREFIX}/usr")
$(use_with gd png-dir "${EPREFIX}/usr")
$(use_with xpm xpm-dir "${EPREFIX}/usr")
)
if use webp; then
our_conf+=( --with-webp-dir="${EPREFIX}/usr" )
fi
# enable gd last, so configure can pick up the previous settings
our_conf+=( $(use_with gd gd) )
# IMAP support
if use imap ; then
our_conf+=(
$(use_with imap imap "${EPREFIX}/usr")
$(use_with ssl imap-ssl "${EPREFIX}/usr")
)
fi
# Interbase/firebird support
our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") )
# LDAP support
if use ldap ; then
our_conf+=(
$(use_with ldap ldap "${EPREFIX}/usr")
$(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr")
)
fi
# MySQL support
local mysqllib="mysqlnd"
local mysqlilib="mysqlnd"
our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
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
our_conf+=(
$(use_with odbc unixODBC "${EPREFIX}/usr")
$(use_with iodbc iodbc "${EPREFIX}/usr")
)
# 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 "${mysqllib}")
$(use_with postgres pdo-pgsql)
$(use_with sqlite pdo-sqlite "${EPREFIX}/usr")
$(use_with firebird pdo-firebird "${EPREFIX}/usr")
$(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr")
$(use_with oci8-instant-client pdo-oci)
)
fi
# readline/libedit support
our_conf+=(
$(use_with readline readline "${EPREFIX}/usr")
$(use_with libedit libedit "${EPREFIX}/usr")
)
# Session support
if use session ; then
our_conf+=( $(use_with session-mm mm "${EPREFIX}/usr") )
else
our_conf+=( $(use_enable session 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-pcre-regex affects ext/pcre
# --with-pcre-dir affects ext/filter and ext/zip
# --with-pcre-valgrind cannot be enabled with system pcre
# Many arches don't support pcre-jit
our_conf+=(
--with-pcre-regex="${EPREFIX}/usr"
--with-pcre-dir="${EPREFIX}/usr"
--without-pcre-valgrind
--without-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
local one_sapi
local sapi
mkdir -p "${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
cd "${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
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
local sapi
for sapi in ${SAPIS} ; do
if use "${sapi}"; then
cd "${WORKDIR}/sapis-build/$sapi" || \
die "Failed to change dir to ${WORKDIR}/sapis-build/$1"
emake
fi
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${PHP_MV}$(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${PHP_MV}$(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() {
echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
if [[ ! -x "${PHP_BIN}" ]] ; then
ewarn "Test phase requires USE=cli, skipping"
return
else
export TEST_PHP_EXECUTABLE="${PHP_BIN}"
fi
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
REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \
"session.save_path=${T}" \
"${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \
"session.save_path=${T}"
for name in ${EXPECTED_TEST_FAILURES}; do
mv "${name}.out" "${name}.out.orig" 2>/dev/null || die
done
local failed="$(find -name '*.out')"
if [[ ${failed} != "" ]] ; then
ewarn "The following test cases failed unexpectedly:"
for name in ${failed}; do
ewarn " ${name/.out/}"
done
else
einfo "No unexpected test failures, all fine"
fi
if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
local passed=""
for name in ${EXPECTED_TEST_FAILURES}; do
[[ -f "${name}.diff" ]] && continue
passed="${passed} ${name}"
done
if [[ ${passed} != "" ]] ; then
einfo "The following test cases passed unexpectedly:"
for name in ${passed}; do
ewarn " ${passed}"
done
else
einfo "None of the known-to-fail tests passed, all fine"
fi
fi
}
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
}

@ -18,7 +18,7 @@ LICENSE="PHP-3.01
unicode? ( BSD-2 LGPL-2.1 )"
SLOT="$(ver_cut 1-2)"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ~ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
# We can build the following SAPIs in the given order
SAPIS="embed cli cgi fpm apache2 phpdbg"

@ -1,760 +0,0 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="7"
inherit flag-o-matic systemd autotools
MY_PV=${PV/_rc/RC}
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 ~mips ppc ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
S="${WORKDIR}/${PN}-${MY_PV}"
# 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 argon2 bcmath berkdb bzip2 calendar cdb cjk
coverage +ctype curl debug
enchant exif +fileinfo +filter firebird
+flatfile ftp gd gdbm gmp +hash +iconv imap inifile
intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl lmdb
mhash mssql mysql mysqli nls
oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
readline recode selinux +session session-mm sharedmem
+simplexml snmp soap sockets sodium spell sqlite ssl
sysvipc systemd test tidy +tokenizer tokyocabinet truetype unicode wddx webp
+xml xmlreader xmlwriter xmlrpc xpm xslt zip zip-encryption zlib"
# 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.1[apache2?,fpm?]
>=dev-libs/libpcre2-10.30[unicode]
fpm? ( acl? ( sys-apps/acl ) )
apache2? ( www-servers/apache[apache2_modules_unixd(+),threads=] )
argon2? ( app-crypt/argon2:= )
berkdb? ( || ( sys-libs/db:5.3
sys-libs/db:5.1
sys-libs/db:4.8
sys-libs/db:4.7
sys-libs/db:4.6
sys-libs/db:4.5 ) )
bzip2? ( app-arch/bzip2:0= )
cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
coverage? ( dev-util/lcov )
curl? ( >=net-misc/curl-7.10.5 )
enchant? ( <app-text/enchant-2.0:0 )
firebird? ( dev-db/firebird )
gd? ( >=virtual/jpeg-0-r3:0 media-libs/libpng:0= >=sys-libs/zlib-1.2.0.4 )
gdbm? ( >=sys-libs/gdbm-1.8.0:0= )
gmp? ( dev-libs/gmp:0= )
iconv? ( virtual/libiconv )
imap? ( >=virtual/imap-c-client-2[kerberos=,ssl=] )
intl? ( dev-libs/icu:= )
iodbc? ( dev-db/libiodbc )
kerberos? ( virtual/krb5 )
ldap? ( >=net-nds/openldap-1.2.11 )
ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 )
libedit? ( dev-libs/libedit )
lmdb? ( dev-db/lmdb:= )
mssql? ( dev-db/freetds[mssql] )
nls? ( sys-devel/gettext )
oci8-instant-client? ( dev-db/oracle-instantclient-basic )
odbc? ( >=dev-db/unixODBC-1.8.13 )
postgres? ( dev-db/postgresql:* )
qdbm? ( dev-db/qdbm )
readline? ( sys-libs/readline:0= )
recode? ( app-text/recode )
session-mm? ( dev-libs/mm )
simplexml? ( >=dev-libs/libxml2-2.6.8 )
snmp? ( >=net-analyzer/net-snmp-5.2 )
soap? ( >=dev-libs/libxml2-2.6.8 )
sodium? ( dev-libs/libsodium:= )
spell? ( >=app-text/aspell-0.50 )
sqlite? ( >=dev-db/sqlite-3.7.6.3 )
ssl? (
!libressl? ( >=dev-libs/openssl-1.0.1:0= )
libressl? ( dev-libs/libressl:0= )
)
tidy? ( || ( app-text/tidy-html5 app-text/htmltidy ) )
tokyocabinet? ( dev-db/tokyocabinet )
truetype? ( =media-libs/freetype-2* )
unicode? ( dev-libs/oniguruma:= )
wddx? ( >=dev-libs/libxml2-2.6.8 )
webp? ( media-libs/libwebp:0= )
xml? ( >=dev-libs/libxml2-2.6.8 )
xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
xmlreader? ( >=dev-libs/libxml2-2.6.8 )
xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
xpm? ( x11-libs/libXpm )
xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
zip? ( >=sys-libs/zlib-1.2.0.4:0= )
zip-encryption? ( >=dev-libs/libzip-1.2.0:= )
zlib? ( >=sys-libs/zlib-1.2.0.4:0= )
"
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"
# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
REQUIRED_USE="
|| ( cli cgi fpm apache2 embed phpdbg )
cli? ( ^^ ( readline libedit ) )
truetype? ( gd zlib )
webp? ( gd zlib )
cjk? ( gd zlib )
exif? ( gd zlib )
xpm? ( gd zlib )
gd? ( zlib )
simplexml? ( xml )
soap? ( xml )
wddx? ( xml )
xmlrpc? ( || ( xml iconv ) )
xmlreader? ( xml )
xslt? ( xml )
ldap-sasl? ( ldap )
mhash? ( hash )
phar? ( hash )
qdbm? ( !gdbm )
readline? ( !libedit )
recode? ( !imap !mysqli !mysql )
session-mm? ( session !threads )
mysql? ( || ( mysqli pdo ) )
zip-encryption? ( zip )
"
RESTRICT="!test? ( test )"
PATCHES=(
"${FILESDIR}/php-freetype-2.9.1.patch"
)
PHP_MV="$(ver_cut 1)"
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'
# Bug 669566 - necessary so that build tools are updated for commands like pecl
# Force rebuilding aclocal.m4
rm -f aclocal.m4 || die "failed to remove aclocal.m4 in src_prepare"
eautoreconf
}
src_configure() {
addpredict /usr/share/snmp/mibs/.index #nowarn
addpredict /var/lib/net-snmp/mib_indexes #nowarn
PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
# 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
$(use_enable threads maintainer-zts)
)
our_conf+=(
$(use_with argon2 password-argon2 "${EPREFIX}/usr")
$(use_enable bcmath bcmath)
$(use_with bzip2 bz2 "${EPREFIX}/usr")
$(use_enable calendar calendar)
$(use_enable coverage gcov)
$(use_enable ctype ctype)
$(use_with curl curl "${EPREFIX}/usr")
$(use_enable xml dom)
$(use_with enchant enchant "${EPREFIX}/usr")
$(use_enable exif exif)
$(use_enable fileinfo fileinfo)
$(use_enable filter filter)
$(use_enable ftp ftp)
$(use_with nls gettext "${EPREFIX}/usr")
$(use_with gmp gmp "${EPREFIX}/usr")
$(use_enable hash hash)
$(use_with mhash mhash "${EPREFIX}/usr")
$(use_with iconv iconv \
$(use elibc_glibc || use elibc_musl || use elibc_FreeBSD || echo "${EPREFIX}/usr"))
$(use_enable intl intl)
$(use_enable ipv6 ipv6)
$(use_enable json json)
$(use_with kerberos kerberos "${EPREFIX}/usr")
$(use_enable xml libxml)
$(use_with xml libxml-dir "${EPREFIX}/usr")
$(use_enable unicode mbstring)
$(use_with unicode onig "${EPREFIX}/usr")
$(use_with ssl openssl "${EPREFIX}/usr")
$(use_with ssl openssl-dir "${EPREFIX}/usr")
$(use_enable pcntl pcntl)
$(use_enable phar phar)
$(use_enable pdo pdo)
$(use_enable opcache opcache)
$(use_with postgres pgsql "${EPREFIX}/usr")
$(use_enable posix posix)
$(use_with spell pspell "${EPREFIX}/usr")
$(use_with recode recode "${EPREFIX}/usr")
$(use_enable simplexml simplexml)
$(use_enable sharedmem shmop)
$(use_with snmp snmp "${EPREFIX}/usr")
$(use_enable soap soap)
$(use_enable sockets sockets)
$(use_with sodium sodium "${EPREFIX}/usr")
$(use_with sqlite sqlite3 "${EPREFIX}/usr")
$(use_enable sysvipc sysvmsg)
$(use_enable sysvipc sysvsem)
$(use_enable sysvipc sysvshm)
$(use_with tidy tidy "${EPREFIX}/usr")
$(use_enable tokenizer tokenizer)
$(use_enable wddx wddx)
$(use_enable xml xml)
$(use_enable xmlreader xmlreader)
$(use_enable xmlwriter xmlwriter)
$(use_with xmlrpc xmlrpc)
$(use_with xslt xsl "${EPREFIX}/usr")
$(use_enable zip zip)
$(use_with zip-encryption libzip "${EPREFIX}/usr")
$(use_with zlib zlib "${EPREFIX}/usr")
$(use_enable debug debug)
)
# DBA support
if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
|| use qdbm || use lmdb || use tokyocabinet ; then
our_conf+=( "--enable-dba${shared}" )
fi
# DBA drivers support
our_conf+=(
$(use_with cdb cdb)
$(use_with berkdb db4 "${EPREFIX}/usr")
$(use_enable flatfile flatfile)
$(use_with gdbm gdbm "${EPREFIX}/usr")
$(use_enable inifile inifile)
$(use_with qdbm qdbm "${EPREFIX}/usr")
$(use_with lmdb lmdb "${EPREFIX}/usr")
)
# Support for the GD graphics library
our_conf+=(
$(use_with truetype freetype-dir "${EPREFIX}/usr")
$(use_enable cjk gd-jis-conv)
$(use_with gd jpeg-dir "${EPREFIX}/usr")
$(use_with gd png-dir "${EPREFIX}/usr")
$(use_with xpm xpm-dir "${EPREFIX}/usr")
)
if use webp; then
our_conf+=( --with-webp-dir="${EPREFIX}/usr" )
fi
# enable gd last, so configure can pick up the previous settings
our_conf+=( $(use_with gd gd) )
# IMAP support
if use imap ; then
our_conf+=(
$(use_with imap imap "${EPREFIX}/usr")
$(use_with ssl imap-ssl "${EPREFIX}/usr")
)
fi
# Interbase/firebird support
our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") )
# LDAP support
if use ldap ; then
our_conf+=(
$(use_with ldap ldap "${EPREFIX}/usr")
$(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr")
)
fi
# MySQL support
local mysqllib="mysqlnd"
local mysqlilib="mysqlnd"
our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
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
our_conf+=(
$(use_with odbc unixODBC "${EPREFIX}/usr")
$(use_with iodbc iodbc "${EPREFIX}/usr")
)
# 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 "${mysqllib}")
$(use_with postgres pdo-pgsql)
$(use_with sqlite pdo-sqlite "${EPREFIX}/usr")
$(use_with firebird pdo-firebird "${EPREFIX}/usr")
$(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr")
$(use_with oci8-instant-client pdo-oci)
)
fi
# readline/libedit support
our_conf+=(
$(use_with readline readline "${EPREFIX}/usr")
$(use_with libedit libedit "${EPREFIX}/usr")
)
# Session support
if use session ; then
our_conf+=( $(use_with session-mm mm "${EPREFIX}/usr") )
else
our_conf+=( $(use_enable session 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-pcre-regex affects ext/pcre
# --with-pcre-dir affects ext/filter and ext/zip
# --with-pcre-valgrind cannot be enabled with system pcre
# Many arches don't support pcre-jit
our_conf+=(
--with-pcre-regex="${EPREFIX}/usr"
--with-pcre-dir="${EPREFIX}/usr"
--without-pcre-valgrind
--without-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
local one_sapi
local sapi
mkdir -p "${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
cd "${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
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
local sapi
for sapi in ${SAPIS} ; do
if use "${sapi}"; then
cd "${WORKDIR}/sapis-build/$sapi" || \
die "Failed to change dir to ${WORKDIR}/sapis-build/$1"
emake
fi
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${PHP_MV}$(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${PHP_MV}$(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() {
echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
if [[ ! -x "${PHP_BIN}" ]] ; then
ewarn "Test phase requires USE=cli, skipping"
return
else
export TEST_PHP_EXECUTABLE="${PHP_BIN}"
fi
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
REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \
"session.save_path=${T}" \
"${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \
"session.save_path=${T}"
for name in ${EXPECTED_TEST_FAILURES}; do
mv "${name}.out" "${name}.out.orig" 2>/dev/null || die
done
local failed="$(find -name '*.out')"
if [[ ${failed} != "" ]] ; then
ewarn "The following test cases failed unexpectedly:"
for name in ${failed}; do
ewarn " ${name/.out/}"
done
else
einfo "No unexpected test failures, all fine"
fi
if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
local passed=""
for name in ${EXPECTED_TEST_FAILURES}; do
[[ -f "${name}.diff" ]] && continue
passed="${passed} ${name}"
done
if [[ ${passed} != "" ]] ; then
einfo "The following test cases passed unexpectedly:"
for name in ${passed}; do
ewarn " ${passed}"
done
else
einfo "None of the known-to-fail tests passed, all fine"
fi
fi
}
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
}

@ -1,760 +0,0 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="7"
inherit flag-o-matic systemd autotools
MY_PV=${PV/_rc/RC}
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 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
S="${WORKDIR}/${PN}-${MY_PV}"
# 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 argon2 bcmath berkdb bzip2 calendar cdb cjk
coverage +ctype curl debug
enchant exif +fileinfo +filter firebird
+flatfile ftp gd gdbm gmp +hash +iconv imap inifile
intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl lmdb
mhash mssql mysql mysqli nls
oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
readline recode selinux +session session-mm sharedmem
+simplexml snmp soap sockets sodium spell sqlite ssl
sysvipc systemd test tidy +tokenizer tokyocabinet truetype unicode wddx webp
+xml xmlreader xmlwriter xmlrpc xpm xslt zip zip-encryption zlib"
# 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.1[apache2?,fpm?]
>=dev-libs/libpcre2-10.30[unicode]
fpm? ( acl? ( sys-apps/acl ) )
apache2? ( www-servers/apache[apache2_modules_unixd(+),threads=] )
argon2? ( app-crypt/argon2:= )
berkdb? ( || ( sys-libs/db:5.3
sys-libs/db:5.1
sys-libs/db:4.8
sys-libs/db:4.7
sys-libs/db:4.6
sys-libs/db:4.5 ) )
bzip2? ( app-arch/bzip2:0= )
cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
coverage? ( dev-util/lcov )
curl? ( >=net-misc/curl-7.10.5 )
enchant? ( <app-text/enchant-2.0:0 )
firebird? ( dev-db/firebird )
gd? ( >=virtual/jpeg-0-r3:0 media-libs/libpng:0= >=sys-libs/zlib-1.2.0.4 )
gdbm? ( >=sys-libs/gdbm-1.8.0:0= )
gmp? ( dev-libs/gmp:0= )
iconv? ( virtual/libiconv )
imap? ( >=virtual/imap-c-client-2[kerberos=,ssl=] )
intl? ( dev-libs/icu:= )
iodbc? ( dev-db/libiodbc )
kerberos? ( virtual/krb5 )
ldap? ( >=net-nds/openldap-1.2.11 )
ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 )
libedit? ( dev-libs/libedit )
lmdb? ( dev-db/lmdb:= )
mssql? ( dev-db/freetds[mssql] )
nls? ( sys-devel/gettext )
oci8-instant-client? ( dev-db/oracle-instantclient-basic )
odbc? ( >=dev-db/unixODBC-1.8.13 )
postgres? ( dev-db/postgresql:* )
qdbm? ( dev-db/qdbm )
readline? ( sys-libs/readline:0= )
recode? ( app-text/recode )
session-mm? ( dev-libs/mm )
simplexml? ( >=dev-libs/libxml2-2.6.8 )
snmp? ( >=net-analyzer/net-snmp-5.2 )
soap? ( >=dev-libs/libxml2-2.6.8 )
sodium? ( dev-libs/libsodium:= )
spell? ( >=app-text/aspell-0.50 )
sqlite? ( >=dev-db/sqlite-3.7.6.3 )
ssl? (
!libressl? ( >=dev-libs/openssl-1.0.1:0= )
libressl? ( dev-libs/libressl:0= )
)
tidy? ( || ( app-text/tidy-html5 app-text/htmltidy ) )
tokyocabinet? ( dev-db/tokyocabinet )
truetype? ( =media-libs/freetype-2* )
unicode? ( dev-libs/oniguruma:= )
wddx? ( >=dev-libs/libxml2-2.6.8 )
webp? ( media-libs/libwebp:0= )
xml? ( >=dev-libs/libxml2-2.6.8 )
xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
xmlreader? ( >=dev-libs/libxml2-2.6.8 )
xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
xpm? ( x11-libs/libXpm )
xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
zip? ( >=sys-libs/zlib-1.2.0.4:0= )
zip-encryption? ( >=dev-libs/libzip-1.2.0:= )
zlib? ( >=sys-libs/zlib-1.2.0.4:0= )
"
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"
# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
REQUIRED_USE="
|| ( cli cgi fpm apache2 embed phpdbg )
cli? ( ^^ ( readline libedit ) )
truetype? ( gd zlib )
webp? ( gd zlib )
cjk? ( gd zlib )
exif? ( gd zlib )
xpm? ( gd zlib )
gd? ( zlib )
simplexml? ( xml )
soap? ( xml )
wddx? ( xml )
xmlrpc? ( || ( xml iconv ) )
xmlreader? ( xml )
xslt? ( xml )
ldap-sasl? ( ldap )
mhash? ( hash )
phar? ( hash )
qdbm? ( !gdbm )
readline? ( !libedit )
recode? ( !imap !mysqli !mysql )
session-mm? ( session !threads )
mysql? ( || ( mysqli pdo ) )
zip-encryption? ( zip )
"
RESTRICT="!test? ( test )"
PATCHES=(
"${FILESDIR}/php-freetype-2.9.1.patch"
)
PHP_MV="$(ver_cut 1)"
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'
# Bug 669566 - necessary so that build tools are updated for commands like pecl
# Force rebuilding aclocal.m4
rm -f aclocal.m4 || die "failed to remove aclocal.m4 in src_prepare"
eautoreconf
}
src_configure() {
addpredict /usr/share/snmp/mibs/.index #nowarn
addpredict /var/lib/net-snmp/mib_indexes #nowarn
PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
# 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
$(use_enable threads maintainer-zts)
)
our_conf+=(
$(use_with argon2 password-argon2 "${EPREFIX}/usr")
$(use_enable bcmath bcmath)
$(use_with bzip2 bz2 "${EPREFIX}/usr")
$(use_enable calendar calendar)
$(use_enable coverage gcov)
$(use_enable ctype ctype)
$(use_with curl curl "${EPREFIX}/usr")
$(use_enable xml dom)
$(use_with enchant enchant "${EPREFIX}/usr")
$(use_enable exif exif)
$(use_enable fileinfo fileinfo)
$(use_enable filter filter)
$(use_enable ftp ftp)
$(use_with nls gettext "${EPREFIX}/usr")
$(use_with gmp gmp "${EPREFIX}/usr")
$(use_enable hash hash)
$(use_with mhash mhash "${EPREFIX}/usr")
$(use_with iconv iconv \
$(use elibc_glibc || use elibc_musl || use elibc_FreeBSD || echo "${EPREFIX}/usr"))
$(use_enable intl intl)
$(use_enable ipv6 ipv6)
$(use_enable json json)
$(use_with kerberos kerberos "${EPREFIX}/usr")
$(use_enable xml libxml)
$(use_with xml libxml-dir "${EPREFIX}/usr")
$(use_enable unicode mbstring)
$(use_with unicode onig "${EPREFIX}/usr")
$(use_with ssl openssl "${EPREFIX}/usr")
$(use_with ssl openssl-dir "${EPREFIX}/usr")
$(use_enable pcntl pcntl)
$(use_enable phar phar)
$(use_enable pdo pdo)
$(use_enable opcache opcache)
$(use_with postgres pgsql "${EPREFIX}/usr")
$(use_enable posix posix)
$(use_with spell pspell "${EPREFIX}/usr")
$(use_with recode recode "${EPREFIX}/usr")
$(use_enable simplexml simplexml)
$(use_enable sharedmem shmop)
$(use_with snmp snmp "${EPREFIX}/usr")
$(use_enable soap soap)
$(use_enable sockets sockets)
$(use_with sodium sodium "${EPREFIX}/usr")
$(use_with sqlite sqlite3 "${EPREFIX}/usr")
$(use_enable sysvipc sysvmsg)
$(use_enable sysvipc sysvsem)
$(use_enable sysvipc sysvshm)
$(use_with tidy tidy "${EPREFIX}/usr")
$(use_enable tokenizer tokenizer)
$(use_enable wddx wddx)
$(use_enable xml xml)
$(use_enable xmlreader xmlreader)
$(use_enable xmlwriter xmlwriter)
$(use_with xmlrpc xmlrpc)
$(use_with xslt xsl "${EPREFIX}/usr")
$(use_enable zip zip)
$(use_with zip-encryption libzip "${EPREFIX}/usr")
$(use_with zlib zlib "${EPREFIX}/usr")
$(use_enable debug debug)
)
# DBA support
if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
|| use qdbm || use lmdb || use tokyocabinet ; then
our_conf+=( "--enable-dba${shared}" )
fi
# DBA drivers support
our_conf+=(
$(use_with cdb cdb)
$(use_with berkdb db4 "${EPREFIX}/usr")
$(use_enable flatfile flatfile)
$(use_with gdbm gdbm "${EPREFIX}/usr")
$(use_enable inifile inifile)
$(use_with qdbm qdbm "${EPREFIX}/usr")
$(use_with lmdb lmdb "${EPREFIX}/usr")
)
# Support for the GD graphics library
our_conf+=(
$(use_with truetype freetype-dir "${EPREFIX}/usr")
$(use_enable cjk gd-jis-conv)
$(use_with gd jpeg-dir "${EPREFIX}/usr")
$(use_with gd png-dir "${EPREFIX}/usr")
$(use_with xpm xpm-dir "${EPREFIX}/usr")
)
if use webp; then
our_conf+=( --with-webp-dir="${EPREFIX}/usr" )
fi
# enable gd last, so configure can pick up the previous settings
our_conf+=( $(use_with gd gd) )
# IMAP support
if use imap ; then
our_conf+=(
$(use_with imap imap "${EPREFIX}/usr")
$(use_with ssl imap-ssl "${EPREFIX}/usr")
)
fi
# Interbase/firebird support
our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") )
# LDAP support
if use ldap ; then
our_conf+=(
$(use_with ldap ldap "${EPREFIX}/usr")
$(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr")
)
fi
# MySQL support
local mysqllib="mysqlnd"
local mysqlilib="mysqlnd"
our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
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
our_conf+=(
$(use_with odbc unixODBC "${EPREFIX}/usr")
$(use_with iodbc iodbc "${EPREFIX}/usr")
)
# 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 "${mysqllib}")
$(use_with postgres pdo-pgsql)
$(use_with sqlite pdo-sqlite "${EPREFIX}/usr")
$(use_with firebird pdo-firebird "${EPREFIX}/usr")
$(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr")
$(use_with oci8-instant-client pdo-oci)
)
fi
# readline/libedit support
our_conf+=(
$(use_with readline readline "${EPREFIX}/usr")
$(use_with libedit libedit "${EPREFIX}/usr")
)
# Session support
if use session ; then
our_conf+=( $(use_with session-mm mm "${EPREFIX}/usr") )
else
our_conf+=( $(use_enable session 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-pcre-regex affects ext/pcre
# --with-pcre-dir affects ext/filter and ext/zip
# --with-pcre-valgrind cannot be enabled with system pcre
# Many arches don't support pcre-jit
our_conf+=(
--with-pcre-regex="${EPREFIX}/usr"
--with-pcre-dir="${EPREFIX}/usr"
--without-pcre-valgrind
--without-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
local one_sapi
local sapi
mkdir -p "${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
cd "${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
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
local sapi
for sapi in ${SAPIS} ; do
if use "${sapi}"; then
cd "${WORKDIR}/sapis-build/$sapi" || \
die "Failed to change dir to ${WORKDIR}/sapis-build/$1"
emake
fi
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${PHP_MV}$(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${PHP_MV}$(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() {
echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
if [[ ! -x "${PHP_BIN}" ]] ; then
ewarn "Test phase requires USE=cli, skipping"
return
else
export TEST_PHP_EXECUTABLE="${PHP_BIN}"
fi
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
REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \
"session.save_path=${T}" \
"${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \
"session.save_path=${T}"
for name in ${EXPECTED_TEST_FAILURES}; do
mv "${name}.out" "${name}.out.orig" 2>/dev/null || die
done
local failed="$(find -name '*.out')"
if [[ ${failed} != "" ]] ; then
ewarn "The following test cases failed unexpectedly:"
for name in ${failed}; do
ewarn " ${name/.out/}"
done
else
einfo "No unexpected test failures, all fine"
fi
if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
local passed=""
for name in ${EXPECTED_TEST_FAILURES}; do
[[ -f "${name}.diff" ]] && continue
passed="${passed} ${name}"
done
if [[ ${passed} != "" ]] ; then
einfo "The following test cases passed unexpectedly:"
for name in ${passed}; do
ewarn " ${passed}"
done
else
einfo "None of the known-to-fail tests passed, all fine"
fi
fi
}
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
}

@ -1,760 +0,0 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="7"
inherit flag-o-matic systemd autotools
MY_PV=${PV/_rc/RC}
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 ~mips ppc ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
S="${WORKDIR}/${PN}-${MY_PV}"
# 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 argon2 bcmath berkdb bzip2 calendar cdb cjk
coverage +ctype curl debug
enchant exif +fileinfo +filter firebird
+flatfile ftp gd gdbm gmp +hash +iconv imap inifile
intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl lmdb
mhash mssql mysql mysqli nls
oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
readline recode selinux +session session-mm sharedmem
+simplexml snmp soap sockets sodium spell sqlite ssl
sysvipc systemd test tidy +tokenizer tokyocabinet truetype unicode wddx webp
+xml xmlreader xmlwriter xmlrpc xpm xslt zip zip-encryption zlib"
# 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.1[apache2?,fpm?]
>=dev-libs/libpcre2-10.30[unicode]
fpm? ( acl? ( sys-apps/acl ) )
apache2? ( www-servers/apache[apache2_modules_unixd(+),threads=] )
argon2? ( app-crypt/argon2:= )
berkdb? ( || ( sys-libs/db:5.3
sys-libs/db:5.1
sys-libs/db:4.8
sys-libs/db:4.7
sys-libs/db:4.6
sys-libs/db:4.5 ) )
bzip2? ( app-arch/bzip2:0= )
cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
coverage? ( dev-util/lcov )
curl? ( >=net-misc/curl-7.10.5 )
enchant? ( <app-text/enchant-2.0:0 )
firebird? ( dev-db/firebird )
gd? ( >=virtual/jpeg-0-r3:0 media-libs/libpng:0= >=sys-libs/zlib-1.2.0.4 )
gdbm? ( >=sys-libs/gdbm-1.8.0:0= )
gmp? ( dev-libs/gmp:0= )
iconv? ( virtual/libiconv )
imap? ( >=virtual/imap-c-client-2[kerberos=,ssl=] )
intl? ( dev-libs/icu:= )
iodbc? ( dev-db/libiodbc )
kerberos? ( virtual/krb5 )
ldap? ( >=net-nds/openldap-1.2.11 )
ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 )
libedit? ( dev-libs/libedit )
lmdb? ( dev-db/lmdb:= )
mssql? ( dev-db/freetds[mssql] )
nls? ( sys-devel/gettext )
oci8-instant-client? ( dev-db/oracle-instantclient-basic )
odbc? ( >=dev-db/unixODBC-1.8.13 )
postgres? ( dev-db/postgresql:* )
qdbm? ( dev-db/qdbm )
readline? ( sys-libs/readline:0= )
recode? ( app-text/recode )
session-mm? ( dev-libs/mm )
simplexml? ( >=dev-libs/libxml2-2.6.8 )
snmp? ( >=net-analyzer/net-snmp-5.2 )
soap? ( >=dev-libs/libxml2-2.6.8 )
sodium? ( dev-libs/libsodium:= )
spell? ( >=app-text/aspell-0.50 )
sqlite? ( >=dev-db/sqlite-3.7.6.3 )
ssl? (
!libressl? ( >=dev-libs/openssl-1.0.1:0= )
libressl? ( dev-libs/libressl:0= )
)
tidy? ( || ( app-text/tidy-html5 app-text/htmltidy ) )
tokyocabinet? ( dev-db/tokyocabinet )
truetype? ( =media-libs/freetype-2* )
unicode? ( dev-libs/oniguruma:= )
wddx? ( >=dev-libs/libxml2-2.6.8 )
webp? ( media-libs/libwebp:0= )
xml? ( >=dev-libs/libxml2-2.6.8 )
xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
xmlreader? ( >=dev-libs/libxml2-2.6.8 )
xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
xpm? ( x11-libs/libXpm )
xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
zip? ( >=sys-libs/zlib-1.2.0.4:0= )
zip-encryption? ( >=dev-libs/libzip-1.2.0:= )
zlib? ( >=sys-libs/zlib-1.2.0.4:0= )
"
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"
# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
REQUIRED_USE="
|| ( cli cgi fpm apache2 embed phpdbg )
cli? ( ^^ ( readline libedit ) )
truetype? ( gd zlib )
webp? ( gd zlib )
cjk? ( gd zlib )
exif? ( gd zlib )
xpm? ( gd zlib )
gd? ( zlib )
simplexml? ( xml )
soap? ( xml )
wddx? ( xml )
xmlrpc? ( || ( xml iconv ) )
xmlreader? ( xml )
xslt? ( xml )
ldap-sasl? ( ldap )
mhash? ( hash )
phar? ( hash )
qdbm? ( !gdbm )
readline? ( !libedit )
recode? ( !imap !mysqli !mysql )
session-mm? ( session !threads )
mysql? ( || ( mysqli pdo ) )
zip-encryption? ( zip )
"
RESTRICT="!test? ( test )"
PATCHES=(
"${FILESDIR}/php-freetype-2.9.1.patch"
)
PHP_MV="$(ver_cut 1)"
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'
# Bug 669566 - necessary so that build tools are updated for commands like pecl
# Force rebuilding aclocal.m4
rm -f aclocal.m4 || die "failed to remove aclocal.m4 in src_prepare"
eautoreconf
}
src_configure() {
addpredict /usr/share/snmp/mibs/.index #nowarn
addpredict /var/lib/net-snmp/mib_indexes #nowarn
PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
# 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
$(use_enable threads maintainer-zts)
)
our_conf+=(
$(use_with argon2 password-argon2 "${EPREFIX}/usr")
$(use_enable bcmath bcmath)
$(use_with bzip2 bz2 "${EPREFIX}/usr")
$(use_enable calendar calendar)
$(use_enable coverage gcov)
$(use_enable ctype ctype)
$(use_with curl curl "${EPREFIX}/usr")
$(use_enable xml dom)
$(use_with enchant enchant "${EPREFIX}/usr")
$(use_enable exif exif)
$(use_enable fileinfo fileinfo)
$(use_enable filter filter)
$(use_enable ftp ftp)
$(use_with nls gettext "${EPREFIX}/usr")
$(use_with gmp gmp "${EPREFIX}/usr")
$(use_enable hash hash)
$(use_with mhash mhash "${EPREFIX}/usr")
$(use_with iconv iconv \
$(use elibc_glibc || use elibc_musl || use elibc_FreeBSD || echo "${EPREFIX}/usr"))
$(use_enable intl intl)
$(use_enable ipv6 ipv6)
$(use_enable json json)
$(use_with kerberos kerberos "${EPREFIX}/usr")
$(use_enable xml libxml)
$(use_with xml libxml-dir "${EPREFIX}/usr")
$(use_enable unicode mbstring)
$(use_with unicode onig "${EPREFIX}/usr")
$(use_with ssl openssl "${EPREFIX}/usr")
$(use_with ssl openssl-dir "${EPREFIX}/usr")
$(use_enable pcntl pcntl)
$(use_enable phar phar)
$(use_enable pdo pdo)
$(use_enable opcache opcache)
$(use_with postgres pgsql "${EPREFIX}/usr")
$(use_enable posix posix)
$(use_with spell pspell "${EPREFIX}/usr")
$(use_with recode recode "${EPREFIX}/usr")
$(use_enable simplexml simplexml)
$(use_enable sharedmem shmop)
$(use_with snmp snmp "${EPREFIX}/usr")
$(use_enable soap soap)
$(use_enable sockets sockets)
$(use_with sodium sodium "${EPREFIX}/usr")
$(use_with sqlite sqlite3 "${EPREFIX}/usr")
$(use_enable sysvipc sysvmsg)
$(use_enable sysvipc sysvsem)
$(use_enable sysvipc sysvshm)
$(use_with tidy tidy "${EPREFIX}/usr")
$(use_enable tokenizer tokenizer)
$(use_enable wddx wddx)
$(use_enable xml xml)
$(use_enable xmlreader xmlreader)
$(use_enable xmlwriter xmlwriter)
$(use_with xmlrpc xmlrpc)
$(use_with xslt xsl "${EPREFIX}/usr")
$(use_enable zip zip)
$(use_with zip-encryption libzip "${EPREFIX}/usr")
$(use_with zlib zlib "${EPREFIX}/usr")
$(use_enable debug debug)
)
# DBA support
if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
|| use qdbm || use lmdb || use tokyocabinet ; then
our_conf+=( "--enable-dba${shared}" )
fi
# DBA drivers support
our_conf+=(
$(use_with cdb cdb)
$(use_with berkdb db4 "${EPREFIX}/usr")
$(use_enable flatfile flatfile)
$(use_with gdbm gdbm "${EPREFIX}/usr")
$(use_enable inifile inifile)
$(use_with qdbm qdbm "${EPREFIX}/usr")
$(use_with lmdb lmdb "${EPREFIX}/usr")
)
# Support for the GD graphics library
our_conf+=(
$(use_with truetype freetype-dir "${EPREFIX}/usr")
$(use_enable cjk gd-jis-conv)
$(use_with gd jpeg-dir "${EPREFIX}/usr")
$(use_with gd png-dir "${EPREFIX}/usr")
$(use_with xpm xpm-dir "${EPREFIX}/usr")
)
if use webp; then
our_conf+=( --with-webp-dir="${EPREFIX}/usr" )
fi
# enable gd last, so configure can pick up the previous settings
our_conf+=( $(use_with gd gd) )
# IMAP support
if use imap ; then
our_conf+=(
$(use_with imap imap "${EPREFIX}/usr")
$(use_with ssl imap-ssl "${EPREFIX}/usr")
)
fi
# Interbase/firebird support
our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") )
# LDAP support
if use ldap ; then
our_conf+=(
$(use_with ldap ldap "${EPREFIX}/usr")
$(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr")
)
fi
# MySQL support
local mysqllib="mysqlnd"
local mysqlilib="mysqlnd"
our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
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
our_conf+=(
$(use_with odbc unixODBC "${EPREFIX}/usr")
$(use_with iodbc iodbc "${EPREFIX}/usr")
)
# 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 "${mysqllib}")
$(use_with postgres pdo-pgsql)
$(use_with sqlite pdo-sqlite "${EPREFIX}/usr")
$(use_with firebird pdo-firebird "${EPREFIX}/usr")
$(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr")
$(use_with oci8-instant-client pdo-oci)
)
fi
# readline/libedit support
our_conf+=(
$(use_with readline readline "${EPREFIX}/usr")
$(use_with libedit libedit "${EPREFIX}/usr")
)
# Session support
if use session ; then
our_conf+=( $(use_with session-mm mm "${EPREFIX}/usr") )
else
our_conf+=( $(use_enable session 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-pcre-regex affects ext/pcre
# --with-pcre-dir affects ext/filter and ext/zip
# --with-pcre-valgrind cannot be enabled with system pcre
# Many arches don't support pcre-jit
our_conf+=(
--with-pcre-regex="${EPREFIX}/usr"
--with-pcre-dir="${EPREFIX}/usr"
--without-pcre-valgrind
--without-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
local one_sapi
local sapi
mkdir -p "${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
cd "${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
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
local sapi
for sapi in ${SAPIS} ; do
if use "${sapi}"; then
cd "${WORKDIR}/sapis-build/$sapi" || \
die "Failed to change dir to ${WORKDIR}/sapis-build/$1"
emake
fi
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${PHP_MV}$(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${PHP_MV}$(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() {
echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
if [[ ! -x "${PHP_BIN}" ]] ; then
ewarn "Test phase requires USE=cli, skipping"
return
else
export TEST_PHP_EXECUTABLE="${PHP_BIN}"
fi
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
REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \
"session.save_path=${T}" \
"${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \
"session.save_path=${T}"
for name in ${EXPECTED_TEST_FAILURES}; do
mv "${name}.out" "${name}.out.orig" 2>/dev/null || die
done
local failed="$(find -name '*.out')"
if [[ ${failed} != "" ]] ; then
ewarn "The following test cases failed unexpectedly:"
for name in ${failed}; do
ewarn " ${name/.out/}"
done
else
einfo "No unexpected test failures, all fine"
fi
if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
local passed=""
for name in ${EXPECTED_TEST_FAILURES}; do
[[ -f "${name}.diff" ]] && continue
passed="${passed} ${name}"
done
if [[ ${passed} != "" ]] ; then
einfo "The following test cases passed unexpectedly:"
for name in ${passed}; do
ewarn " ${passed}"
done
else
einfo "None of the known-to-fail tests passed, all fine"
fi
fi
}
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
}

@ -19,7 +19,7 @@ LICENSE="PHP-3.01
unicode? ( BSD-2 LGPL-2.1 )"
SLOT="$(ver_cut 1-2)"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ~ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
S="${WORKDIR}/${PN}-${MY_PV}"

@ -1,750 +0,0 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="7"
WANT_AUTOMAKE="none"
inherit flag-o-matic systemd autotools
MY_PV=${PV/_rc/RC}
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 ~mips ppc ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
S="${WORKDIR}/${PN}-${MY_PV}"
# 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 argon2 bcmath berkdb bzip2 calendar cdb cjk
coverage +ctype curl debug
enchant exif ffi +fileinfo +filter firebird
+flatfile ftp gd gdbm gmp +iconv imap inifile
intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl 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 webp
+xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib"
# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
REQUIRED_USE="
|| ( cli cgi fpm apache2 embed phpdbg )
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 )
xmlrpc? ( xml iconv )
xmlreader? ( xml )
xmlwriter? ( xml )
xslt? ( xml )
ldap-sasl? ( ldap )
qdbm? ( !gdbm )
session-mm? ( session !threads )
mysql? ( || ( mysqli pdo ) )
firebird? ( pdo )
mssql? ( pdo )
"
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.1[apache2?,fpm?]
>=dev-libs/libpcre2-10.30[unicode]
fpm? ( acl? ( sys-apps/acl ) )
apache2? ( www-servers/apache[apache2_modules_unixd(+),threads=] )
argon2? ( app-crypt/argon2:= )
berkdb? ( || ( sys-libs/db:5.3
sys-libs/db:5.1
sys-libs/db:4.8
sys-libs/db:4.7
sys-libs/db:4.6
sys-libs/db:4.5 ) )
bzip2? ( app-arch/bzip2:0= )
cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
coverage? ( dev-util/lcov )
curl? ( >=net-misc/curl-7.10.5 )
enchant? ( <app-text/enchant-2.0:0 )
ffi? ( >=dev-libs/libffi-3.0.11 )
firebird? ( dev-db/firebird )
gd? ( >=virtual/jpeg-0-r3:0 media-libs/libpng:0= )
gdbm? ( >=sys-libs/gdbm-1.8.0:0= )
gmp? ( dev-libs/gmp:0= )
iconv? ( virtual/libiconv )
imap? ( >=virtual/imap-c-client-2[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-basic )
odbc? ( iodbc? ( dev-db/libiodbc ) !iodbc? ( >=dev-db/unixODBC-1.8.13 ) )
postgres? ( dev-db/postgresql:* )
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:= )
spell? ( >=app-text/aspell-0.50 )
sqlite? ( >=dev-db/sqlite-3.7.6.3 )
ssl? (
!libressl? ( >=dev-libs/openssl-1.0.1:0= )
libressl? ( dev-libs/libressl:0= )
)
tidy? ( || ( app-text/tidy-html5 app-text/htmltidy ) )
tokyocabinet? ( dev-db/tokyocabinet )
truetype? ( =media-libs/freetype-2* )
unicode? ( dev-libs/oniguruma:= )
webp? ( media-libs/libwebp:0= )
xml? ( >=dev-libs/libxml2-2.7.6 )
xpm? ( x11-libs/libXpm )
xslt? ( dev-libs/libxslt )
zip? ( >=dev-libs/libzip-1.2.0:= )
zlib? ( >=sys-libs/zlib-1.2.0.4:0= )
"
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" )
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
}
src_configure() {
addpredict /usr/share/snmp/mibs/.index #nowarn
addpredict /var/lib/net-snmp/mib_indexes #nowarn
PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
# 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
$(use_enable threads maintainer-zts)
)
our_conf+=(
$(use_with argon2 password-argon2 "${EPREFIX}/usr")
$(use_enable bcmath)
$(use_with bzip2 bz2 "${EPREFIX}/usr")
$(use_enable calendar)
$(use_enable coverage gcov)
$(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 || use elibc_FreeBSD || echo "${EPREFIX}/usr"))
$(use_enable intl)
$(use_enable ipv6)
$(use_enable json)
$(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 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 xmlrpc)
$(use_with xslt xsl)
$(use_with zip)
$(use_with zlib zlib "${EPREFIX}/usr")
$(use_enable debug)
)
# 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
local mysqllib="mysqlnd"
local mysqlilib="mysqlnd"
our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
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 "${mysqllib}")
$(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
# Many arches don't support pcre-jit
our_conf+=(
--with-external-pcre
--without-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
local one_sapi
local sapi
mkdir -p "${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
cd "${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
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
local sapi
for sapi in ${SAPIS} ; do
if use "${sapi}"; then
cd "${WORKDIR}/sapis-build/$sapi" || \
die "Failed to change dir to ${WORKDIR}/sapis-build/$1"
emake
fi
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${PHP_MV}$(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${PHP_MV}$(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() {
echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
if [[ ! -x "${PHP_BIN}" ]] ; then
ewarn "Test phase requires USE=cli, skipping"
return
else
export TEST_PHP_EXECUTABLE="${PHP_BIN}"
fi
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
REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \
"session.save_path=${T}" \
"${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \
"session.save_path=${T}"
for name in ${EXPECTED_TEST_FAILURES}; do
mv "${name}.out" "${name}.out.orig" 2>/dev/null || die
done
local failed="$(find -name '*.out')"
if [[ ${failed} != "" ]] ; then
ewarn "The following test cases failed unexpectedly:"
for name in ${failed}; do
ewarn " ${name/.out/}"
done
else
einfo "No unexpected test failures, all fine"
fi
if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
local passed=""
for name in ${EXPECTED_TEST_FAILURES}; do
[[ -f "${name}.diff" ]] && continue
passed="${passed} ${name}"
done
if [[ ${passed} != "" ]] ; then
einfo "The following test cases passed unexpectedly:"
for name in ${passed}; do
ewarn " ${passed}"
done
else
einfo "None of the known-to-fail tests passed, all fine"
fi
fi
}
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
}

@ -1,750 +0,0 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="7"
WANT_AUTOMAKE="none"
inherit flag-o-matic systemd autotools
MY_PV=${PV/_rc/RC}
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 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
S="${WORKDIR}/${PN}-${MY_PV}"
# 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 argon2 bcmath berkdb bzip2 calendar cdb cjk
coverage +ctype curl debug
enchant exif ffi +fileinfo +filter firebird
+flatfile ftp gd gdbm gmp +iconv imap inifile
intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl 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 webp
+xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib"
# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
REQUIRED_USE="
|| ( cli cgi fpm apache2 embed phpdbg )
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 )
xmlrpc? ( xml iconv )
xmlreader? ( xml )
xmlwriter? ( xml )
xslt? ( xml )
ldap-sasl? ( ldap )
qdbm? ( !gdbm )
session-mm? ( session !threads )
mysql? ( || ( mysqli pdo ) )
firebird? ( pdo )
mssql? ( pdo )
"
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.1[apache2?,fpm?]
>=dev-libs/libpcre2-10.30[unicode]
fpm? ( acl? ( sys-apps/acl ) )
apache2? ( www-servers/apache[apache2_modules_unixd(+),threads=] )
argon2? ( app-crypt/argon2:= )
berkdb? ( || ( sys-libs/db:5.3
sys-libs/db:5.1
sys-libs/db:4.8
sys-libs/db:4.7
sys-libs/db:4.6
sys-libs/db:4.5 ) )
bzip2? ( app-arch/bzip2:0= )
cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
coverage? ( dev-util/lcov )
curl? ( >=net-misc/curl-7.10.5 )
enchant? ( <app-text/enchant-2.0:0 )
ffi? ( >=dev-libs/libffi-3.0.11 )
firebird? ( dev-db/firebird )
gd? ( >=virtual/jpeg-0-r3:0 media-libs/libpng:0= )
gdbm? ( >=sys-libs/gdbm-1.8.0:0= )
gmp? ( dev-libs/gmp:0= )
iconv? ( virtual/libiconv )
imap? ( >=virtual/imap-c-client-2[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-basic )
odbc? ( iodbc? ( dev-db/libiodbc ) !iodbc? ( >=dev-db/unixODBC-1.8.13 ) )
postgres? ( dev-db/postgresql:* )
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:= )
spell? ( >=app-text/aspell-0.50 )
sqlite? ( >=dev-db/sqlite-3.7.6.3 )
ssl? (
!libressl? ( >=dev-libs/openssl-1.0.1:0= )
libressl? ( dev-libs/libressl:0= )
)
tidy? ( || ( app-text/tidy-html5 app-text/htmltidy ) )
tokyocabinet? ( dev-db/tokyocabinet )
truetype? ( =media-libs/freetype-2* )
unicode? ( dev-libs/oniguruma:= )
webp? ( media-libs/libwebp:0= )
xml? ( >=dev-libs/libxml2-2.7.6 )
xpm? ( x11-libs/libXpm )
xslt? ( dev-libs/libxslt )
zip? ( >=dev-libs/libzip-1.2.0:= )
zlib? ( >=sys-libs/zlib-1.2.0.4:0= )
"
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" )
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
}
src_configure() {
addpredict /usr/share/snmp/mibs/.index #nowarn
addpredict /var/lib/net-snmp/mib_indexes #nowarn
PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
# 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
$(use_enable threads maintainer-zts)
)
our_conf+=(
$(use_with argon2 password-argon2 "${EPREFIX}/usr")
$(use_enable bcmath)
$(use_with bzip2 bz2 "${EPREFIX}/usr")
$(use_enable calendar)
$(use_enable coverage gcov)
$(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 || use elibc_FreeBSD || echo "${EPREFIX}/usr"))
$(use_enable intl)
$(use_enable ipv6)
$(use_enable json)
$(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 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 xmlrpc)
$(use_with xslt xsl)
$(use_with zip)
$(use_with zlib zlib "${EPREFIX}/usr")
$(use_enable debug)
)
# 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
local mysqllib="mysqlnd"
local mysqlilib="mysqlnd"
our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
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 "${mysqllib}")
$(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
# Many arches don't support pcre-jit
our_conf+=(
--with-external-pcre
--without-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
local one_sapi
local sapi
mkdir -p "${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
cd "${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
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
local sapi
for sapi in ${SAPIS} ; do
if use "${sapi}"; then
cd "${WORKDIR}/sapis-build/$sapi" || \
die "Failed to change dir to ${WORKDIR}/sapis-build/$1"
emake
fi
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${PHP_MV}$(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${PHP_MV}$(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() {
echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
if [[ ! -x "${PHP_BIN}" ]] ; then
ewarn "Test phase requires USE=cli, skipping"
return
else
export TEST_PHP_EXECUTABLE="${PHP_BIN}"
fi
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
REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \
"session.save_path=${T}" \
"${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \
"session.save_path=${T}"
for name in ${EXPECTED_TEST_FAILURES}; do
mv "${name}.out" "${name}.out.orig" 2>/dev/null || die
done
local failed="$(find -name '*.out')"
if [[ ${failed} != "" ]] ; then
ewarn "The following test cases failed unexpectedly:"
for name in ${failed}; do
ewarn " ${name/.out/}"
done
else
einfo "No unexpected test failures, all fine"
fi
if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
local passed=""
for name in ${EXPECTED_TEST_FAILURES}; do
[[ -f "${name}.diff" ]] && continue
passed="${passed} ${name}"
done
if [[ ${passed} != "" ]] ; then
einfo "The following test cases passed unexpectedly:"
for name in ${passed}; do
ewarn " ${passed}"
done
else
einfo "None of the known-to-fail tests passed, all fine"
fi
fi
}
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
}

@ -1,750 +0,0 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="7"
WANT_AUTOMAKE="none"
inherit flag-o-matic systemd autotools
MY_PV=${PV/_rc/RC}
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 ~mips ppc ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
S="${WORKDIR}/${PN}-${MY_PV}"
# 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 argon2 bcmath berkdb bzip2 calendar cdb cjk
coverage +ctype curl debug
enchant exif ffi +fileinfo +filter firebird
+flatfile ftp gd gdbm gmp +iconv imap inifile
intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl 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 webp
+xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib"
# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
REQUIRED_USE="
|| ( cli cgi fpm apache2 embed phpdbg )
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 )
xmlrpc? ( xml iconv )
xmlreader? ( xml )
xmlwriter? ( xml )
xslt? ( xml )
ldap-sasl? ( ldap )
qdbm? ( !gdbm )
session-mm? ( session !threads )
mysql? ( || ( mysqli pdo ) )
firebird? ( pdo )
mssql? ( pdo )
"
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.1[apache2?,fpm?]
>=dev-libs/libpcre2-10.30[unicode]
fpm? ( acl? ( sys-apps/acl ) )
apache2? ( www-servers/apache[apache2_modules_unixd(+),threads=] )
argon2? ( app-crypt/argon2:= )
berkdb? ( || ( sys-libs/db:5.3
sys-libs/db:5.1
sys-libs/db:4.8
sys-libs/db:4.7
sys-libs/db:4.6
sys-libs/db:4.5 ) )
bzip2? ( app-arch/bzip2:0= )
cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
coverage? ( dev-util/lcov )
curl? ( >=net-misc/curl-7.10.5 )
enchant? ( <app-text/enchant-2.0:0 )
ffi? ( >=dev-libs/libffi-3.0.11 )
firebird? ( dev-db/firebird )
gd? ( >=virtual/jpeg-0-r3:0 media-libs/libpng:0= )
gdbm? ( >=sys-libs/gdbm-1.8.0:0= )
gmp? ( dev-libs/gmp:0= )
iconv? ( virtual/libiconv )
imap? ( >=virtual/imap-c-client-2[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-basic )
odbc? ( iodbc? ( dev-db/libiodbc ) !iodbc? ( >=dev-db/unixODBC-1.8.13 ) )
postgres? ( dev-db/postgresql:* )
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:= )
spell? ( >=app-text/aspell-0.50 )
sqlite? ( >=dev-db/sqlite-3.7.6.3 )
ssl? (
!libressl? ( >=dev-libs/openssl-1.0.1:0= )
libressl? ( dev-libs/libressl:0= )
)
tidy? ( || ( app-text/tidy-html5 app-text/htmltidy ) )
tokyocabinet? ( dev-db/tokyocabinet )
truetype? ( =media-libs/freetype-2* )
unicode? ( dev-libs/oniguruma:= )
webp? ( media-libs/libwebp:0= )
xml? ( >=dev-libs/libxml2-2.7.6 )
xpm? ( x11-libs/libXpm )
xslt? ( dev-libs/libxslt )
zip? ( >=dev-libs/libzip-1.2.0:= )
zlib? ( >=sys-libs/zlib-1.2.0.4:0= )
"
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" )
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
}
src_configure() {
addpredict /usr/share/snmp/mibs/.index #nowarn
addpredict /var/lib/net-snmp/mib_indexes #nowarn
PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
# 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
$(use_enable threads maintainer-zts)
)
our_conf+=(
$(use_with argon2 password-argon2 "${EPREFIX}/usr")
$(use_enable bcmath)
$(use_with bzip2 bz2 "${EPREFIX}/usr")
$(use_enable calendar)
$(use_enable coverage gcov)
$(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 || use elibc_FreeBSD || echo "${EPREFIX}/usr"))
$(use_enable intl)
$(use_enable ipv6)
$(use_enable json)
$(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 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 xmlrpc)
$(use_with xslt xsl)
$(use_with zip)
$(use_with zlib zlib "${EPREFIX}/usr")
$(use_enable debug)
)
# 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
local mysqllib="mysqlnd"
local mysqlilib="mysqlnd"
our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
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 "${mysqllib}")
$(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
# Many arches don't support pcre-jit
our_conf+=(
--with-external-pcre
--without-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
local one_sapi
local sapi
mkdir -p "${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
cd "${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
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
local sapi
for sapi in ${SAPIS} ; do
if use "${sapi}"; then
cd "${WORKDIR}/sapis-build/$sapi" || \
die "Failed to change dir to ${WORKDIR}/sapis-build/$1"
emake
fi
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${PHP_MV}$(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${PHP_MV}$(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() {
echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
if [[ ! -x "${PHP_BIN}" ]] ; then
ewarn "Test phase requires USE=cli, skipping"
return
else
export TEST_PHP_EXECUTABLE="${PHP_BIN}"
fi
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
REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \
"session.save_path=${T}" \
"${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \
"session.save_path=${T}"
for name in ${EXPECTED_TEST_FAILURES}; do
mv "${name}.out" "${name}.out.orig" 2>/dev/null || die
done
local failed="$(find -name '*.out')"
if [[ ${failed} != "" ]] ; then
ewarn "The following test cases failed unexpectedly:"
for name in ${failed}; do
ewarn " ${name/.out/}"
done
else
einfo "No unexpected test failures, all fine"
fi
if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
local passed=""
for name in ${EXPECTED_TEST_FAILURES}; do
[[ -f "${name}.diff" ]] && continue
passed="${passed} ${name}"
done
if [[ ${passed} != "" ]] ; then
einfo "The following test cases passed unexpectedly:"
for name in ${passed}; do
ewarn " ${passed}"
done
else
einfo "None of the known-to-fail tests passed, all fine"
fi
fi
}
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
}

@ -21,7 +21,7 @@ LICENSE="PHP-3.01
unicode? ( BSD-2 LGPL-2.1 )"
SLOT="$(ver_cut 1-2)"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ~ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
S="${WORKDIR}/${PN}-${MY_PV}"

@ -11,7 +11,7 @@ SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
LICENSE="GPL-3+ BSD BSD-2"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~x64-solaris ~x86-solaris"
KEYWORDS="~alpha ~amd64 arm arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~x64-solaris ~x86-solaris"
IUSE="ccache doc pcre"
RESTRICT="test"

Binary file not shown.

@ -16,7 +16,7 @@ SRC_URI="mirror://sourceforge/project/polyclipping/${MY_P}.zip -> ${P}.zip"
LICENSE="Boost-1.0"
SLOT="0"
KEYWORDS="~amd64"
KEYWORDS="~amd64 ~x86"
IUSE=""

@ -14,7 +14,7 @@ SRC_URI="https://github.com/cyrusimap/${PN}/releases/download/${P}/${P}.tar.gz"
LICENSE="BSD-with-attribution"
SLOT="2"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ~ppc64 s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
IUSE="authdaemond berkdb gdbm kerberos ldapdb libressl openldap mysql pam postgres sample selinux sqlite srp ssl static-libs urandom"
CDEPEND="

@ -11,7 +11,7 @@ SRC_URI="https://github.com/ndevilla/iniparser/archive/v${PV}.tar.gz -> ${P}.tar
LICENSE="MIT"
SLOT="4"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc x86 ~ppc-aix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
KEYWORDS="~alpha ~amd64 arm arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 sparc x86 ~ppc-aix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
IUSE="doc examples"
BDEPEND="doc? ( app-doc/doxygen )"

@ -11,7 +11,7 @@ SRC_URI="https://www.digip.org/jansson/releases/${P}.tar.gz"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
IUSE="doc static-libs"
# dev-libs/jansson-2.13.1[doc]: fails to build with >=sphinx-3.0, #731668

@ -11,7 +11,7 @@ SRC_URI="https://github.com/jemalloc/jemalloc/releases/download/${PV}/${P}.tar.b
LICENSE="BSD"
SLOT="0/2"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ppc ppc64 s390 x86 ~amd64-linux ~x86-linux ~x64-macos ~x64-solaris"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ppc ppc64 ~riscv s390 x86 ~amd64-linux ~x86-linux ~x64-macos ~x64-solaris"
IUSE="debug hardened lazy-lock prof static-libs stats xmalloc"
HTML_DOCS=( doc/jemalloc.html )
PATCHES=( "${FILESDIR}/${PN}-5.2.0-gentoo-fixups.patch" )

@ -12,7 +12,7 @@ SRC_URI="mirror://gnupg/${PN}/${P}.tar.bz2
LICENSE="GPL-2 LGPL-2.1"
SLOT="0"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv s390 sparc x86 ~ppc-aix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ~ppc64 ~riscv s390 sparc x86 ~ppc-aix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
IUSE="common-lisp nls static-libs"
RDEPEND="nls? ( >=virtual/libintl-0-r1[${MULTILIB_USEDEP}] )"

@ -25,7 +25,7 @@ fi
LICENSE="BSD"
SLOT="0"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv s390 sparc x86 ~ppc-aix ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~m68k ~mips ppc ~ppc64 ~riscv s390 sparc x86 ~ppc-aix ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
IUSE="bzip2 +jit libedit pcre16 pcre32 +readline +recursion-limit static-libs unicode zlib"
REQUIRED_USE="?? ( libedit readline )"

@ -0,0 +1,180 @@
https://github.com/rsyslog/librelp/issues/206
--- /dev/null
+++ b/tests/tls-certs/certchain.pem
@@ -0,0 +1,60 @@
+-----BEGIN CERTIFICATE-----
+MIIFVzCCA7+gAwIBAgIIWxfNMhQmuncwDQYJKoZIhvcNAQELBQAwgYsxEzARBgNV
+BAMTCnJzeXNsb2cgY2ExEDAOBgNVBAsTB0FkaXNjb24xFTATBgNVBAoTDEFkaXNj
+b24gR21iSDEYMBYGA1UEBxMPR3Jvc3NyaW5kZXJmZWxkMQswCQYDVQQIEwJCVzEL
+MAkGA1UEBhMCREUxFzAVBgoJkiaJk/IsZAEZFgdyc3lzbG9nMCAXDTE4MDYwNjEy
+MDE1NVoYDzIxMTgwNTEzMTIwMjAxWjCBmDEXMBUGA1UEAxMOcnN5c2xvZy1jbGll
+bnQxFTATBgNVBAsTDEFkaXNjb24gR21iSDEVMBMGA1UEChMMQWRpc2NvbiBHbWJI
+MRgwFgYDVQQHEw9Hcm9zc3JpbmRlcmZlbGQxCzAJBgNVBAgTAkJXMQswCQYDVQQG
+EwJERTEbMBkGCgmSJomT8ixkARkWC3JzeXNsb2cuY29tMIIBojANBgkqhkiG9w0B
+AQEFAAOCAY8AMIIBigKCAYEA8nNWVoZwi7fYKSYxm+lidTbMQEHh9pLXV8P1N2FD
+wqhNc6Z71VqQw6gIDyzxBjZf3ldyPb6xAcxikvk2XCxVGqDaP7E1rfnCDSqxcgLG
+r1/TlRH3fFMFPqzMgs0GbDoKi7WuhcNMH1yIRk4uPVSUY3IclcE9sNvMpNVY77c9
+tYeLyoLgG8A2ljlSjbHXDmR8E1C+WcOvjFKQunpv29zIOvfp3Wuw0g3C6E26RyvY
+OnNNq6bmDHXdyIkxYNPwxyfBDGq/WhnrFqQTyEqulVLVVIpK+3fIdtmH/4OpOwxz
+KM0q2k9CzL+AI1JqlFoePeIKYQYAOssUBwB0VBDbhyo8f7txBs6OB1phPcmbkAo2
+bJfL01UT315omqlGWjvvDRjDEeRAfXnWu/UVLIs1MNn09l2+fKwgZyOZIQEk5gGg
+b+xO7pZp5W1IuLxB1DMatQjYK1L1MG8KUebovTyumAj8kOaCJaqa+EWcPvsH2wJb
+zp7JZV7xAMnNQGLHHccY9Iv9AgMBAAGjga0wgaowDAYDVR0TAQH/BAIwADAnBgNV
+HSUEIDAeBggrBgEFBQcDAgYIKwYBBQUHAwEGCCsGAQUFBwMRMCAGA1UdEQQZMBeC
+FXRlc3RiZW5jaC5yc3lzbG9nLmNvbTAPBgNVHQ8BAf8EBQMDB6AAMB0GA1UdDgQW
+BBTFQ9rF9eWMeqNtrDMOGb1fZ54EYTAfBgNVHSMEGDAWgBQMETadsJwFRGSslyZA
+wChTI52OmjANBgkqhkiG9w0BAQsFAAOCAYEAG9hahjpm74U85pP7/zngEJ5P5nnM
+3aC8u4lDM7kodtnxJWoisbv/EBr6SihpDtfWA6+bAJGGu+4UBUaMyUg8w/FjylHc
+INtljbalRuu7YguL2uLdlDNCxQa1XkWugYMObR6r6OvTPUwK0QakTsZuibRbWBDz
+lWKOoM7ZSxZi9DaeChe3yNSGxJSC9xHZbYYBOP5RjChXTZTKtYZemF2wx6EtWRtc
+vXK3TbnJtDy7SPm60EoFnLXUyywmo5mCUSlx85HinS1DzYo7I1yksWQgdW4XgWId
+9RgwPtP0iZSjrZ1TwKqcvo5jvn96LNCoob+JyhpL+9mFvPc6C3vLOxyG7JZOb7Dn
+IpJf52KeBnLRUoIpp+x1XYptoy1ti7r8YqPYn5EHmPxCDVoujskRSX7ncP3SV1qY
+eEgr94Tw/l8GyiaGyixVl2pAMbzYJtgrzQ9UvZurhSPjApGlm87X5KHHXN/CJTY5
+8t59+qvjESRJk74JNpm1L6X/N7HpAsqcsYjP
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIE9jCCA16gAwIBAgIIWxfM+RyuD1EwDQYJKoZIhvcNAQELBQAwgYsxEzARBgNV
+BAMTCnJzeXNsb2cgY2ExEDAOBgNVBAsTB0FkaXNjb24xFTATBgNVBAoTDEFkaXNj
+b24gR21iSDEYMBYGA1UEBxMPR3Jvc3NyaW5kZXJmZWxkMQswCQYDVQQIEwJCVzEL
+MAkGA1UEBhMCREUxFzAVBgoJkiaJk/IsZAEZFgdyc3lzbG9nMCAXDTE4MDYwNjEy
+MDA1OFoYDzIxMTgwNTEzMTIwMTA1WjCBizETMBEGA1UEAxMKcnN5c2xvZyBjYTEQ
+MA4GA1UECxMHQWRpc2NvbjEVMBMGA1UEChMMQWRpc2NvbiBHbWJIMRgwFgYDVQQH
+Ew9Hcm9zc3JpbmRlcmZlbGQxCzAJBgNVBAgTAkJXMQswCQYDVQQGEwJERTEXMBUG
+CgmSJomT8ixkARkWB3JzeXNsb2cwggGiMA0GCSqGSIb3DQEBAQUAA4IBjwAwggGK
+AoIBgQDHA1CeNI30en7OKGJ/pWyNSH9rnw8z6egDxdTjtOIichA2/LVPaGZYecI0
+GH/UtkRgM69kFuo6dRaWvr0yp+XPfGlAcFcPg6cYKEoYyb18HsTReyuAcdBcYQYg
+2ZdmAqtqeHAqcb7wSEB8XuXLdD2Flsco3GaT3zFNv7t7QFDW1b2tT/92w+QGtI1T
+r5LCMVbISRGSQzhCv29l3UtWt4SKA9W8yhg5zMJkMExaUJVtViRFlAFzKrUVKFqZ
+8sszy2yXIcTLskJJc5if8o5cpWCrbcXSb5TsHA+4FHOB6ou0z7/s3LwYjof056Zy
+ixj0LM4sTYIEttDuLERRvYTIhtLhlA2BWfAfuW9bGuog0C9xGpt99vniHJlKmMms
+qz5hEDLYziUEfj5qzSxKMcA2VCeO1DgajSedh13VN/sWUyk5aKA71i40Cnp4oK/u
+zeYW7vWl/ttCEFc6x8pzeMdoBjv1Jd9hC0Z2UgttC/KnMTKX3y6NR1PVFjDQ3MIA
+7Bhxj50CAwEAAaNaMFgwDwYDVR0TAQH/BAUwAwEB/zAVBgNVHREEDjAMggpyc3lz
+bG9nIGNhMA8GA1UdDwEB/wQFAwMHBAAwHQYDVR0OBBYEFAwRNp2wnAVEZKyXJkDA
+KFMjnY6aMA0GCSqGSIb3DQEBCwUAA4IBgQCOv2kyg8vZ3jncZuZ4i2k0QbXztZoO
+jMDNqFX2935lK6WrVZ6u1InZzsaqrXXOJions3EvmmAqrdTBW6dyw6V2/lic1gGz
+MhlafAPe0DyQCaXp9iFCH91Hzo94YhuPbne1qdga9jrVTiQIHdIKqVtbiUv7i7mN
+43GssOm4a1guf+Qs5rkuHG4YwiJZhjzhmixfXCerHXykJkpSvBUb6EeKA+p5/w+I
+Wjm9sAkJgqcvrNvOwwBZInU1I56zmM0ZwWucSydf0hgOImpgO5F6KGVQRoZsO9IA
+Iju2RQ1y9qVTNp8evVjIMuqXh5ZtU9ti/buZrjr5Zb601jFLZCMrpDVUcVyHUfOB
+rb3nkUFDcFcrKlfovwp/fvlISKM0bp6pFas5X0FXg3sVVI+iIokmHsmqRUHhjdLX
+t27+/TYpyEkjF1cH3acd7MOcw33KxE/4+qUHT2QU9COPkGu7oPS24qDYnmGPLkev
+ZSmpz4jLTmbCBSRcoOB0Q4K36WnegzVtvd8=
+-----END CERTIFICATE-----
--- /dev/null
+++ b/tests/tls-certs/ossl-client-certchain.pem
@@ -0,0 +1,54 @@
+-----BEGIN CERTIFICATE-----
+MIIEoTCCAwmgAwIBAgIIXBeg0SlsiUswDQYJKoZIhvcNAQELBQAwRDERMA8GA1UE
+AxMIc29tZU5hbWUxEDAOBgNVBAsTB3JzeXNsb2cxEDAOBgNVBAoTB1NvbWVPcmcx
+CzAJBgNVBAYTAlVTMCAXDTE4MTIxNzEzMTI1MFoYDzIxMTgxMTIzMTMxMjUzWjBY
+MRcwFQYDVQQDEw5yc3lzbG9nIGNsaWVudDERMA8GA1UECxMIU29tZVVuaXQxEDAO
+BgNVBAoTB1NvbWVPcmcxCzAJBgNVBAgTAkNBMQswCQYDVQQGEwJVUzCCAaIwDQYJ
+KoZIhvcNAQEBBQADggGPADCCAYoCggGBAJ2R2tguPZ2uhcPFp/akZvjIkZG4cCDc
+7egjylP3uFJD86fr+9+KOyywE/pi06FTpFFxH2jZ/bw5SvvJat/ziISwgLzA9RtC
+EfZMGtgsYgtdUGQwmtPbwdV/OVPkvegeBJ3JEuDkVykpAbnx5bx0pudLYeZnXGxO
+7u4iDBsUbegMb+7uw7jd3xXtepZbzIXl41DEziu/tjfmIPxuRX4JvYR6rwcn9Jkj
+Qd822CkxoJaEL/1FLtS0+frcjyPA4AatrQpy2vQ7ocvWpjvsRsSV8nGlrQgf5wYY
+DtuAUZa6JPZkAmvT8HYBNDpyAunL0KpiUQyPg77AR5nSknLtU6VJBdTJofRN3hKd
+GsgXhPOifGdHgkuGHnOG4iYmEJSjmZsImXidPTNdhcJGZZSrcLQ7wSaLEbZmJ4gi
+hAO1CEUyjIEjvmLcb6CqXp8D96f1A3A8eAnQhESMGa9295P8r8b929lMyyB5RHHL
+5lVhqXqvC6Om7empEa/6o12sl+fvK7aoNwIDAQABo4GAMH4wDAYDVR0TAQH/BAIw
+ADAdBgNVHSUEFjAUBggrBgEFBQcDAgYIKwYBBQUHAwEwDwYDVR0PAQH/BAUDAweg
+ADAdBgNVHQ4EFgQUlBeunSFXuHvBrhB7CKkhvKEUAIswHwYDVR0jBBgwFoAUsJ9n
+MyyIiIkfRGJ0nSX/wAYTXdYwDQYJKoZIhvcNAQELBQADggGBAEk9KaiQ6NzNHf7M
+kvPosgCu9Tm1jgRg4qjdMHxtzDxFQZWOtMuDxqqrNEC9FEF5zpEB8Z4VtubIeVK7
+6i6BdSMbI5zlnlxffPD1Gz8AKXe9BNb6UlLvlEC+58D4CJmrxDuKZXaBzy3xh2TP
+Al/s5XkPBuXKc7l0qQdDkt67LfDCrwpGfseOFXNUHDREBOulwX4LJzilVqLMsp03
+qMHK0f4kOxc0oJrH+2+jCgpu1QPoFOLl/6shbRw3qls/f/coWnnS5kd2NOPUf0pe
+j5lBt5ThhnLQIGwJucLa6cHVx+R4BWtTz4/v8hCwWr1cUbNEkxTyBErl0l8KkpCQ
+d0NCuZe2u2AJYEKdNilSiBr33ERZ70peE/ATfk6hv9ysWepeGYJiuybWXMrDtLbw
+X9wzwtdetIvvMxXiNAT5RpsZtFrdBD9ZwCHhJ+xjEycRDQKdnL/H4WbpAfvB9zcJ
+WCJ50FBFjNoHSYrwmhQULOYa8AjVxxrX/27g2mN3P3sDLG6bzw==
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIEiDCCAvCgAwIBAgIIXBeb1iWItcgwDQYJKoZIhvcNAQELBQAwRDERMA8GA1UE
+AxMIc29tZU5hbWUxEDAOBgNVBAsTB3JzeXNsb2cxEDAOBgNVBAoTB1NvbWVPcmcx
+CzAJBgNVBAYTAlVTMCAXDTE4MTIxNzEyNTEzNVoYDzIxMTgxMTIzMTI1MTUwWjBE
+MREwDwYDVQQDEwhzb21lTmFtZTEQMA4GA1UECxMHcnN5c2xvZzEQMA4GA1UEChMH
+U29tZU9yZzELMAkGA1UEBhMCVVMwggGiMA0GCSqGSIb3DQEBAQUAA4IBjwAwggGK
+AoIBgQChCwzkraL2v9SFAY3WD1au6cRCSaqrgC/5cecwzGBum0njlO4kmUkI5G4g
+1cwTtXqcmTh17EKaHlBFougnH5JZdDFmKpOIp4odACl5uuT5J1lRh6lsOyVq9X0h
+qp9qfjn1rrn7XfLk9i9+or0/iLK2megmU5ZUX6pNpoKaGeLBl4CeiiiqdaUeyGK8
+YKQksx/0zdeWb04Yp+zHIddcGoGAx88zf94onJQESsVOn1yG3sGM7rhfvOHDLGJ4
+flE+1ww8D6rZZci6D4bYhfA1bpiRwsU3UILginUVpfbMn+W6f2s+Cq0dbiQza0lf
++S2rK+7cH+4z9ltqA054B2/JPuNKbwf3lLoabGNWu47TCfyzaDUb7Y70CFRrYfkN
+4pD5y+Z838IH87RKJioh5q2ceVX5pyNv8XmkMuvWYDrnjVTnX7Q0fN/T6h8fVTIp
+lojlgV8z2tPcrJE0M4Y67nSAgYX7v2AtmcoBPML5Sairzq5apiljb0Wm5KSNwXZ2
+eAz9nTsCAwEAAaN8MHowDwYDVR0TAQH/BAUwAwEB/zBIBgNVHREEQTA/ghNzb21l
+b25lQGV4YW1wbGUubmV0ghNzb21lb25lQGV4YW1wbGUubmV0gRNzb21lb25lQGV4
+YW1wbGUubmV0MB0GA1UdDgQWBBSwn2czLIiIiR9EYnSdJf/ABhNd1jANBgkqhkiG
+9w0BAQsFAAOCAYEAl6nIgBHMX8rnAC054xx/aQcXazrv89KyEp0ydzBwJQOTei7I
+UGWQIRkSLL+CtrGhcLPQpTzAQn5NDo4ayinAtlPtP8MYcMBv13ZBJXLSqRfrTM04
+wkEbsWuCp+c/fU14E+QYSk4AwpoUdQeqmdM60KAoHNn+BaHGJRhRGOY9A8hfQQ5L
+S2TpJ+suJuHafNjr9vvhlqTSefCfENV40Ie1nwHCbqNZdDZel1iQBmdI7WJG7uTI
+OrSOPepYzOAYKQ+PWKMvZuzBc6ei/lcIpPHksWxK7nY35izSHjepMLGqH0/XZ51i
+wN55slw9agg5eCq/zL/+Ebu7+yub8JhA9D4pgT5nBp8LtQPOIKnkVlFookjfyO8/
+dWsjGnhT9RNbDUQg7Y7spTWPT7wqOmQchEvQt+x96BHq4SLe88HnTpBk2Cb370jq
+QQFW6s9vwo9PjOafOkyqYsiBuuCFxT80GegBlaipDNqLYhJ1fJAdQtRtFgogqpeS
+thWJZzNJeHyZSpah
+-----END CERTIFICATE-----
--- /dev/null
+++ b/tests/tls-certs/ossl-server-certchain.pem
@@ -0,0 +1,54 @@
+-----BEGIN CERTIFICATE-----
+MIIEmjCCAwKgAwIBAgIIXBegQDWsgowwDQYJKoZIhvcNAQELBQAwRDERMA8GA1UE
+AxMIc29tZU5hbWUxEDAOBgNVBAsTB3JzeXNsb2cxEDAOBgNVBAoTB1NvbWVPcmcx
+CzAJBgNVBAYTAlVTMCAXDTE4MTIxNzEzMTAyNloYDzIxMTgxMTIzMTMxMDI4WjBR
+MQ8wDQYDVQQLEwZTb21lT1UxEDAOBgNVBAoTB1NvbWVPcmcxEjAQBgNVBAcTCVNv
+bWV3aGVyZTELMAkGA1UECBMCQ0ExCzAJBgNVBAYTAlVTMIIBojANBgkqhkiG9w0B
+AQEFAAOCAY8AMIIBigKCAYEAvYhZDSdPcxBgjF+sgQZ10YPuIXIzoiq4G943OGFX
+EdMc0kdaVQcCKkR4raPMR0wKs57akpiN5CrU1HvkwYZbTNB/BpyhUuZnx2qjTRyO
+pB71k62z7HP3KAI/GYfEMX5DNPS0X3B7chkAT4Sk1Xdn3WjW3BVt3GK4XdWmG2M0
+cmsYaFvijFJDi6Fs8fy/5sG2x+WBwct1Kt8HnjfR+nh00YhgiqOdX1jOrDN29XHk
+n4GIEm/BRQRQ0/PoOa6VWGVVxu+8sfmM7IJ8kC5/QII3PFZCplqPnxFYd3C0Wa6v
+au+tYisJ9B5CB/fn9ars7H6nFMc1D38G/sVkspdJrFuFbQLElkH7ydxBZBv3O+fl
+Iomav/+JL1PiNHFtXxoGsTOPHHFKbqauxLuTbv9B5D1tO/MaxOBTt9MVMx8rDpVB
+y0spKhfWcxJ/0Hge7G9XrFGpN4joBPHPMghM8QjS9/EL8r98m8PNQk6OIG9TNeQC
+gzglQIV3K+rhFwTeeyetxDozAgMBAAGjgYAwfjAMBgNVHRMBAf8EAjAAMB0GA1Ud
+JQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDATAPBgNVHQ8BAf8EBQMDB6AAMB0GA1Ud
+DgQWBBQ3rDq/2kYOFskMD0lHFG+g2Ej/2zAfBgNVHSMEGDAWgBSwn2czLIiIiR9E
+YnSdJf/ABhNd1jANBgkqhkiG9w0BAQsFAAOCAYEARbJDuWZiqwA/CU9Eh99POTOk
+fnWdog8tLaOPLFS5mCiLNDmTXX14syAAjhbRrJ+43j1HWXbgovzDqzFtQzbztCMB
+qpxQy3d3R9nUKv6NpNT/IO84OcYuiMtRGr/AaVqc2PZlFirBqlQkxFUxiDc2pIhy
+h2orOJrPu3jSQdWI1PDT6oWKCwHdU+obqh+NmRWwjetpmeJ5r/kgAlZJ1krlNPJU
+V3U/J9WTdOYMhLcn4RcNOTAyrmxOoTEIOcqkXzJOypbkMcZic+OHCaDohUsfdOkB
+Xxz+6nP4xqnOcyHBLNTjVVrnr+wyqsWA18HoyLiCluf946S6mVoXcxwvWHzz7VVm
+qHVppLVD/iOJxtl4bm8YEYjO4C1IPxWOCszG4N71Reyo/+p1UJ8Ww6IAgJj0jX2l
+L7pqCwZKXhd8+LT05dZr7YJV/EjmGV/pL6IU3RAk6s2BqgtTkvy5nnmSPjBFuxG/
+gUBfaglsXC6w6R1aMVr9m3E1ht4vOPu9Qx7E21oG
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIEiDCCAvCgAwIBAgIIXBeb1iWItcgwDQYJKoZIhvcNAQELBQAwRDERMA8GA1UE
+AxMIc29tZU5hbWUxEDAOBgNVBAsTB3JzeXNsb2cxEDAOBgNVBAoTB1NvbWVPcmcx
+CzAJBgNVBAYTAlVTMCAXDTE4MTIxNzEyNTEzNVoYDzIxMTgxMTIzMTI1MTUwWjBE
+MREwDwYDVQQDEwhzb21lTmFtZTEQMA4GA1UECxMHcnN5c2xvZzEQMA4GA1UEChMH
+U29tZU9yZzELMAkGA1UEBhMCVVMwggGiMA0GCSqGSIb3DQEBAQUAA4IBjwAwggGK
+AoIBgQChCwzkraL2v9SFAY3WD1au6cRCSaqrgC/5cecwzGBum0njlO4kmUkI5G4g
+1cwTtXqcmTh17EKaHlBFougnH5JZdDFmKpOIp4odACl5uuT5J1lRh6lsOyVq9X0h
+qp9qfjn1rrn7XfLk9i9+or0/iLK2megmU5ZUX6pNpoKaGeLBl4CeiiiqdaUeyGK8
+YKQksx/0zdeWb04Yp+zHIddcGoGAx88zf94onJQESsVOn1yG3sGM7rhfvOHDLGJ4
+flE+1ww8D6rZZci6D4bYhfA1bpiRwsU3UILginUVpfbMn+W6f2s+Cq0dbiQza0lf
++S2rK+7cH+4z9ltqA054B2/JPuNKbwf3lLoabGNWu47TCfyzaDUb7Y70CFRrYfkN
+4pD5y+Z838IH87RKJioh5q2ceVX5pyNv8XmkMuvWYDrnjVTnX7Q0fN/T6h8fVTIp
+lojlgV8z2tPcrJE0M4Y67nSAgYX7v2AtmcoBPML5Sairzq5apiljb0Wm5KSNwXZ2
+eAz9nTsCAwEAAaN8MHowDwYDVR0TAQH/BAUwAwEB/zBIBgNVHREEQTA/ghNzb21l
+b25lQGV4YW1wbGUubmV0ghNzb21lb25lQGV4YW1wbGUubmV0gRNzb21lb25lQGV4
+YW1wbGUubmV0MB0GA1UdDgQWBBSwn2czLIiIiR9EYnSdJf/ABhNd1jANBgkqhkiG
+9w0BAQsFAAOCAYEAl6nIgBHMX8rnAC054xx/aQcXazrv89KyEp0ydzBwJQOTei7I
+UGWQIRkSLL+CtrGhcLPQpTzAQn5NDo4ayinAtlPtP8MYcMBv13ZBJXLSqRfrTM04
+wkEbsWuCp+c/fU14E+QYSk4AwpoUdQeqmdM60KAoHNn+BaHGJRhRGOY9A8hfQQ5L
+S2TpJ+suJuHafNjr9vvhlqTSefCfENV40Ie1nwHCbqNZdDZel1iQBmdI7WJG7uTI
+OrSOPepYzOAYKQ+PWKMvZuzBc6ei/lcIpPHksWxK7nY35izSHjepMLGqH0/XZ51i
+wN55slw9agg5eCq/zL/+Ebu7+yub8JhA9D4pgT5nBp8LtQPOIKnkVlFookjfyO8/
+dWsjGnhT9RNbDUQg7Y7spTWPT7wqOmQchEvQt+x96BHq4SLe88HnTpBk2Cb370jq
+QQFW6s9vwo9PjOafOkyqYsiBuuCFxT80GegBlaipDNqLYhJ1fJAdQtRtFgogqpeS
+thWJZzNJeHyZSpah
+-----END CERTIFICATE-----

@ -33,6 +33,8 @@ DEPEND="${RDEPEND}
RESTRICT="!test? ( test )"
PATCHES=( "${FILESDIR}"/${P}-missing-files.patch )
pkg_setup() {
use test && python-any-r1_pkg_setup
}

@ -10,7 +10,7 @@ if [[ ${PV} == *9999 ]] ; then
inherit git-r3
else
SRC_URI="https://code.videolan.org/videolan/libudfread/-/archive/${PV}/${P}.tar.gz"
KEYWORDS="~amd64 ~arm64 ~x86"
KEYWORDS="~amd64 ~arm ~arm64 ~x86"
fi
DESCRIPTION="Library for reading UDF from raw devices and image files"

@ -1,5 +1,3 @@
DIST mongo-c-driver-0.7.1.tar.gz 108537 BLAKE2B 29d7f6680d700d15d02b3d5deefbdc27b4e0841a2ac30205ed148216d15e95fe487f4cea4decacdf573a4ce78248cfd12cba72b9dbf90065e127fa7fb56cad27 SHA512 5c6996dc47ecbe4d77971e3aa983a877e7de736bf358c467808eceba8b1a5eea342376249cdc682a034fc7ec39290d234527cec3c3732686f184281a72aec724
DIST mongo-c-driver-0.8.1.tar.gz 124053 BLAKE2B 1c6b0d3998c6497c39fc2f6597021e84571c717e5d6f288d79d3862e7f15f131604648595ca0e12200352a7fbf40652803afd0f60a80eac657b9853a1de51173 SHA512 7b61ac4b1b154ee1f518eddb2bbc0cdafe0da8786eed4475e5703c2a735ec5a09efde59f5bfa45fb226cbce24d8c0ba0de403d8fc3e561c0e48507dfb07962b1
DIST mongo-c-driver-0.98.2.tar.gz 5342760 BLAKE2B 399fb03464234c87dcb66647c5383c505e654238e72e86794fdbc56716590ea6637aa7bfb0d25c0fb6aae8fce6055741753ac33125cb1b475c7bfe1e198a0a1e SHA512 6e3abc31b1e0e02d3bb864882444a95aa01ec4a85ee77abdc52675a730790be7f1924f3c6ea36405ff0f2066e332302ca567bbfa35ba7b918bce81fb409600eb
DIST mongo-c-driver-1.1.10.tar.gz 5321144 BLAKE2B d63ba4b1a256b8b29654398a53d9ca46d49faad0e0327db0d51cfc4e2a1771568341ff4e7ba6ff2ff31fb11ad8a14c452e52cabdd83da7eb1c1ceb8af7bef7d2 SHA512 10ebd1bddc0c713c0934679974fb1ed29eda1bf8e2ebbe2a1ebbcba219574092c34c4b352231ec65ffe3e350d8d701ef85debaaa9f9c10e6ab36fc3fa29f69df
DIST mongo-c-driver-1.1.2.tar.gz 5443153 BLAKE2B f8004486baf6d2d3086e458bdb4bc8060462fd52ba700cbf05fdb9827adcbd087b61d7e0e00169cf635c8021983dc851b7f34c3e08d66efc65483fce98a85f74 SHA512 d420fc407f6a04c06a959b8971dc2643c987df5c3d82f2b13bfdf6a44e96bc377478c4d0e385abf67f21b56892c915c79675fe9ebf6efa9aab51fe452c5e6f95

@ -1,14 +0,0 @@
diff -uNr mongo-c-driver-0.8.1.ORIG/src/mongo.h mongo-c-driver-0.8.1/src/mongo.h
--- mongo-c-driver-0.8.1.ORIG/src/mongo.h 2014-03-27 17:00:42.880465606 +0000
+++ mongo-c-driver-0.8.1/src/mongo.h 2014-03-27 17:01:05.131465940 +0000
@@ -33,8 +33,8 @@
#endif
#define MONGO_MAJOR 0
-#define MONGO_MINOR 7
-#define MONGO_PATCH 0
+#define MONGO_MINOR 8
+#define MONGO_PATCH 1
#define MONGO_OK 0
#define MONGO_ERROR -1

@ -1,59 +0,0 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=5
PYTHON_COMPAT=( python2_7 )
inherit flag-o-matic multilib python-any-r1 toolchain-funcs
DESCRIPTION="C Driver for MongoDB"
HOMEPAGE="http://www.mongodb.org/ https://github.com/mongodb/mongo-c-driver"
SRC_URI="https://github.com/mongodb/${PN}/tarball/v${PV/_/} -> ${P}.tar.gz"
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="amd64 ~hppa ~s390 x86"
IUSE="doc static-libs"
# tests fails to build
RESTRICT="test"
RDEPEND=""
DEPEND="${PYTHON_DEPS}
doc? ( $(python_gen_any_dep 'dev-python/sphinx[${PYTHON_USEDEP}]') )
"
python_check_deps() {
if use doc; then
has_version "dev-python/sphinx[${PYTHON_USEDEP}]"
fi
}
src_unpack() {
unpack ${A}
mv *-${PN}-* "${S}"
}
src_prepare() {
# bug #510722
sed -e 's/-O3//g' \
-e 's/-ggdb//g' \
-e "s/CC:=.*/CC:=$(tc-getCC)/g" \
-i Makefile || die
}
src_compile() {
append-cflags -D_POSIX_C_SOURCE=200112L
emake
use doc && make -C docs/source/sphinx html
}
src_install() {
emake install \
INSTALL_LIBRARY_PATH="${D}/usr/$(get_libdir)" \
INSTALL_INCLUDE_PATH="${D}/usr/include"
use static-libs || find "${ED}" -name '*.a' -exec rm -f {} +
use doc && dohtml -r docs/source/sphinx/build/html/*
}

@ -1,53 +0,0 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="5"
PYTHON_COMPAT=( python2_7 )
inherit base flag-o-matic multilib python-any-r1 toolchain-funcs
DESCRIPTION="C Driver for MongoDB"
HOMEPAGE="http://www.mongodb.org/ https://github.com/mongodb/mongo-c-driver"
SRC_URI="https://github.com/mongodb/${PN}/tarball/v${PV/_/} -> ${P}.tar.gz"
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="amd64 ~hppa ~s390 x86"
IUSE="doc static-libs"
# tests fails to build
RESTRICT="test"
RDEPEND=""
DEPEND="${PYTHON_DEPS}
doc? ( $(python_gen_any_dep 'dev-python/sphinx[${PYTHON_USEDEP}]') )
"
PATCHES=( "${FILESDIR}/${PV}-api-version.diff" )
python_check_deps() {
if use doc; then
has_version "dev-python/sphinx[${PYTHON_USEDEP}]"
fi
}
src_unpack() {
unpack ${A}
mv *-${PN}-* "${S}"
}
src_compile() {
append-cflags -D_POSIX_C_SOURCE=200112L
tc-export CC
emake
use doc && make -C docs/source/sphinx html
}
src_install() {
emake install \
INSTALL_LIBRARY_PATH="${D}/usr/$(get_libdir)" \
INSTALL_INCLUDE_PATH="${D}/usr/include"
use static-libs || find "${ED}" -name '*.a' -exec rm -f {} +
use doc && dohtml -r docs/source/sphinx/build/html/*
}

@ -11,7 +11,7 @@ SRC_URI="mirror://gnupg/${PN}/${P}.tar.bz2"
LICENSE="LGPL-2.1+"
SLOT="0"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~m68k ~mips ppc ~ppc64 ~riscv s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
IUSE="static-libs"
src_prepare() {

@ -161,6 +161,14 @@ multilib_src_compile() {
export USE_SYSTEM_ZLIB=1
export ZLIB_LIBS=-lz
export ASFLAGS=""
# Fix build failure on arm64
export NS_USE_GCC=1
# Detect compiler type and set proper environment value
if tc-is-gcc; then
export CC_IS_GCC=1
elif tc-is-clang; then
export CC_IS_CLANG=1
fi
local d

@ -12,7 +12,7 @@ SRC_URI="https://github.com/leethomason/${PN}/archive/${PV}.tar.gz -> ${P}.tar.g
LICENSE="ZLIB"
SLOT="0/8"
KEYWORDS="~amd64 arm ~arm64 ~hppa ~ppc64 ~sparc x86"
KEYWORDS="~amd64 arm arm64 ~hppa ~ppc64 sparc x86"
IUSE="test"
RESTRICT="!test? ( test )"

@ -11,7 +11,7 @@ SRC_URI="https://github.com/${PN}/${PN}/releases/download/${P}/${P}.tar.bz2"
LICENSE="BSD"
SLOT="0"
KEYWORDS="amd64 ~arm ~arm64 ~ppc ~ppc64 x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~x86-solaris"
KEYWORDS="amd64 ~arm ~arm64 ppc ~ppc64 x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~x86-solaris"
IUSE="doc qt5 test unicode"
RDEPEND=""

@ -9,7 +9,7 @@ SRC_URI="https://www.aleksey.com/xmlsec/download/${PN}1-${PV}.tar.gz"
LICENSE="MIT"
SLOT="0"
KEYWORDS="amd64 arm arm64 ~ppc ~ppc64 ~sparc x86"
KEYWORDS="amd64 arm arm64 ppc ~ppc64 ~sparc x86"
IUSE="doc gcrypt gnutls libressl nss +openssl static-libs test"
RESTRICT="!test? ( test )"
REQUIRED_USE="|| ( gcrypt gnutls nss openssl )

Binary file not shown.

@ -1,3 +1 @@
DIST clisp-2.49.90.tar.bz2 8921458 BLAKE2B 3be7cfe41038f42d8844d500877fa5c20e5c21dc0e162aa0018b297e4dfcd5374ef608793c9d809852e1f9885a155bb5b25fef8efe66016dd0ee400007386b70 SHA512 1fa7205e38883dcc863160b5418ddaaa2c45ee2d2f936de4067d1ea4a1e5043bf1235361bbbfc366afd6d8f1144497ccdccf1767ecf327f7a672b18742ceb651
DIST clisp-2.49.92.tar.bz2 9055207 BLAKE2B 6cf331eb9f99f62579e35469e2d01cae066083592ccc71cf483b70b4d1be349cdee9d403e0a7ed1ad1c8c5d805c1dab51c1a5031d77469ff8c4dc52eb58913df SHA512 cc9412a7b3f21c85b040bf5e660380fafb3c2374765a1c00272feb3f7838f2161e27a5d6295cef9976f0c4522f10796cf5ee5447716090d1cc69ecfe598ef306
DIST clisp-2.49.tar.bz2 8091011 BLAKE2B e034c581b8100837b34d0adf1ef45bd667272d062945875175958178b4ef5b11e899dfb76505eb8cb51fca6101c11a9f21fb2cc9a78a3c0f82b06166211434f7 SHA512 eef66fc85199a2c283b616db61bf67ff103eeb0f19fa907da48994dc790b6f5f8d0c74fb3bd723c6b827c0ff3cfd89fa6ba67934fc669ed5d5249044b5140d81

@ -1,144 +0,0 @@
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=5
inherit eutils flag-o-matic multilib toolchain-funcs xdg-utils
DESCRIPTION="A portable, bytecode-compiled implementation of Common Lisp"
HOMEPAGE="https://clisp.sourceforge.io/"
SRC_URI="mirror://sourceforge/clisp/${P}.tar.bz2"
LICENSE="GPL-2"
SLOT="2/${PV}"
KEYWORDS="amd64 ~ppc ~sparc x86"
IUSE="hyperspec X berkdb dbus fastcgi gdbm gtk +pcre postgres +readline svm -threads +unicode +zlib"
# "jit" disabled ATM
RDEPEND=">=dev-lisp/asdf-2.33-r3
virtual/libiconv
>=dev-libs/libsigsegv-2.4
>=dev-libs/ffcall-1.10
dbus? ( sys-apps/dbus )
fastcgi? ( dev-libs/fcgi )
gdbm? ( sys-libs/gdbm )
gtk? ( >=x11-libs/gtk+-2.10 >=gnome-base/libglade-2.6 )
postgres? ( >=dev-db/postgresql-8.0 )
readline? ( >=sys-libs/readline-5.0 <sys-libs/readline-7.0 )
pcre? ( dev-libs/libpcre )
svm? ( sci-libs/libsvm )
zlib? ( sys-libs/zlib )
X? ( x11-libs/libXpm )
hyperspec? ( dev-lisp/hyperspec )
berkdb? ( sys-libs/db:4.8 )"
# jit? ( >=dev-libs/lightning-1.2 )
DEPEND="${RDEPEND}
X? ( x11-base/xorg-proto x11-misc/imake )"
enable_modules() {
[[ $# = 0 ]] && die "${FUNCNAME[0]} must receive at least one argument"
for m in "$@" ; do
einfo "enabling module $m"
myconf+=" --with-module=${m}"
done
}
BUILDDIR="builddir"
# modules not enabled:
# * berkdb: must figure out a way to make the configure script pick up the
# currect version of the library and headers
# * dirkey: fails to compile, requiring windows.h, possibly wrong #ifdefs
# * matlab, netica: not in portage
# * oracle: can't install oracle-instantclient
src_prepare() {
# More than -O1 breaks alpha/ia64
if use alpha || use ia64; then
sed -i -e 's/-O2//g' src/makemake.in || die
fi
epatch "${FILESDIR}"/${P}-bits_ipctypes_to_sys_ipc.patch
epatch "${FILESDIR}"/${P}-get_hostname.patch
epatch "${FILESDIR}"/${P}-tinfo.patch
xdg_environment_reset
}
src_configure() {
# Bug 618170. If anyone has a better idea...
append-flags -fno-pie
# We need this to build on alpha/ia64
if use alpha || use ia64; then
replace-flags -O? -O1
append-flags '-D NO_MULTIMAP_SHM -D NO_MULTIMAP_FILE -D NO_SINGLEMAP -D NO_TRIVIALMAP'
fi
# QA issue with lisp.run
append-flags -Wa,--noexecstack
# built-in features
local myconf="--with-ffcall --without-dynamic-modules"
# There's a problem with jit_allocai function
# if use jit; then
# myconf+=" --with-jitc=lightning"
# fi
if use threads; then
myconf+=" --with-threads=POSIX_THREADS"
fi
# default modules
enable_modules wildcard rawsock
# optional modules
use elibc_glibc && enable_modules bindings/glibc
use X && enable_modules clx/new-clx
if use postgres; then
enable_modules postgresql
append-cppflags -I$(pg_config --includedir)
fi
if use berkdb; then
enable_modules berkeley-db
append-cppflags -I/usr/include/db4.8
fi
use dbus && enable_modules dbus
use fastcgi && enable_modules fastcgi
use gdbm && enable_modules gdbm
use gtk && enable_modules gtk2
use pcre && enable_modules pcre
use svm && enable_modules libsvm
use zlib && enable_modules zlib
if use hyperspec; then
CLHSROOT="file:///usr/share/doc/hyperspec/HyperSpec/"
else
CLHSROOT="http://www.lispworks.com/reference/HyperSpec/"
fi
# configure chokes on --sysconfdir option
local configure="./configure --prefix=/usr --libdir=/usr/$(get_libdir) \
$(use_with readline) $(use_with unicode) \
${myconf} --hyperspec=${CLHSROOT} ${BUILDDIR}"
einfo "${configure}"
${configure} || die "./configure failed"
IMPNOTES="file://${ROOT%/}/usr/share/doc/${PN}-${PVR}/html/impnotes.html"
sed -i "s,http://clisp.cons.org/impnotes/,${IMPNOTES},g" \
"${BUILDDIR}"/config.lisp || die "Cannot fix link to implementation notes"
}
src_compile() {
export VARTEXFONTS="${T}"/fonts
cd "${BUILDDIR}"
# parallel build fails
emake -j1
}
src_install() {
pushd "${BUILDDIR}"
make DESTDIR="${D}" prefix=/usr install-bin || die "Installation failed"
doman clisp.1
dodoc ../SUMMARY README* ../src/NEWS ../unix/MAGIC.add ../ANNOUNCE
popd
dohtml doc/impnotes.{css,html} doc/regexp.html doc/clisp.png
dodoc doc/{CLOS-guide,LISP-tutorial}.txt
}

@ -1,140 +0,0 @@
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=6
inherit eutils flag-o-matic multilib toolchain-funcs xdg-utils
DESCRIPTION="A portable, bytecode-compiled implementation of Common Lisp"
HOMEPAGE="https://clisp.sourceforge.io/"
SRC_URI="https://haible.de/bruno/gnu/${P}.tar.bz2"
LICENSE="GPL-2"
SLOT="2/8"
KEYWORDS="~alpha ~amd64 ~ia64 ~ppc ~sparc ~x86"
IUSE="hyperspec X berkdb dbus fastcgi gdbm gtk +pcre postgres +readline svm -threads +unicode +zlib"
# "jit" disabled ATM
RDEPEND=">=dev-lisp/asdf-2.33-r3
virtual/libiconv
>=dev-libs/libsigsegv-2.10
>=dev-libs/ffcall-1.10
dbus? ( sys-apps/dbus )
fastcgi? ( dev-libs/fcgi )
gdbm? ( sys-libs/gdbm )
gtk? ( >=x11-libs/gtk+-2.10:2 >=gnome-base/libglade-2.6 )
postgres? ( >=dev-db/postgresql-8.0:* )
readline? ( >=sys-libs/readline-7.0:0= )
pcre? ( dev-libs/libpcre:3 )
svm? ( sci-libs/libsvm )
zlib? ( sys-libs/zlib )
X? ( x11-libs/libXpm )
hyperspec? ( dev-lisp/hyperspec )
berkdb? ( sys-libs/db:4.8 )"
DEPEND="${RDEPEND}
X? ( x11-base/xorg-proto x11-misc/imake )"
enable_modules() {
[[ $# = 0 ]] && die "${FUNCNAME[0]} must receive at least one argument"
for m in "$@" ; do
einfo "enabling module $m"
myconf+=" --with-module=${m}"
done
}
BUILDDIR="builddir"
# modules not enabled:
# * berkdb: must figure out a way to make the configure script pick up the
# currect version of the library and headers
# * dirkey: fails to compile, requiring windows.h, possibly wrong #ifdefs
# * matlab, netica: not in portage
# * oracle: can't install oracle-instantclient
src_prepare() {
# More than -O1 breaks alpha/ia64
if use alpha || use ia64; then
sed -i -e 's/-O2//g' src/makemake.in || die
fi
eapply "${FILESDIR}"/"${P}"-after_glibc_cfree_bdb.patch
eapply_user
xdg_environment_reset
}
src_configure() {
# We need this to build on alpha/ia64
if use alpha || use ia64; then
replace-flags -O? -O1
fi
if use x86; then
append-flags -falign-functions=4
fi
# built-in features
local myconf="--with-ffcall --without-dynamic-modules"
# There's a problem with jit_allocai function
# if use jit; then
# myconf+=" --with-jitc=lightning"
# fi
if use threads; then
myconf+=" --with-threads=POSIX_THREADS"
fi
# default modules
enable_modules rawsock
# optional modules
use elibc_glibc && enable_modules bindings/glibc
use X && enable_modules clx/new-clx
if use postgres; then
enable_modules postgresql
append-cppflags -I$(pg_config --includedir)
fi
if use berkdb; then
enable_modules berkeley-db
append-cppflags -I"${EPREFIX}"/usr/include/db4.8
fi
use dbus && enable_modules dbus
use fastcgi && enable_modules fastcgi
use gdbm && enable_modules gdbm
use gtk && enable_modules gtk2
use pcre && enable_modules pcre
use svm && enable_modules libsvm
use zlib && enable_modules zlib
if use hyperspec; then
CLHSROOT="file:///${EPREFIX}/usr/share/doc/hyperspec/HyperSpec/"
else
CLHSROOT="http://www.lispworks.com/reference/HyperSpec/"
fi
# configure chokes on --sysconfdir option
local configure="./configure --prefix=${EPREFIX}/usr --enable-portability \
--libdir=${EPREFIX}/usr/$(get_libdir) $(use_with readline) $(use_with unicode) \
${myconf} --hyperspec=${CLHSROOT} ${BUILDDIR}"
einfo "${configure}"
${configure} || die "./configure failed"
IMPNOTES="file://${ROOT%/}/usr/share/doc/${PN}-${PVR}/html/impnotes.html"
sed -i "s,http://clisp.cons.org/impnotes/,${IMPNOTES},g" \
"${BUILDDIR}"/config.lisp || die "Cannot fix link to implementation notes"
}
src_compile() {
export VARTEXFONTS="${T}"/fonts
cd "${BUILDDIR}" || die
# parallel build fails
emake -j1
}
src_install() {
pushd "${BUILDDIR}"
make DESTDIR="${D}" prefix="${EPREFIX}"/usr install-bin || die "Installation failed"
doman clisp.1
dodoc ../SUMMARY README* ../src/NEWS ../unix/MAGIC.add ../ANNOUNCE
popd
dohtml doc/impnotes.{css,html} doc/regexp.html doc/clisp.png
dodoc doc/{CLOS-guide,LISP-tutorial}.txt
}

@ -1,21 +0,0 @@
diff -ru a/modules/bindings/glibc/linux.lisp b/modules/bindings/glibc/linux.lisp
--- a/modules/bindings/glibc/linux.lisp 2008-10-08 19:36:19.000000000 +0300
+++ b/modules/bindings/glibc/linux.lisp 2013-04-08 00:05:06.028305248 +0300
@@ -67,7 +67,7 @@
(def-c-type __daddr_t) ; int
(def-c-type __caddr_t) ; c-pointer
(def-c-type __time_t) ; long
-(def-c-type __swblk_t) ; long
+;(def-c-type __swblk_t) ; long
(def-c-type __fd_mask ulong)
(eval-when (load compile eval)
@@ -86,7 +86,7 @@
(def-c-type __key_t) ; int
-(c-lines "#include <bits/ipctypes.h>~%")
+(c-lines "#include <sys/ipc.h>~%")
(def-c-type __ipc_pid_t) ; ushort
; --------------------------- <sys/types.h> -----------------------------------

@ -1,56 +0,0 @@
diff -r -U1 clisp-2.49.orig/src/socket.d clisp-2.49/src/socket.d
--- clisp-2.49.orig/src/socket.d 2009-10-08 21:45:13.000000000 +0700
+++ clisp-2.49/src/socket.d 2013-04-20 16:24:11.133895050 +0700
@@ -59,5 +59,5 @@
Fetches the machine's host name.
- get_hostname(host =);
- The name is allocated on the stack, with dynamic extent.
- < const char* host: The host name.
+ get_hostname(hostname);
+ where hostname is an array of MAXHOTNAMELEN+1 characters.
+ < const char host[]: The host name.
(Note: In some cases we could get away with less system calls by simply
@@ -69,10 +69,8 @@
/* present on all supported unix systems and on woe32 */
- #define get_hostname(host_assignment) \
- do { var char hostname[MAXHOSTNAMELEN+1]; \
- begin_system_call(); \
- if ( gethostname(&hostname[0],MAXHOSTNAMELEN) <0) { SOCK_error(); } \
- end_system_call(); \
- hostname[MAXHOSTNAMELEN] = '\0'; \
- host_assignment &hostname[0]; \
- } while(0)
+static void get_hostname (char *hostname) {
+ begin_system_call();
+ if (gethostname(hostname,MAXHOSTNAMELEN) < 0) { ANSIC_error(); }
+ end_system_call();
+ hostname[MAXHOSTNAMELEN] = '\0';
+}
#else
@@ -209,4 +207,4 @@
(apply #'string-concat hostname " [" (inet-ntop address) "]"))) */
- var const char* host;
- get_hostname(host =);
+ var char host[MAXHOSTNAMELEN+1];
+ get_hostname(host);
result = asciz_to_string(host,O(misc_encoding)); /* hostname as result */
@@ -391,4 +389,4 @@
if (eq(arg,S(Kdefault))) {
- var char* host;
- get_hostname(host =);
+ var char host[MAXHOSTNAMELEN+1];
+ get_hostname(host);
begin_system_call();
@@ -726,3 +724,4 @@
if (host[0] == '\0') {
- get_hostname(host =);
+ var char host[MAXHOSTNAMELEN+1];
+ get_hostname(host);
fd = with_host_port(host,port,&connect_to_x_via_ip,NULL);
@@ -800,4 +799,4 @@
if (resolve_p) { /* Fill in hd->truename. */
- var const char* host;
- get_hostname(host =); /* was: host = "localhost"; */
+ var char host[MAXHOSTNAMELEN+1];
+ get_hostname(host);
ASSERT(strlen(host) <= MAXHOSTNAMELEN);

@ -1,15 +0,0 @@
clisp does not need a full blown ncurses, but it does require a termcap or tinfo
I would have changed this in src/m4/termcap.m4 but configure.in fails terribly - JeR
--- a/src/configure
+++ b/src/configure
@@ -28613,7 +28613,7 @@
return 0;
}
_ACEOF
-for ac_lib in '' ncurses termcap; do
+for ac_lib in '' tinfo ncurses termcap; do
if test -z "$ac_lib"; then
ac_res="none required"
else

@ -1,185 +0,0 @@
diff -r -U3 clisp-2.49.90.orig/modules/berkeley-db/bdb.c clisp-2.49.90/modules/berkeley-db/bdb.c
--- clisp-2.49.90.orig/modules/berkeley-db/bdb.c 2018-01-27 12:03:01.000000000 +0100
+++ clisp-2.49.90/modules/berkeley-db/bdb.c 2018-02-12 20:37:24.203803219 +0100
@@ -2216,7 +2216,13 @@
c_data.compact_timeout = timeout;
c_data.compact_pages = pages;
SYSCALL(db->compact,(db,txn,pstart,pstop,&c_data,flags,&end));
- pushSTACK(uint32_to_I(c_data.compact_empty_buckets));
+ /* ====
+ * compact_empty_buckets is in bdb-5.3 as part of output stats
+ * however this version use bdb-4.8 which does not have it
+ * ====
+ *
+ * pushSTACK(uint32_to_I(c_data.compact_empty_buckets));
+ * */
pushSTACK(uint32_to_I(c_data.compact_pages_free));
pushSTACK(uint32_to_I(c_data.compact_pages_examine));
pushSTACK(uint32_to_I(c_data.compact_levels));
diff -r -U3 clisp-2.49.90.orig/modules/bindings/glibc/linux.lisp clisp-2.49.90/modules/bindings/glibc/linux.lisp
--- clisp-2.49.90.orig/modules/bindings/glibc/linux.lisp 2018-01-10 00:32:25.000000000 +0100
+++ clisp-2.49.90/modules/bindings/glibc/linux.lisp 2018-02-12 20:48:22.467775536 +0100
@@ -1,7 +1,7 @@
;; Foreign functions provided by the Linux C library version 6,
;; i.e. the GNU C library version 2.0.7.
;; Bruno Haible 10.4.1998, 19.4.1998
-;; Sam Steingold 2002-2008, 2011
+;; Sam Steingold 2002-2008, 2011, 2013, 2016-2017
;; NB: quite a few functions here have more portable counterparts in POSIX
@@ -686,9 +686,8 @@
(def-call-out system? (:arguments (null c-string))
(:return-type boolean) (:name "system"))
-; You can uncomment this if your compiler sets __USE_GNU
-; (def-call-out canonicalize_file_name (:arguments (name c-string))
-; (:return-type c-string :malloc-free))
+(def-call-out canonicalize_file_name (:arguments (name c-string))
+ (:return-type c-string :malloc-free))
(def-call-out realpath
(:arguments (name c-string)
@@ -1040,9 +1039,8 @@
(def-call-out access (:arguments (name c-string) (type int))
(:return-type int))
-; You can uncomment this if your compiler sets __USE_GNU
-; (def-call-out euidaccess (:arguments (name c-string) (type int))
-; (:return-type int))
+(def-call-out euidaccess (:arguments (name c-string) (type int))
+ (:return-type int))
(defconstant SEEK_SET 0)
(defconstant SEEK_CUR 1)
@@ -1093,9 +1091,8 @@
;(def-call-out getcwd (:arguments (buf c-string :out) (size size_t)) ; ??
; (:return-type c-string))
-; You can uncomment this if your compiler sets __USE_GNU
-; (def-call-out get_current_dir_name (:arguments)
-; (:return-type c-string :malloc-free))
+(def-call-out get_current_dir_name (:arguments)
+ (:return-type c-string :malloc-free))
;(def-call-out getwd (:arguments (buf c-string :out)) ; ??
; (:return-type c-string))
@@ -1323,8 +1320,7 @@
; (:arguments (size int) (list (c-ptr (c-array gid_t ??)) :out)) ; ??
; (:return-type int))
-; You can uncomment this if your compiler sets __USE_GNU
-; (def-call-out group_member (:arguments (gid gid_t)) (:return-type boolean))
+(def-call-out group_member (:arguments (gid gid_t)) (:return-type boolean))
(def-call-out setuid (:arguments (uid uid_t)) (:return-type int))
(def-call-out setreuid (:arguments (ruid uid_t) (euid uid_t))
(:return-type int))
@@ -1821,8 +1817,7 @@
(:return-type c-string :malloc-free))
(def-call-out ungetc (:arguments (c int) (fp FILE))
(:return-type int))
-; You can uncomment this if your compiler sets __USE_GNU
-; (def-call-out fcloseall (:arguments) (:return-type int))
+(def-call-out fcloseall (:arguments) (:return-type int))
(def-call-out fdopen (:arguments (fildes int) (mode c-string))
(:return-type c-pointer))
(def-call-out fileno (:arguments (fp FILE)) (:return-type int))
@@ -1900,11 +1895,11 @@
(:return-type (c-ptr-null dirent)))
(def-call-out readdir64 (:arguments (dirp c-pointer))
(:return-type (c-ptr-null dirent64)))
-(def-call-out readdir_r
+(def-call-out readdir_r ; deprecated
(:arguments (dirp c-pointer) (entry (c-ptr dirent) :out :alloca)
(result (c-ptr (c-ptr dirent)) :out :alloca)) ; ??
(:return-type int))
-(def-call-out readdir64_r
+(def-call-out readdir64_r ; deprecated
(:arguments (dirp c-pointer) (entry (c-ptr dirent64) :out :alloca)
(result (c-ptr (c-ptr dirent64)) :out :alloca)) ; ??
(:return-type int))
diff -r -U3 clisp-2.49.90.orig/modules/bindings/glibc/test.tst clisp-2.49.90/modules/bindings/glibc/test.tst
--- clisp-2.49.90.orig/modules/bindings/glibc/test.tst 2018-01-10 00:04:26.000000000 +0100
+++ clisp-2.49.90/modules/bindings/glibc/test.tst 2018-02-12 20:50:48.225769407 +0100
@@ -14,6 +14,16 @@
(= linux:DT_DIR (linux:dirent64-d_type (show (linux:readdir64 *d*)))) T
(linux:closedir *d*) 0
+(stringp (show (linux:get-domain-name))) T
+(stringp (show (linux:get-host-name))) T
+
+;; usually __USE_GNU is defined, so this should work:
+(let* ((d (linux:get_current_dir_name))
+ (c (linux:canonicalize_file_name (concatenate 'string d "/."))))
+ (or (string= d c)
+ (list :cur-dir d :canonical c)))
+T
+
(defparameter *d* (show (linux:opendir "."))) *D*
(linux:dirent-d_name (show (linux:readdir *d*))) "."
(linux:dirent-d_name (show (linux:readdir *d*))) ".."
diff -r -U3 clisp-2.49.90.orig/src/foreign1.lisp clisp-2.49.90/src/foreign1.lisp
--- clisp-2.49.90.orig/src/foreign1.lisp 2018-01-10 00:04:26.000000000 +0100
+++ clisp-2.49.90/src/foreign1.lisp 2018-02-12 21:03:56.768736245 +0100
@@ -805,14 +805,17 @@
c-name (to-c-string c-name) (third variable) (first variable))
(when *foreign-guard* (format *coutput-stream* "# endif~%"))))
(dolist (function *function-list*)
- (let ((c-name (first function)))
- (when *foreign-guard*
- (format *coutput-stream* "# if defined(HAVE_~A)~%"
- (string-upcase c-name)))
+ (let ((c-name (first function))
+ (guard (fourth function)))
+ (when guard
+ (format *coutput-stream* "# if ~A~%"
+ (if (eq guard t)
+ (format nil "defined(HAVE_~A)" (string-upcase c-name))
+ guard)))
(format *coutput-stream*
" register_foreign_function((void*)&~A,~A,~D);~%"
c-name (to-c-string c-name) (svref (second function) 3))
- (when *foreign-guard* (format *coutput-stream* "# endif~%"))))
+ (when guard (format *coutput-stream* "# endif~%"))))
(maphash (lambda (type fun-vec)
(declare (ignore type))
(let ((c-name (to-c-name (car fun-vec))))
@@ -1083,7 +1086,7 @@
(defmacro DEF-CALL-OUT (&whole whole-form name &rest options)
(setq name (check-symbol name (first whole-form)))
(let* ((alist
- (parse-options options '(:name :arguments :return-type :language
+ (parse-options options '(:name :arguments :return-type :language :guard
:built-in :library :version :documentation)
whole-form))
(def (gensym "DEF-CALL-OUT-"))
@@ -1095,6 +1098,7 @@
(version (second (assoc :version alist)))
(c-name (foreign-name name (assoc :name alist)))
(built-in (second (assoc :built-in alist)))
+ (guard (get-assoc :guard alist '*foreign-guard*))
;; Maximize sharing in .fas file, reuse options
;; parse-c-function ignores unknown options, e.g. :name
(ctype `(PARSE-C-FUNCTION ',options ',whole-form)))
@@ -1102,7 +1106,7 @@
',c-name ,ctype ',properties ,library ,version NIL)))
(EXT:COMPILER-LET ((,def ,ctype))
(EVAL-WHEN (COMPILE)
- (UNLESS ,LIBRARY (NOTE-C-FUN ',c-name ,def ',built-in)))
+ (UNLESS ,LIBRARY (NOTE-C-FUN ',c-name ,def ',built-in ,guard)))
(SYSTEM::EVAL-WHEN-COMPILE
(SYSTEM::C-DEFUN ',name (C-TYPE-TO-SIGNATURE ,ctype))))
(WHEN ,def ; found library function
@@ -1110,10 +1114,10 @@
(SYSTEM::%PUTD ',name ,def))
',name)))
-(defun note-c-fun (c-name ctype built-in) ; not ABI, compile-time only
+(defun note-c-fun (c-name ctype built-in guard) ; not ABI, compile-time only
(when (system::prepare-coutput-file)
(prepare-module)
- (push (list c-name ctype built-in)
+ (push (list c-name ctype built-in guard)
*function-list*)))
(defun count-inarguments (arg-vector)

Binary file not shown.

@ -12,7 +12,7 @@ SRC_URI="https://github.com/camlp4/camlp4/archive/${MY_PV}.tar.gz -> ${P}.tar.gz
LICENSE="LGPL-2-with-linking-exception"
SLOT="0/${PV}"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux"
KEYWORDS="~alpha ~amd64 arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux"
IUSE="+ocamlopt"
DEPEND=">=dev-lang/ocaml-4.09.0:=[ocamlopt?]"

@ -11,7 +11,7 @@ inherit perl-module
DESCRIPTION="A module to implement some of AutoConf macros in pure perl"
SLOT="0"
KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86"
KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~sparc ~x86"
IUSE="test"
RESTRICT="!test? ( test )"

@ -11,7 +11,7 @@ inherit perl-module
DESCRIPTION="Perl wrapper for libmagic"
SLOT="0"
KEYWORDS="~amd64 ~ppc64 ~x86"
KEYWORDS="~amd64 ~ppc64 ~sparc ~x86"
IUSE="test"
RESTRICT="!test? ( test )"

Binary file not shown.

Binary file not shown.

@ -12,7 +12,7 @@ SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
LICENSE="MIT"
SLOT="0"
KEYWORDS="amd64 arm arm64 ppc ~ppc64 ~sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
KEYWORDS="amd64 arm arm64 ppc ~ppc64 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
PATCHES=(
# taken from https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=909545

@ -2,3 +2,4 @@ DIST boto3-1.14.23.tar.gz 299581 BLAKE2B 57cbb3fbd9a84f334b5874ca96490cb0269bb79
DIST boto3-1.14.31.tar.gz 300720 BLAKE2B 9dbd002e299c629f28037572c615a00612c80773006c344797d0ad56c81c240b56bfc56e8ffe52e3b404c77a56318532aadfa2d008c254e70f7bfa91e40b7e1a SHA512 e3fe0041bbdc67affcf5d5272c26aa14ef0fa546af2efb99187311bee23531181ab1f1ebc69f2c3ed8250140642f4402334ebbc9acbf422641fa6abed5d5815f
DIST boto3-1.14.46.tar.gz 301815 BLAKE2B e389e7e0cd9ed0907fd13a948bf37e00040e32029d7720f5a720c8c9cb3cf1fb157bb665032b4ba594b3b5f50129088f26f004535fc4f8fe72f32ab0be6ce9b9 SHA512 aa1aa0155fcaaaddcfc24697211e8f5a69eab1282a185f0cb76b02d63d1426c02ca3be71be980214484a351159f6bcc34c3422cd11b9a556d67802c01a06aed0
DIST boto3-1.14.49.tar.gz 301978 BLAKE2B ab27aab54b7e1b531ae063e3a84691820208d5d229664d07aaba4c184d5344eb2a620bd2cf4cd4dc4555cf014926c56c89ee29a9832d7ede4fa46b025914a135 SHA512 bc66702f869cb41c6c6dc7d6f82eb09c962122e108d02daf2c4ee408b7a805193f2f4f9af0c5c96775c8a79975142d1154a32c2fe86b0c6aacd18617ff2934c8
DIST boto3-1.14.52.tar.gz 302219 BLAKE2B 97b93e7e203aba7e0dad8bdace83ac41fb85b5880473721543160dc19da52559db3e095edfea8e0946a8915e1a3c396de598b76a35221a64226d602199b8301e SHA512 f65473d91d45bfbd036413b63ee62688bdf9318a09fb81d7e83d5655b785a7b6b626ec7b61ddc1fef8f3fc46c7acb7becefb632d4ae931335a4568451596673d

@ -0,0 +1,56 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
PYTHON_COMPAT=( python3_{6..9} )
DISTUTILS_USE_SETUPTOOLS=bdepend
inherit distutils-r1
DESCRIPTION="The AWS SDK for Python"
HOMEPAGE="https://github.com/boto/boto3"
LICENSE="Apache-2.0"
SLOT="0"
if [[ "${PV}" == "9999" ]]; then
EGIT_REPO_URI="https://github.com/boto/boto3"
inherit git-r3
BOTOCORE_PV=${PV}
else
SRC_URI="https://github.com/boto/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
KEYWORDS="~amd64 ~arm ~arm64 ~x86 ~amd64-linux ~x86-linux"
# botocore is x.(y+3).z
BOTOCORE_PV="$(ver_cut 1).$(( $(ver_cut 2) + 3)).$(ver_cut 3-)"
fi
RDEPEND="
>=dev-python/botocore-${BOTOCORE_PV}[${PYTHON_USEDEP}]
>=dev-python/jmespath-0.7.1[${PYTHON_USEDEP}]
>=dev-python/s3transfer-0.3.0[${PYTHON_USEDEP}]
"
BDEPEND="
test? (
dev-python/mock[${PYTHON_USEDEP}]
)
"
distutils_enable_sphinx docs/source \
'dev-python/guzzle_sphinx_theme'
distutils_enable_tests nose
python_prepare_all() {
# don't lock versions to narrow ranges
sed -e '/botocore/ d' \
-e '/jmespath/ d' \
-e '/s3transfer/ d' \
-i setup.py || die
# prevent an infinite loop
rm tests/functional/docs/test_smoke.py || die
distutils-r1_python_prepare_all
}
python_test() {
nosetests -v tests/unit/ tests/functional/ || die "test failed under ${EPYTHON}"
}

@ -2,3 +2,4 @@ DIST botocore-1.17.23.tar.gz 6564852 BLAKE2B cc1da91f4a45964fe684b015de9db253059
DIST botocore-1.17.31.tar.gz 6665851 BLAKE2B dbc89d1216f9fda89c6185baccfdf2878c265d8761e4ad1349a45d334f9a4d5b79ad1ce06a19a7a706b75be1a6d7f2a7bf5bc33d8ffbe7ad8a016472edf0432f SHA512 ab1921fae887846d1c224d624e8d5dd888ab9c0c90a415ac97e5ad2f7563131b199e8870553e7f3dd6f5ff4c7901aa04bfa99160aca4e9da8ef3096cfd922ec9
DIST botocore-1.17.46.tar.gz 6738493 BLAKE2B 2e5ee1241af91c19cef0ac575c5ad68d46277e8b2f0f1f719428f7b4026303a47e48b8a8240c1121cfe35c6310be5fde3f0cfa2aa3f3321249811eb510b47f94 SHA512 a11de252454477d478f2b5d0b5978b24961baa3942936ef5990c421709d0b8081e8dbf020b76cce5c3c43d3fe0467cedf5441918767163712e0ad178c9cba80d
DIST botocore-1.17.49.tar.gz 6765351 BLAKE2B c5c40c37d1f1f0f1d7e059a1b88025039be6021723d244725de28d453789a51b19c4feed35d7c862a8238e5d2b4d77fb83f0b0052ce7a7b31c26e024b7be4321 SHA512 912a25c98fa08a89aa8511f00a83712525eaa11a1c8137da3e569a993c54d2c2a3c9566ff88f91cede34dc1d1b155f21ac037f2396b3b3339ddc2c2be7c400d1
DIST botocore-1.17.52.tar.gz 6778122 BLAKE2B 4afb88a7990ca4cd04f113a75f00dcc26569102a3a3b8ad991073577178a86b56b607888ed8d70569affb03fc77d3f89060a1a34059dd33a457eff4f3c31eb5e SHA512 97de510725dcc2db9c57d7e9415f5c22fc30a2737c3785ffc32e53a56cb542dec06468b3a06bf03ae0ae2eb913628b68ca104b1e8f211e5c580606422e5f3267

@ -0,0 +1,62 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
PYTHON_COMPAT=( python3_{6..9} )
inherit distutils-r1
DESCRIPTION="Low-level, data-driven core of boto 3"
HOMEPAGE="https://github.com/boto/botocore"
LICENSE="Apache-2.0"
SLOT="0"
if [[ "${PV}" == "9999" ]]; then
EGIT_REPO_URI="https://github.com/boto/botocore"
inherit git-r3
else
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
KEYWORDS="~amd64 ~arm ~arm64 ~x86 ~amd64-linux ~x86-linux"
fi
RDEPEND="
dev-python/six[${PYTHON_USEDEP}]
dev-python/docutils[${PYTHON_USEDEP}]
dev-python/jmespath[${PYTHON_USEDEP}]
dev-python/python-dateutil[${PYTHON_USEDEP}]
dev-python/urllib3[${PYTHON_USEDEP}]
"
BDEPEND="
test? (
dev-python/mock[${PYTHON_USEDEP}]
dev-python/jsonschema[${PYTHON_USEDEP}]
)
"
PATCHES=(
"${FILESDIR}/1.8.6-tests-pass-all-env-vars-to-cmd-runner.patch"
"${FILESDIR}/botocore-1.16.7-unlock-deps.patch"
)
distutils_enable_sphinx docs/source \
'dev-python/guzzle_sphinx_theme'
distutils_enable_tests nose
src_prepare() {
# py3.9
find -name '*.py' -exec \
sed -i -e 's:cElementTree:ElementTree:' {} + || die
# very unstable
sed -i -e 's:test_stress_test_token_bucket:_&:' \
tests/functional/retries/test_bucket.py || die
distutils-r1_src_prepare
}
python_test() {
# note: suites need to be run separately as one of the unit tests
# seems to be leaking mocks and breaking a few functional tests
nosetests -v tests/unit ||
die "unit tests failed under ${EPYTHON}"
nosetests -v tests/functional ||
die "functional tests failed under ${EPYTHON}"
}

@ -12,7 +12,7 @@ SRC_URI="mirror://pypi/e/${PN}/${P}.tar.gz"
LICENSE="MIT"
SLOT="0"
KEYWORDS="amd64 arm arm64 ppc ppc64 ~s390 ~sparc x86"
KEYWORDS="amd64 arm arm64 ppc ppc64 ~s390 sparc x86"
IUSE="doc examples test"
RDEPEND="

@ -14,7 +14,7 @@ SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~alpha amd64 arm arm64 -hppa -ia64 ~mips ppc ppc64 s390 ~sparc x86 ~amd64-linux ~x86-linux"
KEYWORDS="~alpha amd64 arm arm64 -hppa -ia64 ~mips ppc ppc64 s390 sparc x86 ~amd64-linux ~x86-linux"
IUSE="doc"
DISTUTILS_IN_SOURCE_BUILD=1

@ -13,7 +13,7 @@ SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
SLOT="0"
LICENSE="MIT"
KEYWORDS="amd64 arm arm64 ppc ~ppc64 ~sparc x86"
KEYWORDS="amd64 arm arm64 ppc ~ppc64 sparc x86"
IUSE="test"
RESTRICT="!test? ( test )"

@ -40,7 +40,8 @@ src_prepare() {
src_test() {
local pkgver=$(best_version sys-cluster/zookeeper-bin)
export ZOOKEEPER_VERSION=${pkgver##*-}
pkgver=${pkgver#sys-cluster/zookeeper-bin-}
export ZOOKEEPER_VERSION=${pkgver%-r*}
export ZOOKEEPER_PATH=${BROOT}/opt/zookeeper-bin
distutils-r1_src_test
}

@ -15,7 +15,7 @@ SRC_URI="mirror://pypi/${MY_PN:0:1}/${MY_PN}/${MY_PN}-${PV}.tar.gz"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-macos"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ~ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-macos"
IUSE="libressl"
RDEPEND="

@ -12,7 +12,7 @@ SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="amd64 arm arm64 ~hppa ~ia64 ppc ppc64 ~s390 ~sparc x86"
KEYWORDS="amd64 arm arm64 ~hppa ~ia64 ppc ppc64 ~s390 sparc x86"
IUSE=""
# no tests

@ -15,7 +15,7 @@ SRC_URI="
LICENSE="MIT"
SLOT="0"
KEYWORDS="amd64 arm arm64 ~hppa ~ia64 ~ppc ~ppc64 sparc x86"
KEYWORDS="amd64 arm arm64 ~hppa ~ia64 ppc ~ppc64 sparc x86"
RDEPEND="
dev-python/freezegun[${PYTHON_USEDEP}]

@ -18,7 +18,7 @@ S=${WORKDIR}/${MY_P}
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="amd64 arm arm64 ppc ~ppc64 ~sparc x86"
KEYWORDS="amd64 arm arm64 ppc ~ppc64 sparc x86"
RDEPEND="
>=dev-python/pyasn1-0.1.3[${PYTHON_USEDEP}]

@ -16,7 +16,7 @@ SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz
-> ${P}.gh.tar.gz
)"
KEYWORDS="amd64 arm arm64 ~ia64 ppc ppc64 ~sparc x86"
KEYWORDS="amd64 arm arm64 ~ia64 ppc ppc64 sparc x86"
LICENSE="Apache-2.0"
SLOT="0"

@ -13,7 +13,7 @@ SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
LICENSE="|| ( MIT AFL-2.1 )"
SLOT="0"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ~ppc ~ppc64 s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ~ppc64 s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
DOCS=( README.rst CHANGES.txt )

@ -13,7 +13,7 @@ SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
LICENSE="GPL-3+"
SLOT="0"
KEYWORDS="amd64 arm arm64 ppc ppc64 ~sparc x86"
KEYWORDS="amd64 arm arm64 ppc ppc64 sparc x86"
IUSE="test"
RESTRICT="!test? ( test )"

@ -16,7 +16,7 @@ S="${WORKDIR}/${MY_PN}-${PV}"
LICENSE="MIT"
SLOT="0"
KEYWORDS="amd64 arm arm64 ~hppa ~ia64 ~ppc ~ppc64 sparc x86"
KEYWORDS="amd64 arm arm64 ~hppa ~ia64 ppc ~ppc64 sparc x86"
RDEPEND="
>=dev-python/jaraco-functools-1.20[${PYTHON_USEDEP}]

@ -16,7 +16,7 @@ SRC_URI="mirror://pypi/${P:0:1}/${MY_PN}/${MY_PN}-${MY_PV}.tar.gz"
LICENSE="wxWinLL-3"
SLOT="4.0"
KEYWORDS="~alpha ~amd64 ~arm arm64 ~ppc ~ppc64 ~sparc ~x86"
KEYWORDS="~alpha ~amd64 arm arm64 ~ppc ~ppc64 ~sparc ~x86"
IUSE="test webkit"
RESTRICT="!test? ( test )"

Binary file not shown.

@ -4,3 +4,4 @@ DIST minitest-5.12.2.gem 82432 BLAKE2B fb8df3d5407a96b7be9611c19763a4480c20ac29a
DIST minitest-5.13.0.gem 83968 BLAKE2B 90f2bc20328a5522a51bcfee94d69e6fd03189190a04ee77499d574531e95b8f8b6652cc51a5917e51920f58c0f95465c27c5d69bab7aba01e02502ccf72ae38 SHA512 bdd0d665cfd6f6e36dcb1f2f069f5154a468f68eb4c41f5c39e3a3397644141d5e05024023b20fafbceb983b019b00a0ec6da98432f505cc8fd1cebc11cc1fca
DIST minitest-5.14.0.gem 84992 BLAKE2B 3bf733ae992e83af862773b6b76997b7a3262290c8239fe2871e9d55bfdd0a9c921a88965167a693794e064fcc2efdf9f6c111075f59921c55669fca1a8ada27 SHA512 4d65cbc96fe96bd79fd1dce36ce3b72d8e01efc12dcfeb6264075bb36430110f1c8fb519e0885e3449379fb5237cbdf7e24803ef49034e46ddf1d3a24c56b45f
DIST minitest-5.14.1.gem 84992 BLAKE2B 1bc258ea21ff887381ce9d13ea08f07d6242bf1daa8e65063ac9bfa41c5a9363d0c7e25356d803e780814fcc62c54b9f62e76c7db8e0666f19dbb52bd94e171d SHA512 57a205ce8f71a494d9d8b0343cbc39f8d3ee22f33145b53b6b0bebebc0a2ed542eba3e1df91bf115be0910f0c2e65d5c24be6b595f13e6ccbbe417e06c54ffce
DIST minitest-5.14.2.gem 84992 BLAKE2B 2cca1cbbd7588d2bd77458008a0dce0dcf34e9e68fa0ab7eaa79a72515c3d2399030db61905e84835596dea5e854a4a0708096f3b401ca8fb61c3da0823a8ad5 SHA512 c1cdb87824382233d4ae0570346a6888ecdf0dddbd5fbc9bc136e1c8ed9e1ce57d08d5994f57ba1eee99a38e48a04a10a32288d34ce10ca4ecdfa15587cf602e

@ -0,0 +1,22 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
USE_RUBY="ruby25 ruby26 ruby27"
RUBY_FAKEGEM_DOCDIR="doc"
RUBY_FAKEGEM_EXTRADOC="History.rdoc README.rdoc"
inherit ruby-fakegem
DESCRIPTION="minitest/unit is a small and fast replacement for ruby's huge and slow test/unit"
HOMEPAGE="https://github.com/seattlerb/minitest"
LICENSE="MIT"
SLOT="5"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
IUSE="doc test"
each_ruby_test() {
${RUBY} -Ilib:test:. -e "Dir['**/test_*.rb'].each{|f| require f}" || die "Tests failed"
}

@ -1 +1,2 @@
DIST warden-1.2.8.tar.gz 29841 BLAKE2B 657f9d1b5a7fbf3b07ac8cfa514c410561cce853cbc2e6c7bf6d98deab8f625771b20d339613738a979395638b654b066080fad5a7378b15345cb46e273966c9 SHA512 efd7a416f2da3095d6d33c2dca3a7e09d127fb0abec86e959aba56739ae865ea9a11e234ea1f6d557466d9076e3f271481e20982bc159a3f09a4d55148d45734
DIST warden-1.2.9.tar.gz 29992 BLAKE2B 8a4470c6503c89cb759ebcc155171e86dbb124585d391d6d06c09da0fc0a4095f0235816b9e80895dafe7290584ba49e6699adc9fe8121b2aaee8d1045919b59 SHA512 2ec1129d9afc178c9883a72ffed06f184001147463827f4c5d09475ad65beb084832902a94980e22136400648ad97f2e42a779faf6d49d5a110f545d82a4ddb7

@ -0,0 +1,28 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
USE_RUBY="ruby25 ruby26 ruby27"
RUBY_FAKEGEM_EXTRADOC="CHANGELOG.md README.md"
RUBY_FAKEGEM_RECIPE_TEST="rspec3"
RUBY_FAKEGEM_GEMSPEC="${PN}.gemspec"
inherit ruby-fakegem
DESCRIPTION="General Rack Authentication Framework"
HOMEPAGE="https://github.com/wardencommunity/warden"
SRC_URI="https://github.com/wardencommunity/warden/archive/v${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="MIT"
KEYWORDS="~amd64"
SLOT="0"
IUSE=""
ruby_add_rdepend ">=dev-ruby/rack-2.0.9:*"
all_ruby_prepare() {
sed -i -e 's/git ls-files -z/find . -print0/' ${RUBY_FAKEGEM_GEMSPEC} || die
}

Binary file not shown.

@ -1 +1,2 @@
DIST atanks-6.4.tar.gz 6059315 BLAKE2B ea217b5dceaf63e85e3772369ebab1f76d35175cf8e2d0914e2806db8209f9d4721590f8a285bbfe0938f4957eec409e1581189257f117ec5d5e4c3af59707c1 SHA512 e9410e5bf0e8ec0281718ad8ddca74b67000db96b09b6af8aa906bbf2cd815f07ff550087ecdee2e4c5bfabc42941f184173f35e50538e57bb008372a599e1e6
DIST atanks-6.5.tar.gz 6059648 BLAKE2B 8a5c3e77391d0e7b3dc8170f49e2cd24fb31eda6f29362851d29eba5dc10748d2b95bfb688771fbbdaac4aada253f06c5ce4064e293335ef59cc8accc43a64a0 SHA512 cb1456e06132da754ae5d9926e118ecb8ac7789747f0a3273bcb49311d79824610bb9cfc74fbba8c75bbefe905d63ae2e01d193ccb37a64759f5490328c8cc89

@ -0,0 +1,40 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit desktop gnome2-utils toolchain-funcs
DESCRIPTION="Worms and Scorched Earth-like game"
HOMEPAGE="https://atanks.sourceforge.io/"
SRC_URI="mirror://sourceforge/atanks/${P}.tar.gz"
LICENSE="GPL-2+"
SLOT="0"
KEYWORDS="~amd64 ~x86"
DEPEND="media-libs/allegro:0[X]"
RDEPEND="${DEPEND}"
PATCHES=( "${FILESDIR}"/${PN}-6.4-fix-build-system.patch )
src_configure() {
tc-export CXX
}
src_compile() {
emake INSTALLDIR="${EPREFIX}/usr/share/${PN}"
}
src_install() {
dobin ${PN}
local DOCS=( Changelog README TODO )
einstalldocs
insinto /usr/share/${PN}
doins -r button misc missile sound stock tank tankgun text title unicode.dat *.txt
doicon -s 48 ${PN}.png
make_desktop_entry atanks "Atomic Tanks"
}

Binary file not shown.

@ -27,7 +27,7 @@ SRC_URI="
LICENSE="GPL-2+ GPL-3 Boost-1.0"
SLOT="0"
KEYWORDS="~amd64 ~x86"
KEYWORDS="~amd64 ~arm64 ~x86"
IUSE="test"
RESTRICT="!test? ( test )"

Binary file not shown.

@ -1,3 +1,4 @@
DIST postfix-3.5.1.tar.gz 4609587 BLAKE2B 94b06ed536417ca72729d93f03d4fa2dce602508e4c5816ad902740d4203ad3df66d7380ea41859ab75ab327c0f53bc2bbaf09ba45fe83490d02808426a6253d SHA512 9c091cda6c2d54fefc7093736f69dc60dc4d9d2d858260bde1430427bc49caa59f81aea7a992b9764998a4edaaa015ddd50392b8f0a1bccd15f52b563887a698
DIST postfix-3.5.6.tar.gz 4613310 BLAKE2B b7d236677cc698bb7028b39a25441c1163e65112573756da6c17b3ef64d0917f86fdcb96ab4a20f13ccee0381420301b57e1e41c3fad11d28c7ad70bd2e1f7e3 SHA512 9187981357a3861d735b8601c61851a5b9e53cde5668a0ebc62ca8b922a2629e53fe3369af6beb9df1a6fe6d4d87822d8882e27410a460ea8c98418b17287b9c
DIST postfix-3.6-20200725.tar.gz 4625218 BLAKE2B 4f2d6457e56ea1c49a28e27df13933dab5ebd2fcbc9fdd13ea5873e63b50effc8b0441ce7e21405430ff58169dad117e9045c2aa1735fffd325302ad2e936f43 SHA512 1077ea3f181fa7ea1b4389e1a92d80e2a1a224e7c5a03ef8ca1a550f8f020cff27b7018ed3986d85fd17c0f6989b8d869c547eae43da94bd943ae08795faa257
DIST postfix-3.5.7.tar.gz 4613756 BLAKE2B 9fa7de3e6d7d20c549c6f26d77d9a0973e789f1b6650a13be08ddc35d047b0ba6e7e75dcb5749e0772cd1e821a9e2f40891c0422bc47a90be166cc937050bc52 SHA512 7828210bc9d3eadfd47f1121ae2f7ca057e03391048e8e79fbf2f96f6677f5e17145f5869d6f5c0b735ecd8584f420df7ba4922f54686f1a5be663bff257f2c2
DIST postfix-3.6-20200830.tar.gz 4649178 BLAKE2B f6553201213df338cb4d339b862eee69ad022756f2829e5e4a655b849f98155ff60211d9ae490b3a2d9f23da9c9ef71f45386ce374f6f51a217061eac10b513e SHA512 101d073348f13fc52897be7995a04455e171c9b4e2a42eca2cce86a294d3d3ed13c65b8b3660798ae7bd8c347c5d3094be8ac91d8931d3b80a47f8d5b91942c1

@ -0,0 +1,316 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit flag-o-matic pam systemd toolchain-funcs
MY_PV="${PV/_rc/-RC}"
MY_SRC="${PN}-${MY_PV}"
MY_URI="ftp://ftp.porcupine.org/mirrors/postfix-release/official"
RC_VER="2.7"
DESCRIPTION="A fast and secure drop-in replacement for sendmail"
HOMEPAGE="http://www.postfix.org/"
SRC_URI="${MY_URI}/${MY_SRC}.tar.gz"
LICENSE="|| ( IBM EPL-2.0 )"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86"
IUSE="+berkdb cdb dovecot-sasl +eai hardened ldap ldap-bind libressl lmdb memcached mbox mysql nis pam postgres sasl selinux sqlite ssl"
DEPEND=">=dev-libs/libpcre-3.4
dev-lang/perl
berkdb? ( >=sys-libs/db-3.2:* )
cdb? ( || ( >=dev-db/tinycdb-0.76 >=dev-db/cdb-0.75-r4 ) )
eai? ( dev-libs/icu:= )
ldap? ( net-nds/openldap )
ldap-bind? ( net-nds/openldap[sasl] )
lmdb? ( >=dev-db/lmdb-0.9.11 )
mysql? ( dev-db/mysql-connector-c:0= )
nis? ( net-libs/libnsl )
pam? ( sys-libs/pam )
postgres? ( dev-db/postgresql:* )
sasl? ( >=dev-libs/cyrus-sasl-2 )
sqlite? ( dev-db/sqlite:3 )
ssl? (
!libressl? ( dev-libs/openssl:0= )
libressl? ( >=dev-libs/libressl-2.9.1:0= )
)"
RDEPEND="${DEPEND}
acct-group/postfix
acct-group/postdrop
acct-user/postfix
memcached? ( net-misc/memcached )
net-mail/mailbase
!mail-mta/courier
!mail-mta/esmtp
!mail-mta/exim
!mail-mta/mini-qmail
!mail-mta/msmtp[mta]
!mail-mta/netqmail
!mail-mta/nullmailer
!mail-mta/qmail-ldap
!mail-mta/sendmail
!mail-mta/opensmtpd
!mail-mta/ssmtp[mta]
!net-mail/fastforward
selinux? ( sec-policy/selinux-postfix )"
REQUIRED_USE="ldap-bind? ( ldap sasl )"
S="${WORKDIR}/${MY_SRC}"
PATCHES=(
"${FILESDIR}/${PN}-libressl-certkey.patch"
"${FILESDIR}/${PN}-libressl-server.patch"
)
src_prepare() {
default
sed -i -e "/^#define ALIAS_DB_MAP/s|:/etc/aliases|:/etc/mail/aliases|" \
src/util/sys_defs.h || die "sed failed"
# change default paths to better comply with portage standard paths
sed -i -e "s:/usr/local/:/usr/:g" conf/master.cf || die "sed failed"
}
src_configure() {
for name in CDB LDAP LMDB MYSQL PCRE PGSQL SDBM SQLITE
do
local AUXLIBS_${name}=""
done
# Make sure LDFLAGS get passed down to the executables.
local mycc="-DHAS_PCRE" mylibs="${LDFLAGS} -ldl"
AUXLIBS_PCRE="$(pcre-config --libs)"
use pam && mylibs="${mylibs} -lpam"
if use ldap; then
mycc="${mycc} -DHAS_LDAP"
AUXLIBS_LDAP="-lldap -llber"
fi
if use mysql; then
mycc="${mycc} -DHAS_MYSQL $(mysql_config --include)"
AUXLIBS_MYSQL="$(mysql_config --libs)"
fi
if use postgres; then
mycc="${mycc} -DHAS_PGSQL -I$(pg_config --includedir)"
AUXLIBS_PGSQL="-L$(pg_config --libdir) -lpq"
fi
if use sqlite; then
mycc="${mycc} -DHAS_SQLITE"
AUXLIBS_SQLITE="-lsqlite3 -lpthread"
fi
if use ssl; then
mycc="${mycc} -DUSE_TLS"
mylibs="${mylibs} -lssl -lcrypto"
fi
if use lmdb; then
mycc="${mycc} -DHAS_LMDB"
AUXLIBS_LMDB="-llmdb -lpthread"
fi
if ! use eai; then
mycc="${mycc} -DNO_EAI"
fi
# broken. and "in other words, not supported" by upstream.
# Use inet_protocols setting in main.cf
#if ! use ipv6; then
# mycc="${mycc} -DNO_IPV6"
#fi
if use sasl; then
if use dovecot-sasl; then
# Set dovecot as default.
mycc="${mycc} -DDEF_SASL_SERVER=\\\"dovecot\\\""
fi
if use ldap-bind; then
mycc="${mycc} -DUSE_LDAP_SASL"
fi
mycc="${mycc} -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/usr/include/sasl"
mylibs="${mylibs} -lsasl2"
elif use dovecot-sasl; then
mycc="${mycc} -DUSE_SASL_AUTH -DDEF_SERVER_SASL_TYPE=\\\"dovecot\\\""
fi
if ! use nis; then
mycc="${mycc} -DNO_NIS"
fi
if ! use berkdb; then
mycc="${mycc} -DNO_DB"
if use cdb; then
# change default hash format from Berkeley DB to cdb
mycc="${mycc} -DDEF_DB_TYPE=\\\"cdb\\\""
fi
fi
if use cdb; then
mycc="${mycc} -DHAS_CDB -I/usr/include/cdb"
# Tinycdb is preferred.
if has_version dev-db/tinycdb ; then
einfo "Building with dev-db/tinycdb"
AUXLIBS_CDB="-lcdb"
else
einfo "Building with dev-db/cdb"
CDB_PATH="/usr/$(get_libdir)"
for i in cdb.a alloc.a buffer.a unix.a byte.a ; do
AUXLIBS_CDB="${AUXLIBS_CDB} ${CDB_PATH}/${i}"
done
fi
fi
# Robin H. Johnson <robbat2@gentoo.org> 17/Nov/2006
# Fix because infra boxes hit 2Gb .db files that fail a 32-bit fstat signed check.
mycc="${mycc} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE"
filter-lfs-flags
# Workaround for bug #76512
if use hardened; then
[[ "$(gcc-version)" == "3.4" ]] && replace-flags -O? -Os
fi
# Remove annoying C++ comment style warnings - bug #378099
append-flags -Wno-comment
sed -i -e "/^RANLIB/s/ranlib/$(tc-getRANLIB)/g" "${S}"/makedefs
sed -i -e "/^AR/s/ar/$(tc-getAR)/g" "${S}"/makedefs
emake makefiles shared=yes dynamicmaps=no pie=yes \
shlib_directory="/usr/$(get_libdir)/postfix/MAIL_VERSION" \
DEBUG="" CC="$(tc-getCC)" OPT="${CFLAGS}" CCARGS="${mycc}" AUXLIBS="${mylibs}" \
AUXLIBS_CDB="${AUXLIBS_CDB}" AUXLIBS_LDAP="${AUXLIBS_LDAP}" \
AUXLIBS_LMDB="${AUXLIBS_LMDB}" AUXLIBS_MYSQL="${AUXLIBS_MYSQL}" \
AUXLIBS_PCRE="${AUXLIBS_PCRE}" AUXLIBS_PGSQL="${AUXLIBS_PGSQL}" \
AUXLIBS_SQLITE="${AUXLIBS_SQLITE}"
}
src_install() {
LD_LIBRARY_PATH="${S}/lib" \
/bin/sh postfix-install \
-non-interactive \
install_root="${D}" \
config_directory="/etc/postfix" \
manpage_directory="/usr/share/man" \
command_directory="/usr/sbin" \
mailq_path="/usr/bin/mailq" \
newaliases_path="/usr/bin/newaliases" \
sendmail_path="/usr/sbin/sendmail" \
|| die "postfix-install failed"
# Fix spool removal on upgrade
rm -Rf "${D}"/var
keepdir /var/spool/postfix
# Install rmail for UUCP, closes bug #19127
dobin auxiliary/rmail/rmail
# Provide another link for legacy FSH
dosym ../sbin/sendmail /usr/$(get_libdir)/sendmail
# Install qshape, posttls-finger and collate
dobin auxiliary/qshape/qshape.pl
doman man/man1/qshape.1
dobin bin/posttls-finger
doman man/man1/posttls-finger.1
dobin auxiliary/collate/collate.pl
newdoc auxiliary/collate/README README.collate
# Performance tuning tools and their manuals
dosbin bin/smtp-{source,sink} bin/qmqp-{source,sink}
doman man/man1/smtp-{source,sink}.1 man/man1/qmqp-{source,sink}.1
# Set proper permissions on required files/directories
keepdir /var/lib/postfix
fowners -R postfix:postfix /var/lib/postfix
fperms 0750 /var/lib/postfix
fowners root:postdrop /usr/sbin/post{drop,queue}
fperms 02755 /usr/sbin/post{drop,queue}
keepdir /etc/postfix
keepdir /etc/postfix/postfix-files.d
if use mbox; then
mypostconf="mail_spool_directory=/var/spool/mail"
else
mypostconf="home_mailbox=.maildir/"
fi
LD_LIBRARY_PATH="${S}/lib" \
"${D}"/usr/sbin/postconf -c "${D}"/etc/postfix \
-e ${mypostconf} || die "postconf failed"
insinto /etc/postfix
newins "${FILESDIR}"/smtp.pass saslpass
fperms 600 /etc/postfix/saslpass
newinitd "${FILESDIR}"/postfix.rc6.${RC_VER} postfix
# do not start mysql/postgres unnecessarily - bug #359913
use mysql || sed -i -e "s/mysql //" "${D}/etc/init.d/postfix"
use postgres || sed -i -e "s/postgresql //" "${D}/etc/init.d/postfix"
dodoc *README COMPATIBILITY HISTORY PORTING RELEASE_NOTES*
mv "${S}"/examples "${D}"/usr/share/doc/${PF}/
# postfix set-permissions expects uncompressed man files
docompress -x /usr/share/man
pamd_mimic_system smtp auth account
if use sasl; then
insinto /etc/sasl2
newins "${FILESDIR}"/smtp.sasl smtpd.conf
fi
# header files
insinto /usr/include/postfix
doins include/*.h
if has_version mail-mta/postfix; then
# let the sysadmin decide when to change the compatibility_level
sed -i -e /^compatibility_level/"s/^/#/" "${D}"/etc/postfix/main.cf || die
fi
systemd_dounit "${FILESDIR}/${PN}.service"
}
pkg_preinst() {
if has_version '<mail-mta/postfix-3.4'; then
elog
elog "Postfix-3.4 introduces a new master.cf service 'postlog'"
elog "with type 'unix-dgram' that is used by the new postlogd(8) daemon."
elog "Before backing out to an older Postfix version, edit the master.cf"
elog "file and remove the postlog entry."
elog
fi
}
pkg_postinst() {
if [[ ! -e /etc/mail/aliases.db ]] ; then
ewarn
ewarn "You must edit /etc/mail/aliases to suit your needs"
ewarn "and then run /usr/bin/newaliases. Postfix will not"
ewarn "work correctly without it."
ewarn
fi
# check and fix file permissions
"${EROOT}"/usr/sbin/postfix set-permissions
# configure tls
if use ssl ; then
if "${EROOT}"/usr/sbin/postfix tls all-default-client; then
elog "To configure client side TLS settings:"
elog "${EROOT}"/usr/sbin/postfix tls enable-client
fi
if "${EROOT}"/usr/sbin/postfix tls all-default-server; then
elog "To configure server side TLS settings:"
elog "${EROOT}"/usr/sbin/postfix tls enable-server
fi
fi
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save