Sync with portage [Sat Jan 12 16:31:30 MSK 2019].

mhiretskiy 1325
root 5 years ago
parent 82989de7b8
commit a4782337ce

Binary file not shown.

Binary file not shown.

@ -1 +1,2 @@
DIST tmpreaper_1.6.13+nmu1.tar.gz 141080 BLAKE2B ad2895e0444e3c1a1ceabf71c34b560a817e7cc274482bde63a07499fac799ef127f5b64c953d43cd11a279819972b63b7e21a683f6250a77eeadc299a491a78 SHA512 c868d421a7757a47b81c8932743981ded2b415c83377f8781fdfd4dfda48c701991da17fa262dfa0680b2a315d6b46ee4c9035ba4c06f5a0c1bc32efa717f19f
DIST tmpreaper_1.6.14.tar.gz 158981 BLAKE2B 1c9ec124c6e57c0aab5d555594950dda37f06a6404a0d111da05be7a48bf6141e09e942c090d3f79ccf855f958a7b32f0d64c73da68b412da74465e39bdb72ae SHA512 e78fab0cd2cc8c851e2806be70c102697bff86230e181bfad1c76b15fe5455fb431bc0dd16bebf77a2e9bb64b5f5a1474d24254ff780d4d72d343ea0e6e30ccb

@ -0,0 +1,43 @@
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
DESCRIPTION="A utility for removing files based on when they were last accessed"
HOMEPAGE="https://packages.debian.org/sid/tmpreaper"
SRC_URI="mirror://debian/pool/main/t/${PN}/${PN}_${PV}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86"
IUSE=""
DEPEND="sys-apps/util-linux
sys-fs/e2fsprogs"
RDEPEND=""
# fix protect patch from debian bug 636459
PATCHES=(
"${FILESDIR}"/${PN}-1.6.13-fix-protect.patch
"${FILESDIR}"/${PN}-1.6.13-gentoo.patch
)
src_install() {
emake DESTDIR="${D}" install
insinto /etc
doins debian/tmpreaper.conf
exeinto /etc/cron.daily
newexe debian/cron.daily tmpreaper
doman debian/tmpreaper.conf.5
dodoc README ChangeLog debian/README*
}
pkg_postinst() {
elog "This package installs a cron script under /etc/cron.daily"
elog "You can configure it using /etc/tmpreaper.conf"
elog "Consult tmpreaper.conf man page for more information"
elog "Read /usr/share/doc/${P}/README.security and"
elog "remove SHOWWARNING from /etc/tmpreaper.conf afterwards"
}

Binary file not shown.

@ -0,0 +1,438 @@
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
inherit desktop libtool qmake-utils systemd user
MY_PV=${PV/_beta/-b}
MY_P=${PN}-${MY_PV}
DESCRIPTION="Featureful client/server network backup suite"
HOMEPAGE="http://www.bacula.org/"
SRC_URI="mirror://sourceforge/bacula/${MY_P}.tar.gz"
LICENSE="AGPL-3"
SLOT="0"
KEYWORDS="~amd64 ~ppc ~sparc ~x86"
IUSE="acl bacula-clientonly bacula-nodir bacula-nosd +batch-insert examples ipv6 libressl logwatch mysql postgres qt5 readline +sqlite ssl static tcpd vim-syntax X"
DEPEND="
!bacula-clientonly? (
!bacula-nodir? ( virtual/mta )
postgres? ( dev-db/postgresql:=[threads] )
mysql? ( || ( dev-db/mysql-connector-c dev-db/mariadb-connector-c ) )
sqlite? ( dev-db/sqlite:3 )
)
dev-libs/gmp:0
qt5? (
dev-qt/qtsvg:5
x11-libs/qwt:6
)
logwatch? ( sys-apps/logwatch )
readline? ( sys-libs/readline:0 )
static? (
dev-libs/lzo[static-libs]
sys-libs/ncurses:=[static-libs]
sys-libs/zlib[static-libs]
acl? ( virtual/acl[static-libs] )
ssl? (
!libressl? ( dev-libs/openssl:0=[static-libs] )
libressl? ( dev-libs/libressl:0=[static-libs] )
)
)
!static? (
dev-libs/lzo
sys-libs/ncurses:=
sys-libs/zlib
acl? ( virtual/acl )
ssl? (
!libressl? ( dev-libs/openssl:0= )
libressl? ( dev-libs/libressl:0= )
)
)
tcpd? ( >=sys-apps/tcp-wrappers-7.6 )
"
RDEPEND="${DEPEND}
!bacula-clientonly? (
!bacula-nosd? (
app-arch/mt-st
sys-block/mtx
)
)
vim-syntax? ( || ( app-editors/vim app-editors/gvim ) )
"
REQUIRED_USE="
!bacula-clientonly? ( ^^ ( mysql postgres sqlite ) )
static? ( bacula-clientonly )
"
S=${WORKDIR}/${MY_P}
pkg_setup() {
#XOR and !bacula-clientonly controlled by REQUIRED_USE
use mysql && export mydbtype="mysql"
use postgres && export mydbtype="postgresql"
use sqlite && export mydbtype="sqlite3"
# create the daemon group and user
if [ -z "$(egetent group bacula 2>/dev/null)" ]; then
enewgroup bacula
einfo
einfo "The group 'bacula' has been created. Any users you add to this"
einfo "group have access to files created by the daemons."
einfo
fi
if use bacula-clientonly && use static && use qt5; then
ewarn
ewarn "Building statically linked 'bat' is not supported. Ignorig 'qt5' useflag."
ewarn
fi
if ! use bacula-clientonly; then
if [ -z "$(egetent passwd bacula 2>/dev/null)" ]; then
enewuser bacula -1 -1 /var/lib/bacula bacula,disk,tape,cdrom,cdrw
einfo
einfo "The user 'bacula' has been created. Please see the bacula manual"
einfo "for information about running bacula as a non-root user."
einfo
fi
fi
}
src_prepare() {
# adjusts default configuration files for several binaries
# to /etc/bacula/<config> instead of ./<config>
pushd src >&/dev/null || die
for f in console/console.c dird/dird.c filed/filed.c \
stored/bcopy.c stored/bextract.c stored/bls.c \
stored/bscan.c stored/btape.c stored/stored.c \
qt-console/main.cpp; do
sed -i -e 's|^\(#define CONFIG_FILE "\)|\1/etc/bacula/|g' "${f}" \
|| die "sed on ${f} failed"
done
popd >&/dev/null || die
# bug 466688 drop deprecated categories from Desktop file
sed -i -e 's/Application;//' scripts/bat.desktop.in || die
# bug 466690 Use CXXFLAGS instead of CFLAGS
sed -i -e 's/@CFLAGS@/@CXXFLAGS@/' autoconf/Make.common.in || die
# drop automatic install of unneeded documentation (for bug 356499)
eapply -p0 "${FILESDIR}"/7.2.0/${PN}-7.2.0-doc.patch
# bug #310087
eapply "${FILESDIR}"/5.2.3/${PN}-5.2.3-as-needed.patch
# bug #311161
eapply -p0 "${FILESDIR}"/9.0.2/${PN}-9.0.2-lib-search-path.patch
# bat needs to respect LDFLAGS and CFLAGS
eapply -p0 "${FILESDIR}"/9.0.6/${PN}-9.0.6-bat-pro.patch
# bug #328701
eapply -p0 "${FILESDIR}"/5.2.3/${PN}-5.2.3-openssl-1.patch
eapply -p0 "${FILESDIR}"/9.0.8/${PN}-9.0.8-fix-static.patch
# fix soname in libbaccat.so bug #602952
eapply -p0 "${FILESDIR}/bacula-fix-sonames.patch"
# do not strip binaries
sed -i -e "s/strip /# strip /" src/filed/Makefile.in || die
sed -i -e "s/strip /# strip /" src/console/Makefile.in || die
# fix file not found error during make depend
eapply -p0 "${FILESDIR}"/7.0.2/${PN}-7.0.2-depend.patch
eapply_user
# Fix systemd unit files:
# bug 497748
sed -i -e '/Requires/d' platforms/systemd/*.service.in || die
sed -i -e '/StandardOutput/d' platforms/systemd/*.service.in || die
# bug 504370
sed -i -e '/Alias=bacula-dir/d' platforms/systemd/bacula-dir.service.in || die
# bug 584442 and 504368
sed -i -e 's/@dir_user@/root/g' platforms/systemd/bacula-dir.service.in || die
# build 'bat' for Qt5
export QMAKE="$(qt5_get_bindir)"/qmake
# adapt to >=Qt-5.9 (see bug #644566)
# qmake needs an existing target file to generate install instructions
sed -i -e 's#bins.files = bat#bins.files = .libs/bat#g' \
src/qt-console/bat.pro.in || die
mkdir src/qt-console/.libs || die
touch src/qt-console/.libs/bat || die
chmod 755 src/qt-console/.libs/bat || die
# fix handling of libressl version
# needs separate handling for <libressl-2.7 and >=libressl2.7
# (see bug #655520)
if has_version "<dev-libs/libressl-2.7"; then
eapply -p0 "${FILESDIR}"/9.4.0/${PN}-9.4.0-libressl26.patch
else
eapply -p0 "${FILESDIR}"/9.4.0/${PN}-9.4.0-libressl27.patch
fi
# Fix an integer overflow (Thanks Ph. Stracchino)
eapply -p1 "${FILESDIR}"/9.4.1/${PN}-9.4.1_sql.patch
# Don't let program install man pages directly
rm "${S}"/manpages/Makefile.in || die "Unable to remove man pages Makefile.in"
eapply -p1 "${FILESDIR}/bacula-fix-manpages.patch"
# fix bundled libtool (bug 466696)
# But first move directory with M4 macros out of the way.
# It is only needed by autoconf and gives errors during elibtoolize.
mv autoconf/libtool autoconf/libtool1 || die
elibtoolize
}
src_configure() {
local myconf=''
if use bacula-clientonly; then
myconf="${myconf} \
$(use_enable bacula-clientonly client-only) \
$(use_enable !static libtool) \
$(use_enable static static-cons) \
$(use_enable static static-fd)"
else
myconf="${myconf} \
$(use_enable !bacula-nodir build-dird) \
$(use_enable !bacula-nosd build-stored)"
# bug #311099
# database support needed by dir-only *and* sd-only
# build as well (for building bscan, btape, etc.)
myconf="${myconf}
--with-${mydbtype}"
fi
# do not build bat if 'static' clientonly
if ! use bacula-clientonly || ! use static; then
myconf="${myconf} \
$(use_enable qt5 bat)"
fi
myconf="${myconf} \
$(use_with X x) \
$(use_enable batch-insert) \
$(use_enable !readline conio) \
$(use_enable readline) \
$(use_with readline readline /usr) \
$(use_with ssl openssl) \
$(use_enable ipv6) \
$(use_enable acl) \
$(use_with tcpd tcp-wrappers)"
econf \
--libdir=/usr/$(get_libdir) \
--docdir=/usr/share/doc/${PF} \
--htmldir=/usr/share/doc/${PF}/html \
--with-pid-dir=/var/run \
--sysconfdir=/etc/bacula \
--with-archivedir=/var/lib/bacula/tmp \
--with-subsys-dir=/var/lock/subsys \
--with-working-dir=/var/lib/bacula \
--with-logdir=/var/lib/bacula \
--with-scriptdir=/usr/libexec/bacula \
--with-systemd=$(systemd_get_systemunitdir) \
--with-dir-user=bacula \
--with-dir-group=bacula \
--with-sd-user=root \
--with-sd-group=bacula \
--with-fd-user=root \
--with-fd-group=bacula \
--enable-smartalloc \
--disable-afs \
--without-s3 \
--host=${CHOST} \
${myconf}
}
src_compile() {
# Make build log verbose (bug #447806)
emake NO_ECHO=""
}
src_install() {
emake DESTDIR="${D}" install
doicon scripts/bacula.png
# install bat icon and desktop file when enabled
# (for some reason ./configure doesn't pick this up)
if use qt5 && ! use static ; then
doicon src/qt-console/images/bat_icon.png
domenu scripts/bat.desktop
fi
# remove some scripts we don't need at all
rm -f "${D}"/usr/libexec/bacula/{bacula,bacula-ctl-dir,bacula-ctl-fd,bacula-ctl-sd,startmysql,stopmysql}
# rename statically linked apps
if use bacula-clientonly && use static ; then
pushd "${D}"/usr/sbin || die
mv static-bacula-fd bacula-fd || die
mv static-bconsole bconsole || die
popd || die
fi
# extra files which 'make install' doesn't cover
if ! use bacula-clientonly; then
# the database update scripts
diropts -m0750
insinto /usr/libexec/bacula/updatedb
insopts -m0754
doins "${S}"/updatedb/*
fperms 0640 /usr/libexec/bacula/updatedb/README
# the logrotate configuration
# (now unconditional wrt bug #258187)
diropts -m0755
insinto /etc/logrotate.d
insopts -m0644
newins "${S}"/scripts/logrotate bacula
# the logwatch scripts
if use logwatch; then
diropts -m0750
dodir /usr/share/logwatch/scripts/services
dodir /usr/share/logwatch/scripts/shared
dodir /etc/logwatch/conf/logfiles
dodir /etc/logwatch/conf/services
pushd "${S}"/scripts/logwatch >&/dev/null || die
emake DESTDIR="${D}" install
popd >&/dev/null || die
fi
fi
if ! use qt5; then
rm -vf "${D}"/usr/share/man/man1/bat.1*
fi
rm -vf "${D}"/usr/share/man/man1/bacula-tray-monitor.1*
if use bacula-clientonly || use bacula-nodir ; then
rm -vf "${D}"/usr/libexec/bacula/create_*_database
rm -vf "${D}"/usr/libexec/bacula/drop_*_database
rm -vf "${D}"/usr/libexec/bacula/make_*_tables
rm -vf "${D}"/usr/libexec/bacula/update_*_tables
rm -vf "${D}"/usr/libexec/bacula/drop_*_tables
rm -vf "${D}"/usr/libexec/bacula/grant_*_privileges
rm -vf "${D}"/usr/libexec/bacula/*_catalog_backup
fi
if use bacula-clientonly || use bacula-nosd; then
rm -vf "${D}"/usr/libexec/bacula/disk-changer
rm -vf "${D}"/usr/libexec/bacula/mtx-changer
rm -vf "${D}"/usr/libexec/bacula/dvd-handler
fi
# documentation
dodoc ChangeLog ReleaseNotes SUPPORT
# Install all man pages
doman "${S}"/manpages/*
# install examples (bug #457504)
if use examples; then
docinto examples/
dodoc -r examples/*
fi
# vim-files
if use vim-syntax; then
insinto /usr/share/vim/vimfiles/syntax
doins scripts/bacula.vim
insinto /usr/share/vim/vimfiles/ftdetect
newins scripts/filetype.vim bacula_ft.vim
fi
# setup init scripts
myscripts="bacula-fd"
if ! use bacula-clientonly; then
if ! use bacula-nodir; then
myscripts="${myscripts} bacula-dir"
fi
if ! use bacula-nosd; then
myscripts="${myscripts} bacula-sd"
fi
fi
for script in ${myscripts}; do
# copy over init script and config to a temporary location
# so we can modify them as needed
cp "${FILESDIR}/${script}".confd "${T}/${script}".confd || die "failed to copy ${script}.confd"
cp "${FILESDIR}/newscripts/${script}".initd "${T}/${script}".initd || die "failed to copy ${script}.initd"
# now set the database dependancy for the director init script
case "${script}" in
bacula-dir)
case "${mydbtype}" in
sqlite3)
# sqlite databases don't have a daemon
sed -i -e 's/need "%database%"/:/g' "${T}/${script}".initd || die
;;
*)
# all other databases have daemons
sed -i -e "s:%database%:${mydbtype}:" "${T}/${script}".initd || die
;;
esac
;;
*)
;;
esac
# install init script and config
newinitd "${T}/${script}".initd "${script}"
newconfd "${T}/${script}".confd "${script}"
done
systemd_dounit "${S}"/platforms/systemd/bacula-{dir,fd,sd}.service
# make sure the working directory exists
diropts -m0750
keepdir /var/lib/bacula
# make sure bacula group can execute bacula libexec scripts
fowners -R root:bacula /usr/libexec/bacula
}
pkg_postinst() {
if use bacula-clientonly; then
fowners root:bacula /var/lib/bacula
else
fowners bacula:bacula /var/lib/bacula
fi
if ! use bacula-clientonly && ! use bacula-nodir; then
einfo
einfo "If this is a new install, you must create the ${mydbtype} databases with:"
einfo " /usr/libexec/bacula/create_${mydbtype}_database"
einfo " /usr/libexec/bacula/make_${mydbtype}_tables"
einfo " /usr/libexec/bacula/grant_${mydbtype}_privileges"
einfo
ewarn "ATTENTION!"
ewarn "The format of the database may have changed."
ewarn "If you just upgraded from a version below 9.0.0 you must run"
ewarn "'update_bacula_tables' now."
ewarn "Make sure to have a backup of your catalog before."
ewarn
fi
if use sqlite; then
einfo
einfo "Be aware that Bacula does not officially support SQLite database anymore."
einfo "Best use it only for a client-only installation. See Bug #445540."
einfo
fi
einfo "Please note that 'bconsole' will always be installed. To compile 'bat'"
einfo "you have to enable 'USE=qt5'."
einfo
einfo "/var/lib/bacula/tmp was configured for archivedir. This dir will be used during"
einfo "restores, so be sure to set it to an appropriate in dir in the bacula config."
}

@ -0,0 +1,11 @@
--- bacula-9.4.1.orig/src/cats/sql_update.c 2018-12-16 05:30:25.000000000 -0500
+++ bacula-9.4.1/src/cats/sql_update.c 2018-12-31 12:58:09.107874630 -0500
@@ -375,7 +375,7 @@
"LabelType=%d,StorageId=%s,PoolId=%s,VolRetention=%s,VolUseDuration=%s,"
"MaxVolJobs=%d,MaxVolFiles=%d,Enabled=%d,LocationId=%s,"
"ScratchPoolId=%s,RecyclePoolId=%s,RecycleCount=%d,Recycle=%d,"
- "ActionOnPurge=%d,CacheRetention=%s,EndBlock=%d"
+ "ActionOnPurge=%d,CacheRetention=%s,EndBlock=%u"
" WHERE VolumeName='%s'",
mr->VolJobs, mr->VolFiles, mr->VolBlocks,
edit_uint64(mr->VolBytes, ed1),

Binary file not shown.

@ -24,7 +24,7 @@ RDEPEND="gcrypt? ( dev-libs/libgcrypt:0= )
DEPEND="${DEPEND}
test? ( dev-util/cmocka )"
BDEPEND="virtual/pkgconfig
sys-devel/autoconf-archive
~sys-devel/autoconf-archive-2018.03.13
doc? ( app-doc/doxygen )"
PATCHES=(

Binary file not shown.

@ -1,2 +1 @@
DIST auto-complete-1.3.1.tar.bz2 155081 BLAKE2B 7ceedcececcd80b7d8207cb2ff88f2bbfeee892d56a96f44c6929323ca974206b6d977830a8593ba9f7c87ba86914bf9a0771f5e11a284d7bb42fdd9e9985b48 SHA512 5b82120f8faf1ee4ff139f4fbacb894fa0bf617b9a0aaebb5a0d672a6f90cb01bc35f0c99cebe2bef55cb7a6af6ce03936a7226c89e3c79248aacf4ae554fb7b
DIST auto-complete-1.5.1.tar.gz 196709 BLAKE2B 1593a6c0b60d9cb25a9597b7283d741042f79d0227c3865386a5d74e03d216a7e96ba7304e23148ac6bd18deb30f36777b88c4b3227b7482f28a224fd027b7b9 SHA512 e01a99d5e393d1d2309d6c616b4af34e8f3f2c585eaefad602ba5b6cf1890a18e851fd58804c4a6669c8131e9e7a5470c7aa650583a0bc1a2298875f7181614e

@ -1,33 +0,0 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=5
inherit elisp
DESCRIPTION="Auto-complete package"
HOMEPAGE="http://cx4a.org/software/auto-complete/
https://github.com/m2ym/auto-complete/"
SRC_URI="http://cx4a.org/pub/${PN}/${P}.tar.bz2"
LICENSE="GPL-3+ FDL-1.1+"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="l10n_ja"
SITEFILE="50${PN}-gentoo.el"
src_install() {
elisp_src_install
# install dictionaries
insinto "${SITEETC}/${PN}"
doins -r dict
dodoc README.txt TODO.txt etc/test.txt
cd doc
dodoc index.txt manual.txt demo.txt changes.txt *.png
if use l10n_ja; then
dodoc index.ja.txt manual.ja.txt changes.ja.txt
fi
}

@ -1,4 +1,4 @@
# Copyright 1999-2018 Gentoo Authors
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
@ -13,6 +13,7 @@ SRC_URI="https://github.com/auto-complete/popup-el/archive/v${PV}.tar.gz -> ${MY
LICENSE="GPL-3+"
SLOT="0"
KEYWORDS="~amd64 ~x86"
RESTRICT="test"
S="${WORKDIR}/${MY_P}"
DOCS="README.md"

@ -2,3 +2,5 @@ DIST ruby-2.3.0.tar.xz 11294412 BLAKE2B 2c1324154aadd287952cc6430891048ea69922c0
DIST ruby-2.4.1.tar.xz 9939188 BLAKE2B 5be893c8996d17ff333276a772747d3099cec0c41331e1a1916679afc43a8ad5ed99a827bc76b32652ec950eaec933dbe28e1dde313987c2891f258ba7097af7 SHA512 e6fd290b6edd166348b70f0f1c56f7ed9d956c4c1eb91d97d0548041ca4196b9b75ec1ad35c745bdbfd4de195899093e7205d7f02b014ecf1c48e6f31cf25903
DIST ruby-2.5.0.tar.xz 11292472 BLAKE2B 852ce003a79d9d77e72928353382962440e99ed1d03558c89a928e8f4a582b27357ef63e3ef45f3b30009f7a95f356100941bd84151571ade3a88b2d0595f8ad SHA512 55714a33d7661fe8b432f73c34fd67b49699f8b79df1cbd680a74899124d31111ab0f444677672aac1ba725820182940d485efb2db0bf2bc96737c5d40c54578
DIST ruby-2.5.1.tar.xz 11348108 BLAKE2B ea1019a81f96169ab8d435215362b36b098df373ac4f53ecda328686ec2c13204a38c66bb1bf9504d18e1762e7e6ae277bab3b16bb53b8e628962df715769f3b SHA512 31bacf58469953282cd5d8b51862dcf4b84dedb927c1871bc3fca32fc157fe49187631575a70838705fe246f4555647577a7ecc26894445a7d64de5503dc11b4
DIST ruby-2.5.3.tar.xz 11453336 BLAKE2B 66c59448a23c22796b43f04a1f84359386b7bee7163da4255426ea75b1c7af0a7a7142991b870a75a72ded56ac49f47c51bc162ebf2be2af0d1b1608b60c02df SHA512 6dcae0e8d0bacdb2cbde636e2030596308b5af53f2eb85d3adccb67b02e6f8f9751e8117d12f8484829fdd9d995f6e327f701d9b433bcf94f1f59d13a1fd7518
DIST ruby-mode-2.6.0.tar.gz 28460 BLAKE2B 15ab0115cc669f31d656a6af03c061699cfd872130ed51240ecbf80fae413b1d2d8ed87ea1515584f276d15ee164a3c14f9138bf5054418419f6c09b2a72e8e4 SHA512 bbeaa3ae788ea3a536715dc8dc0b4c82803d0a21ce44ae048a5a1c1e331f8c571980feaf38f42455e2de099210bbd4d6f3e8dc2984d6318a70fe04aa6c0d9520

@ -0,0 +1,18 @@
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
inherit elisp
DESCRIPTION="Emacs major mode for editing Ruby code"
HOMEPAGE="https://www.ruby-lang.org/"
SRC_URI="mirror://ruby/ruby-${PV}.tar.xz"
LICENSE="GPL-3+"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
S="${WORKDIR}/ruby-${PV}/misc"
DOCS="README"
SITEFILE="50${PN}-gentoo-2.5.0.el"

@ -0,0 +1,20 @@
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit elisp
COMMIT=75bccbb384e6907df47ab69acdccb4536806c890
DESCRIPTION="Emacs major mode for editing Ruby code"
HOMEPAGE="https://www.ruby-lang.org/"
SRC_URI="https://github.com/ruby/elisp/archive/${COMMIT}.tar.gz -> ${P}.tar.gz"
LICENSE="GPL-3+"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
S="${WORKDIR}/elisp-${COMMIT}"
DOCS="README"
SITEFILE="50${PN}-gentoo-2.5.0.el"

Binary file not shown.

@ -1,4 +1,4 @@
# Copyright 1999-2018 Gentoo Foundation
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
@ -8,7 +8,7 @@ HOMEPAGE="https://www.gentoo.org/"
SRC_URI="https://dev.gentoo.org/~titanofold/${P}.tbz2"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="alpha amd64 arm ~arm64 ~hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris"
KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris"
RDEPEND="app-admin/eselect"

@ -8,7 +8,7 @@ HOMEPAGE="https://www.gentoo.org/"
SRC_URI="https://dev.gentoo.org/~titanofold/${P}.tbz2"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ia64 ~mips ppc ppc64 s390 ~sh ~sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
KEYWORDS="~alpha amd64 ~arm ~arm64 hppa ia64 ~mips ppc ppc64 s390 ~sh ~sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
RDEPEND="app-admin/eselect"

Binary file not shown.

@ -0,0 +1,13 @@
DIST github-exporter-04.tar.gz 7023 BLAKE2B a2502fab29f7d987e7fe02a739d9d3bcc34376315581830033dc99d9c16be0bca52a30b8f491682de34ded4732c9216a05e8bfc1d2ac6510a22bd752a50bb5b9 SHA512 4837d78d058e8adb110ced899a9d136eed86aa3facf7258a6d7b392a3a61aa827662e63f8bd64b0ca44e6ed78518a6ae669068018ffc18d3bb42d19f4fb364be
DIST github.com-beorn7-perks-3a771d9.tar.gz 10800 BLAKE2B 5487155a4d010af70b6ea2625d10ae03b6642507902d7dc168edb5d7cf0efa1777b248d0df34ed1a2564950b12613256c1c6ce1d8c9723cc34977ed883b21c8d SHA512 c6aa5df262ab607c0a5f64372fc2fec1ddda9e5624e9d9a22cdd1bc11822c99736d88bdf5e3fc6050217b5084548417cb2926c3940e156da9397d828d59ce277
DIST github.com-fatih-structs-878a968.tar.gz 14629 BLAKE2B 673a25a39cab677bd275ccaf14675a1fa7847d1a089ceaa20cc981ca01a1cbba597e94467e7accdd1a4319acd44c5d7bd0f6e2de0eebd7fe2f43cc6cc9a94271 SHA512 3c00f10e17e6dd818422a6b8e1ef5454b3dd9cc78da22c56ec3c474bd7a590bb3dd56e803c01882b52ce12a6a4deda7935bbb786c3cebc2e60b379337a884752
DIST github.com-golang-crypto-ff983b9.tar.gz 1645106 BLAKE2B 3d7271479ef812761a02c1d20429800cd29706e802a8ccf57e916bdb8befc87a9b1b1a88d42adb764a32fa5f4c5f5a5e434af63812a5bcd3de625658792a49a3 SHA512 19746e84901c0749da544ba02c74c8ccabfee5f186a0d00509e54f20c191da9ea56844de988265f072af1fae671d78d741a44f782b8c1704c9da0441436c2122
DIST github.com-golang-protobuf-347cf4a.tar.gz 329489 BLAKE2B 828678cee603917e7f4efee2dd0902730a73932b94b12d4f4b35f0fcecaa329cdc39c3fa9926ce3706f86cc52c0aa4984f68ee0943ecc6d9571b0175ff671ab0 SHA512 de4307b91923a6890ab2f8eaf2ed4f7f32a45a4a0cc7b0d6f53ce31c5fe3ed08f378072075456d2c99c89a3b5acbca315814b8e5ec70e6ceb0ca62f7013f618c
DIST github.com-golang-sys-48ac38b.tar.gz 1219195 BLAKE2B b632d935ed84ace8ddad5308556ddcfcca7b572fd1f65d8b5c39e9ba2b884c79f5c150cc3efa920654661b0958d894fa23445701dcd1d35f0f49ff4dda3bccd4 SHA512 8cea014c67df943dd68bb8787719acc0925f967f2cef552ae52c595ca4eda38adeab6c92b868822e08601cca20a61f16b78426d8b9252932168ffbd0f2403859
DIST github.com-infinityworks-go-common-7f20a14.tar.gz 4072 BLAKE2B 79a788813840c8361e80ff882fff680ed83d3fe8485c09856290f0fa183438770210be600a3d6ae0d62e1a1027a43a6eef184d5a4b5f38fec9c15d54f16d384e SHA512 a8bc3d11eead090807bd7b64a71d7b078836e807b2a18ebb8e1b1ef286e920e993d3fe734eeafeccd80c8644b4c466a73b1cf479a4932c84e0e5fc328e50fdd2
DIST github.com-matttproud-golang_protobuf_extensions-c182aff.tar.gz 37541 BLAKE2B f78899afa1390aca6cb1b412271713c60107771d512ead83482e0bb1716d175b791b4b04bd24b7f469cc1a29176eadcf0545ac3bf166c5b350602420d3c05aec SHA512 141b1b781a4d1c59f5eb1af93c966343b80ed405a5f63774e6cda9f12c34536e892c7a84699d6cf2e9c775457a4c2ad5d5d0b4d302fc25a923ab81d46ad65580
DIST github.com-prometheus-client_golang-d2ead25.tar.gz 131949 BLAKE2B 352e0ef2bd704f6c490e57520d415e89d950241c39f3cdf851524d4cca87c25c31bf2ffb77914981cb730cb474033f4551b50c5b6085e5e273c2d29aaab1f012 SHA512 ca89d613e8bc6cff928d9ce8d3d563c8277cb31756c66d8c0e6f6b6ce00c1405d10e465245ac63fd6889aeafae0d6914814384e94e127929fbcfd606a59e42a5
DIST github.com-prometheus-client_model-f287a10.tar.gz 57203 BLAKE2B 2d56b90ced967f5f7a2c59bb330aaf8c56cf522091ee413ff27c22cb9e7d656080bd7d4dd2372938a873617054c7c98925e10fdc7996b136eaa4fd1b6482b734 SHA512 b4f900e725a638a7131eee1c6ff5bf550025b4d9e5bb2dd09149e91ce02a7aba458039c2162b6a1f9a6b6c7c8fc0fc29510b6c752caad51282a960d18860f960
DIST github.com-prometheus-common-2998b13.tar.gz 87368 BLAKE2B fc6c6e197d4cc61afefa9fb8e3a8d6b36ab029f62e3cf9adf8359e4885554f94427f17218d45c90c9d7f4a6985b2e4143a4d304d39f806bd70d2c6f05de29bc2 SHA512 b2095da96596fc500ece6b331cda2558f8c813720853f2489aee3dec65de95eb13f7b0853e3812433fdc040f16990d2f05b2a6b8b41275210c504ff333ca625d
DIST github.com-prometheus-procfs-b1a0a9a.tar.gz 61720 BLAKE2B 2f9b25506527aaf6e1bf560a1b680b958d1281acbaa2bb896bfea50b5b7de8992d10e8e812f8ae449ab67145c88179c15afe1f719851d1717b28963071088082 SHA512 5938b4a8fa9a5ee32be995fed0d0e6b26941765470aca4eda63a7c42db457e83da43fde2f33b2d4ded3545e5643f607ec7060406b0a1b15e64cc732bb2badd4a
DIST github.com-sirupsen-logrus-eef6b76.tar.gz 38613 BLAKE2B 32ff02d46dcdf08b273c406323236b0750433bda16a5072e4161b166863f5a062817166dc871e15fb169bfdb95ff45f167bc30b2e259294e0a51111b8a78afd3 SHA512 e7ca358b72bebbf663af426a110cd8da22bf33e2ec14fb7337af75a1cdd4aecb371436b8cc83f04a52a52ced56c02a762b12c2fe5ae5e64d7aee261a7254b14e

@ -0,0 +1,14 @@
# settings for github-exporter
# I will list the required variables here, but there are several more.
# Please see the README for all of them.
# LISTEN_PORT specifies the port the exporter will use. Below is the default.
# LISTEN_PORT=9171
# ORGS should contain a list of github organizations you wish to monitor.
# ORGS="org1,org2"
# REPOS should contain a list of github repos you want tomonitor.
# If neither ORGS nor REPOS is set, the exporter will refuse to run.
# REPOS="user1/repo1,user2/repo2"

@ -0,0 +1,53 @@
#!/sbin/openrc-run
description="github exporter for Prometheus"
command=/usr/bin/github-exporter
command_background=yes
command_user=${RC_SVCNAME}:${RC_SVCNAME}
pidfile=/var/run/github-exporter.pid
error_log="/var/log/${RC_SVCNAME}/${RC_SVCNAME}.log"
output_log="/var/log/${RC_SVCNAME}/${RC_SVCNAME}.log"
depend() {
after net
}
start_pre() {
local env_args
if [ -z "${ORGS}" ] && [ -z "${REPOS}" ]; then
eerror "ORGS and / or REPOS must be set."
return 1
fi
if [ -n "${GITHUB_TOKEN}" ] && [ -n "${GITHUB_TOKEN_FILE}" ]; then
eerror "Please set only one of GITHUB_TOKEN or GITHUB_TOKEN_FILE"
return 1
fi
if [ -n "${API_URL}" ]; then
env_args="${env_args} -e API_URL=${API_URL}"
fi
if [ -n "${GITHUB_TOKEN}" ]; then
env_args="${env_args} -e GITHUB_TOKEN=${GITHUB_TOKEN}"
elif [ -n "${GITHUB_TOKEN_FILE}" ]; then
env_args="${env_args} -e GITHUB_TOKEN_FILE=${GITHUB_TOKEN_FILE}"
fi
if [ -z "${LISTEN_PORT}" ]; then
env_args="${env_args} -e LISTEN_PORT=9171"
else
env_args="${env_args} -e LISTEN_PORT=${LISTEN_PORT}"
fi
if [ -n "${LOG_LEVEL}" ]; then
env_args="${env_args} -e LOG_LEVEL=${LOG_LEVEL}"
fi
if [ -n "${METRICS_PATH}" ]; then
env_args="${env_args} -e METRICS_PATH=${METRICS_PATH}"
fi
if [ -n "${ORGS}" ]; then
env_args="${env_args} -e ORGS=${ORGS}"
fi
if [ -n "${REPOS}" ]; then
env_args="${env_args} -e REPOS=${REPOS}"
fi
start_stop_daemon_args="${start_stop_daemon_args} ${env_args}"
supervise_daemon_args="${supervise_daemon_args} ${env_args}"
return 0
}

@ -0,0 +1,75 @@
# Copyright 2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
EGO_PN=github.com/infinityworks/github-exporter
EGO_VENDOR=(
"github.com/beorn7/perks 3a771d9"
"github.com/fatih/structs 878a968"
"github.com/golang/protobuf 347cf4a"
"github.com/infinityworks/go-common 7f20a14"
"github.com/matttproud/golang_protobuf_extensions c182aff"
"github.com/prometheus/client_golang d2ead25"
"github.com/prometheus/client_model f287a10"
"github.com/prometheus/common 2998b13"
"github.com/prometheus/procfs b1a0a9a"
"github.com/sirupsen/logrus eef6b76"
"golang.org/x/crypto ff983b9 github.com/golang/crypto"
"golang.org/x/sys 48ac38b github.com/golang/sys"
)
inherit golang-build golang-vcs-snapshot systemd
DESCRIPTION="Github statistics exporter for prometheus"
HOMEPAGE="https://github.com/infinityworks/github-exporter"
SRC_URI="https://${EGO_PN}/archive/${PV}.tar.gz -> ${P}.tar.gz
${EGO_VENDOR_URI}"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64"
RESTRICT="strip"
pkg_setup() {
enewgroup ${PN}
enewuser ${PN} -1 -1 -1 ${PN}
}
src_prepare() {
default
sed -i -e 's/infinityworksltd/infinityworks/' \
"src/${EGO_PN}/main.go" \
"src/${EGO_PN}/config/config.go" \
"src/${EGO_PN}/exporter/structs.go" \
|| die "sed failed"
sed -i -e 's/Sirupsen/sirupsen/' \
"src/${EGO_PN}/main.go" \
"src/${EGO_PN}/config/config.go" \
"src/${EGO_PN}/exporter/gather.go" \
"src/${EGO_PN}/exporter/http.go" \
"src/${EGO_PN}/exporter/prometheus.go" \
|| die "sed failed"
}
src_compile() {
set -- env GOPATH="${S}" go build -v "${EGO_PN}"
echo "$@"
"$@" || die "build failed"
}
src_install() {
dobin ${PN}
cd "src/${EGO_PN}" || die
dodoc *.md
newconfd "${FILESDIR}"/${PN}.confd ${PN}
newinitd "${FILESDIR}"/${PN}.initd ${PN}
}
pkg_postinst() {
if [[ -z "${REPLACING_VERSIONS}" ]]; then
elog "Before you can use ${PN}, you must configure it in"
elog "${EROOT}/etc/conf.d/${PN}"
fi
}

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>williamh@gentoo.org</email>
<name>William Hubbs</name>
</maintainer>
</pkgmetadata>

@ -0,0 +1 @@
DIST vault_exporter-0.1.2.tar.gz 34555506 BLAKE2B 53178f8a16fceca442e38a756081cca438abdd786960de3dae073f3ce5f2ac2c5d06684ec56e48a2057b4a2161a25527b41c36d3705a054f0bae37357f33faee SHA512 71941c17d7146861a09ed48289efe15143d3fba18e56accdfdf977bf4443bb650e7201a4870b63793d372dcca8f53a04131c12803f019efbdcac9e0ca8909cbd

@ -0,0 +1,2 @@
# arguments for prometheus vault exporter
command_args=""

@ -0,0 +1,19 @@
#!/sbin/openrc-run
# Copyright 2016-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
description="Prometheus Vault exporter"
pidfile=${pidfile:-"/run/${RC_SVCNAME}.pid"}
user=${user:-${RC_SVCNAME}}
group=${group:-${RC_SVCNAME}}
command="/usr/bin/vault_exporter"
command_args="${command_args}"
command_background="true"
start_stop_daemon_args="--user ${user} --group ${group} \
--stdout /var/log/vault_exporter/${RC_SVCNAME}.log \
--stderr /var/log/vault_exporter/${RC_SVCNAME}.log"
depend() {
after net
}

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>mrueg@gentoo.org</email>
<name>Manuel Rüger</name>
</maintainer>
<upstream>
<remote-id type="github">grapeshot/vault_exporter</remote-id>
</upstream>
</pkgmetadata>

@ -0,0 +1,40 @@
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
inherit user golang-build golang-vcs-snapshot
MY_PV=${PV/_/}
EGO_PN="github.com/grapeshot/vault_exporter"
ARCHIVE_URI="https://${EGO_PN}/archive/v${MY_PV}.tar.gz -> ${P}.tar.gz"
KEYWORDS="~amd64"
DESCRIPTION="Vault exporter for Prometheus"
HOMEPAGE="https://github.com/grapeshot/vault_exporter"
SRC_URI="${ARCHIVE_URI}"
LICENSE="Apache-2.0"
SLOT="0"
IUSE=""
pkg_setup() {
enewgroup ${PN}
enewuser ${PN} -1 -1 -1 ${PN}
}
src_compile() {
pushd src/${EGO_PN} || die
GOPATH="${S}" emake build || die
popd || die
}
src_install() {
pushd src/${EGO_PN} || die
newbin _output/bin/vault_exporter-v${PV}* vault_exporter
dodoc README.md
popd || die
keepdir /var/log/vault_exporter
fowners ${PN}:${PN} /var/log/vault_exporter
newinitd "${FILESDIR}"/${PN}.initd ${PN}
newconfd "${FILESDIR}"/${PN}.confd ${PN}
}

Binary file not shown.

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

Binary file not shown.

@ -1 +1,2 @@
DIST bibutils_4.12_src.tgz 447566 BLAKE2B 64d185963028f29f4efb64c63ee6ddb59961744d525d4dbaf28bdd1edb28ac8ea86529082995d11245c258895f27457c9d01594564a44caa837b0ba76052b969 SHA512 04329ecb685bf4d5314c6d3a2d5bb21e67112d73bcb49f5a7808a4082f32a9aecb40add4ec4b5320be35f49cd8e101dc1e35409e7c6cad8c39238d2122f91dd0
DIST bibutils_6.7_src.tgz 580792 BLAKE2B 29c5863bc414ef7b2f362d95352c0e042c1bcc3275017df82b0206d96520b3f5c3fe1e12563577b84a8bd94b0677bf1ad04ecbd80dcbcc194a71037bbd6facba SHA512 08db07408eee26bce42dbd00b7e821ef41dc12c7ce847425e81145927bcfc6ea7180ff719056e089917811aa9675a09dd52e1e02b8187b8618f67647efcb1236

@ -0,0 +1,47 @@
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit toolchain-funcs
MY_P="${PN}_${PV}"
DESCRIPTION="Interconverts between various bibliography formats using common XML intermediate"
HOMEPAGE="https://sourceforge.net/p/bibutils/home/Bibutils/"
SRC_URI="mirror://sourceforge/${PN}/${MY_P}_src.tgz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~ppc ~x86"
IUSE=""
S=${WORKDIR}/${MY_P}
src_configure() {
# The custom configure script still sucks several releases later, so we'll
# just do its job ourselves
rm -f Makefile configure || die "Failed to purge old Makefile"
sed \
-e "s:REPLACE_CC:$(tc-getCC):g" \
-e "s:REPLACE_EXEEXT::g" \
-e "s:REPLACE_LIBTARGET:libbibutils.so:g" \
-e "s:REPLACE_LIBEXT:.so:g" \
-e "s:REPLACE_CFLAGS:${CFLAGS}:g" \
-e "s:REPLACE_CLIBFLAGS:${CFLAGS} -fPIC:g" \
-e "s:REPLACE_RANLIB:$(tc-getRANLIB):g" \
-e 's:REPLACE_POSTFIX::g' \
-e "s:REPLACE_INSTALLDIR:\"${D}/usr/bin\":g" \
-e "s:REPLACE_LIBINSTALLDIR:\"${D}/usr/$(get_libdir)\":g" \
-e 's:make:$(MAKE):g' \
Makefile_start > Makefile \
|| die "Failed to set up Makefile"
cp lib/Makefile.dynamic lib/Makefile || die
cp bin/Makefile.dynamic bin/Makefile || die
cp test/Makefile.dynamic test/Makefile || die
}
src_install() {
dodir /usr/bin
emake install
dodoc ChangeLog
}

@ -10,7 +10,7 @@ SRC_URI="https://releases.pagure.org/${PN}/${P}.tar.bz2"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~m68k ~mips ppc ppc64 s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~m68k ~mips ppc ppc64 s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
IUSE="latex text"
RDEPEND=">=app-text/docbook-xsl-stylesheets-1.62.0-r1

Binary file not shown.

@ -11,6 +11,7 @@
<flag name="gentoo-vm">Allow this JDK to be recognised by Gentoo (package manager, eselect, java-config, EXPERIMENTAL!)</flag>
<flag name="jbootstrap">Build OpenJDK twice, the second time using the result of the first</flag>
<flag name="source">Install JVM sources</flag>
<flag name="systemtap">Enable SystemTAP/DTrace tracing</flag>
<flag name="webstart">Provide javaws command through symlink to icedtea-web</flag>
</use>
</pkgmetadata>

@ -1,4 +1,4 @@
# Copyright 1999-2018 Gentoo Authors
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
@ -33,12 +33,13 @@ REQUIRED_USE="
jvm_variant_zero? ( !jvm_variant_server !jvm_variant_client !jvm_variant_minimal )
"
IUSE="+${IUSE} alsa debug doc examples gentoo-vm headless-awt +jbootstrap nsplugin +pch selinux source +webstart"
IUSE="+${IUSE} alsa debug doc examples gentoo-vm headless-awt +jbootstrap nsplugin +pch selinux source systemtap +webstart"
CDEPEND="
media-libs/freetype:2=
net-print/cups
sys-libs/zlib
systemtap? ( dev-util/systemtap )
!headless-awt? (
x11-libs/libX11
x11-libs/libXext
@ -170,6 +171,7 @@ src_configure() {
--with-version-pre=gentoo \
--with-version-string=${MY_PV%+*} \
--with-version-build=${MY_PV#*+} \
--enable-dtrace=$(usex systemtap yes no) \
--enable-headless-only=$(usex headless-awt yes no) \
--enable-full-docs=no \
--disable-ccache \

@ -1,4 +1 @@
DIST tomcat-native-1.2.16-src.tar.gz 405109 BLAKE2B e153caeb82c4ac4d2a8c7c24373204edf6e691068e70c858618caf72faaee1f4d10c4529ba758e24422e8580e8b3e95d28cc942998568106ec60b8de7c196c51 SHA512 0345f85fbab406f25c25c8fc06bf55f3d166fa14bfcf542bddb5dc5db4c8c7bd0c5b71603d85261d71152ead3023b112144f2ffa5ede14ae8595013f79c802aa
DIST tomcat-native-1.2.17-src.tar.gz 408967 BLAKE2B 482b0416be01bcbe9ba55555715de37c6071502ed57f179115c3d351684621487b90e05dd488b1c2137e4813a785c1fe229241f191468bc88f7f0dd3a31562c0 SHA512 8fa946855fd14525ec0abe7b09975bbd34d6127352e90730a8afb77e16cd91715417e812a40017fee65939a9ce95faf39a9193222f441cda0ad2eb7f690e77b9
DIST tomcat-native-1.2.18-src.tar.gz 411789 BLAKE2B 16f1ecff3abfa6bf1f88c44af4a6ba58addac69bec1c257325c429fe6eec6a522fd2ae7932d68afa9bb442b0cf248731ce3e1a9db2b383f502093bf0ea5bfd23 SHA512 66481c1f36dc7ea909bf8d55075a232bf6dea3300b56d36415b13da4aefbee16cb52456f3d44b4a2b09b43cd8c7df628145a0623b9cdfa322bc2432e6c44827f
DIST tomcat-native-1.2.19-src.tar.gz 418183 BLAKE2B cab8621bca4dc41e87ebf6418337da8a86d56a0717aacd62c6e4fb2d039e413cb29e8f169abbd353719ce083d302613d3e0f64cd54f1bc8e57f26a523a828025 SHA512 7d69acd5dd684eee9a85c08357b7288a9f083c15a12a9524ba6344f1b9dcdc6ccc512a37b64b9f15b0e697609833e6c68591a60976dcfecce124ec29eb532dba

@ -1,59 +0,0 @@
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="5"
inherit eutils java-pkg-2 java-ant-2
DESCRIPTION="Native APR library for Tomcat"
SLOT="0"
SRC_URI="mirror://apache/tomcat/tomcat-connectors/native/${PV}/source/${P}-src.tar.gz"
HOMEPAGE="https://tomcat.apache.org/"
KEYWORDS="amd64 ~x86"
LICENSE="Apache-2.0"
IUSE="static-libs test"
RDEPEND="dev-libs/apr:1
dev-libs/openssl:0=
>=virtual/jre-1.7"
DEPEND=">=virtual/jdk-1.7
test? ( dev-java/ant-junit:0 )"
S=${WORKDIR}/${P}-src
src_configure(){
cd native || die
econf --with-apr=/usr/bin/apr-1-config \
--with-ssl=/usr || die "Could not configure native sources"
}
src_compile() {
eant jar -f build.xml
cd native || die
default
}
src_install() {
java-pkg_newjar "dist/${P}.jar" "${PN}.jar"
cd native
emake DESTDIR="${D}" install || die "Could not install libtcnative-1.so"
! use static-libs && prune_libtool_files --modules
}
src_test() {
java-pkg-2_src_test
}
pkg_postinst() {
elog
elog " APR should be available with Tomcat, for more information"
elog " please see https://tomcat.apache.org/tomcat-6.0-doc/apr.html"
elog
elog " Please report any bugs to https://bugs.gentoo.org/"
elog
}

@ -1,61 +0,0 @@
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=6
inherit java-pkg-2 java-ant-2
DESCRIPTION="Allows Tomcat to use certain native resources for better performance"
HOMEPAGE="https://tomcat.apache.org/"
SRC_URI="mirror://apache/tomcat/tomcat-connectors/native/${PV}/source/${P}-src.tar.gz"
KEYWORDS="~amd64 ~x86"
LICENSE="Apache-2.0"
SLOT="0"
IUSE="static-libs test"
RDEPEND="dev-libs/apr:1=
dev-libs/openssl:0=
>=virtual/jre-1.8"
DEPEND=">=virtual/jdk-1.8
test? ( dev-java/ant-junit:0 )"
S=${WORKDIR}/${P}-src
JAVA_ANT_REWRITE_CLASSPATH="yes"
src_configure() {
local myeconfargs=(
--with-apr="${EPREFIX}"/usr/bin/apr-1-config
--with-ssl="${EPREFIX}"/usr
)
cd native || die
econf "${myeconfargs[@]}"
}
src_compile() {
eant jar
cd native || die
default
}
src_install() {
java-pkg_newjar "dist/${P}.jar" "${PN}.jar"
cd native || die
default
! use static-libs && find "${D}" -name '*.la' -delete || die
}
src_test() {
java-pkg-2_src_test
}
pkg_postinst() {
elog "For more information, please visit"
elog "https://tomcat.apache.org/tomcat-9.0-doc/apr.html"
}

@ -1,61 +0,0 @@
# Copyright 1999-2018 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
inherit java-pkg-2 java-ant-2
DESCRIPTION="Allows Tomcat to use certain native resources for better performance"
HOMEPAGE="https://tomcat.apache.org/"
SRC_URI="mirror://apache/tomcat/tomcat-connectors/native/${PV}/source/${P}-src.tar.gz"
KEYWORDS="~amd64 ~x86"
LICENSE="Apache-2.0"
SLOT="0"
IUSE="static-libs test"
RDEPEND="dev-libs/apr:1=
dev-libs/openssl:0=
>=virtual/jre-1.8"
DEPEND=">=virtual/jdk-1.8
test? ( dev-java/ant-junit:0 )"
S=${WORKDIR}/${P}-src
JAVA_ANT_REWRITE_CLASSPATH="yes"
src_configure() {
local myeconfargs=(
--with-apr="${EPREFIX}"/usr/bin/apr-1-config
--with-ssl="${EPREFIX}"/usr
)
cd native || die
econf "${myeconfargs[@]}"
}
src_compile() {
eant jar
cd native || die
default
}
src_install() {
java-pkg_newjar "dist/${P}.jar" "${PN}.jar"
cd native || die
default
! use static-libs && find "${D}" -name '*.la' -delete || die
}
src_test() {
java-pkg-2_src_test
}
pkg_postinst() {
elog "For more information, please visit"
elog "https://tomcat.apache.org/tomcat-9.0-doc/apr.html"
}

@ -1,4 +1,4 @@
# Copyright 1999-2018 Gentoo Authors
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
@ -9,7 +9,7 @@ DESCRIPTION="Allows Tomcat to use certain native resources for better performanc
HOMEPAGE="https://tomcat.apache.org/"
SRC_URI="mirror://apache/tomcat/tomcat-connectors/native/${PV}/source/${P}-src.tar.gz"
KEYWORDS="~amd64 ~x86"
KEYWORDS="amd64 ~x86"
LICENSE="Apache-2.0"
SLOT="0"
IUSE="static-libs test"

@ -2,17 +2,16 @@ DIST apache-tomcat-4.1.36-src.tar.gz 3715200 BLAKE2B 0af7c15e821c7b437c4a12c07aa
DIST apache-tomcat-5.5.27-src.tar.gz 7382057 BLAKE2B 289c586c9664efb63f921bffab80a180639ff4c14cc1f676cb7aff27c9416a20e142bc56862c0a06b26d30bc5a7415b07c0b7c3263286af860b27ee940f745b4 SHA512 32c605aad92b7d554b9e0f28a4d3e707b3cbfc0661a969eb2479512517f8e9e8848b820132d711c41f5c0fa863028b38e1fa903e7c0205599e9e58a86ab4733a
DIST apache-tomcat-5.5.34-src.tar.gz 3720299 BLAKE2B 9ec9171f7fb5aa43a3d7df0d3e06932b214d9740c56e95468f45d2f4ea0e157f9bd33dcc715ace9f950761b1fbfd7a5cbf9fec47f98feb1088641a24de4a8f4a SHA512 4c8616f839a3c413ffef45b7b6876f123cbda37f4029db96ac1c8f259a75f0d65cdb5709468d89e731e5436b011dac4ee3e9dc397adfc9ad4d0b1bc462c8e519
DIST apache-tomcat-6.0.44-src.tar.gz 3447711 BLAKE2B 7baf1fc24a7c9aba7e2ddac63fe0c0975178616bfad8cd625d2910d18ad9b00cd85c98ba4a1ada251119629b96ff464ac623857f6928e3b9465708cdf5bc7513 SHA512 0d6a1539b28fa8ca3442557889d7d21cc523b18136f6998820ba13f41420536aba65ce78bac526002ee1dd86df3cbc80d9f043a3f765d7cf0b79e58e516030be
DIST apache-tomcat-6.0.45-src.tar.gz 3494054 BLAKE2B 5dc7ac1c941b3b307ff6ccc53b59ddcd141c5ece00424a89025272d170e00ed14462f9805be0e26750f60ff1eb223e2829e7d215502f526e800bf2ffffaee30a SHA512 d300e6b805bb70fc348133467b2aeac728dc0ae44f2fc1f309c3b2971987c1e46b81f156ebd7ddfda38f6746e90af1402c4e16a2d30bc7b081b761c87df8ffab
DIST apache-tomcat-6.0.53-src.tar.gz 3522914 BLAKE2B 054b097c16861abaa8bdbeba713b49bc1dfcff573bb3f4bd0ff5807c33a2a0fb991af618f6e11e5b3ce3fa55c589fc6569342cab5d5a00349c79bc7061d81e40 SHA512 915a0a18f5c2883625c9441eed6465973eff4f6bf41e08e925c7edaea89ef8f6ee9476d3e06fa38228d4bcb4decaf53e3a7bdb7ec7e899e6250db3e12a9f5f2c
DIST apache-tomcat-7.0.82-src.tar.gz 4697342 BLAKE2B 1106ed04dc83e64e395de29f01a7752a0578b0c88046eb59614a7cfc0d8a98e3aebb698c8eb56763eea41620d9b42482971c5093304184b1028c6bd8f9770ada SHA512 fc92388d81316de0246df4074c417ffa341eab55308c0694e9ea71c5497c863b42019cd1f38628ff640114c501a06c4e9c428cb2b6f1bc1c16fb337a286718db
DIST apache-tomcat-7.0.85-src.tar.gz 4718223 BLAKE2B 3067709eb143feee5cc1f31cdd8d41c58fb96ed1330560a4064ac3b3eeb030c76ff066c2a2f950d6f2c1576bde214f963f1a12342536a8e2ab8ac179dd166bfb SHA512 f95383b2c77670845cce577161ecf326c3e0f49d456792a53305640289d049b0de80f4b6901bcda52bc4967895f97772591eee525affee1a1d07aac2e60d2044
DIST apache-tomcat-7.0.88-src.tar.gz 4733229 BLAKE2B 2e2009f64ae8f027e93bd7f3cec21f98fbb1f5c741b6525da1638c6188ebe44aa8b43d984abd769385992a997226392c59ec059e408873261a04d9e96a4603c3 SHA512 2ad5c11ec7c5e8e68fba6c0427b0479969a56e7ccb3f0b1ee6c6f139d5f2b718ee9c56f044e982013108ee6e06c43037d0061e539203e95453e9cae7cb38711d
DIST apache-tomcat-7.0.90-src.tar.gz 4752747 BLAKE2B 5062ead2756aa8461de5e8387f14838661c082b6e397934fc92c91403f1950d84d79f05b9d4420a973d1b4921515b66c2c847550e1a06d75e722b62d9aa3f8bd SHA512 b32cb6902866ef72337c721d99d77f1a645311bb7694f51b82f7acec500c6197df15fb41be444fc6089652e8c825fb193f1a9de8c1b9b6fabd9d95f784565f6a
DIST apache-tomcat-8.0.50-src.tar.gz 5023017 BLAKE2B 862799b7f6a227217c93e1b65aacc49a765b6d11886d0f2278a860c3f4e2b89692cfb724e323d3afe074ad3af3ef8cfd780e4be1ad2f55fee381e5054fbb1941 SHA512 c46efe03cfaadbc2b89063c05c5ec9f315a4eeacdfbf6dd43691c3d23a87d75b23b6679550518d825f8ec7ed853a899ca88cc54c61da9983b025ec7042c3bfff
DIST apache-tomcat-7.0.92-src.tar.gz 4778943 BLAKE2B d11b01219a25c303ce791d965908c79cd48b5c97e1f0bed81ae60e0fcae3c4b23906f652eaf1d2922db7a57e68ee9f5a09ef017b7f1b89ed6c2ab81a477a810e SHA512 8cbcaf6d8dcda5ad8bd667582a39e91c1feaa4cc7216cafc23b9f5cf005cce9af24473c1c9d573f4da26c88ea68520a113dc0a7e2a50823f3ba3bb1510ec9e0a
DIST apache-tomcat-8.0.52-src.tar.gz 5039683 BLAKE2B 36318d0ae50fbca3f2a97e0210d0a8da8314f1ef79d0b047971bca30a5b0cc937faf013b5090f6e6b8aec4127b6185dc54ae589f5b57143b62c71c09f8bd5e9d SHA512 6d846213db0b15f9add8d80f30f304afdaf879ab6d7f85d212183a93f4f360ebfeeb079813bdea83cbd13f507504473028bbf8279e89b800b6f150b83086fa56
DIST apache-tomcat-8.0.53-src.tar.gz 5057041 BLAKE2B 3a50d2f61baecb5244909972384e36478c69e7592dd35119d8b7b974273c57a4855082f309146ed160144dbdcced3236fd586b047970bd8558bbe7b7e002e9fd SHA512 0b56bc723277b2888896ab34ec3e49cb56bac94ddf1a9b96bd023982e2ffabd5317f63b3c0971afdc8cd7a6364197409df461d22151dbaab3a2be7daf6858b9e
DIST apache-tomcat-8.5.23-src.tar.gz 5086043 BLAKE2B 9bcad0d465aff6da1ba4a846042491bc8d5963283ed1d2530a26ab48289d14e8b85834d24ca476c95a75c1a5f51ee3ecd71c190b9609983cce56b56bc046b6d3 SHA512 2848331553f2c1bc51a4113960c6fe7e2beddf9146341dbfde1a27e2232802cfc364c8e8b988ae862371ca1a3be34665a56a28be9eadf80f8b317e0e2525cbef
DIST apache-tomcat-8.5.30-src.tar.gz 5143270 BLAKE2B 3bdcff663ca509efc3b2ee92ce140a3a22abf7fc0e32b5fa9a0ee713bdc1065ebde0b77cf624cedc2e0893194518d10e1f5df5b2f41edf76cb61157ac4d02862 SHA512 53729cfd1859872109f816df2642e3cd776a7faf8c55b1d50df0459f12958aacbf36debe6e8f10c19ab0a5bb2973fa63a2fec57f83ecaf19f4cf9d82e4a20265
DIST apache-tomcat-8.5.31-src.tar.gz 5154531 BLAKE2B cce0388e5c8c5fb5fcb3dba3b5961dc21d9f19d9a2f6177660a41410bddf241f73dda1e52c3875e28cfa13041c85a458a92c9a23c509b645f042cfa472081fde SHA512 659137ef4809af329ae4dd6f5825a603c1408ef3e48153abe7480a722e7f4bebef68a64af9cbef4a4ad9a7e8da76494f825035bbadbb983a097525f476f32f33
DIST apache-tomcat-8.5.37-src.tar.gz 5233414 BLAKE2B 1848180c3e0a3f4559e5c232bea8bad6d05f09d9c4f2f9f903178012b7b8837d395a5ac73c8ac0504fbd3d1df3c2dc785022e1c97da4441cfdcf8b790170ff7c SHA512 29ddbf7bfef19441a8a043020b5f1149d12590dac8120012a2167b6892e3db7c644990e49ba14cc4b4c7339faed65f010a7b24d660db0fb8adde34f032099cec
DIST apache-tomcat-9.0.14-src.tar.gz 5472704 BLAKE2B ee533afd733dacbe4a20baadb4c5dc9fa7620d695c1c57b1662894945731f978508b45ef0d8169068c13ba862804868f12d3e494873643589b9f57bc9ec0a342 SHA512 46119f6ae9003b7a178dd5158c1eae3b5116461e73c5d78cd763bff82b80f282ff08cee5175cf850d3f209af900677e93bab31c556035a6eaf6aae86a5d42fc6
DIST apache-tomcat-9.0.7-src.tar.gz 5106551 BLAKE2B b4552146a40c2e7cbb2e454fb5ec9169425db5c08cf269c391ec3144425ad388a2b6f003a7c05f59a9fd724fb5c848102890a24fcfd43d5fea3d881141aa7798 SHA512 cb7dc5547671d94f7c7fb0b58eeb94d05128349cdabf576fc8ad837a4bf3ea655a8eab3342245dfa84a9db23f1cbee2918846eedd48e3ca372eecebfef13c5b2
DIST apache-tomcat-9.0.8-src.tar.gz 5115250 BLAKE2B 8eaf0aa963711f90278d6d20986f4ba583c64e9e2b1f0b82ccc676a854a2078fe29c3b691d49af529074c9eea02ba78802cc9a4bb5cd7a3e561f6dfcb342c50b SHA512 22a3c9a2c9f2fa87b218ec5deb50248af201e83111bbeb7fcfbb7dde5aba3e2d61b53bc40500b3e364a9fb94b576ad8a4683979534274af0f3bcdfb86aa045e7
DIST jakarta-servletapi-src.tar.gz 65342 BLAKE2B 03674ca65e0cc509b04a6255d5dd20d26aa5053ed54588e9ba655330c56c9c523c5b382804aee9816cb9aa2ac19cccc1ad288ed06b2af85ba535854bc72bed73 SHA512 7dad5a52ab6bfca4b052d60a48fc89ce22a5eb790584671f24d8d22b163f2dffe93bea58caebc6b4ecb0bd8434a074c88f640aa57daa1cefbf47d74df758c084

@ -1,34 +0,0 @@
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI="5"
JAVA_PKG_IUSE="source"
inherit eutils java-pkg-2 java-ant-2
MY_A="apache-${P}-src"
MY_P="${MY_A/-servlet-api/}"
DESCRIPTION="Tomcat's Servlet API 2.5/JSP API 2.1 implementation"
HOMEPAGE="http://tomcat.apache.org/"
SRC_URI="mirror://apache/tomcat/tomcat-6/v${PV}/src/${MY_P}.tar.gz"
LICENSE="Apache-2.0"
SLOT="2.5"
KEYWORDS="~amd64 ~arm ~ppc64 ~x86 ~amd64-linux ~x86-linux ~x64-macos ~x64-solaris ~x86-solaris"
IUSE=""
DEPEND=">=virtual/jdk-1.6"
RDEPEND=">=virtual/jre-1.6"
S="${WORKDIR}/${MY_P}"
java_prepare() {
cp "${FILESDIR}/${SLOT}-build-r1.xml" build.xml || die "Could not replace build.xml"
rm -r */*/build.xml java/javax/{annotation,ejb,mail,persistence,xml}/ || die
find -name '*.jar' -delete || die
}
src_install() {
java-pkg_dojar "${S}"/output/build/lib/*.jar
use source && java-pkg_dosrc java/javax
}

@ -1,4 +1,4 @@
# Copyright 1999-2018 Gentoo Foundation
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="6"
@ -14,7 +14,7 @@ SRC_URI="mirror://apache/tomcat/tomcat-7/v${PV}/src/${MY_P}.tar.gz"
LICENSE="Apache-2.0"
SLOT="3.0"
KEYWORDS="~amd64 ~arm64 ~ppc64 ~x86 ~amd64-linux ~x86-linux ~x64-solaris ~x86-solaris"
KEYWORDS="amd64 ~arm64 ~ppc64 ~x86 ~amd64-linux ~x86-linux ~x64-solaris ~x86-solaris"
IUSE=""
DEPEND=">=virtual/jdk-1.6"

@ -1,4 +1,4 @@
# Copyright 1999-2018 Gentoo Foundation
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="6"

@ -1,4 +1,4 @@
# Copyright 1999-2018 Gentoo Foundation
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="5"
@ -14,7 +14,7 @@ SRC_URI="mirror://apache/tomcat/tomcat-8/v${PV}/src/${MY_P}.tar.gz"
LICENSE="Apache-2.0"
SLOT="3.1"
KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux ~x64-solaris ~x86-solaris"
KEYWORDS="amd64 ~x86 ~amd64-linux ~x86-linux ~x64-solaris ~x86-solaris"
IUSE=""
DEPEND=">=virtual/jdk-1.7"

@ -1,4 +1,4 @@
# Copyright 1999-2018 Gentoo Foundation
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="5"
@ -14,7 +14,7 @@ SRC_URI="mirror://apache/tomcat/tomcat-8/v${PV}/src/${MY_P}.tar.gz"
LICENSE="Apache-2.0"
SLOT="3.1"
KEYWORDS="amd64 ~x86 ~amd64-linux ~x86-linux ~x64-solaris ~x86-solaris"
KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux ~x64-solaris ~x86-solaris"
IUSE=""
DEPEND=">=virtual/jdk-1.7"

@ -1,4 +1,4 @@
# Copyright 1999-2018 Gentoo Foundation
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="6"
@ -14,7 +14,7 @@ SRC_URI="mirror://apache/tomcat/tomcat-8/v${PV}/src/${MY_P}.tar.gz"
LICENSE="Apache-2.0"
SLOT="3.1"
KEYWORDS="~amd64 ~arm64 ~ppc64 ~x86 ~amd64-linux ~x86-linux ~x64-solaris ~x86-solaris"
KEYWORDS="amd64 ~arm64 ~ppc64 ~x86 ~amd64-linux ~x86-linux ~x64-solaris ~x86-solaris"
IUSE=""
DEPEND=">=virtual/jdk-1.7"

@ -1,4 +1,4 @@
# Copyright 1999-2018 Gentoo Foundation
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="6"
@ -14,7 +14,7 @@ SRC_URI="mirror://apache/tomcat/tomcat-8/v${PV}/src/${MY_P}.tar.gz"
LICENSE="Apache-2.0"
SLOT="3.1"
KEYWORDS="amd64 ~arm64 ~ppc64 ~x86 ~amd64-linux ~x86-linux ~x64-solaris ~x86-solaris"
KEYWORDS="~amd64 ~arm64 ~ppc64 ~x86 ~amd64-linux ~x86-linux ~x64-solaris ~x86-solaris"
IUSE=""
DEPEND=">=virtual/jdk-1.7"

@ -1,4 +1,4 @@
# Copyright 1999-2018 Gentoo Foundation
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="6"
@ -6,19 +6,19 @@ JAVA_PKG_IUSE="source"
inherit eutils java-pkg-2 java-ant-2
MY_A="apache-${P}-src"
MY_A="apache-${PN}-${PV}-src"
MY_P="${MY_A/-servlet-api/}"
DESCRIPTION="Tomcat's Servlet API 3.0/JSP API 2.2 implementation"
DESCRIPTION="Tomcat's Servlet API 4.0/JSP API 2.4?/EL API 3.1? implementation"
HOMEPAGE="https://tomcat.apache.org/"
SRC_URI="mirror://apache/tomcat/tomcat-7/v${PV}/src/${MY_P}.tar.gz"
SRC_URI="mirror://apache/tomcat/tomcat-9/v${PV}/src/${MY_P}.tar.gz"
LICENSE="Apache-2.0"
SLOT="3.0"
KEYWORDS="amd64 ~arm64 ~ppc64 ~x86 ~amd64-linux ~x86-linux ~x64-solaris ~x86-solaris"
SLOT="4.0"
KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux ~x64-solaris ~x86-solaris"
IUSE=""
DEPEND=">=virtual/jdk-1.6"
RDEPEND=">=virtual/jre-1.6"
DEPEND=">=virtual/jdk-1.8"
RDEPEND=">=virtual/jre-1.8"
S="${WORKDIR}/${MY_P}/"
@ -26,8 +26,9 @@ src_prepare() {
default
cp "${FILESDIR}/${SLOT}-build.xml" build.xml || die "Could not replace build.xml"
rm -fR */*/build.xml ||die
java-pkg_clean
rm -fR */*/build.xml
einfo "Removing bundled jars and classes"
find "${S}" '(' -name '*.class' -o -name '*.jar' ')' -exec rm -frv {} +
java-pkg-2_src_prepare
}

@ -1,4 +1,4 @@
# Copyright 1999-2018 Gentoo Foundation
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="6"
@ -14,7 +14,7 @@ SRC_URI="mirror://apache/tomcat/tomcat-9/v${PV}/src/${MY_P}.tar.gz"
LICENSE="Apache-2.0"
SLOT="4.0"
KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux ~x64-solaris ~x86-solaris"
KEYWORDS="amd64 ~x86 ~amd64-linux ~x86-linux ~x64-solaris ~x86-solaris"
IUSE=""
DEPEND=">=virtual/jdk-1.8"

Binary file not shown.

@ -1,18 +1,10 @@
DIST php-5.6-openssl-1.1-compatibility.patch 42559 BLAKE2B b7f13866cd8545543143932930f31bcd928fa0b4b36ef63f04798b9ef4699f12b4f4227772ac9e6e5c498aaeacf7b106abcfa48031a12214e123de4b79d3a4cd SHA512 eed695a3dd7ce27e8651b4a4b96ccd0514f256e7d2f0214fac899e9eeea6412aa24f863f1b5d13305bcac50667ccb62709597fb34da1002b005ebf411dd2f5df
DIST php-5.6.38.tar.xz 12467408 BLAKE2B d9ee47e193d80bce8a9ed6ffd3eb13e67ba6d1f597ece2803cd92fddc6245f46cdfe644d6cda12a6bb409b92c1fe748610cc5eb43dea0bf063fda81188ee8b3d SHA512 66c51a8e954b1496c0bad0a2864a2a1537dd1c1c573b553991d6d5bce85fc7bc340e56a21109bc5e9a03799e703204b980b569c95a5c0a1bddb01c8947e7a682
DIST php-5.6.39.tar.xz 12467096 BLAKE2B 354b147c0fcc13eeec0ab333bcaa32ad26e2f4eef19a0ee52cf596ff96997eaf32cbb6d980cacf643167ed01b06ee9d27eeb7c00c95c8023d305c967c1ce3539 SHA512 814ea2d74df9c3c7041769803ceb4ba20dbfc18885ff85f91dca0c3ab694e3ebfb6a564427d116b35382fe292583a54d449f2528495032ca9724cfbdea82c226
DIST php-5.6.40.tar.xz 12472236 BLAKE2B f41147eaec9b15e965540f9e871691cc88848dd619bae6af85e7bba0130b71ce91bad5cdbbadbb537c42df83369f5c731007339a9d9e21e689e913c135201afc SHA512 997b5a952a60cf9166671cc91fcc34c674dd62bfd5cb0a9cdf3fdf2d088b5d19943d94c1cf193f8ab71fc4957d9a9a4c7c2fb8826f937501c1c0a0858f10e329
DIST php-7.0.32.tar.xz 12030780 BLAKE2B 0c277eac4c931a6e30954cceb7feef8dea1c3ef4aebac91779b7e1a6f90f608faa93d1750a2dc8f354c73304e0f7a9b9ac17bb0d1da4768ddb68925752c11aef SHA512 4a7c9a6b91ad7da69303916202062d639e6f02dcd483e851a44d8c7a2efeb5c9a666097935ab60d700c4445f86a0c68df1515300c57af1cdb76528b54b757608
DIST php-7.0.33.tar.xz 12033040 BLAKE2B cb7a4eb3ba8ede93ae8e85b6a11664f33654f7e94fa077ac9a33ab95157c0c2b3b05f98413e13e36f710c6d00b35d49d38bf26092a36e508b88805d092764287 SHA512 9298e185702ea801e9243671ecb0b781c2b04181a2f9fd6490bc14897a333a2c0cc88fe27b0c69c6dd0079629a71c330ed1aa337f48cac6cbd624addb8855500
DIST php-7.1.22.tar.xz 12227848 BLAKE2B 72fab94b1c7ecfd3479f6d6c9a76a9d8813f7789402664201615d79ab8b5bb26fb1b7273769c4898a36f0336e0ce4d50bf2f17b81ddb54acc9583e39623e3a5b SHA512 0fc0907d303711dbc4ba0a18618e3e73550c73d13988c769f8d50066017b1efe3feb0d22d5539f69271ea4e9532a3d997e22841cb59bdbf96313169e1c03538d
DIST php-7.1.23.tar.xz 12227528 BLAKE2B d03470b07ae041c4677e100c1b4f7994d3e15d4830eccba3c654c1f3546345c8205cac057011d2d43ab962ebbc01652f6748270daa40aa1e540453923500288c SHA512 d5a451f1a48415175e3117ffa84ef3504275a407698b59c13eeb403958aa27342e04dc4ffea9791b923ac0cc5d6fdacf2e8672f0e19755bae858707c7fc3627f
DIST php-7.1.24.tar.xz 12205112 BLAKE2B d4dd8bdd980cbb2c8cd813cad44da7a322d75641bb5f4eb986f6be44acf61898e64e43a3206da08b6c68fb1213a95cf5c6bf28bc75356d9abd9711330fa04554 SHA512 ee54d04fa1bb049807e7876baf6a4d12ab8360367bb44ac77c71e53ee8ca078342b4a86f2bc4587838ead27fb8204fea8e739bd582a9e146513ae5d465e59202
DIST php-7.1.25.tar.xz 12205972 BLAKE2B 3d69cc87d75ee45dc85e5e672ddb6c312fcba12882e227d28e397e1e796e0149588b9519beeb990111315a747a07fa5349ad5f9662c0725b4551478f9e95b51d SHA512 10a75b96d5fa104bc1d5b63f4606d9cfacfc594f7d6ab34f9c5e9e8f209b896516c4121b9cbd323a862724d6dfbd275ef902993cfab619d9a4b9518790b9147c
DIST php-7.1.26.tar.xz 12206956 BLAKE2B af78f764349a05905d7db22260c8a6415a2755b29e0dd01225160235b3b38ea76c8910d79c69798aa2de3fc6d4d41e45ab951161b54e62753111f81ac9d85bc2 SHA512 3c80dce2d5dcbf6f253ca4ca4e4ce01fdd3a3d31a6e6045f539fefadc1ea3c391d4d4995600a4ff758ab0361e0ec2244e2eaa6591ecb3e9b8e8a9c44f67a5b32
DIST php-7.2.10.tar.xz 12160864 BLAKE2B f1959a00622c1bd11fa87c61d152c802b307f0b9e89b51ed86b40086cda03eeb6652d47b59df8cc7c9b4e79ab687ae1292b978f453e9f07ac352d209b64c62d8 SHA512 aa90fce17034b2649012d66461626ae74c21ea938b1c71c7eb12419e562c641b432df87a7e900c245ad28df39624cf64a1b2f8ffb123608d94cd35e41f09c0fe
DIST php-7.2.11.tar.xz 12132268 BLAKE2B 8007f6a8f4236efb796681d25f2066deeba98e6e136def0c323aa13399951d58d7f218b3544b3bd0418dfe220f87a38b6515547c50f65c641bd09a2d440eb4e1 SHA512 0cd8578147d17d612e013dfc22b73977719177058b39c7b61dd0bfdfb8c2441aba78af49f58c824f7e66c89b5ad201c36fafb89ccf1e2d20f19b79d6a8fed7e5
DIST php-7.2.12.tar.xz 12141472 BLAKE2B 25d55fcbe63aab64c658e9c4ab52b552831d5c03a8887e1c64f0cadbb8b0d9f3c38cd5d15dac89002c328b737ad864fce392baa0891292ee77d1975562a2bc17 SHA512 bbeaed1278d0d2f1ecb2249dab1ebaab1489ef43be0797dac57d8b523d8e5d284166e6cbf52095f5d34eef447fbdeb0c6916caaa5770221a180ec064f4ffcad8
DIST php-7.2.13.tar.xz 12116484 BLAKE2B 00d265c10343e590772a4de103ae885149a56a7c0ef957cb24d5e81f86021231da5e75b655081e9fcba99b83956d55265b6af1d779ee65cebee9a974f936a634 SHA512 9df1d43e9cd701db10281811b328721b85cb90c6c8dae1842b0fd848cb5388328918b3040bbad7634b340550d82b93746ea479ed45f4d8a80e8a316e6324115d
DIST php-7.2.14.tar.xz 12156460 BLAKE2B 88727241ca3fd68238ce50dcb4c12868f8e6df54213b04dba7650c5f98c3f18a3d02e0a191c0ebd13d85c83cc686fef60135f69ca7cc3e425bd5d7f80035fdd7 SHA512 13f2c97b730e3e872bd24bcc004c6cff5e2cc633c37a4eb60b8b5d1d4454bc5985f7d52943448d61cf4a227c64be770edc5eadd2c9612b297d71c0840b4b1259
DIST php-7.3.0.tar.xz 11928820 BLAKE2B 36fee652cbbc28bbeb1b2df037b4b05084910d94af86c16150d776b82f91fb85691f9846c51538dbf6f3e64ece26894fe9c7a5f272d2848d41cdf8e1338b9805 SHA512 d991101eb833d3a47833aa930341e75c56f26c4cb0249896728ebe209c6c02af1704fccc3052128d8f9fdffc60dcef0ece38a532697131141946898d8b1abcda
DIST php-7.3.1.tar.xz 11944376 BLAKE2B 55b3192774c08b1e4c6621e16176a1e352ff6ba5540794a5d769b6416929723638f1409f2f8224c7fe3db99c9b020fa51db7b78d50eaa00e790308562a0a5334 SHA512 0663d90537fe3901cad00ba1056782050b8a61e8edb49f01851add4992df21d23aee3e9468e32b76b7f53ffd513f1ba10c9513c549e247d796416ed176355348

@ -1,779 +0,0 @@
# Copyright 1999-2018 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
inherit autotools flag-o-matic eapi7-ver systemd
DESCRIPTION="The PHP language runtime engine"
HOMEPAGE="https://secure.php.net/"
SRC_URI="https://php.net/distributions/${P}.tar.xz
https://salsa.debian.org/php-team/php/raw/8149a436/debian/patches/0055-Use-OpenSSL-1.1-compatibility-patch-when-built-with-.patch?inline=false -> php-5.6-openssl-1.1-compatibility.patch"
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 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
# We can build the following SAPIs in the given order
SAPIS="embed cli cgi fpm apache2"
# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
IUSE="${IUSE}
${SAPIS/cli/+cli}
threads"
IUSE="${IUSE} acl bcmath berkdb bzip2 calendar cdb cjk
coverage crypt +ctype curl debug
enchant exif +fileinfo +filter firebird
flatfile ftp gd gdbm gmp +hash +iconv imap inifile
intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl
mhash mssql mysql libmysqlclient mysqli nls
oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
readline recode selinux +session sharedmem
+simplexml snmp soap sockets spell sqlite ssl
sybase-ct sysvipc systemd tidy +tokenizer truetype unicode vpx wddx
+xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib"
# The supported (that is, autodetected) versions of BDB are listed in
# the ./configure script. Other versions *work*, but we need to stick to
# the ones that can be detected to avoid a repeat of bug #564824.
COMMON_DEPEND="
>=app-eselect/eselect-php-0.9.1[apache2?,fpm?]
>=dev-libs/libpcre-8.32[unicode]
fpm? ( acl? ( sys-apps/acl ) )
apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=]
<www-servers/apache-2.4[threads=] ) )
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 ) )
cjk? ( !gd? (
virtual/jpeg:0
media-libs/libpng:0=
sys-libs/zlib:0=
) )
coverage? ( dev-util/lcov )
crypt? ( >=dev-libs/libmcrypt-2.4 )
curl? ( >=net-misc/curl-7.10.5 )
enchant? ( app-text/enchant )
exif? ( !gd? (
virtual/jpeg:0
media-libs/libpng:0=
sys-libs/zlib:0=
) )
firebird? ( dev-db/firebird )
gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib:0= )
gdbm? ( >=sys-libs/gdbm-1.8.0:0= )
gmp? ( dev-libs/gmp:0= )
iconv? ( virtual/libiconv )
imap? ( virtual/imap-c-client[kerberos=,ssl=] )
intl? ( <dev-libs/icu-61.1:= )
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? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) )
mssql? ( dev-db/freetds[mssql] )
libmysqlclient? (
mysql? ( virtual/libmysqlclient:= )
mysqli? ( virtual/libmysqlclient:= )
)
nls? ( sys-devel/gettext )
oci8-instant-client? ( dev-db/oracle-instantclient-basic )
odbc? ( >=dev-db/unixODBC-1.8.13 )
postgres? ( dev-db/postgresql:* )
qdbm? ( dev-db/qdbm )
readline? ( sys-libs/readline:0= )
recode? ( app-text/recode )
sharedmem? ( dev-libs/mm )
simplexml? ( >=dev-libs/libxml2-2.6.8 )
snmp? ( >=net-analyzer/net-snmp-5.2 )
soap? ( >=dev-libs/libxml2-2.6.8 )
spell? ( >=app-text/aspell-0.50 )
sqlite? ( >=dev-db/sqlite-3.7.6.3 )
ssl? (
!libressl? ( dev-libs/openssl:0= )
libressl? ( dev-libs/libressl:0= )
)
sybase-ct? ( dev-db/freetds )
tidy? ( app-text/htmltidy )
truetype? (
=media-libs/freetype-2*
>=media-libs/t1lib-5.0.0
!gd? (
virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib:0= )
)
unicode? ( dev-libs/oniguruma:= )
vpx? ( media-libs/libvpx:0= )
wddx? ( >=dev-libs/libxml2-2.6.8 )
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
virtual/jpeg:0
media-libs/libpng:0= sys-libs/zlib:0=
)
xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
zip? ( sys-libs/zlib:0= )
zlib? ( sys-libs/zlib:0= )
"
RDEPEND="${COMMON_DEPEND}
virtual/mta
fpm? (
selinux? ( sec-policy/selinux-phpfpm )
systemd? ( sys-apps/systemd ) )"
DEPEND="${COMMON_DEPEND}
app-arch/xz-utils
>=sys-devel/bison-3.0.1
sys-devel/flex
>=sys-devel/m4-1.4.3
>=sys-devel/libtool-1.5.18"
# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
REQUIRED_USE="
|| ( cli cgi fpm apache2 embed )
cli? ( ^^ ( readline libedit ) )
truetype? ( gd zlib )
vpx? ( gd zlib )
cjk? ( gd zlib )
exif? ( gd zlib )
xpm? ( gd zlib )
gd? ( zlib )
simplexml? ( xml )
soap? ( xml )
wddx? ( xml )
xmlrpc? ( || ( xml iconv ) )
xmlreader? ( xml )
xslt? ( xml )
ldap-sasl? ( ldap )
mhash? ( hash )
phar? ( hash )
recode? ( !imap !mysql !mysqli !libmysqlclient )
libmysqlclient? ( || (
mysql
mysqli
pdo
) )
qdbm? ( !gdbm )
readline? ( !libedit )
sharedmem? ( !threads )
"
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
dodir "${PHP_INI_DIR#${EPREFIX}}"
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 "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" \
"${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini"
fi
# SAPI-specific handling
if [[ "${sapi}" == "fpm" ]] ; then
einfo "Installing FPM config file php-fpm.conf"
insinto "${PHP_INI_DIR#${EPREFIX}}"
doins sapi/fpm/php-fpm.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() {
eapply "${FILESDIR}/php-${SLOT}-no-bison-warnings.patch"
eapply "${FILESDIR}/5.6-mbstring-oniguruma-6.8.patch"
eapply "${DISTDIR}/php-5.6-openssl-1.1-compatibility.patch"
eapply "${FILESDIR}/php-freetype-2.9.1.patch"
# Change PHP branding
# Get the alpha/beta/rc version
sed -re "s|^(PHP_EXTRA_VERSION=\").*(\")|\1-pl${PR/r/}-gentoo\2|g" \
-i configure.in || die "Unable to change PHP branding"
# Patch PHP to show Gentoo as the server platform
sed -e 's/PHP_UNAME=`uname -a | xargs`/PHP_UNAME=`uname -s -n -r -v | xargs`/g' \
-i configure.in || die "Failed to fix server platform name"
# Prevent PHP from activating the Apache config,
# as we will do that ourselves
sed -i \
-e "s,-i -a -n php${PHP_MV},-i -n php${PHP_MV},g" \
-e "s,-i -A -n php${PHP_MV},-i -n php${PHP_MV},g" \
configure sapi/apache2filter/config.m4 sapi/apache2handler/config.m4 \
|| die
# Patch PHP to support heimdal instead of mit-krb5
if has_version "app-crypt/heimdal" ; then
sed -e 's|gssapi_krb5|gssapi|g' -i acinclude.m4 \
|| die "Failed to fix heimdal libname"
sed -e 's|PHP_ADD_LIBRARY(k5crypto, 1, $1)||g' -i acinclude.m4 \
|| die "Failed to fix heimdal crypt library reference"
fi
eapply_user
# Force rebuilding aclocal.m4
rm -f aclocal.m4 || die "failed to remove aclocal.m4 in src_prepare"
eautoreconf
if [[ ${CHOST} == *-darwin* ]] ; then
# http://bugs.php.net/bug.php?id=48795, bug #343481
sed -i -e '/BUILD_CGI="\\$(CC)/s/CC/CXX/' configure || die
fi
}
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_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 crypt mcrypt "${EPREFIX}/usr")
$(use_with mssql mssql "${EPREFIX}/usr")
$(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 sqlite sqlite3 "${EPREFIX}/usr")
$(use_with sybase-ct sybase-ct "${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 zlib zlib "${EPREFIX}/usr")
$(use_enable debug debug)
)
# DBA support
if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
|| use qdbm ; 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")
)
# Support for the GD graphics library
our_conf+=(
$(use_with truetype freetype-dir "${EPREFIX}/usr")
$(use_with truetype t1lib "${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")
$(use_with vpx vpx-dir "${EPREFIX}/usr")
)
# 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"
use libmysqlclient && mysqllib="${EPREFIX}/usr"
use libmysqlclient && mysqlilib="${EPREFIX}/usr/bin/mysql_config"
our_conf+=( $(use_with mysql mysql "${mysqllib}") )
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)
$(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 sharedmem 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
our_conf+=(
--with-pcre-regex="${EPREFIX}/usr"
--with-pcre-dir="${EPREFIX}/usr"
)
# 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
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)
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
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=""
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 sapi="", 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/libphp5$(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"
;;
cgi)
source="sapi/cgi/php-cgi"
;;
fpm)
source="sapi/fpm/php-fpm"
;;
embed)
source="libs/libphp${PHP_MV}$(get_libname)"
;;
*)
die "unhandled sapi in src_install"
;;
esac
if [[ "${source}" == *"$(get_libname)" ]]; then
dolib.so "${source}"
else
dobin "${source}"
local name="$(basename ${source})"
dosym "${dest}/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/cgi/php-cgi" ]] ; then
export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis/cgi/php-cgi"
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
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,785 +0,0 @@
# Copyright 1999-2018 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="7"
inherit autotools flag-o-matic systemd
DESCRIPTION="The PHP language runtime engine"
HOMEPAGE="https://secure.php.net/"
SRC_URI="https://php.net/distributions/${P}.tar.xz
https://salsa.debian.org/php-team/php/raw/8149a436/debian/patches/0055-Use-OpenSSL-1.1-compatibility-patch-when-built-with-.patch?inline=false -> php-5.6-openssl-1.1-compatibility.patch"
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 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
# We can build the following SAPIs in the given order
SAPIS="embed cli cgi fpm apache2"
# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
IUSE="${IUSE}
${SAPIS/cli/+cli}
threads"
IUSE="${IUSE} acl bcmath berkdb bzip2 calendar cdb cjk
coverage crypt +ctype curl debug
enchant exif +fileinfo +filter firebird
flatfile ftp gd gdbm gmp +hash +iconv imap inifile
intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl
mhash mssql mysql libmysqlclient mysqli nls
oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
readline recode selinux +session sharedmem
+simplexml snmp soap sockets spell sqlite ssl
sybase-ct sysvipc systemd tidy +tokenizer truetype unicode vpx wddx
+xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib"
# The supported (that is, autodetected) versions of BDB are listed in
# the ./configure script. Other versions *work*, but we need to stick to
# the ones that can be detected to avoid a repeat of bug #564824.
COMMON_DEPEND="
>=app-eselect/eselect-php-0.9.1[apache2?,fpm?]
>=dev-libs/libpcre-8.32[unicode]
fpm? ( acl? ( sys-apps/acl ) )
apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=]
<www-servers/apache-2.4[threads=] ) )
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 ) )
cjk? ( !gd? (
virtual/jpeg:0
media-libs/libpng:0=
sys-libs/zlib:0=
) )
coverage? ( dev-util/lcov )
crypt? ( >=dev-libs/libmcrypt-2.4 )
curl? ( >=net-misc/curl-7.10.5 )
enchant? ( app-text/enchant )
exif? ( !gd? (
virtual/jpeg:0
media-libs/libpng:0=
sys-libs/zlib:0=
) )
firebird? ( dev-db/firebird )
gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib:0= )
gdbm? ( >=sys-libs/gdbm-1.8.0:0= )
gmp? ( dev-libs/gmp:0= )
iconv? ( virtual/libiconv )
imap? ( virtual/imap-c-client[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? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) )
mssql? ( dev-db/freetds[mssql] )
libmysqlclient? (
mysql? ( virtual/libmysqlclient:= )
mysqli? ( virtual/libmysqlclient:= )
)
nls? ( sys-devel/gettext )
oci8-instant-client? ( dev-db/oracle-instantclient-basic )
odbc? ( >=dev-db/unixODBC-1.8.13 )
postgres? ( dev-db/postgresql:* )
qdbm? ( dev-db/qdbm )
readline? ( sys-libs/readline:0= )
recode? ( app-text/recode )
sharedmem? ( dev-libs/mm )
simplexml? ( >=dev-libs/libxml2-2.6.8 )
snmp? ( >=net-analyzer/net-snmp-5.2 )
soap? ( >=dev-libs/libxml2-2.6.8 )
spell? ( >=app-text/aspell-0.50 )
sqlite? ( >=dev-db/sqlite-3.7.6.3 )
ssl? (
!libressl? ( dev-libs/openssl:0= )
libressl? ( dev-libs/libressl:0= )
)
sybase-ct? ( dev-db/freetds )
tidy? ( app-text/htmltidy )
truetype? (
=media-libs/freetype-2*
>=media-libs/t1lib-5.0.0
!gd? (
virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib:0= )
)
unicode? ( dev-libs/oniguruma:= )
vpx? ( media-libs/libvpx:0= )
wddx? ( >=dev-libs/libxml2-2.6.8 )
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
virtual/jpeg:0
media-libs/libpng:0= sys-libs/zlib:0=
)
xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
zip? ( sys-libs/zlib:0= )
zlib? ( sys-libs/zlib:0= )
"
RDEPEND="${COMMON_DEPEND}
virtual/mta
fpm? (
selinux? ( sec-policy/selinux-phpfpm )
systemd? ( sys-apps/systemd ) )"
DEPEND="${COMMON_DEPEND}
app-arch/xz-utils
>=sys-devel/bison-3.0.1
sys-devel/flex
>=sys-devel/m4-1.4.3
>=sys-devel/libtool-1.5.18"
# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
REQUIRED_USE="
|| ( cli cgi fpm apache2 embed )
cli? ( ^^ ( readline libedit ) )
truetype? ( gd zlib )
vpx? ( gd zlib )
cjk? ( gd zlib )
exif? ( gd zlib )
xpm? ( gd zlib )
gd? ( zlib )
simplexml? ( xml )
soap? ( xml )
wddx? ( xml )
xmlrpc? ( || ( xml iconv ) )
xmlreader? ( xml )
xslt? ( xml )
ldap-sasl? ( ldap )
mhash? ( hash )
phar? ( hash )
recode? ( !imap !mysql !mysqli !libmysqlclient )
libmysqlclient? ( || (
mysql
mysqli
pdo
) )
qdbm? ( !gdbm )
readline? ( !libedit )
sharedmem? ( !threads )
"
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
dodir "${PHP_INI_DIR#${EPREFIX}}"
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 "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" \
"${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini"
fi
# SAPI-specific handling
if [[ "${sapi}" == "fpm" ]] ; then
einfo "Installing FPM config file php-fpm.conf"
insinto "${PHP_INI_DIR#${EPREFIX}}"
doins sapi/fpm/php-fpm.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() {
eapply "${FILESDIR}/php-${SLOT}-no-bison-warnings.patch"
eapply "${FILESDIR}/5.6-mbstring-oniguruma-6.8.patch"
eapply "${DISTDIR}/php-5.6-openssl-1.1-compatibility.patch"
eapply "${FILESDIR}/php-5.6-intl-detect-icu-via-pkg-config.patch"
eapply "${FILESDIR}/php-5.6-intl-use-icu-namespace.patch"
eapply "${FILESDIR}/php-5.6-intl-icu-memory-corruption.patch"
eapply "${FILESDIR}/php-freetype-2.9.1.patch"
# Change PHP branding
# Get the alpha/beta/rc version
sed -re "s|^(PHP_EXTRA_VERSION=\").*(\")|\1-pl${PR/r/}-gentoo\2|g" \
-i configure.in || die "Unable to change PHP branding"
# Patch PHP to show Gentoo as the server platform
sed -e 's/PHP_UNAME=`uname -a | xargs`/PHP_UNAME=`uname -s -n -r -v | xargs`/g' \
-i configure.in || die "Failed to fix server platform name"
# Prevent PHP from activating the Apache config,
# as we will do that ourselves
sed -i \
-e "s,-i -a -n php${PHP_MV},-i -n php${PHP_MV},g" \
-e "s,-i -A -n php${PHP_MV},-i -n php${PHP_MV},g" \
configure sapi/apache2filter/config.m4 sapi/apache2handler/config.m4 \
|| die
# Patch PHP to support heimdal instead of mit-krb5
if has_version "app-crypt/heimdal" ; then
sed -e 's|gssapi_krb5|gssapi|g' -i acinclude.m4 \
|| die "Failed to fix heimdal libname"
sed -e 's|PHP_ADD_LIBRARY(k5crypto, 1, $1)||g' -i acinclude.m4 \
|| die "Failed to fix heimdal crypt library reference"
fi
eapply_user
# Force rebuilding aclocal.m4
rm -f aclocal.m4 || die "failed to remove aclocal.m4 in src_prepare"
mv configure.in configure.ac || die
eautoreconf
if [[ ${CHOST} == *-darwin* ]] ; then
# http://bugs.php.net/bug.php?id=48795, bug #343481
sed -i -e '/BUILD_CGI="\\$(CC)/s/CC/CXX/' configure || die
fi
}
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_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 crypt mcrypt "${EPREFIX}/usr")
$(use_with mssql mssql "${EPREFIX}/usr")
$(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 sqlite sqlite3 "${EPREFIX}/usr")
$(use_with sybase-ct sybase-ct "${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 zlib zlib "${EPREFIX}/usr")
$(use_enable debug debug)
)
# DBA support
if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
|| use qdbm ; 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")
)
# Support for the GD graphics library
our_conf+=(
$(use_with truetype freetype-dir "${EPREFIX}/usr")
$(use_with truetype t1lib "${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")
$(use_with vpx vpx-dir "${EPREFIX}/usr")
)
# 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"
use libmysqlclient && mysqllib="${EPREFIX}/usr"
use libmysqlclient && mysqlilib="${EPREFIX}/usr/bin/mysql_config"
our_conf+=( $(use_with mysql mysql "${mysqllib}") )
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)
$(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 sharedmem 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
our_conf+=(
--with-pcre-regex="${EPREFIX}/usr"
--with-pcre-dir="${EPREFIX}/usr"
)
# 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
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)
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
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=""
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 sapi="", 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/libphp5$(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"
;;
cgi)
source="sapi/cgi/php-cgi"
;;
fpm)
source="sapi/fpm/php-fpm"
;;
embed)
source="libs/libphp${PHP_MV}$(get_libname)"
;;
*)
die "unhandled sapi in src_install"
;;
esac
if [[ "${source}" == *"$(get_libname)" ]]; then
dolib.so "${source}"
else
dobin "${source}"
local name="$(basename ${source})"
dosym "${dest}/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/cgi/php-cgi" ]] ; then
export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis/cgi/php-cgi"
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
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,734 +0,0 @@
# Copyright 1999-2018 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
inherit flag-o-matic eapi7-ver systemd autotools
DESCRIPTION="The PHP language runtime engine"
HOMEPAGE="https://secure.php.net/"
SRC_URI="https://secure.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 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
# We can build the following SAPIs in the given order
SAPIS="embed cli cgi fpm apache2 phpdbg"
# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
IUSE="${IUSE}
${SAPIS/cli/+cli}
threads"
IUSE="${IUSE} acl bcmath berkdb bzip2 calendar cdb cjk
coverage crypt +ctype curl debug
enchant exif +fileinfo +filter firebird
flatfile ftp gd gdbm gmp +hash +iconv imap inifile
intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl
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 spell sqlite ssl
sysvipc systemd test tidy +tokenizer truetype unicode wddx webp
+xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib"
# The supported (that is, autodetected) versions of BDB are listed in
# the ./configure script. Other versions *work*, but we need to stick to
# the ones that can be detected to avoid a repeat of bug #564824.
COMMON_DEPEND="
>=app-eselect/eselect-php-0.9.1[apache2?,fpm?]
>=dev-libs/libpcre-8.32[unicode]
fpm? ( acl? ( sys-apps/acl ) )
apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=]
<www-servers/apache-2.4[threads=] ) )
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 )
crypt? ( >=dev-libs/libmcrypt-2.4 )
curl? ( >=net-misc/curl-7.10.5 )
enchant? ( <app-text/enchant-2.0:0 )
firebird? ( dev-db/firebird )
gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib )
gdbm? ( >=sys-libs/gdbm-1.8.0:0= )
gmp? ( dev-libs/gmp:0= )
iconv? ( virtual/libiconv )
imap? ( virtual/imap-c-client[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? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) )
mssql? ( dev-db/freetds[mssql] )
nls? ( sys-devel/gettext )
oci8-instant-client? ( dev-db/oracle-instantclient-basic )
odbc? ( >=dev-db/unixODBC-1.8.13 )
postgres? ( dev-db/postgresql:* )
qdbm? ( dev-db/qdbm )
readline? ( sys-libs/readline:0= )
recode? ( app-text/recode )
session-mm? ( dev-libs/mm )
simplexml? ( >=dev-libs/libxml2-2.6.8 )
snmp? ( >=net-analyzer/net-snmp-5.2 )
soap? ( >=dev-libs/libxml2-2.6.8 )
spell? ( >=app-text/aspell-0.50 )
sqlite? ( >=dev-db/sqlite-3.7.6.3 )
ssl? (
!libressl? ( dev-libs/openssl:0= )
libressl? ( dev-libs/libressl:0= )
)
tidy? ( || ( app-text/tidy-html5 app-text/htmltidy ) )
truetype? ( =media-libs/freetype-2* )
unicode? ( dev-libs/oniguruma:= )
wddx? ( >=dev-libs/libxml2-2.6.8 )
webp? ( media-libs/libwebp:0= )
xml? ( >=dev-libs/libxml2-2.6.8 )
xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
xmlreader? ( >=dev-libs/libxml2-2.6.8 )
xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
xpm? ( x11-libs/libXpm )
xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
zip? ( sys-libs/zlib:0= )
zlib? ( sys-libs/zlib:0= )
"
RDEPEND="${COMMON_DEPEND}
virtual/mta
fpm? (
selinux? ( sec-policy/selinux-phpfpm )
systemd? ( sys-apps/systemd ) )"
# Bison isn't actually needed when building from a release tarball
# However, the configure script will warn if it's absent or if you
# have an incompatible version installed. See bug 593278.
DEPEND="${COMMON_DEPEND}
app-arch/xz-utils
>=sys-devel/bison-3.0.1"
# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
REQUIRED_USE="
|| ( cli cgi fpm apache2 embed phpdbg )
cli? ( ^^ ( readline libedit ) )
truetype? ( gd zlib )
webp? ( gd zlib )
cjk? ( gd zlib )
exif? ( gd zlib )
xpm? ( gd zlib )
gd? ( zlib )
simplexml? ( xml )
soap? ( xml )
wddx? ( xml )
xmlrpc? ( || ( xml iconv ) )
xmlreader? ( xml )
xslt? ( xml )
ldap-sasl? ( ldap )
mhash? ( hash )
phar? ( hash )
qdbm? ( !gdbm )
readline? ( !libedit )
recode? ( !imap !mysqli !mysql )
session-mm? ( session !threads )
mysql? ( hash || ( mysqli pdo ) )
mysqli? ( hash )
"
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
dodir "${PHP_INI_DIR#${EPREFIX}}"
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 "${PHP_EXT_INI_DIR#${EPREFIX}}/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_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 crypt mcrypt "${EPREFIX}/usr")
$(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 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 zlib zlib "${EPREFIX}/usr")
$(use_enable debug debug)
)
# DBA support
if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
|| use qdbm ; 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")
)
# 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
our_conf+=(
--with-pcre-regex="${EPREFIX}/usr"
--with-pcre-dir="${EPREFIX}/usr"
)
# 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
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
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=""
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 sapi="", 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"
;;
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}/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
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,734 +0,0 @@
# Copyright 1999-2018 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
inherit flag-o-matic eapi7-ver systemd autotools
DESCRIPTION="The PHP language runtime engine"
HOMEPAGE="https://secure.php.net/"
SRC_URI="https://secure.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 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
# We can build the following SAPIs in the given order
SAPIS="embed cli cgi fpm apache2 phpdbg"
# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
IUSE="${IUSE}
${SAPIS/cli/+cli}
threads"
IUSE="${IUSE} acl bcmath berkdb bzip2 calendar cdb cjk
coverage crypt +ctype curl debug
enchant exif +fileinfo +filter firebird
flatfile ftp gd gdbm gmp +hash +iconv imap inifile
intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl
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 spell sqlite ssl
sysvipc systemd test tidy +tokenizer truetype unicode wddx webp
+xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib"
# The supported (that is, autodetected) versions of BDB are listed in
# the ./configure script. Other versions *work*, but we need to stick to
# the ones that can be detected to avoid a repeat of bug #564824.
COMMON_DEPEND="
>=app-eselect/eselect-php-0.9.1[apache2?,fpm?]
>=dev-libs/libpcre-8.32[unicode]
fpm? ( acl? ( sys-apps/acl ) )
apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=]
<www-servers/apache-2.4[threads=] ) )
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 )
crypt? ( >=dev-libs/libmcrypt-2.4 )
curl? ( >=net-misc/curl-7.10.5 )
enchant? ( <app-text/enchant-2.0:0 )
firebird? ( dev-db/firebird )
gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib )
gdbm? ( >=sys-libs/gdbm-1.8.0:0= )
gmp? ( dev-libs/gmp:0= )
iconv? ( virtual/libiconv )
imap? ( virtual/imap-c-client[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? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) )
mssql? ( dev-db/freetds[mssql] )
nls? ( sys-devel/gettext )
oci8-instant-client? ( dev-db/oracle-instantclient-basic )
odbc? ( >=dev-db/unixODBC-1.8.13 )
postgres? ( dev-db/postgresql:* )
qdbm? ( dev-db/qdbm )
readline? ( sys-libs/readline:0= )
recode? ( app-text/recode )
session-mm? ( dev-libs/mm )
simplexml? ( >=dev-libs/libxml2-2.6.8 )
snmp? ( >=net-analyzer/net-snmp-5.2 )
soap? ( >=dev-libs/libxml2-2.6.8 )
spell? ( >=app-text/aspell-0.50 )
sqlite? ( >=dev-db/sqlite-3.7.6.3 )
ssl? (
!libressl? ( dev-libs/openssl:0= )
libressl? ( dev-libs/libressl:0= )
)
tidy? ( || ( app-text/tidy-html5 app-text/htmltidy ) )
truetype? ( =media-libs/freetype-2* )
unicode? ( dev-libs/oniguruma:= )
wddx? ( >=dev-libs/libxml2-2.6.8 )
webp? ( media-libs/libwebp:0= )
xml? ( >=dev-libs/libxml2-2.6.8 )
xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
xmlreader? ( >=dev-libs/libxml2-2.6.8 )
xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
xpm? ( x11-libs/libXpm )
xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
zip? ( sys-libs/zlib:0= )
zlib? ( sys-libs/zlib:0= )
"
RDEPEND="${COMMON_DEPEND}
virtual/mta
fpm? (
selinux? ( sec-policy/selinux-phpfpm )
systemd? ( sys-apps/systemd ) )"
# Bison isn't actually needed when building from a release tarball
# However, the configure script will warn if it's absent or if you
# have an incompatible version installed. See bug 593278.
DEPEND="${COMMON_DEPEND}
app-arch/xz-utils
>=sys-devel/bison-3.0.1"
# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
REQUIRED_USE="
|| ( cli cgi fpm apache2 embed phpdbg )
cli? ( ^^ ( readline libedit ) )
truetype? ( gd zlib )
webp? ( gd zlib )
cjk? ( gd zlib )
exif? ( gd zlib )
xpm? ( gd zlib )
gd? ( zlib )
simplexml? ( xml )
soap? ( xml )
wddx? ( xml )
xmlrpc? ( || ( xml iconv ) )
xmlreader? ( xml )
xslt? ( xml )
ldap-sasl? ( ldap )
mhash? ( hash )
phar? ( hash )
qdbm? ( !gdbm )
readline? ( !libedit )
recode? ( !imap !mysqli !mysql )
session-mm? ( session !threads )
mysql? ( hash || ( mysqli pdo ) )
mysqli? ( hash )
"
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
dodir "${PHP_INI_DIR#${EPREFIX}}"
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 "${PHP_EXT_INI_DIR#${EPREFIX}}/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_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 crypt mcrypt "${EPREFIX}/usr")
$(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 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 zlib zlib "${EPREFIX}/usr")
$(use_enable debug debug)
)
# DBA support
if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
|| use qdbm ; 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")
)
# 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
our_conf+=(
--with-pcre-regex="${EPREFIX}/usr"
--with-pcre-dir="${EPREFIX}/usr"
)
# 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
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
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=""
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 sapi="", 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"
;;
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}/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
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,736 +0,0 @@
# Copyright 1999-2018 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit flag-o-matic systemd autotools
DESCRIPTION="The PHP language runtime engine"
HOMEPAGE="https://secure.php.net/"
SRC_URI="https://secure.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 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
# We can build the following SAPIs in the given order
SAPIS="embed cli cgi fpm apache2 phpdbg"
# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
IUSE="${IUSE}
${SAPIS/cli/+cli}
threads"
IUSE="${IUSE} acl bcmath berkdb bzip2 calendar cdb cjk
coverage crypt +ctype curl debug
enchant exif +fileinfo +filter firebird
flatfile ftp gd gdbm gmp +hash +iconv imap inifile
intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl
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 spell sqlite ssl
sysvipc systemd test tidy +tokenizer truetype unicode wddx webp
+xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib"
# The supported (that is, autodetected) versions of BDB are listed in
# the ./configure script. Other versions *work*, but we need to stick to
# the ones that can be detected to avoid a repeat of bug #564824.
COMMON_DEPEND="
>=app-eselect/eselect-php-0.9.1[apache2?,fpm?]
>=dev-libs/libpcre-8.32[unicode]
fpm? ( acl? ( sys-apps/acl ) )
apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=]
<www-servers/apache-2.4[threads=] ) )
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 )
crypt? ( >=dev-libs/libmcrypt-2.4 )
curl? ( >=net-misc/curl-7.10.5 )
enchant? ( <app-text/enchant-2.0:0 )
firebird? ( dev-db/firebird )
gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib )
gdbm? ( >=sys-libs/gdbm-1.8.0:0= )
gmp? ( dev-libs/gmp:0= )
iconv? ( virtual/libiconv )
imap? ( virtual/imap-c-client[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? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) )
mssql? ( dev-db/freetds[mssql] )
nls? ( sys-devel/gettext )
oci8-instant-client? ( dev-db/oracle-instantclient-basic )
odbc? ( >=dev-db/unixODBC-1.8.13 )
postgres? ( dev-db/postgresql:* )
qdbm? ( dev-db/qdbm )
readline? ( sys-libs/readline:0= )
recode? ( app-text/recode )
session-mm? ( dev-libs/mm )
simplexml? ( >=dev-libs/libxml2-2.6.8 )
snmp? ( >=net-analyzer/net-snmp-5.2 )
soap? ( >=dev-libs/libxml2-2.6.8 )
spell? ( >=app-text/aspell-0.50 )
sqlite? ( >=dev-db/sqlite-3.7.6.3 )
ssl? (
!libressl? ( dev-libs/openssl:0= )
libressl? ( dev-libs/libressl:0= )
)
tidy? ( || ( app-text/tidy-html5 app-text/htmltidy ) )
truetype? ( =media-libs/freetype-2* )
unicode? ( dev-libs/oniguruma:= )
wddx? ( >=dev-libs/libxml2-2.6.8 )
webp? ( media-libs/libwebp:0= )
xml? ( >=dev-libs/libxml2-2.6.8 )
xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
xmlreader? ( >=dev-libs/libxml2-2.6.8 )
xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
xpm? ( x11-libs/libXpm )
xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
zip? ( sys-libs/zlib:0= )
zlib? ( sys-libs/zlib:0= )
"
RDEPEND="${COMMON_DEPEND}
virtual/mta
fpm? (
selinux? ( sec-policy/selinux-phpfpm )
systemd? ( sys-apps/systemd ) )"
# Bison isn't actually needed when building from a release tarball
# However, the configure script will warn if it's absent or if you
# have an incompatible version installed. See bug 593278.
DEPEND="${COMMON_DEPEND}
app-arch/xz-utils
>=sys-devel/bison-3.0.1"
# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
REQUIRED_USE="
|| ( cli cgi fpm apache2 embed phpdbg )
cli? ( ^^ ( readline libedit ) )
truetype? ( gd zlib )
webp? ( gd zlib )
cjk? ( gd zlib )
exif? ( gd zlib )
xpm? ( gd zlib )
gd? ( zlib )
simplexml? ( xml )
soap? ( xml )
wddx? ( xml )
xmlrpc? ( || ( xml iconv ) )
xmlreader? ( xml )
xslt? ( xml )
ldap-sasl? ( ldap )
mhash? ( hash )
phar? ( hash )
qdbm? ( !gdbm )
readline? ( !libedit )
recode? ( !imap !mysqli !mysql )
session-mm? ( session !threads )
mysql? ( hash || ( mysqli pdo ) )
mysqli? ( hash )
"
PATCHES=(
"${FILESDIR}/php-freetype-2.9.1.patch"
"${FILESDIR}/php-7.1.25-intl-detect-icu-via-pkg-config.patch"
"${FILESDIR}/php-7.1.25-intl-use-icu-namespace.patch"
)
PHP_MV="$(ver_cut 1)"
php_install_ini() {
local phpsapi="${1}"
# work out where we are installing the ini file
php_set_ini_dir "${phpsapi}"
# Always install the production INI file, bug 611214.
local phpinisrc="php.ini-production-${phpsapi}"
cp php.ini-production "${phpinisrc}" || die
# default to /tmp for save_path, bug #282768
sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die
# Set the extension dir
sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \
-i "${phpinisrc}" || die
# Set the include path to point to where we want to find PEAR packages
sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die
dodir "${PHP_INI_DIR#${EPREFIX}}"
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 "${PHP_EXT_INI_DIR#${EPREFIX}}/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_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 crypt mcrypt "${EPREFIX}/usr")
$(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 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 zlib zlib "${EPREFIX}/usr")
$(use_enable debug debug)
)
# DBA support
if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
|| use qdbm ; 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")
)
# 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
our_conf+=(
--with-pcre-regex="${EPREFIX}/usr"
--with-pcre-dir="${EPREFIX}/usr"
)
# 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
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
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=""
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 sapi="", 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"
;;
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}/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
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,746 +0,0 @@
# Copyright 1999-2018 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
inherit flag-o-matic eapi7-ver systemd autotools
DESCRIPTION="The PHP language runtime engine"
HOMEPAGE="https://secure.php.net/"
SRC_URI="https://secure.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 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
# We can build the following SAPIs in the given order
SAPIS="embed cli cgi fpm apache2 phpdbg"
# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
IUSE="${IUSE}
${SAPIS/cli/+cli}
threads"
IUSE="${IUSE} acl argon2 bcmath berkdb bzip2 calendar cdb cjk
coverage +ctype curl debug
enchant exif +fileinfo +filter firebird
flatfile ftp gd gdbm gmp +hash +iconv imap inifile
intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl lmdb
mhash mssql mysql mysqli nls
oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
readline recode selinux +session session-mm sharedmem
+simplexml snmp soap sockets sodium spell sqlite ssl
sysvipc systemd test tidy +tokenizer tokyocabinet truetype unicode wddx webp
+xml xmlreader xmlwriter xmlrpc xpm xslt zip zip-encryption zlib"
# The supported (that is, autodetected) versions of BDB are listed in
# the ./configure script. Other versions *work*, but we need to stick to
# the ones that can be detected to avoid a repeat of bug #564824.
COMMON_DEPEND="
>=app-eselect/eselect-php-0.9.1[apache2?,fpm?]
>=dev-libs/libpcre-8.32[unicode]
fpm? ( acl? ( sys-apps/acl ) )
apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=]
<www-servers/apache-2.4[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 media-libs/libpng:0= sys-libs/zlib )
gdbm? ( >=sys-libs/gdbm-1.8.0:0= )
gmp? ( dev-libs/gmp:0= )
iconv? ( virtual/libiconv )
imap? ( virtual/imap-c-client[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? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) )
lmdb? ( dev-db/lmdb:= )
mssql? ( dev-db/freetds[mssql] )
nls? ( sys-devel/gettext )
oci8-instant-client? ( dev-db/oracle-instantclient-basic )
odbc? ( >=dev-db/unixODBC-1.8.13 )
postgres? ( dev-db/postgresql:* )
qdbm? ( dev-db/qdbm )
readline? ( sys-libs/readline:0= )
recode? ( app-text/recode )
session-mm? ( dev-libs/mm )
simplexml? ( >=dev-libs/libxml2-2.6.8 )
snmp? ( >=net-analyzer/net-snmp-5.2 )
soap? ( >=dev-libs/libxml2-2.6.8 )
sodium? ( dev-libs/libsodium:= )
spell? ( >=app-text/aspell-0.50 )
sqlite? ( >=dev-db/sqlite-3.7.6.3 )
ssl? (
!libressl? ( dev-libs/openssl:0= )
libressl? ( dev-libs/libressl:0= )
)
tidy? ( || ( app-text/tidy-html5 app-text/htmltidy ) )
tokyocabinet? ( dev-db/tokyocabinet )
truetype? ( =media-libs/freetype-2* )
unicode? ( dev-libs/oniguruma:= )
wddx? ( >=dev-libs/libxml2-2.6.8 )
webp? ( media-libs/libwebp:0= )
xml? ( >=dev-libs/libxml2-2.6.8 )
xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
xmlreader? ( >=dev-libs/libxml2-2.6.8 )
xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
xpm? ( x11-libs/libXpm )
xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
zip? ( sys-libs/zlib:0= )
zip-encryption? ( >=dev-libs/libzip-1.2.0:= )
zlib? ( sys-libs/zlib:0= )
"
RDEPEND="${COMMON_DEPEND}
virtual/mta
fpm? (
selinux? ( sec-policy/selinux-phpfpm )
systemd? ( sys-apps/systemd ) )"
# Bison isn't actually needed when building from a release tarball
# However, the configure script will warn if it's absent or if you
# have an incompatible version installed. See bug 593278.
DEPEND="${COMMON_DEPEND}
app-arch/xz-utils
>=sys-devel/bison-3.0.1"
# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
REQUIRED_USE="
|| ( cli cgi fpm apache2 embed phpdbg )
cli? ( ^^ ( readline libedit ) )
truetype? ( gd zlib )
webp? ( gd zlib )
cjk? ( gd zlib )
exif? ( gd zlib )
xpm? ( gd zlib )
gd? ( zlib )
simplexml? ( xml )
soap? ( xml )
wddx? ( xml )
xmlrpc? ( || ( xml iconv ) )
xmlreader? ( xml )
xslt? ( xml )
ldap-sasl? ( ldap )
mhash? ( hash )
phar? ( hash )
qdbm? ( !gdbm )
readline? ( !libedit )
recode? ( !imap !mysqli !mysql )
session-mm? ( session !threads )
mysql? ( hash || ( mysqli pdo ) )
mysqli? ( hash )
zip-encryption? ( zip )
"
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
dodir "${PHP_INI_DIR#${EPREFIX}}"
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 "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" \
"${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini"
fi
# SAPI-specific handling
if [[ "${sapi}" == "fpm" ]] ; then
einfo "Installing FPM config files php-fpm.conf and www.conf"
insinto "${PHP_INI_DIR#${EPREFIX}}"
doins sapi/fpm/php-fpm.conf
insinto "${PHP_INI_DIR#${EPREFIX}}/fpm.d"
doins sapi/fpm/www.conf
fi
dodoc php.ini-{development,production}
}
php_set_ini_dir() {
PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}"
PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
}
src_prepare() {
default
# In php-7.x, the FPM pool configuration files have been split off
# of the main config. By default the pool config files go in
# e.g. /etc/php-fpm.d, which isn't slotted. So here we move the
# include directory to a subdirectory "fpm.d" of $PHP_INI_DIR. Later
# we'll install the pool configuration file "www.conf" there.
php_set_ini_dir fpm
sed -i "s~^include=.*$~include=${PHP_INI_DIR}/fpm.d/*.conf~" \
sapi/fpm/php-fpm.conf.in \
|| die 'failed to move the include directory in php-fpm.conf'
# Bug 669566 - necessary so that build tools are updated for commands like pecl
# Force rebuilding aclocal.m4
rm -f aclocal.m4 || die "failed to remove aclocal.m4 in src_prepare"
eautoreconf
}
src_configure() {
addpredict /usr/share/snmp/mibs/.index #nowarn
addpredict /var/lib/net-snmp/mib_indexes #nowarn
PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
# The php-fpm config file wants localstatedir to be ${EPREFIX}/var
# and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002.
local our_conf=(
--prefix="${PHP_DESTDIR}"
--mandir="${PHP_DESTDIR}/man"
--infodir="${PHP_DESTDIR}/info"
--libdir="${PHP_DESTDIR}/lib"
--with-libdir="$(get_libdir)"
--localstatedir="${EPREFIX}/var"
--without-pear
$(use_enable threads maintainer-zts)
)
our_conf+=(
$(use_with argon2 password-argon2 "${EPREFIX}/usr")
$(use_enable bcmath bcmath)
$(use_with bzip2 bz2 "${EPREFIX}/usr")
$(use_enable calendar calendar)
$(use_enable coverage gcov)
$(use_enable ctype ctype)
$(use_with curl curl "${EPREFIX}/usr")
$(use_enable xml dom)
$(use_with enchant enchant "${EPREFIX}/usr")
$(use_enable exif exif)
$(use_enable fileinfo fileinfo)
$(use_enable filter filter)
$(use_enable ftp ftp)
$(use_with nls gettext "${EPREFIX}/usr")
$(use_with gmp gmp "${EPREFIX}/usr")
$(use_enable hash hash)
$(use_with mhash mhash "${EPREFIX}/usr")
$(use_with iconv iconv \
$(use elibc_glibc || use elibc_musl || use elibc_FreeBSD || echo "${EPREFIX}/usr"))
$(use_enable intl intl)
$(use_enable ipv6 ipv6)
$(use_enable json json)
$(use_with kerberos kerberos "${EPREFIX}/usr")
$(use_enable xml libxml)
$(use_with xml libxml-dir "${EPREFIX}/usr")
$(use_enable unicode mbstring)
$(use_with unicode onig "${EPREFIX}/usr")
$(use_with ssl openssl "${EPREFIX}/usr")
$(use_with ssl openssl-dir "${EPREFIX}/usr")
$(use_enable pcntl pcntl)
$(use_enable phar phar)
$(use_enable pdo pdo)
$(use_enable opcache opcache)
$(use_with postgres pgsql "${EPREFIX}/usr")
$(use_enable posix posix)
$(use_with spell pspell "${EPREFIX}/usr")
$(use_with recode recode "${EPREFIX}/usr")
$(use_enable simplexml simplexml)
$(use_enable sharedmem shmop)
$(use_with snmp snmp "${EPREFIX}/usr")
$(use_enable soap soap)
$(use_enable sockets sockets)
$(use_with sodium sodium "${EPREFIX}/usr")
$(use_with sqlite sqlite3 "${EPREFIX}/usr")
$(use_enable sysvipc sysvmsg)
$(use_enable sysvipc sysvsem)
$(use_enable sysvipc sysvshm)
$(use_with tidy tidy "${EPREFIX}/usr")
$(use_enable tokenizer tokenizer)
$(use_enable wddx wddx)
$(use_enable xml xml)
$(use_enable xmlreader xmlreader)
$(use_enable xmlwriter xmlwriter)
$(use_with xmlrpc xmlrpc)
$(use_with xslt xsl "${EPREFIX}/usr")
$(use_enable zip zip)
$(use_with zip-encryption libzip "${EPREFIX}/usr")
$(use_with zlib zlib "${EPREFIX}/usr")
$(use_enable debug debug)
)
# DBA support
if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
|| use qdbm || use lmdb || use tokyocabinet ; then
our_conf+=( "--enable-dba${shared}" )
fi
# DBA drivers support
our_conf+=(
$(use_with cdb cdb)
$(use_with berkdb db4 "${EPREFIX}/usr")
$(use_enable flatfile flatfile)
$(use_with gdbm gdbm "${EPREFIX}/usr")
$(use_enable inifile inifile)
$(use_with qdbm qdbm "${EPREFIX}/usr")
$(use_with lmdb lmdb "${EPREFIX}/usr")
)
# Support for the GD graphics library
our_conf+=(
$(use_with truetype freetype-dir "${EPREFIX}/usr")
$(use_enable cjk gd-jis-conv)
$(use_with gd jpeg-dir "${EPREFIX}/usr")
$(use_with gd png-dir "${EPREFIX}/usr")
$(use_with xpm xpm-dir "${EPREFIX}/usr")
)
if use webp; then
our_conf+=( --with-webp-dir="${EPREFIX}/usr" )
fi
# enable gd last, so configure can pick up the previous settings
our_conf+=( $(use_with gd gd) )
# IMAP support
if use imap ; then
our_conf+=(
$(use_with imap imap "${EPREFIX}/usr")
$(use_with ssl imap-ssl "${EPREFIX}/usr")
)
fi
# Interbase/firebird support
our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") )
# LDAP support
if use ldap ; then
our_conf+=(
$(use_with ldap ldap "${EPREFIX}/usr")
$(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr")
)
fi
# MySQL support
local mysqllib="mysqlnd"
local mysqlilib="mysqlnd"
our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock"
if use mysql || use mysqli ; then
our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") )
fi
# ODBC support
our_conf+=(
$(use_with odbc unixODBC "${EPREFIX}/usr")
$(use_with iodbc iodbc "${EPREFIX}/usr")
)
# Oracle support
our_conf+=( $(use_with oci8-instant-client oci8) )
# PDO support
if use pdo ; then
our_conf+=(
$(use_with mssql pdo-dblib "${EPREFIX}/usr")
$(use_with mysql pdo-mysql "${mysqllib}")
$(use_with postgres pdo-pgsql)
$(use_with sqlite pdo-sqlite "${EPREFIX}/usr")
$(use_with firebird pdo-firebird "${EPREFIX}/usr")
$(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr")
$(use_with oci8-instant-client pdo-oci)
)
fi
# readline/libedit support
our_conf+=(
$(use_with readline readline "${EPREFIX}/usr")
$(use_with libedit libedit "${EPREFIX}/usr")
)
# Session support
if use session ; then
our_conf+=( $(use_with session-mm mm "${EPREFIX}/usr") )
else
our_conf+=( $(use_enable session session) )
fi
# Use pic for shared modules such as apache2's mod_php
our_conf+=( --with-pic )
# we use the system copy of pcre
# --with-pcre-regex affects ext/pcre
# --with-pcre-dir affects ext/filter and ext/zip
# --with-pcre-valgrind cannot be enabled with system pcre
# Many arches don't support pcre-jit
our_conf+=(
--with-pcre-regex="${EPREFIX}/usr"
--with-pcre-dir="${EPREFIX}/usr"
--without-pcre-valgrind
--without-pcre-jit
)
# Catch CFLAGS problems
# Fixes bug #14067.
# Changed order to run it in reverse for bug #32022 and #12021.
replace-cpu-flags "k6*" "i586"
# Cache the ./configure test results between SAPIs.
our_conf+=( --cache-file="${T}/config.cache" )
# Support user-passed configuration parameters
our_conf+=( ${EXTRA_ECONF:-} )
# Support the Apache2 extras, they must be set globally for all
# SAPIs to work correctly, especially for external PHP extensions
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
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=""
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 sapi="", 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"
;;
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}/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
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,746 +0,0 @@
# Copyright 1999-2018 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
inherit flag-o-matic eapi7-ver systemd autotools
DESCRIPTION="The PHP language runtime engine"
HOMEPAGE="https://secure.php.net/"
SRC_URI="https://secure.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 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
# We can build the following SAPIs in the given order
SAPIS="embed cli cgi fpm apache2 phpdbg"
# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
IUSE="${IUSE}
${SAPIS/cli/+cli}
threads"
IUSE="${IUSE} acl argon2 bcmath berkdb bzip2 calendar cdb cjk
coverage +ctype curl debug
enchant exif +fileinfo +filter firebird
flatfile ftp gd gdbm gmp +hash +iconv imap inifile
intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl lmdb
mhash mssql mysql mysqli nls
oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
readline recode selinux +session session-mm sharedmem
+simplexml snmp soap sockets sodium spell sqlite ssl
sysvipc systemd test tidy +tokenizer tokyocabinet truetype unicode wddx webp
+xml xmlreader xmlwriter xmlrpc xpm xslt zip zip-encryption zlib"
# The supported (that is, autodetected) versions of BDB are listed in
# the ./configure script. Other versions *work*, but we need to stick to
# the ones that can be detected to avoid a repeat of bug #564824.
COMMON_DEPEND="
>=app-eselect/eselect-php-0.9.1[apache2?,fpm?]
>=dev-libs/libpcre-8.32[unicode]
fpm? ( acl? ( sys-apps/acl ) )
apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=]
<www-servers/apache-2.4[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 media-libs/libpng:0= sys-libs/zlib )
gdbm? ( >=sys-libs/gdbm-1.8.0:0= )
gmp? ( dev-libs/gmp:0= )
iconv? ( virtual/libiconv )
imap? ( virtual/imap-c-client[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? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) )
lmdb? ( dev-db/lmdb:= )
mssql? ( dev-db/freetds[mssql] )
nls? ( sys-devel/gettext )
oci8-instant-client? ( dev-db/oracle-instantclient-basic )
odbc? ( >=dev-db/unixODBC-1.8.13 )
postgres? ( dev-db/postgresql:* )
qdbm? ( dev-db/qdbm )
readline? ( sys-libs/readline:0= )
recode? ( app-text/recode )
session-mm? ( dev-libs/mm )
simplexml? ( >=dev-libs/libxml2-2.6.8 )
snmp? ( >=net-analyzer/net-snmp-5.2 )
soap? ( >=dev-libs/libxml2-2.6.8 )
sodium? ( dev-libs/libsodium:= )
spell? ( >=app-text/aspell-0.50 )
sqlite? ( >=dev-db/sqlite-3.7.6.3 )
ssl? (
!libressl? ( dev-libs/openssl:0= )
libressl? ( dev-libs/libressl:0= )
)
tidy? ( || ( app-text/tidy-html5 app-text/htmltidy ) )
tokyocabinet? ( dev-db/tokyocabinet )
truetype? ( =media-libs/freetype-2* )
unicode? ( dev-libs/oniguruma:= )
wddx? ( >=dev-libs/libxml2-2.6.8 )
webp? ( media-libs/libwebp:0= )
xml? ( >=dev-libs/libxml2-2.6.8 )
xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
xmlreader? ( >=dev-libs/libxml2-2.6.8 )
xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
xpm? ( x11-libs/libXpm )
xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
zip? ( sys-libs/zlib:0= )
zip-encryption? ( >=dev-libs/libzip-1.2.0:= )
zlib? ( sys-libs/zlib:0= )
"
RDEPEND="${COMMON_DEPEND}
virtual/mta
fpm? (
selinux? ( sec-policy/selinux-phpfpm )
systemd? ( sys-apps/systemd ) )"
# Bison isn't actually needed when building from a release tarball
# However, the configure script will warn if it's absent or if you
# have an incompatible version installed. See bug 593278.
DEPEND="${COMMON_DEPEND}
app-arch/xz-utils
>=sys-devel/bison-3.0.1"
# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
REQUIRED_USE="
|| ( cli cgi fpm apache2 embed phpdbg )
cli? ( ^^ ( readline libedit ) )
truetype? ( gd zlib )
webp? ( gd zlib )
cjk? ( gd zlib )
exif? ( gd zlib )
xpm? ( gd zlib )
gd? ( zlib )
simplexml? ( xml )
soap? ( xml )
wddx? ( xml )
xmlrpc? ( || ( xml iconv ) )
xmlreader? ( xml )
xslt? ( xml )
ldap-sasl? ( ldap )
mhash? ( hash )
phar? ( hash )
qdbm? ( !gdbm )
readline? ( !libedit )
recode? ( !imap !mysqli !mysql )
session-mm? ( session !threads )
mysql? ( hash || ( mysqli pdo ) )
mysqli? ( hash )
zip-encryption? ( zip )
"
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
dodir "${PHP_INI_DIR#${EPREFIX}}"
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 "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" \
"${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini"
fi
# SAPI-specific handling
if [[ "${sapi}" == "fpm" ]] ; then
einfo "Installing FPM config files php-fpm.conf and www.conf"
insinto "${PHP_INI_DIR#${EPREFIX}}"
doins sapi/fpm/php-fpm.conf
insinto "${PHP_INI_DIR#${EPREFIX}}/fpm.d"
doins sapi/fpm/www.conf
fi
dodoc php.ini-{development,production}
}
php_set_ini_dir() {
PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}"
PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
}
src_prepare() {
default
# In php-7.x, the FPM pool configuration files have been split off
# of the main config. By default the pool config files go in
# e.g. /etc/php-fpm.d, which isn't slotted. So here we move the
# include directory to a subdirectory "fpm.d" of $PHP_INI_DIR. Later
# we'll install the pool configuration file "www.conf" there.
php_set_ini_dir fpm
sed -i "s~^include=.*$~include=${PHP_INI_DIR}/fpm.d/*.conf~" \
sapi/fpm/php-fpm.conf.in \
|| die 'failed to move the include directory in php-fpm.conf'
# Bug 669566 - necessary so that build tools are updated for commands like pecl
# Force rebuilding aclocal.m4
rm -f aclocal.m4 || die "failed to remove aclocal.m4 in src_prepare"
eautoreconf
}
src_configure() {
addpredict /usr/share/snmp/mibs/.index #nowarn
addpredict /var/lib/net-snmp/mib_indexes #nowarn
PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
# The php-fpm config file wants localstatedir to be ${EPREFIX}/var
# and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002.
local our_conf=(
--prefix="${PHP_DESTDIR}"
--mandir="${PHP_DESTDIR}/man"
--infodir="${PHP_DESTDIR}/info"
--libdir="${PHP_DESTDIR}/lib"
--with-libdir="$(get_libdir)"
--localstatedir="${EPREFIX}/var"
--without-pear
$(use_enable threads maintainer-zts)
)
our_conf+=(
$(use_with argon2 password-argon2 "${EPREFIX}/usr")
$(use_enable bcmath bcmath)
$(use_with bzip2 bz2 "${EPREFIX}/usr")
$(use_enable calendar calendar)
$(use_enable coverage gcov)
$(use_enable ctype ctype)
$(use_with curl curl "${EPREFIX}/usr")
$(use_enable xml dom)
$(use_with enchant enchant "${EPREFIX}/usr")
$(use_enable exif exif)
$(use_enable fileinfo fileinfo)
$(use_enable filter filter)
$(use_enable ftp ftp)
$(use_with nls gettext "${EPREFIX}/usr")
$(use_with gmp gmp "${EPREFIX}/usr")
$(use_enable hash hash)
$(use_with mhash mhash "${EPREFIX}/usr")
$(use_with iconv iconv \
$(use elibc_glibc || use elibc_musl || use elibc_FreeBSD || echo "${EPREFIX}/usr"))
$(use_enable intl intl)
$(use_enable ipv6 ipv6)
$(use_enable json json)
$(use_with kerberos kerberos "${EPREFIX}/usr")
$(use_enable xml libxml)
$(use_with xml libxml-dir "${EPREFIX}/usr")
$(use_enable unicode mbstring)
$(use_with unicode onig "${EPREFIX}/usr")
$(use_with ssl openssl "${EPREFIX}/usr")
$(use_with ssl openssl-dir "${EPREFIX}/usr")
$(use_enable pcntl pcntl)
$(use_enable phar phar)
$(use_enable pdo pdo)
$(use_enable opcache opcache)
$(use_with postgres pgsql "${EPREFIX}/usr")
$(use_enable posix posix)
$(use_with spell pspell "${EPREFIX}/usr")
$(use_with recode recode "${EPREFIX}/usr")
$(use_enable simplexml simplexml)
$(use_enable sharedmem shmop)
$(use_with snmp snmp "${EPREFIX}/usr")
$(use_enable soap soap)
$(use_enable sockets sockets)
$(use_with sodium sodium "${EPREFIX}/usr")
$(use_with sqlite sqlite3 "${EPREFIX}/usr")
$(use_enable sysvipc sysvmsg)
$(use_enable sysvipc sysvsem)
$(use_enable sysvipc sysvshm)
$(use_with tidy tidy "${EPREFIX}/usr")
$(use_enable tokenizer tokenizer)
$(use_enable wddx wddx)
$(use_enable xml xml)
$(use_enable xmlreader xmlreader)
$(use_enable xmlwriter xmlwriter)
$(use_with xmlrpc xmlrpc)
$(use_with xslt xsl "${EPREFIX}/usr")
$(use_enable zip zip)
$(use_with zip-encryption libzip "${EPREFIX}/usr")
$(use_with zlib zlib "${EPREFIX}/usr")
$(use_enable debug debug)
)
# DBA support
if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
|| use qdbm || use lmdb || use tokyocabinet ; then
our_conf+=( "--enable-dba${shared}" )
fi
# DBA drivers support
our_conf+=(
$(use_with cdb cdb)
$(use_with berkdb db4 "${EPREFIX}/usr")
$(use_enable flatfile flatfile)
$(use_with gdbm gdbm "${EPREFIX}/usr")
$(use_enable inifile inifile)
$(use_with qdbm qdbm "${EPREFIX}/usr")
$(use_with lmdb lmdb "${EPREFIX}/usr")
)
# Support for the GD graphics library
our_conf+=(
$(use_with truetype freetype-dir "${EPREFIX}/usr")
$(use_enable cjk gd-jis-conv)
$(use_with gd jpeg-dir "${EPREFIX}/usr")
$(use_with gd png-dir "${EPREFIX}/usr")
$(use_with xpm xpm-dir "${EPREFIX}/usr")
)
if use webp; then
our_conf+=( --with-webp-dir="${EPREFIX}/usr" )
fi
# enable gd last, so configure can pick up the previous settings
our_conf+=( $(use_with gd gd) )
# IMAP support
if use imap ; then
our_conf+=(
$(use_with imap imap "${EPREFIX}/usr")
$(use_with ssl imap-ssl "${EPREFIX}/usr")
)
fi
# Interbase/firebird support
our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") )
# LDAP support
if use ldap ; then
our_conf+=(
$(use_with ldap ldap "${EPREFIX}/usr")
$(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr")
)
fi
# MySQL support
local mysqllib="mysqlnd"
local mysqlilib="mysqlnd"
our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock"
if use mysql || use mysqli ; then
our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") )
fi
# ODBC support
our_conf+=(
$(use_with odbc unixODBC "${EPREFIX}/usr")
$(use_with iodbc iodbc "${EPREFIX}/usr")
)
# Oracle support
our_conf+=( $(use_with oci8-instant-client oci8) )
# PDO support
if use pdo ; then
our_conf+=(
$(use_with mssql pdo-dblib "${EPREFIX}/usr")
$(use_with mysql pdo-mysql "${mysqllib}")
$(use_with postgres pdo-pgsql)
$(use_with sqlite pdo-sqlite "${EPREFIX}/usr")
$(use_with firebird pdo-firebird "${EPREFIX}/usr")
$(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr")
$(use_with oci8-instant-client pdo-oci)
)
fi
# readline/libedit support
our_conf+=(
$(use_with readline readline "${EPREFIX}/usr")
$(use_with libedit libedit "${EPREFIX}/usr")
)
# Session support
if use session ; then
our_conf+=( $(use_with session-mm mm "${EPREFIX}/usr") )
else
our_conf+=( $(use_enable session session) )
fi
# Use pic for shared modules such as apache2's mod_php
our_conf+=( --with-pic )
# we use the system copy of pcre
# --with-pcre-regex affects ext/pcre
# --with-pcre-dir affects ext/filter and ext/zip
# --with-pcre-valgrind cannot be enabled with system pcre
# Many arches don't support pcre-jit
our_conf+=(
--with-pcre-regex="${EPREFIX}/usr"
--with-pcre-dir="${EPREFIX}/usr"
--without-pcre-valgrind
--without-pcre-jit
)
# Catch CFLAGS problems
# Fixes bug #14067.
# Changed order to run it in reverse for bug #32022 and #12021.
replace-cpu-flags "k6*" "i586"
# Cache the ./configure test results between SAPIs.
our_conf+=( --cache-file="${T}/config.cache" )
# Support user-passed configuration parameters
our_conf+=( ${EXTRA_ECONF:-} )
# Support the Apache2 extras, they must be set globally for all
# SAPIs to work correctly, especially for external PHP extensions
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
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=""
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 sapi="", 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"
;;
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}/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
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,748 +0,0 @@
# Copyright 1999-2018 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit flag-o-matic systemd autotools
DESCRIPTION="The PHP language runtime engine"
HOMEPAGE="https://secure.php.net/"
SRC_URI="https://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 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
# We can build the following SAPIs in the given order
SAPIS="embed cli cgi fpm apache2 phpdbg"
# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
IUSE="${IUSE}
${SAPIS/cli/+cli}
threads"
IUSE="${IUSE} acl argon2 bcmath berkdb bzip2 calendar cdb cjk
coverage +ctype curl debug
enchant exif +fileinfo +filter firebird
flatfile ftp gd gdbm gmp +hash +iconv imap inifile
intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl lmdb
mhash mssql mysql mysqli nls
oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
readline recode selinux +session session-mm sharedmem
+simplexml snmp soap sockets sodium spell sqlite ssl
sysvipc systemd test tidy +tokenizer tokyocabinet truetype unicode wddx webp
+xml xmlreader xmlwriter xmlrpc xpm xslt zip zip-encryption zlib"
# The supported (that is, autodetected) versions of BDB are listed in
# the ./configure script. Other versions *work*, but we need to stick to
# the ones that can be detected to avoid a repeat of bug #564824.
COMMON_DEPEND="
>=app-eselect/eselect-php-0.9.1[apache2?,fpm?]
>=dev-libs/libpcre-8.32[unicode]
fpm? ( acl? ( sys-apps/acl ) )
apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=]
<www-servers/apache-2.4[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 media-libs/libpng:0= sys-libs/zlib )
gdbm? ( >=sys-libs/gdbm-1.8.0:0= )
gmp? ( dev-libs/gmp:0= )
iconv? ( virtual/libiconv )
imap? ( virtual/imap-c-client[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? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) )
lmdb? ( dev-db/lmdb:= )
mssql? ( dev-db/freetds[mssql] )
nls? ( sys-devel/gettext )
oci8-instant-client? ( dev-db/oracle-instantclient-basic )
odbc? ( >=dev-db/unixODBC-1.8.13 )
postgres? ( dev-db/postgresql:* )
qdbm? ( dev-db/qdbm )
readline? ( sys-libs/readline:0= )
recode? ( app-text/recode )
session-mm? ( dev-libs/mm )
simplexml? ( >=dev-libs/libxml2-2.6.8 )
snmp? ( >=net-analyzer/net-snmp-5.2 )
soap? ( >=dev-libs/libxml2-2.6.8 )
sodium? ( dev-libs/libsodium:= )
spell? ( >=app-text/aspell-0.50 )
sqlite? ( >=dev-db/sqlite-3.7.6.3 )
ssl? (
!libressl? ( dev-libs/openssl:0= )
libressl? ( dev-libs/libressl:0= )
)
tidy? ( || ( app-text/tidy-html5 app-text/htmltidy ) )
tokyocabinet? ( dev-db/tokyocabinet )
truetype? ( =media-libs/freetype-2* )
unicode? ( dev-libs/oniguruma:= )
wddx? ( >=dev-libs/libxml2-2.6.8 )
webp? ( media-libs/libwebp:0= )
xml? ( >=dev-libs/libxml2-2.6.8 )
xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
xmlreader? ( >=dev-libs/libxml2-2.6.8 )
xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
xpm? ( x11-libs/libXpm )
xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
zip? ( sys-libs/zlib:0= )
zip-encryption? ( >=dev-libs/libzip-1.2.0:= )
zlib? ( sys-libs/zlib:0= )
"
RDEPEND="${COMMON_DEPEND}
virtual/mta
fpm? (
selinux? ( sec-policy/selinux-phpfpm )
systemd? ( sys-apps/systemd ) )"
# Bison isn't actually needed when building from a release tarball
# However, the configure script will warn if it's absent or if you
# have an incompatible version installed. See bug 593278.
DEPEND="${COMMON_DEPEND}
app-arch/xz-utils
>=sys-devel/bison-3.0.1"
# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
REQUIRED_USE="
|| ( cli cgi fpm apache2 embed phpdbg )
cli? ( ^^ ( readline libedit ) )
truetype? ( gd zlib )
webp? ( gd zlib )
cjk? ( gd zlib )
exif? ( gd zlib )
xpm? ( gd zlib )
gd? ( zlib )
simplexml? ( xml )
soap? ( xml )
wddx? ( xml )
xmlrpc? ( || ( xml iconv ) )
xmlreader? ( xml )
xslt? ( xml )
ldap-sasl? ( ldap )
mhash? ( hash )
phar? ( hash )
qdbm? ( !gdbm )
readline? ( !libedit )
recode? ( !imap !mysqli !mysql )
session-mm? ( session !threads )
mysql? ( hash || ( mysqli pdo ) )
mysqli? ( hash )
zip-encryption? ( zip )
"
PATCHES=(
"${FILESDIR}/php-freetype-2.9.1.patch"
"${FILESDIR}/php-7.1.25-intl-detect-icu-via-pkg-config.patch"
"${FILESDIR}/php-7.2.13-intl-use-icu-namespace.patch"
)
PHP_MV="$(ver_cut 1)"
php_install_ini() {
local phpsapi="${1}"
# work out where we are installing the ini file
php_set_ini_dir "${phpsapi}"
# Always install the production INI file, bug 611214.
local phpinisrc="php.ini-production-${phpsapi}"
cp php.ini-production "${phpinisrc}" || die
# default to /tmp for save_path, bug #282768
sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die
# Set the extension dir
sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \
-i "${phpinisrc}" || die
# Set the include path to point to where we want to find PEAR packages
sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die
dodir "${PHP_INI_DIR#${EPREFIX}}"
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 "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" \
"${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini"
fi
# SAPI-specific handling
if [[ "${sapi}" == "fpm" ]] ; then
einfo "Installing FPM config files php-fpm.conf and www.conf"
insinto "${PHP_INI_DIR#${EPREFIX}}"
doins sapi/fpm/php-fpm.conf
insinto "${PHP_INI_DIR#${EPREFIX}}/fpm.d"
doins sapi/fpm/www.conf
fi
dodoc php.ini-{development,production}
}
php_set_ini_dir() {
PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}"
PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
}
src_prepare() {
default
# In php-7.x, the FPM pool configuration files have been split off
# of the main config. By default the pool config files go in
# e.g. /etc/php-fpm.d, which isn't slotted. So here we move the
# include directory to a subdirectory "fpm.d" of $PHP_INI_DIR. Later
# we'll install the pool configuration file "www.conf" there.
php_set_ini_dir fpm
sed -i "s~^include=.*$~include=${PHP_INI_DIR}/fpm.d/*.conf~" \
sapi/fpm/php-fpm.conf.in \
|| die 'failed to move the include directory in php-fpm.conf'
# Bug 669566 - necessary so that build tools are updated for commands like pecl
# Force rebuilding aclocal.m4
rm -f aclocal.m4 || die "failed to remove aclocal.m4 in src_prepare"
eautoreconf
}
src_configure() {
addpredict /usr/share/snmp/mibs/.index #nowarn
addpredict /var/lib/net-snmp/mib_indexes #nowarn
PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
# The php-fpm config file wants localstatedir to be ${EPREFIX}/var
# and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002.
local our_conf=(
--prefix="${PHP_DESTDIR}"
--mandir="${PHP_DESTDIR}/man"
--infodir="${PHP_DESTDIR}/info"
--libdir="${PHP_DESTDIR}/lib"
--with-libdir="$(get_libdir)"
--localstatedir="${EPREFIX}/var"
--without-pear
$(use_enable threads maintainer-zts)
)
our_conf+=(
$(use_with argon2 password-argon2 "${EPREFIX}/usr")
$(use_enable bcmath bcmath)
$(use_with bzip2 bz2 "${EPREFIX}/usr")
$(use_enable calendar calendar)
$(use_enable coverage gcov)
$(use_enable ctype ctype)
$(use_with curl curl "${EPREFIX}/usr")
$(use_enable xml dom)
$(use_with enchant enchant "${EPREFIX}/usr")
$(use_enable exif exif)
$(use_enable fileinfo fileinfo)
$(use_enable filter filter)
$(use_enable ftp ftp)
$(use_with nls gettext "${EPREFIX}/usr")
$(use_with gmp gmp "${EPREFIX}/usr")
$(use_enable hash hash)
$(use_with mhash mhash "${EPREFIX}/usr")
$(use_with iconv iconv \
$(use elibc_glibc || use elibc_musl || use elibc_FreeBSD || echo "${EPREFIX}/usr"))
$(use_enable intl intl)
$(use_enable ipv6 ipv6)
$(use_enable json json)
$(use_with kerberos kerberos "${EPREFIX}/usr")
$(use_enable xml libxml)
$(use_with xml libxml-dir "${EPREFIX}/usr")
$(use_enable unicode mbstring)
$(use_with unicode onig "${EPREFIX}/usr")
$(use_with ssl openssl "${EPREFIX}/usr")
$(use_with ssl openssl-dir "${EPREFIX}/usr")
$(use_enable pcntl pcntl)
$(use_enable phar phar)
$(use_enable pdo pdo)
$(use_enable opcache opcache)
$(use_with postgres pgsql "${EPREFIX}/usr")
$(use_enable posix posix)
$(use_with spell pspell "${EPREFIX}/usr")
$(use_with recode recode "${EPREFIX}/usr")
$(use_enable simplexml simplexml)
$(use_enable sharedmem shmop)
$(use_with snmp snmp "${EPREFIX}/usr")
$(use_enable soap soap)
$(use_enable sockets sockets)
$(use_with sodium sodium "${EPREFIX}/usr")
$(use_with sqlite sqlite3 "${EPREFIX}/usr")
$(use_enable sysvipc sysvmsg)
$(use_enable sysvipc sysvsem)
$(use_enable sysvipc sysvshm)
$(use_with tidy tidy "${EPREFIX}/usr")
$(use_enable tokenizer tokenizer)
$(use_enable wddx wddx)
$(use_enable xml xml)
$(use_enable xmlreader xmlreader)
$(use_enable xmlwriter xmlwriter)
$(use_with xmlrpc xmlrpc)
$(use_with xslt xsl "${EPREFIX}/usr")
$(use_enable zip zip)
$(use_with zip-encryption libzip "${EPREFIX}/usr")
$(use_with zlib zlib "${EPREFIX}/usr")
$(use_enable debug debug)
)
# DBA support
if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
|| use qdbm || use lmdb || use tokyocabinet ; then
our_conf+=( "--enable-dba${shared}" )
fi
# DBA drivers support
our_conf+=(
$(use_with cdb cdb)
$(use_with berkdb db4 "${EPREFIX}/usr")
$(use_enable flatfile flatfile)
$(use_with gdbm gdbm "${EPREFIX}/usr")
$(use_enable inifile inifile)
$(use_with qdbm qdbm "${EPREFIX}/usr")
$(use_with lmdb lmdb "${EPREFIX}/usr")
)
# Support for the GD graphics library
our_conf+=(
$(use_with truetype freetype-dir "${EPREFIX}/usr")
$(use_enable cjk gd-jis-conv)
$(use_with gd jpeg-dir "${EPREFIX}/usr")
$(use_with gd png-dir "${EPREFIX}/usr")
$(use_with xpm xpm-dir "${EPREFIX}/usr")
)
if use webp; then
our_conf+=( --with-webp-dir="${EPREFIX}/usr" )
fi
# enable gd last, so configure can pick up the previous settings
our_conf+=( $(use_with gd gd) )
# IMAP support
if use imap ; then
our_conf+=(
$(use_with imap imap "${EPREFIX}/usr")
$(use_with ssl imap-ssl "${EPREFIX}/usr")
)
fi
# Interbase/firebird support
our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") )
# LDAP support
if use ldap ; then
our_conf+=(
$(use_with ldap ldap "${EPREFIX}/usr")
$(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr")
)
fi
# MySQL support
local mysqllib="mysqlnd"
local mysqlilib="mysqlnd"
our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock"
if use mysql || use mysqli ; then
our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") )
fi
# ODBC support
our_conf+=(
$(use_with odbc unixODBC "${EPREFIX}/usr")
$(use_with iodbc iodbc "${EPREFIX}/usr")
)
# Oracle support
our_conf+=( $(use_with oci8-instant-client oci8) )
# PDO support
if use pdo ; then
our_conf+=(
$(use_with mssql pdo-dblib "${EPREFIX}/usr")
$(use_with mysql pdo-mysql "${mysqllib}")
$(use_with postgres pdo-pgsql)
$(use_with sqlite pdo-sqlite "${EPREFIX}/usr")
$(use_with firebird pdo-firebird "${EPREFIX}/usr")
$(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr")
$(use_with oci8-instant-client pdo-oci)
)
fi
# readline/libedit support
our_conf+=(
$(use_with readline readline "${EPREFIX}/usr")
$(use_with libedit libedit "${EPREFIX}/usr")
)
# Session support
if use session ; then
our_conf+=( $(use_with session-mm mm "${EPREFIX}/usr") )
else
our_conf+=( $(use_enable session session) )
fi
# Use pic for shared modules such as apache2's mod_php
our_conf+=( --with-pic )
# we use the system copy of pcre
# --with-pcre-regex affects ext/pcre
# --with-pcre-dir affects ext/filter and ext/zip
# --with-pcre-valgrind cannot be enabled with system pcre
# Many arches don't support pcre-jit
our_conf+=(
--with-pcre-regex="${EPREFIX}/usr"
--with-pcre-dir="${EPREFIX}/usr"
--without-pcre-valgrind
--without-pcre-jit
)
# Catch CFLAGS problems
# Fixes bug #14067.
# Changed order to run it in reverse for bug #32022 and #12021.
replace-cpu-flags "k6*" "i586"
# Cache the ./configure test results between SAPIs.
our_conf+=( --cache-file="${T}/config.cache" )
# Support user-passed configuration parameters
our_conf+=( ${EXTRA_ECONF:-} )
# Support the Apache2 extras, they must be set globally for all
# SAPIs to work correctly, especially for external PHP extensions
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
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=""
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 sapi="", 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"
;;
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}/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
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,748 +0,0 @@
# Copyright 1999-2018 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
inherit flag-o-matic eapi7-ver systemd autotools
MY_PV=${PV/_rc/RC}
DESCRIPTION="The PHP language runtime engine"
HOMEPAGE="https://secure.php.net/"
SRC_URI="https://secure.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 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
S="${WORKDIR}/${PN}-${MY_PV}"
# We can build the following SAPIs in the given order
SAPIS="embed cli cgi fpm apache2 phpdbg"
# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
IUSE="${IUSE}
${SAPIS/cli/+cli}
threads"
IUSE="${IUSE} acl argon2 bcmath berkdb bzip2 calendar cdb cjk
coverage +ctype curl debug
enchant exif +fileinfo +filter firebird
flatfile ftp gd gdbm gmp +hash +iconv imap inifile
intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl lmdb
mhash mssql mysql mysqli nls
oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
readline recode selinux +session session-mm sharedmem
+simplexml snmp soap sockets sodium spell sqlite ssl
sysvipc systemd test tidy +tokenizer tokyocabinet truetype unicode wddx webp
+xml xmlreader xmlwriter xmlrpc xpm xslt zip zip-encryption zlib"
# The supported (that is, autodetected) versions of BDB are listed in
# the ./configure script. Other versions *work*, but we need to stick to
# the ones that can be detected to avoid a repeat of bug #564824.
COMMON_DEPEND="
>=app-eselect/eselect-php-0.9.1[apache2?,fpm?]
>=dev-libs/libpcre2-10.30[unicode]
fpm? ( acl? ( sys-apps/acl ) )
apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=]
<www-servers/apache-2.4[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 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[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? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) )
lmdb? ( dev-db/lmdb:= )
mssql? ( dev-db/freetds[mssql] )
nls? ( sys-devel/gettext )
oci8-instant-client? ( dev-db/oracle-instantclient-basic )
odbc? ( >=dev-db/unixODBC-1.8.13 )
postgres? ( dev-db/postgresql:* )
qdbm? ( dev-db/qdbm )
readline? ( sys-libs/readline:0= )
recode? ( app-text/recode )
session-mm? ( dev-libs/mm )
simplexml? ( >=dev-libs/libxml2-2.6.8 )
snmp? ( >=net-analyzer/net-snmp-5.2 )
soap? ( >=dev-libs/libxml2-2.6.8 )
sodium? ( dev-libs/libsodium:= )
spell? ( >=app-text/aspell-0.50 )
sqlite? ( >=dev-db/sqlite-3.7.6.3 )
ssl? (
!libressl? ( >=dev-libs/openssl-1.0.1:0= )
libressl? ( dev-libs/libressl:0= )
)
tidy? ( || ( app-text/tidy-html5 app-text/htmltidy ) )
tokyocabinet? ( dev-db/tokyocabinet )
truetype? ( =media-libs/freetype-2* )
unicode? ( dev-libs/oniguruma:= )
wddx? ( >=dev-libs/libxml2-2.6.8 )
webp? ( media-libs/libwebp:0= )
xml? ( >=dev-libs/libxml2-2.6.8 )
xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
xmlreader? ( >=dev-libs/libxml2-2.6.8 )
xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
xpm? ( x11-libs/libXpm )
xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
zip? ( >=sys-libs/zlib-1.2.0.4:0= )
zip-encryption? ( >=dev-libs/libzip-1.2.0:= )
zlib? ( >=sys-libs/zlib-1.2.0.4:0= )
"
RDEPEND="${COMMON_DEPEND}
virtual/mta
fpm? (
selinux? ( sec-policy/selinux-phpfpm )
systemd? ( sys-apps/systemd ) )"
# Bison isn't actually needed when building from a release tarball
# However, the configure script will warn if it's absent or if you
# have an incompatible version installed. See bug 593278.
DEPEND="${COMMON_DEPEND}
app-arch/xz-utils
>=sys-devel/bison-3.0.1"
# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
REQUIRED_USE="
|| ( cli cgi fpm apache2 embed phpdbg )
cli? ( ^^ ( readline libedit ) )
truetype? ( gd zlib )
webp? ( gd zlib )
cjk? ( gd zlib )
exif? ( gd zlib )
xpm? ( gd zlib )
gd? ( zlib )
simplexml? ( xml )
soap? ( xml )
wddx? ( xml )
xmlrpc? ( || ( xml iconv ) )
xmlreader? ( xml )
xslt? ( xml )
ldap-sasl? ( ldap )
mhash? ( hash )
phar? ( hash )
qdbm? ( !gdbm )
readline? ( !libedit )
recode? ( !imap !mysqli !mysql )
session-mm? ( session !threads )
mysql? ( || ( mysqli pdo ) )
zip-encryption? ( zip )
"
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
dodir "${PHP_INI_DIR#${EPREFIX}}"
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 "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" \
"${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini"
fi
# SAPI-specific handling
if [[ "${sapi}" == "fpm" ]] ; then
einfo "Installing FPM config files php-fpm.conf and www.conf"
insinto "${PHP_INI_DIR#${EPREFIX}}"
doins sapi/fpm/php-fpm.conf
insinto "${PHP_INI_DIR#${EPREFIX}}/fpm.d"
doins sapi/fpm/www.conf
fi
dodoc php.ini-{development,production}
}
php_set_ini_dir() {
PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}"
PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
}
src_prepare() {
default
# In php-7.x, the FPM pool configuration files have been split off
# of the main config. By default the pool config files go in
# e.g. /etc/php-fpm.d, which isn't slotted. So here we move the
# include directory to a subdirectory "fpm.d" of $PHP_INI_DIR. Later
# we'll install the pool configuration file "www.conf" there.
php_set_ini_dir fpm
sed -i "s~^include=.*$~include=${PHP_INI_DIR}/fpm.d/*.conf~" \
sapi/fpm/php-fpm.conf.in \
|| die 'failed to move the include directory in php-fpm.conf'
# Bug 669566 - necessary so that build tools are updated for commands like pecl
# Force rebuilding aclocal.m4
rm -f aclocal.m4 || die "failed to remove aclocal.m4 in src_prepare"
eautoreconf
}
src_configure() {
addpredict /usr/share/snmp/mibs/.index #nowarn
addpredict /var/lib/net-snmp/mib_indexes #nowarn
PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
# The php-fpm config file wants localstatedir to be ${EPREFIX}/var
# and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002.
local our_conf=(
--prefix="${PHP_DESTDIR}"
--mandir="${PHP_DESTDIR}/man"
--infodir="${PHP_DESTDIR}/info"
--libdir="${PHP_DESTDIR}/lib"
--with-libdir="$(get_libdir)"
--localstatedir="${EPREFIX}/var"
--without-pear
$(use_enable threads maintainer-zts)
)
our_conf+=(
$(use_with argon2 password-argon2 "${EPREFIX}/usr")
$(use_enable bcmath bcmath)
$(use_with bzip2 bz2 "${EPREFIX}/usr")
$(use_enable calendar calendar)
$(use_enable coverage gcov)
$(use_enable ctype ctype)
$(use_with curl curl "${EPREFIX}/usr")
$(use_enable xml dom)
$(use_with enchant enchant "${EPREFIX}/usr")
$(use_enable exif exif)
$(use_enable fileinfo fileinfo)
$(use_enable filter filter)
$(use_enable ftp ftp)
$(use_with nls gettext "${EPREFIX}/usr")
$(use_with gmp gmp "${EPREFIX}/usr")
$(use_enable hash hash)
$(use_with mhash mhash "${EPREFIX}/usr")
$(use_with iconv iconv \
$(use elibc_glibc || use elibc_musl || use elibc_FreeBSD || echo "${EPREFIX}/usr"))
$(use_enable intl intl)
$(use_enable ipv6 ipv6)
$(use_enable json json)
$(use_with kerberos kerberos "${EPREFIX}/usr")
$(use_enable xml libxml)
$(use_with xml libxml-dir "${EPREFIX}/usr")
$(use_enable unicode mbstring)
$(use_with unicode onig "${EPREFIX}/usr")
$(use_with ssl openssl "${EPREFIX}/usr")
$(use_with ssl openssl-dir "${EPREFIX}/usr")
$(use_enable pcntl pcntl)
$(use_enable phar phar)
$(use_enable pdo pdo)
$(use_enable opcache opcache)
$(use_with postgres pgsql "${EPREFIX}/usr")
$(use_enable posix posix)
$(use_with spell pspell "${EPREFIX}/usr")
$(use_with recode recode "${EPREFIX}/usr")
$(use_enable simplexml simplexml)
$(use_enable sharedmem shmop)
$(use_with snmp snmp "${EPREFIX}/usr")
$(use_enable soap soap)
$(use_enable sockets sockets)
$(use_with sodium sodium "${EPREFIX}/usr")
$(use_with sqlite sqlite3 "${EPREFIX}/usr")
$(use_enable sysvipc sysvmsg)
$(use_enable sysvipc sysvsem)
$(use_enable sysvipc sysvshm)
$(use_with tidy tidy "${EPREFIX}/usr")
$(use_enable tokenizer tokenizer)
$(use_enable wddx wddx)
$(use_enable xml xml)
$(use_enable xmlreader xmlreader)
$(use_enable xmlwriter xmlwriter)
$(use_with xmlrpc xmlrpc)
$(use_with xslt xsl "${EPREFIX}/usr")
$(use_enable zip zip)
$(use_with zip-encryption libzip "${EPREFIX}/usr")
$(use_with zlib zlib "${EPREFIX}/usr")
$(use_enable debug debug)
)
# DBA support
if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
|| use qdbm || use lmdb || use tokyocabinet ; then
our_conf+=( "--enable-dba${shared}" )
fi
# DBA drivers support
our_conf+=(
$(use_with cdb cdb)
$(use_with berkdb db4 "${EPREFIX}/usr")
$(use_enable flatfile flatfile)
$(use_with gdbm gdbm "${EPREFIX}/usr")
$(use_enable inifile inifile)
$(use_with qdbm qdbm "${EPREFIX}/usr")
$(use_with lmdb lmdb "${EPREFIX}/usr")
)
# Support for the GD graphics library
our_conf+=(
$(use_with truetype freetype-dir "${EPREFIX}/usr")
$(use_enable cjk gd-jis-conv)
$(use_with gd jpeg-dir "${EPREFIX}/usr")
$(use_with gd png-dir "${EPREFIX}/usr")
$(use_with xpm xpm-dir "${EPREFIX}/usr")
)
if use webp; then
our_conf+=( --with-webp-dir="${EPREFIX}/usr" )
fi
# enable gd last, so configure can pick up the previous settings
our_conf+=( $(use_with gd gd) )
# IMAP support
if use imap ; then
our_conf+=(
$(use_with imap imap "${EPREFIX}/usr")
$(use_with ssl imap-ssl "${EPREFIX}/usr")
)
fi
# Interbase/firebird support
our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") )
# LDAP support
if use ldap ; then
our_conf+=(
$(use_with ldap ldap "${EPREFIX}/usr")
$(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr")
)
fi
# MySQL support
local mysqllib="mysqlnd"
local mysqlilib="mysqlnd"
our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock"
if use mysql || use mysqli ; then
our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") )
fi
# ODBC support
our_conf+=(
$(use_with odbc unixODBC "${EPREFIX}/usr")
$(use_with iodbc iodbc "${EPREFIX}/usr")
)
# Oracle support
our_conf+=( $(use_with oci8-instant-client oci8) )
# PDO support
if use pdo ; then
our_conf+=(
$(use_with mssql pdo-dblib "${EPREFIX}/usr")
$(use_with mysql pdo-mysql "${mysqllib}")
$(use_with postgres pdo-pgsql)
$(use_with sqlite pdo-sqlite "${EPREFIX}/usr")
$(use_with firebird pdo-firebird "${EPREFIX}/usr")
$(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr")
$(use_with oci8-instant-client pdo-oci)
)
fi
# readline/libedit support
our_conf+=(
$(use_with readline readline "${EPREFIX}/usr")
$(use_with libedit libedit "${EPREFIX}/usr")
)
# Session support
if use session ; then
our_conf+=( $(use_with session-mm mm "${EPREFIX}/usr") )
else
our_conf+=( $(use_enable session session) )
fi
# Use pic for shared modules such as apache2's mod_php
our_conf+=( --with-pic )
# we use the system copy of pcre
# --with-pcre-regex affects ext/pcre
# --with-pcre-dir affects ext/filter and ext/zip
# --with-pcre-valgrind cannot be enabled with system pcre
# Many arches don't support pcre-jit
our_conf+=(
--with-pcre-regex="${EPREFIX}/usr"
--with-pcre-dir="${EPREFIX}/usr"
--without-pcre-valgrind
--without-pcre-jit
)
# Catch CFLAGS problems
# Fixes bug #14067.
# Changed order to run it in reverse for bug #32022 and #12021.
replace-cpu-flags "k6*" "i586"
# Cache the ./configure test results between SAPIs.
our_conf+=( --cache-file="${T}/config.cache" )
# Support user-passed configuration parameters
our_conf+=( ${EXTRA_ECONF:-} )
# Support the Apache2 extras, they must be set globally for all
# SAPIs to work correctly, especially for external PHP extensions
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
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=""
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 sapi="", 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"
;;
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}/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
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
}

@ -6,3 +6,4 @@ DIST swipl-7.6.3.tar.gz 16772590 BLAKE2B 644be801e290ec9d949a9b7462256a35e11cf9a
DIST swipl-7.6.4.tar.gz 16777875 BLAKE2B 94409966362e649f4748b94b4ec25415bb827c7742aa39453d8e37db4ce992a65ad2d054ded4e651f2a9abe3a9438285bc9c9c895437c087ae6cf88f4afae9ca SHA512 f0ed16e4f1436115651c38a0bb37008d0dadad5a19b0f09894fcfc51dd3d429f86488e89cce00788c3c36cc2f0cd2957f92df47d5441133a6f8ea9d91ca5470f
DIST swipl-7.7.22.tar.gz 10408402 BLAKE2B e804190a07ad000f054f05bda6c895cae7aa588d6e31a86f17bf2ae4934d747939023035ac8a1b758e5d8e82a39f4a493d19fa41ee323a91333903b7ccb1b78b SHA512 bce8fa4bda39c8841533b4b8d98520b04df3272d8fe49924a49d5c6b7c66ab2defe5d121b1c7fb83506842645258ab6925a1c18740322f468c08e19374f67bfb
DIST swipl-7.7.23.tar.gz 10422411 BLAKE2B 88a28d290070524d9f552e9d816f70723ac3ceb20dd8ae14e2f894188de024c89157ab68cb692b3a56839580047ebea92f4b6c3c39694b0b0077fd5c4616b30d SHA512 38430827c7f1fd151b448b0c71cd53a59681dfd04b97b8f71c3fcb6d4f86d261f46c3e76d4ebb52e987b665a7505ab5ee1d8528613f9b6bf319d177deb09d28f
DIST swipl-7.7.24.tar.gz 10433121 BLAKE2B 25efe95c11000fa19ff66ff52ecede8d4fb24c99a4405e1e16313e66947d61f64d572ec1d54017542ea9999258115f647a77a9d7871495b47d6ab3873c2d3f61 SHA512 24c2ffbe7ef9906451490f4b7cfec6afa969a59d265479b659e4287e30c4d00aa977cf55dbe81e560812f517b1270657a360bd917f94660ff2a05fb52efa4cbf

@ -0,0 +1,98 @@
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
inherit cmake-utils eutils flag-o-matic multilib
PATCHSET_VER="0"
DESCRIPTION="versatile implementation of the Prolog programming language"
HOMEPAGE="http://www.swi-prolog.org/"
SRC_URI="http://www.swi-prolog.org/download/devel/src/swipl-${PV}.tar.gz"
LICENSE="BSD-2"
SLOT="0"
KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
IUSE="archive berkdb debug doc +gmp java +libedit libressl minimal odbc pcre qt5 readline ssl test uuid X yaml"
RDEPEND="sys-libs/ncurses:=
sys-libs/zlib
archive? ( app-arch/libarchive )
berkdb? ( >=sys-libs/db-4:= )
odbc? ( dev-db/unixODBC )
pcre? ( dev-libs/libpcre )
readline? ( sys-libs/readline:= )
libedit? ( dev-libs/libedit )
gmp? ( dev-libs/gmp:0 )
ssl? (
!libressl? ( dev-libs/openssl:0 )
libressl? ( dev-libs/libressl )
)
java? ( >=virtual/jdk-1.7:= )
uuid? ( dev-libs/ossp-uuid )
qt5? (
dev-qt/qtwidgets:5
dev-qt/qtgui:5
)
X? (
virtual/jpeg:0
x11-libs/libX11
x11-libs/libXft
x11-libs/libXpm
x11-libs/libXt
x11-libs/libICE
x11-libs/libSM )
yaml? ( dev-libs/libyaml )"
DEPEND="${RDEPEND}
X? ( x11-base/xorg-proto )
java? ( test? ( =dev-java/junit-3.8* ) )"
S="${WORKDIR}/swipl-${PV}"
BUILD_DIR="${S}/build"
CMAKE_USE_DIR="${S}"
src_prepare() {
EPATCH_FORCE=yes
EPATCH_SUFFIX=patch
if [[ -d "${WORKDIR}"/${PV} ]] ; then
epatch "${WORKDIR}"/${PV}
fi
sed -i -e "s|\(SWIPL_INSTALL_PREFIX\) lib/.*)|\1 $(get_libdir)/swipl)|" CMakeLists.txt || die
eapply_user
cmake-utils_src_prepare
}
src_configure() {
append-flags -fno-strict-aliasing
use debug && append-flags -DO_DEBUG
mycmakeargs=(
-DSWIPL_INSTALL_PREFIX=$(get_libdir)/swipl
-DUSE_GMP=$(usex gmp)
-DINSTALL_DOCUMENTATION=$(usex doc)
-DSWIPL_PACKAGES_BASIC=$(usex !minimal)
-DSWIPL_PACKAGES_ARCHIVE=$(usex archive)
-DSWIPL_PACKAGES_ODBC=$(usex odbc)
-DSWIPL_PACKAGES_BDB=$(usex berkdb)
-DSWIPL_PACKAGES_PCRE=$(usex pcre)
-DSWIPL_PACKAGES_YAML=$(usex yaml)
-DSWIPL_PACKAGES_SSL=$(usex ssl)
-DSWIPL_PACKAGES_JAVA=$(usex java)
-DSWIPL_PACKAGES_QT=$(usex qt5)
-DSWIPL_PACKAGES_X=$(usex X)
-DSWIPL_PACKAGES_TERM=$(if use libedit || use readline; then echo yes; else echo no; fi)
)
cmake-utils_src_configure
}
src_test() {
USE_PUBLIC_NETWORK_TESTS=false \
USE_ODBC_TESTS=false \
cmake-utils_src_test -V
}

Binary file not shown.

@ -1,2 +1,3 @@
DIST libsecp256k1-v0.0.0_pre20161213.tgz 147557 BLAKE2B 078cb90c078722e2eb3b5645f9692d737c99ebfe04db5a96dcfb57bb750b31c009cd3ae46f793bb1789239be9689f6e695a5b03477eecea84f2c657d0cc7442c SHA512 f4d16fae972364fd04bfcfbaca1edde4410a7367a936f76c1e93b85ac3c9c45da58785f604a4fc14cdfb4d7a23395d2d274957ad83118e15a236dfff0d0f57dd
DIST libsecp256k1-v0.1_pre20170928.tgz 150935 BLAKE2B f8b3408a33f36186c07cf931a8183a7a241e6418a846f4c3b248cf87e7a8b33a5a92368aa30310efadb066792eebead7fb48b4f4d902e7c8e9b4209717d7b8c0 SHA512 f480c76ba04b3d731c65227e156eb726b27da92f5dcfbd9b0a34c62e97f9b6dfd5c3fae3180b59244d0c9845fdf624b05f29e097f3ac0032ab15cebc4bf00660
DIST secp256k1-v0.0.0_pre20151118.tgz 125884 BLAKE2B 7a4fc950006138d04d8d3da35db24be0c568e25202c16f34f94555fde1297fba839fd114a003b5510693de3386de22166c6f1294726fe381ae5b565cb9866a75 SHA512 3cc0a4973acf7936a7c6dc0abc37ee43ecd69e835069ed40765595d36ca597b43837b5d6f90499455599de03abfc775d7c9d019d26216b79b03dd6dc53a73e19

@ -0,0 +1,70 @@
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit autotools eutils
MyPN=secp256k1
DESCRIPTION="Optimized C library for EC operations on curve secp256k1"
HOMEPAGE="https://github.com/bitcoin-core/${MyPN}"
COMMITHASH="7a78f60598a6aeb635ef227ead50fb44a209c363"
SRC_URI="https://github.com/bitcoin-core/${MyPN}/archive/${COMMITHASH}.tar.gz -> ${PN}-v${PV}.tgz"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~arm ~arm64 ~mips ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux"
IUSE="+asm ecdh endomorphism experimental gmp java +recovery test test_openssl"
REQUIRED_USE="
asm? ( || ( amd64 arm ) arm? ( experimental ) )
ecdh? ( experimental )
java? ( ecdh )
test_openssl? ( test )
"
RDEPEND="
gmp? ( dev-libs/gmp:0= )
"
DEPEND="${RDEPEND}
virtual/pkgconfig
java? ( virtual/jdk )
test_openssl? ( dev-libs/openssl:0 )
"
S="${WORKDIR}/${MyPN}-${COMMITHASH}"
src_prepare() {
default
eautoreconf
}
src_configure() {
local asm_opt
if use asm; then
if use arm; then
asm_opt=arm
else
asm_opt=auto
fi
else
asm_opt=no
fi
econf \
--disable-benchmark \
$(use_enable experimental) \
$(use_enable java jni) \
$(use_enable test tests) \
$(use_enable test_openssl openssl-tests) \
$(use_enable ecdh module-ecdh) \
$(use_enable endomorphism) \
--with-asm=$asm_opt \
--with-bignum=$(usex gmp gmp no) \
$(use_enable recovery module-recovery) \
--disable-static
}
src_install() {
dodoc README.md
emake DESTDIR="${D}" install
find "${D}" -name '*.la' -delete || die
}

@ -1,4 +1,4 @@
# Copyright 1999-2018 Gentoo Authors
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
@ -13,7 +13,7 @@ SRC_URI="https://archive.mozilla.org/pub/nspr/releases/v${PV}/src/${P}.tar.gz"
LICENSE="|| ( MPL-2.0 GPL-2 LGPL-2.1 )"
SLOT="0"
KEYWORDS="alpha amd64 ~arm ~arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x64-macos ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
KEYWORDS="alpha amd64 ~arm arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x64-macos ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
IUSE="debug"
MULTILIB_CHOST_TOOLS=(

@ -1,4 +1,4 @@
# Copyright 1999-2018 Gentoo Authors
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
@ -19,7 +19,7 @@ SRC_URI="https://archive.mozilla.org/pub/security/nss/releases/${RTM_NAME}/src/$
LICENSE="|| ( MPL-2.0 GPL-2 LGPL-2.1 )"
SLOT="0"
KEYWORDS="alpha amd64 ~arm ~arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
KEYWORDS="alpha amd64 ~arm arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
IUSE="cacert +nss-pem utils"
CDEPEND=">=dev-db/sqlite-3.8.2[${MULTILIB_USEDEP}]
>=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}]"

@ -13,7 +13,7 @@ if [[ ${PV} == *9999 ]] ; then
inherit git-r3
else
SRC_URI="https://codeload.github.com/jgarzik/${PN}/tar.gz/v${PV} -> ${P}.tar.gz"
KEYWORDS="~amd64 ~arm ~arm64 ~mips ~ppc ~x86 ~amd64-linux ~x86-linux"
KEYWORDS="~amd64 ~arm ~arm64 ~mips ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux"
fi
LICENSE="MIT"

@ -9,7 +9,7 @@ inherit perl-module
DESCRIPTION="Walk Perl syntax tree, printing debug info about ops"
SLOT="0"
KEYWORDS="~amd64 ~x86"
KEYWORDS="~amd64 ~arm64 ~x86"
IUSE="test minimal"
PERL_RM_FILES=(

@ -9,7 +9,7 @@ inherit perl-module
DESCRIPTION="Friendlier flags for B"
SLOT="0"
KEYWORDS="~amd64 ~x86"
KEYWORDS="~amd64 ~arm64 ~x86"
IUSE="test"
RDEPEND=""

@ -1,4 +1,4 @@
# Copyright 1999-2018 Gentoo Authors
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
@ -10,7 +10,7 @@ inherit perl-module
DESCRIPTION="cPanel fork of JSON::XS, fast and correct serializing"
SLOT="0"
KEYWORDS="~alpha amd64 ~arm hppa ia64 ~mips ~ppc ~ppc64 s390 sparc x86 ~ppc-aix ~amd64-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
KEYWORDS="~alpha amd64 ~arm ~arm64 hppa ia64 ~mips ~ppc ~ppc64 s390 sparc x86 ~ppc-aix ~amd64-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
IUSE="test"
RDEPEND=""

@ -1,4 +1,4 @@
# Copyright 1999-2018 Gentoo Foundation
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
@ -27,6 +27,10 @@ DEPEND="${RDEPEND}
)
"
src_test() {
if [[ $(makeopts_jobs) -gt 70 ]]; then
einfo "Reducing jobs to 70. Bug: https://bugs.gentoo.org/675164"
MAKEOPTS="${MAKEOPTS} -j70";
fi
perl_rm_files t/pod-coverage.t t/pod.t
perl-module_src_test
}

Binary file not shown.

@ -1,4 +1,4 @@
# Copyright 1999-2018 Gentoo Authors
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
@ -11,7 +11,7 @@ inherit perl-module
DESCRIPTION="Internationalizing Domain Names in Applications (IDNA)"
SLOT="0"
KEYWORDS="~alpha amd64 ~ia64 ~mips ppc ~ppc64 ~sparc x86 ~ppc-aix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
KEYWORDS="~alpha amd64 ~arm64 ~ia64 ~mips ppc ~ppc64 ~sparc x86 ~ppc-aix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
IUSE="test"
RDEPEND="

@ -1,4 +1,4 @@
# Copyright 1999-2018 Gentoo Authors
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=5
@ -10,7 +10,7 @@ inherit perl-module
DESCRIPTION="Perl bindings for GNU Libidn"
SLOT="0"
KEYWORDS="alpha amd64 arm hppa ia64 ~m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
IUSE=""
DEPEND="net-dns/libidn"

Binary file not shown.

@ -1 +1,2 @@
DIST html5-parser-0.4.4.tar.gz 267787 BLAKE2B 9fcaec9faa906914d43f2b19381fe3095d4cd009bfb534537d2eabb420195276b3690d760c1defc92ad00e4965b3eb34ce4700d54f4f0291dff88026d890c90d SHA512 3aaeb32f360d2c131ecbe11fa1dcd3dfcd62c9ca046fce7dd4ff8127d0e62216f666e83bb20c7809c6adc591e1fb2798e382e78a1cf6129b1f0a09a71377f8d4
DIST html5-parser-0.4.5.tar.gz 275587 BLAKE2B e26db3b6c55d43e26eb08076c59012814c2dd8739d6cba591e34cf8e304aa78bdf3440405668875acece2c21425f26ed9a0edbc5bb1da55da09c17eb52fa74aa SHA512 3c0421dd228ba5f3544f188fde5391d6be0fe92b879cf1e7697b5e5612a9e5bf08863bcb76f4297a59bfbfc69010a95f5d97fff78a7e6d26c889e173b07e4ae5

@ -0,0 +1,36 @@
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=7
PYTHON_COMPAT=( python2_7 python3_{4,5,6} )
inherit distutils-r1 toolchain-funcs
DESCRIPTION="Fast C based HTML 5 parsing for python"
HOMEPAGE="https://github.com/kovidgoyal/html5-parser/"
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz -> ${P}.tar.gz"
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~amd64 ~arm ~x86"
IUSE=""
BDEPEND="dev-python/setuptools[${PYTHON_USEDEP}]"
DEPEND="dev-libs/libxml2:="
RDEPEND="${DEPEND}
dev-python/chardet[${PYTHON_USEDEP}]
>=dev-python/lxml-3.8.0[${PYTHON_USEDEP}]"
src_prepare() {
# Soup is not used when lxml is available.
rm test/soup.py || die
distutils-r1_src_prepare
}
src_configure() {
export PKGCONFIG_EXE=$(tc-getPKG_CONFIG)
}
python_test() {
esetup.py test || die "Tests failed under ${EPYTHON}"
}

@ -2,3 +2,4 @@ DIST setuptools_scm-1.15.6.tar.gz 25779 BLAKE2B 01d6771c24015f072a46ff1429b96413
DIST setuptools_scm-1.15.7.tar.gz 15426 BLAKE2B 6c23f2bd74f51ec8633a814ce22e63e5afb9953244659833a61e810c9029227e1cc25a067a59cec5666add76863070ae5b7dc2600953a45def886e52378a3399 SHA512 0aa6056c03fe100cdaa7b11c9d2073431bb5c3904a80a994a8263c0ccac81f7a2c0b6c7e6dfd09ad605c5ff0e86981b894b42920cb69d1ef1d43ea08b2ddd4a0
DIST setuptools_scm-1.16.1.tar.gz 28956 BLAKE2B 6721830e9ef171768afb94e6d6aacb829665658599409880e87c58e1bf2c6366d04a666ff60ed5d689bf376c258eda93367a4c52fe28ec694a3a93ac109db1fb SHA512 fd5017648c4a8af696e8528eab37061776e8495e2de3640f726e5e4347836eca5a13cbe54fc0c2223c3ae80ede1a81a6f3d9c0910a417545b9f9f206e5177a13
DIST setuptools_scm-2.1.0.tar.gz 32776 BLAKE2B 7a141f3fa826a82931b6c33afd19d3185f98b735451c03651b875051e514eab287b20ee382a9576841b6f1283b9d1bf3dcbd0aabc41d2f1143cf960b856c8492 SHA512 69ce171aa4d3b576883efffb350c59f38bfe8b35bd8e4e8fa1128d9f8a3e6cfaab832633e91fada36126f8e7e2c18663fad621d62c9834be1b5d36c58ae1d1c8
DIST setuptools_scm-3.1.0.tar.gz 35585 BLAKE2B 7ecbdf325467cb3e5217150c548b99603e1bb851a3bc8c694acf3aeb0da798ec853d13b29ad0537bdf5c1010834576786e0dde3965d61991554a12cf206ba7e0 SHA512 bd84bb02900ddc7de2f02dd7cb62bafdea7040ebdc2506b72d05f2c6a6d16be903321e576f63a04f2aa13d8c75b1834dec7d9ea8444e8330281f8e586a3d6426

@ -0,0 +1,105 @@
diff --git a/src/setuptools_scm/hg.py b/src/setuptools_scm/hg.py
index 972f493..8fedd68 100644
--- a/src/setuptools_scm/hg.py
+++ b/src/setuptools_scm/hg.py
@@ -13,7 +13,7 @@ def _hg_tagdist_normalize_tagcommit(config, tag, dist, node, branch):
"(branch(.)" # look for revisions in this branch only
" and tag({tag!r})::." # after the last tag
# ignore commits that only modify .hgtags and nothing else:
- " and (merge() or file('re:^(?!\.hgtags).*$'))"
+ " and (merge() or file('re:^(?!\\.hgtags).*$'))"
" and not tag({tag!r}))" # ignore the tagged commit itself
).format(
tag=tag
@@ -70,7 +70,9 @@ def parse(root, config=None):
def get_latest_normalizable_tag(root):
# Gets all tags containing a '.' (see #229) from oldest to newest
- cmd = ["hg", "log", "-r", "ancestors(.) and tag('re:\.')", "--template", "{tags}\n"]
+ cmd = [
+ "hg", "log", "-r", "ancestors(.) and tag('re:\\.')", "--template", "{tags}\n"
+ ]
outlines = do(cmd, root).split()
if not outlines:
return "null"
diff --git a/testing/test_functions.py b/testing/test_functions.py
index 14d8961..c3d78b6 100644
--- a/testing/test_functions.py
+++ b/testing/test_functions.py
@@ -8,6 +8,8 @@ from setuptools_scm.version import (
format_version,
tag_to_version,
)
+
+from setuptools_scm.config import Configuration
from setuptools_scm.utils import has_command
PY3 = sys.version_info > (2,)
@@ -33,12 +35,14 @@ def test_next_tag(tag, expected):
assert guess_next_version(version) == expected
+c = Configuration()
+
VERSIONS = {
- "exact": meta("1.1", distance=None, dirty=False),
- "zerodistance": meta("1.1", distance=0, dirty=False),
- "dirty": meta("1.1", distance=None, dirty=True),
- "distance": meta("1.1", distance=3, dirty=False),
- "distancedirty": meta("1.1", distance=3, dirty=True),
+ "exact": meta("1.1", distance=None, dirty=False, config=c),
+ "zerodistance": meta("1.1", distance=0, dirty=False, config=c),
+ "dirty": meta("1.1", distance=None, dirty=True, config=c),
+ "distance": meta("1.1", distance=3, dirty=False, config=c),
+ "distancedirty": meta("1.1", distance=3, dirty=True, config=c),
}
diff --git a/testing/test_version.py b/testing/test_version.py
index be940ef..a287a0d 100644
--- a/testing/test_version.py
+++ b/testing/test_version.py
@@ -3,33 +3,36 @@ from setuptools_scm.config import Configuration
from setuptools_scm.version import meta, simplified_semver_version, tags_to_versions
+c = Configuration()
+
+
@pytest.mark.parametrize(
"version, expected_next",
[
- pytest.param(meta("1.0.0"), "1.0.0", id="exact"),
- pytest.param(meta("1.0"), "1.0.0", id="short_tag"),
+ pytest.param(meta("1.0.0", config=c), "1.0.0", id="exact"),
+ pytest.param(meta("1.0", config=c), "1.0.0", id="short_tag"),
pytest.param(
- meta("1.0.0", distance=2, branch="default"),
+ meta("1.0.0", distance=2, branch="default", config=c),
"1.0.1.dev2",
id="normal_branch",
),
pytest.param(
- meta("1.0", distance=2, branch="default"),
+ meta("1.0", distance=2, branch="default", config=c),
"1.0.1.dev2",
id="normal_branch_short_tag",
),
pytest.param(
- meta("1.0.0", distance=2, branch="feature"),
+ meta("1.0.0", distance=2, branch="feature", config=c),
"1.1.0.dev2",
id="feature_branch",
),
pytest.param(
- meta("1.0", distance=2, branch="feature"),
+ meta("1.0", distance=2, branch="feature", config=c),
"1.1.0.dev2",
id="feature_branch_short_tag",
),
pytest.param(
- meta("1.0.0", distance=2, branch="features/test"),
+ meta("1.0.0", distance=2, branch="features/test", config=c),
"1.1.0.dev2",
id="feature_in_branch",
),

@ -0,0 +1,43 @@
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
PYTHON_COMPAT=( python2_7 python3_{4,5,6,7} pypy pypy3 )
inherit distutils-r1
DESCRIPTION="package to manage versions by scm tags via setuptools"
HOMEPAGE="https://github.com/pypa/setuptools_scm https://pypi.org/project/setuptools_scm/"
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~amd64-linux ~x86-linux ~x64-macos ~x86-macos"
IUSE="test"
RESTRICT="!test? ( test )"
DEPEND="
dev-python/setuptools[${PYTHON_USEDEP}]
test? (
dev-python/pytest[${PYTHON_USEDEP}]
dev-vcs/git
dev-vcs/mercurial )"
python_prepare_all() {
local PATCHES=(
"${FILESDIR}"/setuptools_scm-3.1.0-test-failures.patch
)
# network access
sed -i -e 's:test_pip_download:_&:' testing/test_regressions.py || die
# all fetch specific setuptools versions
rm testing/test_setuptools_support.py || die
distutils-r1_python_prepare_all
}
python_test() {
distutils_install_for_testing
py.test -v -v -x || die "Tests fail with ${EPYTHON}"
}

Binary file not shown.

@ -1,8 +1,8 @@
# Copyright 1999-2018 Gentoo Foundation
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=5
USE_RUBY="ruby22 ruby23 ruby24 ruby25"
USE_RUBY="ruby23 ruby24 ruby25 ruby26"
RUBY_FAKEGEM_TASK_TEST=""
RUBY_FAKEGEM_TASK_DOC=""

@ -1,8 +1,8 @@
# Copyright 1999-2018 Gentoo Foundation
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=5
USE_RUBY="ruby22 ruby23 ruby24 ruby25"
USE_RUBY="ruby23 ruby24 ruby25 ruby26"
RUBY_FAKEGEM_TASK_TEST=""
RUBY_FAKEGEM_TASK_DOC=""

@ -1,8 +1,8 @@
# Copyright 1999-2018 Gentoo Foundation
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=5
USE_RUBY="ruby22 ruby23 ruby24 ruby25"
USE_RUBY="ruby23 ruby24 ruby25 ruby26"
RUBY_FAKEGEM_TASK_TEST=""
RUBY_FAKEGEM_TASK_DOC=""

@ -1,9 +1,9 @@
# Copyright 1999-2018 Gentoo Foundation
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
USE_RUBY="ruby22 ruby23 ruby24 ruby25"
USE_RUBY="ruby23 ruby24 ruby25 ruby26"
RUBY_FAKEGEM_RECIPE_TEST="rspec3"
RUBY_FAKEGEM_EXTRADOC="CHANGES.md README.md"

@ -1,3 +1,4 @@
DIST curses-1.2.4.gem 35328 BLAKE2B ba84d733a663c27a89be200b95c1e7a72063389190b2f90f0fc1b3a2af60025d926c348a08116734b15c2d494a4431c6e2be78e1f5982c03ee13d69bf7edb96e SHA512 bece3833be353ef8db51717dcdbf060667be5d33d00ce78952c44b3a8c3df082c11649b0a2a30072ce99c6578ffde7dce0c0108e109e55022703cfa1c1861bb9
DIST curses-1.2.5.gem 35840 BLAKE2B 4c45f0ff81b4e4a6e9a305567b57536ae89cd3ced400066b27530461e91f1d1d4e4c30ebb5af67137a831c38bc6bad8f56e86c647abe246a189102f9e6649933 SHA512 eb1d56ecb8f1d55488a9a46d66193efaed1f85c16d0bfe43102d12f6b2e6e8ffe10f1c714d74f31cef4bac1158790764f5da9ca4b60740d3c7a2d2135f1536e4
DIST curses-1.2.6.gem 38912 BLAKE2B 599233b8e9a80056ed404704ba81b671fc11ee997a5e1235e655d1f957fedbc6fe6e38a0463a5141ecac0cbd071d5c0ac02b1db2fab98ab0967c846ca54c2a67 SHA512 dbf3fe0b0567f35de5dd61c61e9d149038fddf4d79ac3a45c3fd7e5c0878ed74de6e31b24ecf625c0c03b2ae79b7b05fe418f63ce1064e270806648a0a9453af
DIST curses-1.2.7.gem 38912 BLAKE2B 8cf1b908aea6f2f0edccd26f4aa240d31ef7e0cce533e75d8ddb90e021672e73426f826373418e4a5e5348204833898143b8a6923e28c23e2362be8e64c78f25 SHA512 258fd46104fecf68c0a4f2ea6c7755ba6b0abcd1faf3853209b4587ee8694228611ba1194de5b05b3e8607503223bc675bbeb19677382b2ef630b4d0882cd32c

@ -0,0 +1,33 @@
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
USE_RUBY="ruby23 ruby24 ruby25 ruby26"
RUBY_FAKEGEM_RECIPE_DOC="rdoc"
RUBY_FAKEGEM_EXTRADOC="README.md"
RUBY_FAKEGEM_RECIPE_TEST="none"
inherit ruby-fakegem
DESCRIPTION="Ruby binding for curses, ncurses, and PDCurses"
HOMEPAGE="https://github.com/ruby/curses"
LICENSE="|| ( Ruby BSD-2 )"
KEYWORDS="~amd64 ~x86"
SLOT="1"
IUSE=""
DEPEND+=" sys-libs/ncurses:0"
RDEPEND+=" sys-libs/ncurses:0"
each_ruby_configure() {
${RUBY} -Cext/curses extconf.rb || die
}
each_ruby_compile() {
emake V=1 -Cext/curses
cp ext/curses/curses.so lib/ || die
}

@ -1,3 +1,4 @@
DIST dbf-3.1.1.gem 126976 BLAKE2B 449b70abaa0bdcdf579ee78facbac46d2f97fb99e983b99ef7487c6a78f5d6f8f1c5257e1a490a169b8cb8e9581fb56827d86844d2d2ee9bc0b3326998206f6e SHA512 88aedb43858702ef2f24a2a751ceaeceba7d75ad58a6abdb314219cbb83551165aa7a1973a68e6b4c0da87c9f35c80b2e0650b25f570a76821bbdccb3dbaafb5
DIST dbf-3.1.2.gem 127488 BLAKE2B c71089220f7b2d57b99ab27881c5f094a753c1a7c5378074f18d4a9fccba26d4ac7e8e563b84c0556aa50db7f39d03697957c10e6528ddaed8bef812cac662f5 SHA512 1e9c809cc03d4ecadaadd5cc754e4fa85961cf675465f950cda1c084e80c32e0a62223494f76b4ba8e26cde61eea8e43414d1b03c95fd36e8994222c3ffcab11
DIST dbf-3.1.3.gem 127488 BLAKE2B 6c75d901b0d694266cfe2441567bf5684e5845a95b3c68eaf7bcbd5bc7b9b4748412740d8afce1015d5a84b26fcc30656a7f6dfc57c8a11055ac657b28cd034d SHA512 222957472dede8cfee42971ad9e7de4a08a7fb0ed017930027d4203da75298ce4eb9d222b841c4b051cf54c772b9799b2ee78cd5308452672142303bdf60c9f9
DIST dbf-4.0.1.gem 127488 BLAKE2B 60fbd21d8a5caf14480ccf03aaf9ae6b9917d8537b3437a6831c4e69f878fc17a8ac70344dbfb9a459aca88f0000ec7ea89110dd489a802079bd8171f36f36c8 SHA512 cc678bfc7faf1e24b35053a77e91f203228a715a357d0c8e075998be27f19f2db2e6aa9e51d700842e81ca47f9ac5ab68cde1241e59d951ba82a1a7a020d0d0d

@ -0,0 +1,22 @@
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
USE_RUBY="ruby24 ruby25 ruby26"
RUBY_FAKEGEM_RECIPE_TEST="rspec3"
RUBY_FAKEGEM_RECIPE_DOC="rdoc"
RUBY_FAKEGEM_EXTRADOC="CHANGELOG.md README.md docs/*"
inherit ruby-fakegem
DESCRIPTION="a small fast library for reading dBase, xBase, Clipper and FoxPro
database files"
HOMEPAGE="https://github.com/infused/dbf"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""

@ -1,9 +1,9 @@
# Copyright 1999-2018 Gentoo Foundation
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=5
USE_RUBY="ruby22 ruby23 ruby24 ruby25"
USE_RUBY="ruby23 ruby24 ruby25 ruby26"
RUBY_FAKEGEM_TASK_DOC=""
RUBY_FAKEGEM_TASK_TEST=""

@ -1 +1,2 @@
DIST ethon-0.11.0.gem 56832 BLAKE2B 64f184e3dbedf6fc05cb97d7e642366b45b9493ccd79ba1dd9f4ddafea695bc8d5e72bc5a305e192ad6f78d55704319316a13ced61c14aef7d3e41936ec69a78 SHA512 271ff2ce5578352722bab318ad40f06d9c76fdbdead573a015fed0a38f3fd6341bcf70acedaa9470fe97f47069977b09ac9f71d8dacb21b67aad917c2a078c72
DIST ethon-0.12.0.gem 56832 BLAKE2B 04765dcb9599e7435c3f71b1e8c35b815123ec460dbb761360146b24acaff1aeb52a75efe5dbbacdbd11e7247743988629ce965604cdfd15cdd75ef03301d9da SHA512 5fea666efdd5e2d568d0e074f205525656e202ecea3bb5ff8a8ab838a596cab349b869baffb7926227d6cfdae5b9c1cb86bb201b4c9585056c6671ab4feee596

@ -0,0 +1,33 @@
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
USE_RUBY="ruby23 ruby24 ruby25"
RUBY_FAKEGEM_TASK_DOC=""
RUBY_FAKEGEM_EXTRADOC="CHANGELOG.md README.md"
RUBY_FAKEGEM_RECIPE_TEST="rspec3"
inherit ruby-fakegem
DESCRIPTION="Very lightweight libcurl wrapper"
HOMEPAGE="https://github.com/typhoeus/ethon"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~arm ~x86"
IUSE=""
RDEPEND+=" net-misc/curl"
ruby_add_rdepend ">=dev-ruby/ffi-1.3.0"
ruby_add_bdepend "test? ( dev-ruby/sinatra dev-ruby/mime-types )"
all_ruby_prepare() {
rm Gemfile || die
sed -e '/bundler/I s:^:#:' \
-e '1igem "sinatra"' -i Rakefile spec/spec_helper.rb || die
}

@ -1,8 +1,8 @@
# Copyright 1999-2018 Gentoo Foundation
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=5
USE_RUBY="ruby22 ruby23 ruby24 ruby25"
USE_RUBY="ruby23 ruby24 ruby25 ruby26"
RUBY_FAKEGEM_TASK_DOC=""

@ -1 +1,2 @@
DIST globalid-0.4.1.tar.gz 17924 BLAKE2B 6657c916049f841f472f6320868287451d061f96501f5a2b4df8fd71512f5752d5568185c8166344494fa3f6829ec0047f54235c8ea4e01b040653b8699d0484 SHA512 da484c6c7e8155416d008d650929c6b72981d2ae2d1654eb02e414838a065dad9b4ba3c6e275abb008a0d9cad1e2d4d5295d90807c7d7fc73e55b7071c0fd657
DIST globalid-0.4.2.tar.gz 18669 BLAKE2B 7773362a16f5e3d0fec2a45e9bc768b5f22072d148bc77289c6841f24e4187f88b34bb9134f3ac086390bea5664d4cfa4281d96b0b8a3750e09e461350a0a50a SHA512 2f101601e36fdb6ba912652bbcc78a0561e0233c58d481dacbddd250ed39a1fa68a9b9c1cdadbdc708ac3147f64475fd6b68562d1ebab376fd2a517c93a23e49

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

Loading…
Cancel
Save