Gentoo Archives: gentoo-commits

From: Brian Evans <grknight@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/php/
Date: Mon, 29 Jul 2019 12:49:25
Message-Id: 1564404517.f4d9be6963560585c340e4eb313560af17231701.grknight@gentoo
1 commit: f4d9be6963560585c340e4eb313560af17231701
2 Author: Brian Evans <grknight <AT> gentoo <DOT> org>
3 AuthorDate: Mon Jul 29 12:48:37 2019 +0000
4 Commit: Brian Evans <grknight <AT> gentoo <DOT> org>
5 CommitDate: Mon Jul 29 12:48:37 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f4d9be69
7
8 dev-lang/php: Drop security vulnerable versions
9
10 Package-Manager: Portage-2.3.69, Repoman-2.3.16
11 Signed-off-by: Brian Evans <grknight <AT> gentoo.org>
12
13 dev-lang/php/Manifest | 10 -
14 dev-lang/php/php-5.6.40-r1.ebuild | 801 --------------------------------------
15 dev-lang/php/php-5.6.40-r2.ebuild | 788 -------------------------------------
16 dev-lang/php/php-5.6.40-r3.ebuild | 789 -------------------------------------
17 dev-lang/php/php-7.1.27.ebuild | 737 -----------------------------------
18 dev-lang/php/php-7.1.29.ebuild | 737 -----------------------------------
19 dev-lang/php/php-7.2.16.ebuild | 749 -----------------------------------
20 dev-lang/php/php-7.2.18.ebuild | 749 -----------------------------------
21 dev-lang/php/php-7.2.19.ebuild | 749 -----------------------------------
22 dev-lang/php/php-7.3.5.ebuild | 750 -----------------------------------
23 dev-lang/php/php-7.3.6.ebuild | 750 -----------------------------------
24 11 files changed, 7609 deletions(-)
25
26 diff --git a/dev-lang/php/Manifest b/dev-lang/php/Manifest
27 index c500bf50286..f678ee632df 100644
28 --- a/dev-lang/php/Manifest
29 +++ b/dev-lang/php/Manifest
30 @@ -1,16 +1,6 @@
31 DIST php-5.6.40.tar.xz 12472236 BLAKE2B f41147eaec9b15e965540f9e871691cc88848dd619bae6af85e7bba0130b71ce91bad5cdbbadbb537c42df83369f5c731007339a9d9e21e689e913c135201afc SHA512 997b5a952a60cf9166671cc91fcc34c674dd62bfd5cb0a9cdf3fdf2d088b5d19943d94c1cf193f8ab71fc4957d9a9a4c7c2fb8826f937501c1c0a0858f10e329
32 -DIST php-7.1.27.tar.xz 12219868 BLAKE2B 9de4902504e50b53aab28eac2252aa79302541352b1323a17e68cc58e22cd3b6108b3f7d6ba4779a7f87a561442cf3c44c5660418a354d3b48b6df270a761f8b SHA512 a7019788b02f624e19f804cb0c34578443fc2e0a582a32e72d1340f3cd7bb866631497fe61d18f31f92bad5aa7667847e21bd3916fcdd6f04a3b8f88c805f544
33 -DIST php-7.1.29.tar.xz 12221984 BLAKE2B a07e7e5ee58f9a74437d865bb7ee9a4458fde52cf3e678128fb4c2d1cc076da0d37dc16c8908011ed542cc37f492d56a6565e06315630d2a213e2a42accdc4f4 SHA512 97575ec588fd3ab51360525fc02058254b95e89e0a36c74a2890ae7619adda1a5489f3675fa83754f8f693af463cdf17232db071351b6ace9f83d4c3c643f682
34 DIST php-7.1.30.tar.xz 12221980 BLAKE2B 7b2550e8f1c3cbd40223d9ed1d3e9e7a32550a057ecf0c83ce105a5e17805a57266130830adf60adeb4bbcd4cb787539a04783b0588d84e9771ce036de8b176e SHA512 7c6654e118931a8dab4896a7b62221b863b5a235a9bbce3e0c09abf5e55b964f86b1d2b2c96683b09254829c2569e72620f4d8d50cd05153ee56617e62ad37c1
35 -DIST php-7.2.16.tar.xz 12166372 BLAKE2B c59ac69b717a8ee88f229baa94c43f9ee1d9c7161c767a95c3a9719ee70cdc9b61aaff75504aca09bba10d224d9a717cb7c985060b6912491857a003e6cbc349 SHA512 cd2ea3c68d7ed20317800f4b838b0dd9ae2fde508c79662b296dacdacf6c7e35b6ef30a6564516d7b22e82749a6e9e2ffcfd95b05cd79a9f227fbfaf9e25bc31
36 -DIST php-7.2.18.tar.xz 12172696 BLAKE2B c23f4dffe60ad48b53de1c565ecb4f378f5d3daccde98ec8d9bddcfce8bd1a48a75061a72d0094d0db6719a3c0a96cae25ce0ef0fbfadc28fbeff27b332c8107 SHA512 b38034aa13867496009903ba64e4e8bf3216307a9ff1dade60a1477671ecf7bceb5062b349f6997d9af414d58d46ea7bb3f9855e372c230f4a6cff26ad9985d6
37 -DIST php-7.2.19.tar.xz 12176404 BLAKE2B 2ca4ffaa525bc4b3c52b394ab667f99e1657307e11ccffe7a01f9a3b2974b69edf3039b52d8b3ab4509265c966a1d4722d60d281245136b57fe0dfb7aef72bab SHA512 debf42e35ad4884efbe54095abd1f067ddbb4b1446a7b168cb5a08ef61400f5b59844b29d51bd5fa740bf24bfe822c94c5889b4be1bb159eadb3751f77e37ab7
38 DIST php-7.2.20.tar.xz 12183712 BLAKE2B d163afbc56c0d32a3d0f24d3db2c4016a71bb745642f27a01bdfbe29015106f5708ee3aabfc482b01f48c147ca9e28e9b6d1da613284bc3d35651e2aa0862940 SHA512 7c61b7277181f70a8abae560e72f765f598712afe9be6cef0b9a50402e0eca74b773237866e0375e41a4e6f76111035c92e823120a4be2b7647517b01ef6b5c7
39 -DIST php-7.3.5.tar.xz 11981356 BLAKE2B f0ea69358519458d1e48f598f3af808f560d824f417995ea80fc63c8610fb04144a471cee7941802b29eaf24b233b506baa4fff390e57292335f88c434b8dc46 SHA512 3231947b01333987568ec3304bebf0c089a23cd6bc4a7139683bd36b2490fef13ed494108b645d40d5ab55f65990004445ba04af48393a9a508cfa7379ba81d3
40 -DIST php-7.3.6.tar.xz 11989392 BLAKE2B 3aeba998f05a93f21befc1356365586bcf51186fd356948ca15016569b4d4838b2c9079975df45147f017af775cd870770ffa199682837b4b1b3b8b3938f2083 SHA512 940085bd4c53b11751d962426c73ba3bc30ffa22ac3b4380465d0d15e383ed68f83fa4f22b1246fcdc4f68b46e59512a52966453463c60fb9241c34d8a340ffc
41 DIST php-7.3.7.tar.xz 11993760 BLAKE2B 0d634171825b9fd0a831a45486f4d67142bf592042571025a26d8a01e236ef6735af11cffb645ca19d245fe56f1b0085b32545360668b68686524f4307898d07 SHA512 583a28aa346c3322998bfda81bf00f2f2b84ff1e2311f0877288d7d4f02639e953e9bd8cb59372cd4bec9aeffa3ec00375c4b03a3ee8ec1db05a095a28164908
42 DIST php-7.4.0beta1.tar.xz 10200060 BLAKE2B f49c49fcebe0309bbe266dec5c468037499fc96908a4130454403e57caa3ef7da3c46dbc83829bb290c46edfc14921f71fafddb8b0777c23adec35fbb57ad68c SHA512 3e4307201c91cec238c9bc6c27a629a93de8baba0307f2e61cb4bb242720178382dd50b38e7a18fbd65baf25068b358faf571dcb895e7cd6fb292038dee3ed6b
43 -DIST php-patches-20190307-r1.tar.xz 20796 BLAKE2B 251f0d8b222e4a6a339a3b1d4aff39fab8bd7203ec34295b7316a366a7d0015bb9e6665614005949da9decbca53aa9ac0aab63845638a6b4d3d462eabff4ea35 SHA512 d7a412ec1bc6002c458c6bc3cb53faf4e95a852a6cdad337f6a81a978dd56ba72801cccbe866857d6c5b7e95dfe558878133e44a4e9f9b6efd38e679acc82af9
44 -DIST php-patches-7.1.28bp.tar.bz2 27464 BLAKE2B 4babea64a2a24f31299997d6a962b3b7506ec1bb77b8e8b4532cce50c1a9eda73829820c2c7883ea97c1a860bab4220e2c576bdd14d8dd80c8e6a3af808c4c52 SHA512 171a8e52c70283dee12316ff8449dc7c7d3bf37c803724b63c7aa9bb12468a795de286075af317ba69080a5e1c3ed59a2f5b3891b35fb1e5045ede277d48e56a
45 -DIST php-patches-7.1.29bp.tar.bz2 28709 BLAKE2B ad9510e5f550407895371c615db9dc3329c725e9dc61c7a4a2b3bf92ca96040d720cceb333e5c5cc577a9587530da2b0dca5e5466c2acdb0c12f6395927334e1 SHA512 d41fb828cd00473abb9d6d8c8a5f0f2783146874de27c6c7d329437dcd8cc292574f4762e64738d4e7cc584db59d33396908d54a9aef238afda5d445d062065a
46 DIST php-patches-7.1.30bp.tar.bz2 30698 BLAKE2B 74bbab7e3d721ce823f1820b9fad1dd61c9b109e50392ae6cf08f9ae1f6b813273d50edad2644913b016b369f6fc32ff5bf1abe0687c23876596f3f18ec20e1a SHA512 832f97636a346c88089190dc0a0d98d39ef69244b441e553a7775da602227338f1f4a6cb90295b4f5fb117f6c64b259120840dbfe0da7352819d94392aff9fd6
47
48 diff --git a/dev-lang/php/php-5.6.40-r1.ebuild b/dev-lang/php/php-5.6.40-r1.ebuild
49 deleted file mode 100644
50 index 60bc5be0940..00000000000
51 --- a/dev-lang/php/php-5.6.40-r1.ebuild
52 +++ /dev/null
53 @@ -1,801 +0,0 @@
54 -# Copyright 1999-2019 Gentoo Authors
55 -# Distributed under the terms of the GNU General Public License v2
56 -
57 -EAPI="7"
58 -
59 -inherit autotools flag-o-matic systemd
60 -
61 -PATCH_V="20190307"
62 -
63 -DESCRIPTION="The PHP language runtime engine"
64 -HOMEPAGE="https://secure.php.net/"
65 -SRC_URI="https://php.net/distributions/${P}.tar.xz
66 - mirror://gentoo/php-patches-${PATCH_V}-r1.tar.xz"
67 -
68 -LICENSE="PHP-3.01
69 - BSD
70 - Zend-2.0
71 - bcmath? ( LGPL-2.1+ )
72 - fpm? ( BSD-2 )
73 - gd? ( gd )
74 - unicode? ( BSD-2 LGPL-2.1 )"
75 -
76 -SLOT="$(ver_cut 1-2)"
77 -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"
78 -
79 -# We can build the following SAPIs in the given order
80 -SAPIS="embed cli cgi fpm apache2"
81 -
82 -# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
83 -IUSE="${IUSE}
84 - ${SAPIS/cli/+cli}
85 - threads"
86 -
87 -IUSE="${IUSE} acl bcmath berkdb bzip2 calendar cdb cjk
88 - coverage crypt +ctype curl debug
89 - enchant exif +fileinfo +filter firebird
90 - flatfile ftp gd gdbm gmp +hash +iconv imap inifile
91 - intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl
92 - mhash mssql mysql libmysqlclient mysqli nls
93 - oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
94 - readline recode selinux +session sharedmem
95 - +simplexml snmp soap sockets spell sqlite ssl
96 - sybase-ct sysvipc systemd tidy +tokenizer truetype unicode vpx wddx
97 - +xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib"
98 -
99 -# The supported (that is, autodetected) versions of BDB are listed in
100 -# the ./configure script. Other versions *work*, but we need to stick to
101 -# the ones that can be detected to avoid a repeat of bug #564824.
102 -COMMON_DEPEND="
103 - >=app-eselect/eselect-php-0.9.1[apache2?,fpm?]
104 - >=dev-libs/libpcre-8.32[unicode]
105 - fpm? ( acl? ( sys-apps/acl ) )
106 - apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=]
107 - <www-servers/apache-2.4[threads=] ) )
108 - berkdb? ( || ( sys-libs/db:5.3
109 - sys-libs/db:5.1
110 - sys-libs/db:4.8
111 - sys-libs/db:4.7
112 - sys-libs/db:4.6
113 - sys-libs/db:4.5 ) )
114 - bzip2? ( app-arch/bzip2:0= )
115 - cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
116 - cjk? ( !gd? (
117 - virtual/jpeg:0
118 - media-libs/libpng:0=
119 - sys-libs/zlib:0=
120 - ) )
121 - coverage? ( dev-util/lcov )
122 - crypt? ( >=dev-libs/libmcrypt-2.4 )
123 - curl? ( >=net-misc/curl-7.10.5 )
124 - enchant? ( app-text/enchant )
125 - exif? ( !gd? (
126 - virtual/jpeg:0
127 - media-libs/libpng:0=
128 - sys-libs/zlib:0=
129 - ) )
130 - firebird? ( dev-db/firebird )
131 - gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib:0= )
132 - gdbm? ( >=sys-libs/gdbm-1.8.0:0= )
133 - gmp? ( dev-libs/gmp:0= )
134 - iconv? ( virtual/libiconv )
135 - imap? ( virtual/imap-c-client[kerberos=,ssl=] )
136 - intl? ( dev-libs/icu:= )
137 - iodbc? ( dev-db/libiodbc )
138 - kerberos? ( virtual/krb5 )
139 - ldap? ( >=net-nds/openldap-1.2.11 )
140 - ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 )
141 - libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) )
142 - mssql? ( dev-db/freetds[mssql] )
143 - libmysqlclient? (
144 - mysql? ( virtual/libmysqlclient:= )
145 - mysqli? ( virtual/libmysqlclient:= )
146 - )
147 - nls? ( sys-devel/gettext )
148 - oci8-instant-client? ( dev-db/oracle-instantclient-basic )
149 - odbc? ( >=dev-db/unixODBC-1.8.13 )
150 - postgres? ( dev-db/postgresql:* )
151 - qdbm? ( dev-db/qdbm )
152 - readline? ( sys-libs/readline:0= )
153 - recode? ( app-text/recode )
154 - sharedmem? ( dev-libs/mm )
155 - simplexml? ( >=dev-libs/libxml2-2.6.8 )
156 - snmp? ( >=net-analyzer/net-snmp-5.2 )
157 - soap? ( >=dev-libs/libxml2-2.6.8 )
158 - spell? ( >=app-text/aspell-0.50 )
159 - sqlite? ( >=dev-db/sqlite-3.7.6.3 )
160 - ssl? (
161 - !libressl? ( dev-libs/openssl:0= )
162 - libressl? ( dev-libs/libressl:0= )
163 - )
164 - sybase-ct? ( dev-db/freetds )
165 - tidy? ( app-text/htmltidy )
166 - truetype? (
167 - =media-libs/freetype-2*
168 - >=media-libs/t1lib-5.0.0
169 - !gd? (
170 - virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib:0= )
171 - )
172 - unicode? ( dev-libs/oniguruma:= )
173 - vpx? ( media-libs/libvpx:0= )
174 - wddx? ( >=dev-libs/libxml2-2.6.8 )
175 - xml? ( >=dev-libs/libxml2-2.6.8 )
176 - xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
177 - xmlreader? ( >=dev-libs/libxml2-2.6.8 )
178 - xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
179 - xpm? (
180 - x11-libs/libXpm
181 - virtual/jpeg:0
182 - media-libs/libpng:0= sys-libs/zlib:0=
183 - )
184 - xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
185 - zip? ( sys-libs/zlib:0= )
186 - zlib? ( sys-libs/zlib:0= )
187 -"
188 -
189 -RDEPEND="${COMMON_DEPEND}
190 - virtual/mta
191 - fpm? (
192 - selinux? ( sec-policy/selinux-phpfpm )
193 - systemd? ( sys-apps/systemd ) )"
194 -
195 -DEPEND="${COMMON_DEPEND}
196 - app-arch/xz-utils
197 - >=sys-devel/bison-3.0.1
198 - sys-devel/flex
199 - >=sys-devel/m4-1.4.3
200 - >=sys-devel/libtool-1.5.18"
201 -
202 -# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
203 -REQUIRED_USE="
204 - || ( cli cgi fpm apache2 embed )
205 - cli? ( ^^ ( readline libedit ) )
206 - truetype? ( gd zlib )
207 - vpx? ( gd zlib )
208 - cjk? ( gd zlib )
209 - exif? ( gd zlib )
210 - xpm? ( gd zlib )
211 - gd? ( zlib )
212 - simplexml? ( xml )
213 - soap? ( xml )
214 - wddx? ( xml )
215 - xmlrpc? ( || ( xml iconv ) )
216 - xmlreader? ( xml )
217 - xslt? ( xml )
218 - ldap-sasl? ( ldap )
219 - mhash? ( hash )
220 - phar? ( hash )
221 - recode? ( !imap !mysql !mysqli !libmysqlclient )
222 - libmysqlclient? ( || (
223 - mysql
224 - mysqli
225 - pdo
226 - ) )
227 -
228 - qdbm? ( !gdbm )
229 - readline? ( !libedit )
230 - sharedmem? ( !threads )
231 -"
232 -
233 -PHP_MV="$(ver_cut 1)"
234 -
235 -php_install_ini() {
236 - local phpsapi="${1}"
237 -
238 - # work out where we are installing the ini file
239 - php_set_ini_dir "${phpsapi}"
240 -
241 - # Always install the production INI file, bug 611214.
242 - local phpinisrc="php.ini-production-${phpsapi}"
243 - cp php.ini-production "${phpinisrc}" || die
244 -
245 - # default to /tmp for save_path, bug #282768
246 - sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die
247 -
248 - # Set the extension dir
249 - sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \
250 - -i "${phpinisrc}" || die
251 -
252 - # Set the include path to point to where we want to find PEAR packages
253 - sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die
254 -
255 - dodir "${PHP_INI_DIR#${EPREFIX}}"
256 - insinto "${PHP_INI_DIR#${EPREFIX}}"
257 - newins "${phpinisrc}" php.ini
258 -
259 - elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}"
260 - elog
261 -
262 - dodir "${PHP_EXT_INI_DIR#${EPREFIX}}"
263 - dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}"
264 -
265 - if use opcache; then
266 - elog "Adding opcache to $PHP_EXT_INI_DIR"
267 - echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \
268 - "${D}/${PHP_EXT_INI_DIR}"/opcache.ini
269 - dosym "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" \
270 - "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini"
271 - fi
272 -
273 - # SAPI-specific handling
274 - if [[ "${sapi}" == "fpm" ]] ; then
275 - einfo "Installing FPM config file php-fpm.conf"
276 - insinto "${PHP_INI_DIR#${EPREFIX}}"
277 - doins sapi/fpm/php-fpm.conf
278 - fi
279 -
280 - dodoc php.ini-{development,production}
281 -}
282 -
283 -php_set_ini_dir() {
284 - PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}"
285 - PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
286 - PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
287 -}
288 -
289 -src_prepare() {
290 - local patchdir="${WORKDIR}/php-patches-${PATCH_V}"
291 -
292 - eapply "${patchdir}/php-${SLOT}-no-bison-warnings.patch" \
293 - "${patchdir}/5.6-mbstring-oniguruma-6.8.patch" \
294 - "${patchdir}/php-5.6-openssl-1.1-compatibility.patch" \
295 - "${patchdir}/php-5.6-intl-detect-icu-via-pkg-config.patch" \
296 - "${patchdir}/php-5.6-intl-use-icu-namespace.patch" \
297 - "${patchdir}/php-5.6-intl-icu-memory-corruption.patch" \
298 - "${FILESDIR}/php-freetype-2.9.1.patch" \
299 - "${patchdir}/php-5.6-secbug-77396.patch" \
300 - "${patchdir}/php-5.6-secbug-77431.patch" \
301 - "${patchdir}/php-5.6-bug77494.patch" \
302 - "${patchdir}/php-5.6-secbug-77509.patch" \
303 - "${patchdir}/php-5.6-secbug-77540.patch" \
304 - "${patchdir}/php-5.6-secbug-77563.patch" \
305 - "${patchdir}/php-5.6-secbug-77586.patch" \
306 - "${patchdir}/php-5.6-secbug-77630.patch"
307 -
308 - # Copy test binaries from patches
309 - cp "${patchdir}/bug77540.jpg" \
310 - "${patchdir}/bug77563.jpg" "ext/exif/tests/" || die
311 -
312 - # Change PHP branding
313 - # Get the alpha/beta/rc version
314 - sed -re "s|^(PHP_EXTRA_VERSION=\").*(\")|\1-pl${PR/r/}-gentoo\2|g" \
315 - -i configure.in || die "Unable to change PHP branding"
316 -
317 - # Patch PHP to show Gentoo as the server platform
318 - sed -e 's/PHP_UNAME=`uname -a | xargs`/PHP_UNAME=`uname -s -n -r -v | xargs`/g' \
319 - -i configure.in || die "Failed to fix server platform name"
320 -
321 - # Prevent PHP from activating the Apache config,
322 - # as we will do that ourselves
323 - sed -i \
324 - -e "s,-i -a -n php${PHP_MV},-i -n php${PHP_MV},g" \
325 - -e "s,-i -A -n php${PHP_MV},-i -n php${PHP_MV},g" \
326 - configure sapi/apache2filter/config.m4 sapi/apache2handler/config.m4 \
327 - || die
328 -
329 - # Patch PHP to support heimdal instead of mit-krb5
330 - if has_version "app-crypt/heimdal" ; then
331 - sed -e 's|gssapi_krb5|gssapi|g' -i acinclude.m4 \
332 - || die "Failed to fix heimdal libname"
333 - sed -e 's|PHP_ADD_LIBRARY(k5crypto, 1, $1)||g' -i acinclude.m4 \
334 - || die "Failed to fix heimdal crypt library reference"
335 - fi
336 -
337 - eapply_user
338 -
339 - # Force rebuilding aclocal.m4
340 - rm -f aclocal.m4 || die "failed to remove aclocal.m4 in src_prepare"
341 -
342 - mv configure.in configure.ac || die
343 -
344 - eautoreconf
345 -
346 - if [[ ${CHOST} == *-darwin* ]] ; then
347 - # http://bugs.php.net/bug.php?id=48795, bug #343481
348 - sed -i -e '/BUILD_CGI="\\$(CC)/s/CC/CXX/' configure || die
349 - fi
350 -}
351 -
352 -src_configure() {
353 - addpredict /usr/share/snmp/mibs/.index #nowarn
354 - addpredict /var/lib/net-snmp/mib_indexes #nowarn
355 -
356 - PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
357 -
358 - # The php-fpm config file wants localstatedir to be ${EPREFIX}/var
359 - # and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002.
360 - local our_conf=(
361 - --prefix="${PHP_DESTDIR}"
362 - --mandir="${PHP_DESTDIR}/man"
363 - --infodir="${PHP_DESTDIR}/info"
364 - --libdir="${PHP_DESTDIR}/lib"
365 - --with-libdir="$(get_libdir)"
366 - --localstatedir="${EPREFIX}/var"
367 - --without-pear
368 - $(use_enable threads maintainer-zts)
369 - )
370 -
371 - our_conf+=(
372 - $(use_enable bcmath bcmath)
373 - $(use_with bzip2 bz2 "${EPREFIX}/usr")
374 - $(use_enable calendar calendar)
375 - $(use_enable coverage gcov)
376 - $(use_enable ctype ctype)
377 - $(use_with curl curl "${EPREFIX}/usr")
378 - $(use_enable xml dom)
379 - $(use_with enchant enchant "${EPREFIX}/usr")
380 - $(use_enable exif exif)
381 - $(use_enable fileinfo fileinfo)
382 - $(use_enable filter filter)
383 - $(use_enable ftp ftp)
384 - $(use_with nls gettext "${EPREFIX}/usr")
385 - $(use_with gmp gmp "${EPREFIX}/usr")
386 - $(use_enable hash hash)
387 - $(use_with mhash mhash "${EPREFIX}/usr")
388 - $(use_with iconv iconv \
389 - $(use elibc_glibc || use elibc_musl || use elibc_FreeBSD || echo "${EPREFIX}/usr"))
390 - $(use_enable intl intl)
391 - $(use_enable ipv6 ipv6)
392 - $(use_enable json json)
393 - $(use_with kerberos kerberos "${EPREFIX}/usr")
394 - $(use_enable xml libxml)
395 - $(use_with xml libxml-dir "${EPREFIX}/usr")
396 - $(use_enable unicode mbstring)
397 - $(use_with crypt mcrypt "${EPREFIX}/usr")
398 - $(use_with mssql mssql "${EPREFIX}/usr")
399 - $(use_with unicode onig "${EPREFIX}/usr")
400 - $(use_with ssl openssl "${EPREFIX}/usr")
401 - $(use_with ssl openssl-dir "${EPREFIX}/usr")
402 - $(use_enable pcntl pcntl)
403 - $(use_enable phar phar)
404 - $(use_enable pdo pdo)
405 - $(use_enable opcache opcache)
406 - $(use_with postgres pgsql "${EPREFIX}/usr")
407 - $(use_enable posix posix)
408 - $(use_with spell pspell "${EPREFIX}/usr")
409 - $(use_with recode recode "${EPREFIX}/usr")
410 - $(use_enable simplexml simplexml)
411 - $(use_enable sharedmem shmop)
412 - $(use_with snmp snmp "${EPREFIX}/usr")
413 - $(use_enable soap soap)
414 - $(use_enable sockets sockets)
415 - $(use_with sqlite sqlite3 "${EPREFIX}/usr")
416 - $(use_with sybase-ct sybase-ct "${EPREFIX}/usr")
417 - $(use_enable sysvipc sysvmsg)
418 - $(use_enable sysvipc sysvsem)
419 - $(use_enable sysvipc sysvshm)
420 - $(use_with tidy tidy "${EPREFIX}/usr")
421 - $(use_enable tokenizer tokenizer)
422 - $(use_enable wddx wddx)
423 - $(use_enable xml xml)
424 - $(use_enable xmlreader xmlreader)
425 - $(use_enable xmlwriter xmlwriter)
426 - $(use_with xmlrpc xmlrpc)
427 - $(use_with xslt xsl "${EPREFIX}/usr")
428 - $(use_enable zip zip)
429 - $(use_with zlib zlib "${EPREFIX}/usr")
430 - $(use_enable debug debug)
431 - )
432 -
433 - # DBA support
434 - if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
435 - || use qdbm ; then
436 - our_conf+=( "--enable-dba${shared}" )
437 - fi
438 -
439 - # DBA drivers support
440 - our_conf+=(
441 - $(use_with cdb cdb)
442 - $(use_with berkdb db4 "${EPREFIX}/usr")
443 - $(use_enable flatfile flatfile)
444 - $(use_with gdbm gdbm "${EPREFIX}/usr")
445 - $(use_enable inifile inifile)
446 - $(use_with qdbm qdbm "${EPREFIX}/usr")
447 - )
448 -
449 - # Support for the GD graphics library
450 - our_conf+=(
451 - $(use_with truetype freetype-dir "${EPREFIX}/usr")
452 - $(use_with truetype t1lib "${EPREFIX}/usr")
453 - $(use_enable cjk gd-jis-conv)
454 - $(use_with gd jpeg-dir "${EPREFIX}/usr")
455 - $(use_with gd png-dir "${EPREFIX}/usr")
456 - $(use_with xpm xpm-dir "${EPREFIX}/usr")
457 - $(use_with vpx vpx-dir "${EPREFIX}/usr")
458 - )
459 - # enable gd last, so configure can pick up the previous settings
460 - our_conf+=( $(use_with gd gd) )
461 -
462 - # IMAP support
463 - if use imap ; then
464 - our_conf+=(
465 - $(use_with imap imap "${EPREFIX}/usr")
466 - $(use_with ssl imap-ssl "${EPREFIX}/usr")
467 - )
468 - fi
469 -
470 - # Interbase/firebird support
471 - our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") )
472 -
473 - # LDAP support
474 - if use ldap ; then
475 - our_conf+=(
476 - $(use_with ldap ldap "${EPREFIX}/usr")
477 - $(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr")
478 - )
479 - fi
480 -
481 - # MySQL support
482 - local mysqllib="mysqlnd"
483 - local mysqlilib="mysqlnd"
484 - use libmysqlclient && mysqllib="${EPREFIX}/usr"
485 - use libmysqlclient && mysqlilib="${EPREFIX}/usr/bin/mysql_config"
486 -
487 - our_conf+=( $(use_with mysql mysql "${mysqllib}") )
488 - our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
489 -
490 - local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock"
491 - if use mysql || use mysqli ; then
492 - our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") )
493 - fi
494 -
495 - # ODBC support
496 - our_conf+=(
497 - $(use_with odbc unixODBC "${EPREFIX}/usr")
498 - $(use_with iodbc iodbc "${EPREFIX}/usr")
499 - )
500 -
501 - # Oracle support
502 - our_conf+=( $(use_with oci8-instant-client oci8) )
503 -
504 - # PDO support
505 - if use pdo ; then
506 - our_conf+=(
507 - $(use_with mssql pdo-dblib)
508 - $(use_with mysql pdo-mysql "${mysqllib}")
509 - $(use_with postgres pdo-pgsql)
510 - $(use_with sqlite pdo-sqlite "${EPREFIX}/usr")
511 - $(use_with firebird pdo-firebird "${EPREFIX}/usr")
512 - $(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr")
513 - $(use_with oci8-instant-client pdo-oci)
514 - )
515 - fi
516 -
517 - # readline/libedit support
518 - our_conf+=(
519 - $(use_with readline readline "${EPREFIX}/usr")
520 - $(use_with libedit libedit "${EPREFIX}/usr")
521 - )
522 -
523 - # Session support
524 - if use session ; then
525 - our_conf+=( $(use_with sharedmem mm "${EPREFIX}/usr") )
526 - else
527 - our_conf+=( $(use_enable session session) )
528 - fi
529 -
530 - # Use pic for shared modules such as apache2's mod_php
531 - our_conf+=( --with-pic )
532 -
533 - # we use the system copy of pcre
534 - # --with-pcre-regex affects ext/pcre
535 - # --with-pcre-dir affects ext/filter and ext/zip
536 - our_conf+=(
537 - --with-pcre-regex="${EPREFIX}/usr"
538 - --with-pcre-dir="${EPREFIX}/usr"
539 - )
540 -
541 - # Catch CFLAGS problems
542 - # Fixes bug #14067.
543 - # Changed order to run it in reverse for bug #32022 and #12021.
544 - replace-cpu-flags "k6*" "i586"
545 -
546 - # Cache the ./configure test results between SAPIs.
547 - our_conf+=( --cache-file="${T}/config.cache" )
548 -
549 - # Support user-passed configuration parameters
550 - our_conf+=( ${EXTRA_ECONF:-} )
551 -
552 - # Support the Apache2 extras, they must be set globally for all
553 - # SAPIs to work correctly, especially for external PHP extensions
554 -
555 - mkdir -p "${WORKDIR}/sapis-build" || die
556 - for one_sapi in $SAPIS ; do
557 - use "${one_sapi}" || continue
558 - php_set_ini_dir "${one_sapi}"
559 -
560 - # The BUILD_DIR variable is used to determine where to output
561 - # the files that autotools creates. This was all originally
562 - # based on the autotools-utils eclass.
563 - BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}"
564 - cp -a "${S}" "${BUILD_DIR}" || die
565 - cd "${BUILD_DIR}" || die
566 -
567 - local sapi_conf=(
568 - --with-config-file-path="${PHP_INI_DIR}"
569 - --with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}"
570 - )
571 -
572 - for sapi in $SAPIS ; do
573 - case "$sapi" in
574 - cli|cgi|embed|fpm)
575 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
576 - sapi_conf+=( "--enable-${sapi}" )
577 - if [[ "fpm" == "${sapi}" ]] ; then
578 - sapi_conf+=(
579 - $(use_with acl fpm-acl)
580 - $(use_with systemd fpm-systemd)
581 - )
582 - fi
583 - else
584 - sapi_conf+=( "--disable-${sapi}" )
585 - fi
586 - ;;
587 -
588 - apache2)
589 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
590 - sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" )
591 - else
592 - sapi_conf+=( --without-apxs2 )
593 - fi
594 - ;;
595 - esac
596 - done
597 -
598 - # Construct the $myeconfargs array by concatenating $our_conf
599 - # (the common args) and $sapi_conf (the SAPI-specific args).
600 - local myeconfargs=( "${our_conf[@]}" )
601 - myeconfargs+=( "${sapi_conf[@]}" )
602 -
603 - pushd "${BUILD_DIR}" > /dev/null || die
604 - econf "${myeconfargs[@]}"
605 - popd > /dev/null || die
606 - done
607 -}
608 -
609 -src_compile() {
610 - # snmp seems to run during src_compile, too (bug #324739)
611 - addpredict /usr/share/snmp/mibs/.index #nowarn
612 - addpredict /var/lib/net-snmp/mib_indexes #nowarn
613 -
614 - for sapi in ${SAPIS} ; do
615 - if use "${sapi}"; then
616 - cd "${WORKDIR}/sapis-build/$sapi" || \
617 - die "Failed to change dir to ${WORKDIR}/sapis-build/$1"
618 - emake
619 - fi
620 - done
621 -}
622 -
623 -src_install() {
624 - # see bug #324739 for what happens when we don't have that
625 - addpredict /usr/share/snmp/mibs/.index #nowarn
626 -
627 - # grab the first SAPI that got built and install common files from there
628 - local first_sapi=""
629 - for sapi in $SAPIS ; do
630 - if use $sapi ; then
631 - first_sapi=$sapi
632 - break
633 - fi
634 - done
635 -
636 - # Makefile forgets to create this before trying to write to it...
637 - dodir "${PHP_DESTDIR#${EPREFIX}}/bin"
638 -
639 - # Install php environment (without any sapis)
640 - cd "${WORKDIR}/sapis-build/$first_sapi" || die
641 - emake INSTALL_ROOT="${D}" \
642 - install-build install-headers install-programs
643 -
644 - local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)"
645 -
646 - # Create the directory where we'll put version-specific php scripts
647 - keepdir "/usr/share/php${PHP_MV}"
648 -
649 - local sapi="", file=""
650 - local sapi_list=""
651 -
652 - for sapi in ${SAPIS}; do
653 - if use "${sapi}" ; then
654 - einfo "Installing SAPI: ${sapi}"
655 - cd "${WORKDIR}/sapis-build/${sapi}" || die
656 -
657 - if [[ "${sapi}" == "apache2" ]] ; then
658 - # We're specifically not using emake install-sapi as libtool
659 - # may cause unnecessary relink failures (see bug #351266)
660 - insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/"
661 - newins ".libs/libphp5$(get_libname)" \
662 - "libphp${PHP_MV}$(get_libname)"
663 - keepdir "/usr/$(get_libdir)/apache2/modules"
664 - else
665 - # needed each time, php_install_ini would reset it
666 - local dest="${PHP_DESTDIR#${EPREFIX}}"
667 - into "${dest}"
668 - case "$sapi" in
669 - cli)
670 - source="sapi/cli/php"
671 - ;;
672 - cgi)
673 - source="sapi/cgi/php-cgi"
674 - ;;
675 - fpm)
676 - source="sapi/fpm/php-fpm"
677 - ;;
678 - embed)
679 - source="libs/libphp${PHP_MV}$(get_libname)"
680 - ;;
681 - *)
682 - die "unhandled sapi in src_install"
683 - ;;
684 - esac
685 -
686 - if [[ "${source}" == *"$(get_libname)" ]]; then
687 - dolib.so "${source}"
688 - else
689 - dobin "${source}"
690 - local name="$(basename ${source})"
691 - dosym "${dest}/bin/${name}" "/usr/bin/${name}${SLOT}"
692 - fi
693 - fi
694 -
695 - php_install_ini "${sapi}"
696 -
697 - # construct correct SAPI string for php-config
698 - # thanks to ferringb for the bash voodoo
699 - if [[ "${sapi}" == "apache2" ]]; then
700 - sapi_list="${sapi_list:+${sapi_list} }apache2handler"
701 - else
702 - sapi_list="${sapi_list:+${sapi_list} }${sapi}"
703 - fi
704 - fi
705 - done
706 -
707 - # Installing opcache module
708 - if use opcache ; then
709 - into "${PHP_DESTDIR#${EPREFIX}}"
710 - dolib.so "modules/opcache$(get_libname)"
711 - fi
712 -
713 - # Install env.d files
714 - newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}"
715 - sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
716 - sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
717 -
718 - # set php-config variable correctly (bug #278439)
719 - sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \
720 - "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die
721 -
722 - if use fpm ; then
723 - if use systemd; then
724 - systemd_newunit "${FILESDIR}/php-fpm_at.service" \
725 - "php-fpm@${SLOT}.service"
726 - else
727 - systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \
728 - "php-fpm@${SLOT}.service"
729 - fi
730 - fi
731 -}
732 -
733 -src_test() {
734 - echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
735 - PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
736 - if [[ ! -x "${PHP_BIN}" ]] ; then
737 - ewarn "Test phase requires USE=cli, skipping"
738 - return
739 - else
740 - export TEST_PHP_EXECUTABLE="${PHP_BIN}"
741 - fi
742 -
743 - if [[ -x "${WORKDIR}/sapis/cgi/php-cgi" ]] ; then
744 - export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis/cgi/php-cgi"
745 - fi
746 -
747 - REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \
748 - "session.save_path=${T}" \
749 - "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \
750 - "session.save_path=${T}"
751 -
752 - for name in ${EXPECTED_TEST_FAILURES}; do
753 - mv "${name}.out" "${name}.out.orig" 2>/dev/null || die
754 - done
755 -
756 - local failed="$(find -name '*.out')"
757 - if [[ ${failed} != "" ]] ; then
758 - ewarn "The following test cases failed unexpectedly:"
759 - for name in ${failed}; do
760 - ewarn " ${name/.out/}"
761 - done
762 - else
763 - einfo "No unexpected test failures, all fine"
764 - fi
765 -
766 - if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
767 - local passed=""
768 - for name in ${EXPECTED_TEST_FAILURES}; do
769 - [[ -f "${name}.diff" ]] && continue
770 - passed="${passed} ${name}"
771 - done
772 - if [[ ${passed} != "" ]] ; then
773 - einfo "The following test cases passed unexpectedly:"
774 - for name in ${passed}; do
775 - ewarn " ${passed}"
776 - done
777 - else
778 - einfo "None of the known-to-fail tests passed, all fine"
779 - fi
780 - fi
781 -}
782 -
783 -pkg_postinst() {
784 - # Output some general info to the user
785 - if use apache2 ; then
786 - elog
787 - elog "To enable PHP in apache, you will need to add \"-D PHP\" to"
788 - elog "your apache2 command. OpenRC users can append that string to"
789 - elog "APACHE2_OPTS in /etc/conf.d/apache2."
790 - elog
791 - elog "The apache module configuration file 70_mod_php.conf is"
792 - elog "provided (and maintained) by eselect-php."
793 - elog
794 - fi
795 -
796 - # Create the symlinks for php
797 - for m in ${SAPIS}; do
798 - [[ ${m} == 'embed' ]] && continue;
799 - if use $m ; then
800 - local ci=$(eselect php show $m)
801 - if [[ -z $ci ]]; then
802 - eselect php set $m php${SLOT} || die
803 - einfo "Switched ${m} to use php:${SLOT}"
804 - einfo
805 - elif [[ $ci != "php${SLOT}" ]] ; then
806 - elog "To switch $m to use php:${SLOT}, run"
807 - elog " eselect php set $m php${SLOT}"
808 - elog
809 - fi
810 - fi
811 - done
812 -
813 - # Remove dead symlinks for SAPIs that were just disabled. For
814 - # example, if the user has the cgi SAPI enabled, then he has an
815 - # eselect-php symlink for it. If he later reinstalls PHP with
816 - # USE="-cgi", that symlink will break. This call to eselect is
817 - # supposed to remove that dead link per bug 572436.
818 - eselect php cleanup || die
819 -
820 - if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then
821 - elog "To build extensions for this version of PHP, you will need to"
822 - elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable."
823 - elog
824 - fi
825 -
826 - # Warn about the removal of PHP_INI_VERSION if the user has it set.
827 - if [[ -n "${PHP_INI_VERSION}" ]]; then
828 - ewarn 'The PHP_INI_VERSION variable has been phased out. You may'
829 - ewarn 'remove it from your configuration at your convenience. See'
830 - ewarn
831 - ewarn ' https://bugs.gentoo.org/611214'
832 - ewarn
833 - ewarn 'for more information.'
834 - fi
835 -
836 - elog "For details on how version slotting works, please see"
837 - elog "the wiki:"
838 - elog
839 - elog " https://wiki.gentoo.org/wiki/PHP"
840 - elog
841 -}
842 -
843 -pkg_postrm() {
844 - # This serves two purposes. First, if we have just removed the last
845 - # installed version of PHP, then this will remove any dead symlinks
846 - # belonging to eselect-php. Second, if a user upgrades slots from
847 - # (say) 5.6 to 7.0 and depcleans the old slot, then this will update
848 - # his existing symlinks to point to the new 7.0 installation. The
849 - # latter is bug 432962.
850 - #
851 - # Note: the eselect-php package may not be installed at this point,
852 - # so we can't die() if this command fails.
853 - eselect php cleanup
854 -}
855
856 diff --git a/dev-lang/php/php-5.6.40-r2.ebuild b/dev-lang/php/php-5.6.40-r2.ebuild
857 deleted file mode 100644
858 index d38bf8fa63f..00000000000
859 --- a/dev-lang/php/php-5.6.40-r2.ebuild
860 +++ /dev/null
861 @@ -1,788 +0,0 @@
862 -# Copyright 1999-2019 Gentoo Authors
863 -# Distributed under the terms of the GNU General Public License v2
864 -
865 -EAPI="7"
866 -
867 -inherit autotools flag-o-matic systemd
868 -
869 -PATCH_V="7.1.28bp"
870 -
871 -DESCRIPTION="The PHP language runtime engine"
872 -HOMEPAGE="https://secure.php.net/"
873 -SRC_URI="https://php.net/distributions/${P}.tar.xz
874 - https://gitweb.gentoo.org/proj/php-patches.git/snapshot/php-patches-${PATCH_V}.tar.bz2"
875 -
876 -LICENSE="PHP-3.01
877 - BSD
878 - Zend-2.0
879 - bcmath? ( LGPL-2.1+ )
880 - fpm? ( BSD-2 )
881 - gd? ( gd )
882 - unicode? ( BSD-2 LGPL-2.1 )"
883 -
884 -SLOT="$(ver_cut 1-2)"
885 -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"
886 -
887 -# We can build the following SAPIs in the given order
888 -SAPIS="embed cli cgi fpm apache2"
889 -
890 -# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
891 -IUSE="${IUSE}
892 - ${SAPIS/cli/+cli}
893 - threads"
894 -
895 -IUSE="${IUSE} acl bcmath berkdb bzip2 calendar cdb cjk
896 - coverage crypt +ctype curl debug
897 - enchant exif +fileinfo +filter firebird
898 - flatfile ftp gd gdbm gmp +hash +iconv imap inifile
899 - intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl
900 - mhash mssql mysql libmysqlclient mysqli nls
901 - oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
902 - readline recode selinux +session sharedmem
903 - +simplexml snmp soap sockets spell sqlite ssl
904 - sybase-ct sysvipc systemd tidy +tokenizer truetype unicode vpx wddx
905 - +xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib"
906 -
907 -# The supported (that is, autodetected) versions of BDB are listed in
908 -# the ./configure script. Other versions *work*, but we need to stick to
909 -# the ones that can be detected to avoid a repeat of bug #564824.
910 -COMMON_DEPEND="
911 - >=app-eselect/eselect-php-0.9.1[apache2?,fpm?]
912 - >=dev-libs/libpcre-8.32[unicode]
913 - fpm? ( acl? ( sys-apps/acl ) )
914 - apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=]
915 - <www-servers/apache-2.4[threads=] ) )
916 - berkdb? ( || ( sys-libs/db:5.3
917 - sys-libs/db:5.1
918 - sys-libs/db:4.8
919 - sys-libs/db:4.7
920 - sys-libs/db:4.6
921 - sys-libs/db:4.5 ) )
922 - bzip2? ( app-arch/bzip2:0= )
923 - cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
924 - cjk? ( !gd? (
925 - virtual/jpeg:0
926 - media-libs/libpng:0=
927 - sys-libs/zlib:0=
928 - ) )
929 - coverage? ( dev-util/lcov )
930 - crypt? ( >=dev-libs/libmcrypt-2.4 )
931 - curl? ( >=net-misc/curl-7.10.5 )
932 - enchant? ( app-text/enchant )
933 - exif? ( !gd? (
934 - virtual/jpeg:0
935 - media-libs/libpng:0=
936 - sys-libs/zlib:0=
937 - ) )
938 - firebird? ( dev-db/firebird )
939 - gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib:0= )
940 - gdbm? ( >=sys-libs/gdbm-1.8.0:0= )
941 - gmp? ( dev-libs/gmp:0= )
942 - iconv? ( virtual/libiconv )
943 - imap? ( virtual/imap-c-client[kerberos=,ssl=] )
944 - intl? ( dev-libs/icu:= )
945 - iodbc? ( dev-db/libiodbc )
946 - kerberos? ( virtual/krb5 )
947 - ldap? ( >=net-nds/openldap-1.2.11 )
948 - ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 )
949 - libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) )
950 - mssql? ( dev-db/freetds[mssql] )
951 - libmysqlclient? (
952 - mysql? ( virtual/libmysqlclient:= )
953 - mysqli? ( virtual/libmysqlclient:= )
954 - )
955 - nls? ( sys-devel/gettext )
956 - oci8-instant-client? ( dev-db/oracle-instantclient-basic )
957 - odbc? ( >=dev-db/unixODBC-1.8.13 )
958 - postgres? ( dev-db/postgresql:* )
959 - qdbm? ( dev-db/qdbm )
960 - readline? ( sys-libs/readline:0= )
961 - recode? ( app-text/recode )
962 - sharedmem? ( dev-libs/mm )
963 - simplexml? ( >=dev-libs/libxml2-2.6.8 )
964 - snmp? ( >=net-analyzer/net-snmp-5.2 )
965 - soap? ( >=dev-libs/libxml2-2.6.8 )
966 - spell? ( >=app-text/aspell-0.50 )
967 - sqlite? ( >=dev-db/sqlite-3.7.6.3 )
968 - ssl? (
969 - !libressl? ( dev-libs/openssl:0= )
970 - libressl? ( dev-libs/libressl:0= )
971 - )
972 - sybase-ct? ( dev-db/freetds )
973 - tidy? ( app-text/htmltidy )
974 - truetype? (
975 - =media-libs/freetype-2*
976 - >=media-libs/t1lib-5.0.0
977 - !gd? (
978 - virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib:0= )
979 - )
980 - unicode? ( dev-libs/oniguruma:= )
981 - vpx? ( media-libs/libvpx:0= )
982 - wddx? ( >=dev-libs/libxml2-2.6.8 )
983 - xml? ( >=dev-libs/libxml2-2.6.8 )
984 - xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
985 - xmlreader? ( >=dev-libs/libxml2-2.6.8 )
986 - xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
987 - xpm? (
988 - x11-libs/libXpm
989 - virtual/jpeg:0
990 - media-libs/libpng:0= sys-libs/zlib:0=
991 - )
992 - xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
993 - zip? ( sys-libs/zlib:0= )
994 - zlib? ( sys-libs/zlib:0= )
995 -"
996 -
997 -RDEPEND="${COMMON_DEPEND}
998 - virtual/mta
999 - fpm? (
1000 - selinux? ( sec-policy/selinux-phpfpm )
1001 - systemd? ( sys-apps/systemd ) )"
1002 -
1003 -DEPEND="${COMMON_DEPEND}
1004 - app-arch/xz-utils
1005 - >=sys-devel/bison-3.0.1
1006 - sys-devel/flex
1007 - >=sys-devel/m4-1.4.3
1008 - >=sys-devel/libtool-1.5.18"
1009 -
1010 -# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
1011 -REQUIRED_USE="
1012 - || ( cli cgi fpm apache2 embed )
1013 - cli? ( ^^ ( readline libedit ) )
1014 - truetype? ( gd zlib )
1015 - vpx? ( gd zlib )
1016 - cjk? ( gd zlib )
1017 - exif? ( gd zlib )
1018 - xpm? ( gd zlib )
1019 - gd? ( zlib )
1020 - simplexml? ( xml )
1021 - soap? ( xml )
1022 - wddx? ( xml )
1023 - xmlrpc? ( || ( xml iconv ) )
1024 - xmlreader? ( xml )
1025 - xslt? ( xml )
1026 - ldap-sasl? ( ldap )
1027 - mhash? ( hash )
1028 - phar? ( hash )
1029 - recode? ( !imap !mysql !mysqli !libmysqlclient )
1030 - libmysqlclient? ( || (
1031 - mysql
1032 - mysqli
1033 - pdo
1034 - ) )
1035 -
1036 - qdbm? ( !gdbm )
1037 - readline? ( !libedit )
1038 - sharedmem? ( !threads )
1039 -"
1040 -
1041 -PHP_MV="$(ver_cut 1)"
1042 -
1043 -php_install_ini() {
1044 - local phpsapi="${1}"
1045 -
1046 - # work out where we are installing the ini file
1047 - php_set_ini_dir "${phpsapi}"
1048 -
1049 - # Always install the production INI file, bug 611214.
1050 - local phpinisrc="php.ini-production-${phpsapi}"
1051 - cp php.ini-production "${phpinisrc}" || die
1052 -
1053 - # default to /tmp for save_path, bug #282768
1054 - sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die
1055 -
1056 - # Set the extension dir
1057 - sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \
1058 - -i "${phpinisrc}" || die
1059 -
1060 - # Set the include path to point to where we want to find PEAR packages
1061 - sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die
1062 -
1063 - dodir "${PHP_INI_DIR#${EPREFIX}}"
1064 - insinto "${PHP_INI_DIR#${EPREFIX}}"
1065 - newins "${phpinisrc}" php.ini
1066 -
1067 - elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}"
1068 - elog
1069 -
1070 - dodir "${PHP_EXT_INI_DIR#${EPREFIX}}"
1071 - dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}"
1072 -
1073 - if use opcache; then
1074 - elog "Adding opcache to $PHP_EXT_INI_DIR"
1075 - echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \
1076 - "${D}/${PHP_EXT_INI_DIR}"/opcache.ini
1077 - dosym "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" \
1078 - "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini"
1079 - fi
1080 -
1081 - # SAPI-specific handling
1082 - if [[ "${sapi}" == "fpm" ]] ; then
1083 - einfo "Installing FPM config file php-fpm.conf"
1084 - insinto "${PHP_INI_DIR#${EPREFIX}}"
1085 - doins sapi/fpm/php-fpm.conf
1086 - fi
1087 -
1088 - dodoc php.ini-{development,production}
1089 -}
1090 -
1091 -php_set_ini_dir() {
1092 - PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}"
1093 - PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
1094 - PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
1095 -}
1096 -
1097 -src_prepare() {
1098 - local patchdir="${WORKDIR}/php-patches-${PATCH_V}"
1099 -
1100 - eapply "${patchdir}/"
1101 -
1102 - # Copy test binaries from patches
1103 - cp "${patchdir}/bug77540.jpg" \
1104 - "${patchdir}/bug77753.tiff" "${patchdir}/bug77831.tiff" \
1105 - "${patchdir}/bug77563.jpg" "ext/exif/tests/" || die
1106 -
1107 - # Change PHP branding
1108 - # Get the alpha/beta/rc version
1109 - sed -re "s|^(PHP_EXTRA_VERSION=\").*(\")|\1-pl${PR/r/}-gentoo\2|g" \
1110 - -i configure.in || die "Unable to change PHP branding"
1111 -
1112 - # Patch PHP to show Gentoo as the server platform
1113 - sed -e 's/PHP_UNAME=`uname -a | xargs`/PHP_UNAME=`uname -s -n -r -v | xargs`/g' \
1114 - -i configure.in || die "Failed to fix server platform name"
1115 -
1116 - # Prevent PHP from activating the Apache config,
1117 - # as we will do that ourselves
1118 - sed -i \
1119 - -e "s,-i -a -n php${PHP_MV},-i -n php${PHP_MV},g" \
1120 - -e "s,-i -A -n php${PHP_MV},-i -n php${PHP_MV},g" \
1121 - configure sapi/apache2filter/config.m4 sapi/apache2handler/config.m4 \
1122 - || die
1123 -
1124 - # Patch PHP to support heimdal instead of mit-krb5
1125 - if has_version "app-crypt/heimdal" ; then
1126 - sed -e 's|gssapi_krb5|gssapi|g' -i acinclude.m4 \
1127 - || die "Failed to fix heimdal libname"
1128 - sed -e 's|PHP_ADD_LIBRARY(k5crypto, 1, $1)||g' -i acinclude.m4 \
1129 - || die "Failed to fix heimdal crypt library reference"
1130 - fi
1131 -
1132 - eapply_user
1133 -
1134 - # Force rebuilding aclocal.m4
1135 - rm -f aclocal.m4 || die "failed to remove aclocal.m4 in src_prepare"
1136 -
1137 - mv configure.in configure.ac || die
1138 -
1139 - eautoreconf
1140 -
1141 - if [[ ${CHOST} == *-darwin* ]] ; then
1142 - # http://bugs.php.net/bug.php?id=48795, bug #343481
1143 - sed -i -e '/BUILD_CGI="\\$(CC)/s/CC/CXX/' configure || die
1144 - fi
1145 -}
1146 -
1147 -src_configure() {
1148 - addpredict /usr/share/snmp/mibs/.index #nowarn
1149 - addpredict /var/lib/net-snmp/mib_indexes #nowarn
1150 -
1151 - PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
1152 -
1153 - # The php-fpm config file wants localstatedir to be ${EPREFIX}/var
1154 - # and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002.
1155 - local our_conf=(
1156 - --prefix="${PHP_DESTDIR}"
1157 - --mandir="${PHP_DESTDIR}/man"
1158 - --infodir="${PHP_DESTDIR}/info"
1159 - --libdir="${PHP_DESTDIR}/lib"
1160 - --with-libdir="$(get_libdir)"
1161 - --localstatedir="${EPREFIX}/var"
1162 - --without-pear
1163 - $(use_enable threads maintainer-zts)
1164 - )
1165 -
1166 - our_conf+=(
1167 - $(use_enable bcmath bcmath)
1168 - $(use_with bzip2 bz2 "${EPREFIX}/usr")
1169 - $(use_enable calendar calendar)
1170 - $(use_enable coverage gcov)
1171 - $(use_enable ctype ctype)
1172 - $(use_with curl curl "${EPREFIX}/usr")
1173 - $(use_enable xml dom)
1174 - $(use_with enchant enchant "${EPREFIX}/usr")
1175 - $(use_enable exif exif)
1176 - $(use_enable fileinfo fileinfo)
1177 - $(use_enable filter filter)
1178 - $(use_enable ftp ftp)
1179 - $(use_with nls gettext "${EPREFIX}/usr")
1180 - $(use_with gmp gmp "${EPREFIX}/usr")
1181 - $(use_enable hash hash)
1182 - $(use_with mhash mhash "${EPREFIX}/usr")
1183 - $(use_with iconv iconv \
1184 - $(use elibc_glibc || use elibc_musl || use elibc_FreeBSD || echo "${EPREFIX}/usr"))
1185 - $(use_enable intl intl)
1186 - $(use_enable ipv6 ipv6)
1187 - $(use_enable json json)
1188 - $(use_with kerberos kerberos "${EPREFIX}/usr")
1189 - $(use_enable xml libxml)
1190 - $(use_with xml libxml-dir "${EPREFIX}/usr")
1191 - $(use_enable unicode mbstring)
1192 - $(use_with crypt mcrypt "${EPREFIX}/usr")
1193 - $(use_with mssql mssql "${EPREFIX}/usr")
1194 - $(use_with unicode onig "${EPREFIX}/usr")
1195 - $(use_with ssl openssl "${EPREFIX}/usr")
1196 - $(use_with ssl openssl-dir "${EPREFIX}/usr")
1197 - $(use_enable pcntl pcntl)
1198 - $(use_enable phar phar)
1199 - $(use_enable pdo pdo)
1200 - $(use_enable opcache opcache)
1201 - $(use_with postgres pgsql "${EPREFIX}/usr")
1202 - $(use_enable posix posix)
1203 - $(use_with spell pspell "${EPREFIX}/usr")
1204 - $(use_with recode recode "${EPREFIX}/usr")
1205 - $(use_enable simplexml simplexml)
1206 - $(use_enable sharedmem shmop)
1207 - $(use_with snmp snmp "${EPREFIX}/usr")
1208 - $(use_enable soap soap)
1209 - $(use_enable sockets sockets)
1210 - $(use_with sqlite sqlite3 "${EPREFIX}/usr")
1211 - $(use_with sybase-ct sybase-ct "${EPREFIX}/usr")
1212 - $(use_enable sysvipc sysvmsg)
1213 - $(use_enable sysvipc sysvsem)
1214 - $(use_enable sysvipc sysvshm)
1215 - $(use_with tidy tidy "${EPREFIX}/usr")
1216 - $(use_enable tokenizer tokenizer)
1217 - $(use_enable wddx wddx)
1218 - $(use_enable xml xml)
1219 - $(use_enable xmlreader xmlreader)
1220 - $(use_enable xmlwriter xmlwriter)
1221 - $(use_with xmlrpc xmlrpc)
1222 - $(use_with xslt xsl "${EPREFIX}/usr")
1223 - $(use_enable zip zip)
1224 - $(use_with zlib zlib "${EPREFIX}/usr")
1225 - $(use_enable debug debug)
1226 - )
1227 -
1228 - # DBA support
1229 - if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
1230 - || use qdbm ; then
1231 - our_conf+=( "--enable-dba${shared}" )
1232 - fi
1233 -
1234 - # DBA drivers support
1235 - our_conf+=(
1236 - $(use_with cdb cdb)
1237 - $(use_with berkdb db4 "${EPREFIX}/usr")
1238 - $(use_enable flatfile flatfile)
1239 - $(use_with gdbm gdbm "${EPREFIX}/usr")
1240 - $(use_enable inifile inifile)
1241 - $(use_with qdbm qdbm "${EPREFIX}/usr")
1242 - )
1243 -
1244 - # Support for the GD graphics library
1245 - our_conf+=(
1246 - $(use_with truetype freetype-dir "${EPREFIX}/usr")
1247 - $(use_with truetype t1lib "${EPREFIX}/usr")
1248 - $(use_enable cjk gd-jis-conv)
1249 - $(use_with gd jpeg-dir "${EPREFIX}/usr")
1250 - $(use_with gd png-dir "${EPREFIX}/usr")
1251 - $(use_with xpm xpm-dir "${EPREFIX}/usr")
1252 - $(use_with vpx vpx-dir "${EPREFIX}/usr")
1253 - )
1254 - # enable gd last, so configure can pick up the previous settings
1255 - our_conf+=( $(use_with gd gd) )
1256 -
1257 - # IMAP support
1258 - if use imap ; then
1259 - our_conf+=(
1260 - $(use_with imap imap "${EPREFIX}/usr")
1261 - $(use_with ssl imap-ssl "${EPREFIX}/usr")
1262 - )
1263 - fi
1264 -
1265 - # Interbase/firebird support
1266 - our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") )
1267 -
1268 - # LDAP support
1269 - if use ldap ; then
1270 - our_conf+=(
1271 - $(use_with ldap ldap "${EPREFIX}/usr")
1272 - $(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr")
1273 - )
1274 - fi
1275 -
1276 - # MySQL support
1277 - local mysqllib="mysqlnd"
1278 - local mysqlilib="mysqlnd"
1279 - use libmysqlclient && mysqllib="${EPREFIX}/usr"
1280 - use libmysqlclient && mysqlilib="${EPREFIX}/usr/bin/mysql_config"
1281 -
1282 - our_conf+=( $(use_with mysql mysql "${mysqllib}") )
1283 - our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
1284 -
1285 - local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock"
1286 - if use mysql || use mysqli ; then
1287 - our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") )
1288 - fi
1289 -
1290 - # ODBC support
1291 - our_conf+=(
1292 - $(use_with odbc unixODBC "${EPREFIX}/usr")
1293 - $(use_with iodbc iodbc "${EPREFIX}/usr")
1294 - )
1295 -
1296 - # Oracle support
1297 - our_conf+=( $(use_with oci8-instant-client oci8) )
1298 -
1299 - # PDO support
1300 - if use pdo ; then
1301 - our_conf+=(
1302 - $(use_with mssql pdo-dblib)
1303 - $(use_with mysql pdo-mysql "${mysqllib}")
1304 - $(use_with postgres pdo-pgsql)
1305 - $(use_with sqlite pdo-sqlite "${EPREFIX}/usr")
1306 - $(use_with firebird pdo-firebird "${EPREFIX}/usr")
1307 - $(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr")
1308 - $(use_with oci8-instant-client pdo-oci)
1309 - )
1310 - fi
1311 -
1312 - # readline/libedit support
1313 - our_conf+=(
1314 - $(use_with readline readline "${EPREFIX}/usr")
1315 - $(use_with libedit libedit "${EPREFIX}/usr")
1316 - )
1317 -
1318 - # Session support
1319 - if use session ; then
1320 - our_conf+=( $(use_with sharedmem mm "${EPREFIX}/usr") )
1321 - else
1322 - our_conf+=( $(use_enable session session) )
1323 - fi
1324 -
1325 - # Use pic for shared modules such as apache2's mod_php
1326 - our_conf+=( --with-pic )
1327 -
1328 - # we use the system copy of pcre
1329 - # --with-pcre-regex affects ext/pcre
1330 - # --with-pcre-dir affects ext/filter and ext/zip
1331 - our_conf+=(
1332 - --with-pcre-regex="${EPREFIX}/usr"
1333 - --with-pcre-dir="${EPREFIX}/usr"
1334 - )
1335 -
1336 - # Catch CFLAGS problems
1337 - # Fixes bug #14067.
1338 - # Changed order to run it in reverse for bug #32022 and #12021.
1339 - replace-cpu-flags "k6*" "i586"
1340 -
1341 - # Cache the ./configure test results between SAPIs.
1342 - our_conf+=( --cache-file="${T}/config.cache" )
1343 -
1344 - # Support user-passed configuration parameters
1345 - our_conf+=( ${EXTRA_ECONF:-} )
1346 -
1347 - # Support the Apache2 extras, they must be set globally for all
1348 - # SAPIs to work correctly, especially for external PHP extensions
1349 -
1350 - mkdir -p "${WORKDIR}/sapis-build" || die
1351 - for one_sapi in $SAPIS ; do
1352 - use "${one_sapi}" || continue
1353 - php_set_ini_dir "${one_sapi}"
1354 -
1355 - # The BUILD_DIR variable is used to determine where to output
1356 - # the files that autotools creates. This was all originally
1357 - # based on the autotools-utils eclass.
1358 - BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}"
1359 - cp -a "${S}" "${BUILD_DIR}" || die
1360 - cd "${BUILD_DIR}" || die
1361 -
1362 - local sapi_conf=(
1363 - --with-config-file-path="${PHP_INI_DIR}"
1364 - --with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}"
1365 - )
1366 -
1367 - for sapi in $SAPIS ; do
1368 - case "$sapi" in
1369 - cli|cgi|embed|fpm)
1370 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
1371 - sapi_conf+=( "--enable-${sapi}" )
1372 - if [[ "fpm" == "${sapi}" ]] ; then
1373 - sapi_conf+=(
1374 - $(use_with acl fpm-acl)
1375 - $(use_with systemd fpm-systemd)
1376 - )
1377 - fi
1378 - else
1379 - sapi_conf+=( "--disable-${sapi}" )
1380 - fi
1381 - ;;
1382 -
1383 - apache2)
1384 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
1385 - sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" )
1386 - else
1387 - sapi_conf+=( --without-apxs2 )
1388 - fi
1389 - ;;
1390 - esac
1391 - done
1392 -
1393 - # Construct the $myeconfargs array by concatenating $our_conf
1394 - # (the common args) and $sapi_conf (the SAPI-specific args).
1395 - local myeconfargs=( "${our_conf[@]}" )
1396 - myeconfargs+=( "${sapi_conf[@]}" )
1397 -
1398 - pushd "${BUILD_DIR}" > /dev/null || die
1399 - econf "${myeconfargs[@]}"
1400 - popd > /dev/null || die
1401 - done
1402 -}
1403 -
1404 -src_compile() {
1405 - # snmp seems to run during src_compile, too (bug #324739)
1406 - addpredict /usr/share/snmp/mibs/.index #nowarn
1407 - addpredict /var/lib/net-snmp/mib_indexes #nowarn
1408 -
1409 - for sapi in ${SAPIS} ; do
1410 - if use "${sapi}"; then
1411 - cd "${WORKDIR}/sapis-build/$sapi" || \
1412 - die "Failed to change dir to ${WORKDIR}/sapis-build/$1"
1413 - emake
1414 - fi
1415 - done
1416 -}
1417 -
1418 -src_install() {
1419 - # see bug #324739 for what happens when we don't have that
1420 - addpredict /usr/share/snmp/mibs/.index #nowarn
1421 -
1422 - # grab the first SAPI that got built and install common files from there
1423 - local first_sapi=""
1424 - for sapi in $SAPIS ; do
1425 - if use $sapi ; then
1426 - first_sapi=$sapi
1427 - break
1428 - fi
1429 - done
1430 -
1431 - # Makefile forgets to create this before trying to write to it...
1432 - dodir "${PHP_DESTDIR#${EPREFIX}}/bin"
1433 -
1434 - # Install php environment (without any sapis)
1435 - cd "${WORKDIR}/sapis-build/$first_sapi" || die
1436 - emake INSTALL_ROOT="${D}" \
1437 - install-build install-headers install-programs
1438 -
1439 - local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)"
1440 -
1441 - # Create the directory where we'll put version-specific php scripts
1442 - keepdir "/usr/share/php${PHP_MV}"
1443 -
1444 - local sapi="", file=""
1445 - local sapi_list=""
1446 -
1447 - for sapi in ${SAPIS}; do
1448 - if use "${sapi}" ; then
1449 - einfo "Installing SAPI: ${sapi}"
1450 - cd "${WORKDIR}/sapis-build/${sapi}" || die
1451 -
1452 - if [[ "${sapi}" == "apache2" ]] ; then
1453 - # We're specifically not using emake install-sapi as libtool
1454 - # may cause unnecessary relink failures (see bug #351266)
1455 - insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/"
1456 - newins ".libs/libphp5$(get_libname)" \
1457 - "libphp${PHP_MV}$(get_libname)"
1458 - keepdir "/usr/$(get_libdir)/apache2/modules"
1459 - else
1460 - # needed each time, php_install_ini would reset it
1461 - local dest="${PHP_DESTDIR#${EPREFIX}}"
1462 - into "${dest}"
1463 - case "$sapi" in
1464 - cli)
1465 - source="sapi/cli/php"
1466 - ;;
1467 - cgi)
1468 - source="sapi/cgi/php-cgi"
1469 - ;;
1470 - fpm)
1471 - source="sapi/fpm/php-fpm"
1472 - ;;
1473 - embed)
1474 - source="libs/libphp${PHP_MV}$(get_libname)"
1475 - ;;
1476 - *)
1477 - die "unhandled sapi in src_install"
1478 - ;;
1479 - esac
1480 -
1481 - if [[ "${source}" == *"$(get_libname)" ]]; then
1482 - dolib.so "${source}"
1483 - else
1484 - dobin "${source}"
1485 - local name="$(basename ${source})"
1486 - dosym "${dest}/bin/${name}" "/usr/bin/${name}${SLOT}"
1487 - fi
1488 - fi
1489 -
1490 - php_install_ini "${sapi}"
1491 -
1492 - # construct correct SAPI string for php-config
1493 - # thanks to ferringb for the bash voodoo
1494 - if [[ "${sapi}" == "apache2" ]]; then
1495 - sapi_list="${sapi_list:+${sapi_list} }apache2handler"
1496 - else
1497 - sapi_list="${sapi_list:+${sapi_list} }${sapi}"
1498 - fi
1499 - fi
1500 - done
1501 -
1502 - # Installing opcache module
1503 - if use opcache ; then
1504 - into "${PHP_DESTDIR#${EPREFIX}}"
1505 - dolib.so "modules/opcache$(get_libname)"
1506 - fi
1507 -
1508 - # Install env.d files
1509 - newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}"
1510 - sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
1511 - sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
1512 -
1513 - # set php-config variable correctly (bug #278439)
1514 - sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \
1515 - "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die
1516 -
1517 - if use fpm ; then
1518 - if use systemd; then
1519 - systemd_newunit "${FILESDIR}/php-fpm_at.service" \
1520 - "php-fpm@${SLOT}.service"
1521 - else
1522 - systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \
1523 - "php-fpm@${SLOT}.service"
1524 - fi
1525 - fi
1526 -}
1527 -
1528 -src_test() {
1529 - echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
1530 - PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
1531 - if [[ ! -x "${PHP_BIN}" ]] ; then
1532 - ewarn "Test phase requires USE=cli, skipping"
1533 - return
1534 - else
1535 - export TEST_PHP_EXECUTABLE="${PHP_BIN}"
1536 - fi
1537 -
1538 - if [[ -x "${WORKDIR}/sapis/cgi/php-cgi" ]] ; then
1539 - export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis/cgi/php-cgi"
1540 - fi
1541 -
1542 - REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \
1543 - "session.save_path=${T}" \
1544 - "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \
1545 - "session.save_path=${T}"
1546 -
1547 - for name in ${EXPECTED_TEST_FAILURES}; do
1548 - mv "${name}.out" "${name}.out.orig" 2>/dev/null || die
1549 - done
1550 -
1551 - local failed="$(find -name '*.out')"
1552 - if [[ ${failed} != "" ]] ; then
1553 - ewarn "The following test cases failed unexpectedly:"
1554 - for name in ${failed}; do
1555 - ewarn " ${name/.out/}"
1556 - done
1557 - else
1558 - einfo "No unexpected test failures, all fine"
1559 - fi
1560 -
1561 - if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
1562 - local passed=""
1563 - for name in ${EXPECTED_TEST_FAILURES}; do
1564 - [[ -f "${name}.diff" ]] && continue
1565 - passed="${passed} ${name}"
1566 - done
1567 - if [[ ${passed} != "" ]] ; then
1568 - einfo "The following test cases passed unexpectedly:"
1569 - for name in ${passed}; do
1570 - ewarn " ${passed}"
1571 - done
1572 - else
1573 - einfo "None of the known-to-fail tests passed, all fine"
1574 - fi
1575 - fi
1576 -}
1577 -
1578 -pkg_postinst() {
1579 - # Output some general info to the user
1580 - if use apache2 ; then
1581 - elog
1582 - elog "To enable PHP in apache, you will need to add \"-D PHP\" to"
1583 - elog "your apache2 command. OpenRC users can append that string to"
1584 - elog "APACHE2_OPTS in /etc/conf.d/apache2."
1585 - elog
1586 - elog "The apache module configuration file 70_mod_php.conf is"
1587 - elog "provided (and maintained) by eselect-php."
1588 - elog
1589 - fi
1590 -
1591 - # Create the symlinks for php
1592 - for m in ${SAPIS}; do
1593 - [[ ${m} == 'embed' ]] && continue;
1594 - if use $m ; then
1595 - local ci=$(eselect php show $m)
1596 - if [[ -z $ci ]]; then
1597 - eselect php set $m php${SLOT} || die
1598 - einfo "Switched ${m} to use php:${SLOT}"
1599 - einfo
1600 - elif [[ $ci != "php${SLOT}" ]] ; then
1601 - elog "To switch $m to use php:${SLOT}, run"
1602 - elog " eselect php set $m php${SLOT}"
1603 - elog
1604 - fi
1605 - fi
1606 - done
1607 -
1608 - # Remove dead symlinks for SAPIs that were just disabled. For
1609 - # example, if the user has the cgi SAPI enabled, then he has an
1610 - # eselect-php symlink for it. If he later reinstalls PHP with
1611 - # USE="-cgi", that symlink will break. This call to eselect is
1612 - # supposed to remove that dead link per bug 572436.
1613 - eselect php cleanup || die
1614 -
1615 - if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then
1616 - elog "To build extensions for this version of PHP, you will need to"
1617 - elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable."
1618 - elog
1619 - fi
1620 -
1621 - # Warn about the removal of PHP_INI_VERSION if the user has it set.
1622 - if [[ -n "${PHP_INI_VERSION}" ]]; then
1623 - ewarn 'The PHP_INI_VERSION variable has been phased out. You may'
1624 - ewarn 'remove it from your configuration at your convenience. See'
1625 - ewarn
1626 - ewarn ' https://bugs.gentoo.org/611214'
1627 - ewarn
1628 - ewarn 'for more information.'
1629 - fi
1630 -
1631 - elog "For details on how version slotting works, please see"
1632 - elog "the wiki:"
1633 - elog
1634 - elog " https://wiki.gentoo.org/wiki/PHP"
1635 - elog
1636 -}
1637 -
1638 -pkg_postrm() {
1639 - # This serves two purposes. First, if we have just removed the last
1640 - # installed version of PHP, then this will remove any dead symlinks
1641 - # belonging to eselect-php. Second, if a user upgrades slots from
1642 - # (say) 5.6 to 7.0 and depcleans the old slot, then this will update
1643 - # his existing symlinks to point to the new 7.0 installation. The
1644 - # latter is bug 432962.
1645 - #
1646 - # Note: the eselect-php package may not be installed at this point,
1647 - # so we can't die() if this command fails.
1648 - eselect php cleanup
1649 -}
1650
1651 diff --git a/dev-lang/php/php-5.6.40-r3.ebuild b/dev-lang/php/php-5.6.40-r3.ebuild
1652 deleted file mode 100644
1653 index 224b353c58b..00000000000
1654 --- a/dev-lang/php/php-5.6.40-r3.ebuild
1655 +++ /dev/null
1656 @@ -1,789 +0,0 @@
1657 -# Copyright 1999-2019 Gentoo Authors
1658 -# Distributed under the terms of the GNU General Public License v2
1659 -
1660 -EAPI="7"
1661 -
1662 -inherit autotools flag-o-matic systemd
1663 -
1664 -PATCH_V="7.1.29bp"
1665 -
1666 -DESCRIPTION="The PHP language runtime engine"
1667 -HOMEPAGE="https://secure.php.net/"
1668 -SRC_URI="https://php.net/distributions/${P}.tar.xz
1669 - https://gitweb.gentoo.org/proj/php-patches.git/snapshot/php-patches-${PATCH_V}.tar.bz2"
1670 -
1671 -LICENSE="PHP-3.01
1672 - BSD
1673 - Zend-2.0
1674 - bcmath? ( LGPL-2.1+ )
1675 - fpm? ( BSD-2 )
1676 - gd? ( gd )
1677 - unicode? ( BSD-2 LGPL-2.1 )"
1678 -
1679 -SLOT="$(ver_cut 1-2)"
1680 -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"
1681 -
1682 -# We can build the following SAPIs in the given order
1683 -SAPIS="embed cli cgi fpm apache2"
1684 -
1685 -# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
1686 -IUSE="${IUSE}
1687 - ${SAPIS/cli/+cli}
1688 - threads"
1689 -
1690 -IUSE="${IUSE} acl bcmath berkdb bzip2 calendar cdb cjk
1691 - coverage crypt +ctype curl debug
1692 - enchant exif +fileinfo +filter firebird
1693 - flatfile ftp gd gdbm gmp +hash +iconv imap inifile
1694 - intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl
1695 - mhash mssql mysql libmysqlclient mysqli nls
1696 - oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
1697 - readline recode selinux +session sharedmem
1698 - +simplexml snmp soap sockets spell sqlite ssl
1699 - sybase-ct sysvipc systemd tidy +tokenizer truetype unicode vpx wddx
1700 - +xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib"
1701 -
1702 -# The supported (that is, autodetected) versions of BDB are listed in
1703 -# the ./configure script. Other versions *work*, but we need to stick to
1704 -# the ones that can be detected to avoid a repeat of bug #564824.
1705 -COMMON_DEPEND="
1706 - >=app-eselect/eselect-php-0.9.1[apache2?,fpm?]
1707 - >=dev-libs/libpcre-8.32[unicode]
1708 - fpm? ( acl? ( sys-apps/acl ) )
1709 - apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=]
1710 - <www-servers/apache-2.4[threads=] ) )
1711 - berkdb? ( || ( sys-libs/db:5.3
1712 - sys-libs/db:5.1
1713 - sys-libs/db:4.8
1714 - sys-libs/db:4.7
1715 - sys-libs/db:4.6
1716 - sys-libs/db:4.5 ) )
1717 - bzip2? ( app-arch/bzip2:0= )
1718 - cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
1719 - cjk? ( !gd? (
1720 - virtual/jpeg:0
1721 - media-libs/libpng:0=
1722 - sys-libs/zlib:0=
1723 - ) )
1724 - coverage? ( dev-util/lcov )
1725 - crypt? ( >=dev-libs/libmcrypt-2.4 )
1726 - curl? ( >=net-misc/curl-7.10.5 )
1727 - enchant? ( app-text/enchant )
1728 - exif? ( !gd? (
1729 - virtual/jpeg:0
1730 - media-libs/libpng:0=
1731 - sys-libs/zlib:0=
1732 - ) )
1733 - firebird? ( dev-db/firebird )
1734 - gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib:0= )
1735 - gdbm? ( >=sys-libs/gdbm-1.8.0:0= )
1736 - gmp? ( dev-libs/gmp:0= )
1737 - iconv? ( virtual/libiconv )
1738 - imap? ( virtual/imap-c-client[kerberos=,ssl=] )
1739 - intl? ( dev-libs/icu:= )
1740 - iodbc? ( dev-db/libiodbc )
1741 - kerberos? ( virtual/krb5 )
1742 - ldap? ( >=net-nds/openldap-1.2.11 )
1743 - ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 )
1744 - libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) )
1745 - mssql? ( dev-db/freetds[mssql] )
1746 - libmysqlclient? (
1747 - mysql? ( virtual/libmysqlclient:= )
1748 - mysqli? ( virtual/libmysqlclient:= )
1749 - )
1750 - nls? ( sys-devel/gettext )
1751 - oci8-instant-client? ( dev-db/oracle-instantclient-basic )
1752 - odbc? ( >=dev-db/unixODBC-1.8.13 )
1753 - postgres? ( dev-db/postgresql:* )
1754 - qdbm? ( dev-db/qdbm )
1755 - readline? ( sys-libs/readline:0= )
1756 - recode? ( app-text/recode )
1757 - sharedmem? ( dev-libs/mm )
1758 - simplexml? ( >=dev-libs/libxml2-2.6.8 )
1759 - snmp? ( >=net-analyzer/net-snmp-5.2 )
1760 - soap? ( >=dev-libs/libxml2-2.6.8 )
1761 - spell? ( >=app-text/aspell-0.50 )
1762 - sqlite? ( >=dev-db/sqlite-3.7.6.3 )
1763 - ssl? (
1764 - !libressl? ( dev-libs/openssl:0= )
1765 - libressl? ( dev-libs/libressl:0= )
1766 - )
1767 - sybase-ct? ( dev-db/freetds )
1768 - tidy? ( app-text/htmltidy )
1769 - truetype? (
1770 - =media-libs/freetype-2*
1771 - >=media-libs/t1lib-5.0.0
1772 - !gd? (
1773 - virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib:0= )
1774 - )
1775 - unicode? ( dev-libs/oniguruma:= )
1776 - vpx? ( media-libs/libvpx:0= )
1777 - wddx? ( >=dev-libs/libxml2-2.6.8 )
1778 - xml? ( >=dev-libs/libxml2-2.6.8 )
1779 - xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
1780 - xmlreader? ( >=dev-libs/libxml2-2.6.8 )
1781 - xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
1782 - xpm? (
1783 - x11-libs/libXpm
1784 - virtual/jpeg:0
1785 - media-libs/libpng:0= sys-libs/zlib:0=
1786 - )
1787 - xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
1788 - zip? ( sys-libs/zlib:0= )
1789 - zlib? ( sys-libs/zlib:0= )
1790 -"
1791 -
1792 -RDEPEND="${COMMON_DEPEND}
1793 - virtual/mta
1794 - fpm? (
1795 - selinux? ( sec-policy/selinux-phpfpm )
1796 - systemd? ( sys-apps/systemd ) )"
1797 -
1798 -DEPEND="${COMMON_DEPEND}
1799 - app-arch/xz-utils
1800 - >=sys-devel/bison-3.0.1
1801 - sys-devel/flex
1802 - >=sys-devel/m4-1.4.3
1803 - >=sys-devel/libtool-1.5.18"
1804 -
1805 -# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
1806 -REQUIRED_USE="
1807 - || ( cli cgi fpm apache2 embed )
1808 - cli? ( ^^ ( readline libedit ) )
1809 - truetype? ( gd zlib )
1810 - vpx? ( gd zlib )
1811 - cjk? ( gd zlib )
1812 - exif? ( gd zlib )
1813 - xpm? ( gd zlib )
1814 - gd? ( zlib )
1815 - simplexml? ( xml )
1816 - soap? ( xml )
1817 - wddx? ( xml )
1818 - xmlrpc? ( || ( xml iconv ) )
1819 - xmlreader? ( xml )
1820 - xslt? ( xml )
1821 - ldap-sasl? ( ldap )
1822 - mhash? ( hash )
1823 - phar? ( hash )
1824 - recode? ( !imap !mysql !mysqli !libmysqlclient )
1825 - libmysqlclient? ( || (
1826 - mysql
1827 - mysqli
1828 - pdo
1829 - ) )
1830 -
1831 - qdbm? ( !gdbm )
1832 - readline? ( !libedit )
1833 - sharedmem? ( !threads )
1834 -"
1835 -
1836 -PHP_MV="$(ver_cut 1)"
1837 -
1838 -php_install_ini() {
1839 - local phpsapi="${1}"
1840 -
1841 - # work out where we are installing the ini file
1842 - php_set_ini_dir "${phpsapi}"
1843 -
1844 - # Always install the production INI file, bug 611214.
1845 - local phpinisrc="php.ini-production-${phpsapi}"
1846 - cp php.ini-production "${phpinisrc}" || die
1847 -
1848 - # default to /tmp for save_path, bug #282768
1849 - sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die
1850 -
1851 - # Set the extension dir
1852 - sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \
1853 - -i "${phpinisrc}" || die
1854 -
1855 - # Set the include path to point to where we want to find PEAR packages
1856 - sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die
1857 -
1858 - dodir "${PHP_INI_DIR#${EPREFIX}}"
1859 - insinto "${PHP_INI_DIR#${EPREFIX}}"
1860 - newins "${phpinisrc}" php.ini
1861 -
1862 - elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}"
1863 - elog
1864 -
1865 - dodir "${PHP_EXT_INI_DIR#${EPREFIX}}"
1866 - dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}"
1867 -
1868 - if use opcache; then
1869 - elog "Adding opcache to $PHP_EXT_INI_DIR"
1870 - echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \
1871 - "${D}/${PHP_EXT_INI_DIR}"/opcache.ini
1872 - dosym "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" \
1873 - "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini"
1874 - fi
1875 -
1876 - # SAPI-specific handling
1877 - if [[ "${sapi}" == "fpm" ]] ; then
1878 - einfo "Installing FPM config file php-fpm.conf"
1879 - insinto "${PHP_INI_DIR#${EPREFIX}}"
1880 - doins sapi/fpm/php-fpm.conf
1881 - fi
1882 -
1883 - dodoc php.ini-{development,production}
1884 -}
1885 -
1886 -php_set_ini_dir() {
1887 - PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}"
1888 - PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
1889 - PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
1890 -}
1891 -
1892 -src_prepare() {
1893 - local patchdir="${WORKDIR}/php-patches-${PATCH_V}"
1894 -
1895 - eapply "${patchdir}/"
1896 -
1897 - # Copy test binaries from patches
1898 - cp "${patchdir}/bug77540.jpg" \
1899 - "${patchdir}/bug77753.tiff" "${patchdir}/bug77831.tiff" \
1900 - "${patchdir}/bug77950.tiff" \
1901 - "${patchdir}/bug77563.jpg" "ext/exif/tests/" || die
1902 -
1903 - # Change PHP branding
1904 - # Get the alpha/beta/rc version
1905 - sed -re "s|^(PHP_EXTRA_VERSION=\").*(\")|\1-pl${PR/r/}-gentoo\2|g" \
1906 - -i configure.in || die "Unable to change PHP branding"
1907 -
1908 - # Patch PHP to show Gentoo as the server platform
1909 - sed -e 's/PHP_UNAME=`uname -a | xargs`/PHP_UNAME=`uname -s -n -r -v | xargs`/g' \
1910 - -i configure.in || die "Failed to fix server platform name"
1911 -
1912 - # Prevent PHP from activating the Apache config,
1913 - # as we will do that ourselves
1914 - sed -i \
1915 - -e "s,-i -a -n php${PHP_MV},-i -n php${PHP_MV},g" \
1916 - -e "s,-i -A -n php${PHP_MV},-i -n php${PHP_MV},g" \
1917 - configure sapi/apache2filter/config.m4 sapi/apache2handler/config.m4 \
1918 - || die
1919 -
1920 - # Patch PHP to support heimdal instead of mit-krb5
1921 - if has_version "app-crypt/heimdal" ; then
1922 - sed -e 's|gssapi_krb5|gssapi|g' -i acinclude.m4 \
1923 - || die "Failed to fix heimdal libname"
1924 - sed -e 's|PHP_ADD_LIBRARY(k5crypto, 1, $1)||g' -i acinclude.m4 \
1925 - || die "Failed to fix heimdal crypt library reference"
1926 - fi
1927 -
1928 - eapply_user
1929 -
1930 - # Force rebuilding aclocal.m4
1931 - rm -f aclocal.m4 || die "failed to remove aclocal.m4 in src_prepare"
1932 -
1933 - mv configure.in configure.ac || die
1934 -
1935 - eautoreconf
1936 -
1937 - if [[ ${CHOST} == *-darwin* ]] ; then
1938 - # http://bugs.php.net/bug.php?id=48795, bug #343481
1939 - sed -i -e '/BUILD_CGI="\\$(CC)/s/CC/CXX/' configure || die
1940 - fi
1941 -}
1942 -
1943 -src_configure() {
1944 - addpredict /usr/share/snmp/mibs/.index #nowarn
1945 - addpredict /var/lib/net-snmp/mib_indexes #nowarn
1946 -
1947 - PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
1948 -
1949 - # The php-fpm config file wants localstatedir to be ${EPREFIX}/var
1950 - # and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002.
1951 - local our_conf=(
1952 - --prefix="${PHP_DESTDIR}"
1953 - --mandir="${PHP_DESTDIR}/man"
1954 - --infodir="${PHP_DESTDIR}/info"
1955 - --libdir="${PHP_DESTDIR}/lib"
1956 - --with-libdir="$(get_libdir)"
1957 - --localstatedir="${EPREFIX}/var"
1958 - --without-pear
1959 - $(use_enable threads maintainer-zts)
1960 - )
1961 -
1962 - our_conf+=(
1963 - $(use_enable bcmath bcmath)
1964 - $(use_with bzip2 bz2 "${EPREFIX}/usr")
1965 - $(use_enable calendar calendar)
1966 - $(use_enable coverage gcov)
1967 - $(use_enable ctype ctype)
1968 - $(use_with curl curl "${EPREFIX}/usr")
1969 - $(use_enable xml dom)
1970 - $(use_with enchant enchant "${EPREFIX}/usr")
1971 - $(use_enable exif exif)
1972 - $(use_enable fileinfo fileinfo)
1973 - $(use_enable filter filter)
1974 - $(use_enable ftp ftp)
1975 - $(use_with nls gettext "${EPREFIX}/usr")
1976 - $(use_with gmp gmp "${EPREFIX}/usr")
1977 - $(use_enable hash hash)
1978 - $(use_with mhash mhash "${EPREFIX}/usr")
1979 - $(use_with iconv iconv \
1980 - $(use elibc_glibc || use elibc_musl || use elibc_FreeBSD || echo "${EPREFIX}/usr"))
1981 - $(use_enable intl intl)
1982 - $(use_enable ipv6 ipv6)
1983 - $(use_enable json json)
1984 - $(use_with kerberos kerberos "${EPREFIX}/usr")
1985 - $(use_enable xml libxml)
1986 - $(use_with xml libxml-dir "${EPREFIX}/usr")
1987 - $(use_enable unicode mbstring)
1988 - $(use_with crypt mcrypt "${EPREFIX}/usr")
1989 - $(use_with mssql mssql "${EPREFIX}/usr")
1990 - $(use_with unicode onig "${EPREFIX}/usr")
1991 - $(use_with ssl openssl "${EPREFIX}/usr")
1992 - $(use_with ssl openssl-dir "${EPREFIX}/usr")
1993 - $(use_enable pcntl pcntl)
1994 - $(use_enable phar phar)
1995 - $(use_enable pdo pdo)
1996 - $(use_enable opcache opcache)
1997 - $(use_with postgres pgsql "${EPREFIX}/usr")
1998 - $(use_enable posix posix)
1999 - $(use_with spell pspell "${EPREFIX}/usr")
2000 - $(use_with recode recode "${EPREFIX}/usr")
2001 - $(use_enable simplexml simplexml)
2002 - $(use_enable sharedmem shmop)
2003 - $(use_with snmp snmp "${EPREFIX}/usr")
2004 - $(use_enable soap soap)
2005 - $(use_enable sockets sockets)
2006 - $(use_with sqlite sqlite3 "${EPREFIX}/usr")
2007 - $(use_with sybase-ct sybase-ct "${EPREFIX}/usr")
2008 - $(use_enable sysvipc sysvmsg)
2009 - $(use_enable sysvipc sysvsem)
2010 - $(use_enable sysvipc sysvshm)
2011 - $(use_with tidy tidy "${EPREFIX}/usr")
2012 - $(use_enable tokenizer tokenizer)
2013 - $(use_enable wddx wddx)
2014 - $(use_enable xml xml)
2015 - $(use_enable xmlreader xmlreader)
2016 - $(use_enable xmlwriter xmlwriter)
2017 - $(use_with xmlrpc xmlrpc)
2018 - $(use_with xslt xsl "${EPREFIX}/usr")
2019 - $(use_enable zip zip)
2020 - $(use_with zlib zlib "${EPREFIX}/usr")
2021 - $(use_enable debug debug)
2022 - )
2023 -
2024 - # DBA support
2025 - if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
2026 - || use qdbm ; then
2027 - our_conf+=( "--enable-dba${shared}" )
2028 - fi
2029 -
2030 - # DBA drivers support
2031 - our_conf+=(
2032 - $(use_with cdb cdb)
2033 - $(use_with berkdb db4 "${EPREFIX}/usr")
2034 - $(use_enable flatfile flatfile)
2035 - $(use_with gdbm gdbm "${EPREFIX}/usr")
2036 - $(use_enable inifile inifile)
2037 - $(use_with qdbm qdbm "${EPREFIX}/usr")
2038 - )
2039 -
2040 - # Support for the GD graphics library
2041 - our_conf+=(
2042 - $(use_with truetype freetype-dir "${EPREFIX}/usr")
2043 - $(use_with truetype t1lib "${EPREFIX}/usr")
2044 - $(use_enable cjk gd-jis-conv)
2045 - $(use_with gd jpeg-dir "${EPREFIX}/usr")
2046 - $(use_with gd png-dir "${EPREFIX}/usr")
2047 - $(use_with xpm xpm-dir "${EPREFIX}/usr")
2048 - $(use_with vpx vpx-dir "${EPREFIX}/usr")
2049 - )
2050 - # enable gd last, so configure can pick up the previous settings
2051 - our_conf+=( $(use_with gd gd) )
2052 -
2053 - # IMAP support
2054 - if use imap ; then
2055 - our_conf+=(
2056 - $(use_with imap imap "${EPREFIX}/usr")
2057 - $(use_with ssl imap-ssl "${EPREFIX}/usr")
2058 - )
2059 - fi
2060 -
2061 - # Interbase/firebird support
2062 - our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") )
2063 -
2064 - # LDAP support
2065 - if use ldap ; then
2066 - our_conf+=(
2067 - $(use_with ldap ldap "${EPREFIX}/usr")
2068 - $(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr")
2069 - )
2070 - fi
2071 -
2072 - # MySQL support
2073 - local mysqllib="mysqlnd"
2074 - local mysqlilib="mysqlnd"
2075 - use libmysqlclient && mysqllib="${EPREFIX}/usr"
2076 - use libmysqlclient && mysqlilib="${EPREFIX}/usr/bin/mysql_config"
2077 -
2078 - our_conf+=( $(use_with mysql mysql "${mysqllib}") )
2079 - our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
2080 -
2081 - local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock"
2082 - if use mysql || use mysqli ; then
2083 - our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") )
2084 - fi
2085 -
2086 - # ODBC support
2087 - our_conf+=(
2088 - $(use_with odbc unixODBC "${EPREFIX}/usr")
2089 - $(use_with iodbc iodbc "${EPREFIX}/usr")
2090 - )
2091 -
2092 - # Oracle support
2093 - our_conf+=( $(use_with oci8-instant-client oci8) )
2094 -
2095 - # PDO support
2096 - if use pdo ; then
2097 - our_conf+=(
2098 - $(use_with mssql pdo-dblib)
2099 - $(use_with mysql pdo-mysql "${mysqllib}")
2100 - $(use_with postgres pdo-pgsql)
2101 - $(use_with sqlite pdo-sqlite "${EPREFIX}/usr")
2102 - $(use_with firebird pdo-firebird "${EPREFIX}/usr")
2103 - $(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr")
2104 - $(use_with oci8-instant-client pdo-oci)
2105 - )
2106 - fi
2107 -
2108 - # readline/libedit support
2109 - our_conf+=(
2110 - $(use_with readline readline "${EPREFIX}/usr")
2111 - $(use_with libedit libedit "${EPREFIX}/usr")
2112 - )
2113 -
2114 - # Session support
2115 - if use session ; then
2116 - our_conf+=( $(use_with sharedmem mm "${EPREFIX}/usr") )
2117 - else
2118 - our_conf+=( $(use_enable session session) )
2119 - fi
2120 -
2121 - # Use pic for shared modules such as apache2's mod_php
2122 - our_conf+=( --with-pic )
2123 -
2124 - # we use the system copy of pcre
2125 - # --with-pcre-regex affects ext/pcre
2126 - # --with-pcre-dir affects ext/filter and ext/zip
2127 - our_conf+=(
2128 - --with-pcre-regex="${EPREFIX}/usr"
2129 - --with-pcre-dir="${EPREFIX}/usr"
2130 - )
2131 -
2132 - # Catch CFLAGS problems
2133 - # Fixes bug #14067.
2134 - # Changed order to run it in reverse for bug #32022 and #12021.
2135 - replace-cpu-flags "k6*" "i586"
2136 -
2137 - # Cache the ./configure test results between SAPIs.
2138 - our_conf+=( --cache-file="${T}/config.cache" )
2139 -
2140 - # Support user-passed configuration parameters
2141 - our_conf+=( ${EXTRA_ECONF:-} )
2142 -
2143 - # Support the Apache2 extras, they must be set globally for all
2144 - # SAPIs to work correctly, especially for external PHP extensions
2145 -
2146 - mkdir -p "${WORKDIR}/sapis-build" || die
2147 - for one_sapi in $SAPIS ; do
2148 - use "${one_sapi}" || continue
2149 - php_set_ini_dir "${one_sapi}"
2150 -
2151 - # The BUILD_DIR variable is used to determine where to output
2152 - # the files that autotools creates. This was all originally
2153 - # based on the autotools-utils eclass.
2154 - BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}"
2155 - cp -a "${S}" "${BUILD_DIR}" || die
2156 - cd "${BUILD_DIR}" || die
2157 -
2158 - local sapi_conf=(
2159 - --with-config-file-path="${PHP_INI_DIR}"
2160 - --with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}"
2161 - )
2162 -
2163 - for sapi in $SAPIS ; do
2164 - case "$sapi" in
2165 - cli|cgi|embed|fpm)
2166 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
2167 - sapi_conf+=( "--enable-${sapi}" )
2168 - if [[ "fpm" == "${sapi}" ]] ; then
2169 - sapi_conf+=(
2170 - $(use_with acl fpm-acl)
2171 - $(use_with systemd fpm-systemd)
2172 - )
2173 - fi
2174 - else
2175 - sapi_conf+=( "--disable-${sapi}" )
2176 - fi
2177 - ;;
2178 -
2179 - apache2)
2180 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
2181 - sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" )
2182 - else
2183 - sapi_conf+=( --without-apxs2 )
2184 - fi
2185 - ;;
2186 - esac
2187 - done
2188 -
2189 - # Construct the $myeconfargs array by concatenating $our_conf
2190 - # (the common args) and $sapi_conf (the SAPI-specific args).
2191 - local myeconfargs=( "${our_conf[@]}" )
2192 - myeconfargs+=( "${sapi_conf[@]}" )
2193 -
2194 - pushd "${BUILD_DIR}" > /dev/null || die
2195 - econf "${myeconfargs[@]}"
2196 - popd > /dev/null || die
2197 - done
2198 -}
2199 -
2200 -src_compile() {
2201 - # snmp seems to run during src_compile, too (bug #324739)
2202 - addpredict /usr/share/snmp/mibs/.index #nowarn
2203 - addpredict /var/lib/net-snmp/mib_indexes #nowarn
2204 -
2205 - for sapi in ${SAPIS} ; do
2206 - if use "${sapi}"; then
2207 - cd "${WORKDIR}/sapis-build/$sapi" || \
2208 - die "Failed to change dir to ${WORKDIR}/sapis-build/$1"
2209 - emake
2210 - fi
2211 - done
2212 -}
2213 -
2214 -src_install() {
2215 - # see bug #324739 for what happens when we don't have that
2216 - addpredict /usr/share/snmp/mibs/.index #nowarn
2217 -
2218 - # grab the first SAPI that got built and install common files from there
2219 - local first_sapi=""
2220 - for sapi in $SAPIS ; do
2221 - if use $sapi ; then
2222 - first_sapi=$sapi
2223 - break
2224 - fi
2225 - done
2226 -
2227 - # Makefile forgets to create this before trying to write to it...
2228 - dodir "${PHP_DESTDIR#${EPREFIX}}/bin"
2229 -
2230 - # Install php environment (without any sapis)
2231 - cd "${WORKDIR}/sapis-build/$first_sapi" || die
2232 - emake INSTALL_ROOT="${D}" \
2233 - install-build install-headers install-programs
2234 -
2235 - local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)"
2236 -
2237 - # Create the directory where we'll put version-specific php scripts
2238 - keepdir "/usr/share/php${PHP_MV}"
2239 -
2240 - local sapi="", file=""
2241 - local sapi_list=""
2242 -
2243 - for sapi in ${SAPIS}; do
2244 - if use "${sapi}" ; then
2245 - einfo "Installing SAPI: ${sapi}"
2246 - cd "${WORKDIR}/sapis-build/${sapi}" || die
2247 -
2248 - if [[ "${sapi}" == "apache2" ]] ; then
2249 - # We're specifically not using emake install-sapi as libtool
2250 - # may cause unnecessary relink failures (see bug #351266)
2251 - insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/"
2252 - newins ".libs/libphp5$(get_libname)" \
2253 - "libphp${PHP_MV}$(get_libname)"
2254 - keepdir "/usr/$(get_libdir)/apache2/modules"
2255 - else
2256 - # needed each time, php_install_ini would reset it
2257 - local dest="${PHP_DESTDIR#${EPREFIX}}"
2258 - into "${dest}"
2259 - case "$sapi" in
2260 - cli)
2261 - source="sapi/cli/php"
2262 - ;;
2263 - cgi)
2264 - source="sapi/cgi/php-cgi"
2265 - ;;
2266 - fpm)
2267 - source="sapi/fpm/php-fpm"
2268 - ;;
2269 - embed)
2270 - source="libs/libphp${PHP_MV}$(get_libname)"
2271 - ;;
2272 - *)
2273 - die "unhandled sapi in src_install"
2274 - ;;
2275 - esac
2276 -
2277 - if [[ "${source}" == *"$(get_libname)" ]]; then
2278 - dolib.so "${source}"
2279 - else
2280 - dobin "${source}"
2281 - local name="$(basename ${source})"
2282 - dosym "${dest}/bin/${name}" "/usr/bin/${name}${SLOT}"
2283 - fi
2284 - fi
2285 -
2286 - php_install_ini "${sapi}"
2287 -
2288 - # construct correct SAPI string for php-config
2289 - # thanks to ferringb for the bash voodoo
2290 - if [[ "${sapi}" == "apache2" ]]; then
2291 - sapi_list="${sapi_list:+${sapi_list} }apache2handler"
2292 - else
2293 - sapi_list="${sapi_list:+${sapi_list} }${sapi}"
2294 - fi
2295 - fi
2296 - done
2297 -
2298 - # Installing opcache module
2299 - if use opcache ; then
2300 - into "${PHP_DESTDIR#${EPREFIX}}"
2301 - dolib.so "modules/opcache$(get_libname)"
2302 - fi
2303 -
2304 - # Install env.d files
2305 - newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}"
2306 - sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
2307 - sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
2308 -
2309 - # set php-config variable correctly (bug #278439)
2310 - sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \
2311 - "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die
2312 -
2313 - if use fpm ; then
2314 - if use systemd; then
2315 - systemd_newunit "${FILESDIR}/php-fpm_at.service" \
2316 - "php-fpm@${SLOT}.service"
2317 - else
2318 - systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \
2319 - "php-fpm@${SLOT}.service"
2320 - fi
2321 - fi
2322 -}
2323 -
2324 -src_test() {
2325 - echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
2326 - PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
2327 - if [[ ! -x "${PHP_BIN}" ]] ; then
2328 - ewarn "Test phase requires USE=cli, skipping"
2329 - return
2330 - else
2331 - export TEST_PHP_EXECUTABLE="${PHP_BIN}"
2332 - fi
2333 -
2334 - if [[ -x "${WORKDIR}/sapis/cgi/php-cgi" ]] ; then
2335 - export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis/cgi/php-cgi"
2336 - fi
2337 -
2338 - REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \
2339 - "session.save_path=${T}" \
2340 - "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \
2341 - "session.save_path=${T}"
2342 -
2343 - for name in ${EXPECTED_TEST_FAILURES}; do
2344 - mv "${name}.out" "${name}.out.orig" 2>/dev/null || die
2345 - done
2346 -
2347 - local failed="$(find -name '*.out')"
2348 - if [[ ${failed} != "" ]] ; then
2349 - ewarn "The following test cases failed unexpectedly:"
2350 - for name in ${failed}; do
2351 - ewarn " ${name/.out/}"
2352 - done
2353 - else
2354 - einfo "No unexpected test failures, all fine"
2355 - fi
2356 -
2357 - if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
2358 - local passed=""
2359 - for name in ${EXPECTED_TEST_FAILURES}; do
2360 - [[ -f "${name}.diff" ]] && continue
2361 - passed="${passed} ${name}"
2362 - done
2363 - if [[ ${passed} != "" ]] ; then
2364 - einfo "The following test cases passed unexpectedly:"
2365 - for name in ${passed}; do
2366 - ewarn " ${passed}"
2367 - done
2368 - else
2369 - einfo "None of the known-to-fail tests passed, all fine"
2370 - fi
2371 - fi
2372 -}
2373 -
2374 -pkg_postinst() {
2375 - # Output some general info to the user
2376 - if use apache2 ; then
2377 - elog
2378 - elog "To enable PHP in apache, you will need to add \"-D PHP\" to"
2379 - elog "your apache2 command. OpenRC users can append that string to"
2380 - elog "APACHE2_OPTS in /etc/conf.d/apache2."
2381 - elog
2382 - elog "The apache module configuration file 70_mod_php.conf is"
2383 - elog "provided (and maintained) by eselect-php."
2384 - elog
2385 - fi
2386 -
2387 - # Create the symlinks for php
2388 - for m in ${SAPIS}; do
2389 - [[ ${m} == 'embed' ]] && continue;
2390 - if use $m ; then
2391 - local ci=$(eselect php show $m)
2392 - if [[ -z $ci ]]; then
2393 - eselect php set $m php${SLOT} || die
2394 - einfo "Switched ${m} to use php:${SLOT}"
2395 - einfo
2396 - elif [[ $ci != "php${SLOT}" ]] ; then
2397 - elog "To switch $m to use php:${SLOT}, run"
2398 - elog " eselect php set $m php${SLOT}"
2399 - elog
2400 - fi
2401 - fi
2402 - done
2403 -
2404 - # Remove dead symlinks for SAPIs that were just disabled. For
2405 - # example, if the user has the cgi SAPI enabled, then he has an
2406 - # eselect-php symlink for it. If he later reinstalls PHP with
2407 - # USE="-cgi", that symlink will break. This call to eselect is
2408 - # supposed to remove that dead link per bug 572436.
2409 - eselect php cleanup || die
2410 -
2411 - if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then
2412 - elog "To build extensions for this version of PHP, you will need to"
2413 - elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable."
2414 - elog
2415 - fi
2416 -
2417 - # Warn about the removal of PHP_INI_VERSION if the user has it set.
2418 - if [[ -n "${PHP_INI_VERSION}" ]]; then
2419 - ewarn 'The PHP_INI_VERSION variable has been phased out. You may'
2420 - ewarn 'remove it from your configuration at your convenience. See'
2421 - ewarn
2422 - ewarn ' https://bugs.gentoo.org/611214'
2423 - ewarn
2424 - ewarn 'for more information.'
2425 - fi
2426 -
2427 - elog "For details on how version slotting works, please see"
2428 - elog "the wiki:"
2429 - elog
2430 - elog " https://wiki.gentoo.org/wiki/PHP"
2431 - elog
2432 -}
2433 -
2434 -pkg_postrm() {
2435 - # This serves two purposes. First, if we have just removed the last
2436 - # installed version of PHP, then this will remove any dead symlinks
2437 - # belonging to eselect-php. Second, if a user upgrades slots from
2438 - # (say) 5.6 to 7.0 and depcleans the old slot, then this will update
2439 - # his existing symlinks to point to the new 7.0 installation. The
2440 - # latter is bug 432962.
2441 - #
2442 - # Note: the eselect-php package may not be installed at this point,
2443 - # so we can't die() if this command fails.
2444 - eselect php cleanup
2445 -}
2446
2447 diff --git a/dev-lang/php/php-7.1.27.ebuild b/dev-lang/php/php-7.1.27.ebuild
2448 deleted file mode 100644
2449 index 3be3c028962..00000000000
2450 --- a/dev-lang/php/php-7.1.27.ebuild
2451 +++ /dev/null
2452 @@ -1,737 +0,0 @@
2453 -# Copyright 1999-2019 Gentoo Authors
2454 -# Distributed under the terms of the GNU General Public License v2
2455 -
2456 -EAPI="7"
2457 -
2458 -inherit flag-o-matic systemd autotools
2459 -
2460 -DESCRIPTION="The PHP language runtime engine"
2461 -HOMEPAGE="https://php.net/"
2462 -SRC_URI="https://php.net/distributions/${P}.tar.xz"
2463 -
2464 -LICENSE="PHP-3.01
2465 - BSD
2466 - Zend-2.0
2467 - bcmath? ( LGPL-2.1+ )
2468 - fpm? ( BSD-2 )
2469 - gd? ( gd )
2470 - unicode? ( BSD-2 LGPL-2.1 )"
2471 -
2472 -SLOT="$(ver_cut 1-2)"
2473 -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"
2474 -
2475 -# We can build the following SAPIs in the given order
2476 -SAPIS="embed cli cgi fpm apache2 phpdbg"
2477 -
2478 -# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
2479 -IUSE="${IUSE}
2480 - ${SAPIS/cli/+cli}
2481 - threads"
2482 -
2483 -IUSE="${IUSE} acl bcmath berkdb bzip2 calendar cdb cjk
2484 - coverage crypt +ctype curl debug
2485 - enchant exif +fileinfo +filter firebird
2486 - flatfile ftp gd gdbm gmp +hash +iconv imap inifile
2487 - intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl
2488 - mhash mssql mysql mysqli nls
2489 - oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
2490 - readline recode selinux +session session-mm sharedmem
2491 - +simplexml snmp soap sockets spell sqlite ssl
2492 - sysvipc systemd test tidy +tokenizer truetype unicode wddx webp
2493 - +xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib"
2494 -
2495 -# The supported (that is, autodetected) versions of BDB are listed in
2496 -# the ./configure script. Other versions *work*, but we need to stick to
2497 -# the ones that can be detected to avoid a repeat of bug #564824.
2498 -COMMON_DEPEND="
2499 - >=app-eselect/eselect-php-0.9.1[apache2?,fpm?]
2500 - >=dev-libs/libpcre-8.32[unicode]
2501 - fpm? ( acl? ( sys-apps/acl ) )
2502 - apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=]
2503 - <www-servers/apache-2.4[threads=] ) )
2504 - berkdb? ( || ( sys-libs/db:5.3
2505 - sys-libs/db:5.1
2506 - sys-libs/db:4.8
2507 - sys-libs/db:4.7
2508 - sys-libs/db:4.6
2509 - sys-libs/db:4.5 ) )
2510 - bzip2? ( app-arch/bzip2:0= )
2511 - cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
2512 - coverage? ( dev-util/lcov )
2513 - crypt? ( >=dev-libs/libmcrypt-2.4 )
2514 - curl? ( >=net-misc/curl-7.10.5 )
2515 - enchant? ( <app-text/enchant-2.0:0 )
2516 - firebird? ( dev-db/firebird )
2517 - gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib )
2518 - gdbm? ( >=sys-libs/gdbm-1.8.0:0= )
2519 - gmp? ( dev-libs/gmp:0= )
2520 - iconv? ( virtual/libiconv )
2521 - imap? ( virtual/imap-c-client[kerberos=,ssl=] )
2522 - intl? ( dev-libs/icu:= )
2523 - iodbc? ( dev-db/libiodbc )
2524 - kerberos? ( virtual/krb5 )
2525 - ldap? ( >=net-nds/openldap-1.2.11 )
2526 - ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 )
2527 - libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) )
2528 - mssql? ( dev-db/freetds[mssql] )
2529 - nls? ( sys-devel/gettext )
2530 - oci8-instant-client? ( dev-db/oracle-instantclient-basic )
2531 - odbc? ( >=dev-db/unixODBC-1.8.13 )
2532 - postgres? ( dev-db/postgresql:* )
2533 - qdbm? ( dev-db/qdbm )
2534 - readline? ( sys-libs/readline:0= )
2535 - recode? ( app-text/recode )
2536 - session-mm? ( dev-libs/mm )
2537 - simplexml? ( >=dev-libs/libxml2-2.6.8 )
2538 - snmp? ( >=net-analyzer/net-snmp-5.2 )
2539 - soap? ( >=dev-libs/libxml2-2.6.8 )
2540 - spell? ( >=app-text/aspell-0.50 )
2541 - sqlite? ( >=dev-db/sqlite-3.7.6.3 )
2542 - ssl? (
2543 - !libressl? ( dev-libs/openssl:0= )
2544 - libressl? ( dev-libs/libressl:0= )
2545 - )
2546 - tidy? ( || ( app-text/tidy-html5 app-text/htmltidy ) )
2547 - truetype? ( =media-libs/freetype-2* )
2548 - unicode? ( dev-libs/oniguruma:= )
2549 - wddx? ( >=dev-libs/libxml2-2.6.8 )
2550 - webp? ( media-libs/libwebp:0= )
2551 - xml? ( >=dev-libs/libxml2-2.6.8 )
2552 - xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
2553 - xmlreader? ( >=dev-libs/libxml2-2.6.8 )
2554 - xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
2555 - xpm? ( x11-libs/libXpm )
2556 - xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
2557 - zip? ( sys-libs/zlib:0= )
2558 - zlib? ( sys-libs/zlib:0= )
2559 -"
2560 -
2561 -RDEPEND="${COMMON_DEPEND}
2562 - virtual/mta
2563 - fpm? (
2564 - selinux? ( sec-policy/selinux-phpfpm )
2565 - systemd? ( sys-apps/systemd ) )"
2566 -
2567 -# Bison isn't actually needed when building from a release tarball
2568 -# However, the configure script will warn if it's absent or if you
2569 -# have an incompatible version installed. See bug 593278.
2570 -DEPEND="${COMMON_DEPEND}
2571 - app-arch/xz-utils
2572 - >=sys-devel/bison-3.0.1"
2573 -
2574 -BDEPEND="virtual/pkgconfig"
2575 -
2576 -# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
2577 -REQUIRED_USE="
2578 - || ( cli cgi fpm apache2 embed phpdbg )
2579 - cli? ( ^^ ( readline libedit ) )
2580 - truetype? ( gd zlib )
2581 - webp? ( gd zlib )
2582 - cjk? ( gd zlib )
2583 - exif? ( gd zlib )
2584 - xpm? ( gd zlib )
2585 - gd? ( zlib )
2586 - simplexml? ( xml )
2587 - soap? ( xml )
2588 - wddx? ( xml )
2589 - xmlrpc? ( || ( xml iconv ) )
2590 - xmlreader? ( xml )
2591 - xslt? ( xml )
2592 - ldap-sasl? ( ldap )
2593 - mhash? ( hash )
2594 - phar? ( hash )
2595 - qdbm? ( !gdbm )
2596 - readline? ( !libedit )
2597 - recode? ( !imap !mysqli !mysql )
2598 - session-mm? ( session !threads )
2599 - mysql? ( hash || ( mysqli pdo ) )
2600 - mysqli? ( hash )
2601 -"
2602 -PATCHES=(
2603 - "${FILESDIR}/php-freetype-2.9.1.patch"
2604 - "${FILESDIR}/php-7.1.25-intl-use-icu-namespace.patch"
2605 -)
2606 -
2607 -PHP_MV="$(ver_cut 1)"
2608 -
2609 -php_install_ini() {
2610 - local phpsapi="${1}"
2611 -
2612 - # work out where we are installing the ini file
2613 - php_set_ini_dir "${phpsapi}"
2614 -
2615 - # Always install the production INI file, bug 611214.
2616 - local phpinisrc="php.ini-production-${phpsapi}"
2617 - cp php.ini-production "${phpinisrc}" || die
2618 -
2619 - # default to /tmp for save_path, bug #282768
2620 - sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die
2621 -
2622 - # Set the extension dir
2623 - sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \
2624 - -i "${phpinisrc}" || die
2625 -
2626 - # Set the include path to point to where we want to find PEAR packages
2627 - sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die
2628 -
2629 - dodir "${PHP_INI_DIR#${EPREFIX}}"
2630 - insinto "${PHP_INI_DIR#${EPREFIX}}"
2631 - newins "${phpinisrc}" php.ini
2632 -
2633 - elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}"
2634 - elog
2635 -
2636 - dodir "${PHP_EXT_INI_DIR#${EPREFIX}}"
2637 - dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}"
2638 -
2639 - if use opcache; then
2640 - elog "Adding opcache to $PHP_EXT_INI_DIR"
2641 - echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \
2642 - "${D}/${PHP_EXT_INI_DIR}"/opcache.ini
2643 - dosym "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" \
2644 - "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini"
2645 - fi
2646 -
2647 - # SAPI-specific handling
2648 - if [[ "${sapi}" == "fpm" ]] ; then
2649 - einfo "Installing FPM config files php-fpm.conf and www.conf"
2650 - insinto "${PHP_INI_DIR#${EPREFIX}}"
2651 - doins sapi/fpm/php-fpm.conf
2652 - insinto "${PHP_INI_DIR#${EPREFIX}}/fpm.d"
2653 - doins sapi/fpm/www.conf
2654 - fi
2655 -
2656 - dodoc php.ini-{development,production}
2657 -}
2658 -
2659 -php_set_ini_dir() {
2660 - PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}"
2661 - PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
2662 - PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
2663 -}
2664 -
2665 -src_prepare() {
2666 - default
2667 -
2668 - # In php-7.x, the FPM pool configuration files have been split off
2669 - # of the main config. By default the pool config files go in
2670 - # e.g. /etc/php-fpm.d, which isn't slotted. So here we move the
2671 - # include directory to a subdirectory "fpm.d" of $PHP_INI_DIR. Later
2672 - # we'll install the pool configuration file "www.conf" there.
2673 - php_set_ini_dir fpm
2674 - sed -i "s~^include=.*$~include=${PHP_INI_DIR}/fpm.d/*.conf~" \
2675 - sapi/fpm/php-fpm.conf.in \
2676 - || die 'failed to move the include directory in php-fpm.conf'
2677 -
2678 - # Bug 669566 - necessary so that build tools are updated for commands like pecl
2679 - # Force rebuilding aclocal.m4
2680 - rm -f aclocal.m4 || die "failed to remove aclocal.m4 in src_prepare"
2681 - eautoreconf
2682 -}
2683 -
2684 -src_configure() {
2685 - addpredict /usr/share/snmp/mibs/.index #nowarn
2686 - addpredict /var/lib/net-snmp/mib_indexes #nowarn
2687 -
2688 - PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
2689 -
2690 - # The php-fpm config file wants localstatedir to be ${EPREFIX}/var
2691 - # and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002.
2692 - local our_conf=(
2693 - --prefix="${PHP_DESTDIR}"
2694 - --mandir="${PHP_DESTDIR}/man"
2695 - --infodir="${PHP_DESTDIR}/info"
2696 - --libdir="${PHP_DESTDIR}/lib"
2697 - --with-libdir="$(get_libdir)"
2698 - --localstatedir="${EPREFIX}/var"
2699 - --without-pear
2700 - $(use_enable threads maintainer-zts)
2701 - )
2702 -
2703 - our_conf+=(
2704 - $(use_enable bcmath bcmath)
2705 - $(use_with bzip2 bz2 "${EPREFIX}/usr")
2706 - $(use_enable calendar calendar)
2707 - $(use_enable coverage gcov)
2708 - $(use_enable ctype ctype)
2709 - $(use_with curl curl "${EPREFIX}/usr")
2710 - $(use_enable xml dom)
2711 - $(use_with enchant enchant "${EPREFIX}/usr")
2712 - $(use_enable exif exif)
2713 - $(use_enable fileinfo fileinfo)
2714 - $(use_enable filter filter)
2715 - $(use_enable ftp ftp)
2716 - $(use_with nls gettext "${EPREFIX}/usr")
2717 - $(use_with gmp gmp "${EPREFIX}/usr")
2718 - $(use_enable hash hash)
2719 - $(use_with mhash mhash "${EPREFIX}/usr")
2720 - $(use_with iconv iconv \
2721 - $(use elibc_glibc || use elibc_musl || use elibc_FreeBSD || echo "${EPREFIX}/usr"))
2722 - $(use_enable intl intl)
2723 - $(use_enable ipv6 ipv6)
2724 - $(use_enable json json)
2725 - $(use_with kerberos kerberos "${EPREFIX}/usr")
2726 - $(use_enable xml libxml)
2727 - $(use_with xml libxml-dir "${EPREFIX}/usr")
2728 - $(use_enable unicode mbstring)
2729 - $(use_with crypt mcrypt "${EPREFIX}/usr")
2730 - $(use_with unicode onig "${EPREFIX}/usr")
2731 - $(use_with ssl openssl "${EPREFIX}/usr")
2732 - $(use_with ssl openssl-dir "${EPREFIX}/usr")
2733 - $(use_enable pcntl pcntl)
2734 - $(use_enable phar phar)
2735 - $(use_enable pdo pdo)
2736 - $(use_enable opcache opcache)
2737 - $(use_with postgres pgsql "${EPREFIX}/usr")
2738 - $(use_enable posix posix)
2739 - $(use_with spell pspell "${EPREFIX}/usr")
2740 - $(use_with recode recode "${EPREFIX}/usr")
2741 - $(use_enable simplexml simplexml)
2742 - $(use_enable sharedmem shmop)
2743 - $(use_with snmp snmp "${EPREFIX}/usr")
2744 - $(use_enable soap soap)
2745 - $(use_enable sockets sockets)
2746 - $(use_with sqlite sqlite3 "${EPREFIX}/usr")
2747 - $(use_enable sysvipc sysvmsg)
2748 - $(use_enable sysvipc sysvsem)
2749 - $(use_enable sysvipc sysvshm)
2750 - $(use_with tidy tidy "${EPREFIX}/usr")
2751 - $(use_enable tokenizer tokenizer)
2752 - $(use_enable wddx wddx)
2753 - $(use_enable xml xml)
2754 - $(use_enable xmlreader xmlreader)
2755 - $(use_enable xmlwriter xmlwriter)
2756 - $(use_with xmlrpc xmlrpc)
2757 - $(use_with xslt xsl "${EPREFIX}/usr")
2758 - $(use_enable zip zip)
2759 - $(use_with zlib zlib "${EPREFIX}/usr")
2760 - $(use_enable debug debug)
2761 - )
2762 -
2763 - # DBA support
2764 - if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
2765 - || use qdbm ; then
2766 - our_conf+=( "--enable-dba${shared}" )
2767 - fi
2768 -
2769 - # DBA drivers support
2770 - our_conf+=(
2771 - $(use_with cdb cdb)
2772 - $(use_with berkdb db4 "${EPREFIX}/usr")
2773 - $(use_enable flatfile flatfile)
2774 - $(use_with gdbm gdbm "${EPREFIX}/usr")
2775 - $(use_enable inifile inifile)
2776 - $(use_with qdbm qdbm "${EPREFIX}/usr")
2777 - )
2778 -
2779 - # Support for the GD graphics library
2780 - our_conf+=(
2781 - $(use_with truetype freetype-dir "${EPREFIX}/usr")
2782 - $(use_enable cjk gd-jis-conv)
2783 - $(use_with gd jpeg-dir "${EPREFIX}/usr")
2784 - $(use_with gd png-dir "${EPREFIX}/usr")
2785 - $(use_with xpm xpm-dir "${EPREFIX}/usr")
2786 - )
2787 - if use webp; then
2788 - our_conf+=( --with-webp-dir="${EPREFIX}/usr" )
2789 - fi
2790 - # enable gd last, so configure can pick up the previous settings
2791 - our_conf+=( $(use_with gd gd) )
2792 -
2793 - # IMAP support
2794 - if use imap ; then
2795 - our_conf+=(
2796 - $(use_with imap imap "${EPREFIX}/usr")
2797 - $(use_with ssl imap-ssl "${EPREFIX}/usr")
2798 - )
2799 - fi
2800 -
2801 - # Interbase/firebird support
2802 - our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") )
2803 -
2804 - # LDAP support
2805 - if use ldap ; then
2806 - our_conf+=(
2807 - $(use_with ldap ldap "${EPREFIX}/usr")
2808 - $(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr")
2809 - )
2810 - fi
2811 -
2812 - # MySQL support
2813 - local mysqllib="mysqlnd"
2814 - local mysqlilib="mysqlnd"
2815 -
2816 - our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
2817 -
2818 - local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock"
2819 - if use mysql || use mysqli ; then
2820 - our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") )
2821 - fi
2822 -
2823 - # ODBC support
2824 - our_conf+=(
2825 - $(use_with odbc unixODBC "${EPREFIX}/usr")
2826 - $(use_with iodbc iodbc "${EPREFIX}/usr")
2827 - )
2828 -
2829 - # Oracle support
2830 - our_conf+=( $(use_with oci8-instant-client oci8) )
2831 -
2832 - # PDO support
2833 - if use pdo ; then
2834 - our_conf+=(
2835 - $(use_with mssql pdo-dblib "${EPREFIX}/usr")
2836 - $(use_with mysql pdo-mysql "${mysqllib}")
2837 - $(use_with postgres pdo-pgsql)
2838 - $(use_with sqlite pdo-sqlite "${EPREFIX}/usr")
2839 - $(use_with firebird pdo-firebird "${EPREFIX}/usr")
2840 - $(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr")
2841 - $(use_with oci8-instant-client pdo-oci)
2842 - )
2843 - fi
2844 -
2845 - # readline/libedit support
2846 - our_conf+=(
2847 - $(use_with readline readline "${EPREFIX}/usr")
2848 - $(use_with libedit libedit "${EPREFIX}/usr")
2849 - )
2850 -
2851 - # Session support
2852 - if use session ; then
2853 - our_conf+=( $(use_with session-mm mm "${EPREFIX}/usr") )
2854 - else
2855 - our_conf+=( $(use_enable session session) )
2856 - fi
2857 -
2858 - # Use pic for shared modules such as apache2's mod_php
2859 - our_conf+=( --with-pic )
2860 -
2861 - # we use the system copy of pcre
2862 - # --with-pcre-regex affects ext/pcre
2863 - # --with-pcre-dir affects ext/filter and ext/zip
2864 - our_conf+=(
2865 - --with-pcre-regex="${EPREFIX}/usr"
2866 - --with-pcre-dir="${EPREFIX}/usr"
2867 - )
2868 -
2869 - # Catch CFLAGS problems
2870 - # Fixes bug #14067.
2871 - # Changed order to run it in reverse for bug #32022 and #12021.
2872 - replace-cpu-flags "k6*" "i586"
2873 -
2874 - # Cache the ./configure test results between SAPIs.
2875 - our_conf+=( --cache-file="${T}/config.cache" )
2876 -
2877 - # Support user-passed configuration parameters
2878 - our_conf+=( ${EXTRA_ECONF:-} )
2879 -
2880 - # Support the Apache2 extras, they must be set globally for all
2881 - # SAPIs to work correctly, especially for external PHP extensions
2882 -
2883 - mkdir -p "${WORKDIR}/sapis-build" || die
2884 - for one_sapi in $SAPIS ; do
2885 - use "${one_sapi}" || continue
2886 - php_set_ini_dir "${one_sapi}"
2887 -
2888 - # The BUILD_DIR variable is used to determine where to output
2889 - # the files that autotools creates. This was all originally
2890 - # based on the autotools-utils eclass.
2891 - BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}"
2892 - cp -a "${S}" "${BUILD_DIR}" || die
2893 - cd "${BUILD_DIR}" || die
2894 -
2895 - local sapi_conf=(
2896 - --with-config-file-path="${PHP_INI_DIR}"
2897 - --with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}"
2898 - )
2899 -
2900 - for sapi in $SAPIS ; do
2901 - case "$sapi" in
2902 - cli|cgi|embed|fpm|phpdbg)
2903 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
2904 - sapi_conf+=( "--enable-${sapi}" )
2905 - if [[ "fpm" == "${sapi}" ]] ; then
2906 - sapi_conf+=(
2907 - $(use_with acl fpm-acl)
2908 - $(use_with systemd fpm-systemd)
2909 - )
2910 - fi
2911 - else
2912 - sapi_conf+=( "--disable-${sapi}" )
2913 - fi
2914 - ;;
2915 -
2916 - apache2)
2917 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
2918 - sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" )
2919 - else
2920 - sapi_conf+=( --without-apxs2 )
2921 - fi
2922 - ;;
2923 - esac
2924 - done
2925 -
2926 - # Construct the $myeconfargs array by concatenating $our_conf
2927 - # (the common args) and $sapi_conf (the SAPI-specific args).
2928 - local myeconfargs=( "${our_conf[@]}" )
2929 - myeconfargs+=( "${sapi_conf[@]}" )
2930 -
2931 - pushd "${BUILD_DIR}" > /dev/null || die
2932 - econf "${myeconfargs[@]}"
2933 - popd > /dev/null || die
2934 - done
2935 -}
2936 -
2937 -src_compile() {
2938 - # snmp seems to run during src_compile, too (bug #324739)
2939 - addpredict /usr/share/snmp/mibs/.index #nowarn
2940 - addpredict /var/lib/net-snmp/mib_indexes #nowarn
2941 -
2942 - for sapi in ${SAPIS} ; do
2943 - if use "${sapi}"; then
2944 - cd "${WORKDIR}/sapis-build/$sapi" || \
2945 - die "Failed to change dir to ${WORKDIR}/sapis-build/$1"
2946 - emake
2947 - fi
2948 - done
2949 -}
2950 -
2951 -src_install() {
2952 - # see bug #324739 for what happens when we don't have that
2953 - addpredict /usr/share/snmp/mibs/.index #nowarn
2954 -
2955 - # grab the first SAPI that got built and install common files from there
2956 - local first_sapi=""
2957 - for sapi in $SAPIS ; do
2958 - if use $sapi ; then
2959 - first_sapi=$sapi
2960 - break
2961 - fi
2962 - done
2963 -
2964 - # Makefile forgets to create this before trying to write to it...
2965 - dodir "${PHP_DESTDIR#${EPREFIX}}/bin"
2966 -
2967 - # Install php environment (without any sapis)
2968 - cd "${WORKDIR}/sapis-build/$first_sapi" || die
2969 - emake INSTALL_ROOT="${D}" \
2970 - install-build install-headers install-programs
2971 -
2972 - local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)"
2973 -
2974 - # Create the directory where we'll put version-specific php scripts
2975 - keepdir "/usr/share/php${PHP_MV}"
2976 -
2977 - local sapi="", file=""
2978 - local sapi_list=""
2979 -
2980 - for sapi in ${SAPIS}; do
2981 - if use "${sapi}" ; then
2982 - einfo "Installing SAPI: ${sapi}"
2983 - cd "${WORKDIR}/sapis-build/${sapi}" || die
2984 -
2985 - if [[ "${sapi}" == "apache2" ]] ; then
2986 - # We're specifically not using emake install-sapi as libtool
2987 - # may cause unnecessary relink failures (see bug #351266)
2988 - insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/"
2989 - newins ".libs/libphp${PHP_MV}$(get_libname)" \
2990 - "libphp${PHP_MV}$(get_libname)"
2991 - keepdir "/usr/$(get_libdir)/apache2/modules"
2992 - else
2993 - # needed each time, php_install_ini would reset it
2994 - local dest="${PHP_DESTDIR#${EPREFIX}}"
2995 - into "${dest}"
2996 - case "$sapi" in
2997 - cli)
2998 - source="sapi/cli/php"
2999 - ;;
3000 - cgi)
3001 - source="sapi/cgi/php-cgi"
3002 - ;;
3003 - fpm)
3004 - source="sapi/fpm/php-fpm"
3005 - ;;
3006 - embed)
3007 - source="libs/libphp${PHP_MV}$(get_libname)"
3008 - ;;
3009 - phpdbg)
3010 - source="sapi/phpdbg/phpdbg"
3011 - ;;
3012 - *)
3013 - die "unhandled sapi in src_install"
3014 - ;;
3015 - esac
3016 -
3017 - if [[ "${source}" == *"$(get_libname)" ]]; then
3018 - dolib.so "${source}"
3019 - else
3020 - dobin "${source}"
3021 - local name="$(basename ${source})"
3022 - dosym "${dest}/bin/${name}" "/usr/bin/${name}${SLOT}"
3023 - fi
3024 - fi
3025 -
3026 - php_install_ini "${sapi}"
3027 -
3028 - # construct correct SAPI string for php-config
3029 - # thanks to ferringb for the bash voodoo
3030 - if [[ "${sapi}" == "apache2" ]]; then
3031 - sapi_list="${sapi_list:+${sapi_list} }apache2handler"
3032 - else
3033 - sapi_list="${sapi_list:+${sapi_list} }${sapi}"
3034 - fi
3035 - fi
3036 - done
3037 -
3038 - # Installing opcache module
3039 - if use opcache ; then
3040 - into "${PHP_DESTDIR#${EPREFIX}}"
3041 - dolib.so "modules/opcache$(get_libname)"
3042 - fi
3043 -
3044 - # Install env.d files
3045 - newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}"
3046 - sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
3047 - sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
3048 -
3049 - # set php-config variable correctly (bug #278439)
3050 - sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \
3051 - "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die
3052 -
3053 - if use fpm ; then
3054 - if use systemd; then
3055 - systemd_newunit "${FILESDIR}/php-fpm_at.service" \
3056 - "php-fpm@${SLOT}.service"
3057 - else
3058 - systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \
3059 - "php-fpm@${SLOT}.service"
3060 - fi
3061 - fi
3062 -}
3063 -
3064 -src_test() {
3065 - echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
3066 - PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
3067 - if [[ ! -x "${PHP_BIN}" ]] ; then
3068 - ewarn "Test phase requires USE=cli, skipping"
3069 - return
3070 - else
3071 - export TEST_PHP_EXECUTABLE="${PHP_BIN}"
3072 - fi
3073 -
3074 - if [[ -x "${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" ]] ; then
3075 - export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi"
3076 - fi
3077 -
3078 - if [[ -x "${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" ]] ; then
3079 - export TEST_PHPDBG_EXECUTABLE="${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg"
3080 - fi
3081 -
3082 - REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \
3083 - "session.save_path=${T}" \
3084 - "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \
3085 - "session.save_path=${T}"
3086 -
3087 - for name in ${EXPECTED_TEST_FAILURES}; do
3088 - mv "${name}.out" "${name}.out.orig" 2>/dev/null || die
3089 - done
3090 -
3091 - local failed="$(find -name '*.out')"
3092 - if [[ ${failed} != "" ]] ; then
3093 - ewarn "The following test cases failed unexpectedly:"
3094 - for name in ${failed}; do
3095 - ewarn " ${name/.out/}"
3096 - done
3097 - else
3098 - einfo "No unexpected test failures, all fine"
3099 - fi
3100 -
3101 - if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
3102 - local passed=""
3103 - for name in ${EXPECTED_TEST_FAILURES}; do
3104 - [[ -f "${name}.diff" ]] && continue
3105 - passed="${passed} ${name}"
3106 - done
3107 - if [[ ${passed} != "" ]] ; then
3108 - einfo "The following test cases passed unexpectedly:"
3109 - for name in ${passed}; do
3110 - ewarn " ${passed}"
3111 - done
3112 - else
3113 - einfo "None of the known-to-fail tests passed, all fine"
3114 - fi
3115 - fi
3116 -}
3117 -
3118 -pkg_postinst() {
3119 - # Output some general info to the user
3120 - if use apache2 ; then
3121 - elog
3122 - elog "To enable PHP in apache, you will need to add \"-D PHP\" to"
3123 - elog "your apache2 command. OpenRC users can append that string to"
3124 - elog "APACHE2_OPTS in /etc/conf.d/apache2."
3125 - elog
3126 - elog "The apache module configuration file 70_mod_php.conf is"
3127 - elog "provided (and maintained) by eselect-php."
3128 - elog
3129 - fi
3130 -
3131 - # Create the symlinks for php
3132 - for m in ${SAPIS}; do
3133 - [[ ${m} == 'embed' ]] && continue;
3134 - if use $m ; then
3135 - local ci=$(eselect php show $m)
3136 - if [[ -z $ci ]]; then
3137 - eselect php set $m php${SLOT} || die
3138 - einfo "Switched ${m} to use php:${SLOT}"
3139 - einfo
3140 - elif [[ $ci != "php${SLOT}" ]] ; then
3141 - elog "To switch $m to use php:${SLOT}, run"
3142 - elog " eselect php set $m php${SLOT}"
3143 - elog
3144 - fi
3145 - fi
3146 - done
3147 -
3148 - # Remove dead symlinks for SAPIs that were just disabled. For
3149 - # example, if the user has the cgi SAPI enabled, then he has an
3150 - # eselect-php symlink for it. If he later reinstalls PHP with
3151 - # USE="-cgi", that symlink will break. This call to eselect is
3152 - # supposed to remove that dead link per bug 572436.
3153 - eselect php cleanup || die
3154 -
3155 - if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then
3156 - elog "To build extensions for this version of PHP, you will need to"
3157 - elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable."
3158 - elog
3159 - fi
3160 -
3161 - # Warn about the removal of PHP_INI_VERSION if the user has it set.
3162 - if [[ -n "${PHP_INI_VERSION}" ]]; then
3163 - ewarn 'The PHP_INI_VERSION variable has been phased out. You may'
3164 - ewarn 'remove it from your configuration at your convenience. See'
3165 - ewarn
3166 - ewarn ' https://bugs.gentoo.org/611214'
3167 - ewarn
3168 - ewarn 'for more information.'
3169 - fi
3170 -
3171 - elog "For details on how version slotting works, please see"
3172 - elog "the wiki:"
3173 - elog
3174 - elog " https://wiki.gentoo.org/wiki/PHP"
3175 - elog
3176 -}
3177 -
3178 -pkg_postrm() {
3179 - # This serves two purposes. First, if we have just removed the last
3180 - # installed version of PHP, then this will remove any dead symlinks
3181 - # belonging to eselect-php. Second, if a user upgrades slots from
3182 - # (say) 5.6 to 7.0 and depcleans the old slot, then this will update
3183 - # his existing symlinks to point to the new 7.0 installation. The
3184 - # latter is bug 432962.
3185 - #
3186 - # Note: the eselect-php package may not be installed at this point,
3187 - # so we can't die() if this command fails.
3188 - eselect php cleanup
3189 -}
3190
3191 diff --git a/dev-lang/php/php-7.1.29.ebuild b/dev-lang/php/php-7.1.29.ebuild
3192 deleted file mode 100644
3193 index 21ae6551ee5..00000000000
3194 --- a/dev-lang/php/php-7.1.29.ebuild
3195 +++ /dev/null
3196 @@ -1,737 +0,0 @@
3197 -# Copyright 1999-2019 Gentoo Authors
3198 -# Distributed under the terms of the GNU General Public License v2
3199 -
3200 -EAPI="7"
3201 -
3202 -inherit flag-o-matic systemd autotools
3203 -
3204 -DESCRIPTION="The PHP language runtime engine"
3205 -HOMEPAGE="https://php.net/"
3206 -SRC_URI="https://php.net/distributions/${P}.tar.xz"
3207 -
3208 -LICENSE="PHP-3.01
3209 - BSD
3210 - Zend-2.0
3211 - bcmath? ( LGPL-2.1+ )
3212 - fpm? ( BSD-2 )
3213 - gd? ( gd )
3214 - unicode? ( BSD-2 LGPL-2.1 )"
3215 -
3216 -SLOT="$(ver_cut 1-2)"
3217 -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"
3218 -
3219 -# We can build the following SAPIs in the given order
3220 -SAPIS="embed cli cgi fpm apache2 phpdbg"
3221 -
3222 -# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
3223 -IUSE="${IUSE}
3224 - ${SAPIS/cli/+cli}
3225 - threads"
3226 -
3227 -IUSE="${IUSE} acl bcmath berkdb bzip2 calendar cdb cjk
3228 - coverage crypt +ctype curl debug
3229 - enchant exif +fileinfo +filter firebird
3230 - flatfile ftp gd gdbm gmp +hash +iconv imap inifile
3231 - intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl
3232 - mhash mssql mysql mysqli nls
3233 - oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
3234 - readline recode selinux +session session-mm sharedmem
3235 - +simplexml snmp soap sockets spell sqlite ssl
3236 - sysvipc systemd test tidy +tokenizer truetype unicode wddx webp
3237 - +xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib"
3238 -
3239 -# The supported (that is, autodetected) versions of BDB are listed in
3240 -# the ./configure script. Other versions *work*, but we need to stick to
3241 -# the ones that can be detected to avoid a repeat of bug #564824.
3242 -COMMON_DEPEND="
3243 - >=app-eselect/eselect-php-0.9.1[apache2?,fpm?]
3244 - >=dev-libs/libpcre-8.32[unicode]
3245 - fpm? ( acl? ( sys-apps/acl ) )
3246 - apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=]
3247 - <www-servers/apache-2.4[threads=] ) )
3248 - berkdb? ( || ( sys-libs/db:5.3
3249 - sys-libs/db:5.1
3250 - sys-libs/db:4.8
3251 - sys-libs/db:4.7
3252 - sys-libs/db:4.6
3253 - sys-libs/db:4.5 ) )
3254 - bzip2? ( app-arch/bzip2:0= )
3255 - cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
3256 - coverage? ( dev-util/lcov )
3257 - crypt? ( >=dev-libs/libmcrypt-2.4 )
3258 - curl? ( >=net-misc/curl-7.10.5 )
3259 - enchant? ( <app-text/enchant-2.0:0 )
3260 - firebird? ( dev-db/firebird )
3261 - gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib )
3262 - gdbm? ( >=sys-libs/gdbm-1.8.0:0= )
3263 - gmp? ( dev-libs/gmp:0= )
3264 - iconv? ( virtual/libiconv )
3265 - imap? ( virtual/imap-c-client[kerberos=,ssl=] )
3266 - intl? ( dev-libs/icu:= )
3267 - iodbc? ( dev-db/libiodbc )
3268 - kerberos? ( virtual/krb5 )
3269 - ldap? ( >=net-nds/openldap-1.2.11 )
3270 - ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 )
3271 - libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) )
3272 - mssql? ( dev-db/freetds[mssql] )
3273 - nls? ( sys-devel/gettext )
3274 - oci8-instant-client? ( dev-db/oracle-instantclient-basic )
3275 - odbc? ( >=dev-db/unixODBC-1.8.13 )
3276 - postgres? ( dev-db/postgresql:* )
3277 - qdbm? ( dev-db/qdbm )
3278 - readline? ( sys-libs/readline:0= )
3279 - recode? ( app-text/recode )
3280 - session-mm? ( dev-libs/mm )
3281 - simplexml? ( >=dev-libs/libxml2-2.6.8 )
3282 - snmp? ( >=net-analyzer/net-snmp-5.2 )
3283 - soap? ( >=dev-libs/libxml2-2.6.8 )
3284 - spell? ( >=app-text/aspell-0.50 )
3285 - sqlite? ( >=dev-db/sqlite-3.7.6.3 )
3286 - ssl? (
3287 - !libressl? ( dev-libs/openssl:0= )
3288 - libressl? ( dev-libs/libressl:0= )
3289 - )
3290 - tidy? ( || ( app-text/tidy-html5 app-text/htmltidy ) )
3291 - truetype? ( =media-libs/freetype-2* )
3292 - unicode? ( dev-libs/oniguruma:= )
3293 - wddx? ( >=dev-libs/libxml2-2.6.8 )
3294 - webp? ( media-libs/libwebp:0= )
3295 - xml? ( >=dev-libs/libxml2-2.6.8 )
3296 - xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
3297 - xmlreader? ( >=dev-libs/libxml2-2.6.8 )
3298 - xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
3299 - xpm? ( x11-libs/libXpm )
3300 - xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
3301 - zip? ( sys-libs/zlib:0= )
3302 - zlib? ( sys-libs/zlib:0= )
3303 -"
3304 -
3305 -RDEPEND="${COMMON_DEPEND}
3306 - virtual/mta
3307 - fpm? (
3308 - selinux? ( sec-policy/selinux-phpfpm )
3309 - systemd? ( sys-apps/systemd ) )"
3310 -
3311 -# Bison isn't actually needed when building from a release tarball
3312 -# However, the configure script will warn if it's absent or if you
3313 -# have an incompatible version installed. See bug 593278.
3314 -DEPEND="${COMMON_DEPEND}
3315 - app-arch/xz-utils
3316 - >=sys-devel/bison-3.0.1"
3317 -
3318 -BDEPEND="virtual/pkgconfig"
3319 -
3320 -# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
3321 -REQUIRED_USE="
3322 - || ( cli cgi fpm apache2 embed phpdbg )
3323 - cli? ( ^^ ( readline libedit ) )
3324 - truetype? ( gd zlib )
3325 - webp? ( gd zlib )
3326 - cjk? ( gd zlib )
3327 - exif? ( gd zlib )
3328 - xpm? ( gd zlib )
3329 - gd? ( zlib )
3330 - simplexml? ( xml )
3331 - soap? ( xml )
3332 - wddx? ( xml )
3333 - xmlrpc? ( || ( xml iconv ) )
3334 - xmlreader? ( xml )
3335 - xslt? ( xml )
3336 - ldap-sasl? ( ldap )
3337 - mhash? ( hash )
3338 - phar? ( hash )
3339 - qdbm? ( !gdbm )
3340 - readline? ( !libedit )
3341 - recode? ( !imap !mysqli !mysql )
3342 - session-mm? ( session !threads )
3343 - mysql? ( hash || ( mysqli pdo ) )
3344 - mysqli? ( hash )
3345 -"
3346 -PATCHES=(
3347 - "${FILESDIR}/php-freetype-2.9.1.patch"
3348 - "${FILESDIR}/php-7.1.25-intl-use-icu-namespace.patch"
3349 -)
3350 -
3351 -PHP_MV="$(ver_cut 1)"
3352 -
3353 -php_install_ini() {
3354 - local phpsapi="${1}"
3355 -
3356 - # work out where we are installing the ini file
3357 - php_set_ini_dir "${phpsapi}"
3358 -
3359 - # Always install the production INI file, bug 611214.
3360 - local phpinisrc="php.ini-production-${phpsapi}"
3361 - cp php.ini-production "${phpinisrc}" || die
3362 -
3363 - # default to /tmp for save_path, bug #282768
3364 - sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die
3365 -
3366 - # Set the extension dir
3367 - sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \
3368 - -i "${phpinisrc}" || die
3369 -
3370 - # Set the include path to point to where we want to find PEAR packages
3371 - sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die
3372 -
3373 - dodir "${PHP_INI_DIR#${EPREFIX}}"
3374 - insinto "${PHP_INI_DIR#${EPREFIX}}"
3375 - newins "${phpinisrc}" php.ini
3376 -
3377 - elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}"
3378 - elog
3379 -
3380 - dodir "${PHP_EXT_INI_DIR#${EPREFIX}}"
3381 - dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}"
3382 -
3383 - if use opcache; then
3384 - elog "Adding opcache to $PHP_EXT_INI_DIR"
3385 - echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \
3386 - "${D}/${PHP_EXT_INI_DIR}"/opcache.ini
3387 - dosym "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" \
3388 - "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini"
3389 - fi
3390 -
3391 - # SAPI-specific handling
3392 - if [[ "${sapi}" == "fpm" ]] ; then
3393 - einfo "Installing FPM config files php-fpm.conf and www.conf"
3394 - insinto "${PHP_INI_DIR#${EPREFIX}}"
3395 - doins sapi/fpm/php-fpm.conf
3396 - insinto "${PHP_INI_DIR#${EPREFIX}}/fpm.d"
3397 - doins sapi/fpm/www.conf
3398 - fi
3399 -
3400 - dodoc php.ini-{development,production}
3401 -}
3402 -
3403 -php_set_ini_dir() {
3404 - PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}"
3405 - PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
3406 - PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
3407 -}
3408 -
3409 -src_prepare() {
3410 - default
3411 -
3412 - # In php-7.x, the FPM pool configuration files have been split off
3413 - # of the main config. By default the pool config files go in
3414 - # e.g. /etc/php-fpm.d, which isn't slotted. So here we move the
3415 - # include directory to a subdirectory "fpm.d" of $PHP_INI_DIR. Later
3416 - # we'll install the pool configuration file "www.conf" there.
3417 - php_set_ini_dir fpm
3418 - sed -i "s~^include=.*$~include=${PHP_INI_DIR}/fpm.d/*.conf~" \
3419 - sapi/fpm/php-fpm.conf.in \
3420 - || die 'failed to move the include directory in php-fpm.conf'
3421 -
3422 - # Bug 669566 - necessary so that build tools are updated for commands like pecl
3423 - # Force rebuilding aclocal.m4
3424 - rm -f aclocal.m4 || die "failed to remove aclocal.m4 in src_prepare"
3425 - eautoreconf
3426 -}
3427 -
3428 -src_configure() {
3429 - addpredict /usr/share/snmp/mibs/.index #nowarn
3430 - addpredict /var/lib/net-snmp/mib_indexes #nowarn
3431 -
3432 - PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
3433 -
3434 - # The php-fpm config file wants localstatedir to be ${EPREFIX}/var
3435 - # and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002.
3436 - local our_conf=(
3437 - --prefix="${PHP_DESTDIR}"
3438 - --mandir="${PHP_DESTDIR}/man"
3439 - --infodir="${PHP_DESTDIR}/info"
3440 - --libdir="${PHP_DESTDIR}/lib"
3441 - --with-libdir="$(get_libdir)"
3442 - --localstatedir="${EPREFIX}/var"
3443 - --without-pear
3444 - $(use_enable threads maintainer-zts)
3445 - )
3446 -
3447 - our_conf+=(
3448 - $(use_enable bcmath bcmath)
3449 - $(use_with bzip2 bz2 "${EPREFIX}/usr")
3450 - $(use_enable calendar calendar)
3451 - $(use_enable coverage gcov)
3452 - $(use_enable ctype ctype)
3453 - $(use_with curl curl "${EPREFIX}/usr")
3454 - $(use_enable xml dom)
3455 - $(use_with enchant enchant "${EPREFIX}/usr")
3456 - $(use_enable exif exif)
3457 - $(use_enable fileinfo fileinfo)
3458 - $(use_enable filter filter)
3459 - $(use_enable ftp ftp)
3460 - $(use_with nls gettext "${EPREFIX}/usr")
3461 - $(use_with gmp gmp "${EPREFIX}/usr")
3462 - $(use_enable hash hash)
3463 - $(use_with mhash mhash "${EPREFIX}/usr")
3464 - $(use_with iconv iconv \
3465 - $(use elibc_glibc || use elibc_musl || use elibc_FreeBSD || echo "${EPREFIX}/usr"))
3466 - $(use_enable intl intl)
3467 - $(use_enable ipv6 ipv6)
3468 - $(use_enable json json)
3469 - $(use_with kerberos kerberos "${EPREFIX}/usr")
3470 - $(use_enable xml libxml)
3471 - $(use_with xml libxml-dir "${EPREFIX}/usr")
3472 - $(use_enable unicode mbstring)
3473 - $(use_with crypt mcrypt "${EPREFIX}/usr")
3474 - $(use_with unicode onig "${EPREFIX}/usr")
3475 - $(use_with ssl openssl "${EPREFIX}/usr")
3476 - $(use_with ssl openssl-dir "${EPREFIX}/usr")
3477 - $(use_enable pcntl pcntl)
3478 - $(use_enable phar phar)
3479 - $(use_enable pdo pdo)
3480 - $(use_enable opcache opcache)
3481 - $(use_with postgres pgsql "${EPREFIX}/usr")
3482 - $(use_enable posix posix)
3483 - $(use_with spell pspell "${EPREFIX}/usr")
3484 - $(use_with recode recode "${EPREFIX}/usr")
3485 - $(use_enable simplexml simplexml)
3486 - $(use_enable sharedmem shmop)
3487 - $(use_with snmp snmp "${EPREFIX}/usr")
3488 - $(use_enable soap soap)
3489 - $(use_enable sockets sockets)
3490 - $(use_with sqlite sqlite3 "${EPREFIX}/usr")
3491 - $(use_enable sysvipc sysvmsg)
3492 - $(use_enable sysvipc sysvsem)
3493 - $(use_enable sysvipc sysvshm)
3494 - $(use_with tidy tidy "${EPREFIX}/usr")
3495 - $(use_enable tokenizer tokenizer)
3496 - $(use_enable wddx wddx)
3497 - $(use_enable xml xml)
3498 - $(use_enable xmlreader xmlreader)
3499 - $(use_enable xmlwriter xmlwriter)
3500 - $(use_with xmlrpc xmlrpc)
3501 - $(use_with xslt xsl "${EPREFIX}/usr")
3502 - $(use_enable zip zip)
3503 - $(use_with zlib zlib "${EPREFIX}/usr")
3504 - $(use_enable debug debug)
3505 - )
3506 -
3507 - # DBA support
3508 - if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
3509 - || use qdbm ; then
3510 - our_conf+=( "--enable-dba${shared}" )
3511 - fi
3512 -
3513 - # DBA drivers support
3514 - our_conf+=(
3515 - $(use_with cdb cdb)
3516 - $(use_with berkdb db4 "${EPREFIX}/usr")
3517 - $(use_enable flatfile flatfile)
3518 - $(use_with gdbm gdbm "${EPREFIX}/usr")
3519 - $(use_enable inifile inifile)
3520 - $(use_with qdbm qdbm "${EPREFIX}/usr")
3521 - )
3522 -
3523 - # Support for the GD graphics library
3524 - our_conf+=(
3525 - $(use_with truetype freetype-dir "${EPREFIX}/usr")
3526 - $(use_enable cjk gd-jis-conv)
3527 - $(use_with gd jpeg-dir "${EPREFIX}/usr")
3528 - $(use_with gd png-dir "${EPREFIX}/usr")
3529 - $(use_with xpm xpm-dir "${EPREFIX}/usr")
3530 - )
3531 - if use webp; then
3532 - our_conf+=( --with-webp-dir="${EPREFIX}/usr" )
3533 - fi
3534 - # enable gd last, so configure can pick up the previous settings
3535 - our_conf+=( $(use_with gd gd) )
3536 -
3537 - # IMAP support
3538 - if use imap ; then
3539 - our_conf+=(
3540 - $(use_with imap imap "${EPREFIX}/usr")
3541 - $(use_with ssl imap-ssl "${EPREFIX}/usr")
3542 - )
3543 - fi
3544 -
3545 - # Interbase/firebird support
3546 - our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") )
3547 -
3548 - # LDAP support
3549 - if use ldap ; then
3550 - our_conf+=(
3551 - $(use_with ldap ldap "${EPREFIX}/usr")
3552 - $(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr")
3553 - )
3554 - fi
3555 -
3556 - # MySQL support
3557 - local mysqllib="mysqlnd"
3558 - local mysqlilib="mysqlnd"
3559 -
3560 - our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
3561 -
3562 - local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock"
3563 - if use mysql || use mysqli ; then
3564 - our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") )
3565 - fi
3566 -
3567 - # ODBC support
3568 - our_conf+=(
3569 - $(use_with odbc unixODBC "${EPREFIX}/usr")
3570 - $(use_with iodbc iodbc "${EPREFIX}/usr")
3571 - )
3572 -
3573 - # Oracle support
3574 - our_conf+=( $(use_with oci8-instant-client oci8) )
3575 -
3576 - # PDO support
3577 - if use pdo ; then
3578 - our_conf+=(
3579 - $(use_with mssql pdo-dblib "${EPREFIX}/usr")
3580 - $(use_with mysql pdo-mysql "${mysqllib}")
3581 - $(use_with postgres pdo-pgsql)
3582 - $(use_with sqlite pdo-sqlite "${EPREFIX}/usr")
3583 - $(use_with firebird pdo-firebird "${EPREFIX}/usr")
3584 - $(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr")
3585 - $(use_with oci8-instant-client pdo-oci)
3586 - )
3587 - fi
3588 -
3589 - # readline/libedit support
3590 - our_conf+=(
3591 - $(use_with readline readline "${EPREFIX}/usr")
3592 - $(use_with libedit libedit "${EPREFIX}/usr")
3593 - )
3594 -
3595 - # Session support
3596 - if use session ; then
3597 - our_conf+=( $(use_with session-mm mm "${EPREFIX}/usr") )
3598 - else
3599 - our_conf+=( $(use_enable session session) )
3600 - fi
3601 -
3602 - # Use pic for shared modules such as apache2's mod_php
3603 - our_conf+=( --with-pic )
3604 -
3605 - # we use the system copy of pcre
3606 - # --with-pcre-regex affects ext/pcre
3607 - # --with-pcre-dir affects ext/filter and ext/zip
3608 - our_conf+=(
3609 - --with-pcre-regex="${EPREFIX}/usr"
3610 - --with-pcre-dir="${EPREFIX}/usr"
3611 - )
3612 -
3613 - # Catch CFLAGS problems
3614 - # Fixes bug #14067.
3615 - # Changed order to run it in reverse for bug #32022 and #12021.
3616 - replace-cpu-flags "k6*" "i586"
3617 -
3618 - # Cache the ./configure test results between SAPIs.
3619 - our_conf+=( --cache-file="${T}/config.cache" )
3620 -
3621 - # Support user-passed configuration parameters
3622 - our_conf+=( ${EXTRA_ECONF:-} )
3623 -
3624 - # Support the Apache2 extras, they must be set globally for all
3625 - # SAPIs to work correctly, especially for external PHP extensions
3626 -
3627 - mkdir -p "${WORKDIR}/sapis-build" || die
3628 - for one_sapi in $SAPIS ; do
3629 - use "${one_sapi}" || continue
3630 - php_set_ini_dir "${one_sapi}"
3631 -
3632 - # The BUILD_DIR variable is used to determine where to output
3633 - # the files that autotools creates. This was all originally
3634 - # based on the autotools-utils eclass.
3635 - BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}"
3636 - cp -a "${S}" "${BUILD_DIR}" || die
3637 - cd "${BUILD_DIR}" || die
3638 -
3639 - local sapi_conf=(
3640 - --with-config-file-path="${PHP_INI_DIR}"
3641 - --with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}"
3642 - )
3643 -
3644 - for sapi in $SAPIS ; do
3645 - case "$sapi" in
3646 - cli|cgi|embed|fpm|phpdbg)
3647 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
3648 - sapi_conf+=( "--enable-${sapi}" )
3649 - if [[ "fpm" == "${sapi}" ]] ; then
3650 - sapi_conf+=(
3651 - $(use_with acl fpm-acl)
3652 - $(use_with systemd fpm-systemd)
3653 - )
3654 - fi
3655 - else
3656 - sapi_conf+=( "--disable-${sapi}" )
3657 - fi
3658 - ;;
3659 -
3660 - apache2)
3661 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
3662 - sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" )
3663 - else
3664 - sapi_conf+=( --without-apxs2 )
3665 - fi
3666 - ;;
3667 - esac
3668 - done
3669 -
3670 - # Construct the $myeconfargs array by concatenating $our_conf
3671 - # (the common args) and $sapi_conf (the SAPI-specific args).
3672 - local myeconfargs=( "${our_conf[@]}" )
3673 - myeconfargs+=( "${sapi_conf[@]}" )
3674 -
3675 - pushd "${BUILD_DIR}" > /dev/null || die
3676 - econf "${myeconfargs[@]}"
3677 - popd > /dev/null || die
3678 - done
3679 -}
3680 -
3681 -src_compile() {
3682 - # snmp seems to run during src_compile, too (bug #324739)
3683 - addpredict /usr/share/snmp/mibs/.index #nowarn
3684 - addpredict /var/lib/net-snmp/mib_indexes #nowarn
3685 -
3686 - for sapi in ${SAPIS} ; do
3687 - if use "${sapi}"; then
3688 - cd "${WORKDIR}/sapis-build/$sapi" || \
3689 - die "Failed to change dir to ${WORKDIR}/sapis-build/$1"
3690 - emake
3691 - fi
3692 - done
3693 -}
3694 -
3695 -src_install() {
3696 - # see bug #324739 for what happens when we don't have that
3697 - addpredict /usr/share/snmp/mibs/.index #nowarn
3698 -
3699 - # grab the first SAPI that got built and install common files from there
3700 - local first_sapi=""
3701 - for sapi in $SAPIS ; do
3702 - if use $sapi ; then
3703 - first_sapi=$sapi
3704 - break
3705 - fi
3706 - done
3707 -
3708 - # Makefile forgets to create this before trying to write to it...
3709 - dodir "${PHP_DESTDIR#${EPREFIX}}/bin"
3710 -
3711 - # Install php environment (without any sapis)
3712 - cd "${WORKDIR}/sapis-build/$first_sapi" || die
3713 - emake INSTALL_ROOT="${D}" \
3714 - install-build install-headers install-programs
3715 -
3716 - local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)"
3717 -
3718 - # Create the directory where we'll put version-specific php scripts
3719 - keepdir "/usr/share/php${PHP_MV}"
3720 -
3721 - local sapi="", file=""
3722 - local sapi_list=""
3723 -
3724 - for sapi in ${SAPIS}; do
3725 - if use "${sapi}" ; then
3726 - einfo "Installing SAPI: ${sapi}"
3727 - cd "${WORKDIR}/sapis-build/${sapi}" || die
3728 -
3729 - if [[ "${sapi}" == "apache2" ]] ; then
3730 - # We're specifically not using emake install-sapi as libtool
3731 - # may cause unnecessary relink failures (see bug #351266)
3732 - insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/"
3733 - newins ".libs/libphp${PHP_MV}$(get_libname)" \
3734 - "libphp${PHP_MV}$(get_libname)"
3735 - keepdir "/usr/$(get_libdir)/apache2/modules"
3736 - else
3737 - # needed each time, php_install_ini would reset it
3738 - local dest="${PHP_DESTDIR#${EPREFIX}}"
3739 - into "${dest}"
3740 - case "$sapi" in
3741 - cli)
3742 - source="sapi/cli/php"
3743 - ;;
3744 - cgi)
3745 - source="sapi/cgi/php-cgi"
3746 - ;;
3747 - fpm)
3748 - source="sapi/fpm/php-fpm"
3749 - ;;
3750 - embed)
3751 - source="libs/libphp${PHP_MV}$(get_libname)"
3752 - ;;
3753 - phpdbg)
3754 - source="sapi/phpdbg/phpdbg"
3755 - ;;
3756 - *)
3757 - die "unhandled sapi in src_install"
3758 - ;;
3759 - esac
3760 -
3761 - if [[ "${source}" == *"$(get_libname)" ]]; then
3762 - dolib.so "${source}"
3763 - else
3764 - dobin "${source}"
3765 - local name="$(basename ${source})"
3766 - dosym "${dest}/bin/${name}" "/usr/bin/${name}${SLOT}"
3767 - fi
3768 - fi
3769 -
3770 - php_install_ini "${sapi}"
3771 -
3772 - # construct correct SAPI string for php-config
3773 - # thanks to ferringb for the bash voodoo
3774 - if [[ "${sapi}" == "apache2" ]]; then
3775 - sapi_list="${sapi_list:+${sapi_list} }apache2handler"
3776 - else
3777 - sapi_list="${sapi_list:+${sapi_list} }${sapi}"
3778 - fi
3779 - fi
3780 - done
3781 -
3782 - # Installing opcache module
3783 - if use opcache ; then
3784 - into "${PHP_DESTDIR#${EPREFIX}}"
3785 - dolib.so "modules/opcache$(get_libname)"
3786 - fi
3787 -
3788 - # Install env.d files
3789 - newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}"
3790 - sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
3791 - sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
3792 -
3793 - # set php-config variable correctly (bug #278439)
3794 - sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \
3795 - "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die
3796 -
3797 - if use fpm ; then
3798 - if use systemd; then
3799 - systemd_newunit "${FILESDIR}/php-fpm_at.service" \
3800 - "php-fpm@${SLOT}.service"
3801 - else
3802 - systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \
3803 - "php-fpm@${SLOT}.service"
3804 - fi
3805 - fi
3806 -}
3807 -
3808 -src_test() {
3809 - echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
3810 - PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
3811 - if [[ ! -x "${PHP_BIN}" ]] ; then
3812 - ewarn "Test phase requires USE=cli, skipping"
3813 - return
3814 - else
3815 - export TEST_PHP_EXECUTABLE="${PHP_BIN}"
3816 - fi
3817 -
3818 - if [[ -x "${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" ]] ; then
3819 - export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi"
3820 - fi
3821 -
3822 - if [[ -x "${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" ]] ; then
3823 - export TEST_PHPDBG_EXECUTABLE="${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg"
3824 - fi
3825 -
3826 - REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \
3827 - "session.save_path=${T}" \
3828 - "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \
3829 - "session.save_path=${T}"
3830 -
3831 - for name in ${EXPECTED_TEST_FAILURES}; do
3832 - mv "${name}.out" "${name}.out.orig" 2>/dev/null || die
3833 - done
3834 -
3835 - local failed="$(find -name '*.out')"
3836 - if [[ ${failed} != "" ]] ; then
3837 - ewarn "The following test cases failed unexpectedly:"
3838 - for name in ${failed}; do
3839 - ewarn " ${name/.out/}"
3840 - done
3841 - else
3842 - einfo "No unexpected test failures, all fine"
3843 - fi
3844 -
3845 - if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
3846 - local passed=""
3847 - for name in ${EXPECTED_TEST_FAILURES}; do
3848 - [[ -f "${name}.diff" ]] && continue
3849 - passed="${passed} ${name}"
3850 - done
3851 - if [[ ${passed} != "" ]] ; then
3852 - einfo "The following test cases passed unexpectedly:"
3853 - for name in ${passed}; do
3854 - ewarn " ${passed}"
3855 - done
3856 - else
3857 - einfo "None of the known-to-fail tests passed, all fine"
3858 - fi
3859 - fi
3860 -}
3861 -
3862 -pkg_postinst() {
3863 - # Output some general info to the user
3864 - if use apache2 ; then
3865 - elog
3866 - elog "To enable PHP in apache, you will need to add \"-D PHP\" to"
3867 - elog "your apache2 command. OpenRC users can append that string to"
3868 - elog "APACHE2_OPTS in /etc/conf.d/apache2."
3869 - elog
3870 - elog "The apache module configuration file 70_mod_php.conf is"
3871 - elog "provided (and maintained) by eselect-php."
3872 - elog
3873 - fi
3874 -
3875 - # Create the symlinks for php
3876 - for m in ${SAPIS}; do
3877 - [[ ${m} == 'embed' ]] && continue;
3878 - if use $m ; then
3879 - local ci=$(eselect php show $m)
3880 - if [[ -z $ci ]]; then
3881 - eselect php set $m php${SLOT} || die
3882 - einfo "Switched ${m} to use php:${SLOT}"
3883 - einfo
3884 - elif [[ $ci != "php${SLOT}" ]] ; then
3885 - elog "To switch $m to use php:${SLOT}, run"
3886 - elog " eselect php set $m php${SLOT}"
3887 - elog
3888 - fi
3889 - fi
3890 - done
3891 -
3892 - # Remove dead symlinks for SAPIs that were just disabled. For
3893 - # example, if the user has the cgi SAPI enabled, then he has an
3894 - # eselect-php symlink for it. If he later reinstalls PHP with
3895 - # USE="-cgi", that symlink will break. This call to eselect is
3896 - # supposed to remove that dead link per bug 572436.
3897 - eselect php cleanup || die
3898 -
3899 - if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then
3900 - elog "To build extensions for this version of PHP, you will need to"
3901 - elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable."
3902 - elog
3903 - fi
3904 -
3905 - # Warn about the removal of PHP_INI_VERSION if the user has it set.
3906 - if [[ -n "${PHP_INI_VERSION}" ]]; then
3907 - ewarn 'The PHP_INI_VERSION variable has been phased out. You may'
3908 - ewarn 'remove it from your configuration at your convenience. See'
3909 - ewarn
3910 - ewarn ' https://bugs.gentoo.org/611214'
3911 - ewarn
3912 - ewarn 'for more information.'
3913 - fi
3914 -
3915 - elog "For details on how version slotting works, please see"
3916 - elog "the wiki:"
3917 - elog
3918 - elog " https://wiki.gentoo.org/wiki/PHP"
3919 - elog
3920 -}
3921 -
3922 -pkg_postrm() {
3923 - # This serves two purposes. First, if we have just removed the last
3924 - # installed version of PHP, then this will remove any dead symlinks
3925 - # belonging to eselect-php. Second, if a user upgrades slots from
3926 - # (say) 5.6 to 7.0 and depcleans the old slot, then this will update
3927 - # his existing symlinks to point to the new 7.0 installation. The
3928 - # latter is bug 432962.
3929 - #
3930 - # Note: the eselect-php package may not be installed at this point,
3931 - # so we can't die() if this command fails.
3932 - eselect php cleanup
3933 -}
3934
3935 diff --git a/dev-lang/php/php-7.2.16.ebuild b/dev-lang/php/php-7.2.16.ebuild
3936 deleted file mode 100644
3937 index 30968e0621d..00000000000
3938 --- a/dev-lang/php/php-7.2.16.ebuild
3939 +++ /dev/null
3940 @@ -1,749 +0,0 @@
3941 -# Copyright 1999-2019 Gentoo Authors
3942 -# Distributed under the terms of the GNU General Public License v2
3943 -
3944 -EAPI="7"
3945 -
3946 -inherit flag-o-matic systemd autotools
3947 -
3948 -DESCRIPTION="The PHP language runtime engine"
3949 -HOMEPAGE="https://php.net/"
3950 -SRC_URI="https://php.net/distributions/${P}.tar.xz"
3951 -
3952 -LICENSE="PHP-3.01
3953 - BSD
3954 - Zend-2.0
3955 - bcmath? ( LGPL-2.1+ )
3956 - fpm? ( BSD-2 )
3957 - gd? ( gd )
3958 - unicode? ( BSD-2 LGPL-2.1 )"
3959 -
3960 -SLOT="$(ver_cut 1-2)"
3961 -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"
3962 -
3963 -# We can build the following SAPIs in the given order
3964 -SAPIS="embed cli cgi fpm apache2 phpdbg"
3965 -
3966 -# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
3967 -IUSE="${IUSE}
3968 - ${SAPIS/cli/+cli}
3969 - threads"
3970 -
3971 -IUSE="${IUSE} acl argon2 bcmath berkdb bzip2 calendar cdb cjk
3972 - coverage +ctype curl debug
3973 - enchant exif +fileinfo +filter firebird
3974 - flatfile ftp gd gdbm gmp +hash +iconv imap inifile
3975 - intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl lmdb
3976 - mhash mssql mysql mysqli nls
3977 - oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
3978 - readline recode selinux +session session-mm sharedmem
3979 - +simplexml snmp soap sockets sodium spell sqlite ssl
3980 - sysvipc systemd test tidy +tokenizer tokyocabinet truetype unicode wddx webp
3981 - +xml xmlreader xmlwriter xmlrpc xpm xslt zip zip-encryption zlib"
3982 -
3983 -# The supported (that is, autodetected) versions of BDB are listed in
3984 -# the ./configure script. Other versions *work*, but we need to stick to
3985 -# the ones that can be detected to avoid a repeat of bug #564824.
3986 -COMMON_DEPEND="
3987 - >=app-eselect/eselect-php-0.9.1[apache2?,fpm?]
3988 - >=dev-libs/libpcre-8.32[unicode]
3989 - fpm? ( acl? ( sys-apps/acl ) )
3990 - apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=]
3991 - <www-servers/apache-2.4[threads=] ) )
3992 - argon2? ( app-crypt/argon2:= )
3993 - berkdb? ( || ( sys-libs/db:5.3
3994 - sys-libs/db:5.1
3995 - sys-libs/db:4.8
3996 - sys-libs/db:4.7
3997 - sys-libs/db:4.6
3998 - sys-libs/db:4.5 ) )
3999 - bzip2? ( app-arch/bzip2:0= )
4000 - cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
4001 - coverage? ( dev-util/lcov )
4002 - curl? ( >=net-misc/curl-7.10.5 )
4003 - enchant? ( <app-text/enchant-2.0:0 )
4004 - firebird? ( dev-db/firebird )
4005 - gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib )
4006 - gdbm? ( >=sys-libs/gdbm-1.8.0:0= )
4007 - gmp? ( dev-libs/gmp:0= )
4008 - iconv? ( virtual/libiconv )
4009 - imap? ( virtual/imap-c-client[kerberos=,ssl=] )
4010 - intl? ( dev-libs/icu:= )
4011 - iodbc? ( dev-db/libiodbc )
4012 - kerberos? ( virtual/krb5 )
4013 - ldap? ( >=net-nds/openldap-1.2.11 )
4014 - ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 )
4015 - libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) )
4016 - lmdb? ( dev-db/lmdb:= )
4017 - mssql? ( dev-db/freetds[mssql] )
4018 - nls? ( sys-devel/gettext )
4019 - oci8-instant-client? ( dev-db/oracle-instantclient-basic )
4020 - odbc? ( >=dev-db/unixODBC-1.8.13 )
4021 - postgres? ( dev-db/postgresql:* )
4022 - qdbm? ( dev-db/qdbm )
4023 - readline? ( sys-libs/readline:0= )
4024 - recode? ( app-text/recode )
4025 - session-mm? ( dev-libs/mm )
4026 - simplexml? ( >=dev-libs/libxml2-2.6.8 )
4027 - snmp? ( >=net-analyzer/net-snmp-5.2 )
4028 - soap? ( >=dev-libs/libxml2-2.6.8 )
4029 - sodium? ( dev-libs/libsodium:= )
4030 - spell? ( >=app-text/aspell-0.50 )
4031 - sqlite? ( >=dev-db/sqlite-3.7.6.3 )
4032 - ssl? (
4033 - !libressl? ( dev-libs/openssl:0= )
4034 - libressl? ( dev-libs/libressl:0= )
4035 - )
4036 - tidy? ( || ( app-text/tidy-html5 app-text/htmltidy ) )
4037 - tokyocabinet? ( dev-db/tokyocabinet )
4038 - truetype? ( =media-libs/freetype-2* )
4039 - unicode? ( dev-libs/oniguruma:= )
4040 - wddx? ( >=dev-libs/libxml2-2.6.8 )
4041 - webp? ( media-libs/libwebp:0= )
4042 - xml? ( >=dev-libs/libxml2-2.6.8 )
4043 - xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
4044 - xmlreader? ( >=dev-libs/libxml2-2.6.8 )
4045 - xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
4046 - xpm? ( x11-libs/libXpm )
4047 - xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
4048 - zip? ( sys-libs/zlib:0= )
4049 - zip-encryption? ( >=dev-libs/libzip-1.2.0:= )
4050 - zlib? ( sys-libs/zlib:0= )
4051 -"
4052 -
4053 -RDEPEND="${COMMON_DEPEND}
4054 - virtual/mta
4055 - fpm? (
4056 - selinux? ( sec-policy/selinux-phpfpm )
4057 - systemd? ( sys-apps/systemd ) )"
4058 -
4059 -# Bison isn't actually needed when building from a release tarball
4060 -# However, the configure script will warn if it's absent or if you
4061 -# have an incompatible version installed. See bug 593278.
4062 -DEPEND="${COMMON_DEPEND}
4063 - app-arch/xz-utils
4064 - >=sys-devel/bison-3.0.1"
4065 -
4066 -BDEPEND="virtual/pkgconfig"
4067 -
4068 -# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
4069 -REQUIRED_USE="
4070 - || ( cli cgi fpm apache2 embed phpdbg )
4071 - cli? ( ^^ ( readline libedit ) )
4072 - truetype? ( gd zlib )
4073 - webp? ( gd zlib )
4074 - cjk? ( gd zlib )
4075 - exif? ( gd zlib )
4076 - xpm? ( gd zlib )
4077 - gd? ( zlib )
4078 - simplexml? ( xml )
4079 - soap? ( xml )
4080 - wddx? ( xml )
4081 - xmlrpc? ( || ( xml iconv ) )
4082 - xmlreader? ( xml )
4083 - xslt? ( xml )
4084 - ldap-sasl? ( ldap )
4085 - mhash? ( hash )
4086 - phar? ( hash )
4087 - qdbm? ( !gdbm )
4088 - readline? ( !libedit )
4089 - recode? ( !imap !mysqli !mysql )
4090 - session-mm? ( session !threads )
4091 - mysql? ( hash || ( mysqli pdo ) )
4092 - mysqli? ( hash )
4093 - zip-encryption? ( zip )
4094 -"
4095 -PATCHES=(
4096 - "${FILESDIR}/php-freetype-2.9.1.patch"
4097 - "${FILESDIR}/php-7.2.13-intl-use-icu-namespace.patch"
4098 -)
4099 -
4100 -PHP_MV="$(ver_cut 1)"
4101 -
4102 -php_install_ini() {
4103 - local phpsapi="${1}"
4104 -
4105 - # work out where we are installing the ini file
4106 - php_set_ini_dir "${phpsapi}"
4107 -
4108 - # Always install the production INI file, bug 611214.
4109 - local phpinisrc="php.ini-production-${phpsapi}"
4110 - cp php.ini-production "${phpinisrc}" || die
4111 -
4112 - # default to /tmp for save_path, bug #282768
4113 - sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die
4114 -
4115 - # Set the extension dir
4116 - sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \
4117 - -i "${phpinisrc}" || die
4118 -
4119 - # Set the include path to point to where we want to find PEAR packages
4120 - sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die
4121 -
4122 - dodir "${PHP_INI_DIR#${EPREFIX}}"
4123 - insinto "${PHP_INI_DIR#${EPREFIX}}"
4124 - newins "${phpinisrc}" php.ini
4125 -
4126 - elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}"
4127 - elog
4128 -
4129 - dodir "${PHP_EXT_INI_DIR#${EPREFIX}}"
4130 - dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}"
4131 -
4132 - if use opcache; then
4133 - elog "Adding opcache to $PHP_EXT_INI_DIR"
4134 - echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \
4135 - "${D}/${PHP_EXT_INI_DIR}"/opcache.ini
4136 - dosym "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" \
4137 - "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini"
4138 - fi
4139 -
4140 - # SAPI-specific handling
4141 - if [[ "${sapi}" == "fpm" ]] ; then
4142 - einfo "Installing FPM config files php-fpm.conf and www.conf"
4143 - insinto "${PHP_INI_DIR#${EPREFIX}}"
4144 - doins sapi/fpm/php-fpm.conf
4145 - insinto "${PHP_INI_DIR#${EPREFIX}}/fpm.d"
4146 - doins sapi/fpm/www.conf
4147 - fi
4148 -
4149 - dodoc php.ini-{development,production}
4150 -}
4151 -
4152 -php_set_ini_dir() {
4153 - PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}"
4154 - PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
4155 - PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
4156 -}
4157 -
4158 -src_prepare() {
4159 - default
4160 -
4161 - # In php-7.x, the FPM pool configuration files have been split off
4162 - # of the main config. By default the pool config files go in
4163 - # e.g. /etc/php-fpm.d, which isn't slotted. So here we move the
4164 - # include directory to a subdirectory "fpm.d" of $PHP_INI_DIR. Later
4165 - # we'll install the pool configuration file "www.conf" there.
4166 - php_set_ini_dir fpm
4167 - sed -i "s~^include=.*$~include=${PHP_INI_DIR}/fpm.d/*.conf~" \
4168 - sapi/fpm/php-fpm.conf.in \
4169 - || die 'failed to move the include directory in php-fpm.conf'
4170 -
4171 - # Bug 669566 - necessary so that build tools are updated for commands like pecl
4172 - # Force rebuilding aclocal.m4
4173 - rm -f aclocal.m4 || die "failed to remove aclocal.m4 in src_prepare"
4174 - eautoreconf
4175 -}
4176 -
4177 -src_configure() {
4178 - addpredict /usr/share/snmp/mibs/.index #nowarn
4179 - addpredict /var/lib/net-snmp/mib_indexes #nowarn
4180 -
4181 - PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
4182 -
4183 - # The php-fpm config file wants localstatedir to be ${EPREFIX}/var
4184 - # and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002.
4185 - local our_conf=(
4186 - --prefix="${PHP_DESTDIR}"
4187 - --mandir="${PHP_DESTDIR}/man"
4188 - --infodir="${PHP_DESTDIR}/info"
4189 - --libdir="${PHP_DESTDIR}/lib"
4190 - --with-libdir="$(get_libdir)"
4191 - --localstatedir="${EPREFIX}/var"
4192 - --without-pear
4193 - $(use_enable threads maintainer-zts)
4194 - )
4195 -
4196 - our_conf+=(
4197 - $(use_with argon2 password-argon2 "${EPREFIX}/usr")
4198 - $(use_enable bcmath bcmath)
4199 - $(use_with bzip2 bz2 "${EPREFIX}/usr")
4200 - $(use_enable calendar calendar)
4201 - $(use_enable coverage gcov)
4202 - $(use_enable ctype ctype)
4203 - $(use_with curl curl "${EPREFIX}/usr")
4204 - $(use_enable xml dom)
4205 - $(use_with enchant enchant "${EPREFIX}/usr")
4206 - $(use_enable exif exif)
4207 - $(use_enable fileinfo fileinfo)
4208 - $(use_enable filter filter)
4209 - $(use_enable ftp ftp)
4210 - $(use_with nls gettext "${EPREFIX}/usr")
4211 - $(use_with gmp gmp "${EPREFIX}/usr")
4212 - $(use_enable hash hash)
4213 - $(use_with mhash mhash "${EPREFIX}/usr")
4214 - $(use_with iconv iconv \
4215 - $(use elibc_glibc || use elibc_musl || use elibc_FreeBSD || echo "${EPREFIX}/usr"))
4216 - $(use_enable intl intl)
4217 - $(use_enable ipv6 ipv6)
4218 - $(use_enable json json)
4219 - $(use_with kerberos kerberos "${EPREFIX}/usr")
4220 - $(use_enable xml libxml)
4221 - $(use_with xml libxml-dir "${EPREFIX}/usr")
4222 - $(use_enable unicode mbstring)
4223 - $(use_with unicode onig "${EPREFIX}/usr")
4224 - $(use_with ssl openssl "${EPREFIX}/usr")
4225 - $(use_with ssl openssl-dir "${EPREFIX}/usr")
4226 - $(use_enable pcntl pcntl)
4227 - $(use_enable phar phar)
4228 - $(use_enable pdo pdo)
4229 - $(use_enable opcache opcache)
4230 - $(use_with postgres pgsql "${EPREFIX}/usr")
4231 - $(use_enable posix posix)
4232 - $(use_with spell pspell "${EPREFIX}/usr")
4233 - $(use_with recode recode "${EPREFIX}/usr")
4234 - $(use_enable simplexml simplexml)
4235 - $(use_enable sharedmem shmop)
4236 - $(use_with snmp snmp "${EPREFIX}/usr")
4237 - $(use_enable soap soap)
4238 - $(use_enable sockets sockets)
4239 - $(use_with sodium sodium "${EPREFIX}/usr")
4240 - $(use_with sqlite sqlite3 "${EPREFIX}/usr")
4241 - $(use_enable sysvipc sysvmsg)
4242 - $(use_enable sysvipc sysvsem)
4243 - $(use_enable sysvipc sysvshm)
4244 - $(use_with tidy tidy "${EPREFIX}/usr")
4245 - $(use_enable tokenizer tokenizer)
4246 - $(use_enable wddx wddx)
4247 - $(use_enable xml xml)
4248 - $(use_enable xmlreader xmlreader)
4249 - $(use_enable xmlwriter xmlwriter)
4250 - $(use_with xmlrpc xmlrpc)
4251 - $(use_with xslt xsl "${EPREFIX}/usr")
4252 - $(use_enable zip zip)
4253 - $(use_with zip-encryption libzip "${EPREFIX}/usr")
4254 - $(use_with zlib zlib "${EPREFIX}/usr")
4255 - $(use_enable debug debug)
4256 - )
4257 -
4258 - # DBA support
4259 - if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
4260 - || use qdbm || use lmdb || use tokyocabinet ; then
4261 - our_conf+=( "--enable-dba${shared}" )
4262 - fi
4263 -
4264 - # DBA drivers support
4265 - our_conf+=(
4266 - $(use_with cdb cdb)
4267 - $(use_with berkdb db4 "${EPREFIX}/usr")
4268 - $(use_enable flatfile flatfile)
4269 - $(use_with gdbm gdbm "${EPREFIX}/usr")
4270 - $(use_enable inifile inifile)
4271 - $(use_with qdbm qdbm "${EPREFIX}/usr")
4272 - $(use_with lmdb lmdb "${EPREFIX}/usr")
4273 - )
4274 -
4275 - # Support for the GD graphics library
4276 - our_conf+=(
4277 - $(use_with truetype freetype-dir "${EPREFIX}/usr")
4278 - $(use_enable cjk gd-jis-conv)
4279 - $(use_with gd jpeg-dir "${EPREFIX}/usr")
4280 - $(use_with gd png-dir "${EPREFIX}/usr")
4281 - $(use_with xpm xpm-dir "${EPREFIX}/usr")
4282 - )
4283 - if use webp; then
4284 - our_conf+=( --with-webp-dir="${EPREFIX}/usr" )
4285 - fi
4286 - # enable gd last, so configure can pick up the previous settings
4287 - our_conf+=( $(use_with gd gd) )
4288 -
4289 - # IMAP support
4290 - if use imap ; then
4291 - our_conf+=(
4292 - $(use_with imap imap "${EPREFIX}/usr")
4293 - $(use_with ssl imap-ssl "${EPREFIX}/usr")
4294 - )
4295 - fi
4296 -
4297 - # Interbase/firebird support
4298 - our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") )
4299 -
4300 - # LDAP support
4301 - if use ldap ; then
4302 - our_conf+=(
4303 - $(use_with ldap ldap "${EPREFIX}/usr")
4304 - $(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr")
4305 - )
4306 - fi
4307 -
4308 - # MySQL support
4309 - local mysqllib="mysqlnd"
4310 - local mysqlilib="mysqlnd"
4311 -
4312 - our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
4313 -
4314 - local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock"
4315 - if use mysql || use mysqli ; then
4316 - our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") )
4317 - fi
4318 -
4319 - # ODBC support
4320 - our_conf+=(
4321 - $(use_with odbc unixODBC "${EPREFIX}/usr")
4322 - $(use_with iodbc iodbc "${EPREFIX}/usr")
4323 - )
4324 -
4325 - # Oracle support
4326 - our_conf+=( $(use_with oci8-instant-client oci8) )
4327 -
4328 - # PDO support
4329 - if use pdo ; then
4330 - our_conf+=(
4331 - $(use_with mssql pdo-dblib "${EPREFIX}/usr")
4332 - $(use_with mysql pdo-mysql "${mysqllib}")
4333 - $(use_with postgres pdo-pgsql)
4334 - $(use_with sqlite pdo-sqlite "${EPREFIX}/usr")
4335 - $(use_with firebird pdo-firebird "${EPREFIX}/usr")
4336 - $(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr")
4337 - $(use_with oci8-instant-client pdo-oci)
4338 - )
4339 - fi
4340 -
4341 - # readline/libedit support
4342 - our_conf+=(
4343 - $(use_with readline readline "${EPREFIX}/usr")
4344 - $(use_with libedit libedit "${EPREFIX}/usr")
4345 - )
4346 -
4347 - # Session support
4348 - if use session ; then
4349 - our_conf+=( $(use_with session-mm mm "${EPREFIX}/usr") )
4350 - else
4351 - our_conf+=( $(use_enable session session) )
4352 - fi
4353 -
4354 - # Use pic for shared modules such as apache2's mod_php
4355 - our_conf+=( --with-pic )
4356 -
4357 - # we use the system copy of pcre
4358 - # --with-pcre-regex affects ext/pcre
4359 - # --with-pcre-dir affects ext/filter and ext/zip
4360 - # --with-pcre-valgrind cannot be enabled with system pcre
4361 - # Many arches don't support pcre-jit
4362 - our_conf+=(
4363 - --with-pcre-regex="${EPREFIX}/usr"
4364 - --with-pcre-dir="${EPREFIX}/usr"
4365 - --without-pcre-valgrind
4366 - --without-pcre-jit
4367 - )
4368 -
4369 - # Catch CFLAGS problems
4370 - # Fixes bug #14067.
4371 - # Changed order to run it in reverse for bug #32022 and #12021.
4372 - replace-cpu-flags "k6*" "i586"
4373 -
4374 - # Cache the ./configure test results between SAPIs.
4375 - our_conf+=( --cache-file="${T}/config.cache" )
4376 -
4377 - # Support user-passed configuration parameters
4378 - our_conf+=( ${EXTRA_ECONF:-} )
4379 -
4380 - # Support the Apache2 extras, they must be set globally for all
4381 - # SAPIs to work correctly, especially for external PHP extensions
4382 -
4383 - mkdir -p "${WORKDIR}/sapis-build" || die
4384 - for one_sapi in $SAPIS ; do
4385 - use "${one_sapi}" || continue
4386 - php_set_ini_dir "${one_sapi}"
4387 -
4388 - # The BUILD_DIR variable is used to determine where to output
4389 - # the files that autotools creates. This was all originally
4390 - # based on the autotools-utils eclass.
4391 - BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}"
4392 - cp -a "${S}" "${BUILD_DIR}" || die
4393 - cd "${BUILD_DIR}" || die
4394 -
4395 - local sapi_conf=(
4396 - --with-config-file-path="${PHP_INI_DIR}"
4397 - --with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}"
4398 - )
4399 -
4400 - for sapi in $SAPIS ; do
4401 - case "$sapi" in
4402 - cli|cgi|embed|fpm|phpdbg)
4403 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
4404 - sapi_conf+=( "--enable-${sapi}" )
4405 - if [[ "fpm" == "${sapi}" ]] ; then
4406 - sapi_conf+=(
4407 - $(use_with acl fpm-acl)
4408 - $(use_with systemd fpm-systemd)
4409 - )
4410 - fi
4411 - else
4412 - sapi_conf+=( "--disable-${sapi}" )
4413 - fi
4414 - ;;
4415 -
4416 - apache2)
4417 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
4418 - sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" )
4419 - else
4420 - sapi_conf+=( --without-apxs2 )
4421 - fi
4422 - ;;
4423 - esac
4424 - done
4425 -
4426 - # Construct the $myeconfargs array by concatenating $our_conf
4427 - # (the common args) and $sapi_conf (the SAPI-specific args).
4428 - local myeconfargs=( "${our_conf[@]}" )
4429 - myeconfargs+=( "${sapi_conf[@]}" )
4430 -
4431 - pushd "${BUILD_DIR}" > /dev/null || die
4432 - econf "${myeconfargs[@]}"
4433 - popd > /dev/null || die
4434 - done
4435 -}
4436 -
4437 -src_compile() {
4438 - # snmp seems to run during src_compile, too (bug #324739)
4439 - addpredict /usr/share/snmp/mibs/.index #nowarn
4440 - addpredict /var/lib/net-snmp/mib_indexes #nowarn
4441 -
4442 - for sapi in ${SAPIS} ; do
4443 - if use "${sapi}"; then
4444 - cd "${WORKDIR}/sapis-build/$sapi" || \
4445 - die "Failed to change dir to ${WORKDIR}/sapis-build/$1"
4446 - emake
4447 - fi
4448 - done
4449 -}
4450 -
4451 -src_install() {
4452 - # see bug #324739 for what happens when we don't have that
4453 - addpredict /usr/share/snmp/mibs/.index #nowarn
4454 -
4455 - # grab the first SAPI that got built and install common files from there
4456 - local first_sapi=""
4457 - for sapi in $SAPIS ; do
4458 - if use $sapi ; then
4459 - first_sapi=$sapi
4460 - break
4461 - fi
4462 - done
4463 -
4464 - # Makefile forgets to create this before trying to write to it...
4465 - dodir "${PHP_DESTDIR#${EPREFIX}}/bin"
4466 -
4467 - # Install php environment (without any sapis)
4468 - cd "${WORKDIR}/sapis-build/$first_sapi" || die
4469 - emake INSTALL_ROOT="${D}" \
4470 - install-build install-headers install-programs
4471 -
4472 - local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)"
4473 -
4474 - # Create the directory where we'll put version-specific php scripts
4475 - keepdir "/usr/share/php${PHP_MV}"
4476 -
4477 - local sapi="", file=""
4478 - local sapi_list=""
4479 -
4480 - for sapi in ${SAPIS}; do
4481 - if use "${sapi}" ; then
4482 - einfo "Installing SAPI: ${sapi}"
4483 - cd "${WORKDIR}/sapis-build/${sapi}" || die
4484 -
4485 - if [[ "${sapi}" == "apache2" ]] ; then
4486 - # We're specifically not using emake install-sapi as libtool
4487 - # may cause unnecessary relink failures (see bug #351266)
4488 - insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/"
4489 - newins ".libs/libphp${PHP_MV}$(get_libname)" \
4490 - "libphp${PHP_MV}$(get_libname)"
4491 - keepdir "/usr/$(get_libdir)/apache2/modules"
4492 - else
4493 - # needed each time, php_install_ini would reset it
4494 - local dest="${PHP_DESTDIR#${EPREFIX}}"
4495 - into "${dest}"
4496 - case "$sapi" in
4497 - cli)
4498 - source="sapi/cli/php"
4499 - ;;
4500 - cgi)
4501 - source="sapi/cgi/php-cgi"
4502 - ;;
4503 - fpm)
4504 - source="sapi/fpm/php-fpm"
4505 - ;;
4506 - embed)
4507 - source="libs/libphp${PHP_MV}$(get_libname)"
4508 - ;;
4509 - phpdbg)
4510 - source="sapi/phpdbg/phpdbg"
4511 - ;;
4512 - *)
4513 - die "unhandled sapi in src_install"
4514 - ;;
4515 - esac
4516 -
4517 - if [[ "${source}" == *"$(get_libname)" ]]; then
4518 - dolib.so "${source}"
4519 - else
4520 - dobin "${source}"
4521 - local name="$(basename ${source})"
4522 - dosym "${dest}/bin/${name}" "/usr/bin/${name}${SLOT}"
4523 - fi
4524 - fi
4525 -
4526 - php_install_ini "${sapi}"
4527 -
4528 - # construct correct SAPI string for php-config
4529 - # thanks to ferringb for the bash voodoo
4530 - if [[ "${sapi}" == "apache2" ]]; then
4531 - sapi_list="${sapi_list:+${sapi_list} }apache2handler"
4532 - else
4533 - sapi_list="${sapi_list:+${sapi_list} }${sapi}"
4534 - fi
4535 - fi
4536 - done
4537 -
4538 - # Installing opcache module
4539 - if use opcache ; then
4540 - into "${PHP_DESTDIR#${EPREFIX}}"
4541 - dolib.so "modules/opcache$(get_libname)"
4542 - fi
4543 -
4544 - # Install env.d files
4545 - newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}"
4546 - sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
4547 - sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
4548 -
4549 - # set php-config variable correctly (bug #278439)
4550 - sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \
4551 - "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die
4552 -
4553 - if use fpm ; then
4554 - if use systemd; then
4555 - systemd_newunit "${FILESDIR}/php-fpm_at.service" \
4556 - "php-fpm@${SLOT}.service"
4557 - else
4558 - systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \
4559 - "php-fpm@${SLOT}.service"
4560 - fi
4561 - fi
4562 -}
4563 -
4564 -src_test() {
4565 - echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
4566 - PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
4567 - if [[ ! -x "${PHP_BIN}" ]] ; then
4568 - ewarn "Test phase requires USE=cli, skipping"
4569 - return
4570 - else
4571 - export TEST_PHP_EXECUTABLE="${PHP_BIN}"
4572 - fi
4573 -
4574 - if [[ -x "${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" ]] ; then
4575 - export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi"
4576 - fi
4577 -
4578 - if [[ -x "${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" ]] ; then
4579 - export TEST_PHPDBG_EXECUTABLE="${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg"
4580 - fi
4581 -
4582 - REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \
4583 - "session.save_path=${T}" \
4584 - "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \
4585 - "session.save_path=${T}"
4586 -
4587 - for name in ${EXPECTED_TEST_FAILURES}; do
4588 - mv "${name}.out" "${name}.out.orig" 2>/dev/null || die
4589 - done
4590 -
4591 - local failed="$(find -name '*.out')"
4592 - if [[ ${failed} != "" ]] ; then
4593 - ewarn "The following test cases failed unexpectedly:"
4594 - for name in ${failed}; do
4595 - ewarn " ${name/.out/}"
4596 - done
4597 - else
4598 - einfo "No unexpected test failures, all fine"
4599 - fi
4600 -
4601 - if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
4602 - local passed=""
4603 - for name in ${EXPECTED_TEST_FAILURES}; do
4604 - [[ -f "${name}.diff" ]] && continue
4605 - passed="${passed} ${name}"
4606 - done
4607 - if [[ ${passed} != "" ]] ; then
4608 - einfo "The following test cases passed unexpectedly:"
4609 - for name in ${passed}; do
4610 - ewarn " ${passed}"
4611 - done
4612 - else
4613 - einfo "None of the known-to-fail tests passed, all fine"
4614 - fi
4615 - fi
4616 -}
4617 -
4618 -pkg_postinst() {
4619 - # Output some general info to the user
4620 - if use apache2 ; then
4621 - elog
4622 - elog "To enable PHP in apache, you will need to add \"-D PHP\" to"
4623 - elog "your apache2 command. OpenRC users can append that string to"
4624 - elog "APACHE2_OPTS in /etc/conf.d/apache2."
4625 - elog
4626 - elog "The apache module configuration file 70_mod_php.conf is"
4627 - elog "provided (and maintained) by eselect-php."
4628 - elog
4629 - fi
4630 -
4631 - # Create the symlinks for php
4632 - for m in ${SAPIS}; do
4633 - [[ ${m} == 'embed' ]] && continue;
4634 - if use $m ; then
4635 - local ci=$(eselect php show $m)
4636 - if [[ -z $ci ]]; then
4637 - eselect php set $m php${SLOT} || die
4638 - einfo "Switched ${m} to use php:${SLOT}"
4639 - einfo
4640 - elif [[ $ci != "php${SLOT}" ]] ; then
4641 - elog "To switch $m to use php:${SLOT}, run"
4642 - elog " eselect php set $m php${SLOT}"
4643 - elog
4644 - fi
4645 - fi
4646 - done
4647 -
4648 - # Remove dead symlinks for SAPIs that were just disabled. For
4649 - # example, if the user has the cgi SAPI enabled, then he has an
4650 - # eselect-php symlink for it. If he later reinstalls PHP with
4651 - # USE="-cgi", that symlink will break. This call to eselect is
4652 - # supposed to remove that dead link per bug 572436.
4653 - eselect php cleanup || die
4654 -
4655 - if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then
4656 - elog "To build extensions for this version of PHP, you will need to"
4657 - elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable."
4658 - elog
4659 - fi
4660 -
4661 - # Warn about the removal of PHP_INI_VERSION if the user has it set.
4662 - if [[ -n "${PHP_INI_VERSION}" ]]; then
4663 - ewarn 'The PHP_INI_VERSION variable has been phased out. You may'
4664 - ewarn 'remove it from your configuration at your convenience. See'
4665 - ewarn
4666 - ewarn ' https://bugs.gentoo.org/611214'
4667 - ewarn
4668 - ewarn 'for more information.'
4669 - fi
4670 -
4671 - elog "For details on how version slotting works, please see"
4672 - elog "the wiki:"
4673 - elog
4674 - elog " https://wiki.gentoo.org/wiki/PHP"
4675 - elog
4676 -}
4677 -
4678 -pkg_postrm() {
4679 - # This serves two purposes. First, if we have just removed the last
4680 - # installed version of PHP, then this will remove any dead symlinks
4681 - # belonging to eselect-php. Second, if a user upgrades slots from
4682 - # (say) 5.6 to 7.0 and depcleans the old slot, then this will update
4683 - # his existing symlinks to point to the new 7.0 installation. The
4684 - # latter is bug 432962.
4685 - #
4686 - # Note: the eselect-php package may not be installed at this point,
4687 - # so we can't die() if this command fails.
4688 - eselect php cleanup
4689 -}
4690
4691 diff --git a/dev-lang/php/php-7.2.18.ebuild b/dev-lang/php/php-7.2.18.ebuild
4692 deleted file mode 100644
4693 index 2d85e9d999e..00000000000
4694 --- a/dev-lang/php/php-7.2.18.ebuild
4695 +++ /dev/null
4696 @@ -1,749 +0,0 @@
4697 -# Copyright 1999-2019 Gentoo Authors
4698 -# Distributed under the terms of the GNU General Public License v2
4699 -
4700 -EAPI="7"
4701 -
4702 -inherit flag-o-matic systemd autotools
4703 -
4704 -DESCRIPTION="The PHP language runtime engine"
4705 -HOMEPAGE="https://php.net/"
4706 -SRC_URI="https://php.net/distributions/${P}.tar.xz"
4707 -
4708 -LICENSE="PHP-3.01
4709 - BSD
4710 - Zend-2.0
4711 - bcmath? ( LGPL-2.1+ )
4712 - fpm? ( BSD-2 )
4713 - gd? ( gd )
4714 - unicode? ( BSD-2 LGPL-2.1 )"
4715 -
4716 -SLOT="$(ver_cut 1-2)"
4717 -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"
4718 -
4719 -# We can build the following SAPIs in the given order
4720 -SAPIS="embed cli cgi fpm apache2 phpdbg"
4721 -
4722 -# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
4723 -IUSE="${IUSE}
4724 - ${SAPIS/cli/+cli}
4725 - threads"
4726 -
4727 -IUSE="${IUSE} acl argon2 bcmath berkdb bzip2 calendar cdb cjk
4728 - coverage +ctype curl debug
4729 - enchant exif +fileinfo +filter firebird
4730 - flatfile ftp gd gdbm gmp +hash +iconv imap inifile
4731 - intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl lmdb
4732 - mhash mssql mysql mysqli nls
4733 - oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
4734 - readline recode selinux +session session-mm sharedmem
4735 - +simplexml snmp soap sockets sodium spell sqlite ssl
4736 - sysvipc systemd test tidy +tokenizer tokyocabinet truetype unicode wddx webp
4737 - +xml xmlreader xmlwriter xmlrpc xpm xslt zip zip-encryption zlib"
4738 -
4739 -# The supported (that is, autodetected) versions of BDB are listed in
4740 -# the ./configure script. Other versions *work*, but we need to stick to
4741 -# the ones that can be detected to avoid a repeat of bug #564824.
4742 -COMMON_DEPEND="
4743 - >=app-eselect/eselect-php-0.9.1[apache2?,fpm?]
4744 - >=dev-libs/libpcre-8.32[unicode]
4745 - fpm? ( acl? ( sys-apps/acl ) )
4746 - apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=]
4747 - <www-servers/apache-2.4[threads=] ) )
4748 - argon2? ( app-crypt/argon2:= )
4749 - berkdb? ( || ( sys-libs/db:5.3
4750 - sys-libs/db:5.1
4751 - sys-libs/db:4.8
4752 - sys-libs/db:4.7
4753 - sys-libs/db:4.6
4754 - sys-libs/db:4.5 ) )
4755 - bzip2? ( app-arch/bzip2:0= )
4756 - cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
4757 - coverage? ( dev-util/lcov )
4758 - curl? ( >=net-misc/curl-7.10.5 )
4759 - enchant? ( <app-text/enchant-2.0:0 )
4760 - firebird? ( dev-db/firebird )
4761 - gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib )
4762 - gdbm? ( >=sys-libs/gdbm-1.8.0:0= )
4763 - gmp? ( dev-libs/gmp:0= )
4764 - iconv? ( virtual/libiconv )
4765 - imap? ( virtual/imap-c-client[kerberos=,ssl=] )
4766 - intl? ( dev-libs/icu:= )
4767 - iodbc? ( dev-db/libiodbc )
4768 - kerberos? ( virtual/krb5 )
4769 - ldap? ( >=net-nds/openldap-1.2.11 )
4770 - ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 )
4771 - libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) )
4772 - lmdb? ( dev-db/lmdb:= )
4773 - mssql? ( dev-db/freetds[mssql] )
4774 - nls? ( sys-devel/gettext )
4775 - oci8-instant-client? ( dev-db/oracle-instantclient-basic )
4776 - odbc? ( >=dev-db/unixODBC-1.8.13 )
4777 - postgres? ( dev-db/postgresql:* )
4778 - qdbm? ( dev-db/qdbm )
4779 - readline? ( sys-libs/readline:0= )
4780 - recode? ( app-text/recode )
4781 - session-mm? ( dev-libs/mm )
4782 - simplexml? ( >=dev-libs/libxml2-2.6.8 )
4783 - snmp? ( >=net-analyzer/net-snmp-5.2 )
4784 - soap? ( >=dev-libs/libxml2-2.6.8 )
4785 - sodium? ( dev-libs/libsodium:= )
4786 - spell? ( >=app-text/aspell-0.50 )
4787 - sqlite? ( >=dev-db/sqlite-3.7.6.3 )
4788 - ssl? (
4789 - !libressl? ( dev-libs/openssl:0= )
4790 - libressl? ( dev-libs/libressl:0= )
4791 - )
4792 - tidy? ( || ( app-text/tidy-html5 app-text/htmltidy ) )
4793 - tokyocabinet? ( dev-db/tokyocabinet )
4794 - truetype? ( =media-libs/freetype-2* )
4795 - unicode? ( dev-libs/oniguruma:= )
4796 - wddx? ( >=dev-libs/libxml2-2.6.8 )
4797 - webp? ( media-libs/libwebp:0= )
4798 - xml? ( >=dev-libs/libxml2-2.6.8 )
4799 - xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
4800 - xmlreader? ( >=dev-libs/libxml2-2.6.8 )
4801 - xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
4802 - xpm? ( x11-libs/libXpm )
4803 - xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
4804 - zip? ( sys-libs/zlib:0= )
4805 - zip-encryption? ( >=dev-libs/libzip-1.2.0:= )
4806 - zlib? ( sys-libs/zlib:0= )
4807 -"
4808 -
4809 -RDEPEND="${COMMON_DEPEND}
4810 - virtual/mta
4811 - fpm? (
4812 - selinux? ( sec-policy/selinux-phpfpm )
4813 - systemd? ( sys-apps/systemd ) )"
4814 -
4815 -# Bison isn't actually needed when building from a release tarball
4816 -# However, the configure script will warn if it's absent or if you
4817 -# have an incompatible version installed. See bug 593278.
4818 -DEPEND="${COMMON_DEPEND}
4819 - app-arch/xz-utils
4820 - >=sys-devel/bison-3.0.1"
4821 -
4822 -BDEPEND="virtual/pkgconfig"
4823 -
4824 -# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
4825 -REQUIRED_USE="
4826 - || ( cli cgi fpm apache2 embed phpdbg )
4827 - cli? ( ^^ ( readline libedit ) )
4828 - truetype? ( gd zlib )
4829 - webp? ( gd zlib )
4830 - cjk? ( gd zlib )
4831 - exif? ( gd zlib )
4832 - xpm? ( gd zlib )
4833 - gd? ( zlib )
4834 - simplexml? ( xml )
4835 - soap? ( xml )
4836 - wddx? ( xml )
4837 - xmlrpc? ( || ( xml iconv ) )
4838 - xmlreader? ( xml )
4839 - xslt? ( xml )
4840 - ldap-sasl? ( ldap )
4841 - mhash? ( hash )
4842 - phar? ( hash )
4843 - qdbm? ( !gdbm )
4844 - readline? ( !libedit )
4845 - recode? ( !imap !mysqli !mysql )
4846 - session-mm? ( session !threads )
4847 - mysql? ( hash || ( mysqli pdo ) )
4848 - mysqli? ( hash )
4849 - zip-encryption? ( zip )
4850 -"
4851 -PATCHES=(
4852 - "${FILESDIR}/php-freetype-2.9.1.patch"
4853 - "${FILESDIR}/php-7.2.13-intl-use-icu-namespace.patch"
4854 -)
4855 -
4856 -PHP_MV="$(ver_cut 1)"
4857 -
4858 -php_install_ini() {
4859 - local phpsapi="${1}"
4860 -
4861 - # work out where we are installing the ini file
4862 - php_set_ini_dir "${phpsapi}"
4863 -
4864 - # Always install the production INI file, bug 611214.
4865 - local phpinisrc="php.ini-production-${phpsapi}"
4866 - cp php.ini-production "${phpinisrc}" || die
4867 -
4868 - # default to /tmp for save_path, bug #282768
4869 - sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die
4870 -
4871 - # Set the extension dir
4872 - sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \
4873 - -i "${phpinisrc}" || die
4874 -
4875 - # Set the include path to point to where we want to find PEAR packages
4876 - sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die
4877 -
4878 - dodir "${PHP_INI_DIR#${EPREFIX}}"
4879 - insinto "${PHP_INI_DIR#${EPREFIX}}"
4880 - newins "${phpinisrc}" php.ini
4881 -
4882 - elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}"
4883 - elog
4884 -
4885 - dodir "${PHP_EXT_INI_DIR#${EPREFIX}}"
4886 - dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}"
4887 -
4888 - if use opcache; then
4889 - elog "Adding opcache to $PHP_EXT_INI_DIR"
4890 - echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \
4891 - "${D}/${PHP_EXT_INI_DIR}"/opcache.ini
4892 - dosym "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" \
4893 - "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini"
4894 - fi
4895 -
4896 - # SAPI-specific handling
4897 - if [[ "${sapi}" == "fpm" ]] ; then
4898 - einfo "Installing FPM config files php-fpm.conf and www.conf"
4899 - insinto "${PHP_INI_DIR#${EPREFIX}}"
4900 - doins sapi/fpm/php-fpm.conf
4901 - insinto "${PHP_INI_DIR#${EPREFIX}}/fpm.d"
4902 - doins sapi/fpm/www.conf
4903 - fi
4904 -
4905 - dodoc php.ini-{development,production}
4906 -}
4907 -
4908 -php_set_ini_dir() {
4909 - PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}"
4910 - PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
4911 - PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
4912 -}
4913 -
4914 -src_prepare() {
4915 - default
4916 -
4917 - # In php-7.x, the FPM pool configuration files have been split off
4918 - # of the main config. By default the pool config files go in
4919 - # e.g. /etc/php-fpm.d, which isn't slotted. So here we move the
4920 - # include directory to a subdirectory "fpm.d" of $PHP_INI_DIR. Later
4921 - # we'll install the pool configuration file "www.conf" there.
4922 - php_set_ini_dir fpm
4923 - sed -i "s~^include=.*$~include=${PHP_INI_DIR}/fpm.d/*.conf~" \
4924 - sapi/fpm/php-fpm.conf.in \
4925 - || die 'failed to move the include directory in php-fpm.conf'
4926 -
4927 - # Bug 669566 - necessary so that build tools are updated for commands like pecl
4928 - # Force rebuilding aclocal.m4
4929 - rm -f aclocal.m4 || die "failed to remove aclocal.m4 in src_prepare"
4930 - eautoreconf
4931 -}
4932 -
4933 -src_configure() {
4934 - addpredict /usr/share/snmp/mibs/.index #nowarn
4935 - addpredict /var/lib/net-snmp/mib_indexes #nowarn
4936 -
4937 - PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
4938 -
4939 - # The php-fpm config file wants localstatedir to be ${EPREFIX}/var
4940 - # and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002.
4941 - local our_conf=(
4942 - --prefix="${PHP_DESTDIR}"
4943 - --mandir="${PHP_DESTDIR}/man"
4944 - --infodir="${PHP_DESTDIR}/info"
4945 - --libdir="${PHP_DESTDIR}/lib"
4946 - --with-libdir="$(get_libdir)"
4947 - --localstatedir="${EPREFIX}/var"
4948 - --without-pear
4949 - $(use_enable threads maintainer-zts)
4950 - )
4951 -
4952 - our_conf+=(
4953 - $(use_with argon2 password-argon2 "${EPREFIX}/usr")
4954 - $(use_enable bcmath bcmath)
4955 - $(use_with bzip2 bz2 "${EPREFIX}/usr")
4956 - $(use_enable calendar calendar)
4957 - $(use_enable coverage gcov)
4958 - $(use_enable ctype ctype)
4959 - $(use_with curl curl "${EPREFIX}/usr")
4960 - $(use_enable xml dom)
4961 - $(use_with enchant enchant "${EPREFIX}/usr")
4962 - $(use_enable exif exif)
4963 - $(use_enable fileinfo fileinfo)
4964 - $(use_enable filter filter)
4965 - $(use_enable ftp ftp)
4966 - $(use_with nls gettext "${EPREFIX}/usr")
4967 - $(use_with gmp gmp "${EPREFIX}/usr")
4968 - $(use_enable hash hash)
4969 - $(use_with mhash mhash "${EPREFIX}/usr")
4970 - $(use_with iconv iconv \
4971 - $(use elibc_glibc || use elibc_musl || use elibc_FreeBSD || echo "${EPREFIX}/usr"))
4972 - $(use_enable intl intl)
4973 - $(use_enable ipv6 ipv6)
4974 - $(use_enable json json)
4975 - $(use_with kerberos kerberos "${EPREFIX}/usr")
4976 - $(use_enable xml libxml)
4977 - $(use_with xml libxml-dir "${EPREFIX}/usr")
4978 - $(use_enable unicode mbstring)
4979 - $(use_with unicode onig "${EPREFIX}/usr")
4980 - $(use_with ssl openssl "${EPREFIX}/usr")
4981 - $(use_with ssl openssl-dir "${EPREFIX}/usr")
4982 - $(use_enable pcntl pcntl)
4983 - $(use_enable phar phar)
4984 - $(use_enable pdo pdo)
4985 - $(use_enable opcache opcache)
4986 - $(use_with postgres pgsql "${EPREFIX}/usr")
4987 - $(use_enable posix posix)
4988 - $(use_with spell pspell "${EPREFIX}/usr")
4989 - $(use_with recode recode "${EPREFIX}/usr")
4990 - $(use_enable simplexml simplexml)
4991 - $(use_enable sharedmem shmop)
4992 - $(use_with snmp snmp "${EPREFIX}/usr")
4993 - $(use_enable soap soap)
4994 - $(use_enable sockets sockets)
4995 - $(use_with sodium sodium "${EPREFIX}/usr")
4996 - $(use_with sqlite sqlite3 "${EPREFIX}/usr")
4997 - $(use_enable sysvipc sysvmsg)
4998 - $(use_enable sysvipc sysvsem)
4999 - $(use_enable sysvipc sysvshm)
5000 - $(use_with tidy tidy "${EPREFIX}/usr")
5001 - $(use_enable tokenizer tokenizer)
5002 - $(use_enable wddx wddx)
5003 - $(use_enable xml xml)
5004 - $(use_enable xmlreader xmlreader)
5005 - $(use_enable xmlwriter xmlwriter)
5006 - $(use_with xmlrpc xmlrpc)
5007 - $(use_with xslt xsl "${EPREFIX}/usr")
5008 - $(use_enable zip zip)
5009 - $(use_with zip-encryption libzip "${EPREFIX}/usr")
5010 - $(use_with zlib zlib "${EPREFIX}/usr")
5011 - $(use_enable debug debug)
5012 - )
5013 -
5014 - # DBA support
5015 - if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
5016 - || use qdbm || use lmdb || use tokyocabinet ; then
5017 - our_conf+=( "--enable-dba${shared}" )
5018 - fi
5019 -
5020 - # DBA drivers support
5021 - our_conf+=(
5022 - $(use_with cdb cdb)
5023 - $(use_with berkdb db4 "${EPREFIX}/usr")
5024 - $(use_enable flatfile flatfile)
5025 - $(use_with gdbm gdbm "${EPREFIX}/usr")
5026 - $(use_enable inifile inifile)
5027 - $(use_with qdbm qdbm "${EPREFIX}/usr")
5028 - $(use_with lmdb lmdb "${EPREFIX}/usr")
5029 - )
5030 -
5031 - # Support for the GD graphics library
5032 - our_conf+=(
5033 - $(use_with truetype freetype-dir "${EPREFIX}/usr")
5034 - $(use_enable cjk gd-jis-conv)
5035 - $(use_with gd jpeg-dir "${EPREFIX}/usr")
5036 - $(use_with gd png-dir "${EPREFIX}/usr")
5037 - $(use_with xpm xpm-dir "${EPREFIX}/usr")
5038 - )
5039 - if use webp; then
5040 - our_conf+=( --with-webp-dir="${EPREFIX}/usr" )
5041 - fi
5042 - # enable gd last, so configure can pick up the previous settings
5043 - our_conf+=( $(use_with gd gd) )
5044 -
5045 - # IMAP support
5046 - if use imap ; then
5047 - our_conf+=(
5048 - $(use_with imap imap "${EPREFIX}/usr")
5049 - $(use_with ssl imap-ssl "${EPREFIX}/usr")
5050 - )
5051 - fi
5052 -
5053 - # Interbase/firebird support
5054 - our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") )
5055 -
5056 - # LDAP support
5057 - if use ldap ; then
5058 - our_conf+=(
5059 - $(use_with ldap ldap "${EPREFIX}/usr")
5060 - $(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr")
5061 - )
5062 - fi
5063 -
5064 - # MySQL support
5065 - local mysqllib="mysqlnd"
5066 - local mysqlilib="mysqlnd"
5067 -
5068 - our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
5069 -
5070 - local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock"
5071 - if use mysql || use mysqli ; then
5072 - our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") )
5073 - fi
5074 -
5075 - # ODBC support
5076 - our_conf+=(
5077 - $(use_with odbc unixODBC "${EPREFIX}/usr")
5078 - $(use_with iodbc iodbc "${EPREFIX}/usr")
5079 - )
5080 -
5081 - # Oracle support
5082 - our_conf+=( $(use_with oci8-instant-client oci8) )
5083 -
5084 - # PDO support
5085 - if use pdo ; then
5086 - our_conf+=(
5087 - $(use_with mssql pdo-dblib "${EPREFIX}/usr")
5088 - $(use_with mysql pdo-mysql "${mysqllib}")
5089 - $(use_with postgres pdo-pgsql)
5090 - $(use_with sqlite pdo-sqlite "${EPREFIX}/usr")
5091 - $(use_with firebird pdo-firebird "${EPREFIX}/usr")
5092 - $(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr")
5093 - $(use_with oci8-instant-client pdo-oci)
5094 - )
5095 - fi
5096 -
5097 - # readline/libedit support
5098 - our_conf+=(
5099 - $(use_with readline readline "${EPREFIX}/usr")
5100 - $(use_with libedit libedit "${EPREFIX}/usr")
5101 - )
5102 -
5103 - # Session support
5104 - if use session ; then
5105 - our_conf+=( $(use_with session-mm mm "${EPREFIX}/usr") )
5106 - else
5107 - our_conf+=( $(use_enable session session) )
5108 - fi
5109 -
5110 - # Use pic for shared modules such as apache2's mod_php
5111 - our_conf+=( --with-pic )
5112 -
5113 - # we use the system copy of pcre
5114 - # --with-pcre-regex affects ext/pcre
5115 - # --with-pcre-dir affects ext/filter and ext/zip
5116 - # --with-pcre-valgrind cannot be enabled with system pcre
5117 - # Many arches don't support pcre-jit
5118 - our_conf+=(
5119 - --with-pcre-regex="${EPREFIX}/usr"
5120 - --with-pcre-dir="${EPREFIX}/usr"
5121 - --without-pcre-valgrind
5122 - --without-pcre-jit
5123 - )
5124 -
5125 - # Catch CFLAGS problems
5126 - # Fixes bug #14067.
5127 - # Changed order to run it in reverse for bug #32022 and #12021.
5128 - replace-cpu-flags "k6*" "i586"
5129 -
5130 - # Cache the ./configure test results between SAPIs.
5131 - our_conf+=( --cache-file="${T}/config.cache" )
5132 -
5133 - # Support user-passed configuration parameters
5134 - our_conf+=( ${EXTRA_ECONF:-} )
5135 -
5136 - # Support the Apache2 extras, they must be set globally for all
5137 - # SAPIs to work correctly, especially for external PHP extensions
5138 -
5139 - mkdir -p "${WORKDIR}/sapis-build" || die
5140 - for one_sapi in $SAPIS ; do
5141 - use "${one_sapi}" || continue
5142 - php_set_ini_dir "${one_sapi}"
5143 -
5144 - # The BUILD_DIR variable is used to determine where to output
5145 - # the files that autotools creates. This was all originally
5146 - # based on the autotools-utils eclass.
5147 - BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}"
5148 - cp -a "${S}" "${BUILD_DIR}" || die
5149 - cd "${BUILD_DIR}" || die
5150 -
5151 - local sapi_conf=(
5152 - --with-config-file-path="${PHP_INI_DIR}"
5153 - --with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}"
5154 - )
5155 -
5156 - for sapi in $SAPIS ; do
5157 - case "$sapi" in
5158 - cli|cgi|embed|fpm|phpdbg)
5159 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
5160 - sapi_conf+=( "--enable-${sapi}" )
5161 - if [[ "fpm" == "${sapi}" ]] ; then
5162 - sapi_conf+=(
5163 - $(use_with acl fpm-acl)
5164 - $(use_with systemd fpm-systemd)
5165 - )
5166 - fi
5167 - else
5168 - sapi_conf+=( "--disable-${sapi}" )
5169 - fi
5170 - ;;
5171 -
5172 - apache2)
5173 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
5174 - sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" )
5175 - else
5176 - sapi_conf+=( --without-apxs2 )
5177 - fi
5178 - ;;
5179 - esac
5180 - done
5181 -
5182 - # Construct the $myeconfargs array by concatenating $our_conf
5183 - # (the common args) and $sapi_conf (the SAPI-specific args).
5184 - local myeconfargs=( "${our_conf[@]}" )
5185 - myeconfargs+=( "${sapi_conf[@]}" )
5186 -
5187 - pushd "${BUILD_DIR}" > /dev/null || die
5188 - econf "${myeconfargs[@]}"
5189 - popd > /dev/null || die
5190 - done
5191 -}
5192 -
5193 -src_compile() {
5194 - # snmp seems to run during src_compile, too (bug #324739)
5195 - addpredict /usr/share/snmp/mibs/.index #nowarn
5196 - addpredict /var/lib/net-snmp/mib_indexes #nowarn
5197 -
5198 - for sapi in ${SAPIS} ; do
5199 - if use "${sapi}"; then
5200 - cd "${WORKDIR}/sapis-build/$sapi" || \
5201 - die "Failed to change dir to ${WORKDIR}/sapis-build/$1"
5202 - emake
5203 - fi
5204 - done
5205 -}
5206 -
5207 -src_install() {
5208 - # see bug #324739 for what happens when we don't have that
5209 - addpredict /usr/share/snmp/mibs/.index #nowarn
5210 -
5211 - # grab the first SAPI that got built and install common files from there
5212 - local first_sapi=""
5213 - for sapi in $SAPIS ; do
5214 - if use $sapi ; then
5215 - first_sapi=$sapi
5216 - break
5217 - fi
5218 - done
5219 -
5220 - # Makefile forgets to create this before trying to write to it...
5221 - dodir "${PHP_DESTDIR#${EPREFIX}}/bin"
5222 -
5223 - # Install php environment (without any sapis)
5224 - cd "${WORKDIR}/sapis-build/$first_sapi" || die
5225 - emake INSTALL_ROOT="${D}" \
5226 - install-build install-headers install-programs
5227 -
5228 - local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)"
5229 -
5230 - # Create the directory where we'll put version-specific php scripts
5231 - keepdir "/usr/share/php${PHP_MV}"
5232 -
5233 - local sapi="", file=""
5234 - local sapi_list=""
5235 -
5236 - for sapi in ${SAPIS}; do
5237 - if use "${sapi}" ; then
5238 - einfo "Installing SAPI: ${sapi}"
5239 - cd "${WORKDIR}/sapis-build/${sapi}" || die
5240 -
5241 - if [[ "${sapi}" == "apache2" ]] ; then
5242 - # We're specifically not using emake install-sapi as libtool
5243 - # may cause unnecessary relink failures (see bug #351266)
5244 - insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/"
5245 - newins ".libs/libphp${PHP_MV}$(get_libname)" \
5246 - "libphp${PHP_MV}$(get_libname)"
5247 - keepdir "/usr/$(get_libdir)/apache2/modules"
5248 - else
5249 - # needed each time, php_install_ini would reset it
5250 - local dest="${PHP_DESTDIR#${EPREFIX}}"
5251 - into "${dest}"
5252 - case "$sapi" in
5253 - cli)
5254 - source="sapi/cli/php"
5255 - ;;
5256 - cgi)
5257 - source="sapi/cgi/php-cgi"
5258 - ;;
5259 - fpm)
5260 - source="sapi/fpm/php-fpm"
5261 - ;;
5262 - embed)
5263 - source="libs/libphp${PHP_MV}$(get_libname)"
5264 - ;;
5265 - phpdbg)
5266 - source="sapi/phpdbg/phpdbg"
5267 - ;;
5268 - *)
5269 - die "unhandled sapi in src_install"
5270 - ;;
5271 - esac
5272 -
5273 - if [[ "${source}" == *"$(get_libname)" ]]; then
5274 - dolib.so "${source}"
5275 - else
5276 - dobin "${source}"
5277 - local name="$(basename ${source})"
5278 - dosym "${dest}/bin/${name}" "/usr/bin/${name}${SLOT}"
5279 - fi
5280 - fi
5281 -
5282 - php_install_ini "${sapi}"
5283 -
5284 - # construct correct SAPI string for php-config
5285 - # thanks to ferringb for the bash voodoo
5286 - if [[ "${sapi}" == "apache2" ]]; then
5287 - sapi_list="${sapi_list:+${sapi_list} }apache2handler"
5288 - else
5289 - sapi_list="${sapi_list:+${sapi_list} }${sapi}"
5290 - fi
5291 - fi
5292 - done
5293 -
5294 - # Installing opcache module
5295 - if use opcache ; then
5296 - into "${PHP_DESTDIR#${EPREFIX}}"
5297 - dolib.so "modules/opcache$(get_libname)"
5298 - fi
5299 -
5300 - # Install env.d files
5301 - newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}"
5302 - sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
5303 - sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
5304 -
5305 - # set php-config variable correctly (bug #278439)
5306 - sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \
5307 - "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die
5308 -
5309 - if use fpm ; then
5310 - if use systemd; then
5311 - systemd_newunit "${FILESDIR}/php-fpm_at.service" \
5312 - "php-fpm@${SLOT}.service"
5313 - else
5314 - systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \
5315 - "php-fpm@${SLOT}.service"
5316 - fi
5317 - fi
5318 -}
5319 -
5320 -src_test() {
5321 - echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
5322 - PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
5323 - if [[ ! -x "${PHP_BIN}" ]] ; then
5324 - ewarn "Test phase requires USE=cli, skipping"
5325 - return
5326 - else
5327 - export TEST_PHP_EXECUTABLE="${PHP_BIN}"
5328 - fi
5329 -
5330 - if [[ -x "${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" ]] ; then
5331 - export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi"
5332 - fi
5333 -
5334 - if [[ -x "${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" ]] ; then
5335 - export TEST_PHPDBG_EXECUTABLE="${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg"
5336 - fi
5337 -
5338 - REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \
5339 - "session.save_path=${T}" \
5340 - "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \
5341 - "session.save_path=${T}"
5342 -
5343 - for name in ${EXPECTED_TEST_FAILURES}; do
5344 - mv "${name}.out" "${name}.out.orig" 2>/dev/null || die
5345 - done
5346 -
5347 - local failed="$(find -name '*.out')"
5348 - if [[ ${failed} != "" ]] ; then
5349 - ewarn "The following test cases failed unexpectedly:"
5350 - for name in ${failed}; do
5351 - ewarn " ${name/.out/}"
5352 - done
5353 - else
5354 - einfo "No unexpected test failures, all fine"
5355 - fi
5356 -
5357 - if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
5358 - local passed=""
5359 - for name in ${EXPECTED_TEST_FAILURES}; do
5360 - [[ -f "${name}.diff" ]] && continue
5361 - passed="${passed} ${name}"
5362 - done
5363 - if [[ ${passed} != "" ]] ; then
5364 - einfo "The following test cases passed unexpectedly:"
5365 - for name in ${passed}; do
5366 - ewarn " ${passed}"
5367 - done
5368 - else
5369 - einfo "None of the known-to-fail tests passed, all fine"
5370 - fi
5371 - fi
5372 -}
5373 -
5374 -pkg_postinst() {
5375 - # Output some general info to the user
5376 - if use apache2 ; then
5377 - elog
5378 - elog "To enable PHP in apache, you will need to add \"-D PHP\" to"
5379 - elog "your apache2 command. OpenRC users can append that string to"
5380 - elog "APACHE2_OPTS in /etc/conf.d/apache2."
5381 - elog
5382 - elog "The apache module configuration file 70_mod_php.conf is"
5383 - elog "provided (and maintained) by eselect-php."
5384 - elog
5385 - fi
5386 -
5387 - # Create the symlinks for php
5388 - for m in ${SAPIS}; do
5389 - [[ ${m} == 'embed' ]] && continue;
5390 - if use $m ; then
5391 - local ci=$(eselect php show $m)
5392 - if [[ -z $ci ]]; then
5393 - eselect php set $m php${SLOT} || die
5394 - einfo "Switched ${m} to use php:${SLOT}"
5395 - einfo
5396 - elif [[ $ci != "php${SLOT}" ]] ; then
5397 - elog "To switch $m to use php:${SLOT}, run"
5398 - elog " eselect php set $m php${SLOT}"
5399 - elog
5400 - fi
5401 - fi
5402 - done
5403 -
5404 - # Remove dead symlinks for SAPIs that were just disabled. For
5405 - # example, if the user has the cgi SAPI enabled, then he has an
5406 - # eselect-php symlink for it. If he later reinstalls PHP with
5407 - # USE="-cgi", that symlink will break. This call to eselect is
5408 - # supposed to remove that dead link per bug 572436.
5409 - eselect php cleanup || die
5410 -
5411 - if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then
5412 - elog "To build extensions for this version of PHP, you will need to"
5413 - elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable."
5414 - elog
5415 - fi
5416 -
5417 - # Warn about the removal of PHP_INI_VERSION if the user has it set.
5418 - if [[ -n "${PHP_INI_VERSION}" ]]; then
5419 - ewarn 'The PHP_INI_VERSION variable has been phased out. You may'
5420 - ewarn 'remove it from your configuration at your convenience. See'
5421 - ewarn
5422 - ewarn ' https://bugs.gentoo.org/611214'
5423 - ewarn
5424 - ewarn 'for more information.'
5425 - fi
5426 -
5427 - elog "For details on how version slotting works, please see"
5428 - elog "the wiki:"
5429 - elog
5430 - elog " https://wiki.gentoo.org/wiki/PHP"
5431 - elog
5432 -}
5433 -
5434 -pkg_postrm() {
5435 - # This serves two purposes. First, if we have just removed the last
5436 - # installed version of PHP, then this will remove any dead symlinks
5437 - # belonging to eselect-php. Second, if a user upgrades slots from
5438 - # (say) 5.6 to 7.0 and depcleans the old slot, then this will update
5439 - # his existing symlinks to point to the new 7.0 installation. The
5440 - # latter is bug 432962.
5441 - #
5442 - # Note: the eselect-php package may not be installed at this point,
5443 - # so we can't die() if this command fails.
5444 - eselect php cleanup
5445 -}
5446
5447 diff --git a/dev-lang/php/php-7.2.19.ebuild b/dev-lang/php/php-7.2.19.ebuild
5448 deleted file mode 100644
5449 index f12011458a0..00000000000
5450 --- a/dev-lang/php/php-7.2.19.ebuild
5451 +++ /dev/null
5452 @@ -1,749 +0,0 @@
5453 -# Copyright 1999-2019 Gentoo Authors
5454 -# Distributed under the terms of the GNU General Public License v2
5455 -
5456 -EAPI="7"
5457 -
5458 -inherit flag-o-matic systemd autotools
5459 -
5460 -DESCRIPTION="The PHP language runtime engine"
5461 -HOMEPAGE="https://php.net/"
5462 -SRC_URI="https://php.net/distributions/${P}.tar.xz"
5463 -
5464 -LICENSE="PHP-3.01
5465 - BSD
5466 - Zend-2.0
5467 - bcmath? ( LGPL-2.1+ )
5468 - fpm? ( BSD-2 )
5469 - gd? ( gd )
5470 - unicode? ( BSD-2 LGPL-2.1 )"
5471 -
5472 -SLOT="$(ver_cut 1-2)"
5473 -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"
5474 -
5475 -# We can build the following SAPIs in the given order
5476 -SAPIS="embed cli cgi fpm apache2 phpdbg"
5477 -
5478 -# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
5479 -IUSE="${IUSE}
5480 - ${SAPIS/cli/+cli}
5481 - threads"
5482 -
5483 -IUSE="${IUSE} acl argon2 bcmath berkdb bzip2 calendar cdb cjk
5484 - coverage +ctype curl debug
5485 - enchant exif +fileinfo +filter firebird
5486 - flatfile ftp gd gdbm gmp +hash +iconv imap inifile
5487 - intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl lmdb
5488 - mhash mssql mysql mysqli nls
5489 - oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
5490 - readline recode selinux +session session-mm sharedmem
5491 - +simplexml snmp soap sockets sodium spell sqlite ssl
5492 - sysvipc systemd test tidy +tokenizer tokyocabinet truetype unicode wddx webp
5493 - +xml xmlreader xmlwriter xmlrpc xpm xslt zip zip-encryption zlib"
5494 -
5495 -# The supported (that is, autodetected) versions of BDB are listed in
5496 -# the ./configure script. Other versions *work*, but we need to stick to
5497 -# the ones that can be detected to avoid a repeat of bug #564824.
5498 -COMMON_DEPEND="
5499 - >=app-eselect/eselect-php-0.9.1[apache2?,fpm?]
5500 - >=dev-libs/libpcre-8.32[unicode]
5501 - fpm? ( acl? ( sys-apps/acl ) )
5502 - apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=]
5503 - <www-servers/apache-2.4[threads=] ) )
5504 - argon2? ( app-crypt/argon2:= )
5505 - berkdb? ( || ( sys-libs/db:5.3
5506 - sys-libs/db:5.1
5507 - sys-libs/db:4.8
5508 - sys-libs/db:4.7
5509 - sys-libs/db:4.6
5510 - sys-libs/db:4.5 ) )
5511 - bzip2? ( app-arch/bzip2:0= )
5512 - cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
5513 - coverage? ( dev-util/lcov )
5514 - curl? ( >=net-misc/curl-7.10.5 )
5515 - enchant? ( <app-text/enchant-2.0:0 )
5516 - firebird? ( dev-db/firebird )
5517 - gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib )
5518 - gdbm? ( >=sys-libs/gdbm-1.8.0:0= )
5519 - gmp? ( dev-libs/gmp:0= )
5520 - iconv? ( virtual/libiconv )
5521 - imap? ( virtual/imap-c-client[kerberos=,ssl=] )
5522 - intl? ( dev-libs/icu:= )
5523 - iodbc? ( dev-db/libiodbc )
5524 - kerberos? ( virtual/krb5 )
5525 - ldap? ( >=net-nds/openldap-1.2.11 )
5526 - ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 )
5527 - libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) )
5528 - lmdb? ( dev-db/lmdb:= )
5529 - mssql? ( dev-db/freetds[mssql] )
5530 - nls? ( sys-devel/gettext )
5531 - oci8-instant-client? ( dev-db/oracle-instantclient-basic )
5532 - odbc? ( >=dev-db/unixODBC-1.8.13 )
5533 - postgres? ( dev-db/postgresql:* )
5534 - qdbm? ( dev-db/qdbm )
5535 - readline? ( sys-libs/readline:0= )
5536 - recode? ( app-text/recode )
5537 - session-mm? ( dev-libs/mm )
5538 - simplexml? ( >=dev-libs/libxml2-2.6.8 )
5539 - snmp? ( >=net-analyzer/net-snmp-5.2 )
5540 - soap? ( >=dev-libs/libxml2-2.6.8 )
5541 - sodium? ( dev-libs/libsodium:= )
5542 - spell? ( >=app-text/aspell-0.50 )
5543 - sqlite? ( >=dev-db/sqlite-3.7.6.3 )
5544 - ssl? (
5545 - !libressl? ( dev-libs/openssl:0= )
5546 - libressl? ( dev-libs/libressl:0= )
5547 - )
5548 - tidy? ( || ( app-text/tidy-html5 app-text/htmltidy ) )
5549 - tokyocabinet? ( dev-db/tokyocabinet )
5550 - truetype? ( =media-libs/freetype-2* )
5551 - unicode? ( dev-libs/oniguruma:= )
5552 - wddx? ( >=dev-libs/libxml2-2.6.8 )
5553 - webp? ( media-libs/libwebp:0= )
5554 - xml? ( >=dev-libs/libxml2-2.6.8 )
5555 - xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
5556 - xmlreader? ( >=dev-libs/libxml2-2.6.8 )
5557 - xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
5558 - xpm? ( x11-libs/libXpm )
5559 - xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
5560 - zip? ( sys-libs/zlib:0= )
5561 - zip-encryption? ( >=dev-libs/libzip-1.2.0:= )
5562 - zlib? ( sys-libs/zlib:0= )
5563 -"
5564 -
5565 -RDEPEND="${COMMON_DEPEND}
5566 - virtual/mta
5567 - fpm? (
5568 - selinux? ( sec-policy/selinux-phpfpm )
5569 - systemd? ( sys-apps/systemd ) )"
5570 -
5571 -# Bison isn't actually needed when building from a release tarball
5572 -# However, the configure script will warn if it's absent or if you
5573 -# have an incompatible version installed. See bug 593278.
5574 -DEPEND="${COMMON_DEPEND}
5575 - app-arch/xz-utils
5576 - >=sys-devel/bison-3.0.1"
5577 -
5578 -BDEPEND="virtual/pkgconfig"
5579 -
5580 -# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
5581 -REQUIRED_USE="
5582 - || ( cli cgi fpm apache2 embed phpdbg )
5583 - cli? ( ^^ ( readline libedit ) )
5584 - truetype? ( gd zlib )
5585 - webp? ( gd zlib )
5586 - cjk? ( gd zlib )
5587 - exif? ( gd zlib )
5588 - xpm? ( gd zlib )
5589 - gd? ( zlib )
5590 - simplexml? ( xml )
5591 - soap? ( xml )
5592 - wddx? ( xml )
5593 - xmlrpc? ( || ( xml iconv ) )
5594 - xmlreader? ( xml )
5595 - xslt? ( xml )
5596 - ldap-sasl? ( ldap )
5597 - mhash? ( hash )
5598 - phar? ( hash )
5599 - qdbm? ( !gdbm )
5600 - readline? ( !libedit )
5601 - recode? ( !imap !mysqli !mysql )
5602 - session-mm? ( session !threads )
5603 - mysql? ( hash || ( mysqli pdo ) )
5604 - mysqli? ( hash )
5605 - zip-encryption? ( zip )
5606 -"
5607 -PATCHES=(
5608 - "${FILESDIR}/php-freetype-2.9.1.patch"
5609 - "${FILESDIR}/php-7.2.13-intl-use-icu-namespace.patch"
5610 -)
5611 -
5612 -PHP_MV="$(ver_cut 1)"
5613 -
5614 -php_install_ini() {
5615 - local phpsapi="${1}"
5616 -
5617 - # work out where we are installing the ini file
5618 - php_set_ini_dir "${phpsapi}"
5619 -
5620 - # Always install the production INI file, bug 611214.
5621 - local phpinisrc="php.ini-production-${phpsapi}"
5622 - cp php.ini-production "${phpinisrc}" || die
5623 -
5624 - # default to /tmp for save_path, bug #282768
5625 - sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die
5626 -
5627 - # Set the extension dir
5628 - sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \
5629 - -i "${phpinisrc}" || die
5630 -
5631 - # Set the include path to point to where we want to find PEAR packages
5632 - sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die
5633 -
5634 - dodir "${PHP_INI_DIR#${EPREFIX}}"
5635 - insinto "${PHP_INI_DIR#${EPREFIX}}"
5636 - newins "${phpinisrc}" php.ini
5637 -
5638 - elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}"
5639 - elog
5640 -
5641 - dodir "${PHP_EXT_INI_DIR#${EPREFIX}}"
5642 - dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}"
5643 -
5644 - if use opcache; then
5645 - elog "Adding opcache to $PHP_EXT_INI_DIR"
5646 - echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \
5647 - "${D}/${PHP_EXT_INI_DIR}"/opcache.ini
5648 - dosym "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" \
5649 - "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini"
5650 - fi
5651 -
5652 - # SAPI-specific handling
5653 - if [[ "${sapi}" == "fpm" ]] ; then
5654 - einfo "Installing FPM config files php-fpm.conf and www.conf"
5655 - insinto "${PHP_INI_DIR#${EPREFIX}}"
5656 - doins sapi/fpm/php-fpm.conf
5657 - insinto "${PHP_INI_DIR#${EPREFIX}}/fpm.d"
5658 - doins sapi/fpm/www.conf
5659 - fi
5660 -
5661 - dodoc php.ini-{development,production}
5662 -}
5663 -
5664 -php_set_ini_dir() {
5665 - PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}"
5666 - PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
5667 - PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
5668 -}
5669 -
5670 -src_prepare() {
5671 - default
5672 -
5673 - # In php-7.x, the FPM pool configuration files have been split off
5674 - # of the main config. By default the pool config files go in
5675 - # e.g. /etc/php-fpm.d, which isn't slotted. So here we move the
5676 - # include directory to a subdirectory "fpm.d" of $PHP_INI_DIR. Later
5677 - # we'll install the pool configuration file "www.conf" there.
5678 - php_set_ini_dir fpm
5679 - sed -i "s~^include=.*$~include=${PHP_INI_DIR}/fpm.d/*.conf~" \
5680 - sapi/fpm/php-fpm.conf.in \
5681 - || die 'failed to move the include directory in php-fpm.conf'
5682 -
5683 - # Bug 669566 - necessary so that build tools are updated for commands like pecl
5684 - # Force rebuilding aclocal.m4
5685 - rm -f aclocal.m4 || die "failed to remove aclocal.m4 in src_prepare"
5686 - eautoreconf
5687 -}
5688 -
5689 -src_configure() {
5690 - addpredict /usr/share/snmp/mibs/.index #nowarn
5691 - addpredict /var/lib/net-snmp/mib_indexes #nowarn
5692 -
5693 - PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
5694 -
5695 - # The php-fpm config file wants localstatedir to be ${EPREFIX}/var
5696 - # and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002.
5697 - local our_conf=(
5698 - --prefix="${PHP_DESTDIR}"
5699 - --mandir="${PHP_DESTDIR}/man"
5700 - --infodir="${PHP_DESTDIR}/info"
5701 - --libdir="${PHP_DESTDIR}/lib"
5702 - --with-libdir="$(get_libdir)"
5703 - --localstatedir="${EPREFIX}/var"
5704 - --without-pear
5705 - $(use_enable threads maintainer-zts)
5706 - )
5707 -
5708 - our_conf+=(
5709 - $(use_with argon2 password-argon2 "${EPREFIX}/usr")
5710 - $(use_enable bcmath bcmath)
5711 - $(use_with bzip2 bz2 "${EPREFIX}/usr")
5712 - $(use_enable calendar calendar)
5713 - $(use_enable coverage gcov)
5714 - $(use_enable ctype ctype)
5715 - $(use_with curl curl "${EPREFIX}/usr")
5716 - $(use_enable xml dom)
5717 - $(use_with enchant enchant "${EPREFIX}/usr")
5718 - $(use_enable exif exif)
5719 - $(use_enable fileinfo fileinfo)
5720 - $(use_enable filter filter)
5721 - $(use_enable ftp ftp)
5722 - $(use_with nls gettext "${EPREFIX}/usr")
5723 - $(use_with gmp gmp "${EPREFIX}/usr")
5724 - $(use_enable hash hash)
5725 - $(use_with mhash mhash "${EPREFIX}/usr")
5726 - $(use_with iconv iconv \
5727 - $(use elibc_glibc || use elibc_musl || use elibc_FreeBSD || echo "${EPREFIX}/usr"))
5728 - $(use_enable intl intl)
5729 - $(use_enable ipv6 ipv6)
5730 - $(use_enable json json)
5731 - $(use_with kerberos kerberos "${EPREFIX}/usr")
5732 - $(use_enable xml libxml)
5733 - $(use_with xml libxml-dir "${EPREFIX}/usr")
5734 - $(use_enable unicode mbstring)
5735 - $(use_with unicode onig "${EPREFIX}/usr")
5736 - $(use_with ssl openssl "${EPREFIX}/usr")
5737 - $(use_with ssl openssl-dir "${EPREFIX}/usr")
5738 - $(use_enable pcntl pcntl)
5739 - $(use_enable phar phar)
5740 - $(use_enable pdo pdo)
5741 - $(use_enable opcache opcache)
5742 - $(use_with postgres pgsql "${EPREFIX}/usr")
5743 - $(use_enable posix posix)
5744 - $(use_with spell pspell "${EPREFIX}/usr")
5745 - $(use_with recode recode "${EPREFIX}/usr")
5746 - $(use_enable simplexml simplexml)
5747 - $(use_enable sharedmem shmop)
5748 - $(use_with snmp snmp "${EPREFIX}/usr")
5749 - $(use_enable soap soap)
5750 - $(use_enable sockets sockets)
5751 - $(use_with sodium sodium "${EPREFIX}/usr")
5752 - $(use_with sqlite sqlite3 "${EPREFIX}/usr")
5753 - $(use_enable sysvipc sysvmsg)
5754 - $(use_enable sysvipc sysvsem)
5755 - $(use_enable sysvipc sysvshm)
5756 - $(use_with tidy tidy "${EPREFIX}/usr")
5757 - $(use_enable tokenizer tokenizer)
5758 - $(use_enable wddx wddx)
5759 - $(use_enable xml xml)
5760 - $(use_enable xmlreader xmlreader)
5761 - $(use_enable xmlwriter xmlwriter)
5762 - $(use_with xmlrpc xmlrpc)
5763 - $(use_with xslt xsl "${EPREFIX}/usr")
5764 - $(use_enable zip zip)
5765 - $(use_with zip-encryption libzip "${EPREFIX}/usr")
5766 - $(use_with zlib zlib "${EPREFIX}/usr")
5767 - $(use_enable debug debug)
5768 - )
5769 -
5770 - # DBA support
5771 - if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
5772 - || use qdbm || use lmdb || use tokyocabinet ; then
5773 - our_conf+=( "--enable-dba${shared}" )
5774 - fi
5775 -
5776 - # DBA drivers support
5777 - our_conf+=(
5778 - $(use_with cdb cdb)
5779 - $(use_with berkdb db4 "${EPREFIX}/usr")
5780 - $(use_enable flatfile flatfile)
5781 - $(use_with gdbm gdbm "${EPREFIX}/usr")
5782 - $(use_enable inifile inifile)
5783 - $(use_with qdbm qdbm "${EPREFIX}/usr")
5784 - $(use_with lmdb lmdb "${EPREFIX}/usr")
5785 - )
5786 -
5787 - # Support for the GD graphics library
5788 - our_conf+=(
5789 - $(use_with truetype freetype-dir "${EPREFIX}/usr")
5790 - $(use_enable cjk gd-jis-conv)
5791 - $(use_with gd jpeg-dir "${EPREFIX}/usr")
5792 - $(use_with gd png-dir "${EPREFIX}/usr")
5793 - $(use_with xpm xpm-dir "${EPREFIX}/usr")
5794 - )
5795 - if use webp; then
5796 - our_conf+=( --with-webp-dir="${EPREFIX}/usr" )
5797 - fi
5798 - # enable gd last, so configure can pick up the previous settings
5799 - our_conf+=( $(use_with gd gd) )
5800 -
5801 - # IMAP support
5802 - if use imap ; then
5803 - our_conf+=(
5804 - $(use_with imap imap "${EPREFIX}/usr")
5805 - $(use_with ssl imap-ssl "${EPREFIX}/usr")
5806 - )
5807 - fi
5808 -
5809 - # Interbase/firebird support
5810 - our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") )
5811 -
5812 - # LDAP support
5813 - if use ldap ; then
5814 - our_conf+=(
5815 - $(use_with ldap ldap "${EPREFIX}/usr")
5816 - $(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr")
5817 - )
5818 - fi
5819 -
5820 - # MySQL support
5821 - local mysqllib="mysqlnd"
5822 - local mysqlilib="mysqlnd"
5823 -
5824 - our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
5825 -
5826 - local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock"
5827 - if use mysql || use mysqli ; then
5828 - our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") )
5829 - fi
5830 -
5831 - # ODBC support
5832 - our_conf+=(
5833 - $(use_with odbc unixODBC "${EPREFIX}/usr")
5834 - $(use_with iodbc iodbc "${EPREFIX}/usr")
5835 - )
5836 -
5837 - # Oracle support
5838 - our_conf+=( $(use_with oci8-instant-client oci8) )
5839 -
5840 - # PDO support
5841 - if use pdo ; then
5842 - our_conf+=(
5843 - $(use_with mssql pdo-dblib "${EPREFIX}/usr")
5844 - $(use_with mysql pdo-mysql "${mysqllib}")
5845 - $(use_with postgres pdo-pgsql)
5846 - $(use_with sqlite pdo-sqlite "${EPREFIX}/usr")
5847 - $(use_with firebird pdo-firebird "${EPREFIX}/usr")
5848 - $(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr")
5849 - $(use_with oci8-instant-client pdo-oci)
5850 - )
5851 - fi
5852 -
5853 - # readline/libedit support
5854 - our_conf+=(
5855 - $(use_with readline readline "${EPREFIX}/usr")
5856 - $(use_with libedit libedit "${EPREFIX}/usr")
5857 - )
5858 -
5859 - # Session support
5860 - if use session ; then
5861 - our_conf+=( $(use_with session-mm mm "${EPREFIX}/usr") )
5862 - else
5863 - our_conf+=( $(use_enable session session) )
5864 - fi
5865 -
5866 - # Use pic for shared modules such as apache2's mod_php
5867 - our_conf+=( --with-pic )
5868 -
5869 - # we use the system copy of pcre
5870 - # --with-pcre-regex affects ext/pcre
5871 - # --with-pcre-dir affects ext/filter and ext/zip
5872 - # --with-pcre-valgrind cannot be enabled with system pcre
5873 - # Many arches don't support pcre-jit
5874 - our_conf+=(
5875 - --with-pcre-regex="${EPREFIX}/usr"
5876 - --with-pcre-dir="${EPREFIX}/usr"
5877 - --without-pcre-valgrind
5878 - --without-pcre-jit
5879 - )
5880 -
5881 - # Catch CFLAGS problems
5882 - # Fixes bug #14067.
5883 - # Changed order to run it in reverse for bug #32022 and #12021.
5884 - replace-cpu-flags "k6*" "i586"
5885 -
5886 - # Cache the ./configure test results between SAPIs.
5887 - our_conf+=( --cache-file="${T}/config.cache" )
5888 -
5889 - # Support user-passed configuration parameters
5890 - our_conf+=( ${EXTRA_ECONF:-} )
5891 -
5892 - # Support the Apache2 extras, they must be set globally for all
5893 - # SAPIs to work correctly, especially for external PHP extensions
5894 -
5895 - mkdir -p "${WORKDIR}/sapis-build" || die
5896 - for one_sapi in $SAPIS ; do
5897 - use "${one_sapi}" || continue
5898 - php_set_ini_dir "${one_sapi}"
5899 -
5900 - # The BUILD_DIR variable is used to determine where to output
5901 - # the files that autotools creates. This was all originally
5902 - # based on the autotools-utils eclass.
5903 - BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}"
5904 - cp -a "${S}" "${BUILD_DIR}" || die
5905 - cd "${BUILD_DIR}" || die
5906 -
5907 - local sapi_conf=(
5908 - --with-config-file-path="${PHP_INI_DIR}"
5909 - --with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}"
5910 - )
5911 -
5912 - for sapi in $SAPIS ; do
5913 - case "$sapi" in
5914 - cli|cgi|embed|fpm|phpdbg)
5915 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
5916 - sapi_conf+=( "--enable-${sapi}" )
5917 - if [[ "fpm" == "${sapi}" ]] ; then
5918 - sapi_conf+=(
5919 - $(use_with acl fpm-acl)
5920 - $(use_with systemd fpm-systemd)
5921 - )
5922 - fi
5923 - else
5924 - sapi_conf+=( "--disable-${sapi}" )
5925 - fi
5926 - ;;
5927 -
5928 - apache2)
5929 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
5930 - sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" )
5931 - else
5932 - sapi_conf+=( --without-apxs2 )
5933 - fi
5934 - ;;
5935 - esac
5936 - done
5937 -
5938 - # Construct the $myeconfargs array by concatenating $our_conf
5939 - # (the common args) and $sapi_conf (the SAPI-specific args).
5940 - local myeconfargs=( "${our_conf[@]}" )
5941 - myeconfargs+=( "${sapi_conf[@]}" )
5942 -
5943 - pushd "${BUILD_DIR}" > /dev/null || die
5944 - econf "${myeconfargs[@]}"
5945 - popd > /dev/null || die
5946 - done
5947 -}
5948 -
5949 -src_compile() {
5950 - # snmp seems to run during src_compile, too (bug #324739)
5951 - addpredict /usr/share/snmp/mibs/.index #nowarn
5952 - addpredict /var/lib/net-snmp/mib_indexes #nowarn
5953 -
5954 - for sapi in ${SAPIS} ; do
5955 - if use "${sapi}"; then
5956 - cd "${WORKDIR}/sapis-build/$sapi" || \
5957 - die "Failed to change dir to ${WORKDIR}/sapis-build/$1"
5958 - emake
5959 - fi
5960 - done
5961 -}
5962 -
5963 -src_install() {
5964 - # see bug #324739 for what happens when we don't have that
5965 - addpredict /usr/share/snmp/mibs/.index #nowarn
5966 -
5967 - # grab the first SAPI that got built and install common files from there
5968 - local first_sapi=""
5969 - for sapi in $SAPIS ; do
5970 - if use $sapi ; then
5971 - first_sapi=$sapi
5972 - break
5973 - fi
5974 - done
5975 -
5976 - # Makefile forgets to create this before trying to write to it...
5977 - dodir "${PHP_DESTDIR#${EPREFIX}}/bin"
5978 -
5979 - # Install php environment (without any sapis)
5980 - cd "${WORKDIR}/sapis-build/$first_sapi" || die
5981 - emake INSTALL_ROOT="${D}" \
5982 - install-build install-headers install-programs
5983 -
5984 - local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)"
5985 -
5986 - # Create the directory where we'll put version-specific php scripts
5987 - keepdir "/usr/share/php${PHP_MV}"
5988 -
5989 - local sapi="", file=""
5990 - local sapi_list=""
5991 -
5992 - for sapi in ${SAPIS}; do
5993 - if use "${sapi}" ; then
5994 - einfo "Installing SAPI: ${sapi}"
5995 - cd "${WORKDIR}/sapis-build/${sapi}" || die
5996 -
5997 - if [[ "${sapi}" == "apache2" ]] ; then
5998 - # We're specifically not using emake install-sapi as libtool
5999 - # may cause unnecessary relink failures (see bug #351266)
6000 - insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/"
6001 - newins ".libs/libphp${PHP_MV}$(get_libname)" \
6002 - "libphp${PHP_MV}$(get_libname)"
6003 - keepdir "/usr/$(get_libdir)/apache2/modules"
6004 - else
6005 - # needed each time, php_install_ini would reset it
6006 - local dest="${PHP_DESTDIR#${EPREFIX}}"
6007 - into "${dest}"
6008 - case "$sapi" in
6009 - cli)
6010 - source="sapi/cli/php"
6011 - ;;
6012 - cgi)
6013 - source="sapi/cgi/php-cgi"
6014 - ;;
6015 - fpm)
6016 - source="sapi/fpm/php-fpm"
6017 - ;;
6018 - embed)
6019 - source="libs/libphp${PHP_MV}$(get_libname)"
6020 - ;;
6021 - phpdbg)
6022 - source="sapi/phpdbg/phpdbg"
6023 - ;;
6024 - *)
6025 - die "unhandled sapi in src_install"
6026 - ;;
6027 - esac
6028 -
6029 - if [[ "${source}" == *"$(get_libname)" ]]; then
6030 - dolib.so "${source}"
6031 - else
6032 - dobin "${source}"
6033 - local name="$(basename ${source})"
6034 - dosym "${dest}/bin/${name}" "/usr/bin/${name}${SLOT}"
6035 - fi
6036 - fi
6037 -
6038 - php_install_ini "${sapi}"
6039 -
6040 - # construct correct SAPI string for php-config
6041 - # thanks to ferringb for the bash voodoo
6042 - if [[ "${sapi}" == "apache2" ]]; then
6043 - sapi_list="${sapi_list:+${sapi_list} }apache2handler"
6044 - else
6045 - sapi_list="${sapi_list:+${sapi_list} }${sapi}"
6046 - fi
6047 - fi
6048 - done
6049 -
6050 - # Installing opcache module
6051 - if use opcache ; then
6052 - into "${PHP_DESTDIR#${EPREFIX}}"
6053 - dolib.so "modules/opcache$(get_libname)"
6054 - fi
6055 -
6056 - # Install env.d files
6057 - newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}"
6058 - sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
6059 - sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
6060 -
6061 - # set php-config variable correctly (bug #278439)
6062 - sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \
6063 - "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die
6064 -
6065 - if use fpm ; then
6066 - if use systemd; then
6067 - systemd_newunit "${FILESDIR}/php-fpm_at.service" \
6068 - "php-fpm@${SLOT}.service"
6069 - else
6070 - systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \
6071 - "php-fpm@${SLOT}.service"
6072 - fi
6073 - fi
6074 -}
6075 -
6076 -src_test() {
6077 - echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
6078 - PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
6079 - if [[ ! -x "${PHP_BIN}" ]] ; then
6080 - ewarn "Test phase requires USE=cli, skipping"
6081 - return
6082 - else
6083 - export TEST_PHP_EXECUTABLE="${PHP_BIN}"
6084 - fi
6085 -
6086 - if [[ -x "${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" ]] ; then
6087 - export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi"
6088 - fi
6089 -
6090 - if [[ -x "${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" ]] ; then
6091 - export TEST_PHPDBG_EXECUTABLE="${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg"
6092 - fi
6093 -
6094 - REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \
6095 - "session.save_path=${T}" \
6096 - "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \
6097 - "session.save_path=${T}"
6098 -
6099 - for name in ${EXPECTED_TEST_FAILURES}; do
6100 - mv "${name}.out" "${name}.out.orig" 2>/dev/null || die
6101 - done
6102 -
6103 - local failed="$(find -name '*.out')"
6104 - if [[ ${failed} != "" ]] ; then
6105 - ewarn "The following test cases failed unexpectedly:"
6106 - for name in ${failed}; do
6107 - ewarn " ${name/.out/}"
6108 - done
6109 - else
6110 - einfo "No unexpected test failures, all fine"
6111 - fi
6112 -
6113 - if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
6114 - local passed=""
6115 - for name in ${EXPECTED_TEST_FAILURES}; do
6116 - [[ -f "${name}.diff" ]] && continue
6117 - passed="${passed} ${name}"
6118 - done
6119 - if [[ ${passed} != "" ]] ; then
6120 - einfo "The following test cases passed unexpectedly:"
6121 - for name in ${passed}; do
6122 - ewarn " ${passed}"
6123 - done
6124 - else
6125 - einfo "None of the known-to-fail tests passed, all fine"
6126 - fi
6127 - fi
6128 -}
6129 -
6130 -pkg_postinst() {
6131 - # Output some general info to the user
6132 - if use apache2 ; then
6133 - elog
6134 - elog "To enable PHP in apache, you will need to add \"-D PHP\" to"
6135 - elog "your apache2 command. OpenRC users can append that string to"
6136 - elog "APACHE2_OPTS in /etc/conf.d/apache2."
6137 - elog
6138 - elog "The apache module configuration file 70_mod_php.conf is"
6139 - elog "provided (and maintained) by eselect-php."
6140 - elog
6141 - fi
6142 -
6143 - # Create the symlinks for php
6144 - for m in ${SAPIS}; do
6145 - [[ ${m} == 'embed' ]] && continue;
6146 - if use $m ; then
6147 - local ci=$(eselect php show $m)
6148 - if [[ -z $ci ]]; then
6149 - eselect php set $m php${SLOT} || die
6150 - einfo "Switched ${m} to use php:${SLOT}"
6151 - einfo
6152 - elif [[ $ci != "php${SLOT}" ]] ; then
6153 - elog "To switch $m to use php:${SLOT}, run"
6154 - elog " eselect php set $m php${SLOT}"
6155 - elog
6156 - fi
6157 - fi
6158 - done
6159 -
6160 - # Remove dead symlinks for SAPIs that were just disabled. For
6161 - # example, if the user has the cgi SAPI enabled, then he has an
6162 - # eselect-php symlink for it. If he later reinstalls PHP with
6163 - # USE="-cgi", that symlink will break. This call to eselect is
6164 - # supposed to remove that dead link per bug 572436.
6165 - eselect php cleanup || die
6166 -
6167 - if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then
6168 - elog "To build extensions for this version of PHP, you will need to"
6169 - elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable."
6170 - elog
6171 - fi
6172 -
6173 - # Warn about the removal of PHP_INI_VERSION if the user has it set.
6174 - if [[ -n "${PHP_INI_VERSION}" ]]; then
6175 - ewarn 'The PHP_INI_VERSION variable has been phased out. You may'
6176 - ewarn 'remove it from your configuration at your convenience. See'
6177 - ewarn
6178 - ewarn ' https://bugs.gentoo.org/611214'
6179 - ewarn
6180 - ewarn 'for more information.'
6181 - fi
6182 -
6183 - elog "For details on how version slotting works, please see"
6184 - elog "the wiki:"
6185 - elog
6186 - elog " https://wiki.gentoo.org/wiki/PHP"
6187 - elog
6188 -}
6189 -
6190 -pkg_postrm() {
6191 - # This serves two purposes. First, if we have just removed the last
6192 - # installed version of PHP, then this will remove any dead symlinks
6193 - # belonging to eselect-php. Second, if a user upgrades slots from
6194 - # (say) 5.6 to 7.0 and depcleans the old slot, then this will update
6195 - # his existing symlinks to point to the new 7.0 installation. The
6196 - # latter is bug 432962.
6197 - #
6198 - # Note: the eselect-php package may not be installed at this point,
6199 - # so we can't die() if this command fails.
6200 - eselect php cleanup
6201 -}
6202
6203 diff --git a/dev-lang/php/php-7.3.5.ebuild b/dev-lang/php/php-7.3.5.ebuild
6204 deleted file mode 100644
6205 index e8bbeb8dbb0..00000000000
6206 --- a/dev-lang/php/php-7.3.5.ebuild
6207 +++ /dev/null
6208 @@ -1,750 +0,0 @@
6209 -# Copyright 1999-2019 Gentoo Authors
6210 -# Distributed under the terms of the GNU General Public License v2
6211 -
6212 -EAPI="7"
6213 -
6214 -inherit flag-o-matic systemd autotools
6215 -
6216 -MY_PV=${PV/_rc/RC}
6217 -DESCRIPTION="The PHP language runtime engine"
6218 -HOMEPAGE="https://php.net/"
6219 -SRC_URI="https://php.net/distributions/${P}.tar.xz"
6220 -
6221 -LICENSE="PHP-3.01
6222 - BSD
6223 - Zend-2.0
6224 - bcmath? ( LGPL-2.1+ )
6225 - fpm? ( BSD-2 )
6226 - gd? ( gd )
6227 - unicode? ( BSD-2 LGPL-2.1 )"
6228 -
6229 -SLOT="$(ver_cut 1-2)"
6230 -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"
6231 -
6232 -S="${WORKDIR}/${PN}-${MY_PV}"
6233 -
6234 -# We can build the following SAPIs in the given order
6235 -SAPIS="embed cli cgi fpm apache2 phpdbg"
6236 -
6237 -# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
6238 -IUSE="${IUSE}
6239 - ${SAPIS/cli/+cli}
6240 - threads"
6241 -
6242 -IUSE="${IUSE} acl argon2 bcmath berkdb bzip2 calendar cdb cjk
6243 - coverage +ctype curl debug
6244 - enchant exif +fileinfo +filter firebird
6245 - flatfile ftp gd gdbm gmp +hash +iconv imap inifile
6246 - intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl lmdb
6247 - mhash mssql mysql mysqli nls
6248 - oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
6249 - readline recode selinux +session session-mm sharedmem
6250 - +simplexml snmp soap sockets sodium spell sqlite ssl
6251 - sysvipc systemd test tidy +tokenizer tokyocabinet truetype unicode wddx webp
6252 - +xml xmlreader xmlwriter xmlrpc xpm xslt zip zip-encryption zlib"
6253 -
6254 -# The supported (that is, autodetected) versions of BDB are listed in
6255 -# the ./configure script. Other versions *work*, but we need to stick to
6256 -# the ones that can be detected to avoid a repeat of bug #564824.
6257 -COMMON_DEPEND="
6258 - >=app-eselect/eselect-php-0.9.1[apache2?,fpm?]
6259 - >=dev-libs/libpcre2-10.30[unicode]
6260 - fpm? ( acl? ( sys-apps/acl ) )
6261 - apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=]
6262 - <www-servers/apache-2.4[threads=] ) )
6263 - argon2? ( app-crypt/argon2:= )
6264 - berkdb? ( || ( sys-libs/db:5.3
6265 - sys-libs/db:5.1
6266 - sys-libs/db:4.8
6267 - sys-libs/db:4.7
6268 - sys-libs/db:4.6
6269 - sys-libs/db:4.5 ) )
6270 - bzip2? ( app-arch/bzip2:0= )
6271 - cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
6272 - coverage? ( dev-util/lcov )
6273 - curl? ( >=net-misc/curl-7.10.5 )
6274 - enchant? ( <app-text/enchant-2.0:0 )
6275 - firebird? ( dev-db/firebird )
6276 - gd? ( virtual/jpeg:0 media-libs/libpng:0= >=sys-libs/zlib-1.2.0.4 )
6277 - gdbm? ( >=sys-libs/gdbm-1.8.0:0= )
6278 - gmp? ( dev-libs/gmp:0= )
6279 - iconv? ( virtual/libiconv )
6280 - imap? ( virtual/imap-c-client[kerberos=,ssl=] )
6281 - intl? ( dev-libs/icu:= )
6282 - iodbc? ( dev-db/libiodbc )
6283 - kerberos? ( virtual/krb5 )
6284 - ldap? ( >=net-nds/openldap-1.2.11 )
6285 - ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 )
6286 - libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) )
6287 - lmdb? ( dev-db/lmdb:= )
6288 - mssql? ( dev-db/freetds[mssql] )
6289 - nls? ( sys-devel/gettext )
6290 - oci8-instant-client? ( dev-db/oracle-instantclient-basic )
6291 - odbc? ( >=dev-db/unixODBC-1.8.13 )
6292 - postgres? ( dev-db/postgresql:* )
6293 - qdbm? ( dev-db/qdbm )
6294 - readline? ( sys-libs/readline:0= )
6295 - recode? ( app-text/recode )
6296 - session-mm? ( dev-libs/mm )
6297 - simplexml? ( >=dev-libs/libxml2-2.6.8 )
6298 - snmp? ( >=net-analyzer/net-snmp-5.2 )
6299 - soap? ( >=dev-libs/libxml2-2.6.8 )
6300 - sodium? ( dev-libs/libsodium:= )
6301 - spell? ( >=app-text/aspell-0.50 )
6302 - sqlite? ( >=dev-db/sqlite-3.7.6.3 )
6303 - ssl? (
6304 - !libressl? ( >=dev-libs/openssl-1.0.1:0= )
6305 - libressl? ( dev-libs/libressl:0= )
6306 - )
6307 - tidy? ( || ( app-text/tidy-html5 app-text/htmltidy ) )
6308 - tokyocabinet? ( dev-db/tokyocabinet )
6309 - truetype? ( =media-libs/freetype-2* )
6310 - unicode? ( dev-libs/oniguruma:= )
6311 - wddx? ( >=dev-libs/libxml2-2.6.8 )
6312 - webp? ( media-libs/libwebp:0= )
6313 - xml? ( >=dev-libs/libxml2-2.6.8 )
6314 - xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
6315 - xmlreader? ( >=dev-libs/libxml2-2.6.8 )
6316 - xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
6317 - xpm? ( x11-libs/libXpm )
6318 - xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
6319 - zip? ( >=sys-libs/zlib-1.2.0.4:0= )
6320 - zip-encryption? ( >=dev-libs/libzip-1.2.0:= )
6321 - zlib? ( >=sys-libs/zlib-1.2.0.4:0= )
6322 -"
6323 -
6324 -RDEPEND="${COMMON_DEPEND}
6325 - virtual/mta
6326 - fpm? (
6327 - selinux? ( sec-policy/selinux-phpfpm )
6328 - systemd? ( sys-apps/systemd ) )"
6329 -
6330 -# Bison isn't actually needed when building from a release tarball
6331 -# However, the configure script will warn if it's absent or if you
6332 -# have an incompatible version installed. See bug 593278.
6333 -DEPEND="${COMMON_DEPEND}
6334 - app-arch/xz-utils
6335 - >=sys-devel/bison-3.0.1"
6336 -
6337 -BDEPEND="virtual/pkgconfig"
6338 -
6339 -# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
6340 -REQUIRED_USE="
6341 - || ( cli cgi fpm apache2 embed phpdbg )
6342 - cli? ( ^^ ( readline libedit ) )
6343 - truetype? ( gd zlib )
6344 - webp? ( gd zlib )
6345 - cjk? ( gd zlib )
6346 - exif? ( gd zlib )
6347 - xpm? ( gd zlib )
6348 - gd? ( zlib )
6349 - simplexml? ( xml )
6350 - soap? ( xml )
6351 - wddx? ( xml )
6352 - xmlrpc? ( || ( xml iconv ) )
6353 - xmlreader? ( xml )
6354 - xslt? ( xml )
6355 - ldap-sasl? ( ldap )
6356 - mhash? ( hash )
6357 - phar? ( hash )
6358 - qdbm? ( !gdbm )
6359 - readline? ( !libedit )
6360 - recode? ( !imap !mysqli !mysql )
6361 - session-mm? ( session !threads )
6362 - mysql? ( || ( mysqli pdo ) )
6363 - zip-encryption? ( zip )
6364 -"
6365 -PATCHES=(
6366 - "${FILESDIR}/php-freetype-2.9.1.patch"
6367 -)
6368 -
6369 -PHP_MV="$(ver_cut 1)"
6370 -
6371 -php_install_ini() {
6372 - local phpsapi="${1}"
6373 -
6374 - # work out where we are installing the ini file
6375 - php_set_ini_dir "${phpsapi}"
6376 -
6377 - # Always install the production INI file, bug 611214.
6378 - local phpinisrc="php.ini-production-${phpsapi}"
6379 - cp php.ini-production "${phpinisrc}" || die
6380 -
6381 - # default to /tmp for save_path, bug #282768
6382 - sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die
6383 -
6384 - # Set the extension dir
6385 - sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \
6386 - -i "${phpinisrc}" || die
6387 -
6388 - # Set the include path to point to where we want to find PEAR packages
6389 - sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die
6390 -
6391 - dodir "${PHP_INI_DIR#${EPREFIX}}"
6392 - insinto "${PHP_INI_DIR#${EPREFIX}}"
6393 - newins "${phpinisrc}" php.ini
6394 -
6395 - elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}"
6396 - elog
6397 -
6398 - dodir "${PHP_EXT_INI_DIR#${EPREFIX}}"
6399 - dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}"
6400 -
6401 - if use opcache; then
6402 - elog "Adding opcache to $PHP_EXT_INI_DIR"
6403 - echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \
6404 - "${D}/${PHP_EXT_INI_DIR}"/opcache.ini
6405 - dosym "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" \
6406 - "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini"
6407 - fi
6408 -
6409 - # SAPI-specific handling
6410 - if [[ "${sapi}" == "fpm" ]] ; then
6411 - einfo "Installing FPM config files php-fpm.conf and www.conf"
6412 - insinto "${PHP_INI_DIR#${EPREFIX}}"
6413 - doins sapi/fpm/php-fpm.conf
6414 - insinto "${PHP_INI_DIR#${EPREFIX}}/fpm.d"
6415 - doins sapi/fpm/www.conf
6416 - fi
6417 -
6418 - dodoc php.ini-{development,production}
6419 -}
6420 -
6421 -php_set_ini_dir() {
6422 - PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}"
6423 - PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
6424 - PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
6425 -}
6426 -
6427 -src_prepare() {
6428 - default
6429 -
6430 - # In php-7.x, the FPM pool configuration files have been split off
6431 - # of the main config. By default the pool config files go in
6432 - # e.g. /etc/php-fpm.d, which isn't slotted. So here we move the
6433 - # include directory to a subdirectory "fpm.d" of $PHP_INI_DIR. Later
6434 - # we'll install the pool configuration file "www.conf" there.
6435 - php_set_ini_dir fpm
6436 - sed -i "s~^include=.*$~include=${PHP_INI_DIR}/fpm.d/*.conf~" \
6437 - sapi/fpm/php-fpm.conf.in \
6438 - || die 'failed to move the include directory in php-fpm.conf'
6439 -
6440 - # Bug 669566 - necessary so that build tools are updated for commands like pecl
6441 - # Force rebuilding aclocal.m4
6442 - rm -f aclocal.m4 || die "failed to remove aclocal.m4 in src_prepare"
6443 - eautoreconf
6444 -}
6445 -
6446 -src_configure() {
6447 - addpredict /usr/share/snmp/mibs/.index #nowarn
6448 - addpredict /var/lib/net-snmp/mib_indexes #nowarn
6449 -
6450 - PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
6451 -
6452 - # The php-fpm config file wants localstatedir to be ${EPREFIX}/var
6453 - # and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002.
6454 - local our_conf=(
6455 - --prefix="${PHP_DESTDIR}"
6456 - --mandir="${PHP_DESTDIR}/man"
6457 - --infodir="${PHP_DESTDIR}/info"
6458 - --libdir="${PHP_DESTDIR}/lib"
6459 - --with-libdir="$(get_libdir)"
6460 - --localstatedir="${EPREFIX}/var"
6461 - --without-pear
6462 - $(use_enable threads maintainer-zts)
6463 - )
6464 -
6465 - our_conf+=(
6466 - $(use_with argon2 password-argon2 "${EPREFIX}/usr")
6467 - $(use_enable bcmath bcmath)
6468 - $(use_with bzip2 bz2 "${EPREFIX}/usr")
6469 - $(use_enable calendar calendar)
6470 - $(use_enable coverage gcov)
6471 - $(use_enable ctype ctype)
6472 - $(use_with curl curl "${EPREFIX}/usr")
6473 - $(use_enable xml dom)
6474 - $(use_with enchant enchant "${EPREFIX}/usr")
6475 - $(use_enable exif exif)
6476 - $(use_enable fileinfo fileinfo)
6477 - $(use_enable filter filter)
6478 - $(use_enable ftp ftp)
6479 - $(use_with nls gettext "${EPREFIX}/usr")
6480 - $(use_with gmp gmp "${EPREFIX}/usr")
6481 - $(use_enable hash hash)
6482 - $(use_with mhash mhash "${EPREFIX}/usr")
6483 - $(use_with iconv iconv \
6484 - $(use elibc_glibc || use elibc_musl || use elibc_FreeBSD || echo "${EPREFIX}/usr"))
6485 - $(use_enable intl intl)
6486 - $(use_enable ipv6 ipv6)
6487 - $(use_enable json json)
6488 - $(use_with kerberos kerberos "${EPREFIX}/usr")
6489 - $(use_enable xml libxml)
6490 - $(use_with xml libxml-dir "${EPREFIX}/usr")
6491 - $(use_enable unicode mbstring)
6492 - $(use_with unicode onig "${EPREFIX}/usr")
6493 - $(use_with ssl openssl "${EPREFIX}/usr")
6494 - $(use_with ssl openssl-dir "${EPREFIX}/usr")
6495 - $(use_enable pcntl pcntl)
6496 - $(use_enable phar phar)
6497 - $(use_enable pdo pdo)
6498 - $(use_enable opcache opcache)
6499 - $(use_with postgres pgsql "${EPREFIX}/usr")
6500 - $(use_enable posix posix)
6501 - $(use_with spell pspell "${EPREFIX}/usr")
6502 - $(use_with recode recode "${EPREFIX}/usr")
6503 - $(use_enable simplexml simplexml)
6504 - $(use_enable sharedmem shmop)
6505 - $(use_with snmp snmp "${EPREFIX}/usr")
6506 - $(use_enable soap soap)
6507 - $(use_enable sockets sockets)
6508 - $(use_with sodium sodium "${EPREFIX}/usr")
6509 - $(use_with sqlite sqlite3 "${EPREFIX}/usr")
6510 - $(use_enable sysvipc sysvmsg)
6511 - $(use_enable sysvipc sysvsem)
6512 - $(use_enable sysvipc sysvshm)
6513 - $(use_with tidy tidy "${EPREFIX}/usr")
6514 - $(use_enable tokenizer tokenizer)
6515 - $(use_enable wddx wddx)
6516 - $(use_enable xml xml)
6517 - $(use_enable xmlreader xmlreader)
6518 - $(use_enable xmlwriter xmlwriter)
6519 - $(use_with xmlrpc xmlrpc)
6520 - $(use_with xslt xsl "${EPREFIX}/usr")
6521 - $(use_enable zip zip)
6522 - $(use_with zip-encryption libzip "${EPREFIX}/usr")
6523 - $(use_with zlib zlib "${EPREFIX}/usr")
6524 - $(use_enable debug debug)
6525 - )
6526 -
6527 - # DBA support
6528 - if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
6529 - || use qdbm || use lmdb || use tokyocabinet ; then
6530 - our_conf+=( "--enable-dba${shared}" )
6531 - fi
6532 -
6533 - # DBA drivers support
6534 - our_conf+=(
6535 - $(use_with cdb cdb)
6536 - $(use_with berkdb db4 "${EPREFIX}/usr")
6537 - $(use_enable flatfile flatfile)
6538 - $(use_with gdbm gdbm "${EPREFIX}/usr")
6539 - $(use_enable inifile inifile)
6540 - $(use_with qdbm qdbm "${EPREFIX}/usr")
6541 - $(use_with lmdb lmdb "${EPREFIX}/usr")
6542 - )
6543 -
6544 - # Support for the GD graphics library
6545 - our_conf+=(
6546 - $(use_with truetype freetype-dir "${EPREFIX}/usr")
6547 - $(use_enable cjk gd-jis-conv)
6548 - $(use_with gd jpeg-dir "${EPREFIX}/usr")
6549 - $(use_with gd png-dir "${EPREFIX}/usr")
6550 - $(use_with xpm xpm-dir "${EPREFIX}/usr")
6551 - )
6552 - if use webp; then
6553 - our_conf+=( --with-webp-dir="${EPREFIX}/usr" )
6554 - fi
6555 - # enable gd last, so configure can pick up the previous settings
6556 - our_conf+=( $(use_with gd gd) )
6557 -
6558 - # IMAP support
6559 - if use imap ; then
6560 - our_conf+=(
6561 - $(use_with imap imap "${EPREFIX}/usr")
6562 - $(use_with ssl imap-ssl "${EPREFIX}/usr")
6563 - )
6564 - fi
6565 -
6566 - # Interbase/firebird support
6567 - our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") )
6568 -
6569 - # LDAP support
6570 - if use ldap ; then
6571 - our_conf+=(
6572 - $(use_with ldap ldap "${EPREFIX}/usr")
6573 - $(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr")
6574 - )
6575 - fi
6576 -
6577 - # MySQL support
6578 - local mysqllib="mysqlnd"
6579 - local mysqlilib="mysqlnd"
6580 -
6581 - our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
6582 -
6583 - local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock"
6584 - if use mysql || use mysqli ; then
6585 - our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") )
6586 - fi
6587 -
6588 - # ODBC support
6589 - our_conf+=(
6590 - $(use_with odbc unixODBC "${EPREFIX}/usr")
6591 - $(use_with iodbc iodbc "${EPREFIX}/usr")
6592 - )
6593 -
6594 - # Oracle support
6595 - our_conf+=( $(use_with oci8-instant-client oci8) )
6596 -
6597 - # PDO support
6598 - if use pdo ; then
6599 - our_conf+=(
6600 - $(use_with mssql pdo-dblib "${EPREFIX}/usr")
6601 - $(use_with mysql pdo-mysql "${mysqllib}")
6602 - $(use_with postgres pdo-pgsql)
6603 - $(use_with sqlite pdo-sqlite "${EPREFIX}/usr")
6604 - $(use_with firebird pdo-firebird "${EPREFIX}/usr")
6605 - $(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr")
6606 - $(use_with oci8-instant-client pdo-oci)
6607 - )
6608 - fi
6609 -
6610 - # readline/libedit support
6611 - our_conf+=(
6612 - $(use_with readline readline "${EPREFIX}/usr")
6613 - $(use_with libedit libedit "${EPREFIX}/usr")
6614 - )
6615 -
6616 - # Session support
6617 - if use session ; then
6618 - our_conf+=( $(use_with session-mm mm "${EPREFIX}/usr") )
6619 - else
6620 - our_conf+=( $(use_enable session session) )
6621 - fi
6622 -
6623 - # Use pic for shared modules such as apache2's mod_php
6624 - our_conf+=( --with-pic )
6625 -
6626 - # we use the system copy of pcre
6627 - # --with-pcre-regex affects ext/pcre
6628 - # --with-pcre-dir affects ext/filter and ext/zip
6629 - # --with-pcre-valgrind cannot be enabled with system pcre
6630 - # Many arches don't support pcre-jit
6631 - our_conf+=(
6632 - --with-pcre-regex="${EPREFIX}/usr"
6633 - --with-pcre-dir="${EPREFIX}/usr"
6634 - --without-pcre-valgrind
6635 - --without-pcre-jit
6636 - )
6637 -
6638 - # Catch CFLAGS problems
6639 - # Fixes bug #14067.
6640 - # Changed order to run it in reverse for bug #32022 and #12021.
6641 - replace-cpu-flags "k6*" "i586"
6642 -
6643 - # Cache the ./configure test results between SAPIs.
6644 - our_conf+=( --cache-file="${T}/config.cache" )
6645 -
6646 - # Support user-passed configuration parameters
6647 - our_conf+=( ${EXTRA_ECONF:-} )
6648 -
6649 - # Support the Apache2 extras, they must be set globally for all
6650 - # SAPIs to work correctly, especially for external PHP extensions
6651 -
6652 - mkdir -p "${WORKDIR}/sapis-build" || die
6653 - for one_sapi in $SAPIS ; do
6654 - use "${one_sapi}" || continue
6655 - php_set_ini_dir "${one_sapi}"
6656 -
6657 - # The BUILD_DIR variable is used to determine where to output
6658 - # the files that autotools creates. This was all originally
6659 - # based on the autotools-utils eclass.
6660 - BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}"
6661 - cp -a "${S}" "${BUILD_DIR}" || die
6662 - cd "${BUILD_DIR}" || die
6663 -
6664 - local sapi_conf=(
6665 - --with-config-file-path="${PHP_INI_DIR}"
6666 - --with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}"
6667 - )
6668 -
6669 - for sapi in $SAPIS ; do
6670 - case "$sapi" in
6671 - cli|cgi|embed|fpm|phpdbg)
6672 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
6673 - sapi_conf+=( "--enable-${sapi}" )
6674 - if [[ "fpm" == "${sapi}" ]] ; then
6675 - sapi_conf+=(
6676 - $(use_with acl fpm-acl)
6677 - $(use_with systemd fpm-systemd)
6678 - )
6679 - fi
6680 - else
6681 - sapi_conf+=( "--disable-${sapi}" )
6682 - fi
6683 - ;;
6684 -
6685 - apache2)
6686 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
6687 - sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" )
6688 - else
6689 - sapi_conf+=( --without-apxs2 )
6690 - fi
6691 - ;;
6692 - esac
6693 - done
6694 -
6695 - # Construct the $myeconfargs array by concatenating $our_conf
6696 - # (the common args) and $sapi_conf (the SAPI-specific args).
6697 - local myeconfargs=( "${our_conf[@]}" )
6698 - myeconfargs+=( "${sapi_conf[@]}" )
6699 -
6700 - pushd "${BUILD_DIR}" > /dev/null || die
6701 - econf "${myeconfargs[@]}"
6702 - popd > /dev/null || die
6703 - done
6704 -}
6705 -
6706 -src_compile() {
6707 - # snmp seems to run during src_compile, too (bug #324739)
6708 - addpredict /usr/share/snmp/mibs/.index #nowarn
6709 - addpredict /var/lib/net-snmp/mib_indexes #nowarn
6710 -
6711 - for sapi in ${SAPIS} ; do
6712 - if use "${sapi}"; then
6713 - cd "${WORKDIR}/sapis-build/$sapi" || \
6714 - die "Failed to change dir to ${WORKDIR}/sapis-build/$1"
6715 - emake
6716 - fi
6717 - done
6718 -}
6719 -
6720 -src_install() {
6721 - # see bug #324739 for what happens when we don't have that
6722 - addpredict /usr/share/snmp/mibs/.index #nowarn
6723 -
6724 - # grab the first SAPI that got built and install common files from there
6725 - local first_sapi=""
6726 - for sapi in $SAPIS ; do
6727 - if use $sapi ; then
6728 - first_sapi=$sapi
6729 - break
6730 - fi
6731 - done
6732 -
6733 - # Makefile forgets to create this before trying to write to it...
6734 - dodir "${PHP_DESTDIR#${EPREFIX}}/bin"
6735 -
6736 - # Install php environment (without any sapis)
6737 - cd "${WORKDIR}/sapis-build/$first_sapi" || die
6738 - emake INSTALL_ROOT="${D}" \
6739 - install-build install-headers install-programs
6740 -
6741 - local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)"
6742 -
6743 - # Create the directory where we'll put version-specific php scripts
6744 - keepdir "/usr/share/php${PHP_MV}"
6745 -
6746 - local sapi="", file=""
6747 - local sapi_list=""
6748 -
6749 - for sapi in ${SAPIS}; do
6750 - if use "${sapi}" ; then
6751 - einfo "Installing SAPI: ${sapi}"
6752 - cd "${WORKDIR}/sapis-build/${sapi}" || die
6753 -
6754 - if [[ "${sapi}" == "apache2" ]] ; then
6755 - # We're specifically not using emake install-sapi as libtool
6756 - # may cause unnecessary relink failures (see bug #351266)
6757 - insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/"
6758 - newins ".libs/libphp${PHP_MV}$(get_libname)" \
6759 - "libphp${PHP_MV}$(get_libname)"
6760 - keepdir "/usr/$(get_libdir)/apache2/modules"
6761 - else
6762 - # needed each time, php_install_ini would reset it
6763 - local dest="${PHP_DESTDIR#${EPREFIX}}"
6764 - into "${dest}"
6765 - case "$sapi" in
6766 - cli)
6767 - source="sapi/cli/php"
6768 - ;;
6769 - cgi)
6770 - source="sapi/cgi/php-cgi"
6771 - ;;
6772 - fpm)
6773 - source="sapi/fpm/php-fpm"
6774 - ;;
6775 - embed)
6776 - source="libs/libphp${PHP_MV}$(get_libname)"
6777 - ;;
6778 - phpdbg)
6779 - source="sapi/phpdbg/phpdbg"
6780 - ;;
6781 - *)
6782 - die "unhandled sapi in src_install"
6783 - ;;
6784 - esac
6785 -
6786 - if [[ "${source}" == *"$(get_libname)" ]]; then
6787 - dolib.so "${source}"
6788 - else
6789 - dobin "${source}"
6790 - local name="$(basename ${source})"
6791 - dosym "${dest}/bin/${name}" "/usr/bin/${name}${SLOT}"
6792 - fi
6793 - fi
6794 -
6795 - php_install_ini "${sapi}"
6796 -
6797 - # construct correct SAPI string for php-config
6798 - # thanks to ferringb for the bash voodoo
6799 - if [[ "${sapi}" == "apache2" ]]; then
6800 - sapi_list="${sapi_list:+${sapi_list} }apache2handler"
6801 - else
6802 - sapi_list="${sapi_list:+${sapi_list} }${sapi}"
6803 - fi
6804 - fi
6805 - done
6806 -
6807 - # Installing opcache module
6808 - if use opcache ; then
6809 - into "${PHP_DESTDIR#${EPREFIX}}"
6810 - dolib.so "modules/opcache$(get_libname)"
6811 - fi
6812 -
6813 - # Install env.d files
6814 - newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}"
6815 - sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
6816 - sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
6817 -
6818 - # set php-config variable correctly (bug #278439)
6819 - sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \
6820 - "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die
6821 -
6822 - if use fpm ; then
6823 - if use systemd; then
6824 - systemd_newunit "${FILESDIR}/php-fpm_at.service" \
6825 - "php-fpm@${SLOT}.service"
6826 - else
6827 - systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \
6828 - "php-fpm@${SLOT}.service"
6829 - fi
6830 - fi
6831 -}
6832 -
6833 -src_test() {
6834 - echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
6835 - PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
6836 - if [[ ! -x "${PHP_BIN}" ]] ; then
6837 - ewarn "Test phase requires USE=cli, skipping"
6838 - return
6839 - else
6840 - export TEST_PHP_EXECUTABLE="${PHP_BIN}"
6841 - fi
6842 -
6843 - if [[ -x "${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" ]] ; then
6844 - export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi"
6845 - fi
6846 -
6847 - if [[ -x "${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" ]] ; then
6848 - export TEST_PHPDBG_EXECUTABLE="${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg"
6849 - fi
6850 -
6851 - REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \
6852 - "session.save_path=${T}" \
6853 - "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \
6854 - "session.save_path=${T}"
6855 -
6856 - for name in ${EXPECTED_TEST_FAILURES}; do
6857 - mv "${name}.out" "${name}.out.orig" 2>/dev/null || die
6858 - done
6859 -
6860 - local failed="$(find -name '*.out')"
6861 - if [[ ${failed} != "" ]] ; then
6862 - ewarn "The following test cases failed unexpectedly:"
6863 - for name in ${failed}; do
6864 - ewarn " ${name/.out/}"
6865 - done
6866 - else
6867 - einfo "No unexpected test failures, all fine"
6868 - fi
6869 -
6870 - if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
6871 - local passed=""
6872 - for name in ${EXPECTED_TEST_FAILURES}; do
6873 - [[ -f "${name}.diff" ]] && continue
6874 - passed="${passed} ${name}"
6875 - done
6876 - if [[ ${passed} != "" ]] ; then
6877 - einfo "The following test cases passed unexpectedly:"
6878 - for name in ${passed}; do
6879 - ewarn " ${passed}"
6880 - done
6881 - else
6882 - einfo "None of the known-to-fail tests passed, all fine"
6883 - fi
6884 - fi
6885 -}
6886 -
6887 -pkg_postinst() {
6888 - # Output some general info to the user
6889 - if use apache2 ; then
6890 - elog
6891 - elog "To enable PHP in apache, you will need to add \"-D PHP\" to"
6892 - elog "your apache2 command. OpenRC users can append that string to"
6893 - elog "APACHE2_OPTS in /etc/conf.d/apache2."
6894 - elog
6895 - elog "The apache module configuration file 70_mod_php.conf is"
6896 - elog "provided (and maintained) by eselect-php."
6897 - elog
6898 - fi
6899 -
6900 - # Create the symlinks for php
6901 - for m in ${SAPIS}; do
6902 - [[ ${m} == 'embed' ]] && continue;
6903 - if use $m ; then
6904 - local ci=$(eselect php show $m)
6905 - if [[ -z $ci ]]; then
6906 - eselect php set $m php${SLOT} || die
6907 - einfo "Switched ${m} to use php:${SLOT}"
6908 - einfo
6909 - elif [[ $ci != "php${SLOT}" ]] ; then
6910 - elog "To switch $m to use php:${SLOT}, run"
6911 - elog " eselect php set $m php${SLOT}"
6912 - elog
6913 - fi
6914 - fi
6915 - done
6916 -
6917 - # Remove dead symlinks for SAPIs that were just disabled. For
6918 - # example, if the user has the cgi SAPI enabled, then he has an
6919 - # eselect-php symlink for it. If he later reinstalls PHP with
6920 - # USE="-cgi", that symlink will break. This call to eselect is
6921 - # supposed to remove that dead link per bug 572436.
6922 - eselect php cleanup || die
6923 -
6924 - if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then
6925 - elog "To build extensions for this version of PHP, you will need to"
6926 - elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable."
6927 - elog
6928 - fi
6929 -
6930 - # Warn about the removal of PHP_INI_VERSION if the user has it set.
6931 - if [[ -n "${PHP_INI_VERSION}" ]]; then
6932 - ewarn 'The PHP_INI_VERSION variable has been phased out. You may'
6933 - ewarn 'remove it from your configuration at your convenience. See'
6934 - ewarn
6935 - ewarn ' https://bugs.gentoo.org/611214'
6936 - ewarn
6937 - ewarn 'for more information.'
6938 - fi
6939 -
6940 - elog "For details on how version slotting works, please see"
6941 - elog "the wiki:"
6942 - elog
6943 - elog " https://wiki.gentoo.org/wiki/PHP"
6944 - elog
6945 -}
6946 -
6947 -pkg_postrm() {
6948 - # This serves two purposes. First, if we have just removed the last
6949 - # installed version of PHP, then this will remove any dead symlinks
6950 - # belonging to eselect-php. Second, if a user upgrades slots from
6951 - # (say) 5.6 to 7.0 and depcleans the old slot, then this will update
6952 - # his existing symlinks to point to the new 7.0 installation. The
6953 - # latter is bug 432962.
6954 - #
6955 - # Note: the eselect-php package may not be installed at this point,
6956 - # so we can't die() if this command fails.
6957 - eselect php cleanup
6958 -}
6959
6960 diff --git a/dev-lang/php/php-7.3.6.ebuild b/dev-lang/php/php-7.3.6.ebuild
6961 deleted file mode 100644
6962 index c8de16897fe..00000000000
6963 --- a/dev-lang/php/php-7.3.6.ebuild
6964 +++ /dev/null
6965 @@ -1,750 +0,0 @@
6966 -# Copyright 1999-2019 Gentoo Authors
6967 -# Distributed under the terms of the GNU General Public License v2
6968 -
6969 -EAPI="7"
6970 -
6971 -inherit flag-o-matic systemd autotools
6972 -
6973 -MY_PV=${PV/_rc/RC}
6974 -DESCRIPTION="The PHP language runtime engine"
6975 -HOMEPAGE="https://php.net/"
6976 -SRC_URI="https://php.net/distributions/${P}.tar.xz"
6977 -
6978 -LICENSE="PHP-3.01
6979 - BSD
6980 - Zend-2.0
6981 - bcmath? ( LGPL-2.1+ )
6982 - fpm? ( BSD-2 )
6983 - gd? ( gd )
6984 - unicode? ( BSD-2 LGPL-2.1 )"
6985 -
6986 -SLOT="$(ver_cut 1-2)"
6987 -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"
6988 -
6989 -S="${WORKDIR}/${PN}-${MY_PV}"
6990 -
6991 -# We can build the following SAPIs in the given order
6992 -SAPIS="embed cli cgi fpm apache2 phpdbg"
6993 -
6994 -# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
6995 -IUSE="${IUSE}
6996 - ${SAPIS/cli/+cli}
6997 - threads"
6998 -
6999 -IUSE="${IUSE} acl argon2 bcmath berkdb bzip2 calendar cdb cjk
7000 - coverage +ctype curl debug
7001 - enchant exif +fileinfo +filter firebird
7002 - flatfile ftp gd gdbm gmp +hash +iconv imap inifile
7003 - intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl lmdb
7004 - mhash mssql mysql mysqli nls
7005 - oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
7006 - readline recode selinux +session session-mm sharedmem
7007 - +simplexml snmp soap sockets sodium spell sqlite ssl
7008 - sysvipc systemd test tidy +tokenizer tokyocabinet truetype unicode wddx webp
7009 - +xml xmlreader xmlwriter xmlrpc xpm xslt zip zip-encryption zlib"
7010 -
7011 -# The supported (that is, autodetected) versions of BDB are listed in
7012 -# the ./configure script. Other versions *work*, but we need to stick to
7013 -# the ones that can be detected to avoid a repeat of bug #564824.
7014 -COMMON_DEPEND="
7015 - >=app-eselect/eselect-php-0.9.1[apache2?,fpm?]
7016 - >=dev-libs/libpcre2-10.30[unicode]
7017 - fpm? ( acl? ( sys-apps/acl ) )
7018 - apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=]
7019 - <www-servers/apache-2.4[threads=] ) )
7020 - argon2? ( app-crypt/argon2:= )
7021 - berkdb? ( || ( sys-libs/db:5.3
7022 - sys-libs/db:5.1
7023 - sys-libs/db:4.8
7024 - sys-libs/db:4.7
7025 - sys-libs/db:4.6
7026 - sys-libs/db:4.5 ) )
7027 - bzip2? ( app-arch/bzip2:0= )
7028 - cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
7029 - coverage? ( dev-util/lcov )
7030 - curl? ( >=net-misc/curl-7.10.5 )
7031 - enchant? ( <app-text/enchant-2.0:0 )
7032 - firebird? ( dev-db/firebird )
7033 - gd? ( virtual/jpeg:0 media-libs/libpng:0= >=sys-libs/zlib-1.2.0.4 )
7034 - gdbm? ( >=sys-libs/gdbm-1.8.0:0= )
7035 - gmp? ( dev-libs/gmp:0= )
7036 - iconv? ( virtual/libiconv )
7037 - imap? ( virtual/imap-c-client[kerberos=,ssl=] )
7038 - intl? ( dev-libs/icu:= )
7039 - iodbc? ( dev-db/libiodbc )
7040 - kerberos? ( virtual/krb5 )
7041 - ldap? ( >=net-nds/openldap-1.2.11 )
7042 - ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 )
7043 - libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) )
7044 - lmdb? ( dev-db/lmdb:= )
7045 - mssql? ( dev-db/freetds[mssql] )
7046 - nls? ( sys-devel/gettext )
7047 - oci8-instant-client? ( dev-db/oracle-instantclient-basic )
7048 - odbc? ( >=dev-db/unixODBC-1.8.13 )
7049 - postgres? ( dev-db/postgresql:* )
7050 - qdbm? ( dev-db/qdbm )
7051 - readline? ( sys-libs/readline:0= )
7052 - recode? ( app-text/recode )
7053 - session-mm? ( dev-libs/mm )
7054 - simplexml? ( >=dev-libs/libxml2-2.6.8 )
7055 - snmp? ( >=net-analyzer/net-snmp-5.2 )
7056 - soap? ( >=dev-libs/libxml2-2.6.8 )
7057 - sodium? ( dev-libs/libsodium:= )
7058 - spell? ( >=app-text/aspell-0.50 )
7059 - sqlite? ( >=dev-db/sqlite-3.7.6.3 )
7060 - ssl? (
7061 - !libressl? ( >=dev-libs/openssl-1.0.1:0= )
7062 - libressl? ( dev-libs/libressl:0= )
7063 - )
7064 - tidy? ( || ( app-text/tidy-html5 app-text/htmltidy ) )
7065 - tokyocabinet? ( dev-db/tokyocabinet )
7066 - truetype? ( =media-libs/freetype-2* )
7067 - unicode? ( dev-libs/oniguruma:= )
7068 - wddx? ( >=dev-libs/libxml2-2.6.8 )
7069 - webp? ( media-libs/libwebp:0= )
7070 - xml? ( >=dev-libs/libxml2-2.6.8 )
7071 - xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
7072 - xmlreader? ( >=dev-libs/libxml2-2.6.8 )
7073 - xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
7074 - xpm? ( x11-libs/libXpm )
7075 - xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
7076 - zip? ( >=sys-libs/zlib-1.2.0.4:0= )
7077 - zip-encryption? ( >=dev-libs/libzip-1.2.0:= )
7078 - zlib? ( >=sys-libs/zlib-1.2.0.4:0= )
7079 -"
7080 -
7081 -RDEPEND="${COMMON_DEPEND}
7082 - virtual/mta
7083 - fpm? (
7084 - selinux? ( sec-policy/selinux-phpfpm )
7085 - systemd? ( sys-apps/systemd ) )"
7086 -
7087 -# Bison isn't actually needed when building from a release tarball
7088 -# However, the configure script will warn if it's absent or if you
7089 -# have an incompatible version installed. See bug 593278.
7090 -DEPEND="${COMMON_DEPEND}
7091 - app-arch/xz-utils
7092 - >=sys-devel/bison-3.0.1"
7093 -
7094 -BDEPEND="virtual/pkgconfig"
7095 -
7096 -# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
7097 -REQUIRED_USE="
7098 - || ( cli cgi fpm apache2 embed phpdbg )
7099 - cli? ( ^^ ( readline libedit ) )
7100 - truetype? ( gd zlib )
7101 - webp? ( gd zlib )
7102 - cjk? ( gd zlib )
7103 - exif? ( gd zlib )
7104 - xpm? ( gd zlib )
7105 - gd? ( zlib )
7106 - simplexml? ( xml )
7107 - soap? ( xml )
7108 - wddx? ( xml )
7109 - xmlrpc? ( || ( xml iconv ) )
7110 - xmlreader? ( xml )
7111 - xslt? ( xml )
7112 - ldap-sasl? ( ldap )
7113 - mhash? ( hash )
7114 - phar? ( hash )
7115 - qdbm? ( !gdbm )
7116 - readline? ( !libedit )
7117 - recode? ( !imap !mysqli !mysql )
7118 - session-mm? ( session !threads )
7119 - mysql? ( || ( mysqli pdo ) )
7120 - zip-encryption? ( zip )
7121 -"
7122 -PATCHES=(
7123 - "${FILESDIR}/php-freetype-2.9.1.patch"
7124 -)
7125 -
7126 -PHP_MV="$(ver_cut 1)"
7127 -
7128 -php_install_ini() {
7129 - local phpsapi="${1}"
7130 -
7131 - # work out where we are installing the ini file
7132 - php_set_ini_dir "${phpsapi}"
7133 -
7134 - # Always install the production INI file, bug 611214.
7135 - local phpinisrc="php.ini-production-${phpsapi}"
7136 - cp php.ini-production "${phpinisrc}" || die
7137 -
7138 - # default to /tmp for save_path, bug #282768
7139 - sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die
7140 -
7141 - # Set the extension dir
7142 - sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \
7143 - -i "${phpinisrc}" || die
7144 -
7145 - # Set the include path to point to where we want to find PEAR packages
7146 - sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die
7147 -
7148 - dodir "${PHP_INI_DIR#${EPREFIX}}"
7149 - insinto "${PHP_INI_DIR#${EPREFIX}}"
7150 - newins "${phpinisrc}" php.ini
7151 -
7152 - elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}"
7153 - elog
7154 -
7155 - dodir "${PHP_EXT_INI_DIR#${EPREFIX}}"
7156 - dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}"
7157 -
7158 - if use opcache; then
7159 - elog "Adding opcache to $PHP_EXT_INI_DIR"
7160 - echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \
7161 - "${D}/${PHP_EXT_INI_DIR}"/opcache.ini
7162 - dosym "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" \
7163 - "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini"
7164 - fi
7165 -
7166 - # SAPI-specific handling
7167 - if [[ "${sapi}" == "fpm" ]] ; then
7168 - einfo "Installing FPM config files php-fpm.conf and www.conf"
7169 - insinto "${PHP_INI_DIR#${EPREFIX}}"
7170 - doins sapi/fpm/php-fpm.conf
7171 - insinto "${PHP_INI_DIR#${EPREFIX}}/fpm.d"
7172 - doins sapi/fpm/www.conf
7173 - fi
7174 -
7175 - dodoc php.ini-{development,production}
7176 -}
7177 -
7178 -php_set_ini_dir() {
7179 - PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}"
7180 - PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
7181 - PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
7182 -}
7183 -
7184 -src_prepare() {
7185 - default
7186 -
7187 - # In php-7.x, the FPM pool configuration files have been split off
7188 - # of the main config. By default the pool config files go in
7189 - # e.g. /etc/php-fpm.d, which isn't slotted. So here we move the
7190 - # include directory to a subdirectory "fpm.d" of $PHP_INI_DIR. Later
7191 - # we'll install the pool configuration file "www.conf" there.
7192 - php_set_ini_dir fpm
7193 - sed -i "s~^include=.*$~include=${PHP_INI_DIR}/fpm.d/*.conf~" \
7194 - sapi/fpm/php-fpm.conf.in \
7195 - || die 'failed to move the include directory in php-fpm.conf'
7196 -
7197 - # Bug 669566 - necessary so that build tools are updated for commands like pecl
7198 - # Force rebuilding aclocal.m4
7199 - rm -f aclocal.m4 || die "failed to remove aclocal.m4 in src_prepare"
7200 - eautoreconf
7201 -}
7202 -
7203 -src_configure() {
7204 - addpredict /usr/share/snmp/mibs/.index #nowarn
7205 - addpredict /var/lib/net-snmp/mib_indexes #nowarn
7206 -
7207 - PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
7208 -
7209 - # The php-fpm config file wants localstatedir to be ${EPREFIX}/var
7210 - # and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002.
7211 - local our_conf=(
7212 - --prefix="${PHP_DESTDIR}"
7213 - --mandir="${PHP_DESTDIR}/man"
7214 - --infodir="${PHP_DESTDIR}/info"
7215 - --libdir="${PHP_DESTDIR}/lib"
7216 - --with-libdir="$(get_libdir)"
7217 - --localstatedir="${EPREFIX}/var"
7218 - --without-pear
7219 - $(use_enable threads maintainer-zts)
7220 - )
7221 -
7222 - our_conf+=(
7223 - $(use_with argon2 password-argon2 "${EPREFIX}/usr")
7224 - $(use_enable bcmath bcmath)
7225 - $(use_with bzip2 bz2 "${EPREFIX}/usr")
7226 - $(use_enable calendar calendar)
7227 - $(use_enable coverage gcov)
7228 - $(use_enable ctype ctype)
7229 - $(use_with curl curl "${EPREFIX}/usr")
7230 - $(use_enable xml dom)
7231 - $(use_with enchant enchant "${EPREFIX}/usr")
7232 - $(use_enable exif exif)
7233 - $(use_enable fileinfo fileinfo)
7234 - $(use_enable filter filter)
7235 - $(use_enable ftp ftp)
7236 - $(use_with nls gettext "${EPREFIX}/usr")
7237 - $(use_with gmp gmp "${EPREFIX}/usr")
7238 - $(use_enable hash hash)
7239 - $(use_with mhash mhash "${EPREFIX}/usr")
7240 - $(use_with iconv iconv \
7241 - $(use elibc_glibc || use elibc_musl || use elibc_FreeBSD || echo "${EPREFIX}/usr"))
7242 - $(use_enable intl intl)
7243 - $(use_enable ipv6 ipv6)
7244 - $(use_enable json json)
7245 - $(use_with kerberos kerberos "${EPREFIX}/usr")
7246 - $(use_enable xml libxml)
7247 - $(use_with xml libxml-dir "${EPREFIX}/usr")
7248 - $(use_enable unicode mbstring)
7249 - $(use_with unicode onig "${EPREFIX}/usr")
7250 - $(use_with ssl openssl "${EPREFIX}/usr")
7251 - $(use_with ssl openssl-dir "${EPREFIX}/usr")
7252 - $(use_enable pcntl pcntl)
7253 - $(use_enable phar phar)
7254 - $(use_enable pdo pdo)
7255 - $(use_enable opcache opcache)
7256 - $(use_with postgres pgsql "${EPREFIX}/usr")
7257 - $(use_enable posix posix)
7258 - $(use_with spell pspell "${EPREFIX}/usr")
7259 - $(use_with recode recode "${EPREFIX}/usr")
7260 - $(use_enable simplexml simplexml)
7261 - $(use_enable sharedmem shmop)
7262 - $(use_with snmp snmp "${EPREFIX}/usr")
7263 - $(use_enable soap soap)
7264 - $(use_enable sockets sockets)
7265 - $(use_with sodium sodium "${EPREFIX}/usr")
7266 - $(use_with sqlite sqlite3 "${EPREFIX}/usr")
7267 - $(use_enable sysvipc sysvmsg)
7268 - $(use_enable sysvipc sysvsem)
7269 - $(use_enable sysvipc sysvshm)
7270 - $(use_with tidy tidy "${EPREFIX}/usr")
7271 - $(use_enable tokenizer tokenizer)
7272 - $(use_enable wddx wddx)
7273 - $(use_enable xml xml)
7274 - $(use_enable xmlreader xmlreader)
7275 - $(use_enable xmlwriter xmlwriter)
7276 - $(use_with xmlrpc xmlrpc)
7277 - $(use_with xslt xsl "${EPREFIX}/usr")
7278 - $(use_enable zip zip)
7279 - $(use_with zip-encryption libzip "${EPREFIX}/usr")
7280 - $(use_with zlib zlib "${EPREFIX}/usr")
7281 - $(use_enable debug debug)
7282 - )
7283 -
7284 - # DBA support
7285 - if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
7286 - || use qdbm || use lmdb || use tokyocabinet ; then
7287 - our_conf+=( "--enable-dba${shared}" )
7288 - fi
7289 -
7290 - # DBA drivers support
7291 - our_conf+=(
7292 - $(use_with cdb cdb)
7293 - $(use_with berkdb db4 "${EPREFIX}/usr")
7294 - $(use_enable flatfile flatfile)
7295 - $(use_with gdbm gdbm "${EPREFIX}/usr")
7296 - $(use_enable inifile inifile)
7297 - $(use_with qdbm qdbm "${EPREFIX}/usr")
7298 - $(use_with lmdb lmdb "${EPREFIX}/usr")
7299 - )
7300 -
7301 - # Support for the GD graphics library
7302 - our_conf+=(
7303 - $(use_with truetype freetype-dir "${EPREFIX}/usr")
7304 - $(use_enable cjk gd-jis-conv)
7305 - $(use_with gd jpeg-dir "${EPREFIX}/usr")
7306 - $(use_with gd png-dir "${EPREFIX}/usr")
7307 - $(use_with xpm xpm-dir "${EPREFIX}/usr")
7308 - )
7309 - if use webp; then
7310 - our_conf+=( --with-webp-dir="${EPREFIX}/usr" )
7311 - fi
7312 - # enable gd last, so configure can pick up the previous settings
7313 - our_conf+=( $(use_with gd gd) )
7314 -
7315 - # IMAP support
7316 - if use imap ; then
7317 - our_conf+=(
7318 - $(use_with imap imap "${EPREFIX}/usr")
7319 - $(use_with ssl imap-ssl "${EPREFIX}/usr")
7320 - )
7321 - fi
7322 -
7323 - # Interbase/firebird support
7324 - our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") )
7325 -
7326 - # LDAP support
7327 - if use ldap ; then
7328 - our_conf+=(
7329 - $(use_with ldap ldap "${EPREFIX}/usr")
7330 - $(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr")
7331 - )
7332 - fi
7333 -
7334 - # MySQL support
7335 - local mysqllib="mysqlnd"
7336 - local mysqlilib="mysqlnd"
7337 -
7338 - our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
7339 -
7340 - local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock"
7341 - if use mysql || use mysqli ; then
7342 - our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") )
7343 - fi
7344 -
7345 - # ODBC support
7346 - our_conf+=(
7347 - $(use_with odbc unixODBC "${EPREFIX}/usr")
7348 - $(use_with iodbc iodbc "${EPREFIX}/usr")
7349 - )
7350 -
7351 - # Oracle support
7352 - our_conf+=( $(use_with oci8-instant-client oci8) )
7353 -
7354 - # PDO support
7355 - if use pdo ; then
7356 - our_conf+=(
7357 - $(use_with mssql pdo-dblib "${EPREFIX}/usr")
7358 - $(use_with mysql pdo-mysql "${mysqllib}")
7359 - $(use_with postgres pdo-pgsql)
7360 - $(use_with sqlite pdo-sqlite "${EPREFIX}/usr")
7361 - $(use_with firebird pdo-firebird "${EPREFIX}/usr")
7362 - $(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr")
7363 - $(use_with oci8-instant-client pdo-oci)
7364 - )
7365 - fi
7366 -
7367 - # readline/libedit support
7368 - our_conf+=(
7369 - $(use_with readline readline "${EPREFIX}/usr")
7370 - $(use_with libedit libedit "${EPREFIX}/usr")
7371 - )
7372 -
7373 - # Session support
7374 - if use session ; then
7375 - our_conf+=( $(use_with session-mm mm "${EPREFIX}/usr") )
7376 - else
7377 - our_conf+=( $(use_enable session session) )
7378 - fi
7379 -
7380 - # Use pic for shared modules such as apache2's mod_php
7381 - our_conf+=( --with-pic )
7382 -
7383 - # we use the system copy of pcre
7384 - # --with-pcre-regex affects ext/pcre
7385 - # --with-pcre-dir affects ext/filter and ext/zip
7386 - # --with-pcre-valgrind cannot be enabled with system pcre
7387 - # Many arches don't support pcre-jit
7388 - our_conf+=(
7389 - --with-pcre-regex="${EPREFIX}/usr"
7390 - --with-pcre-dir="${EPREFIX}/usr"
7391 - --without-pcre-valgrind
7392 - --without-pcre-jit
7393 - )
7394 -
7395 - # Catch CFLAGS problems
7396 - # Fixes bug #14067.
7397 - # Changed order to run it in reverse for bug #32022 and #12021.
7398 - replace-cpu-flags "k6*" "i586"
7399 -
7400 - # Cache the ./configure test results between SAPIs.
7401 - our_conf+=( --cache-file="${T}/config.cache" )
7402 -
7403 - # Support user-passed configuration parameters
7404 - our_conf+=( ${EXTRA_ECONF:-} )
7405 -
7406 - # Support the Apache2 extras, they must be set globally for all
7407 - # SAPIs to work correctly, especially for external PHP extensions
7408 -
7409 - mkdir -p "${WORKDIR}/sapis-build" || die
7410 - for one_sapi in $SAPIS ; do
7411 - use "${one_sapi}" || continue
7412 - php_set_ini_dir "${one_sapi}"
7413 -
7414 - # The BUILD_DIR variable is used to determine where to output
7415 - # the files that autotools creates. This was all originally
7416 - # based on the autotools-utils eclass.
7417 - BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}"
7418 - cp -a "${S}" "${BUILD_DIR}" || die
7419 - cd "${BUILD_DIR}" || die
7420 -
7421 - local sapi_conf=(
7422 - --with-config-file-path="${PHP_INI_DIR}"
7423 - --with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}"
7424 - )
7425 -
7426 - for sapi in $SAPIS ; do
7427 - case "$sapi" in
7428 - cli|cgi|embed|fpm|phpdbg)
7429 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
7430 - sapi_conf+=( "--enable-${sapi}" )
7431 - if [[ "fpm" == "${sapi}" ]] ; then
7432 - sapi_conf+=(
7433 - $(use_with acl fpm-acl)
7434 - $(use_with systemd fpm-systemd)
7435 - )
7436 - fi
7437 - else
7438 - sapi_conf+=( "--disable-${sapi}" )
7439 - fi
7440 - ;;
7441 -
7442 - apache2)
7443 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
7444 - sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" )
7445 - else
7446 - sapi_conf+=( --without-apxs2 )
7447 - fi
7448 - ;;
7449 - esac
7450 - done
7451 -
7452 - # Construct the $myeconfargs array by concatenating $our_conf
7453 - # (the common args) and $sapi_conf (the SAPI-specific args).
7454 - local myeconfargs=( "${our_conf[@]}" )
7455 - myeconfargs+=( "${sapi_conf[@]}" )
7456 -
7457 - pushd "${BUILD_DIR}" > /dev/null || die
7458 - econf "${myeconfargs[@]}"
7459 - popd > /dev/null || die
7460 - done
7461 -}
7462 -
7463 -src_compile() {
7464 - # snmp seems to run during src_compile, too (bug #324739)
7465 - addpredict /usr/share/snmp/mibs/.index #nowarn
7466 - addpredict /var/lib/net-snmp/mib_indexes #nowarn
7467 -
7468 - for sapi in ${SAPIS} ; do
7469 - if use "${sapi}"; then
7470 - cd "${WORKDIR}/sapis-build/$sapi" || \
7471 - die "Failed to change dir to ${WORKDIR}/sapis-build/$1"
7472 - emake
7473 - fi
7474 - done
7475 -}
7476 -
7477 -src_install() {
7478 - # see bug #324739 for what happens when we don't have that
7479 - addpredict /usr/share/snmp/mibs/.index #nowarn
7480 -
7481 - # grab the first SAPI that got built and install common files from there
7482 - local first_sapi=""
7483 - for sapi in $SAPIS ; do
7484 - if use $sapi ; then
7485 - first_sapi=$sapi
7486 - break
7487 - fi
7488 - done
7489 -
7490 - # Makefile forgets to create this before trying to write to it...
7491 - dodir "${PHP_DESTDIR#${EPREFIX}}/bin"
7492 -
7493 - # Install php environment (without any sapis)
7494 - cd "${WORKDIR}/sapis-build/$first_sapi" || die
7495 - emake INSTALL_ROOT="${D}" \
7496 - install-build install-headers install-programs
7497 -
7498 - local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)"
7499 -
7500 - # Create the directory where we'll put version-specific php scripts
7501 - keepdir "/usr/share/php${PHP_MV}"
7502 -
7503 - local sapi="", file=""
7504 - local sapi_list=""
7505 -
7506 - for sapi in ${SAPIS}; do
7507 - if use "${sapi}" ; then
7508 - einfo "Installing SAPI: ${sapi}"
7509 - cd "${WORKDIR}/sapis-build/${sapi}" || die
7510 -
7511 - if [[ "${sapi}" == "apache2" ]] ; then
7512 - # We're specifically not using emake install-sapi as libtool
7513 - # may cause unnecessary relink failures (see bug #351266)
7514 - insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/"
7515 - newins ".libs/libphp${PHP_MV}$(get_libname)" \
7516 - "libphp${PHP_MV}$(get_libname)"
7517 - keepdir "/usr/$(get_libdir)/apache2/modules"
7518 - else
7519 - # needed each time, php_install_ini would reset it
7520 - local dest="${PHP_DESTDIR#${EPREFIX}}"
7521 - into "${dest}"
7522 - case "$sapi" in
7523 - cli)
7524 - source="sapi/cli/php"
7525 - ;;
7526 - cgi)
7527 - source="sapi/cgi/php-cgi"
7528 - ;;
7529 - fpm)
7530 - source="sapi/fpm/php-fpm"
7531 - ;;
7532 - embed)
7533 - source="libs/libphp${PHP_MV}$(get_libname)"
7534 - ;;
7535 - phpdbg)
7536 - source="sapi/phpdbg/phpdbg"
7537 - ;;
7538 - *)
7539 - die "unhandled sapi in src_install"
7540 - ;;
7541 - esac
7542 -
7543 - if [[ "${source}" == *"$(get_libname)" ]]; then
7544 - dolib.so "${source}"
7545 - else
7546 - dobin "${source}"
7547 - local name="$(basename ${source})"
7548 - dosym "${dest}/bin/${name}" "/usr/bin/${name}${SLOT}"
7549 - fi
7550 - fi
7551 -
7552 - php_install_ini "${sapi}"
7553 -
7554 - # construct correct SAPI string for php-config
7555 - # thanks to ferringb for the bash voodoo
7556 - if [[ "${sapi}" == "apache2" ]]; then
7557 - sapi_list="${sapi_list:+${sapi_list} }apache2handler"
7558 - else
7559 - sapi_list="${sapi_list:+${sapi_list} }${sapi}"
7560 - fi
7561 - fi
7562 - done
7563 -
7564 - # Installing opcache module
7565 - if use opcache ; then
7566 - into "${PHP_DESTDIR#${EPREFIX}}"
7567 - dolib.so "modules/opcache$(get_libname)"
7568 - fi
7569 -
7570 - # Install env.d files
7571 - newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}"
7572 - sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
7573 - sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
7574 -
7575 - # set php-config variable correctly (bug #278439)
7576 - sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \
7577 - "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die
7578 -
7579 - if use fpm ; then
7580 - if use systemd; then
7581 - systemd_newunit "${FILESDIR}/php-fpm_at.service" \
7582 - "php-fpm@${SLOT}.service"
7583 - else
7584 - systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \
7585 - "php-fpm@${SLOT}.service"
7586 - fi
7587 - fi
7588 -}
7589 -
7590 -src_test() {
7591 - echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
7592 - PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
7593 - if [[ ! -x "${PHP_BIN}" ]] ; then
7594 - ewarn "Test phase requires USE=cli, skipping"
7595 - return
7596 - else
7597 - export TEST_PHP_EXECUTABLE="${PHP_BIN}"
7598 - fi
7599 -
7600 - if [[ -x "${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" ]] ; then
7601 - export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi"
7602 - fi
7603 -
7604 - if [[ -x "${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" ]] ; then
7605 - export TEST_PHPDBG_EXECUTABLE="${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg"
7606 - fi
7607 -
7608 - REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \
7609 - "session.save_path=${T}" \
7610 - "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \
7611 - "session.save_path=${T}"
7612 -
7613 - for name in ${EXPECTED_TEST_FAILURES}; do
7614 - mv "${name}.out" "${name}.out.orig" 2>/dev/null || die
7615 - done
7616 -
7617 - local failed="$(find -name '*.out')"
7618 - if [[ ${failed} != "" ]] ; then
7619 - ewarn "The following test cases failed unexpectedly:"
7620 - for name in ${failed}; do
7621 - ewarn " ${name/.out/}"
7622 - done
7623 - else
7624 - einfo "No unexpected test failures, all fine"
7625 - fi
7626 -
7627 - if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
7628 - local passed=""
7629 - for name in ${EXPECTED_TEST_FAILURES}; do
7630 - [[ -f "${name}.diff" ]] && continue
7631 - passed="${passed} ${name}"
7632 - done
7633 - if [[ ${passed} != "" ]] ; then
7634 - einfo "The following test cases passed unexpectedly:"
7635 - for name in ${passed}; do
7636 - ewarn " ${passed}"
7637 - done
7638 - else
7639 - einfo "None of the known-to-fail tests passed, all fine"
7640 - fi
7641 - fi
7642 -}
7643 -
7644 -pkg_postinst() {
7645 - # Output some general info to the user
7646 - if use apache2 ; then
7647 - elog
7648 - elog "To enable PHP in apache, you will need to add \"-D PHP\" to"
7649 - elog "your apache2 command. OpenRC users can append that string to"
7650 - elog "APACHE2_OPTS in /etc/conf.d/apache2."
7651 - elog
7652 - elog "The apache module configuration file 70_mod_php.conf is"
7653 - elog "provided (and maintained) by eselect-php."
7654 - elog
7655 - fi
7656 -
7657 - # Create the symlinks for php
7658 - for m in ${SAPIS}; do
7659 - [[ ${m} == 'embed' ]] && continue;
7660 - if use $m ; then
7661 - local ci=$(eselect php show $m)
7662 - if [[ -z $ci ]]; then
7663 - eselect php set $m php${SLOT} || die
7664 - einfo "Switched ${m} to use php:${SLOT}"
7665 - einfo
7666 - elif [[ $ci != "php${SLOT}" ]] ; then
7667 - elog "To switch $m to use php:${SLOT}, run"
7668 - elog " eselect php set $m php${SLOT}"
7669 - elog
7670 - fi
7671 - fi
7672 - done
7673 -
7674 - # Remove dead symlinks for SAPIs that were just disabled. For
7675 - # example, if the user has the cgi SAPI enabled, then he has an
7676 - # eselect-php symlink for it. If he later reinstalls PHP with
7677 - # USE="-cgi", that symlink will break. This call to eselect is
7678 - # supposed to remove that dead link per bug 572436.
7679 - eselect php cleanup || die
7680 -
7681 - if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then
7682 - elog "To build extensions for this version of PHP, you will need to"
7683 - elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable."
7684 - elog
7685 - fi
7686 -
7687 - # Warn about the removal of PHP_INI_VERSION if the user has it set.
7688 - if [[ -n "${PHP_INI_VERSION}" ]]; then
7689 - ewarn 'The PHP_INI_VERSION variable has been phased out. You may'
7690 - ewarn 'remove it from your configuration at your convenience. See'
7691 - ewarn
7692 - ewarn ' https://bugs.gentoo.org/611214'
7693 - ewarn
7694 - ewarn 'for more information.'
7695 - fi
7696 -
7697 - elog "For details on how version slotting works, please see"
7698 - elog "the wiki:"
7699 - elog
7700 - elog " https://wiki.gentoo.org/wiki/PHP"
7701 - elog
7702 -}
7703 -
7704 -pkg_postrm() {
7705 - # This serves two purposes. First, if we have just removed the last
7706 - # installed version of PHP, then this will remove any dead symlinks
7707 - # belonging to eselect-php. Second, if a user upgrades slots from
7708 - # (say) 5.6 to 7.0 and depcleans the old slot, then this will update
7709 - # his existing symlinks to point to the new 7.0 installation. The
7710 - # latter is bug 432962.
7711 - #
7712 - # Note: the eselect-php package may not be installed at this point,
7713 - # so we can't die() if this command fails.
7714 - eselect php cleanup
7715 -}