Sync with portage [Wed Oct 6 08:27:11 MSK 2021].

akrasnyh 2094
root 3 years ago
parent c98d729d36
commit 525872a75f

Binary file not shown.

Binary file not shown.

@ -1 +1,2 @@
DIST ansible-lint-5.0.12.tar.gz 348478 BLAKE2B 3ea2a0adb82bd21322fa9a2d4c8dd4f41345f909401341748e8395aa8acf92bfc8058ee679a594c886327480bb808e69622e874c9def97c406265a0828a314eb SHA512 06b84d098253ab70f9c3fb59e1d2ba4d30918f1e7c6f3decc8f73fe8cdb7d697527eff3efcc7238fc952bc07b7179d37582d5fb9968e691e2df5495741802404
DIST ansible-lint-5.2.0.tar.gz 356238 BLAKE2B 7c8bdb1486d7fca5f6addbb87075d98b51e9af4e5544f5bd272ee2a4648d289e48e3922246f7c681fa3450cb881b1da8e098d715bd49e3d75783c812e9863a7b SHA512 d3c1da5f0ee648ac7b5f32d4ae186a24cda11fba4fccd4d5d43dbd228986793f975b43895db07855a80528fe684f6adfc4be451aeed7109d65dfae6c351b6c47

@ -4,7 +4,7 @@
EAPI=7
PYTHON_COMPAT=( python3_{8..9} )
DISTUTILS_USE_SETUPTOOLS=rdepend
inherit distutils-r1
DESCRIPTION="Checks ansible playbooks for practices and behaviour that can be improved"

@ -0,0 +1,39 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{8..9} )
inherit distutils-r1
DESCRIPTION="Checks ansible playbooks for practices and behaviour that can be improved"
HOMEPAGE="https://github.com/ansible-community/ansible-lint"
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~riscv"
# Many tests require still-unpackaged yamlllint
RESTRICT="test"
RDEPEND="
>=app-admin/ansible-2.10[${PYTHON_USEDEP}]
>=app-admin/ansible-base-2.11.4[${PYTHON_USEDEP}]
>=dev-python/enrich-1.2.6[${PYTHON_USEDEP}]
dev-python/packaging[${PYTHON_USEDEP}]
dev-python/pyyaml[${PYTHON_USEDEP}]
>=dev-python/rich-9.5.1[${PYTHON_USEDEP}]
>=dev-python/ruamel-yaml-0.15.37[${PYTHON_USEDEP}]
dev-python/tenacity[${PYTHON_USEDEP}]
>=dev-python/wcmatch-7.0[${PYTHON_USEDEP}]"
BDEPEND="
>=dev-python/setuptools_scm-1.15.0[${PYTHON_USEDEP}]
>=dev-python/setuptools_scm_git_archive-1.0[${PYTHON_USEDEP}]
test? (
>=dev-python/flaky-3.7.0[${PYTHON_USEDEP}]
>=dev-python/pytest-xdist-2.1.0[${PYTHON_USEDEP}]
)"
distutils_enable_tests pytest

@ -1,7 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<!-- maintainer-needed -->
<maintainer type="person">
<email>monsieurp@gentoo.org</email>
<name>Patrice Clement</name>
</maintainer>
<maintainer type="person">
<email>marecki@gentoo.org</email>
<name>Marek Szuba</name>
</maintainer>
<upstream>
<remote-id type="pypi">ansible-lint</remote-id>
<remote-id type="github">ansible-community/ansible-lint</remote-id>

@ -1,3 +1 @@
DIST httpd-2.4.48.tar.bz2 7194385 BLAKE2B 5006535dc15b703b4388d90d57559bd882f16210c2f38f4d773312ed8322803629deee18709ca4446000c20c94ff8b0037acbe4dddab9cdbe45417079f708039 SHA512 6c250626f1e7d10428a92d984fd48ff841effcc8705f7816ab71b681bbd51d0012ad158dcd13763fe7d630311f2de258b27574603140d648be42796ab8326724
DIST httpd-2.4.49.tar.bz2 7199599 BLAKE2B 78614647335a2351ce3ffb67f79bffd4aa0f42080a46de1f8d8a75c2ccae24998f5d505e60e9d4a710ff763e6a8cb3abee3da34ff6a7f2e18b68029a8abe80b7 SHA512 418e277232cf30a81d02b8554e31aaae6433bbea842bdb81e47a609469395cc4891183fb6ee02bd669edb2392c2007869b19da29f5998b8fd5c7d3142db310dd
DIST httpd-2.4.50.tar.bz2 7653174 BLAKE2B 6bdb26bc03347b9643e973d22726ef283b8d92b675f81e85f4e0470bedf8510bac60cd043fe966bc786d5ae47827ac1bb31da88a0e510f4bb6c665e2075c3beb SHA512 b1afbaf44e503b822ff2b443881dcb44a93aa55d496f88ae399a2e7def05f78590f266a16da1f2c0aac88e463b76fba20843b1e20a102e76c8269de6fae3e158

@ -1,103 +0,0 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit toolchain-funcs
DESCRIPTION="Useful Apache tools - htdigest, htpasswd, ab, htdbm"
HOMEPAGE="https://httpd.apache.org/"
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 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc64-solaris ~x64-solaris"
IUSE="ssl"
RESTRICT="test"
RDEPEND=">=dev-libs/apr-1.5.0:1=
dev-libs/apr-util:1=
dev-libs/expat
dev-libs/libpcre
virtual/libcrypt:=
kernel_linux? ( sys-apps/util-linux )
ssl? ( dev-libs/openssl:0= )"
DEPEND="${RDEPEND}
sys-devel/libtool"
BDEPEND="virtual/pkgconfig"
S="${WORKDIR}/httpd-${PV}"
PATCHES=(
"${FILESDIR}/${PN}-2.4.7-Makefile.patch" #459446
)
src_prepare() {
default
# This package really should upgrade to using pcre's .pc file.
cat <<-\EOF >"${T}"/pcre-config
#!/bin/bash
flags=()
for flag; do
if [[ ${flag} == "--version" ]]; then
flags+=( --modversion )
else
flags+=( "${flag}" )
fi
done
exec ${PKG_CONFIG} libpcre "${flags[@]}"
EOF
chmod a+x "${T}"/pcre-config || die
}
src_configure() {
# Brain dead check.
tc-is-cross-compiler && export ap_cv_void_ptr_lt_long="no"
tc-export PKG_CONFIG
local myeconfargs=(
--libexecdir="${EPREFIX}"/usr/$(get_libdir)/apache2/modules
--sbindir="${EPREFIX}"/usr/sbin
--with-perl="${EPREFIX}"/usr/bin/perl
--with-expat="${EPREFIX}"/usr
--with-z="${EPREFIX}"/usr
--with-apr="${SYSROOT}${EPREFIX}"/usr
--with-apr-util="${SYSROOT}${EPREFIX}"/usr
--with-pcre="${T}"/pcre-config
$(use_enable ssl)
$(usex ssl '--with-ssl="${EPREFIX}"/usr' '')
)
# econf overwrites the stuff from config.layout.
ac_cv_path_PKGCONFIG="${PKG_CONFIG}" \
econf "${myeconfargs[@]}"
sed -i \
-e '/^LTFLAGS/s:--silent::' \
build/rules.mk build/config_vars.mk || die
}
src_compile() {
emake -C support
}
src_install() {
emake -C support DESTDIR="${D}" install
dodoc CHANGES
doman docs/man/{dbmmanage,htdigest,htpasswd,htdbm,ab,logresolve}.1 \
docs/man/{htcacheclean,rotatelogs}.8
# Providing compatiblity symlinks for #177697 (which we'll stop to install
# at some point).
pushd "${ED}"/usr/sbin >/dev/null || die
local i
for i in *; do
dosym ${i} /usr/sbin/${i}2
done
popd >/dev/null || die
# Provide a symlink for ab-ssl
if use ssl ; then
dosym ab /usr/bin/ab-ssl
dosym ab /usr/bin/ab2-ssl
fi
}

@ -1,103 +0,0 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit toolchain-funcs
DESCRIPTION="Useful Apache tools - htdigest, htpasswd, ab, htdbm"
HOMEPAGE="https://httpd.apache.org/"
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 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc64-solaris ~x64-solaris"
IUSE="ssl"
RESTRICT="test"
RDEPEND=">=dev-libs/apr-1.5.0:1=
dev-libs/apr-util:1=
dev-libs/expat
dev-libs/libpcre
virtual/libcrypt:=
kernel_linux? ( sys-apps/util-linux )
ssl? ( dev-libs/openssl:0= )"
DEPEND="${RDEPEND}
sys-devel/libtool"
BDEPEND="virtual/pkgconfig"
S="${WORKDIR}/httpd-${PV}"
PATCHES=(
"${FILESDIR}/${PN}-2.4.7-Makefile.patch" #459446
)
src_prepare() {
default
# This package really should upgrade to using pcre's .pc file.
cat <<-\EOF >"${T}"/pcre-config
#!/bin/bash
flags=()
for flag; do
if [[ ${flag} == "--version" ]]; then
flags+=( --modversion )
else
flags+=( "${flag}" )
fi
done
exec ${PKG_CONFIG} libpcre "${flags[@]}"
EOF
chmod a+x "${T}"/pcre-config || die
}
src_configure() {
# Brain dead check.
tc-is-cross-compiler && export ap_cv_void_ptr_lt_long="no"
tc-export PKG_CONFIG
local myeconfargs=(
--libexecdir="${EPREFIX}"/usr/$(get_libdir)/apache2/modules
--sbindir="${EPREFIX}"/usr/sbin
--with-perl="${EPREFIX}"/usr/bin/perl
--with-expat="${EPREFIX}"/usr
--with-z="${EPREFIX}"/usr
--with-apr="${SYSROOT}${EPREFIX}"/usr
--with-apr-util="${SYSROOT}${EPREFIX}"/usr
--with-pcre="${T}"/pcre-config
$(use_enable ssl)
$(usex ssl '--with-ssl="${EPREFIX}"/usr' '')
)
# econf overwrites the stuff from config.layout.
ac_cv_path_PKGCONFIG="${PKG_CONFIG}" \
econf "${myeconfargs[@]}"
sed -i \
-e '/^LTFLAGS/s:--silent::' \
build/rules.mk build/config_vars.mk || die
}
src_compile() {
emake -C support
}
src_install() {
emake -C support DESTDIR="${D}" install
dodoc CHANGES
doman docs/man/{dbmmanage,htdigest,htpasswd,htdbm,ab,logresolve}.1 \
docs/man/{htcacheclean,rotatelogs}.8
# Providing compatiblity symlinks for #177697 (which we'll stop to install
# at some point).
pushd "${ED}"/usr/sbin >/dev/null || die
local i
for i in *; do
dosym ${i} /usr/sbin/${i}2
done
popd >/dev/null || die
# Provide a symlink for ab-ssl
if use ssl ; then
dosym ab /usr/bin/ab-ssl
dosym ab /usr/bin/ab2-ssl
fi
}

@ -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 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc64-solaris ~x64-solaris"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc64-solaris ~x64-solaris"
IUSE="ssl"
RESTRICT="test"

@ -2,3 +2,4 @@ DIST awscli-1.20.28.tar.gz 2058578 BLAKE2B 3f6993a41f46ad9d8d45cebc0d5ea95a954e1
DIST awscli-1.20.40.tar.gz 2071857 BLAKE2B b2511d610c13b4ddf8b1f5c6442f0939072eecf81d97805800bd83b6f481d744ad4344dace6e6553e3d4b7cbf9546f911398311cb04fb698a418579e784539a3 SHA512 aa39a8d67cd8efc63687929f19d5878269ce7f3155a0a64ca2f271251a334f57d2358aa4f0aee76415aee33fe23a1e3b19eb2c6dcfa21e8c0fb7409f5d29a001
DIST awscli-1.20.47.tar.gz 2079314 BLAKE2B 2c202ed3e3527a6881c3f9ca73e8639732442948c6cd6a79fc3fe64de38ff56f7e595f0a0e4badeade81624f8a0323f435b63199a138ce90acb0a1785a326dcf SHA512 ad7be0753549c6f82f6f9a8631cbb8c56526ef17eb0152298bb78365735d4454ec4efb44a6858d01f31cff2ae54ad6a11e0afff3277dde2b70415d58bfb81c86
DIST awscli-1.20.53.tar.gz 2081402 BLAKE2B 88d56df063ae6473122913e4713e17bfd8c32961477b8e723ed3c0c0b7dc72ccc4dfd8d897699e2060a2b65a198b96eccf77accdac9a21510aa56dba5423b76e SHA512 48576b535bdf6b9e6397eadd589c41eeec480d2eaf3035ca6e64bd86984aba9170a83b71c0f7f3f64cfaebaf5104fe3adcdaebace5166343fb3b772f5ad8ccfd
DIST awscli-1.20.54.tar.gz 2082080 BLAKE2B 157e35ab297d18aa9739319801e28fabfbd9f68a2ea6215052d11821f96e8df022fe45ba9b34cc9e62ca59186fd16aeda453813f7ad86f96d2b6e483f8fd89a1 SHA512 845e5746808bb40ff41b4a3280bce7787fa6278f3b9176c8ae1237b06d1c6ea01a132ab8b4134d369380823d758c16317a1985ca9f307d17824d2cad5c92858e

@ -0,0 +1,47 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{8..10} )
inherit bash-completion-r1 distutils-r1
DESCRIPTION="Universal Command Line Environment for AWS"
HOMEPAGE="https://pypi.org/project/awscli/"
#SRC_URI="mirror://pypi/${P:0:1}/${PN}/${P}.tar.gz"
SRC_URI="https://github.com/aws/aws-cli/archive/${PV}.tar.gz -> ${P}.tar.gz"
S="${WORKDIR}/aws-cli-${PV}"
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~amd64 ~arm64 ~x86"
# botocore is x.(y+1).z
BOTOCORE_PV="$(ver_cut 1).$(( $(ver_cut 2) + 1)).$(ver_cut 3-)"
RDEPEND="
>=dev-python/botocore-${BOTOCORE_PV}[${PYTHON_USEDEP}]
dev-python/colorama[${PYTHON_USEDEP}]
dev-python/docutils[${PYTHON_USEDEP}]
dev-python/rsa[${PYTHON_USEDEP}]
>=dev-python/s3transfer-0.4.0[${PYTHON_USEDEP}]
dev-python/pyyaml[${PYTHON_USEDEP}]
"
distutils_enable_tests --install pytest
python_test() {
distutils_install_for_testing
# integration tests require AWS credentials and Internet access
epytest tests/{functional,unit}
}
python_install_all() {
newbashcomp bin/aws_bash_completer aws
insinto /usr/share/zsh/site-functions
newins bin/aws_zsh_completer.sh _aws
distutils-r1_python_install_all
rm "${ED}"/usr/bin/{aws.cmd,aws_bash_completer,aws_zsh_completer.sh} || die
}

@ -1,2 +1 @@
DIST hcloud-1.25.1.tar.xz 1164932 BLAKE2B 21d3a0def3684a25c0cb629320f5617c93090d33cc95e66c42355c01afaf3189f8da858028220350bc1f1f53992b289ea75b56196d94ae41323602c4e8fee1a8 SHA512 aba79869553b19f6a117dc4d9f31935582e9ad89d12d9fd8f70087064383b76324483c78890ddb5965f98f2ca783ca46a17dee97b21716a1ff916647c1267a67
DIST hcloud-1.28.1.tar.xz 1498600 BLAKE2B 9489f1c119d941999a3dd6794545704e9946850bb4fef4799a1560fbc50fecc928a93437c3d7221cedbf5435d23d500bec5ffbe4b16dd754ebe934b0e7f57aeb SHA512 146fb1673fcf0939c20ed0259bc69bf05e8971fe20a25cf560023ced4631ac6d470dd270e92c44e26a1131f6cffa3ce339d4524401318764540d8a06ac3cc11f

@ -1,34 +0,0 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
DESCRIPTION="A command-line interface for Hetzner Cloud"
HOMEPAGE="https://github.com/hetznercloud/cli"
SRC_URI="https://dev.gentoo.org/~ago/distfiles/${P}.tar.xz"
LICENSE="MIT"
SLOT="0"
KEYWORDS="amd64"
IUSE=""
DEPEND="dev-lang/go:="
RESTRICT="strip"
QA_FLAGS_IGNORED=".*"
src_compile() {
go build -mod vendor -o ${PN} -ldflags "-w -X github.com/hetznercloud/cli/cli.Version=${PV}-gentoo" ./cmd/${PN} || die "build failed"
}
src_test() {
# For upstream a simple test is run 'hcloud version'
./hcloud version
if [[ $? -ne 0 ]]
then
die "Test failed"
fi
}
src_install() {
dobin ${PN}
}

@ -9,7 +9,7 @@ SRC_URI="https://dev.gentoo.org/~ago/distfiles/${P}.tar.xz"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64"
KEYWORDS="amd64"
IUSE=""
DEPEND="dev-lang/go:="

Binary file not shown.

@ -1,2 +1 @@
DIST clamav-0.103.2.tar.gz 13387954 BLAKE2B de0ececd2fe4486d2e8194dbeb45bfb74086ab3eb45fcab7590e75aa5a2242981066a4e8fa99b571cf7278f4516d986ad1a24254a8fe2c5caf4c870b3179c4b6 SHA512 87d47c4529a57da0b47b3744a279996ca24fa74ce10d7e27a53c19c1e13098af680e0e48ed767122bb2bbd3f927302451da84ccf51a933e7e3556ef43cbe9f45
DIST clamav-0.103.3.tar.gz 13389239 BLAKE2B 1846cceed39fbd48fcf973d05a57901cf6f9ccdbb4d7eae501e712d84ab4d0a662e4477696aa6a1446116db85a89603428d7092a55e18f7acb805016d3cd5431 SHA512 c2ee24a6f63735c064140aa5baa347d51e8240b2f7eced3480d05435202aedd481fa7057fd40ecbc2e93a62fe8b0cefb574d8accdf9acede643ffbe0d396686f

@ -1,240 +0,0 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit autotools flag-o-matic systemd tmpfiles
DESCRIPTION="Clam Anti-Virus Scanner"
HOMEPAGE="https://www.clamav.net/"
SRC_URI="https://www.clamav.net/downloads/production/${P}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ppc ppc64 ~sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris ~x86-solaris"
IUSE="bzip2 doc clamonacc clamdtop clamsubmit iconv ipv6 libclamav-only milter metadata-analysis-api selinux systemd test uclibc xml"
REQUIRED_USE="libclamav-only? ( !clamonacc !clamdtop !clamsubmit !milter !metadata-analysis-api )"
RESTRICT="!test? ( test )"
# Require acct-{user,group}/clamav at build time so that we can set
# the permissions on /var/lib/clamav in src_install rather than in
# pkg_postinst; calling "chown" on the live filesystem scares me.
CDEPEND="acct-group/clamav
acct-user/clamav
dev-libs/libltdl
dev-libs/libmspack
|| ( dev-libs/libpcre2 >dev-libs/libpcre-6 )
dev-libs/tomsfastmath
>=sys-libs/zlib-1.2.2:=
bzip2? ( app-arch/bzip2 )
clamdtop? ( sys-libs/ncurses:0 )
clamsubmit? ( net-misc/curl dev-libs/json-c:= )
elibc_musl? ( sys-libs/fts-standalone )
iconv? ( virtual/libiconv )
!libclamav-only? ( net-misc/curl )
dev-libs/openssl:0=
milter? ( || ( mail-filter/libmilter mail-mta/sendmail ) )
xml? ( dev-libs/libxml2 )"
# We need at least autoconf-2.69-r5 because that's the first (patched)
# version of it in Gentoo that supports ./configure --runstatedir.
BDEPEND=">=sys-devel/autoconf-2.69-r5
virtual/pkgconfig"
DEPEND="${CDEPEND}
metadata-analysis-api? ( dev-libs/json-c:* )
test? ( dev-libs/check )"
RDEPEND="${CDEPEND}
selinux? ( sec-policy/selinux-clamav )"
PATCHES=(
"${FILESDIR}/${PN}-0.102.1-libxml2_pkgconfig.patch" #661328
"${FILESDIR}/${PN}-0.102.2-fix-curl-detection.patch" #709616
"${FILESDIR}/${PN}-0.103.0-system-tomsfastmath.patch" # 649394
"${FILESDIR}/${PN}-0.103.1-upstream-openrc.patch"
)
src_prepare() {
default
# Be extra sure that we're using the system copy of tomsfastmath
einfo "removing bundled copy of dev-libs/tomsfastmath"
rm -r libclamav/tomsfastmath || \
die "failed to remove bundled tomsfastmath"
AT_NO_RECURSIVE="yes" eautoreconf
}
src_configure() {
use elibc_musl && append-ldflags -lfts
use ppc64 && append-flags -mminimal-toc
use uclibc && export ac_cv_type_error_t=yes
# according to configure help it should be
# $(use_enable xml)
# but that does not work
# do not add this, since --disable-xml seems to override
# --without-xml
JSONUSE="--without-libjson"
if use clamsubmit || use metadata-analysis-api; then
# either of those 2 requires libjson.
# clamsubmit will be built as soon as libjson and curl are found
# but we only install the binary if requested
JSONUSE="--with-libjson=${EPREFIX}/usr"
fi
local myeconfargs=(
$(use_enable bzip2)
$(use_enable clamonacc)
$(use_enable clamdtop)
$(use_enable ipv6)
$(use_enable milter)
$(use_enable test check)
$(use_with xml)
$(use_with iconv)
${JSONUSE}
$(use_enable libclamav-only)
$(use_with !libclamav-only libcurl)
--with-system-libmspack
--cache-file="${S}"/config.cache
--disable-experimental
--disable-static
--disable-zlib-vcheck
--enable-id-check
--with-dbdir="${EPREFIX}"/var/lib/clamav
# Don't call --with-zlib=/usr (see bug #699296)
--with-zlib
--disable-llvm
--enable-openrc
--runstatedir=/run
)
econf "${myeconfargs[@]}"
}
src_install() {
default
rm -rf "${ED}"/var/lib/clamav || die
if ! use libclamav-only ; then
if use systemd; then
# The tmpfiles entry is behind USE=systemd because the
# upstream OpenRC service files should (and do) ensure that
# the directories they need exist and have the correct
# permissions without the help of opentmpfiles. There are
# years-old root exploits in opentmpfiles, the design is
# fundamentally flawed, and the maintainer is not up to
# the task of fixing it.
dotmpfiles "${FILESDIR}/tmpfiles.d/clamav.conf"
systemd_newunit "${FILESDIR}/clamd_at.service" "clamd@.service"
systemd_dounit "${FILESDIR}/clamd.service"
systemd_newunit "${FILESDIR}/freshclamd.service-r1" \
"freshclamd.service"
fi
insinto /etc/logrotate.d
newins "${FILESDIR}/clamd.logrotate" clamd
newins "${FILESDIR}/freshclam.logrotate" freshclam
use milter && \
newins "${FILESDIR}/clamav-milter.logrotate" clamav-milter
# Modify /etc/{clamd,freshclam}.conf to be usable out of the box
sed -i -e "s:^\(Example\):\# \1:" \
-e "s/^#\(PidFile .*\)/\1/" \
-e "s/^#\(LocalSocket .*\)/\1/" \
-e "s/^#\(User .*\)/\1/" \
-e "s:^\#\(LogFile\) .*:\1 ${EPREFIX}/var/log/clamav/clamd.log:" \
-e "s:^\#\(LogTime\).*:\1 yes:" \
-e "s/^#\(DatabaseDirectory .*\)/\1/" \
"${ED}"/etc/clamd.conf.sample || die
sed -i -e "s:^\(Example\):\# \1:" \
-e "s/^#\(PidFile .*\)/\1/" \
-e "s/^#\(DatabaseOwner .*\)/\1/" \
-e "s:^\#\(UpdateLogFile\) .*:\1 ${EPREFIX}/var/log/clamav/freshclam.log:" \
-e "s:^\#\(NotifyClamd\).*:\1 ${EPREFIX}/etc/clamd.conf:" \
-e "s:^\#\(ScriptedUpdates\).*:\1 yes:" \
-e "s/^#\(DatabaseDirectory .*\)/\1/" \
"${ED}"/etc/freshclam.conf.sample || die
if use milter ; then
# Note: only keep the "unix" ClamdSocket and MilterSocket!
sed -i -e "s:^\(Example\):\# \1:" \
-e "s/^#\(PidFile .*\)/\1/" \
-e "s/^#\(ClamdSocket unix:.*\)/\1/" \
-e "s/^#\(User .*\)/\1/" \
-e "s/^#\(MilterSocket unix:.*\)/\1/" \
-e "s:^\#\(LogFile\) .*:\1 ${EPREFIX}/var/log/clamav/clamav-milter.log:" \
"${ED}"/etc/clamav-milter.conf.sample || die
cat >> "${ED}"/etc/conf.d/clamd <<-EOF
MILTER_NICELEVEL=19
START_MILTER=no
EOF
systemd_newunit "${FILESDIR}/clamav-milter.service-r1" clamav-milter.service
fi
local i
for i in clamd freshclam clamav-milter
do
if [[ -f "${ED}"/etc/"${i}".conf.sample ]]; then
mv "${ED}"/etc/"${i}".conf{.sample,} || die
fi
done
# These both need to be writable by the clamav user.
# TODO: use syslog by default; that's what it's for.
diropts -o clamav -g clamav
keepdir /var/lib/clamav
keepdir /var/log/clamav
fi
if use doc ; then
local HTML_DOCS=( docs/html/. )
einstalldocs
if ! use libclamav-only ; then
doman docs/man/*.[1-8]
fi
fi
find "${ED}" -name '*.la' -delete || die
}
src_test() {
if use libclamav-only ; then
ewarn "Test target not available when USE=libclamav-only is set, skipping tests ..."
return 0
fi
emake quick-check
}
pkg_postinst() {
if ! use libclamav-only ; then
if use systemd ; then
tmpfiles_process clamav.conf
fi
fi
if use milter ; then
elog "For simple instructions how to setup the clamav-milter read the"
elog "clamav-milter.README.gentoo in /usr/share/doc/${PF}"
fi
local databases=( "${EROOT}"/var/lib/clamav/main.c[lv]d )
if [[ ! -f "${databases}" ]] ; then
ewarn "You must run freshclam manually to populate the virus database"
ewarn "before starting clamav for the first time."
fi
ewarn "This version of ClamAV provides separate OpenRC services"
ewarn "for clamd, freshclam, clamav-milter, and clamonacc. The"
ewarn "clamd service now starts only the clamd daemon itself. You"
ewarn "should add freshclam (and perhaps clamav-milter) to any"
ewarn "runlevels that previously contained clamd."
}

@ -1,25 +0,0 @@
# This script is intended to rotate the logs for clamav-milter in its
# default configuration on Gentoo, where clamav-milter writes to its
# own log file but does not rotate that file itself. The clamav-milter
# daemon is capable of rotating its own logs; if you have "LogRotate
# yes" in clamav-milter.conf then you do not need this script (and
# should disable it). Likewise, if you are logging to syslog
# (LogSyslog yes), this is redundant.
#
# This is more complicated than the clamd/freshclam scripts because
# the milter doesn't yet reopen its log files when it receives a
# SIGHUP. See https://bugzilla.clamav.net/show_bug.cgi?id=12615
# for that. Instead we have to attempt OpenRC/systemd service
# restarts on (only) the machines that support them.
/var/log/clamav/clamav-milter.log {
su clamav clamav
missingok
postrotate
if command -v rc-service 2>/dev/null; then
rc-service clamav-milter status 2>/dev/null 1>&2 && rc-service clamav-milter restart 1>/dev/null
fi
if command -v systemctl 2>/dev/null; then
systemctl try-restart clamav-milter
fi
endscript
}

@ -1,12 +0,0 @@
[Unit]
Description=Milter module for the ClamAV scanner
After=nss-lookup.target network.target
Before=sendmail.service
Before=postfix.service
[Service]
ExecStart=/usr/sbin/clamav-milter -c /etc/clamav-milter.conf --nofork=yes
Restart=on-failure
[Install]
WantedBy=multi-user.target

@ -1,13 +0,0 @@
[Unit]
Description=clamav updater
[Service]
Type=forking
User=clamav
Group=clamav
RuntimeDirectory=clamav
PIDFile=/run/clamav/freshclam.pid
ExecStart=/usr/bin/freshclam -d -p /run/clamav/freshclam.pid
[Install]
WantedBy=multi-user.target

Binary file not shown.

@ -29,6 +29,7 @@ DEPEND="${RDEPEND}
PATCHES=(
"${FILESDIR}/1.7.0-Make.rules.patch"
"${FILESDIR}/1.8.1-respect-ar.patch"
)
src_prepare() {

@ -29,6 +29,7 @@ DEPEND="${RDEPEND}
PATCHES=(
"${FILESDIR}/1.7.0-Make.rules.patch"
"${FILESDIR}/1.8.1-respect-ar.patch"
)
src_prepare() {

@ -0,0 +1,25 @@
From 81503d7a43b99c036758d05c1794502c09189fa4 Mon Sep 17 00:00:00 2001
From: Matthias Maier <tamiko@43-1.org>
Date: Tue, 5 Oct 2021 22:27:52 -0500
Subject: [PATCH] Do not use ar directly
---
Make.rules | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Make.rules b/Make.rules
index e46d407..767070d 100644
--- a/Make.rules
+++ b/Make.rules
@@ -129,7 +129,7 @@ getvar = $(shell if [ "$(1)" = "PK" -o "$(1)" = "KEK" ]; then echo $(1); else ec
# sbsign --key KEK.key --cert KEK.crt --output $@ $<
%.a:
- ar rcv $@ $^
+ $(AR) rcv $@ $^
doc/%.1: doc/%.1.in %
$(HELP2MAN) --no-info -i $< -o $@ ./$*
--
2.32.0

@ -1,2 +1 @@
DIST jitterentropy-rngd-1.1.0.tar.gz 25891 BLAKE2B f711b173c68b74cbc0dbac1ae1b7a2beb5352b38e411f96172aa36ac7f720f05469f5fac2fa97b3514ec11fbe2ccfe0351ee7df8f51a8b36a566635ef93e4d08 SHA512 32835475b604e502caaab9b0d1cd9fe2920c126a27841669f6cf9c717094bfd4c11feab0f9f706ee4cf4caeedf26ced7039075499a3faaf41830c72968544646
DIST jitterentropy-rngd-1.2.2.tar.gz 35773 BLAKE2B 5b1987108beb5db7a456f1216173598c893b1c845dfaa7594854a82257e88adda01e2bb4160b70f2605aff519b7d1ba79bcea94dda34c2fc75e412e0a031b943 SHA512 c317cfb77910b6983da7bf0733c26f28260da746b917cde59a9cdb023b95cf727cf729dd7de27c8cc308b1958ca054114d01ad7dfb9bd211c241a95b7bed83c6
DIST jitterentropy-rngd-1.2.5.tar.gz 45262 BLAKE2B 0fdbd513f0dd2fa216c079d55790ea2848fac26ca17846cfce06d0d338e8e88a13f2e9a7a7d55c938f0366f7cb010d22fc35d63921e4bb1408a5bda73ac9e96c SHA512 23079ff64e1145efa22960dfa772f77dd27f45f1cd950fe7b3a45d56cb75920902a7136da92a7202c686f33db0895115624ac3d809627378056ca13250e5b07b

@ -1,25 +0,0 @@
# Copyright 2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit linux-info systemd
DESCRIPTION="Jitter RNG daemon"
HOMEPAGE="https://www.chronox.de/jent.html"
SRC_URI="https://github.com/smuellerDD/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64 ~mips ~x86"
IUSE=""
PATCHES=(
"${FILESDIR}"/${P}-do-not-strip-and-compress.patch
)
src_install() {
emake DESTDIR="${D}" PREFIX="${EPREFIX}/usr" \
UNITDIR="$(systemd_get_systemunitdir)" install
newinitd "${FILESDIR}"/jitterentropy-rngd-initd jitterentropy-rngd
}

@ -1 +1,2 @@
DIST libmd-1.0.3.tar.xz 258584 BLAKE2B 35b732800a4b0a7b8d0a88eeff5e7e80fe55ab5ed05b7a7a1ffe866e156cc6dc6daca95f865a56297857b10b1bdfc9815b5bf0b198e8284f217498265c08fcc9 SHA512 f4b5a86bea7b9fac9f7f173032ee436d1e7141f760c1a114a785d31644edbf6802fe8193cc4cf3b5c66d38963be919c05055780bdf6bf5a47927690490ff5966
DIST libmd-1.0.4.tar.xz 264472 BLAKE2B ddc2da74635f5cc009c66a58ae82b83e6e0930e18af8a6b0ecec7cbf378246707b493a99fb97d3491d0d626a0d5ef068baea6a3ba2ec311c5a1516ba5b4e2fd5 SHA512 731553ecc5e0e1eb228cced8fccd531fe31fb5c7627ca30013d287e1aeb8222959cf7498fbb7414bbabb967b25d4e8b0edd54fc47f6ccf55fc91087db0725ce3

@ -0,0 +1,23 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit multilib-minimal
DESCRIPTION="Message Digest functions from BSD systems"
HOMEPAGE="https://www.hadrons.org/software/libmd/"
SRC_URI="https://archive.hadrons.org/software/libmd/${P}.tar.xz"
LICENSE="|| ( BSD BSD-2 ISC BEER-WARE public-domain )"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
multilib_src_configure() {
ECONF_SOURCE="${S}" econf
}
multilib_src_install_all() {
einstalldocs
find "${ED}" -type f -name '*.la' -delete || die
}

Binary file not shown.

@ -1,2 +1,4 @@
DIST containerd-1.4.11.tar.gz 6406769 BLAKE2B a4882223e2f71944a4d46fb0500a95248cfa33735447952f94c7d7350c2cb62b4911adc77f96559116cca462be02b7270185a0a3dfed5ce4c530465cca7e2078 SHA512 16aa6ae4209939754e122545b454d8b25027a3621464a4b4e0379480b35adf0efb318271f82cf2b959a62fffe531979c9bdfee9ac7d47d4b33269a6bafe2d070
DIST containerd-1.4.8.tar.gz 6400374 BLAKE2B def2d6e47d550d641888289943fee5c860a5523b1b4e347efafbf43a8dbf9d86bbcef0f4286efdf2591a42faf75aa2dc0acad11f2cfcdd99c7e3e89fcd13fa22 SHA512 3c4c52a7a1b3fb76f7837ef7260024e25df14e86ccaea351a0811dd9b7335eddc94019e3fb7e6acb4a41a3dee9c18387d0b44ea406c3534c64e8a4b3dee6a45b
DIST containerd-1.5.4.tar.gz 7675134 BLAKE2B b50061655b0b78a9f4c8bf7355213d02517c5a15e3ff2a623e59ffcde8e7f59ef39aafaf9790f7d977b285eac4d38338505920cdd032d975c50d42605e7157a5 SHA512 91d2fce2dc218070078f0e9e8141d091eca9f23c0b1ff244180260f214a46cdd66ba5c89472b40c0875cbd25580e19765bb030abf2ad749cfd4eea712dacadc1
DIST containerd-1.5.7.tar.gz 7714453 BLAKE2B 621b6527814665432c52e72263da371840a183aa65f621a686111b59ee48e85dd96919abd35f069476b97858a8112d3c92b03afbe42d57495649ca0d2af2fd50 SHA512 ce0d9d355b4a6142569690a9fcde8cd07de20b5788098f1184a728106a60dd11a437c87499a97af0c147b14372c2bca4daa823ea470f10b5e1b8a1e34ba530b0

@ -0,0 +1,84 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
CONTAINERD_COMMIT=5b46e404f6b9f661a205e28d59c982d3634148f8
EGO_PN="github.com/containerd/${PN}"
inherit golang-vcs-snapshot toolchain-funcs
DESCRIPTION="A daemon to control runC"
HOMEPAGE="https://containerd.io/"
SRC_URI="https://github.com/containerd/containerd/archive/v${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="amd64 ~arm arm64 ppc64 ~x86"
IUSE="apparmor btrfs device-mapper +cri hardened +seccomp selinux test"
DEPEND="
btrfs? ( sys-fs/btrfs-progs )
seccomp? ( sys-libs/libseccomp )
"
# recommended version of runc is found in script/setup/runc-version
RDEPEND="
${DEPEND}
~app-emulation/runc-1.0.2
"
BDEPEND="
dev-go/go-md2man
virtual/pkgconfig
test? ( ${RDEPEND} )
"
# tests require root or docker
# upstream does not recommend stripping binary
RESTRICT+=" strip test"
S="${WORKDIR}/${P}/src/${EGO_PN}"
src_prepare() {
default
sed -i -e "s/git describe --match.*$/echo ${PV})/"\
-e "s/git rev-parse HEAD.*$/echo ${CONTAINERD_COMMIT})/"\
-e "s/-s -w//" \
Makefile || die
}
src_compile() {
local options=(
$(usev apparmor)
$(usex btrfs "" "no_btrfs")
$(usex cri "" "no_cri")
$(usex device-mapper "" "no_devmapper")
$(usev seccomp)
$(usev selinux)
)
myemakeargs=(
BUILDTAGS="${options[*]}"
LDFLAGS="$(usex hardened '-extldflags -fno-PIC' '')"
)
export GOPATH="${WORKDIR}/${P}" # ${PWD}/vendor
export GOFLAGS="-v -x -mod=vendor"
# race condition in man target https://bugs.gentoo.org/765100
emake "${myemakeargs[@]}" man -j1 #nowarn
emake "${myemakeargs[@]}" all
}
src_install() {
dobin bin/*
doman man/*
newinitd "${FILESDIR}"/${PN}.initd "${PN}"
keepdir /var/lib/containerd
# we already installed manpages, remove markdown source
# before installing docs directory
rm -r docs/man || die
local DOCS=( README.md PLUGINS.md docs/. )
einstalldocs
}

@ -0,0 +1,84 @@
# Copyright 2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
GIT_REVISION=8686ededfc90076914c5238eb96c883ea093a8ba
inherit go-module systemd toolchain-funcs
DESCRIPTION="A daemon to control runC"
HOMEPAGE="https://containerd.io/"
SRC_URI="https://github.com/containerd/containerd/archive/v${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~riscv ~x86"
IUSE="apparmor btrfs device-mapper +cri hardened +seccomp selinux test"
DEPEND="
btrfs? ( sys-fs/btrfs-progs )
seccomp? ( sys-libs/libseccomp )
"
# recommended version of runc is found in script/setup/runc-version
RDEPEND="
${DEPEND}
~app-emulation/runc-1.0.2
"
BDEPEND="
dev-go/go-md2man
virtual/pkgconfig
"
# tests require root or docker
# upstream does not recommend stripping binary
RESTRICT+=" strip test"
src_prepare() {
default
sed -i \
-e "s/-s -w//" \
Makefile || die
sed -i \
-e "s:/usr/local:/usr:" \
containerd.service || die
}
src_compile() {
local options=(
$(usev apparmor)
$(usex btrfs "" "no_btrfs")
$(usex cri "" "no_cri")
$(usex device-mapper "" "no_devmapper")
$(usev seccomp)
$(usev selinux)
)
myemakeargs=(
BUILDTAGS="${options[*]}"
LDFLAGS="$(usex hardened '-extldflags -fno-PIC' '')"
REVISION="${GIT_REVISION}"
VERSION=v${PV}
)
# race condition in man target https://bugs.gentoo.org/765100
# we need to explicitly specify GOFLAGS for "go run" to use vendor source
emake "${myemakeargs[@]}" man -j1 #nowarn
emake "${myemakeargs[@]}" all
}
src_install() {
dobin bin/*
doman man/*
newinitd "${FILESDIR}"/${PN}.initd "${PN}"
systemd_dounit containerd.service
keepdir /var/lib/containerd
# we already installed manpages, remove markdown source
# before installing docs directory
rm -r docs/man || die
local DOCS=( ADOPTERS.md README.md RELEASES.md ROADMAP.md SCOPE.md docs/. )
einstalldocs
}

@ -13,7 +13,7 @@ SRC_URI="https://github.com/docker/cli/archive/v${MY_PV}.tar.gz -> ${P}.tar.gz"
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~riscv ~x86"
KEYWORDS="amd64 ~arm arm64 ppc64 ~riscv ~x86"
IUSE="hardened"
RDEPEND="!<app-emulation/docker-20.10.1"

@ -13,7 +13,7 @@ SRC_URI="https://github.com/moby/moby/archive/v${MY_PV}.tar.gz -> ${P}.tar.gz"
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~riscv ~x86"
KEYWORDS="amd64 ~arm arm64 ppc64 ~riscv ~x86"
IUSE="apparmor aufs btrfs +cli +container-init device-mapper hardened overlay seccomp"
DEPEND="

@ -1 +1,3 @@
DIST runc-1.0.0.tar.gz 2366170 BLAKE2B 1b6455cd45bc51b92c12b3293037446da62957d441124e9b76fd44ce92329e0eb2fde2ef71c6519fc4d58bcbd4ef580f64d71753a6fc06f3f6e347de170bd9c3 SHA512 8ddad1e031237c07b6cab5cfe5bdb7b11bf98d5d1064ec06845f36da073fe65a0facc6a28ba5daff71cdcb50cfd5d1cd25e97385b4eddb35b287113c2771365c
DIST runc-1.0.1.tar.gz 2371417 BLAKE2B 2c037c9105bf08131de2dc54d74c982a2fbbcab79ed8b7b0fdcd1b577a38c2aa42dc6c1ce01c934dfc66a2927ce650a87e7ca2001586ca4d3c542e63a582f26a SHA512 c5db1016f438cd4883d1f9b36414e9c8b1fe9dfcb53dfebd1130cea3cb9bf78615a765715f4dd587cf8cc603b69951a5871adc33870cfeef2e63521d1ceccf39
DIST runc-1.0.2.tar.gz 2374156 BLAKE2B 526520adb7127e46e7258de75e66a15a5aac216a2a2fcb91f4d9c5da393892242c4d93c5f5483ab111bf29eed7d8f0c8c138ae83a22809d72802a981dcda0395 SHA512 434abd6d7ad2508c2272b627d8aeeb28ecd8461899bff463e7d2c7abbc0f0cbb2e0bafbfe81fc534fad506b1acb4bda3e05639ecd908bc9d0d2e9356f1e56e26

@ -0,0 +1,78 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit go-module linux-info
# update on bump, look for https://github.com/docker\
# docker-ce/blob/<docker ver OR branch>/components/engine/hack/dockerfile/install/runc.installer
RUNC_COMMIT=4144b63817ebcc5b358fc2c8ef95f7cddd709aa7
CONFIG_CHECK="~USER_NS"
DESCRIPTION="runc container cli tools"
HOMEPAGE="http://runc.io"
MY_PV="${PV/_/-}"
SRC_URI="https://github.com/opencontainers/${PN}/archive/v${MY_PV}.tar.gz -> ${P}.tar.gz"
LICENSE="Apache-2.0 BSD-2 BSD MIT"
SLOT="0"
KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~riscv ~x86"
IUSE="apparmor hardened +kmem +seccomp test"
DEPEND="seccomp? ( sys-libs/libseccomp )"
RDEPEND="
${DEPEND}
!app-emulation/docker-runc
apparmor? ( sys-libs/libapparmor )
"
BDEPEND="
dev-go/go-md2man
test? ( "${RDEPEND}" )
"
# tests need busybox binary, and portage namespace
# sandboxing disabled: mount-sandbox pid-sandbox ipc-sandbox
# majority of tests pass
RESTRICT+=" test"
S="${WORKDIR}/${PN}-${MY_PV}"
src_compile() {
# Taken from app-emulation/docker-1.7.0-r1
export CGO_CFLAGS="-I${ESYSROOT}/usr/include"
export CGO_LDFLAGS="$(usex hardened '-fno-PIC ' '')
-L${ESYSROOT}/usr/$(get_libdir)"
# build up optional flags
local options=(
$(usev apparmor)
$(usev seccomp)
$(usex kmem '' 'nokmem')
)
myemakeargs=(
BUILDTAGS="${options[*]}"
COMMIT="${RUNC_COMMIT}"
)
emake "${myemakeargs[@]}" runc man
}
src_install() {
myemakeargs+=(
PREFIX="${ED}/usr"
BINDIR="${ED}/usr/bin"
MANDIR="${ED}/usr/share/man"
)
emake "${myemakeargs[@]}" install install-man install-bash
local DOCS=( README.md PRINCIPLES.md docs/. )
einstalldocs
}
src_test() {
emake "${myemakeargs[@]}" localunittest
}

@ -0,0 +1,78 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit go-module linux-info
# update on bump, look for https://github.com/docker\
# docker-ce/blob/<docker ver OR branch>/components/engine/hack/dockerfile/install/runc.installer
RUNC_COMMIT=52b36a2dd837e8462de8e01458bf02cf9eea47dd
CONFIG_CHECK="~USER_NS"
DESCRIPTION="runc container cli tools"
HOMEPAGE="http://runc.io"
MY_PV="${PV/_/-}"
SRC_URI="https://github.com/opencontainers/${PN}/archive/v${MY_PV}.tar.gz -> ${P}.tar.gz"
LICENSE="Apache-2.0 BSD-2 BSD MIT"
SLOT="0"
KEYWORDS="amd64 ~arm arm64 ppc64 ~riscv ~x86"
IUSE="apparmor hardened +kmem +seccomp test"
DEPEND="seccomp? ( sys-libs/libseccomp )"
RDEPEND="
${DEPEND}
!app-emulation/docker-runc
apparmor? ( sys-libs/libapparmor )
"
BDEPEND="
dev-go/go-md2man
test? ( "${RDEPEND}" )
"
# tests need busybox binary, and portage namespace
# sandboxing disabled: mount-sandbox pid-sandbox ipc-sandbox
# majority of tests pass
RESTRICT+=" test"
S="${WORKDIR}/${PN}-${MY_PV}"
src_compile() {
# Taken from app-emulation/docker-1.7.0-r1
export CGO_CFLAGS="-I${ESYSROOT}/usr/include"
export CGO_LDFLAGS="$(usex hardened '-fno-PIC ' '')
-L${ESYSROOT}/usr/$(get_libdir)"
# build up optional flags
local options=(
$(usev apparmor)
$(usev seccomp)
$(usex kmem '' 'nokmem')
)
myemakeargs=(
BUILDTAGS="${options[*]}"
COMMIT="${RUNC_COMMIT}"
)
emake "${myemakeargs[@]}" runc man
}
src_install() {
myemakeargs+=(
PREFIX="${ED}/usr"
BINDIR="${ED}/usr/bin"
MANDIR="${ED}/usr/share/man"
)
emake "${myemakeargs[@]}" install install-man install-bash
local DOCS=( README.md PRINCIPLES.md docs/. )
einstalldocs
}
src_test() {
emake "${myemakeargs[@]}" localunittest
}

@ -1,3 +1,2 @@
DIST snapd-2.48.tar.xz 3757292 BLAKE2B 4d1fd4b9ff3bd7cf05ebf0e27db4bcc87b5de689be470b4c62758e411e9d99a541ae084c7b1afe4ede44ad6dce19a53b337dcddc18d0b82957ef537f466e720a SHA512 27e1924d86296a969cd18980d6100c8e41be66f2ad0214ac2857580a2686b1e7ef01e2561c6ed532106eadb1ac2d5fd070ef9eb05e5fabfb8fa9a98456259b89
DIST snapd-2.51.tar.xz 4036884 BLAKE2B debdfe51407306451ecdb7851e3768be5aa5b9714b2861cb17e9989194dfbf441b1569955c6440a7d44f1d36996b398bcf60b903a76116e14dcc3173625e105c SHA512 959cceb8fcb326a14557347cecfb931763084e00639b828dc539646d2988cdeb3c9276ab8b770c6bbe37c7a05fb6548f609f490c55f7ee28713a4eb80cf3da15
DIST snapd-2.52.1.tar.xz 4142764 BLAKE2B aaeebe91ef5d009deae37258cfcdbdcb415d5a2d5f954d01f277d6c4911449c80c49c486f6af71d4a2abc6a1d73f49f54d506dcb178adc33e1d685f1dc3c6b01 SHA512 ae829ff898708843e56688e2c1bd189c765cced11146a504ae8badd1acb1559536e13cec101e57ac4ffed2a3d1fa51323b87785b93290db7a1eec2e1579d1c6c
DIST snapd-2.52.tar.xz 4146496 BLAKE2B 49b952503c60b589fe7ddea9ded135139243da34b35b39d9e309df6854109fb3a99f52ca324737fa7f5773221d453f7093047dcdcb1114d0389e20ba24c3d2c3 SHA512 56d3a2c5048d2ffde5b34f63e6a99dc74a7c6e4637f36250f674a68863c4b997cf940689529eca9d3bf58b0148cc18a0b4033d93aa06375a5f12c552d40472da

@ -1,180 +0,0 @@
# Copyright 2020-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
EGO_PN="github.com/snapcore/${PN}"
inherit autotools bash-completion-r1 golang-vcs-snapshot linux-info readme.gentoo-r1 systemd xdg-utils
DESCRIPTION="Service and tools for management of snap packages"
HOMEPAGE="http://snapcraft.io/"
MY_S="${S}/src/github.com/snapcore/${PN}"
SRC_URI="https://github.com/snapcore/${PN}/releases/download/${PV}/${PN}_${PV}.vendor.tar.xz -> ${P}.tar.xz"
MY_PV=${PV}
KEYWORDS="~amd64"
LICENSE="GPL-3 Apache-2.0 BSD BSD-2 LGPL-3-with-linking-exception MIT"
SLOT="0"
IUSE="apparmor +cgroup-hybrid +forced-devmode gtk kde systemd"
REQUIRED_USE="!forced-devmode? ( apparmor cgroup-hybrid ) systemd"
CONFIG_CHECK="~CGROUPS
~CGROUP_DEVICE
~CGROUP_FREEZER
~NAMESPACES
~SQUASHFS
~SQUASHFS_ZLIB
~SQUASHFS_LZO
~SQUASHFS_XZ
~BLK_DEV_LOOP
~SECCOMP
~SECCOMP_FILTER"
RDEPEND="
sys-libs/libseccomp:=
apparmor? (
sec-policy/apparmor-profiles
sys-apps/apparmor:=
)
dev-libs/glib
virtual/libudev
systemd? ( sys-apps/systemd[cgroup-hybrid(+)?] )
sys-libs/libcap:=
sys-fs/squashfs-tools"
DEPEND="${RDEPEND}"
BDEPEND="
>=dev-lang/go-1.9
dev-python/docutils
sys-devel/gettext
sys-fs/xfsprogs"
PDEPEND="sys-auth/polkit[gtk?,kde?]"
README_GENTOO_SUFFIX=""
pkg_setup() {
if use apparmor; then
CONFIG_CHECK+=" ~SECURITY_APPARMOR"
fi
linux-info_pkg_setup
}
src_prepare() {
default
# Update apparmor profile to allow libtinfow.so*
sed -i 's/libtinfo/libtinfo{,w}/' \
"${MY_S}/cmd/snap-confine/snap-confine.apparmor.in" || die
if ! use forced-devmode; then
sed -e 's#return \(!apparmorFull || cgroupv2\)#//\1\n\tif !apparmorFull || cgroupv2 {\n\t\tpanic("USE=forced-devmode is disabled")\n\t}\n\treturn false#' \
-i "${MY_S}/sandbox/forcedevmode.go" || die
grep -q 'panic("USE=forced-devmode is disabled")' "${MY_S}/sandbox/forcedevmode.go" || die "failed to disable forced-devmode"
fi
sed -i 's:command -v git >/dev/null:false:' -i "${MY_S}/mkversion.sh" || die
pushd "${MY_S}" >/dev/null || die
./mkversion.sh "${PV}"
popd >/dev/null || die
pushd "${MY_S}/cmd" >/dev/null || die
eautoreconf
}
src_configure() {
SNAPD_MAKEARGS=(
"BINDIR=${EPREFIX}/usr/bin"
"DBUSSERVICESDIR=${EPREFIX}/usr/share/dbus-1/services"
"LIBEXECDIR=${EPREFIX}/usr/lib"
"SNAP_MOUNT_DIR=${EPREFIX}/var/lib/snapd/snap"
"SYSTEMDSYSTEMUNITDIR=$(systemd_get_systemunitdir)"
)
export CGO_ENABLED="1"
export CGO_CFLAGS="${CFLAGS}"
export CGO_CPPFLAGS="${CPPFLAGS}"
export CGO_CXXFLAGS="${CXXFLAGS}"
pushd "${MY_S}/cmd" >/dev/null || die
econf --libdir="${EPREFIX}/usr/lib" \
--libexecdir="${EPREFIX}/usr/lib/snapd" \
$(use_enable apparmor) \
--enable-nvidia-biarch \
--with-snap-mount-dir="${EPREFIX}/var/lib/snapd/snap"
}
src_compile() {
export -n GOCACHE XDG_CACHE_HOME
export GO111MODULE=off GOBIN="${S}/bin" GOPATH="${S}"
local file
for file in "${MY_S}/po/"*.po; do
msgfmt "${file}" -o "${file%.po}.mo" || die
done
emake -C "${MY_S}/data" "${SNAPD_MAKEARGS[@]}"
local -a flags=(-buildmode=pie -ldflags "-s -linkmode external -extldflags '${LDFLAGS}'" -trimpath)
local -a staticflags=(-buildmode=pie -ldflags "-s -linkmode external -extldflags '${LDFLAGS} -static'" -trimpath)
local cmd
for cmd in snap snapd snap-bootstrap snap-failure snap-preseed snap-recovery-chooser snap-repair snap-seccomp; do
go build -o "${GOBIN}/${cmd}" "${flags[@]}" \
-v -x "github.com/snapcore/${PN}/cmd/${cmd}"
[[ -e "${GOBIN}/${cmd}" ]] || die "failed to build ${cmd}"
done
for cmd in snapctl snap-exec snap-update-ns; do
go build -o "${GOBIN}/${cmd}" "${staticflags[@]}" \
-v -x "github.com/snapcore/${PN}/cmd/${cmd}"
[[ -e "${GOBIN}/${cmd}" ]] || die "failed to build ${cmd}"
done
}
src_install() {
emake -C "${MY_S}/data" install "${SNAPD_MAKEARGS[@]}" DESTDIR="${D}"
emake -C "${MY_S}/cmd" install "${SNAPD_MAKEARGS[@]}" DESTDIR="${D}"
if use apparmor; then
mv "${ED}/etc/apparmor.d/usr.lib.snapd.snap-confine"{,.real} || die
keepdir /var/lib/snapd/apparmor/profiles
fi
keepdir /var/lib/snapd/{apparmor/snap-confine,cache,cookie,snap,void}
fperms 700 /var/lib/snapd/{cache,cookie}
dobin "${GOBIN}/"{snap,snapctl}
ln "${ED}/usr/bin/snapctl" "${ED}/usr/lib/snapd/snapctl" || die
exeinto /usr/lib/snapd
doexe "${GOBIN}/"{snapd,snap-bootstrap,snap-failure,snap-exec,snap-preseed,snap-recovery-chooser,snap-repair,snap-seccomp,snap-update-ns} \
"${MY_S}/"{cmd/snap-confine/snap-device-helper,cmd/snap-discard-ns/snap-discard-ns,cmd/snap-gdb-shim/snap-gdb-shim,cmd/snap-mgmt/snap-mgmt} \
"${MY_S}/data/completion/bash/"{complete.sh,etelpmoc.sh,}
dobashcomp "${MY_S}/data/completion/bash/snap"
insinto /usr/share/zsh/site-functions
doins "${MY_S}/data/completion/zsh/_snap"
insinto "/usr/share/polkit-1/actions"
doins "${MY_S}/data/polkit/io.snapcraft.snapd.policy"
dodoc "${MY_S}/packaging/ubuntu-16.04/changelog"
domo "${MY_S}/po/"*.mo
readme.gentoo_create_doc
}
pkg_postinst() {
readme.gentoo_print_elog
xdg_desktop_database_update
if use apparmor && [[ -z ${ROOT} && -e /sys/kernel/security/apparmor/profiles &&
$(wc -l < /sys/kernel/security/apparmor/profiles) -gt 0 ]]; then
apparmor_parser -r "${EPREFIX}/etc/apparmor.d/usr.lib.snapd.snap-confine.real"
fi
}
pkg_postrm() {
xdg_desktop_database_update
}

Binary file not shown.

@ -1 +1,2 @@
DIST calcurse-4.7.0.tar.gz 699134 BLAKE2B fb50ee3d5fe6a0eebacb557ae6fdc1b49a413b35d53fd8dfb64102bd2ed963bf83f27f1e3c3f454284143d1410f18766b56792252634ad82b1b20c130364a54c SHA512 656f3e74cde923bf7bbe5aca56f0544023b69fd8ff6ac8c851bbe224bf6cbe1fb58eb141b66ba818b1382d705e1a7c82a7e20eda7a1672d513ad54749d5a2bac
DIST calcurse-4.7.1.tar.gz 701563 BLAKE2B 438741b9e0f61438d235fa60d13816d83c19f7d1b612619fe20a78812e77657b003ad0b9416bcc766f0e38e7868b3543972ed65eee43d8f9d6b1d80ba1872091 SHA512 8b5574d2909128c745b2d6367b517c5fb04a1c451e666dc9ee0652b3793b519576af5700d4fd073de0ccd5e5dced6b69c45dbfaf98b35a99784093208512b68e

@ -0,0 +1,50 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
PYTHON_COMPAT=( python3_{8..10} )
inherit autotools python-single-r1
DESCRIPTION="A text-based calendar and scheduling application"
HOMEPAGE="https://calcurse.org/"
SRC_URI="https://calcurse.org/files/${P}.tar.gz"
LICENSE="BSD-2"
SLOT="0"
KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
RDEPEND="
${PYTHON_DEPS}
$(python_gen_cond_dep 'dev-python/httplib2[${PYTHON_USEDEP}]')
sys-libs/ncurses:0="
DEPEND="
${RDEPEND}"
# Some tests fail, mostly those pertaining to ical, perhaps due to requiring network?
RESTRICT="test"
PATCHES=(
"${FILESDIR}"/${PN}-4.2.1-tinfo.patch
"${FILESDIR}"/${PN}-4.7.1-respect-docdir.patch
)
src_prepare() {
default
eautoreconf
}
src_compile() {
default
python_setup
python_fix_shebang contrib/caldav/calcurse-caldav
}
src_install() {
# calcurse likes to read the text files uncompressed
docompress -x /usr/share/doc
default
}

@ -0,0 +1,13 @@
# Gentoo bug "app-office/calcurse: Unable to find documentation"
# https://bugs.gentoo.org/813438
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -57,8 +57,6 @@ CLEANFILES = \
submitting-patches.html \
calcurse.1
-docdir = $(datadir)/doc/$(PACKAGE)
-
.txt.html:
if HAVE_ASCIIDOC
$(AM_V_GEN) $(ASCIIDOC) $(ASCIIDOC_ARGS) $<

@ -20,7 +20,7 @@ fi
LICENSE="GPL-2" # TODO: CHECK
SLOT="5"
IUSE="debug experimental marble mdb mysql postgres sqlite webkit"
IUSE="debug experimental marble mdb mysql postgres sqlite"
BDEPEND="sys-devel/gettext"
DEPEND="
@ -60,7 +60,6 @@ DEPEND="
dev-db/postgresql:*
dev-libs/libpqxx
)
webkit? ( >=dev-qt/qtwebkit-5.212.0_pre20180120:5 )
"
RDEPEND="${DEPEND}"
@ -72,10 +71,8 @@ PATCHES=(
)
src_prepare() {
if ! use webkit; then
ecm_punt_bogus_dep Qt5 WebKit
ecm_punt_bogus_dep Qt5 WebKitWidgets
fi
ecm_punt_bogus_dep Qt5 WebKit
ecm_punt_bogus_dep Qt5 WebKitWidgets
ecm_src_prepare
}

@ -12,6 +12,5 @@
<flag name="experimental">Enable features deemed experimental by upstream</flag>
<flag name="marble">Enable displaying of maps using <pkg>kde-apps/marble</pkg></flag>
<flag name="mdb">Enable support for Microsoft Access database</flag>
<flag name="webkit">Enable web form designer widget using <pkg>dev-qt/qtwebkit</pkg></flag>
</use>
</pkgmetadata>

Binary file not shown.

@ -16,7 +16,7 @@ if [[ ${PV} == *9999 ]] ; then
EGIT_REPO_URI="https://github.com/thesamesam/recover-broken-vdb.git"
else
SRC_URI="https://github.com/thesamesam/recover-broken-vdb/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
fi
LICENSE="GPL-2"

Binary file not shown.

@ -72,7 +72,7 @@ COMMON_DEPEND="${PYTHON_DEPS}
>=dev-python/python-dateutil-2.5.3[${PYTHON_USEDEP}]
>=dev-python/PyQt5-5.15.5_pre2107091435[gui,svg,widgets,network,printsupport,${PYTHON_USEDEP}]
>=dev-python/PyQt-builder-1.10.3[${PYTHON_USEDEP}]
>=dev-python/PyQtWebEngine-5.12[${PYTHON_USEDEP}]
>=dev-python/PyQtWebEngine-5.15.5_pre2108100905[${PYTHON_USEDEP}]
dev-python/regex[${PYTHON_USEDEP}]
dev-python/zeroconf[${PYTHON_USEDEP}]
')

@ -1 +0,0 @@
DIST fb2edit-0.1.0.tar.gz 244667 BLAKE2B 332ba2801a346ef667760ff9f116aec6ae3ef93c7d862884514982bcc6adfd5413b22beb40859cc28ca297548e2e8f1c95885c2e68734c554922965d53c8f7ab SHA512 f13d45987a513fa9ea8139b195cda77dd39d4d680b5a826882b8b9d6d5704f10ed4b447070f1de39997b3be0fafa8378fe1261ff2d1e53cf9b3225c07a293d08

@ -1,26 +0,0 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit cmake xdg
DESCRIPTION="Create and edit fb2 books"
HOMEPAGE="https://github.com/vitlav/fb2edit"
SRC_URI="https://github.com/vitlav/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~amd64"
IUSE=""
RDEPEND="dev-qt/qtcore:5
dev-qt/qtgui:5
dev-qt/qtwidgets:5
dev-qt/qtwebkit:5
dev-qt/qtnetwork:5
dev-qt/qtxml:5
dev-qt/qtxmlpatterns:5
dev-libs/libxml2:2"
DEPEND="${RDEPEND}"
BDEPEND="dev-qt/linguist-tools:5"
src_prepare () {
cmake_src_prepare
}

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>grozin@gentoo.org</email>
</maintainer>
<upstream>
<remote-id type="github">vitlav/fb2edit</remote-id>
</upstream>
</pkgmetadata>

@ -1,8 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>sam@gentoo.org</email>
<name>Sam James</name>
</maintainer>
<!-- maintainer-needed -->
</pkgmetadata>

@ -3,6 +3,9 @@
EAPI=7
# Please check upstream git regularly for relevant security-related commits
# to backport.
inherit desktop flag-o-matic toolchain-funcs xdg
DESCRIPTION="A lightweight PDF viewer and toolkit written in portable C"

@ -1,2 +1,2 @@
DIST namazu-2.0.21.tar.gz 1394048 BLAKE2B 86755fe2433bee1a1c7bf8239b38b3d9500eb20f720b031f349d968f173384f172d81eb0926265343b2c749fca527e6cd6c2940fbaa2be333830b41f8b7853a2 SHA512 c0ce1b8c8b8ce30ee7d28cfed790a9c8585d1b468eefe2ba4ac70976e09329ae04a3a3bbf0b86b9673cfdf206f2b103896daca2f053062f451884fa659b31ea6
DIST namazu-2.0.22pre7.tar.gz 1841999 BLAKE2B 4728b83ebca2bf3313cfffa5831a357281ee210e9ecab26506297022307d54a6818b9167bc3a41b66d14b682310d4533b26dab1e2a6f4f805a45d018350bdc76 SHA512 e530e0cb5219995a1b9193a8755a5a30eb09bec2f6e0b100a2423e7df1eb3a7b5f83c7f2eecdcbfd370301dab29857a3ac4d417653ed391f77ce131c340a9989
DIST namazu-2.0.22pre8.tar.gz 1975653 BLAKE2B 91e07e576fe7f8dc93db2754726f0fa286191dae44e885abafed5887d741f3291fd79665294dcae23770d2f42b5b35a323f7896209a62e802ac4253d729c3f23 SHA512 2d891cd2a4eae8246753511f3e2323093139be917edef9e2c3481ac7a0de9b9200906d7d56bbcd7bf1861ede44ae6bca72820b8086b2be93ad9d8f20cb56cae0

@ -0,0 +1,14 @@
--- a/lisp/namazu.el
+++ b/lisp/namazu.el
@@ -99,9 +99,9 @@
(defmacro defgroup (&rest args)
nil)
(defmacro defcustom (var value doc &rest args)
- (` (defvar (, var) (, value) (, doc))))
+ `(defvar (, var) (, value) (, doc)))
(defmacro defface (var value doc &rest args)
- (` (make-face (, var))))
+ `(make-face (, var)))
(defmacro define-widget (&rest args)
nil)))

@ -1,7 +1,7 @@
# Copyright 1999-2020 Gentoo Authors
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="6"
EAPI="7"
inherit autotools elisp-common
@ -9,7 +9,7 @@ DESCRIPTION="Namazu is a full-text search engine"
HOMEPAGE="http://www.namazu.org/"
SRC_URI="http://www.namazu.org/stable/${P}.tar.gz"
LICENSE="GPL-2"
LICENSE="GPL-2+"
SLOT="0"
KEYWORDS="amd64 ~ppc ~ppc64 x86"
IUSE="emacs l10n_ja nls static-libs tk"
@ -30,11 +30,12 @@ RDEPEND="dev-perl/File-MMagic
dev-lang/tk:0
www-client/lynx
)"
DEPEND="${RDEPEND}
nls? ( sys-devel/gettext )"
DEPEND="${RDEPEND}"
BDEPEND="nls? ( sys-devel/gettext )"
PATCHES=(
"${FILESDIR}"/${PN}-gentoo.patch
"${FILESDIR}"/${PN}-emacs-27.patch
"${FILESDIR}"/${PN}-perl-5.18.patch
"${FILESDIR}"/${PN}-perl-5.26.patch
"${FILESDIR}"/${P}-memmove.patch
@ -43,8 +44,8 @@ PATCHES=(
src_prepare() {
default
mv configure.{in,ac}
mv tk${PN}/configure.{in,ac}
mv configure.{in,ac} || die
mv tk${PN}/configure.{in,ac} || die
eautoreconf
}
@ -64,7 +65,7 @@ src_configure() {
}
src_compile() {
emake
default
if use emacs; then
cd lisp

@ -1,7 +1,7 @@
# Copyright 1999-2020 Gentoo Authors
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="6"
EAPI="7"
inherit autotools elisp-common
@ -11,7 +11,7 @@ DESCRIPTION="Namazu is a full-text search engine"
HOMEPAGE="http://www.namazu.org/"
SRC_URI="http://www.namazu.org/test/${MY_P}.tar.gz"
LICENSE="GPL-2"
LICENSE="GPL-2+"
SLOT="0"
KEYWORDS=""
IUSE="emacs l10n_ja nls static-libs tk"
@ -32,8 +32,8 @@ RDEPEND="dev-perl/File-MMagic
dev-lang/tk:0
www-client/lynx
)"
DEPEND="${RDEPEND}
nls? ( sys-devel/gettext )"
DEPEND="${RDEPEND}"
BDEPEND="nls? ( sys-devel/gettext )"
S="${WORKDIR}"/${MY_P}
PATCHES=( "${FILESDIR}"/${PN}-gentoo.patch )
@ -41,8 +41,8 @@ PATCHES=( "${FILESDIR}"/${PN}-gentoo.patch )
src_prepare() {
default
mv configure.{in,ac}
mv tk${PN}/configure.{in,ac}
mv configure.{in,ac} || die
mv tk${PN}/configure.{in,ac} || die
eautoreconf
}
@ -62,7 +62,7 @@ src_configure() {
}
src_compile() {
emake
default
if use emacs; then
cd lisp

Binary file not shown.

@ -72,9 +72,6 @@ src_prepare() {
}
src_configure() {
local mycmakeargs=(
-DCMAKEPACKAGE_INSTALL_DIR=$(get_libdir)/cmake/${PN}${SLOT}
)
use test && mycmakeargs+=(
# the OpenGL testsuite is extremely brittle, bug #712808
-DEIGEN_TEST_NO_OPENGL=ON

Binary file not shown.

@ -1,2 +1 @@
DIST ponyprog-3.0.0.tar.gz 933166 BLAKE2B 46eb0a720c91ed187ef06907b28d8b84ecbe4c62a92cabf2b9ff58c553e3f8afc949e523d6b97af0cbf168c545b71e0395e02e5c182714a76bbacce645a1d890 SHA512 a1779b28e03f824fb242d6eb063f0e038af26602c26d5392884f69cbbccac8a934660dffa9bec7489aeb2656e35f21e2b097fc6fe011f278046894e180023881
DIST ponyprog-3.1.2.tar.gz 1364636 BLAKE2B a913903278791d937266da50fcd5b5bda892dcc316011117816e37fc4ef03becce893b597fb34f2a6ef05b5692bb375e4ba10b04c079a63eb735aa0ddadb5ab9 SHA512 697c6fdc775629086a1c01ad94f291fda550a9ad6065e5fdff9db9fb035b8270ed9058894db7ca17d0daf2a26cc5e431415c160d61f65214677eae2109d87603

@ -1,41 +0,0 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
inherit cmake-utils
DESCRIPTION="EEPROM and microcontroller programmer/flasher"
HOMEPAGE="https://github.com/lancos/ponyprog/"
SRC_URI="https://github.com/lancos/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="LGPL-2"
SLOT="0"
KEYWORDS="amd64 x86"
IUSE="doc"
RDEPEND=">=app-editors/qhexedit2-0.8.4_p20170719
dev-qt/qtcore:5
dev-qt/qtgui:5
dev-qt/qtmultimedia:5
dev-qt/qtprintsupport:5"
DEPEND="${RDEPEND}"
PATCHES=(
"${FILESDIR}"/${P}-fix-build-system.patch
"${FILESDIR}"/${P}-desktop-qa.patch
)
src_configure() {
local mycmakeargs=( -DCMAKE_INSTALL_DOCDIR="share/doc/${PF}" )
cmake-utils_src_configure
}
pkg_postinst() {
elog "To use the COM port in user mode (not as root), you need to"
elog "be in the 'uucp' group."
elog
elog "To use the LPT port in user mode (not as root) you need a kernel with"
elog "ppdev, parport and parport_pc compiled in or as modules. You need the"
elog "rights to write to /dev/parport? devices."
}

@ -11,7 +11,7 @@ SRC_URI="https://github.com/lancos/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="LGPL-2"
SLOT="0"
KEYWORDS="~amd64 x86"
KEYWORDS="amd64 x86"
IUSE="doc"
DEPEND="

Binary file not shown.

@ -1 +1,2 @@
DIST htmlcleaner-2.24-src.zip 413806 BLAKE2B 26ac6d150607c3ee00a8afcf58fed313ac570178f84c52a0fe43b0d324e3b32bb60f63db9ae5f171e7a6a7517799c633f85abfeb64e3f7421d655842bb5a5610 SHA512 beb16e383b6d43d0dfd4697b919a30c1a74eea824976521475c458bdda6c5f0eb22f299eddae033cb190a2af4fafde7e7f2c8ab1378bd82f15842a3ca8ebaaff
DIST htmlcleaner-2.25-src.zip 414193 BLAKE2B e840b65665b23a6c55eda49a522994208b7178ddf924e60bdca9304c58df9bde343b31bbd4b7491db7bfd4fe0930283f9019d9213450618e0d50036563cced86 SHA512 fb49f0298b05008a727e7ba97a3444c6f8c31f65a9962e42bae63e1dab76fc7302f282daa45177daffcadbb73565685735f44b57107c62819bafa0db030c5ea3

@ -0,0 +1,73 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
JAVA_PKG_IUSE="doc source"
inherit java-pkg-2 java-pkg-simple
DESCRIPTION="HTML parser written in Java that can be used as a tool, library or Ant task"
HOMEPAGE="http://htmlcleaner.sourceforge.net/"
SRC_URI="mirror://sourceforge/htmlcleaner/files/${P}-src.zip"
LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="test"
RESTRICT="!test? ( test )"
CDEPEND="dev-java/jdom:2"
RDEPEND="
${CDEPEND}
>=virtual/jre-1.8:*"
DEPEND="
${CDEPEND}
dev-java/ant-core:0
test? ( dev-java/junit:4 )
>=virtual/jdk-1.8:*"
BDEPEND="
app-arch/unzip"
JAVA_SRC_DIR="src/main/java"
JAVA_GENTOO_CLASSPATH="jdom-2"
PATCHES=(
"${FILESDIR}/${PN}-2.24-fix-tests.patch"
)
src_prepare() {
default
# Don't require default.xml to be in the current directory.
sed -i "s:\"default\.xml\":\"${JAVA_PKG_SHAREPATH}/default.xml\":g" \
src/main/java/org/htmlcleaner/ConfigFileTagProvider.java || die
}
src_configure() {
JAVA_GENTOO_CLASSPATH_EXTRA=$(java-pkg_getjars --build-only ant-core)
}
src_install() {
java-pkg-simple_src_install
java-pkg_register-ant-task
java-pkg_dolauncher ${PN} --main org.${PN}.CommandLine
insinto "${JAVA_PKG_SHAREPATH}"
newins example.xml default.xml
}
src_test() {
local DIR="src/test/java"
local CP="${DIR}:${PN}.jar:$(java-pkg_getjars junit-4,${JAVA_GENTOO_CLASSPATH})"
local TESTS=$(find "${DIR}" -name "*Test.java" ! -name "Abstract*")
TESTS="${TESTS//src\/test\/java\/}"
TESTS="${TESTS//.java}"
TESTS="${TESTS//\//.}"
ejavac -classpath "${CP}" -d "${DIR}" $(find "${DIR}" -name "*.java")
ejunit4 -classpath "${CP}" ${TESTS}
}

@ -1 +1,2 @@
DIST apache-maven-3.8.2-bin.tar.gz 9338426 BLAKE2B b39c9c87b6d05d633172152598496b6cb9b82c64c0572426c6a612ecfcc6d087085d58fdcaef0b61f5554c2b58e90b47bb0e6844dacc88c95bfb72ffc618e355 SHA512 b0bf39460348b2d8eae1c861ced6c3e8a077b6e761fb3d4669be5de09490521a74db294cf031b0775b2dfcd57bd82246e42ce10904063ef8e3806222e686f222
DIST apache-maven-3.8.3-bin.tar.gz 9042049 BLAKE2B 2709a47fddca340d9ddaa1f716990e5a4580667169552cedcda2f2017b190cacfc545e2d5b0d5aaae5f95172fb49201eefc4edaff1009f855fb93065e0de6919 SHA512 1c12a5df43421795054874fd54bb8b37d242949133b5bf6052a063a13a93f13a20e6e9dae2b3d85b9c7034ec977bbc2b6e7f66832182b9c863711d78bfe60faa

@ -0,0 +1,64 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit java-pkg-2
MY_PN=apache-${PN%%-bin}
MY_PV=${PV/_alpha/-alpha-}
MY_P="${MY_PN}-${MY_PV}"
MY_MV="${PV%%.*}"
DESCRIPTION="Project Management and Comprehension Tool for Java"
SRC_URI="mirror://apache/maven/maven-${MY_MV}/${PV}/binaries/${MY_P}-bin.tar.gz"
HOMEPAGE="https://maven.apache.org/"
LICENSE="Apache-2.0"
SLOT="3.8"
KEYWORDS="~amd64 ~x86"
DEPEND="
>=virtual/jdk-1.8:*
app-eselect/eselect-java"
RDEPEND="
>=virtual/jre-1.8:*"
S="${WORKDIR}/${MY_P}"
MAVEN="${PN}-${SLOT}"
MAVEN_SHARE="/usr/share/${MAVEN}"
QA_FLAGS_IGNORED=(
"${MAVEN_SHARE}/lib/jansi-native/linux32/libjansi.so"
"${MAVEN_SHARE}/lib/jansi-native/linux64/libjansi.so"
)
# TODO:
# We should use jars from packages, instead of what is bundled.
src_install() {
dodir "${MAVEN_SHARE}"
cp -Rp bin boot conf lib "${ED}/${MAVEN_SHARE}" || die "failed to copy"
java-pkg_regjar "${ED}/${MAVEN_SHARE}"/boot/*.jar
java-pkg_regjar "${ED}/${MAVEN_SHARE}"/lib/*.jar
dodoc NOTICE README.txt
dodir /usr/bin
dosym "${MAVEN_SHARE}/bin/mvn" /usr/bin/mvn-${SLOT}
# See bug #342901.
echo "CONFIG_PROTECT=\"${MAVEN_SHARE}/conf\"" > "${T}/25${MAVEN}" || die
doenvd "${T}/25${MAVEN}"
}
pkg_postinst() {
eselect maven update mvn-${SLOT}
}
pkg_postrm() {
eselect maven update
}

@ -1,5 +1,6 @@
DIST apache-tomcat-10.0.10-src.tar.gz 6032784 BLAKE2B f73d2b0d549d773a13a8adcc76a87713f0f146d80bca2d2ba633ce3145d69505fb7172eac0f04bb6d10fd9f9abb0cbbca7fb6d5b4608e2f6f07df88e5e661d70 SHA512 6241a62d01dcbf37e4745803c77dfbc4307d43c884e8e4c78c33b10d45a9b42e0103ef94acaff19790fa4876bdb369e9aca4974a4dae2622cedfa56b3fbe0658
DIST apache-tomcat-10.0.11-src.tar.gz 6065513 BLAKE2B e734a3f5086d94dd49886a1fc7e1fddc1b500240837ccba945dc0d10ad5aaaf580d1b9e2c78aca8af474c4312d723bc4095ec8e90a14f0bd7f292b9333bc554f SHA512 c06f4069c1664483f176231dd9fe132c89e7c66f845d82b41d6c962ea2d2ba2d3c6004b6a875388925ba295761f533ced416fc91261ecb97d11219a87940db2b
DIST apache-tomcat-10.0.12-src.tar.gz 6066701 BLAKE2B 24acb9e10de923c9d6443c956cd6e6c5b5463f4f6af72d89445c7d635731449afc9b7050c95af3cbd3653168c073840f02472dd01bde65c1bcbdfcba41814117 SHA512 753d36edb5ce873e346856305d6a7f40d762ae8fb9ecd20406ed9ff400e9e1261f66d4549fc98f20a05b01136ff4beaacb462147e84a306858e2acc7fcd98d5b
DIST apache-tomcat-4.1.40-src.tar.gz 3709719 BLAKE2B f7ca82052c1148a5c384fcbc3871beeddccdb4cfed05ba176581ebb50f52ba867bed8dbc500e97b7348a3a87b9693fb73eb81209df4f31e8c1ced7e30a6af30b SHA512 c455fa3da9da8fcbf1d54ae5dce808f8a4520ccafd627a6b2d1b003c37e8395d8b2a55d5471bf6c196549d082715862b3b8958aef88613293a07fc0160aa5c6e
DIST apache-tomcat-5.5.36-src.tar.gz 3743113 BLAKE2B dbfcfd123a23b0ceb9f1fdd936e42324ea8b10cf327a1d0abf1703006535859c7122690a08b5ec27b86b526cc7709a7199b4f35f123538ff11f23f3b489358f3 SHA512 845636b5b992fbbb7d657d192afbab1e6a924bfd0c71b025cf22776eb4527d92d63f9b3f33475d4349a0df4cebd984ba3776eedd7482b820abdea909e90a97b7
DIST apache-tomcat-6.0.53-src.tar.gz 3522914 BLAKE2B 054b097c16861abaa8bdbeba713b49bc1dfcff573bb3f4bd0ff5807c33a2a0fb991af618f6e11e5b3ce3fa55c589fc6569342cab5d5a00349c79bc7061d81e40 SHA512 915a0a18f5c2883625c9441eed6465973eff4f6bf41e08e925c7edaea89ef8f6ee9476d3e06fa38228d4bcb4decaf53e3a7bdb7ec7e899e6250db3e12a9f5f2c
@ -8,3 +9,4 @@ DIST apache-tomcat-8.5.70-src.tar.gz 5939095 BLAKE2B 9a2bf14c9b9f551af15ebf2b95f
DIST apache-tomcat-8.5.71-src.tar.gz 5945776 BLAKE2B b7a5b344dbe09ef88ee046dcce701ea65d8587f1d8c2f980c67fff5466979d15dea019a9abae6d48a45797a989ebddb4dbdbc5196c8740cde9ebc45041b857ef SHA512 df99749d7ef387e29c1d2976c584dc219fc8764f618a004a646564315ab3f00a71ca94408d1fbaff20c3bab3911c82af4f7cf2ec02f0408d9e829c27f8aabdba
DIST apache-tomcat-9.0.52-src.tar.gz 6110883 BLAKE2B 8d2d4e3640fdc43a3b20d9722a73a8756de7ad71b2f05e8b2090bc712811cfcf6f8e79eeded039291b9306d1c49aec46fe8c7e347aab10384ca293894984ab27 SHA512 8b1817c171fa49e5568fb24a72b6b7533c5eb3ddd6d232b78e67186574f70bb311bbef9a58af047caa14bdae57c27c6a3df721c4583072740fec0a3863bb068d
DIST apache-tomcat-9.0.53-src.tar.gz 6142608 BLAKE2B 71f45e04ac01221cbfc6e730066e1aa7f5d65d31a497a775a3147180591f23799f0b47db3a1dd4a86936c40f624795cf4fd1d3dd44d4d39633aeb0733f4f9f26 SHA512 f72b9abff6af24d486a1e3dd3cd8b6cb44feab811efb74a3469502676e661bdb4cfed0fe44f38b7f5a6f74a6776ae1c0c732504d26609b88280e0b0da6710b27
DIST apache-tomcat-9.0.54-src.tar.gz 6132613 BLAKE2B 5d37359ac9cac2a1387675a095aa0bea3e2bc74740d761a13fb2313aaca8ddb14f10922a8edc0932c9139c04b4df7f5735b067a71ac75ebbfe16ff6066311993 SHA512 e9d532a966aa8e7c2fcf28e4ecb0a618a8be4dacf8dc579a407483de86ef969383e3662fba07be629bfb8fbd85c041a5a2f1dd8875cc309b69a147b37c58974b

@ -0,0 +1,98 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
JAVA_PKG_IUSE="source"
inherit java-pkg-2 java-pkg-simple
MY_A="apache-${PN}-${PV}-src"
MY_P="${MY_A/-servlet-api/}"
DESCRIPTION="Tomcat's Servlet API 5.0/JSP API 3.0/EL API 4.0 implementation"
HOMEPAGE="https://tomcat.apache.org/"
SRC_URI="mirror://apache/tomcat/tomcat-10/v${PV}/src/${MY_P}.tar.gz"
LICENSE="Apache-2.0"
SLOT="5.0"
KEYWORDS="~amd64 ~arm ~arm64 ~x86 ~amd64-linux ~x86-linux ~x64-solaris ~x86-solaris"
IUSE=""
DEPEND=">=virtual/jdk-1.8:*"
RDEPEND=">=virtual/jre-1.8:*"
S="${WORKDIR}/${MY_P}/"
JAVA_TEST_SRC_DIR="src/test"
SERVLET_API_JAR="servlet-api.jar"
SERVLET_API_SRC="src/main/servlet-api"
SERVLET_API_RESOURCES="src/resources/servlet-api"
EL_API_JAR="el-api.jar"
EL_API_SRC="src/main/el-api"
EL_API_RESOURCES="src/resources/el-api"
JSP_API_JAR="jsp-api.jar"
JSP_API_SRC="src/main/jsp-api"
JSP_API_RESOURCES="src/resources/jsp-api"
src_prepare() {
default
# The sources and also resources are mixed together so we first give it a structure to make it easier to compile and package
mkdir -p ${SERVLET_API_SRC} ${SERVLET_API_RESOURCES} \
${EL_API_SRC} ${EL_API_RESOURCES} \
${JSP_API_SRC}/jakarta/servlet ${JSP_API_RESOURCES} \
${JAVA_TEST_SRC_DIR} || die "Failed to create source directory"
pushd java || die "Failed to cd to java dir"
cp --parents -R jakarta/servlet "${S}/${SERVLET_API_SRC}/" || die "Failed to copy servlet-api sources"
mv "${S}/${SERVLET_API_SRC}/jakarta/servlet/jsp" "${S}/${JSP_API_SRC}/jakarta/servlet" || die "Failed to copy jsp-api sources"
cp --parents -R jakarta/el "${S}/${EL_API_SRC}/" || die "Failed to copy el-api sources"
popd
for file in $(find src -type f | grep -vE "\.java$"); do
target_dir=$(dirname $file | sed "s%src/main/%src/resources/%g")
mkdir -p ${target_dir} || die "Failed to create resource directory"
mv $file ${target_dir} || die "Failed to move resource file"
done
mv test/jakarta ${JAVA_TEST_SRC_DIR} || die "Failed to copy test sources"
java-pkg-2_src_prepare
}
src_compile() {
JAVA_SRC_DIR="${SERVLET_API_SRC}"
JAVA_RESOURCE_DIRS="${SERVLET_API_RESOURCES}"
JAVA_JAR_FILENAME="${SERVLET_API_JAR}"
java-pkg-simple_src_compile
rm -fr target || die "Failed to remove compiled files"
JAVA_SRC_DIR="${EL_API_SRC}"
JAVA_RESOURCE_DIRS="${EL_API_RESOURCES}"
JAVA_JAR_FILENAME="${EL_API_JAR}"
java-pkg-simple_src_compile
rm -fr target || die "Failed to remove compiled files"
JAVA_SRC_DIR="${JSP_API_SRC}"
JAVA_RESOURCE_DIRS="${JSP_API_RESOURCES}"
JAVA_JAR_FILENAME="${JSP_API_JAR}"
JAVA_GENTOO_CLASSPATH_EXTRA="servlet-api.jar:el-api.jar"
java-pkg-simple_src_compile
}
src_install() {
JAVA_SRC_DIR="${SERVLET_API_SRC}"
JAVA_JAR_FILENAME="${SERVLET_API_JAR}"
java-pkg-simple_src_install
JAVA_SRC_DIR="${EL_API_SRC}"
JAVA_JAR_FILENAME="${EL_API_JAR}"
java-pkg-simple_src_install
JAVA_SRC_DIR="${JSP_API_SRC}"
JAVA_JAR_FILENAME="${JSP_API_JAR}"
java-pkg-simple_src_install
}

@ -0,0 +1,99 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
JAVA_PKG_IUSE="source"
inherit java-pkg-2 java-pkg-simple
MY_A="apache-${PN}-${PV}-src"
MY_P="${MY_A/-servlet-api/}"
DESCRIPTION="Tomcat's Servlet API 4.0/JSP API 2.3/EL API 3.0 implementation"
HOMEPAGE="https://tomcat.apache.org/"
SRC_URI="mirror://apache/tomcat/tomcat-9/v${PV}/src/${MY_P}.tar.gz"
LICENSE="Apache-2.0"
SLOT="4.0"
KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86 ~amd64-linux ~x86-linux ~x64-solaris ~x86-solaris"
IUSE=""
DEPEND=">=virtual/jdk-1.8:*"
RDEPEND=">=virtual/jre-1.8:*"
S="${WORKDIR}/${MY_P}/"
JAVA_TEST_SRC_DIR="src/test"
SERVLET_API_JAR="servlet-api.jar"
SERVLET_API_SRC="src/main/servlet-api"
SERVLET_API_RESOURCES="src/resources/servlet-api"
EL_API_JAR="el-api.jar"
EL_API_SRC="src/main/el-api"
EL_API_RESOURCES="src/resources/el-api"
JSP_API_JAR="jsp-api.jar"
JSP_API_SRC="src/main/jsp-api"
JSP_API_RESOURCES="src/resources/jsp-api"
src_prepare() {
default
# The sources and also resources are mixed together so we first give it a structure to make it easier to compila and package
mkdir -p ${SERVLET_API_SRC} ${SERVLET_API_RESOURCES} \
${EL_API_SRC} ${EL_API_RESOURCES} \
${JSP_API_SRC}/javax/servlet ${JSP_API_RESOURCES} \
${JAVA_TEST_SRC_DIR} || die "Failed to create source directory"
pushd java || die "Failed to cd to java dir"
cp --parents -R javax/servlet "${S}/${SERVLET_API_SRC}/" || die "Failed to copy servlet-api sources"
mv "${S}/${SERVLET_API_SRC}/javax/servlet/jsp" "${S}/${JSP_API_SRC}/javax/servlet" || die "Failed to copy jsp-api sources"
cp --parents -R javax/el "${S}/${EL_API_SRC}/" || die "Failed to copy el-api sources"
popd
for file in $(find src -type f | grep -vE "\.java$"); do
target_dir=$(dirname $file | sed "s%src/main/%src/resources/%g")
mkdir -p ${target_dir} || die "Failed to create resource directory"
mv $file ${target_dir} || die "Failed to move resource file"
done
mv test/javax ${JAVA_TEST_SRC_DIR} || die "Failed to copy test sources"
java-pkg-2_src_prepare
}
src_compile() {
JAVA_SRC_DIR="${SERVLET_API_SRC}"
JAVA_RESOURCE_DIRS="${SERVLET_API_RESOURCES}"
JAVA_JAR_FILENAME="${SERVLET_API_JAR}"
java-pkg-simple_src_compile
rm -fr target || die "Failed to remove compiled files"
JAVA_SRC_DIR="${EL_API_SRC}"
JAVA_RESOURCE_DIRS="${EL_API_RESOURCES}"
JAVA_JAR_FILENAME="${EL_API_JAR}"
java-pkg-simple_src_compile
rm -fr target || die "Failed to remove compiled files"
JAVA_SRC_DIR="${JSP_API_SRC}"
JAVA_RESOURCE_DIRS="${JSP_API_RESOURCES}"
JAVA_JAR_FILENAME="${JSP_API_JAR}"
JAVA_GENTOO_CLASSPATH_EXTRA="servlet-api.jar:el-api.jar"
java-pkg-simple_src_compile
}
src_install() {
JAVA_SRC_DIR="${SERVLET_API_SRC}"
JAVA_JAR_FILENAME="${SERVLET_API_JAR}"
java-pkg-simple_src_install
JAVA_SRC_DIR="${EL_API_SRC}"
JAVA_JAR_FILENAME="${EL_API_JAR}"
java-pkg-simple_src_install
JAVA_SRC_DIR="${JSP_API_SRC}"
JAVA_JAR_FILENAME="${JSP_API_JAR}"
java-pkg-simple_src_install
}

Binary file not shown.

@ -1,12 +1,4 @@
DIST php-7.3.29.tar.xz 12139492 BLAKE2B 7e1287e0fd236252f5bc92009e4ff51676eccd197c1c579f0e79a5428fa3920b5d1f95a459cdd77c22699fbe83984a6d726ab4fc0fc1e309da8b34e0e3998071 SHA512 8a495546d575a31f864f85139d8d7931361e6ac421f2cf5ef3b4cb57f59c44568cb9ad0c8793f50169d8d9933abdcec14ab90add2d7fab056e19e7f66d60689f
DIST php-7.3.30.tar.xz 12142596 BLAKE2B 9d8d60aa2a24465e53d99be05f66c8c65ce738c866af0889cdfcd95d545d6308fce33ca2faaaeb2a298eae13d58b5f5b5c519de6af48230a4d9c4e3d41debb28 SHA512 89eb62ab4284393f33b79ee336c1672613c498adb858b16e1a17d5b2056068c849b96bbf591311ff322c607168d9518ade3bfebedbc4da4f37c34d2c64c671b6
DIST php-7.3.31.tar.xz 12142912 BLAKE2B dc68d2e2f38c93653950be4b30dde12fec6e7279e288fe40439a8e3e31110a228a69275e032604a493a53951230f6f42257719617ae18179116be414e49a2af5 SHA512 63a8122233b9892453b6b92429497a7ad9761ad88063e2b95607b5d4d4c0a0e1135073bcae5a0e69a17082d2348911cbbd4807c0d20905d93324d89e5b019a05
DIST php-7.4.21.tar.xz 10346628 BLAKE2B f758d6bef60f5e0c99bd097533d1663640362c2b752a3bd54389acc3bd7d173c1ba5d4b1c119b6ad50f5029aabe2349bb4646a33212dc3cf34fd294f24def401 SHA512 778ddbfe614fdc6a00bc82c61f4c636bdbe815ce3398415a29bd24a2fd4ca2113b3b804303585d8830242e04b0c202bbc7c725a46c9bad79b070a0e896e5e681
DIST php-7.4.22.tar.xz 10348532 BLAKE2B 20e4bfb0362bb13ca8cacf9fb2500ffdd2db011d69cb82f113dd0c25e8a5fd4a017d77481732930afd24a8e092edbce3eafe9d45f27718ddf7567469f80c5642 SHA512 80587ba613b8a863a666f44a16ebb33cbb5a5d396601d1eaf063c8f7793a98abae903cb76fca4216860f1a043d5ee997464d479d53ffff6a1d6a6cd31da9100d
DIST php-7.4.23.tar.xz 10371160 BLAKE2B 5e9fc033f856132dd6b7b06fc5aedc72218f083779fd90a8c4c7a23fb4f8c248a7ff769f9d9f46e5143ddf88ce9289f5a8013c194aeaf22eca74d97846868611 SHA512 659b6bbf9be21a09640529bc088dfd7a494081188e37eb1f2dac2cab92a1084062fd06d550dc8c97bdd7dd9b57f4146e357447be2cb86643bda1d8dbc8a0d4a3
DIST php-7.4.24.tar.xz 10372816 BLAKE2B 62e1853c20eb10d8540b9284af93cce4b3976cfae7cdba5c0c2d6d14e732a57d7f1d196f4270687d6af8f376d7a9ccef60b0b606ed20eda7e1b2b7b95074c55c SHA512 30dd0a83d6184791f4cff3edcffeb05470de8f98ddadba3c11544449bf500280ff2048a8ca8588b35d0622dcbbf16f55ea297f51d469ae137048cab2d40da9cd
DIST php-8.0.10.tar.xz 10703088 BLAKE2B c1be482bf0a7cd2392b4febccca8d9f7b32b12ff4f5ff0ce417658c52444308e67a1a0e702c0d70dc7cece4f8299b2bc12b6f999be8a758e5390e760ce4809d7 SHA512 25f23822a45eab837645a0259c7dbb999766506de35c1bba53e928e2b5935ba70278b931d5085966178e08013ec69407fc68eb041b3ae2e619b81f20ec8ce736
DIST php-8.0.11.tar.xz 10804388 BLAKE2B 8d32f2bb66b2850c7d8d820cbcf94af5161065612b204f6e30289d9b9fffbae7c45cdf5e31c3d1f774932d7eb7218079f6f0d19774b108d53a81a6c88d3c99fb SHA512 2d346959b2691ea0d5334dc9cad225b7a65ec53d6a6493f3b95c4819a0c088bec36aa1bf4ab3c8044a631bcfefb689d85463ff2259d42000e65dac30badcc59d
DIST php-8.0.8.tar.xz 10674548 BLAKE2B d2446ae5b80e692106b89418864e4253e000741addb7526599ec8db96713f91a5ab3bccd5bbd2f536b16cc58afafdf22b19996d424dfdce3218a8083ee2bdf37 SHA512 1f8b94083b64705e24365af57169f8ff08115f31a7471238d9ed7a24b692e46c789f3fc00ff2bef2205243b9cd9c4736831e995a004afc7fc4127f3b74932428
DIST php-8.0.9.tar.xz 10678448 BLAKE2B 7d8684a353ccbcd2aaff4c240563cbd9f94b16ad29223d7e00e3d9ca8b564dabe3f1d0ac676e6499af6b95f24ac2104ed9cc0ce30d05c7c565ccb2067a86b355 SHA512 de9923bfa3ca37cd775ff743beb417152d7380fa5622f3fb0055b49e552c6484561f4f503bb11f535aadd12352c92f673f3e3cc86964c767b1f6cec21265d03c
DIST php-8.1.0RC2.tar.xz 11679352 BLAKE2B 0b4eb5b1f8d3f8fb29421b6c72b3279bc7f3c5f6ba684305afdc7b1f5cc0f45a942d5c0f0a681f152ad87f209fa4e464215aef43732180882d523f2badd4596e SHA512 aecd58eb683467df62032208caa545d243ca2574f6683566a489136c84a19da4383c5aaa122dc09cfb44dc951bfaf85e50b0b9659b49ec1c4ae69f5afea9844b

@ -1,758 +0,0 @@
# Copyright 1999-2021 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"
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 +jit +json kerberos ldap ldap-sasl libedit 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[jit?,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[sdk] )
odbc? ( >=dev-db/unixODBC-1.8.13 )
postgres? ( dev-db/postgresql:* )
qdbm? ( dev-db/qdbm )
readline? ( sys-libs/readline:0= )
recode? ( app-text/recode:0= )
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:=[-minimal] )
spell? ( >=app-text/aspell-0.50 )
sqlite? ( >=dev-db/sqlite-3.7.6.3 )
ssl? ( >=dev-libs/openssl-1.0.1: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.
# The Oracle instant client provides its own incompatible ldap library.
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 )
oci8-instant-client? ( !ldap )
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
our_conf+=(
--with-pcre-regex="${EPREFIX}/usr"
--with-pcre-dir="${EPREFIX}/usr"
--without-pcre-valgrind
$(use_with jit pcre-jit)
)
# Catch CFLAGS problems
# Fixes bug #14067.
# Changed order to run it in reverse for bug #32022 and #12021.
replace-cpu-flags "k6*" "i586"
# Cache the ./configure test results between SAPIs.
our_conf+=( --cache-file="${T}/config.cache" )
# Support user-passed configuration parameters
our_conf+=( ${EXTRA_ECONF:-} )
# Support the Apache2 extras, they must be set globally for all
# SAPIs to work correctly, especially for external PHP extensions
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,758 +0,0 @@
# Copyright 1999-2021 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"
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 +jit +json kerberos ldap ldap-sasl libedit 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[jit?,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[sdk] )
odbc? ( >=dev-db/unixODBC-1.8.13 )
postgres? ( dev-db/postgresql:* )
qdbm? ( dev-db/qdbm )
readline? ( sys-libs/readline:0= )
recode? ( app-text/recode:0= )
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:=[-minimal] )
spell? ( >=app-text/aspell-0.50 )
sqlite? ( >=dev-db/sqlite-3.7.6.3 )
ssl? ( >=dev-libs/openssl-1.0.1: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.
# The Oracle instant client provides its own incompatible ldap library.
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 )
oci8-instant-client? ( !ldap )
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
our_conf+=(
--with-pcre-regex="${EPREFIX}/usr"
--with-pcre-dir="${EPREFIX}/usr"
--without-pcre-valgrind
$(use_with jit pcre-jit)
)
# Catch CFLAGS problems
# Fixes bug #14067.
# Changed order to run it in reverse for bug #32022 and #12021.
replace-cpu-flags "k6*" "i586"
# Cache the ./configure test results between SAPIs.
our_conf+=( --cache-file="${T}/config.cache" )
# Support user-passed configuration parameters
our_conf+=( ${EXTRA_ECONF:-} )
# Support the Apache2 extras, they must be set globally for all
# SAPIs to work correctly, especially for external PHP extensions
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"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos"
S="${WORKDIR}/${PN}-${MY_PV}"

@ -1,750 +0,0 @@
# Copyright 1999-2021 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"
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 +jit +json kerberos ldap ldap-sasl libedit lmdb
mhash mssql mysql mysqli nls
oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
readline selinux +session session-mm sharedmem
+simplexml snmp soap sockets sodium spell sqlite ssl
sysvipc systemd test tidy +tokenizer tokyocabinet truetype unicode webp
+xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib"
# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
# The Oracle instant client provides its own incompatible ldap library.
REQUIRED_USE="
|| ( cli cgi fpm apache2 embed phpdbg )
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 )
oci8-instant-client? ( !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[jit?,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[sdk] )
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:=[-minimal] )
spell? ( >=app-text/aspell-0.50 )
sqlite? ( >=dev-db/sqlite-3.7.6.3 )
ssl? ( >=dev-libs/openssl-1.0.1: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
our_conf+=(
--with-external-pcre
$(use_with jit pcre-jit)
)
# Catch CFLAGS problems
# Fixes bug #14067.
# Changed order to run it in reverse for bug #32022 and #12021.
replace-cpu-flags "k6*" "i586"
# Cache the ./configure test results between SAPIs.
our_conf+=( --cache-file="${T}/config.cache" )
# Support user-passed configuration parameters
our_conf+=( ${EXTRA_ECONF:-} )
# Support the Apache2 extras, they must be set globally for all
# SAPIs to work correctly, especially for external PHP extensions
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-2021 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"
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 +jit +json kerberos ldap ldap-sasl libedit lmdb
mhash mssql mysql mysqli nls
oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
readline selinux +session session-mm sharedmem
+simplexml snmp soap sockets sodium spell sqlite ssl
sysvipc systemd test tidy +tokenizer tokyocabinet truetype unicode webp
+xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib"
# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
# The Oracle instant client provides its own incompatible ldap library.
REQUIRED_USE="
|| ( cli cgi fpm apache2 embed phpdbg )
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 )
oci8-instant-client? ( !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[jit?,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[sdk] )
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:=[-minimal] )
spell? ( >=app-text/aspell-0.50 )
sqlite? ( >=dev-db/sqlite-3.7.6.3 )
ssl? ( >=dev-libs/openssl-1.0.1: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
our_conf+=(
--with-external-pcre
$(use_with jit pcre-jit)
)
# Catch CFLAGS problems
# Fixes bug #14067.
# Changed order to run it in reverse for bug #32022 and #12021.
replace-cpu-flags "k6*" "i586"
# Cache the ./configure test results between SAPIs.
our_conf+=( --cache-file="${T}/config.cache" )
# Support user-passed configuration parameters
our_conf+=( ${EXTRA_ECONF:-} )
# Support the Apache2 extras, they must be set globally for all
# SAPIs to work correctly, especially for external PHP extensions
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-2021 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 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-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 +jit +json kerberos ldap ldap-sasl libedit lmdb
mhash mssql mysql mysqli nls
oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
readline selinux +session session-mm sharedmem
+simplexml snmp soap sockets sodium spell sqlite ssl
sysvipc systemd test tidy +tokenizer tokyocabinet truetype unicode webp
+xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib"
# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
# The Oracle instant client provides its own incompatible ldap library.
REQUIRED_USE="
|| ( cli cgi fpm apache2 embed phpdbg )
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 )
oci8-instant-client? ( !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[jit?,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[sdk] )
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:=[-minimal] )
spell? ( >=app-text/aspell-0.50 )
sqlite? ( >=dev-db/sqlite-3.7.6.3 )
ssl? ( >=dev-libs/openssl-1.0.1: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
our_conf+=(
--with-external-pcre
$(use_with jit pcre-jit)
)
# Catch CFLAGS problems
# Fixes bug #14067.
# Changed order to run it in reverse for bug #32022 and #12021.
replace-cpu-flags "k6*" "i586"
# Cache the ./configure test results between SAPIs.
our_conf+=( --cache-file="${T}/config.cache" )
# Support user-passed configuration parameters
our_conf+=( ${EXTRA_ECONF:-} )
# Support the Apache2 extras, they must be set globally for all
# SAPIs to work correctly, especially for external PHP extensions
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 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos"
S="${WORKDIR}/${PN}-${MY_PV}"

@ -1,749 +0,0 @@
# Copyright 1999-2021 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 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-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 apparmor 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 +jit kerberos ldap ldap-sasl libedit lmdb
mhash mssql mysql mysqli nls
oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
readline selinux +session session-mm sharedmem
+simplexml snmp soap sockets sodium spell sqlite ssl
sysvipc systemd test tidy +tokenizer tokyocabinet truetype unicode webp
+xml xmlreader xmlwriter xpm xslt zip zlib"
# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
# The Oracle instant client provides its own incompatible ldap library.
REQUIRED_USE="
|| ( cli cgi fpm apache2 embed phpdbg )
cli? ( ^^ ( readline libedit ) )
!cli? ( ?? ( readline libedit ) )
truetype? ( gd zlib )
webp? ( gd zlib )
cjk? ( gd zlib )
exif? ( gd zlib )
xpm? ( gd zlib )
gd? ( zlib )
simplexml? ( xml )
soap? ( xml )
xmlreader? ( xml )
xmlwriter? ( xml )
xslt? ( xml )
ldap-sasl? ( ldap )
oci8-instant-client? ( !ldap )
qdbm? ( !gdbm )
session-mm? ( session !threads )
mysql? ( || ( mysqli pdo ) )
firebird? ( pdo )
mssql? ( pdo )
"
RESTRICT="!test? ( test )"
# The supported (that is, autodetected) versions of BDB are listed in
# the ./configure script. Other versions *work*, but we need to stick to
# the ones that can be detected to avoid a repeat of bug #564824.
COMMON_DEPEND="
>=app-eselect/eselect-php-0.9.7[apache2?,fpm?]
>=dev-libs/libpcre2-10.30[jit?,unicode]
fpm? ( acl? ( sys-apps/acl ) apparmor? ( sys-libs/libapparmor ) )
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.29.0 )
enchant? ( app-text/enchant:2 )
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[sdk] )
odbc? ( iodbc? ( dev-db/libiodbc ) !iodbc? ( >=dev-db/unixODBC-1.8.13 ) )
postgres? ( >=dev-db/postgresql-9.1:* )
qdbm? ( dev-db/qdbm )
readline? ( sys-libs/readline:0= )
session-mm? ( dev-libs/mm )
snmp? ( >=net-analyzer/net-snmp-5.2 )
sodium? ( dev-libs/libsodium:=[-minimal] )
spell? ( >=app-text/aspell-0.50 )
sqlite? ( >=dev-db/sqlite-3.7.6.3 )
ssl? ( >=dev-libs/openssl-1.0.1: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.9.0 )
xpm? ( x11-libs/libXpm )
xslt? ( dev-libs/libxslt )
zip? ( >=dev-libs/libzip-1.2.0:= )
zlib? ( >=sys-libs/zlib-1.2.0.4:0= )
"
RDEPEND="${COMMON_DEPEND}
virtual/mta
fpm? (
selinux? ( sec-policy/selinux-phpfpm )
systemd? ( sys-apps/systemd ) )"
# Bison isn't actually needed when building from a release tarball
# However, the configure script will warn if it's absent or if you
# have an incompatible version installed. See bug 593278.
DEPEND="${COMMON_DEPEND}
app-arch/xz-utils
>=sys-devel/bison-3.0.1"
BDEPEND="virtual/pkgconfig"
PHP_MV="$(ver_cut 1)"
PATCHES=(
"${FILESDIR}/php-iodbc-header-location.patch"
"${FILESDIR}/php80-firebird-warnings.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 zts)
)
our_conf+=(
$(use_with apparmor fpm-apparmor)
$(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_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 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
our_conf+=(
--with-external-pcre
$(use_with jit pcre-jit)
)
# Catch CFLAGS problems
# Fixes bug #14067.
# Changed order to run it in reverse for bug #32022 and #12021.
replace-cpu-flags "k6*" "i586"
# Cache the ./configure test results between SAPIs.
our_conf+=( --cache-file="${T}/config.cache" )
# Support user-passed configuration parameters
our_conf+=( ${EXTRA_ECONF:-} )
# Support the Apache2 extras, they must be set globally for all
# SAPIs to work correctly, especially for external PHP extensions
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$(get_libname)" \
"libphp${PHP_MV}$(get_libname)"
keepdir "/usr/$(get_libdir)/apache2/modules"
else
# needed each time, php_install_ini would reset it
local dest="${PHP_DESTDIR#${EPREFIX}}"
into "${dest}"
case "$sapi" in
cli)
source="sapi/cli/php"
# Install the "phar" archive utility.
if use phar ; then
emake INSTALL_ROOT="${D}" install-pharcmd
dosym "..${dest#/usr}/bin/phar" "/usr/bin/phar${SLOT}"
fi
;;
cgi)
source="sapi/cgi/php-cgi"
;;
fpm)
source="sapi/fpm/php-fpm"
;;
embed)
source="libs/libphp$(get_libname)"
;;
phpdbg)
source="sapi/phpdbg/phpdbg"
;;
*)
die "unhandled sapi in src_install"
;;
esac
if [[ "${source}" == *"$(get_libname)" ]]; then
dolib.so "${source}"
else
dobin "${source}"
local name="$(basename ${source})"
dosym "..${dest#/usr}/bin/${name}" "/usr/bin/${name}${SLOT}"
fi
fi
php_install_ini "${sapi}"
# construct correct SAPI string for php-config
# thanks to ferringb for the bash voodoo
if [[ "${sapi}" == "apache2" ]]; then
sapi_list="${sapi_list:+${sapi_list} }apache2handler"
else
sapi_list="${sapi_list:+${sapi_list} }${sapi}"
fi
fi
done
# Installing opcache module
if use opcache ; then
into "${PHP_DESTDIR#${EPREFIX}}"
dolib.so "modules/opcache$(get_libname)"
fi
# Install env.d files
newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}"
sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
# set php-config variable correctly (bug #278439)
sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \
"${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die
if use fpm ; then
if use systemd; then
systemd_newunit "${FILESDIR}/php-fpm_at.service" \
"php-fpm@${SLOT}.service"
else
systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \
"php-fpm@${SLOT}.service"
fi
fi
}
src_test() {
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 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos"
S="${WORKDIR}/${PN}-${MY_PV}"

@ -1,749 +0,0 @@
# Copyright 1999-2021 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"
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 apparmor 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 +jit kerberos ldap ldap-sasl libedit lmdb
mhash mssql mysql mysqli nls
oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
readline selinux +session session-mm sharedmem
+simplexml snmp soap sockets sodium spell sqlite ssl
sysvipc systemd test tidy +tokenizer tokyocabinet truetype unicode webp
+xml xmlreader xmlwriter xpm xslt zip zlib"
# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
# The Oracle instant client provides its own incompatible ldap library.
REQUIRED_USE="
|| ( cli cgi fpm apache2 embed phpdbg )
cli? ( ^^ ( readline libedit ) )
!cli? ( ?? ( readline libedit ) )
truetype? ( gd zlib )
webp? ( gd zlib )
cjk? ( gd zlib )
exif? ( gd zlib )
xpm? ( gd zlib )
gd? ( zlib )
simplexml? ( xml )
soap? ( xml )
xmlreader? ( xml )
xmlwriter? ( xml )
xslt? ( xml )
ldap-sasl? ( ldap )
oci8-instant-client? ( !ldap )
qdbm? ( !gdbm )
session-mm? ( session !threads )
mysql? ( || ( mysqli pdo ) )
firebird? ( pdo )
mssql? ( pdo )
"
RESTRICT="!test? ( test )"
# The supported (that is, autodetected) versions of BDB are listed in
# the ./configure script. Other versions *work*, but we need to stick to
# the ones that can be detected to avoid a repeat of bug #564824.
COMMON_DEPEND="
>=app-eselect/eselect-php-0.9.7[apache2?,fpm?]
>=dev-libs/libpcre2-10.30[jit?,unicode]
fpm? ( acl? ( sys-apps/acl ) apparmor? ( sys-libs/libapparmor ) )
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.29.0 )
enchant? ( app-text/enchant:2 )
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[sdk] )
odbc? ( iodbc? ( dev-db/libiodbc ) !iodbc? ( >=dev-db/unixODBC-1.8.13 ) )
postgres? ( >=dev-db/postgresql-9.1:* )
qdbm? ( dev-db/qdbm )
readline? ( sys-libs/readline:0= )
session-mm? ( dev-libs/mm )
snmp? ( >=net-analyzer/net-snmp-5.2 )
sodium? ( dev-libs/libsodium:=[-minimal] )
spell? ( >=app-text/aspell-0.50 )
sqlite? ( >=dev-db/sqlite-3.7.6.3 )
ssl? ( >=dev-libs/openssl-1.0.1: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.9.0 )
xpm? ( x11-libs/libXpm )
xslt? ( dev-libs/libxslt )
zip? ( >=dev-libs/libzip-1.2.0:= )
zlib? ( >=sys-libs/zlib-1.2.0.4:0= )
"
RDEPEND="${COMMON_DEPEND}
virtual/mta
fpm? (
selinux? ( sec-policy/selinux-phpfpm )
systemd? ( sys-apps/systemd ) )"
# Bison isn't actually needed when building from a release tarball
# However, the configure script will warn if it's absent or if you
# have an incompatible version installed. See bug 593278.
DEPEND="${COMMON_DEPEND}
app-arch/xz-utils
>=sys-devel/bison-3.0.1"
BDEPEND="virtual/pkgconfig"
PHP_MV="$(ver_cut 1)"
PATCHES=(
"${FILESDIR}/php-iodbc-header-location.patch"
"${FILESDIR}/php80-firebird-warnings.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 zts)
)
our_conf+=(
$(use_with apparmor fpm-apparmor)
$(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_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 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
our_conf+=(
--with-external-pcre
$(use_with jit pcre-jit)
)
# Catch CFLAGS problems
# Fixes bug #14067.
# Changed order to run it in reverse for bug #32022 and #12021.
replace-cpu-flags "k6*" "i586"
# Cache the ./configure test results between SAPIs.
our_conf+=( --cache-file="${T}/config.cache" )
# Support user-passed configuration parameters
our_conf+=( ${EXTRA_ECONF:-} )
# Support the Apache2 extras, they must be set globally for all
# SAPIs to work correctly, especially for external PHP extensions
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$(get_libname)" \
"libphp${PHP_MV}$(get_libname)"
keepdir "/usr/$(get_libdir)/apache2/modules"
else
# needed each time, php_install_ini would reset it
local dest="${PHP_DESTDIR#${EPREFIX}}"
into "${dest}"
case "$sapi" in
cli)
source="sapi/cli/php"
# Install the "phar" archive utility.
if use phar ; then
emake INSTALL_ROOT="${D}" install-pharcmd
dosym "..${dest#/usr}/bin/phar" "/usr/bin/phar${SLOT}"
fi
;;
cgi)
source="sapi/cgi/php-cgi"
;;
fpm)
source="sapi/fpm/php-fpm"
;;
embed)
source="libs/libphp$(get_libname)"
;;
phpdbg)
source="sapi/phpdbg/phpdbg"
;;
*)
die "unhandled sapi in src_install"
;;
esac
if [[ "${source}" == *"$(get_libname)" ]]; then
dolib.so "${source}"
else
dobin "${source}"
local name="$(basename ${source})"
dosym "..${dest#/usr}/bin/${name}" "/usr/bin/${name}${SLOT}"
fi
fi
php_install_ini "${sapi}"
# construct correct SAPI string for php-config
# thanks to ferringb for the bash voodoo
if [[ "${sapi}" == "apache2" ]]; then
sapi_list="${sapi_list:+${sapi_list} }apache2handler"
else
sapi_list="${sapi_list:+${sapi_list} }${sapi}"
fi
fi
done
# Installing opcache module
if use opcache ; then
into "${PHP_DESTDIR#${EPREFIX}}"
dolib.so "modules/opcache$(get_libname)"
fi
# Install env.d files
newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}"
sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
# set php-config variable correctly (bug #278439)
sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \
"${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die
if use fpm ; then
if use systemd; then
systemd_newunit "${FILESDIR}/php-fpm_at.service" \
"php-fpm@${SLOT}.service"
else
systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \
"php-fpm@${SLOT}.service"
fi
fi
}
src_test() {
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,749 +0,0 @@
# Copyright 1999-2021 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"
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 apparmor 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 +jit kerberos ldap ldap-sasl libedit lmdb
mhash mssql mysql mysqli nls
oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
readline selinux +session session-mm sharedmem
+simplexml snmp soap sockets sodium spell sqlite ssl
sysvipc systemd test tidy +tokenizer tokyocabinet truetype unicode webp
+xml xmlreader xmlwriter xpm xslt zip zlib"
# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
# The Oracle instant client provides its own incompatible ldap library.
REQUIRED_USE="
|| ( cli cgi fpm apache2 embed phpdbg )
cli? ( ^^ ( readline libedit ) )
!cli? ( ?? ( readline libedit ) )
truetype? ( gd zlib )
webp? ( gd zlib )
cjk? ( gd zlib )
exif? ( gd zlib )
xpm? ( gd zlib )
gd? ( zlib )
simplexml? ( xml )
soap? ( xml )
xmlreader? ( xml )
xmlwriter? ( xml )
xslt? ( xml )
ldap-sasl? ( ldap )
oci8-instant-client? ( !ldap )
qdbm? ( !gdbm )
session-mm? ( session !threads )
mysql? ( || ( mysqli pdo ) )
firebird? ( pdo )
mssql? ( pdo )
"
RESTRICT="!test? ( test )"
# The supported (that is, autodetected) versions of BDB are listed in
# the ./configure script. Other versions *work*, but we need to stick to
# the ones that can be detected to avoid a repeat of bug #564824.
COMMON_DEPEND="
>=app-eselect/eselect-php-0.9.7[apache2?,fpm?]
>=dev-libs/libpcre2-10.30[jit?,unicode]
fpm? ( acl? ( sys-apps/acl ) apparmor? ( sys-libs/libapparmor ) )
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.29.0 )
enchant? ( app-text/enchant:2 )
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[sdk] )
odbc? ( iodbc? ( dev-db/libiodbc ) !iodbc? ( >=dev-db/unixODBC-1.8.13 ) )
postgres? ( >=dev-db/postgresql-9.1:* )
qdbm? ( dev-db/qdbm )
readline? ( sys-libs/readline:0= )
session-mm? ( dev-libs/mm )
snmp? ( >=net-analyzer/net-snmp-5.2 )
sodium? ( dev-libs/libsodium:=[-minimal] )
spell? ( >=app-text/aspell-0.50 )
sqlite? ( >=dev-db/sqlite-3.7.6.3 )
ssl? ( >=dev-libs/openssl-1.0.1: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.9.0 )
xpm? ( x11-libs/libXpm )
xslt? ( dev-libs/libxslt )
zip? ( >=dev-libs/libzip-1.2.0:= )
zlib? ( >=sys-libs/zlib-1.2.0.4:0= )
"
RDEPEND="${COMMON_DEPEND}
virtual/mta
fpm? (
selinux? ( sec-policy/selinux-phpfpm )
systemd? ( sys-apps/systemd ) )"
# Bison isn't actually needed when building from a release tarball
# However, the configure script will warn if it's absent or if you
# have an incompatible version installed. See bug 593278.
DEPEND="${COMMON_DEPEND}
app-arch/xz-utils
>=sys-devel/bison-3.0.1"
BDEPEND="virtual/pkgconfig"
PHP_MV="$(ver_cut 1)"
PATCHES=(
"${FILESDIR}/php-iodbc-header-location.patch"
"${FILESDIR}/php80-firebird-warnings.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 zts)
)
our_conf+=(
$(use_with apparmor fpm-apparmor)
$(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_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 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
our_conf+=(
--with-external-pcre
$(use_with jit pcre-jit)
)
# Catch CFLAGS problems
# Fixes bug #14067.
# Changed order to run it in reverse for bug #32022 and #12021.
replace-cpu-flags "k6*" "i586"
# Cache the ./configure test results between SAPIs.
our_conf+=( --cache-file="${T}/config.cache" )
# Support user-passed configuration parameters
our_conf+=( ${EXTRA_ECONF:-} )
# Support the Apache2 extras, they must be set globally for all
# SAPIs to work correctly, especially for external PHP extensions
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$(get_libname)" \
"libphp${PHP_MV}$(get_libname)"
keepdir "/usr/$(get_libdir)/apache2/modules"
else
# needed each time, php_install_ini would reset it
local dest="${PHP_DESTDIR#${EPREFIX}}"
into "${dest}"
case "$sapi" in
cli)
source="sapi/cli/php"
# Install the "phar" archive utility.
if use phar ; then
emake INSTALL_ROOT="${D}" install-pharcmd
dosym "..${dest#/usr}/bin/phar" "/usr/bin/phar${SLOT}"
fi
;;
cgi)
source="sapi/cgi/php-cgi"
;;
fpm)
source="sapi/fpm/php-fpm"
;;
embed)
source="libs/libphp$(get_libname)"
;;
phpdbg)
source="sapi/phpdbg/phpdbg"
;;
*)
die "unhandled sapi in src_install"
;;
esac
if [[ "${source}" == *"$(get_libname)" ]]; then
dolib.so "${source}"
else
dobin "${source}"
local name="$(basename ${source})"
dosym "..${dest#/usr}/bin/${name}" "/usr/bin/${name}${SLOT}"
fi
fi
php_install_ini "${sapi}"
# construct correct SAPI string for php-config
# thanks to ferringb for the bash voodoo
if [[ "${sapi}" == "apache2" ]]; then
sapi_list="${sapi_list:+${sapi_list} }apache2handler"
else
sapi_list="${sapi_list:+${sapi_list} }${sapi}"
fi
fi
done
# Installing opcache module
if use opcache ; then
into "${PHP_DESTDIR#${EPREFIX}}"
dolib.so "modules/opcache$(get_libname)"
fi
# Install env.d files
newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}"
sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
# set php-config variable correctly (bug #278439)
sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \
"${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die
if use fpm ; then
if use systemd; then
systemd_newunit "${FILESDIR}/php-fpm_at.service" \
"php-fpm@${SLOT}.service"
else
systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \
"php-fpm@${SLOT}.service"
fi
fi
}
src_test() {
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
}

@ -5,11 +5,13 @@ DIST firefox-78.11.0esr.source.tar.xz 333002576 BLAKE2B a8268886f86afb41b86d227f
DIST firefox-78.12.0esr.source.tar.xz 333737488 BLAKE2B 775a55511a48f4210807d2648833bca6f95d9f4cd48b5d0de8cf0bf2609590c1615fca7ff855ae3643a25466d131e15dc293e6a57aa05e1d91d2cf819b0b89ca SHA512 646eb803e0d0e541773e3111708c7eaa85e784e4bae6e4a77dcecdc617ee29e2e349c9ef16ae7e663311734dd7491aebd904359124dda62672dbc18bfb608f0a
DIST firefox-78.13.0esr.source.tar.xz 333506484 BLAKE2B 1922e2f6b2ada46e581e4eaaa388873d31c6a922e5165ba225eeaccde5c1c6d7369a57ecf8e89371a34f692dca5754a461abb7d1c9bfda9cbc4f021d39549439 SHA512 78a5dc8713ab879ebfc3b8fd7a8219844d06f0d897342fdf9a11471633d98e148ff85cf10e561899df4910b94a33b57709b64788df4621a8c0b83eb9a7102cef
DIST firefox-78.14.0esr.source.tar.xz 340771180 BLAKE2B 7b83bf081138fbf2367116099839c6d05ec5ade58f183ba033c5167d503a2a1f40976f88bdba680a7a8df7c66ac32449004e58a5211f16086b792a2b41e27c67 SHA512 5d5e4b1197f87b458a8ab14a62701fa0f3071e9facbb4fba71a64ef69abf31edbb4c5efa6c20198de573216543b5289270b5929c6e917f01bb165ce8c139c1ac
DIST firefox-78.15.0esr.source.tar.xz 330819568 BLAKE2B dc8785613c2f72c55d484642c89c2545765a9efbd609bc7c2cf57b4a3a06a2ea22e6959e42b5b8af867db782e8b2097a67dec858796b744e47008a8e575e2316 SHA512 ac3de735b246ce4f0e1619cd2664321ffa374240ce6843e785d79a350dc30c967996bbcc5e3b301cb3d822ca981cbea116758fc4122f1738d75ddfd1165b6378
DIST firefox-78esr-patches-13.tar.xz 83664 BLAKE2B 92250d5bc3821ee1ff032236bd00e01a53e0af4f9e39696a634edb39f0a182bf5ff74b7fc0f107c9c53136c64485c398391e3a857c8b2b904115fd13d17e2a4f SHA512 96739811bea833a6a9cb09075dfe49c6fa7f613e8bd41e1d830d6ae6851ce8e2f5d27c87d0035b6f3a099340dfd7eebe6ecb930ff25079e76cea92a7610293ca
DIST firefox-78esr-patches-14.tar.xz 82976 BLAKE2B 08cc3618c8069f4169b7647e7eb699153d558bb89f8a4f1ed74d5ccd339f77119cd8f253df011f0c2f255ad889b65e843171d7559f469788463ca7e9aa2e96aa SHA512 1611c6f9d2c7d586e7b53810c1cfdb2682f5d289b1b019b71694b1ab2d8bbdfe827a73cfaf59f7e4808c0b90409ca4fa57e27655d8cdf0c578ffdbad33659f26
DIST firefox-78esr-patches-15.tar.xz 65604 BLAKE2B 86e421e555ffd5f7f201d0f1a1c446c649739c67cdf8dca536efa115e09d9c357ce1551b7270c77e8bfe7dd53e0f3e6386496283879cf5e0c59b3c864951ebb3 SHA512 b229e895f083a0404cda1da0d8ae937429d5975ac52ab20e8b15611d9c737381a1076ebfa8c8a127dacac0e12a2a905ffd579facde2d80c6facc911e5739e34b
DIST firefox-78esr-patches-16.tar.xz 55964 BLAKE2B 79d3a465c69656bb55ee7c1e9060606464b6404435b92f534db275521ac2343e045feae1fff6166fde9e2599a82cd982b0b2395271b1033f0f784e745e2c6965 SHA512 3aa971c726646cbf37a14a0dba6c4ac966b88db655cd8b730c5572543bfbf682991ee7c139889541e4f6936c13f27233dc1837fbdb9ee340b33ebb2cec59b01f
DIST firefox-78esr-patches-17.tar.xz 56004 BLAKE2B 01d2ded2658c24176a3d13d0267d1c4df4ef0113c5c40b1002acd39a0f04db35b773bc617afed1c681df3ec38120621a5c3753ba2d36688d7d5926233bfb8501 SHA512 43b372b848c1f30e02505d06bbb11f5b80d976fe7ee39c0d2aacf60d48bc1d3e378c325f4e2fd4730b971e88c3bd902539a7b81874f53b8b92369f876e05be5e
DIST firefox-78esr-patches-18.tar.xz 55968 BLAKE2B f32fe8e0086e4bf74fd43127b9fe136a0e0ad6e51cb8a2398f6e8f9fe585de1574c745dd3f50440cf62b626f9fa24d368284c563fb75acbacc5238f9bc8d099f SHA512 99a51a241d91aa00c64550f2a521528f6134c8812e379eaf95cd1287fd51d00346de8d41f2d2f55a83332580531b31c4e814a47d7f69da6e3512613e8e98bb31
DIST js185-1.0.0.tar.gz 6164605 BLAKE2B 76a37f0ceae05d3475853875bd0ce4be6e525e4114816f8f281ea6fc6b60a71060975a0fa1cb843f57ad1e2f842dfb26b24244fa0fd6c20f6ae2ebbe430f70be SHA512 2af7122a7c7007fd7b6668776fe1222515a810b3e43bbf0f76b8f94e1ef406ffd3fb5ccec393021b00274c05b38a77235bc8d6886994c56762fcaf0aa7cf6718
DIST mozjs-52.9.1pre1.tar.bz2 30178574 BLAKE2B 0920432b5140e78297a9bcbccb54268d75a223d5e75e4ff90b3b01aab4f7736b4a4e05c47b3a925ff0a74607a0abad3b6583c75d070ef5142009b20ebaf6e4bf SHA512 187b231b246a5ae09e55c0fef77866b316d75f38f4c2e066d5d4325d8da63433027020c929439cab46af3253ac63ab2f780223a8fd2c6ff535b3409bb6c4aa0f
DIST mozjs-60.5.2.tar.bz2 32816585 BLAKE2B 45ac4c9646e1275faf60eeedbf486f802cd106583eb7f640fe2243adc7cbb811dced5cefa94426cceca63468b0112be84078ffcef24cb2b8c1a7b6c8173c0d45 SHA512 5fb73330e7803bdd524fbe7cfdf4e6b72e85d4b22b0c827400317b5d052d1088d36e558ceac376393089e9d03e658b24e69262851fc04a66bbcda47135423dc0

@ -0,0 +1,454 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="7"
# Patch version
FIREFOX_PATCHSET="firefox-78esr-patches-18.tar.xz"
SPIDERMONKEY_PATCHSET="spidermonkey-78-patches-04.tar.xz"
LLVM_MAX_SLOT=12
PYTHON_COMPAT=( python3_{7..9} )
WANT_AUTOCONF="2.1"
inherit autotools check-reqs flag-o-matic llvm multiprocessing prefix python-any-r1 toolchain-funcs
MY_PN="mozjs"
MY_PV="${PV/_pre*}" # Handle Gentoo pre-releases
MY_MAJOR=$(ver_cut 1)
MOZ_ESR=yes
MOZ_PV=${PV}
MOZ_PV_SUFFIX=
if [[ ${PV} =~ (_(alpha|beta|rc).*)$ ]] ; then
MOZ_PV_SUFFIX=${BASH_REMATCH[1]}
# Convert the ebuild version to the upstream Mozilla version
MOZ_PV="${MOZ_PV/_alpha/a}" # Handle alpha for SRC_URI
MOZ_PV="${MOZ_PV/_beta/b}" # Handle beta for SRC_URI
MOZ_PV="${MOZ_PV%%_rc*}" # Handle rc for SRC_URI
fi
if [[ -n ${MOZ_ESR} ]] ; then
# ESR releases have slightly different version numbers
MOZ_PV="${MOZ_PV}esr"
fi
MOZ_PN="firefox"
MOZ_P="${MOZ_PN}-${MOZ_PV}"
MOZ_PV_DISTFILES="${MOZ_PV}${MOZ_PV_SUFFIX}"
MOZ_P_DISTFILES="${MOZ_PN}-${MOZ_PV_DISTFILES}"
MOZ_SRC_BASE_URI="https://archive.mozilla.org/pub/${MOZ_PN}/releases/${MOZ_PV}"
if [[ ${PV} == *_rc* ]] ; then
MOZ_SRC_BASE_URI="https://archive.mozilla.org/pub/${MOZ_PN}/candidates/${MOZ_PV}-candidates/build${PV##*_rc}"
fi
PATCH_URIS=(
https://dev.gentoo.org/~{whissi,polynomial-c,axs}/mozilla/patchsets/${FIREFOX_PATCHSET}
https://dev.gentoo.org/~{whissi,polynomial-c,axs}/mozilla/patchsets/${SPIDERMONKEY_PATCHSET}
)
SRC_URI="${MOZ_SRC_BASE_URI}/source/${MOZ_P}.source.tar.xz -> ${MOZ_P_DISTFILES}.source.tar.xz
${PATCH_URIS[@]}"
DESCRIPTION="SpiderMonkey is Mozilla's JavaScript engine written in C and C++"
HOMEPAGE="https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey"
KEYWORDS="~amd64 ~arm ~arm64 ~mips ~ppc64 ~riscv ~s390 ~x86"
SLOT="78"
LICENSE="MPL-2.0"
IUSE="clang cpu_flags_arm_neon debug +jit lto test"
RESTRICT="!test? ( test )"
BDEPEND="${PYTHON_DEPS}
>=virtual/rust-1.41.0
virtual/pkgconfig
|| (
(
sys-devel/llvm:12
clang? (
sys-devel/clang:12
lto? ( =sys-devel/lld-12* )
)
)
(
sys-devel/llvm:11
clang? (
sys-devel/clang:11
lto? ( =sys-devel/lld-11* )
)
)
(
sys-devel/llvm:10
clang? (
sys-devel/clang:10
lto? ( =sys-devel/lld-10* )
)
)
)
lto? (
!clang? ( sys-devel/binutils[gold] )
)"
CDEPEND=">=dev-libs/icu-67.1:=
>=dev-libs/nspr-4.25
sys-libs/readline:0=
>=sys-libs/zlib-1.2.3"
DEPEND="${CDEPEND}
test? (
$(python_gen_any_dep 'dev-python/six[${PYTHON_USEDEP}]')
)"
RDEPEND="${CDEPEND}"
S="${WORKDIR}/firefox-${MY_PV}/js/src"
llvm_check_deps() {
if ! has_version -b "sys-devel/llvm:${LLVM_SLOT}" ; then
einfo "sys-devel/llvm:${LLVM_SLOT} is missing! Cannot use LLVM slot ${LLVM_SLOT} ..." >&2
return 1
fi
if use clang ; then
if ! has_version -b "sys-devel/clang:${LLVM_SLOT}" ; then
einfo "sys-devel/clang:${LLVM_SLOT} is missing! Cannot use LLVM slot ${LLVM_SLOT} ..." >&2
return 1
fi
if use lto ; then
if ! has_version -b "=sys-devel/lld-${LLVM_SLOT}*" ; then
einfo "=sys-devel/lld-${LLVM_SLOT}* is missing! Cannot use LLVM slot ${LLVM_SLOT} ..." >&2
return 1
fi
fi
fi
einfo "Using LLVM slot ${LLVM_SLOT} to build" >&2
}
python_check_deps() {
if use test ; then
has_version "dev-python/six[${PYTHON_USEDEP}]"
fi
}
pkg_pretend() {
if use test ; then
CHECKREQS_DISK_BUILD="7600M"
else
CHECKREQS_DISK_BUILD="6400M"
fi
check-reqs_pkg_pretend
}
pkg_setup() {
if [[ ${MERGE_TYPE} != binary ]] ; then
if use test ; then
CHECKREQS_DISK_BUILD="7600M"
else
CHECKREQS_DISK_BUILD="6400M"
fi
check-reqs_pkg_setup
llvm_pkg_setup
if use clang && use lto ; then
local version_lld=$(ld.lld --version 2>/dev/null | awk '{ print $2 }')
[[ -n ${version_lld} ]] && version_lld=$(ver_cut 1 "${version_lld}")
[[ -z ${version_lld} ]] && die "Failed to read ld.lld version!"
# temp fix for https://bugs.gentoo.org/768543
# we can assume that rust 1.{49,50}.0 always uses llvm 11
local version_rust=$(rustc -Vv 2>/dev/null | grep -F -- 'release:' | awk '{ print $2 }')
[[ -n ${version_rust} ]] && version_rust=$(ver_cut 1-2 "${version_rust}")
[[ -z ${version_rust} ]] && die "Failed to read version from rustc!"
if ver_test "${version_rust}" -ge "1.49" && ver_test "${version_rust}" -le "1.50" ; then
local version_llvm_rust="11"
else
local version_llvm_rust=$(rustc -Vv 2>/dev/null | grep -F -- 'LLVM version:' | awk '{ print $3 }')
[[ -n ${version_llvm_rust} ]] && version_llvm_rust=$(ver_cut 1 "${version_llvm_rust}")
[[ -z ${version_llvm_rust} ]] && die "Failed to read used LLVM version from rustc!"
fi
if ver_test "${version_lld}" -ne "${version_llvm_rust}" ; then
eerror "Rust is using LLVM version ${version_llvm_rust} but ld.lld version belongs to LLVM version ${version_lld}."
eerror "You will be unable to link ${CATEGORY}/${PN}. To proceed you have the following options:"
eerror " - Manually switch rust version using 'eselect rust' to match used LLVM version"
eerror " - Switch to dev-lang/rust[system-llvm] which will guarantee matching version"
eerror " - Build ${CATEGORY}/${PN} without USE=lto"
die "LLVM version used by Rust (${version_llvm_rust}) does not match with ld.lld version (${version_lld})!"
fi
fi
python-any-r1_pkg_setup
# Build system is using /proc/self/oom_score_adj, bug #604394
addpredict /proc/self/oom_score_adj
if ! mountpoint -q /dev/shm ; then
# If /dev/shm is not available, configure is known to fail with
# a traceback report referencing /usr/lib/pythonN.N/multiprocessing/synchronize.py
ewarn "/dev/shm is not mounted -- expect build failures!"
fi
# Ensure we use C locale when building, bug #746215
export LC_ALL=C
fi
}
src_prepare() {
pushd ../.. &>/dev/null || die
use lto && rm -v "${WORKDIR}"/firefox-patches/*-LTO-Only-enable-LTO-*.patch
eapply "${WORKDIR}"/firefox-patches
eapply "${WORKDIR}"/spidermonkey-patches
default
# Make LTO respect MAKEOPTS
sed -i \
-e "s/multiprocessing.cpu_count()/$(makeopts_jobs)/" \
build/moz.configure/lto-pgo.configure \
|| die "sed failed to set num_cores"
# sed-in toolchain prefix
sed -i \
-e "s/objdump/${CHOST}-objdump/" \
python/mozbuild/mozbuild/configure/check_debug_ranges.py \
|| die "sed failed to set toolchain prefix"
# use prefix shell in wrapper linker scripts, bug #789660
hprefixify "${S}"/../../build/cargo-{,host-}linker
einfo "Removing pre-built binaries ..."
find third_party -type f \( -name '*.so' -o -name '*.o' \) -print -delete || die
MOZJS_BUILDDIR="${WORKDIR}/build"
mkdir "${MOZJS_BUILDDIR}" || die
popd &>/dev/null || die
eautoconf
}
src_configure() {
# Show flags set at the beginning
einfo "Current CFLAGS: ${CFLAGS}"
einfo "Current CXXFLAGS: ${CXXFLAGS}"
einfo "Current LDFLAGS: ${LDFLAGS}"
einfo "Current RUSTFLAGS: ${RUSTFLAGS}"
local have_switched_compiler=
if use clang && ! tc-is-clang ; then
# Force clang
einfo "Enforcing the use of clang due to USE=clang ..."
have_switched_compiler=yes
AR=llvm-ar
CC=${CHOST}-clang
CXX=${CHOST}-clang++
NM=llvm-nm
RANLIB=llvm-ranlib
elif ! use clang && ! tc-is-gcc ; then
# Force gcc
have_switched_compiler=yes
einfo "Enforcing the use of gcc due to USE=-clang ..."
AR=gcc-ar
CC=${CHOST}-gcc
CXX=${CHOST}-g++
NM=gcc-nm
RANLIB=gcc-ranlib
fi
if [[ -n "${have_switched_compiler}" ]] ; then
# Because we switched active compiler we have to ensure
# that no unsupported flags are set
strip-unsupported-flags
fi
# Ensure we use correct toolchain
export HOST_CC="$(tc-getBUILD_CC)"
export HOST_CXX="$(tc-getBUILD_CXX)"
tc-export CC CXX LD AR NM OBJDUMP RANLIB PKG_CONFIG
cd "${MOZJS_BUILDDIR}" || die
# ../python/mach/mach/mixin/process.py fails to detect SHELL
export SHELL="${EPREFIX}/bin/bash"
local -a myeconfargs=(
--host="${CBUILD:-${CHOST}}"
--target="${CHOST}"
--disable-jemalloc
--disable-optimize
--disable-strip
--enable-readline
--enable-shared-js
--with-intl-api
--with-system-icu
--with-system-nspr
--with-system-zlib
--with-toolchain-prefix="${CHOST}-"
$(use_enable debug)
$(use_enable jit)
$(use_enable test tests)
)
if ! use x86 && [[ ${CHOST} != armv*h* ]] ; then
myeconfargs+=( --enable-rust-simd )
fi
# Modifications to better support ARM, bug 717344
if use cpu_flags_arm_neon ; then
myeconfargs+=( --with-fpu=neon )
if ! tc-is-clang ; then
# thumb options aren't supported when using clang, bug 666966
myeconfargs+=( --with-thumb=yes )
myeconfargs+=( --with-thumb-interwork=no )
fi
fi
# Tell build system that we want to use LTO
if use lto ; then
myeconfargs+=( --enable-lto )
if use clang ; then
myeconfargs+=( --enable-linker=lld )
else
myeconfargs+=( --enable-linker=gold )
fi
fi
# LTO flag was handled via configure
filter-flags '-flto*'
if tc-is-gcc ; then
if ver_test $(gcc-fullversion) -ge 10 ; then
einfo "Forcing -fno-tree-loop-vectorize to workaround GCC bug, see bug 758446 ..."
append-cxxflags -fno-tree-loop-vectorize
fi
fi
# Show flags we will use
einfo "Build CFLAGS: ${CFLAGS}"
einfo "Build CXXFLAGS: ${CXXFLAGS}"
einfo "Build LDFLAGS: ${LDFLAGS}"
einfo "Build RUSTFLAGS: ${RUSTFLAGS}"
# Forcing system-icu allows us to skip patching bundled ICU for PPC
# and other minor arches
ECONF_SOURCE="${S}" \
econf \
${myeconfargs[@]} \
XARGS="${EPREFIX}/usr/bin/xargs"
}
src_compile() {
cd "${MOZJS_BUILDDIR}" || die
default
}
src_test() {
if "${MOZJS_BUILDDIR}/js/src/js" -e 'print("Hello world!")'; then
einfo "Smoke-test successful, continuing with full test suite"
else
die "Smoke-test failed: did interpreter initialization fail?"
fi
local -a KNOWN_TESTFAILURES
KNOWN_TESTFAILURES+=( non262/Date/reset-time-zone-cache-same-offset.js )
KNOWN_TESTFAILURES+=( non262/Date/time-zone-path.js )
KNOWN_TESTFAILURES+=( non262/Date/time-zones-historic.js )
KNOWN_TESTFAILURES+=( non262/Date/time-zones-imported.js )
KNOWN_TESTFAILURES+=( non262/Date/toString-localized.js )
KNOWN_TESTFAILURES+=( non262/Date/toString-localized-posix.js )
KNOWN_TESTFAILURES+=( non262/Intl/Date/toLocaleString_timeZone.js )
KNOWN_TESTFAILURES+=( non262/Intl/Date/toLocaleDateString_timeZone.js )
KNOWN_TESTFAILURES+=( non262/Intl/DateTimeFormat/format.js )
KNOWN_TESTFAILURES+=( non262/Intl/DateTimeFormat/format_timeZone.js )
KNOWN_TESTFAILURES+=( non262/Intl/DateTimeFormat/timeZone_backward_links.js )
KNOWN_TESTFAILURES+=( non262/Intl/DateTimeFormat/tz-environment-variable.js )
KNOWN_TESTFAILURES+=( non262/Intl/DisplayNames/language.js )
KNOWN_TESTFAILURES+=( non262/Intl/DisplayNames/region.js )
KNOWN_TESTFAILURES+=( non262/Intl/Locale/likely-subtags.js )
KNOWN_TESTFAILURES+=( non262/Intl/Locale/likely-subtags-generated.js )
KNOWN_TESTFAILURES+=( test262/intl402/Locale/prototype/minimize/removing-likely-subtags-first-adds-likely-subtags.js )
if use x86 ; then
KNOWN_TESTFAILURES+=( non262/Date/timeclip.js )
KNOWN_TESTFAILURES+=( test262/built-ins/Number/prototype/toPrecision/return-values.js )
KNOWN_TESTFAILURES+=( test262/language/types/number/S8.5_A2.1.js )
KNOWN_TESTFAILURES+=( test262/language/types/number/S8.5_A2.2.js )
fi
if [[ $(tc-endian) == "big" ]] ; then
KNOWN_TESTFAILURES+=( test262/built-ins/TypedArray/prototype/set/typedarray-arg-set-values-same-buffer-other-type.js )
fi
echo "" > "${T}"/known_failures.list || die
local KNOWN_TESTFAILURE
for KNOWN_TESTFAILURE in ${KNOWN_TESTFAILURES[@]} ; do
echo "${KNOWN_TESTFAILURE}" >> "${T}"/known_failures.list
done
PYTHONPATH="${S}/tests/lib" \
${PYTHON} \
"${S}"/tests/jstests.py -d -s -t 1800 --wpt=disabled --no-progress \
--exclude-file="${T}"/known_failures.list \
"${MOZJS_BUILDDIR}"/js/src/js \
|| die
if use jit ; then
KNOWN_TESTFAILURES=()
echo "" > "${T}"/known_failures.list || die
for KNOWN_TESTFAILURE in ${KNOWN_TESTFAILURES[@]} ; do
echo "${KNOWN_TESTFAILURE}" >> "${T}"/known_failures.list
done
PYTHONPATH="${S}/tests/lib" \
${PYTHON} \
"${S}"/tests/jstests.py -d -s -t 1800 --wpt=disabled --no-progress \
--exclude-file="${T}"/known_failures.list \
"${MOZJS_BUILDDIR}"/js/src/js basic \
|| die
fi
}
src_install() {
cd "${MOZJS_BUILDDIR}" || die
default
# fix soname links
pushd "${ED}"/usr/$(get_libdir) &>/dev/null || die
mv lib${MY_PN}-${MY_MAJOR}.so lib${MY_PN}-${MY_MAJOR}.so.0.0.0 || die
ln -s lib${MY_PN}-${MY_MAJOR}.so.0.0.0 lib${MY_PN}-${MY_MAJOR}.so.0 || die
ln -s lib${MY_PN}-${MY_MAJOR}.so.0 lib${MY_PN}-${MY_MAJOR}.so || die
popd &>/dev/null || die
# remove unneeded files
rm \
"${ED}"/usr/bin/js${MY_MAJOR}-config \
"${ED}"/usr/$(get_libdir)/libjs_static.ajs \
|| die
# fix permissions
chmod -x \
"${ED}"/usr/$(get_libdir)/pkgconfig/*.pc \
"${ED}"/usr/include/mozjs-${MY_MAJOR}/js-config.h \
|| die
}

Binary file not shown.

@ -40,7 +40,6 @@ src_configure() {
has_version dev-util/google-perftools[minimal] && tcmalloc_lib_name='tcmalloc_minimal'
local myeconfargs=(
--enable-portable-binary \
$(use_with jemalloc) \
$(use_with tcmalloc) \
$(use_with tcmalloc tcmalloc-lib "${tcmalloc_lib_name}")

@ -1,2 +1,3 @@
DIST hiredis-0.14.1.tar.gz 64372 BLAKE2B 9846b05e21bfadb876e26ab45bf5c29a3283b602ef725dfbd877815be690bb5579551f0c452e1d8abf9ae985f6b71408a3b86b343ca5d6dce58dd4897640996a SHA512 a7310f2d65075df0c17636a0220e16487759471a3442b1de2595ab747565f6b6262e37131613b13e396b31050bcbe5529c35d420cd43fd7d500d9d563d469c4f
DIST hiredis-1.0.0.tar.gz 97507 BLAKE2B 247852d53be96e36dbdd7d4d8cfbda4406aa66281f26c28c3f80ab4593679122fd59430b2d5f04d20126b4459fc75af0a1fd67f1ee1db691d8db575debad2b61 SHA512 eb56201121eecdbfc8d42e8c2c141ae77bea248eeb36687ac6835c9b2404f5475beb351c4d8539d552db4d88e933bb2bd5b73f165e62b130bb11aeff39928e69
DIST hiredis-1.0.1.tar.gz 97937 BLAKE2B 476bb3607aabe2147eead61c98de325f4dbd2d7c7439513ea0cd98980fc151a64798647757e46feb61e8914e47b42963bf128c938c94c42c448369065532166f SHA512 87909f78171cf4deeb3d030484b55fbd1a7f7f27f33636f90e169a900ddc5c5ec447d2df34739ada3cf35a50d647cb4fcbe2754f4521d18f770f1cf8ed962909

@ -0,0 +1,87 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit toolchain-funcs
DESCRIPTION="Minimalistic C client library for the Redis database"
HOMEPAGE="https://github.com/redis/hiredis"
SRC_URI="https://github.com/redis/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="BSD"
SLOT="0/1.0.0"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-solaris"
IUSE="examples ssl static-libs test"
RESTRICT="!test? ( test )"
DEPEND="ssl? ( dev-libs/openssl:= )"
RDEPEND="${RDEPEND}"
BDEPEND="test? ( dev-db/redis )"
PATCHES=(
"${FILESDIR}"/${PN}-1.0.0-disable-network-tests.patch
)
src_prepare() {
default
# use GNU ld syntax on Solaris
sed -i -e '/DYLIB_MAKE_CMD=.* -G/d' Makefile || die
}
_build() {
emake \
AR="$(tc-getAR)" \
CC="$(tc-getCC)" \
PREFIX="${EPREFIX}/usr" \
LIBRARY_PATH="$(get_libdir)" \
USE_SSL=$(usex ssl 1 0) \
DEBUG_FLAGS= \
OPTIMIZATION= \
"$@"
}
src_compile() {
# The static lib re-uses the same objects as the shared lib, so
# overhead is low w/creating it all the time. It's also needed
# by the tests.
_build dynamic static hiredis.pc
}
src_test() {
local REDIS_PID="${T}"/hiredis.pid
local REDIS_SOCK="${T}"/hiredis.sock
local REDIS_PORT=56379
local REDIS_TEST_CONFIG="
daemonize yes
pidfile ${REDIS_PID}
port ${REDIS_PORT}
bind 127.0.0.1
unixsocket //${REDIS_SOCK}
"
_build hiredis-test
"${EPREFIX}"/usr/sbin/redis-server - <<< "${REDIS_TEST_CONFIG}" || die
./hiredis-test -h 127.0.0.1 -p ${REDIS_PID} -s ${REDIS_SOCK}
local ret=$?
kill "$(<"${REDIS_PID}")" || die
[[ ${ret} != "0" ]] && die "tests failed"
}
src_install() {
_build PREFIX="${ED}/usr" install
if ! use static-libs ; then
find "${ED}" -name '*.a' -delete || die
fi
insinto /usr/$(get_libdir)/pkgconfig
doins ${PN}.pc
local DOCS=( CHANGELOG.md README.md )
use examples && DOCS+=( examples )
einstalldocs
}

@ -21,7 +21,7 @@ fi
LICENSE="LGPL-2+"
SLOT="5/4"
IUSE="marble +scripting webkit"
IUSE="marble +scripting"
RDEPEND="
>=dev-libs/kproperty-${PV}:5=
@ -35,7 +35,6 @@ RDEPEND="
>=kde-frameworks/kwidgetsaddons-${KFMIN}:5
marble? ( kde-apps/marble:5= )
scripting? ( >=dev-qt/qtdeclarative-${QTMIN}:5 )
webkit? ( >=dev-qt/qtwebkit-5.212.0_pre20180120:5 )
"
DEPEND="${RDEPEND}
${PYTHON_DEPS}
@ -51,7 +50,6 @@ pkg_setup() {
src_configure() {
local mycmakeargs=(
$(cmake_use_find_package marble Marble)
$(cmake_use_find_package webkit Qt5WebKitWidgets)
-DKREPORT_SCRIPTING=$(usex scripting)
)
ecm_src_configure

@ -1,2 +1,3 @@
DIST libgnt-2.14.1.tar.xz 106564 BLAKE2B 19eddef51b44fa82982c705415fee43bf7495bc4692a7371fea782bcc21acdb932f15e1e8de6af962a529eea59f54c0b116d96b87ed3616201e6370760fac5b8 SHA512 434fff31a0946dabeaadbabaf96b4a7cf7f2a7da6d7794b7cf8a75f3f959388d89b32ce5921a20d5d6532ac2fd851ec2f6c18cc7cbc5a0ae97a00ff1ee3f74c3
DIST libgnt-2.14.2.tar.xz 106128 BLAKE2B d3db0ba3a297c14f32cc49b4e5b3392f47031e9406d862520a2f014f4d4e93c13e2ba5a2d61df81637f9dd7961d64ba69b393ee5b3cfebd7eb2768e3f16f29d0 SHA512 17b39e132b44b23486d7d39fa02761997a28abf53f67bf71bbad86d35124e5deb0363d670b2fb5ac99d47256282b0ef6ad1886e12984c868bb0d13ea7ba7d860
DIST libgnt-2.14.3.tar.xz 106388 BLAKE2B bba785c998e53c75ed9c3b0b4ad1d96d63628a6e2b0ac7abec76a671ddfc0284fd787cd6793433aef83e6b31c6efecce0c656e131ca9b8bf548486de1010e1f9 SHA512 7131834cfe585177865bebf26167de08a04fced3da4e9a072d9b09b3becd1194914757b1a1fc8f129ae6c8fefe3ec1ce0d80d6c50cb624a5698b66ee2e06c6c8

@ -11,7 +11,7 @@ SRC_URI="mirror://sourceforge/pidgin/${P}.tar.xz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux"
KEYWORDS="~alpha ~amd64 arm ~arm64 ~ia64 ppc ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux"
IUSE="doc"
RDEPEND="

@ -0,0 +1,40 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit meson
DESCRIPTION="Pidgin's GLib Ncurses Toolkit"
HOMEPAGE="https://keep.imfreedom.org/libgnt/libgnt"
SRC_URI="mirror://sourceforge/pidgin/${P}.tar.xz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux"
IUSE="doc"
RDEPEND="
!<net-im/pidgin-2.14.0
dev-libs/glib:2
dev-libs/libxml2
sys-libs/ncurses:0=
"
DEPEND="${RDEPEND}"
BDEPEND="
dev-util/glib-utils
virtual/pkgconfig
doc? ( dev-util/gtk-doc )
"
PATCHES=(
"${FILESDIR}/${PN}-2.14.0-tinfo.patch"
)
src_configure() {
local emesonargs=(
-Dpython2=false
$(meson_use doc)
)
meson_src_configure
}

@ -18,7 +18,7 @@ SRC_URI="
LICENSE="Apache-2.0 Boost-1.0 BSD MIT"
SLOT="0/8"
KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86"
KEYWORDS="amd64 ~arm ~arm64 ~ppc64 ~x86"
IUSE="test tools"
BDEPEND="

Binary file not shown.

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

Loading…
Cancel
Save