1 |
commit: 73896251628db98d15c64aa65aac004c24b0e38a |
2 |
Author: Brian Evans <grknight <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Nov 7 13:03:02 2021 +0000 |
4 |
Commit: Brian Evans <grknight <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Nov 7 13:03:02 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=73896251 |
7 |
|
8 |
dev-lang/php: Clean up vunlernable versions |
9 |
|
10 |
Bug: https://bugs.gentoo.org/819510 |
11 |
Signed-off-by: Brian Evans <grknight <AT> gentoo.org> |
12 |
|
13 |
dev-lang/php/Manifest | 4 - |
14 |
dev-lang/php/php-7.3.31-r1.ebuild | 754 ------------------------------------- |
15 |
dev-lang/php/php-7.3.31.ebuild | 758 -------------------------------------- |
16 |
dev-lang/php/php-7.4.24.ebuild | 750 ------------------------------------- |
17 |
dev-lang/php/php-8.0.11.ebuild | 749 ------------------------------------- |
18 |
dev-lang/php/php-8.1.0_rc2.ebuild | 749 ------------------------------------- |
19 |
6 files changed, 3764 deletions(-) |
20 |
|
21 |
diff --git a/dev-lang/php/Manifest b/dev-lang/php/Manifest |
22 |
index 0e68481d081..5ce38628708 100644 |
23 |
--- a/dev-lang/php/Manifest |
24 |
+++ b/dev-lang/php/Manifest |
25 |
@@ -1,8 +1,4 @@ |
26 |
-DIST php-7.3.31.tar.xz 12142912 BLAKE2B dc68d2e2f38c93653950be4b30dde12fec6e7279e288fe40439a8e3e31110a228a69275e032604a493a53951230f6f42257719617ae18179116be414e49a2af5 SHA512 63a8122233b9892453b6b92429497a7ad9761ad88063e2b95607b5d4d4c0a0e1135073bcae5a0e69a17082d2348911cbbd4807c0d20905d93324d89e5b019a05 |
27 |
DIST php-7.3.32.tar.xz 12142436 BLAKE2B 375092f7fade8b93d2fbf409552cda42a685267248e3bce373913eeae5f133e7773554c2302b12bf09588d74a76898b138c47287f7d9a721f294635799ca46f6 SHA512 afed20a90aa7d207f9b409fb2066789a637b24d6c6874fc5733bbe6e9972616b387669ce40cba16b606893d88572f398e34aff7a36626308e3ede312f09fcc56 |
28 |
-DIST php-7.4.24.tar.xz 10372816 BLAKE2B 62e1853c20eb10d8540b9284af93cce4b3976cfae7cdba5c0c2d6d14e732a57d7f1d196f4270687d6af8f376d7a9ccef60b0b606ed20eda7e1b2b7b95074c55c SHA512 30dd0a83d6184791f4cff3edcffeb05470de8f98ddadba3c11544449bf500280ff2048a8ca8588b35d0622dcbbf16f55ea297f51d469ae137048cab2d40da9cd |
29 |
DIST php-7.4.25.tar.xz 10376304 BLAKE2B 75682840a9e978d2ce350892bb8d743238f1ca86d4e1bb549637ad259541264c911128d3fbb2a89768acaa366eac91e66b26f8411f6b9f6d55475b139f5ae95a SHA512 7fcb236f6d2a92514059b2e107c2b592e6139e3c65046566ae98fb9d2c09eb3e9ca1a41ea6535fc814bc7127d8fd9f8bb5a80bd86eec32120eb150a34b9b5c34 |
30 |
-DIST php-8.0.11.tar.xz 10804388 BLAKE2B 8d32f2bb66b2850c7d8d820cbcf94af5161065612b204f6e30289d9b9fffbae7c45cdf5e31c3d1f774932d7eb7218079f6f0d19774b108d53a81a6c88d3c99fb SHA512 2d346959b2691ea0d5334dc9cad225b7a65ec53d6a6493f3b95c4819a0c088bec36aa1bf4ab3c8044a631bcfefb689d85463ff2259d42000e65dac30badcc59d |
31 |
DIST php-8.0.12.tar.xz 10713980 BLAKE2B ce8ca0d671e8613a81744a55cf94ff43254482a08dec365c05eb4ca22c1b31732e5ef93a51d383d2e8daf0cf332ed7946e79ba3b385386ca0773fc673fe58307 SHA512 927b15c4443f3741a5325ec7bf387987b405cd5e64e40fd81f1945bf073adda30eeede8e1f98185f505cb61f969cf1abe05b8dad57a3c4e87971e8037bb16b23 |
32 |
-DIST php-8.1.0RC2.tar.xz 11679352 BLAKE2B 0b4eb5b1f8d3f8fb29421b6c72b3279bc7f3c5f6ba684305afdc7b1f5cc0f45a942d5c0f0a681f152ad87f209fa4e464215aef43732180882d523f2badd4596e SHA512 aecd58eb683467df62032208caa545d243ca2574f6683566a489136c84a19da4383c5aaa122dc09cfb44dc951bfaf85e50b0b9659b49ec1c4ae69f5afea9844b |
33 |
DIST php-8.1.0RC5.tar.xz 11717432 BLAKE2B a1f468a17267684030c5350452d20a352c05c1c18b66e305ea86e8fd76210d8795623f8feb82196170037cacc9a36802ae63dc6922e2f1b118681525412177e8 SHA512 ee8c29b0bbe688346837e7f3227f07b354f20b8e783fbeb79d692528089b8e23ad1980659c6ea470d98b07da1735b81ebb52eb378b3161b4cde5e22678bbb0b7 |
34 |
|
35 |
diff --git a/dev-lang/php/php-7.3.31-r1.ebuild b/dev-lang/php/php-7.3.31-r1.ebuild |
36 |
deleted file mode 100644 |
37 |
index 35bd0c80532..00000000000 |
38 |
--- a/dev-lang/php/php-7.3.31-r1.ebuild |
39 |
+++ /dev/null |
40 |
@@ -1,754 +0,0 @@ |
41 |
-# Copyright 1999-2021 Gentoo Authors |
42 |
-# Distributed under the terms of the GNU General Public License v2 |
43 |
- |
44 |
-EAPI="7" |
45 |
- |
46 |
-inherit flag-o-matic systemd autotools |
47 |
- |
48 |
-MY_PV=${PV/_rc/RC} |
49 |
-DESCRIPTION="The PHP language runtime engine" |
50 |
-HOMEPAGE="https://www.php.net/" |
51 |
-SRC_URI="https://www.php.net/distributions/${P}.tar.xz" |
52 |
- |
53 |
-LICENSE="PHP-3.01 |
54 |
- BSD |
55 |
- Zend-2.0 |
56 |
- bcmath? ( LGPL-2.1+ ) |
57 |
- fpm? ( BSD-2 ) |
58 |
- gd? ( gd ) |
59 |
- unicode? ( BSD-2 LGPL-2.1 )" |
60 |
- |
61 |
-SLOT="$(ver_cut 1-2)" |
62 |
-KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos" |
63 |
- |
64 |
-S="${WORKDIR}/${PN}-${MY_PV}" |
65 |
- |
66 |
-# We can build the following SAPIs in the given order |
67 |
-SAPIS="embed cli cgi fpm apache2 phpdbg" |
68 |
- |
69 |
-# SAPIs and SAPI-specific USE flags (cli SAPI is default on): |
70 |
-IUSE="${IUSE} |
71 |
- ${SAPIS/cli/+cli} |
72 |
- threads" |
73 |
- |
74 |
-IUSE="${IUSE} acl argon2 bcmath berkdb bzip2 calendar cdb cjk |
75 |
- coverage +ctype curl debug |
76 |
- enchant exif +fileinfo +filter firebird |
77 |
- +flatfile ftp gd gdbm gmp +hash +iconv imap inifile |
78 |
- intl iodbc ipv6 +jit +json kerberos ldap ldap-sasl libedit lmdb |
79 |
- mhash mssql mysql mysqli nls |
80 |
- oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm |
81 |
- readline recode selinux +session session-mm sharedmem |
82 |
- +simplexml snmp soap sockets sodium spell sqlite ssl |
83 |
- sysvipc systemd test tidy +tokenizer tokyocabinet truetype unicode wddx webp |
84 |
- +xml xmlreader xmlwriter xmlrpc xpm xslt zip zip-encryption zlib" |
85 |
- |
86 |
-# The supported (that is, autodetected) versions of BDB are listed in |
87 |
-# the ./configure script. Other versions *work*, but we need to stick to |
88 |
-# the ones that can be detected to avoid a repeat of bug #564824. |
89 |
-COMMON_DEPEND=" |
90 |
- >=app-eselect/eselect-php-0.9.1[apache2?,fpm?] |
91 |
- >=dev-libs/libpcre2-10.30[jit?,unicode] |
92 |
- fpm? ( acl? ( sys-apps/acl ) ) |
93 |
- apache2? ( www-servers/apache[apache2_modules_unixd(+),threads=] ) |
94 |
- argon2? ( app-crypt/argon2:= ) |
95 |
- berkdb? ( || ( sys-libs/db:5.3 sys-libs/db:4.8 ) ) |
96 |
- bzip2? ( app-arch/bzip2:0= ) |
97 |
- cdb? ( || ( dev-db/cdb dev-db/tinycdb ) ) |
98 |
- coverage? ( dev-util/lcov ) |
99 |
- curl? ( >=net-misc/curl-7.10.5 ) |
100 |
- enchant? ( <app-text/enchant-2.0:0 ) |
101 |
- firebird? ( dev-db/firebird ) |
102 |
- gd? ( >=virtual/jpeg-0-r3:0 media-libs/libpng:0= >=sys-libs/zlib-1.2.0.4 ) |
103 |
- gdbm? ( >=sys-libs/gdbm-1.8.0:0= ) |
104 |
- gmp? ( dev-libs/gmp:0= ) |
105 |
- iconv? ( virtual/libiconv ) |
106 |
- imap? ( >=virtual/imap-c-client-2[kerberos=,ssl=] ) |
107 |
- intl? ( dev-libs/icu:= ) |
108 |
- iodbc? ( dev-db/libiodbc ) |
109 |
- kerberos? ( virtual/krb5 ) |
110 |
- ldap? ( >=net-nds/openldap-1.2.11 ) |
111 |
- ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 ) |
112 |
- libedit? ( dev-libs/libedit ) |
113 |
- lmdb? ( dev-db/lmdb:= ) |
114 |
- mssql? ( dev-db/freetds[mssql] ) |
115 |
- nls? ( sys-devel/gettext ) |
116 |
- oci8-instant-client? ( dev-db/oracle-instantclient[sdk] ) |
117 |
- odbc? ( >=dev-db/unixODBC-1.8.13 ) |
118 |
- postgres? ( dev-db/postgresql:* ) |
119 |
- qdbm? ( dev-db/qdbm ) |
120 |
- readline? ( sys-libs/readline:0= ) |
121 |
- recode? ( app-text/recode:0= ) |
122 |
- session-mm? ( dev-libs/mm ) |
123 |
- simplexml? ( >=dev-libs/libxml2-2.6.8 ) |
124 |
- snmp? ( >=net-analyzer/net-snmp-5.2 ) |
125 |
- soap? ( >=dev-libs/libxml2-2.6.8 ) |
126 |
- sodium? ( dev-libs/libsodium:=[-minimal] ) |
127 |
- spell? ( >=app-text/aspell-0.50 ) |
128 |
- sqlite? ( >=dev-db/sqlite-3.7.6.3 ) |
129 |
- ssl? ( >=dev-libs/openssl-1.0.1:0= ) |
130 |
- tidy? ( || ( app-text/tidy-html5 app-text/htmltidy ) ) |
131 |
- tokyocabinet? ( dev-db/tokyocabinet ) |
132 |
- truetype? ( =media-libs/freetype-2* ) |
133 |
- unicode? ( dev-libs/oniguruma:= ) |
134 |
- wddx? ( >=dev-libs/libxml2-2.6.8 ) |
135 |
- webp? ( media-libs/libwebp:0= ) |
136 |
- xml? ( >=dev-libs/libxml2-2.6.8 ) |
137 |
- xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv ) |
138 |
- xmlreader? ( >=dev-libs/libxml2-2.6.8 ) |
139 |
- xmlwriter? ( >=dev-libs/libxml2-2.6.8 ) |
140 |
- xpm? ( x11-libs/libXpm ) |
141 |
- xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 ) |
142 |
- zip? ( >=sys-libs/zlib-1.2.0.4:0= ) |
143 |
- zip-encryption? ( >=dev-libs/libzip-1.2.0:= ) |
144 |
- zlib? ( >=sys-libs/zlib-1.2.0.4:0= ) |
145 |
-" |
146 |
- |
147 |
-RDEPEND="${COMMON_DEPEND} |
148 |
- virtual/mta |
149 |
- fpm? ( |
150 |
- selinux? ( sec-policy/selinux-phpfpm ) |
151 |
- systemd? ( sys-apps/systemd ) )" |
152 |
- |
153 |
-# Bison isn't actually needed when building from a release tarball |
154 |
-# However, the configure script will warn if it's absent or if you |
155 |
-# have an incompatible version installed. See bug 593278. |
156 |
-DEPEND="${COMMON_DEPEND} |
157 |
- app-arch/xz-utils |
158 |
- >=sys-devel/bison-3.0.1" |
159 |
- |
160 |
-BDEPEND="virtual/pkgconfig" |
161 |
- |
162 |
-# Without USE=readline or libedit, the interactive "php -a" CLI will hang. |
163 |
-# The Oracle instant client provides its own incompatible ldap library. |
164 |
-REQUIRED_USE=" |
165 |
- || ( cli cgi fpm apache2 embed phpdbg ) |
166 |
- cli? ( ^^ ( readline libedit ) ) |
167 |
- truetype? ( gd zlib ) |
168 |
- webp? ( gd zlib ) |
169 |
- cjk? ( gd zlib ) |
170 |
- exif? ( gd zlib ) |
171 |
- xpm? ( gd zlib ) |
172 |
- gd? ( zlib ) |
173 |
- simplexml? ( xml ) |
174 |
- soap? ( xml ) |
175 |
- wddx? ( xml ) |
176 |
- xmlrpc? ( || ( xml iconv ) ) |
177 |
- xmlreader? ( xml ) |
178 |
- xslt? ( xml ) |
179 |
- ldap-sasl? ( ldap ) |
180 |
- mhash? ( hash ) |
181 |
- oci8-instant-client? ( !ldap ) |
182 |
- phar? ( hash ) |
183 |
- qdbm? ( !gdbm ) |
184 |
- readline? ( !libedit ) |
185 |
- recode? ( !imap !mysqli !mysql ) |
186 |
- session-mm? ( session !threads ) |
187 |
- mysql? ( || ( mysqli pdo ) ) |
188 |
- zip-encryption? ( zip ) |
189 |
-" |
190 |
- |
191 |
-RESTRICT="!test? ( test )" |
192 |
- |
193 |
-PATCHES=( |
194 |
- "${FILESDIR}/php-freetype-2.9.1.patch" |
195 |
- "${FILESDIR}/php73-CVE2021-21703.patch" |
196 |
-) |
197 |
- |
198 |
-PHP_MV="$(ver_cut 1)" |
199 |
- |
200 |
-php_install_ini() { |
201 |
- local phpsapi="${1}" |
202 |
- |
203 |
- # work out where we are installing the ini file |
204 |
- php_set_ini_dir "${phpsapi}" |
205 |
- |
206 |
- # Always install the production INI file, bug 611214. |
207 |
- local phpinisrc="php.ini-production-${phpsapi}" |
208 |
- cp php.ini-production "${phpinisrc}" || die |
209 |
- |
210 |
- # default to /tmp for save_path, bug #282768 |
211 |
- sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die |
212 |
- |
213 |
- # Set the extension dir |
214 |
- sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \ |
215 |
- -i "${phpinisrc}" || die |
216 |
- |
217 |
- # Set the include path to point to where we want to find PEAR packages |
218 |
- sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die |
219 |
- |
220 |
- insinto "${PHP_INI_DIR#${EPREFIX}}" |
221 |
- newins "${phpinisrc}" php.ini |
222 |
- |
223 |
- elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}" |
224 |
- elog |
225 |
- |
226 |
- dodir "${PHP_EXT_INI_DIR#${EPREFIX}}" |
227 |
- dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}" |
228 |
- |
229 |
- if use opcache; then |
230 |
- elog "Adding opcache to $PHP_EXT_INI_DIR" |
231 |
- echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \ |
232 |
- "${D}/${PHP_EXT_INI_DIR}"/opcache.ini |
233 |
- dosym "../ext/opcache.ini" \ |
234 |
- "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini" |
235 |
- fi |
236 |
- |
237 |
- # SAPI-specific handling |
238 |
- if [[ "${sapi}" == "fpm" ]] ; then |
239 |
- einfo "Installing FPM config files php-fpm.conf and www.conf" |
240 |
- insinto "${PHP_INI_DIR#${EPREFIX}}" |
241 |
- doins sapi/fpm/php-fpm.conf |
242 |
- insinto "${PHP_INI_DIR#${EPREFIX}}/fpm.d" |
243 |
- doins sapi/fpm/www.conf |
244 |
- fi |
245 |
- |
246 |
- dodoc php.ini-{development,production} |
247 |
-} |
248 |
- |
249 |
-php_set_ini_dir() { |
250 |
- PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}" |
251 |
- PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext" |
252 |
- PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active" |
253 |
-} |
254 |
- |
255 |
-src_prepare() { |
256 |
- default |
257 |
- |
258 |
- # In php-7.x, the FPM pool configuration files have been split off |
259 |
- # of the main config. By default the pool config files go in |
260 |
- # e.g. /etc/php-fpm.d, which isn't slotted. So here we move the |
261 |
- # include directory to a subdirectory "fpm.d" of $PHP_INI_DIR. Later |
262 |
- # we'll install the pool configuration file "www.conf" there. |
263 |
- php_set_ini_dir fpm |
264 |
- sed -i "s~^include=.*$~include=${PHP_INI_DIR}/fpm.d/*.conf~" \ |
265 |
- sapi/fpm/php-fpm.conf.in \ |
266 |
- || die 'failed to move the include directory in php-fpm.conf' |
267 |
- |
268 |
- # Bug 669566 - necessary so that build tools are updated for commands like pecl |
269 |
- # Force rebuilding aclocal.m4 |
270 |
- rm -f aclocal.m4 || die "failed to remove aclocal.m4 in src_prepare" |
271 |
- eautoreconf |
272 |
-} |
273 |
- |
274 |
-src_configure() { |
275 |
- addpredict /usr/share/snmp/mibs/.index #nowarn |
276 |
- addpredict /var/lib/net-snmp/mib_indexes #nowarn |
277 |
- |
278 |
- PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}" |
279 |
- |
280 |
- # The php-fpm config file wants localstatedir to be ${EPREFIX}/var |
281 |
- # and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002. |
282 |
- local our_conf=( |
283 |
- --prefix="${PHP_DESTDIR}" |
284 |
- --mandir="${PHP_DESTDIR}/man" |
285 |
- --infodir="${PHP_DESTDIR}/info" |
286 |
- --libdir="${PHP_DESTDIR}/lib" |
287 |
- --with-libdir="$(get_libdir)" |
288 |
- --localstatedir="${EPREFIX}/var" |
289 |
- --without-pear |
290 |
- $(use_enable threads maintainer-zts) |
291 |
- ) |
292 |
- |
293 |
- our_conf+=( |
294 |
- $(use_with argon2 password-argon2 "${EPREFIX}/usr") |
295 |
- $(use_enable bcmath bcmath) |
296 |
- $(use_with bzip2 bz2 "${EPREFIX}/usr") |
297 |
- $(use_enable calendar calendar) |
298 |
- $(use_enable coverage gcov) |
299 |
- $(use_enable ctype ctype) |
300 |
- $(use_with curl curl "${EPREFIX}/usr") |
301 |
- $(use_enable xml dom) |
302 |
- $(use_with enchant enchant "${EPREFIX}/usr") |
303 |
- $(use_enable exif exif) |
304 |
- $(use_enable fileinfo fileinfo) |
305 |
- $(use_enable filter filter) |
306 |
- $(use_enable ftp ftp) |
307 |
- $(use_with nls gettext "${EPREFIX}/usr") |
308 |
- $(use_with gmp gmp "${EPREFIX}/usr") |
309 |
- $(use_enable hash hash) |
310 |
- $(use_with mhash mhash "${EPREFIX}/usr") |
311 |
- $(use_with iconv iconv \ |
312 |
- $(use elibc_glibc || use elibc_musl || use elibc_FreeBSD || echo "${EPREFIX}/usr")) |
313 |
- $(use_enable intl intl) |
314 |
- $(use_enable ipv6 ipv6) |
315 |
- $(use_enable json json) |
316 |
- $(use_with kerberos kerberos "${EPREFIX}/usr") |
317 |
- $(use_enable xml libxml) |
318 |
- $(use_with xml libxml-dir "${EPREFIX}/usr") |
319 |
- $(use_enable unicode mbstring) |
320 |
- $(use_with unicode onig "${EPREFIX}/usr") |
321 |
- $(use_with ssl openssl "${EPREFIX}/usr") |
322 |
- $(use_with ssl openssl-dir "${EPREFIX}/usr") |
323 |
- $(use_enable pcntl pcntl) |
324 |
- $(use_enable phar phar) |
325 |
- $(use_enable pdo pdo) |
326 |
- $(use_enable opcache opcache) |
327 |
- $(use_with postgres pgsql "${EPREFIX}/usr") |
328 |
- $(use_enable posix posix) |
329 |
- $(use_with spell pspell "${EPREFIX}/usr") |
330 |
- $(use_with recode recode "${EPREFIX}/usr") |
331 |
- $(use_enable simplexml simplexml) |
332 |
- $(use_enable sharedmem shmop) |
333 |
- $(use_with snmp snmp "${EPREFIX}/usr") |
334 |
- $(use_enable soap soap) |
335 |
- $(use_enable sockets sockets) |
336 |
- $(use_with sodium sodium "${EPREFIX}/usr") |
337 |
- $(use_with sqlite sqlite3 "${EPREFIX}/usr") |
338 |
- $(use_enable sysvipc sysvmsg) |
339 |
- $(use_enable sysvipc sysvsem) |
340 |
- $(use_enable sysvipc sysvshm) |
341 |
- $(use_with tidy tidy "${EPREFIX}/usr") |
342 |
- $(use_enable tokenizer tokenizer) |
343 |
- $(use_enable wddx wddx) |
344 |
- $(use_enable xml xml) |
345 |
- $(use_enable xmlreader xmlreader) |
346 |
- $(use_enable xmlwriter xmlwriter) |
347 |
- $(use_with xmlrpc xmlrpc) |
348 |
- $(use_with xslt xsl "${EPREFIX}/usr") |
349 |
- $(use_enable zip zip) |
350 |
- $(use_with zip-encryption libzip "${EPREFIX}/usr") |
351 |
- $(use_with zlib zlib "${EPREFIX}/usr") |
352 |
- $(use_enable debug debug) |
353 |
- ) |
354 |
- |
355 |
- # DBA support |
356 |
- if use cdb || use berkdb || use flatfile || use gdbm || use inifile \ |
357 |
- || use qdbm || use lmdb || use tokyocabinet ; then |
358 |
- our_conf+=( "--enable-dba${shared}" ) |
359 |
- fi |
360 |
- |
361 |
- # DBA drivers support |
362 |
- our_conf+=( |
363 |
- $(use_with cdb cdb) |
364 |
- $(use_with berkdb db4 "${EPREFIX}/usr") |
365 |
- $(use_enable flatfile flatfile) |
366 |
- $(use_with gdbm gdbm "${EPREFIX}/usr") |
367 |
- $(use_enable inifile inifile) |
368 |
- $(use_with qdbm qdbm "${EPREFIX}/usr") |
369 |
- $(use_with lmdb lmdb "${EPREFIX}/usr") |
370 |
- ) |
371 |
- |
372 |
- # Support for the GD graphics library |
373 |
- our_conf+=( |
374 |
- $(use_with truetype freetype-dir "${EPREFIX}/usr") |
375 |
- $(use_enable cjk gd-jis-conv) |
376 |
- $(use_with gd jpeg-dir "${EPREFIX}/usr") |
377 |
- $(use_with gd png-dir "${EPREFIX}/usr") |
378 |
- $(use_with xpm xpm-dir "${EPREFIX}/usr") |
379 |
- ) |
380 |
- if use webp; then |
381 |
- our_conf+=( --with-webp-dir="${EPREFIX}/usr" ) |
382 |
- fi |
383 |
- # enable gd last, so configure can pick up the previous settings |
384 |
- our_conf+=( $(use_with gd gd) ) |
385 |
- |
386 |
- # IMAP support |
387 |
- if use imap ; then |
388 |
- our_conf+=( |
389 |
- $(use_with imap imap "${EPREFIX}/usr") |
390 |
- $(use_with ssl imap-ssl "${EPREFIX}/usr") |
391 |
- ) |
392 |
- fi |
393 |
- |
394 |
- # Interbase/firebird support |
395 |
- our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") ) |
396 |
- |
397 |
- # LDAP support |
398 |
- if use ldap ; then |
399 |
- our_conf+=( |
400 |
- $(use_with ldap ldap "${EPREFIX}/usr") |
401 |
- $(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr") |
402 |
- ) |
403 |
- fi |
404 |
- |
405 |
- # MySQL support |
406 |
- local mysqllib="mysqlnd" |
407 |
- local mysqlilib="mysqlnd" |
408 |
- |
409 |
- our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") ) |
410 |
- |
411 |
- local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock" |
412 |
- if use mysql || use mysqli ; then |
413 |
- our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") ) |
414 |
- fi |
415 |
- |
416 |
- # ODBC support |
417 |
- our_conf+=( |
418 |
- $(use_with odbc unixODBC "${EPREFIX}/usr") |
419 |
- $(use_with iodbc iodbc "${EPREFIX}/usr") |
420 |
- ) |
421 |
- |
422 |
- # Oracle support |
423 |
- our_conf+=( $(use_with oci8-instant-client oci8) ) |
424 |
- |
425 |
- # PDO support |
426 |
- if use pdo ; then |
427 |
- our_conf+=( |
428 |
- $(use_with mssql pdo-dblib "${EPREFIX}/usr") |
429 |
- $(use_with mysql pdo-mysql "${mysqllib}") |
430 |
- $(use_with postgres pdo-pgsql) |
431 |
- $(use_with sqlite pdo-sqlite "${EPREFIX}/usr") |
432 |
- $(use_with firebird pdo-firebird "${EPREFIX}/usr") |
433 |
- $(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr") |
434 |
- $(use_with oci8-instant-client pdo-oci) |
435 |
- ) |
436 |
- fi |
437 |
- |
438 |
- # readline/libedit support |
439 |
- our_conf+=( |
440 |
- $(use_with readline readline "${EPREFIX}/usr") |
441 |
- $(use_with libedit libedit "${EPREFIX}/usr") |
442 |
- ) |
443 |
- |
444 |
- # Session support |
445 |
- if use session ; then |
446 |
- our_conf+=( $(use_with session-mm mm "${EPREFIX}/usr") ) |
447 |
- else |
448 |
- our_conf+=( $(use_enable session session) ) |
449 |
- fi |
450 |
- |
451 |
- # Use pic for shared modules such as apache2's mod_php |
452 |
- our_conf+=( --with-pic ) |
453 |
- |
454 |
- # we use the system copy of pcre |
455 |
- # --with-pcre-regex affects ext/pcre |
456 |
- # --with-pcre-dir affects ext/filter and ext/zip |
457 |
- # --with-pcre-valgrind cannot be enabled with system pcre |
458 |
- our_conf+=( |
459 |
- --with-pcre-regex="${EPREFIX}/usr" |
460 |
- --with-pcre-dir="${EPREFIX}/usr" |
461 |
- --without-pcre-valgrind |
462 |
- $(use_with jit pcre-jit) |
463 |
- ) |
464 |
- |
465 |
- # Catch CFLAGS problems |
466 |
- # Fixes bug #14067. |
467 |
- # Changed order to run it in reverse for bug #32022 and #12021. |
468 |
- replace-cpu-flags "k6*" "i586" |
469 |
- |
470 |
- # Cache the ./configure test results between SAPIs. |
471 |
- our_conf+=( --cache-file="${T}/config.cache" ) |
472 |
- |
473 |
- # Support user-passed configuration parameters |
474 |
- our_conf+=( ${EXTRA_ECONF:-} ) |
475 |
- |
476 |
- # Support the Apache2 extras, they must be set globally for all |
477 |
- # SAPIs to work correctly, especially for external PHP extensions |
478 |
- |
479 |
- local one_sapi |
480 |
- local sapi |
481 |
- mkdir -p "${WORKDIR}/sapis-build" || die |
482 |
- for one_sapi in $SAPIS ; do |
483 |
- use "${one_sapi}" || continue |
484 |
- php_set_ini_dir "${one_sapi}" |
485 |
- |
486 |
- # The BUILD_DIR variable is used to determine where to output |
487 |
- # the files that autotools creates. This was all originally |
488 |
- # based on the autotools-utils eclass. |
489 |
- BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}" |
490 |
- cp -a "${S}" "${BUILD_DIR}" || die |
491 |
- cd "${BUILD_DIR}" || die |
492 |
- |
493 |
- local sapi_conf=( |
494 |
- --with-config-file-path="${PHP_INI_DIR}" |
495 |
- --with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}" |
496 |
- ) |
497 |
- |
498 |
- for sapi in $SAPIS ; do |
499 |
- case "$sapi" in |
500 |
- cli|cgi|embed|fpm|phpdbg) |
501 |
- if [[ "${one_sapi}" == "${sapi}" ]] ; then |
502 |
- sapi_conf+=( "--enable-${sapi}" ) |
503 |
- if [[ "fpm" == "${sapi}" ]] ; then |
504 |
- sapi_conf+=( |
505 |
- $(use_with acl fpm-acl) |
506 |
- $(use_with systemd fpm-systemd) |
507 |
- ) |
508 |
- fi |
509 |
- else |
510 |
- sapi_conf+=( "--disable-${sapi}" ) |
511 |
- fi |
512 |
- ;; |
513 |
- |
514 |
- apache2) |
515 |
- if [[ "${one_sapi}" == "${sapi}" ]] ; then |
516 |
- sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" ) |
517 |
- else |
518 |
- sapi_conf+=( --without-apxs2 ) |
519 |
- fi |
520 |
- ;; |
521 |
- esac |
522 |
- done |
523 |
- |
524 |
- # Construct the $myeconfargs array by concatenating $our_conf |
525 |
- # (the common args) and $sapi_conf (the SAPI-specific args). |
526 |
- local myeconfargs=( "${our_conf[@]}" ) |
527 |
- myeconfargs+=( "${sapi_conf[@]}" ) |
528 |
- |
529 |
- pushd "${BUILD_DIR}" > /dev/null || die |
530 |
- econf "${myeconfargs[@]}" |
531 |
- popd > /dev/null || die |
532 |
- done |
533 |
-} |
534 |
- |
535 |
-src_compile() { |
536 |
- # snmp seems to run during src_compile, too (bug #324739) |
537 |
- addpredict /usr/share/snmp/mibs/.index #nowarn |
538 |
- addpredict /var/lib/net-snmp/mib_indexes #nowarn |
539 |
- |
540 |
- local sapi |
541 |
- for sapi in ${SAPIS} ; do |
542 |
- if use "${sapi}"; then |
543 |
- cd "${WORKDIR}/sapis-build/$sapi" || \ |
544 |
- die "Failed to change dir to ${WORKDIR}/sapis-build/$1" |
545 |
- emake |
546 |
- fi |
547 |
- done |
548 |
-} |
549 |
- |
550 |
-src_install() { |
551 |
- # see bug #324739 for what happens when we don't have that |
552 |
- addpredict /usr/share/snmp/mibs/.index #nowarn |
553 |
- |
554 |
- # grab the first SAPI that got built and install common files from there |
555 |
- local first_sapi="", sapi="" |
556 |
- for sapi in $SAPIS ; do |
557 |
- if use $sapi ; then |
558 |
- first_sapi=$sapi |
559 |
- break |
560 |
- fi |
561 |
- done |
562 |
- |
563 |
- # Makefile forgets to create this before trying to write to it... |
564 |
- dodir "${PHP_DESTDIR#${EPREFIX}}/bin" |
565 |
- |
566 |
- # Install php environment (without any sapis) |
567 |
- cd "${WORKDIR}/sapis-build/$first_sapi" || die |
568 |
- emake INSTALL_ROOT="${D}" \ |
569 |
- install-build install-headers install-programs |
570 |
- |
571 |
- local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)" |
572 |
- |
573 |
- # Create the directory where we'll put version-specific php scripts |
574 |
- keepdir "/usr/share/php${PHP_MV}" |
575 |
- |
576 |
- local file="" |
577 |
- local sapi_list="" |
578 |
- |
579 |
- for sapi in ${SAPIS}; do |
580 |
- if use "${sapi}" ; then |
581 |
- einfo "Installing SAPI: ${sapi}" |
582 |
- cd "${WORKDIR}/sapis-build/${sapi}" || die |
583 |
- |
584 |
- if [[ "${sapi}" == "apache2" ]] ; then |
585 |
- # We're specifically not using emake install-sapi as libtool |
586 |
- # may cause unnecessary relink failures (see bug #351266) |
587 |
- insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/" |
588 |
- newins ".libs/libphp${PHP_MV}$(get_libname)" \ |
589 |
- "libphp${PHP_MV}$(get_libname)" |
590 |
- keepdir "/usr/$(get_libdir)/apache2/modules" |
591 |
- else |
592 |
- # needed each time, php_install_ini would reset it |
593 |
- local dest="${PHP_DESTDIR#${EPREFIX}}" |
594 |
- into "${dest}" |
595 |
- case "$sapi" in |
596 |
- cli) |
597 |
- source="sapi/cli/php" |
598 |
- # Install the "phar" archive utility. |
599 |
- if use phar ; then |
600 |
- emake INSTALL_ROOT="${D}" install-pharcmd |
601 |
- dosym "..${dest#/usr}/bin/phar" "/usr/bin/phar${SLOT}" |
602 |
- fi |
603 |
- ;; |
604 |
- cgi) |
605 |
- source="sapi/cgi/php-cgi" |
606 |
- ;; |
607 |
- fpm) |
608 |
- source="sapi/fpm/php-fpm" |
609 |
- ;; |
610 |
- embed) |
611 |
- source="libs/libphp${PHP_MV}$(get_libname)" |
612 |
- ;; |
613 |
- phpdbg) |
614 |
- source="sapi/phpdbg/phpdbg" |
615 |
- ;; |
616 |
- *) |
617 |
- die "unhandled sapi in src_install" |
618 |
- ;; |
619 |
- esac |
620 |
- |
621 |
- if [[ "${source}" == *"$(get_libname)" ]]; then |
622 |
- dolib.so "${source}" |
623 |
- else |
624 |
- dobin "${source}" |
625 |
- local name="$(basename ${source})" |
626 |
- dosym "..${dest#/usr}/bin/${name}" "/usr/bin/${name}${SLOT}" |
627 |
- fi |
628 |
- fi |
629 |
- |
630 |
- php_install_ini "${sapi}" |
631 |
- |
632 |
- # construct correct SAPI string for php-config |
633 |
- # thanks to ferringb for the bash voodoo |
634 |
- if [[ "${sapi}" == "apache2" ]]; then |
635 |
- sapi_list="${sapi_list:+${sapi_list} }apache2handler" |
636 |
- else |
637 |
- sapi_list="${sapi_list:+${sapi_list} }${sapi}" |
638 |
- fi |
639 |
- fi |
640 |
- done |
641 |
- |
642 |
- # Installing opcache module |
643 |
- if use opcache ; then |
644 |
- into "${PHP_DESTDIR#${EPREFIX}}" |
645 |
- dolib.so "modules/opcache$(get_libname)" |
646 |
- fi |
647 |
- |
648 |
- # Install env.d files |
649 |
- newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}" |
650 |
- sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die |
651 |
- sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die |
652 |
- |
653 |
- # set php-config variable correctly (bug #278439) |
654 |
- sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \ |
655 |
- "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die |
656 |
- |
657 |
- if use fpm ; then |
658 |
- if use systemd; then |
659 |
- systemd_newunit "${FILESDIR}/php-fpm_at.service" \ |
660 |
- "php-fpm@${SLOT}.service" |
661 |
- else |
662 |
- systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \ |
663 |
- "php-fpm@${SLOT}.service" |
664 |
- fi |
665 |
- fi |
666 |
-} |
667 |
- |
668 |
-src_test() { |
669 |
- echo ">>> Test phase [test]: ${CATEGORY}/${PF}" |
670 |
- PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php" |
671 |
- if [[ ! -x "${PHP_BIN}" ]] ; then |
672 |
- ewarn "Test phase requires USE=cli, skipping" |
673 |
- return |
674 |
- else |
675 |
- export TEST_PHP_EXECUTABLE="${PHP_BIN}" |
676 |
- fi |
677 |
- |
678 |
- if [[ -x "${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" ]] ; then |
679 |
- export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" |
680 |
- fi |
681 |
- |
682 |
- if [[ -x "${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" ]] ; then |
683 |
- export TEST_PHPDBG_EXECUTABLE="${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" |
684 |
- fi |
685 |
- |
686 |
- REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \ |
687 |
- "session.save_path=${T}" \ |
688 |
- "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \ |
689 |
- "session.save_path=${T}" |
690 |
- |
691 |
- for name in ${EXPECTED_TEST_FAILURES}; do |
692 |
- mv "${name}.out" "${name}.out.orig" 2>/dev/null || die |
693 |
- done |
694 |
- |
695 |
- local failed="$(find -name '*.out')" |
696 |
- if [[ ${failed} != "" ]] ; then |
697 |
- ewarn "The following test cases failed unexpectedly:" |
698 |
- for name in ${failed}; do |
699 |
- ewarn " ${name/.out/}" |
700 |
- done |
701 |
- else |
702 |
- einfo "No unexpected test failures, all fine" |
703 |
- fi |
704 |
- |
705 |
- if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then |
706 |
- local passed="" |
707 |
- for name in ${EXPECTED_TEST_FAILURES}; do |
708 |
- [[ -f "${name}.diff" ]] && continue |
709 |
- passed="${passed} ${name}" |
710 |
- done |
711 |
- if [[ ${passed} != "" ]] ; then |
712 |
- einfo "The following test cases passed unexpectedly:" |
713 |
- for name in ${passed}; do |
714 |
- ewarn " ${passed}" |
715 |
- done |
716 |
- else |
717 |
- einfo "None of the known-to-fail tests passed, all fine" |
718 |
- fi |
719 |
- fi |
720 |
-} |
721 |
- |
722 |
-pkg_postinst() { |
723 |
- # Output some general info to the user |
724 |
- if use apache2 ; then |
725 |
- elog |
726 |
- elog "To enable PHP in apache, you will need to add \"-D PHP\" to" |
727 |
- elog "your apache2 command. OpenRC users can append that string to" |
728 |
- elog "APACHE2_OPTS in /etc/conf.d/apache2." |
729 |
- elog |
730 |
- elog "The apache module configuration file 70_mod_php.conf is" |
731 |
- elog "provided (and maintained) by eselect-php." |
732 |
- elog |
733 |
- fi |
734 |
- |
735 |
- # Create the symlinks for php |
736 |
- local m |
737 |
- for m in ${SAPIS}; do |
738 |
- [[ ${m} == 'embed' ]] && continue; |
739 |
- if use $m ; then |
740 |
- local ci=$(eselect php show $m) |
741 |
- if [[ -z $ci ]]; then |
742 |
- eselect php set $m php${SLOT} || die |
743 |
- einfo "Switched ${m} to use php:${SLOT}" |
744 |
- einfo |
745 |
- elif [[ $ci != "php${SLOT}" ]] ; then |
746 |
- elog "To switch $m to use php:${SLOT}, run" |
747 |
- elog " eselect php set $m php${SLOT}" |
748 |
- elog |
749 |
- fi |
750 |
- fi |
751 |
- done |
752 |
- |
753 |
- # Remove dead symlinks for SAPIs that were just disabled. For |
754 |
- # example, if the user has the cgi SAPI enabled, then he has an |
755 |
- # eselect-php symlink for it. If he later reinstalls PHP with |
756 |
- # USE="-cgi", that symlink will break. This call to eselect is |
757 |
- # supposed to remove that dead link per bug 572436. |
758 |
- eselect php cleanup || die |
759 |
- |
760 |
- if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then |
761 |
- elog "To build extensions for this version of PHP, you will need to" |
762 |
- elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable." |
763 |
- elog |
764 |
- fi |
765 |
- |
766 |
- # Warn about the removal of PHP_INI_VERSION if the user has it set. |
767 |
- if [[ -n "${PHP_INI_VERSION}" ]]; then |
768 |
- ewarn 'The PHP_INI_VERSION variable has been phased out. You may' |
769 |
- ewarn 'remove it from your configuration at your convenience. See' |
770 |
- ewarn |
771 |
- ewarn ' https://bugs.gentoo.org/611214' |
772 |
- ewarn |
773 |
- ewarn 'for more information.' |
774 |
- fi |
775 |
- |
776 |
- elog "For details on how version slotting works, please see" |
777 |
- elog "the wiki:" |
778 |
- elog |
779 |
- elog " https://wiki.gentoo.org/wiki/PHP" |
780 |
- elog |
781 |
-} |
782 |
- |
783 |
-pkg_postrm() { |
784 |
- # This serves two purposes. First, if we have just removed the last |
785 |
- # installed version of PHP, then this will remove any dead symlinks |
786 |
- # belonging to eselect-php. Second, if a user upgrades slots from |
787 |
- # (say) 5.6 to 7.0 and depcleans the old slot, then this will update |
788 |
- # his existing symlinks to point to the new 7.0 installation. The |
789 |
- # latter is bug 432962. |
790 |
- # |
791 |
- # Note: the eselect-php package may not be installed at this point, |
792 |
- # so we can't die() if this command fails. |
793 |
- eselect php cleanup |
794 |
-} |
795 |
|
796 |
diff --git a/dev-lang/php/php-7.3.31.ebuild b/dev-lang/php/php-7.3.31.ebuild |
797 |
deleted file mode 100644 |
798 |
index 43b75511c0b..00000000000 |
799 |
--- a/dev-lang/php/php-7.3.31.ebuild |
800 |
+++ /dev/null |
801 |
@@ -1,758 +0,0 @@ |
802 |
-# Copyright 1999-2021 Gentoo Authors |
803 |
-# Distributed under the terms of the GNU General Public License v2 |
804 |
- |
805 |
-EAPI="7" |
806 |
- |
807 |
-inherit flag-o-matic systemd autotools |
808 |
- |
809 |
-MY_PV=${PV/_rc/RC} |
810 |
-DESCRIPTION="The PHP language runtime engine" |
811 |
-HOMEPAGE="https://www.php.net/" |
812 |
-SRC_URI="https://www.php.net/distributions/${P}.tar.xz" |
813 |
- |
814 |
-LICENSE="PHP-3.01 |
815 |
- BSD |
816 |
- Zend-2.0 |
817 |
- bcmath? ( LGPL-2.1+ ) |
818 |
- fpm? ( BSD-2 ) |
819 |
- gd? ( gd ) |
820 |
- unicode? ( BSD-2 LGPL-2.1 )" |
821 |
- |
822 |
-SLOT="$(ver_cut 1-2)" |
823 |
-KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos" |
824 |
- |
825 |
-S="${WORKDIR}/${PN}-${MY_PV}" |
826 |
- |
827 |
-# We can build the following SAPIs in the given order |
828 |
-SAPIS="embed cli cgi fpm apache2 phpdbg" |
829 |
- |
830 |
-# SAPIs and SAPI-specific USE flags (cli SAPI is default on): |
831 |
-IUSE="${IUSE} |
832 |
- ${SAPIS/cli/+cli} |
833 |
- threads" |
834 |
- |
835 |
-IUSE="${IUSE} acl argon2 bcmath berkdb bzip2 calendar cdb cjk |
836 |
- coverage +ctype curl debug |
837 |
- enchant exif +fileinfo +filter firebird |
838 |
- +flatfile ftp gd gdbm gmp +hash +iconv imap inifile |
839 |
- intl iodbc ipv6 +jit +json kerberos ldap ldap-sasl libedit lmdb |
840 |
- mhash mssql mysql mysqli nls |
841 |
- oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm |
842 |
- readline recode selinux +session session-mm sharedmem |
843 |
- +simplexml snmp soap sockets sodium spell sqlite ssl |
844 |
- sysvipc systemd test tidy +tokenizer tokyocabinet truetype unicode wddx webp |
845 |
- +xml xmlreader xmlwriter xmlrpc xpm xslt zip zip-encryption zlib" |
846 |
- |
847 |
-# The supported (that is, autodetected) versions of BDB are listed in |
848 |
-# the ./configure script. Other versions *work*, but we need to stick to |
849 |
-# the ones that can be detected to avoid a repeat of bug #564824. |
850 |
-COMMON_DEPEND=" |
851 |
- >=app-eselect/eselect-php-0.9.1[apache2?,fpm?] |
852 |
- >=dev-libs/libpcre2-10.30[jit?,unicode] |
853 |
- fpm? ( acl? ( sys-apps/acl ) ) |
854 |
- apache2? ( www-servers/apache[apache2_modules_unixd(+),threads=] ) |
855 |
- argon2? ( app-crypt/argon2:= ) |
856 |
- berkdb? ( || ( sys-libs/db:5.3 |
857 |
- sys-libs/db:5.1 |
858 |
- sys-libs/db:4.8 |
859 |
- sys-libs/db:4.7 |
860 |
- sys-libs/db:4.6 |
861 |
- sys-libs/db:4.5 ) ) |
862 |
- bzip2? ( app-arch/bzip2:0= ) |
863 |
- cdb? ( || ( dev-db/cdb dev-db/tinycdb ) ) |
864 |
- coverage? ( dev-util/lcov ) |
865 |
- curl? ( >=net-misc/curl-7.10.5 ) |
866 |
- enchant? ( <app-text/enchant-2.0:0 ) |
867 |
- firebird? ( dev-db/firebird ) |
868 |
- gd? ( >=virtual/jpeg-0-r3:0 media-libs/libpng:0= >=sys-libs/zlib-1.2.0.4 ) |
869 |
- gdbm? ( >=sys-libs/gdbm-1.8.0:0= ) |
870 |
- gmp? ( dev-libs/gmp:0= ) |
871 |
- iconv? ( virtual/libiconv ) |
872 |
- imap? ( >=virtual/imap-c-client-2[kerberos=,ssl=] ) |
873 |
- intl? ( dev-libs/icu:= ) |
874 |
- iodbc? ( dev-db/libiodbc ) |
875 |
- kerberos? ( virtual/krb5 ) |
876 |
- ldap? ( >=net-nds/openldap-1.2.11 ) |
877 |
- ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 ) |
878 |
- libedit? ( dev-libs/libedit ) |
879 |
- lmdb? ( dev-db/lmdb:= ) |
880 |
- mssql? ( dev-db/freetds[mssql] ) |
881 |
- nls? ( sys-devel/gettext ) |
882 |
- oci8-instant-client? ( dev-db/oracle-instantclient[sdk] ) |
883 |
- odbc? ( >=dev-db/unixODBC-1.8.13 ) |
884 |
- postgres? ( dev-db/postgresql:* ) |
885 |
- qdbm? ( dev-db/qdbm ) |
886 |
- readline? ( sys-libs/readline:0= ) |
887 |
- recode? ( app-text/recode:0= ) |
888 |
- session-mm? ( dev-libs/mm ) |
889 |
- simplexml? ( >=dev-libs/libxml2-2.6.8 ) |
890 |
- snmp? ( >=net-analyzer/net-snmp-5.2 ) |
891 |
- soap? ( >=dev-libs/libxml2-2.6.8 ) |
892 |
- sodium? ( dev-libs/libsodium:=[-minimal] ) |
893 |
- spell? ( >=app-text/aspell-0.50 ) |
894 |
- sqlite? ( >=dev-db/sqlite-3.7.6.3 ) |
895 |
- ssl? ( >=dev-libs/openssl-1.0.1:0= ) |
896 |
- tidy? ( || ( app-text/tidy-html5 app-text/htmltidy ) ) |
897 |
- tokyocabinet? ( dev-db/tokyocabinet ) |
898 |
- truetype? ( =media-libs/freetype-2* ) |
899 |
- unicode? ( dev-libs/oniguruma:= ) |
900 |
- wddx? ( >=dev-libs/libxml2-2.6.8 ) |
901 |
- webp? ( media-libs/libwebp:0= ) |
902 |
- xml? ( >=dev-libs/libxml2-2.6.8 ) |
903 |
- xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv ) |
904 |
- xmlreader? ( >=dev-libs/libxml2-2.6.8 ) |
905 |
- xmlwriter? ( >=dev-libs/libxml2-2.6.8 ) |
906 |
- xpm? ( x11-libs/libXpm ) |
907 |
- xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 ) |
908 |
- zip? ( >=sys-libs/zlib-1.2.0.4:0= ) |
909 |
- zip-encryption? ( >=dev-libs/libzip-1.2.0:= ) |
910 |
- zlib? ( >=sys-libs/zlib-1.2.0.4:0= ) |
911 |
-" |
912 |
- |
913 |
-RDEPEND="${COMMON_DEPEND} |
914 |
- virtual/mta |
915 |
- fpm? ( |
916 |
- selinux? ( sec-policy/selinux-phpfpm ) |
917 |
- systemd? ( sys-apps/systemd ) )" |
918 |
- |
919 |
-# Bison isn't actually needed when building from a release tarball |
920 |
-# However, the configure script will warn if it's absent or if you |
921 |
-# have an incompatible version installed. See bug 593278. |
922 |
-DEPEND="${COMMON_DEPEND} |
923 |
- app-arch/xz-utils |
924 |
- >=sys-devel/bison-3.0.1" |
925 |
- |
926 |
-BDEPEND="virtual/pkgconfig" |
927 |
- |
928 |
-# Without USE=readline or libedit, the interactive "php -a" CLI will hang. |
929 |
-# The Oracle instant client provides its own incompatible ldap library. |
930 |
-REQUIRED_USE=" |
931 |
- || ( cli cgi fpm apache2 embed phpdbg ) |
932 |
- cli? ( ^^ ( readline libedit ) ) |
933 |
- truetype? ( gd zlib ) |
934 |
- webp? ( gd zlib ) |
935 |
- cjk? ( gd zlib ) |
936 |
- exif? ( gd zlib ) |
937 |
- xpm? ( gd zlib ) |
938 |
- gd? ( zlib ) |
939 |
- simplexml? ( xml ) |
940 |
- soap? ( xml ) |
941 |
- wddx? ( xml ) |
942 |
- xmlrpc? ( || ( xml iconv ) ) |
943 |
- xmlreader? ( xml ) |
944 |
- xslt? ( xml ) |
945 |
- ldap-sasl? ( ldap ) |
946 |
- mhash? ( hash ) |
947 |
- oci8-instant-client? ( !ldap ) |
948 |
- phar? ( hash ) |
949 |
- qdbm? ( !gdbm ) |
950 |
- readline? ( !libedit ) |
951 |
- recode? ( !imap !mysqli !mysql ) |
952 |
- session-mm? ( session !threads ) |
953 |
- mysql? ( || ( mysqli pdo ) ) |
954 |
- zip-encryption? ( zip ) |
955 |
-" |
956 |
- |
957 |
-RESTRICT="!test? ( test )" |
958 |
- |
959 |
-PATCHES=( |
960 |
- "${FILESDIR}/php-freetype-2.9.1.patch" |
961 |
-) |
962 |
- |
963 |
-PHP_MV="$(ver_cut 1)" |
964 |
- |
965 |
-php_install_ini() { |
966 |
- local phpsapi="${1}" |
967 |
- |
968 |
- # work out where we are installing the ini file |
969 |
- php_set_ini_dir "${phpsapi}" |
970 |
- |
971 |
- # Always install the production INI file, bug 611214. |
972 |
- local phpinisrc="php.ini-production-${phpsapi}" |
973 |
- cp php.ini-production "${phpinisrc}" || die |
974 |
- |
975 |
- # default to /tmp for save_path, bug #282768 |
976 |
- sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die |
977 |
- |
978 |
- # Set the extension dir |
979 |
- sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \ |
980 |
- -i "${phpinisrc}" || die |
981 |
- |
982 |
- # Set the include path to point to where we want to find PEAR packages |
983 |
- sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die |
984 |
- |
985 |
- insinto "${PHP_INI_DIR#${EPREFIX}}" |
986 |
- newins "${phpinisrc}" php.ini |
987 |
- |
988 |
- elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}" |
989 |
- elog |
990 |
- |
991 |
- dodir "${PHP_EXT_INI_DIR#${EPREFIX}}" |
992 |
- dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}" |
993 |
- |
994 |
- if use opcache; then |
995 |
- elog "Adding opcache to $PHP_EXT_INI_DIR" |
996 |
- echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \ |
997 |
- "${D}/${PHP_EXT_INI_DIR}"/opcache.ini |
998 |
- dosym "../ext/opcache.ini" \ |
999 |
- "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini" |
1000 |
- fi |
1001 |
- |
1002 |
- # SAPI-specific handling |
1003 |
- if [[ "${sapi}" == "fpm" ]] ; then |
1004 |
- einfo "Installing FPM config files php-fpm.conf and www.conf" |
1005 |
- insinto "${PHP_INI_DIR#${EPREFIX}}" |
1006 |
- doins sapi/fpm/php-fpm.conf |
1007 |
- insinto "${PHP_INI_DIR#${EPREFIX}}/fpm.d" |
1008 |
- doins sapi/fpm/www.conf |
1009 |
- fi |
1010 |
- |
1011 |
- dodoc php.ini-{development,production} |
1012 |
-} |
1013 |
- |
1014 |
-php_set_ini_dir() { |
1015 |
- PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}" |
1016 |
- PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext" |
1017 |
- PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active" |
1018 |
-} |
1019 |
- |
1020 |
-src_prepare() { |
1021 |
- default |
1022 |
- |
1023 |
- # In php-7.x, the FPM pool configuration files have been split off |
1024 |
- # of the main config. By default the pool config files go in |
1025 |
- # e.g. /etc/php-fpm.d, which isn't slotted. So here we move the |
1026 |
- # include directory to a subdirectory "fpm.d" of $PHP_INI_DIR. Later |
1027 |
- # we'll install the pool configuration file "www.conf" there. |
1028 |
- php_set_ini_dir fpm |
1029 |
- sed -i "s~^include=.*$~include=${PHP_INI_DIR}/fpm.d/*.conf~" \ |
1030 |
- sapi/fpm/php-fpm.conf.in \ |
1031 |
- || die 'failed to move the include directory in php-fpm.conf' |
1032 |
- |
1033 |
- # Bug 669566 - necessary so that build tools are updated for commands like pecl |
1034 |
- # Force rebuilding aclocal.m4 |
1035 |
- rm -f aclocal.m4 || die "failed to remove aclocal.m4 in src_prepare" |
1036 |
- eautoreconf |
1037 |
-} |
1038 |
- |
1039 |
-src_configure() { |
1040 |
- addpredict /usr/share/snmp/mibs/.index #nowarn |
1041 |
- addpredict /var/lib/net-snmp/mib_indexes #nowarn |
1042 |
- |
1043 |
- PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}" |
1044 |
- |
1045 |
- # The php-fpm config file wants localstatedir to be ${EPREFIX}/var |
1046 |
- # and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002. |
1047 |
- local our_conf=( |
1048 |
- --prefix="${PHP_DESTDIR}" |
1049 |
- --mandir="${PHP_DESTDIR}/man" |
1050 |
- --infodir="${PHP_DESTDIR}/info" |
1051 |
- --libdir="${PHP_DESTDIR}/lib" |
1052 |
- --with-libdir="$(get_libdir)" |
1053 |
- --localstatedir="${EPREFIX}/var" |
1054 |
- --without-pear |
1055 |
- $(use_enable threads maintainer-zts) |
1056 |
- ) |
1057 |
- |
1058 |
- our_conf+=( |
1059 |
- $(use_with argon2 password-argon2 "${EPREFIX}/usr") |
1060 |
- $(use_enable bcmath bcmath) |
1061 |
- $(use_with bzip2 bz2 "${EPREFIX}/usr") |
1062 |
- $(use_enable calendar calendar) |
1063 |
- $(use_enable coverage gcov) |
1064 |
- $(use_enable ctype ctype) |
1065 |
- $(use_with curl curl "${EPREFIX}/usr") |
1066 |
- $(use_enable xml dom) |
1067 |
- $(use_with enchant enchant "${EPREFIX}/usr") |
1068 |
- $(use_enable exif exif) |
1069 |
- $(use_enable fileinfo fileinfo) |
1070 |
- $(use_enable filter filter) |
1071 |
- $(use_enable ftp ftp) |
1072 |
- $(use_with nls gettext "${EPREFIX}/usr") |
1073 |
- $(use_with gmp gmp "${EPREFIX}/usr") |
1074 |
- $(use_enable hash hash) |
1075 |
- $(use_with mhash mhash "${EPREFIX}/usr") |
1076 |
- $(use_with iconv iconv \ |
1077 |
- $(use elibc_glibc || use elibc_musl || use elibc_FreeBSD || echo "${EPREFIX}/usr")) |
1078 |
- $(use_enable intl intl) |
1079 |
- $(use_enable ipv6 ipv6) |
1080 |
- $(use_enable json json) |
1081 |
- $(use_with kerberos kerberos "${EPREFIX}/usr") |
1082 |
- $(use_enable xml libxml) |
1083 |
- $(use_with xml libxml-dir "${EPREFIX}/usr") |
1084 |
- $(use_enable unicode mbstring) |
1085 |
- $(use_with unicode onig "${EPREFIX}/usr") |
1086 |
- $(use_with ssl openssl "${EPREFIX}/usr") |
1087 |
- $(use_with ssl openssl-dir "${EPREFIX}/usr") |
1088 |
- $(use_enable pcntl pcntl) |
1089 |
- $(use_enable phar phar) |
1090 |
- $(use_enable pdo pdo) |
1091 |
- $(use_enable opcache opcache) |
1092 |
- $(use_with postgres pgsql "${EPREFIX}/usr") |
1093 |
- $(use_enable posix posix) |
1094 |
- $(use_with spell pspell "${EPREFIX}/usr") |
1095 |
- $(use_with recode recode "${EPREFIX}/usr") |
1096 |
- $(use_enable simplexml simplexml) |
1097 |
- $(use_enable sharedmem shmop) |
1098 |
- $(use_with snmp snmp "${EPREFIX}/usr") |
1099 |
- $(use_enable soap soap) |
1100 |
- $(use_enable sockets sockets) |
1101 |
- $(use_with sodium sodium "${EPREFIX}/usr") |
1102 |
- $(use_with sqlite sqlite3 "${EPREFIX}/usr") |
1103 |
- $(use_enable sysvipc sysvmsg) |
1104 |
- $(use_enable sysvipc sysvsem) |
1105 |
- $(use_enable sysvipc sysvshm) |
1106 |
- $(use_with tidy tidy "${EPREFIX}/usr") |
1107 |
- $(use_enable tokenizer tokenizer) |
1108 |
- $(use_enable wddx wddx) |
1109 |
- $(use_enable xml xml) |
1110 |
- $(use_enable xmlreader xmlreader) |
1111 |
- $(use_enable xmlwriter xmlwriter) |
1112 |
- $(use_with xmlrpc xmlrpc) |
1113 |
- $(use_with xslt xsl "${EPREFIX}/usr") |
1114 |
- $(use_enable zip zip) |
1115 |
- $(use_with zip-encryption libzip "${EPREFIX}/usr") |
1116 |
- $(use_with zlib zlib "${EPREFIX}/usr") |
1117 |
- $(use_enable debug debug) |
1118 |
- ) |
1119 |
- |
1120 |
- # DBA support |
1121 |
- if use cdb || use berkdb || use flatfile || use gdbm || use inifile \ |
1122 |
- || use qdbm || use lmdb || use tokyocabinet ; then |
1123 |
- our_conf+=( "--enable-dba${shared}" ) |
1124 |
- fi |
1125 |
- |
1126 |
- # DBA drivers support |
1127 |
- our_conf+=( |
1128 |
- $(use_with cdb cdb) |
1129 |
- $(use_with berkdb db4 "${EPREFIX}/usr") |
1130 |
- $(use_enable flatfile flatfile) |
1131 |
- $(use_with gdbm gdbm "${EPREFIX}/usr") |
1132 |
- $(use_enable inifile inifile) |
1133 |
- $(use_with qdbm qdbm "${EPREFIX}/usr") |
1134 |
- $(use_with lmdb lmdb "${EPREFIX}/usr") |
1135 |
- ) |
1136 |
- |
1137 |
- # Support for the GD graphics library |
1138 |
- our_conf+=( |
1139 |
- $(use_with truetype freetype-dir "${EPREFIX}/usr") |
1140 |
- $(use_enable cjk gd-jis-conv) |
1141 |
- $(use_with gd jpeg-dir "${EPREFIX}/usr") |
1142 |
- $(use_with gd png-dir "${EPREFIX}/usr") |
1143 |
- $(use_with xpm xpm-dir "${EPREFIX}/usr") |
1144 |
- ) |
1145 |
- if use webp; then |
1146 |
- our_conf+=( --with-webp-dir="${EPREFIX}/usr" ) |
1147 |
- fi |
1148 |
- # enable gd last, so configure can pick up the previous settings |
1149 |
- our_conf+=( $(use_with gd gd) ) |
1150 |
- |
1151 |
- # IMAP support |
1152 |
- if use imap ; then |
1153 |
- our_conf+=( |
1154 |
- $(use_with imap imap "${EPREFIX}/usr") |
1155 |
- $(use_with ssl imap-ssl "${EPREFIX}/usr") |
1156 |
- ) |
1157 |
- fi |
1158 |
- |
1159 |
- # Interbase/firebird support |
1160 |
- our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") ) |
1161 |
- |
1162 |
- # LDAP support |
1163 |
- if use ldap ; then |
1164 |
- our_conf+=( |
1165 |
- $(use_with ldap ldap "${EPREFIX}/usr") |
1166 |
- $(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr") |
1167 |
- ) |
1168 |
- fi |
1169 |
- |
1170 |
- # MySQL support |
1171 |
- local mysqllib="mysqlnd" |
1172 |
- local mysqlilib="mysqlnd" |
1173 |
- |
1174 |
- our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") ) |
1175 |
- |
1176 |
- local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock" |
1177 |
- if use mysql || use mysqli ; then |
1178 |
- our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") ) |
1179 |
- fi |
1180 |
- |
1181 |
- # ODBC support |
1182 |
- our_conf+=( |
1183 |
- $(use_with odbc unixODBC "${EPREFIX}/usr") |
1184 |
- $(use_with iodbc iodbc "${EPREFIX}/usr") |
1185 |
- ) |
1186 |
- |
1187 |
- # Oracle support |
1188 |
- our_conf+=( $(use_with oci8-instant-client oci8) ) |
1189 |
- |
1190 |
- # PDO support |
1191 |
- if use pdo ; then |
1192 |
- our_conf+=( |
1193 |
- $(use_with mssql pdo-dblib "${EPREFIX}/usr") |
1194 |
- $(use_with mysql pdo-mysql "${mysqllib}") |
1195 |
- $(use_with postgres pdo-pgsql) |
1196 |
- $(use_with sqlite pdo-sqlite "${EPREFIX}/usr") |
1197 |
- $(use_with firebird pdo-firebird "${EPREFIX}/usr") |
1198 |
- $(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr") |
1199 |
- $(use_with oci8-instant-client pdo-oci) |
1200 |
- ) |
1201 |
- fi |
1202 |
- |
1203 |
- # readline/libedit support |
1204 |
- our_conf+=( |
1205 |
- $(use_with readline readline "${EPREFIX}/usr") |
1206 |
- $(use_with libedit libedit "${EPREFIX}/usr") |
1207 |
- ) |
1208 |
- |
1209 |
- # Session support |
1210 |
- if use session ; then |
1211 |
- our_conf+=( $(use_with session-mm mm "${EPREFIX}/usr") ) |
1212 |
- else |
1213 |
- our_conf+=( $(use_enable session session) ) |
1214 |
- fi |
1215 |
- |
1216 |
- # Use pic for shared modules such as apache2's mod_php |
1217 |
- our_conf+=( --with-pic ) |
1218 |
- |
1219 |
- # we use the system copy of pcre |
1220 |
- # --with-pcre-regex affects ext/pcre |
1221 |
- # --with-pcre-dir affects ext/filter and ext/zip |
1222 |
- # --with-pcre-valgrind cannot be enabled with system pcre |
1223 |
- our_conf+=( |
1224 |
- --with-pcre-regex="${EPREFIX}/usr" |
1225 |
- --with-pcre-dir="${EPREFIX}/usr" |
1226 |
- --without-pcre-valgrind |
1227 |
- $(use_with jit pcre-jit) |
1228 |
- ) |
1229 |
- |
1230 |
- # Catch CFLAGS problems |
1231 |
- # Fixes bug #14067. |
1232 |
- # Changed order to run it in reverse for bug #32022 and #12021. |
1233 |
- replace-cpu-flags "k6*" "i586" |
1234 |
- |
1235 |
- # Cache the ./configure test results between SAPIs. |
1236 |
- our_conf+=( --cache-file="${T}/config.cache" ) |
1237 |
- |
1238 |
- # Support user-passed configuration parameters |
1239 |
- our_conf+=( ${EXTRA_ECONF:-} ) |
1240 |
- |
1241 |
- # Support the Apache2 extras, they must be set globally for all |
1242 |
- # SAPIs to work correctly, especially for external PHP extensions |
1243 |
- |
1244 |
- local one_sapi |
1245 |
- local sapi |
1246 |
- mkdir -p "${WORKDIR}/sapis-build" || die |
1247 |
- for one_sapi in $SAPIS ; do |
1248 |
- use "${one_sapi}" || continue |
1249 |
- php_set_ini_dir "${one_sapi}" |
1250 |
- |
1251 |
- # The BUILD_DIR variable is used to determine where to output |
1252 |
- # the files that autotools creates. This was all originally |
1253 |
- # based on the autotools-utils eclass. |
1254 |
- BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}" |
1255 |
- cp -a "${S}" "${BUILD_DIR}" || die |
1256 |
- cd "${BUILD_DIR}" || die |
1257 |
- |
1258 |
- local sapi_conf=( |
1259 |
- --with-config-file-path="${PHP_INI_DIR}" |
1260 |
- --with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}" |
1261 |
- ) |
1262 |
- |
1263 |
- for sapi in $SAPIS ; do |
1264 |
- case "$sapi" in |
1265 |
- cli|cgi|embed|fpm|phpdbg) |
1266 |
- if [[ "${one_sapi}" == "${sapi}" ]] ; then |
1267 |
- sapi_conf+=( "--enable-${sapi}" ) |
1268 |
- if [[ "fpm" == "${sapi}" ]] ; then |
1269 |
- sapi_conf+=( |
1270 |
- $(use_with acl fpm-acl) |
1271 |
- $(use_with systemd fpm-systemd) |
1272 |
- ) |
1273 |
- fi |
1274 |
- else |
1275 |
- sapi_conf+=( "--disable-${sapi}" ) |
1276 |
- fi |
1277 |
- ;; |
1278 |
- |
1279 |
- apache2) |
1280 |
- if [[ "${one_sapi}" == "${sapi}" ]] ; then |
1281 |
- sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" ) |
1282 |
- else |
1283 |
- sapi_conf+=( --without-apxs2 ) |
1284 |
- fi |
1285 |
- ;; |
1286 |
- esac |
1287 |
- done |
1288 |
- |
1289 |
- # Construct the $myeconfargs array by concatenating $our_conf |
1290 |
- # (the common args) and $sapi_conf (the SAPI-specific args). |
1291 |
- local myeconfargs=( "${our_conf[@]}" ) |
1292 |
- myeconfargs+=( "${sapi_conf[@]}" ) |
1293 |
- |
1294 |
- pushd "${BUILD_DIR}" > /dev/null || die |
1295 |
- econf "${myeconfargs[@]}" |
1296 |
- popd > /dev/null || die |
1297 |
- done |
1298 |
-} |
1299 |
- |
1300 |
-src_compile() { |
1301 |
- # snmp seems to run during src_compile, too (bug #324739) |
1302 |
- addpredict /usr/share/snmp/mibs/.index #nowarn |
1303 |
- addpredict /var/lib/net-snmp/mib_indexes #nowarn |
1304 |
- |
1305 |
- local sapi |
1306 |
- for sapi in ${SAPIS} ; do |
1307 |
- if use "${sapi}"; then |
1308 |
- cd "${WORKDIR}/sapis-build/$sapi" || \ |
1309 |
- die "Failed to change dir to ${WORKDIR}/sapis-build/$1" |
1310 |
- emake |
1311 |
- fi |
1312 |
- done |
1313 |
-} |
1314 |
- |
1315 |
-src_install() { |
1316 |
- # see bug #324739 for what happens when we don't have that |
1317 |
- addpredict /usr/share/snmp/mibs/.index #nowarn |
1318 |
- |
1319 |
- # grab the first SAPI that got built and install common files from there |
1320 |
- local first_sapi="", sapi="" |
1321 |
- for sapi in $SAPIS ; do |
1322 |
- if use $sapi ; then |
1323 |
- first_sapi=$sapi |
1324 |
- break |
1325 |
- fi |
1326 |
- done |
1327 |
- |
1328 |
- # Makefile forgets to create this before trying to write to it... |
1329 |
- dodir "${PHP_DESTDIR#${EPREFIX}}/bin" |
1330 |
- |
1331 |
- # Install php environment (without any sapis) |
1332 |
- cd "${WORKDIR}/sapis-build/$first_sapi" || die |
1333 |
- emake INSTALL_ROOT="${D}" \ |
1334 |
- install-build install-headers install-programs |
1335 |
- |
1336 |
- local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)" |
1337 |
- |
1338 |
- # Create the directory where we'll put version-specific php scripts |
1339 |
- keepdir "/usr/share/php${PHP_MV}" |
1340 |
- |
1341 |
- local file="" |
1342 |
- local sapi_list="" |
1343 |
- |
1344 |
- for sapi in ${SAPIS}; do |
1345 |
- if use "${sapi}" ; then |
1346 |
- einfo "Installing SAPI: ${sapi}" |
1347 |
- cd "${WORKDIR}/sapis-build/${sapi}" || die |
1348 |
- |
1349 |
- if [[ "${sapi}" == "apache2" ]] ; then |
1350 |
- # We're specifically not using emake install-sapi as libtool |
1351 |
- # may cause unnecessary relink failures (see bug #351266) |
1352 |
- insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/" |
1353 |
- newins ".libs/libphp${PHP_MV}$(get_libname)" \ |
1354 |
- "libphp${PHP_MV}$(get_libname)" |
1355 |
- keepdir "/usr/$(get_libdir)/apache2/modules" |
1356 |
- else |
1357 |
- # needed each time, php_install_ini would reset it |
1358 |
- local dest="${PHP_DESTDIR#${EPREFIX}}" |
1359 |
- into "${dest}" |
1360 |
- case "$sapi" in |
1361 |
- cli) |
1362 |
- source="sapi/cli/php" |
1363 |
- # Install the "phar" archive utility. |
1364 |
- if use phar ; then |
1365 |
- emake INSTALL_ROOT="${D}" install-pharcmd |
1366 |
- dosym "..${dest#/usr}/bin/phar" "/usr/bin/phar${SLOT}" |
1367 |
- fi |
1368 |
- ;; |
1369 |
- cgi) |
1370 |
- source="sapi/cgi/php-cgi" |
1371 |
- ;; |
1372 |
- fpm) |
1373 |
- source="sapi/fpm/php-fpm" |
1374 |
- ;; |
1375 |
- embed) |
1376 |
- source="libs/libphp${PHP_MV}$(get_libname)" |
1377 |
- ;; |
1378 |
- phpdbg) |
1379 |
- source="sapi/phpdbg/phpdbg" |
1380 |
- ;; |
1381 |
- *) |
1382 |
- die "unhandled sapi in src_install" |
1383 |
- ;; |
1384 |
- esac |
1385 |
- |
1386 |
- if [[ "${source}" == *"$(get_libname)" ]]; then |
1387 |
- dolib.so "${source}" |
1388 |
- else |
1389 |
- dobin "${source}" |
1390 |
- local name="$(basename ${source})" |
1391 |
- dosym "..${dest#/usr}/bin/${name}" "/usr/bin/${name}${SLOT}" |
1392 |
- fi |
1393 |
- fi |
1394 |
- |
1395 |
- php_install_ini "${sapi}" |
1396 |
- |
1397 |
- # construct correct SAPI string for php-config |
1398 |
- # thanks to ferringb for the bash voodoo |
1399 |
- if [[ "${sapi}" == "apache2" ]]; then |
1400 |
- sapi_list="${sapi_list:+${sapi_list} }apache2handler" |
1401 |
- else |
1402 |
- sapi_list="${sapi_list:+${sapi_list} }${sapi}" |
1403 |
- fi |
1404 |
- fi |
1405 |
- done |
1406 |
- |
1407 |
- # Installing opcache module |
1408 |
- if use opcache ; then |
1409 |
- into "${PHP_DESTDIR#${EPREFIX}}" |
1410 |
- dolib.so "modules/opcache$(get_libname)" |
1411 |
- fi |
1412 |
- |
1413 |
- # Install env.d files |
1414 |
- newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}" |
1415 |
- sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die |
1416 |
- sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die |
1417 |
- |
1418 |
- # set php-config variable correctly (bug #278439) |
1419 |
- sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \ |
1420 |
- "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die |
1421 |
- |
1422 |
- if use fpm ; then |
1423 |
- if use systemd; then |
1424 |
- systemd_newunit "${FILESDIR}/php-fpm_at.service" \ |
1425 |
- "php-fpm@${SLOT}.service" |
1426 |
- else |
1427 |
- systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \ |
1428 |
- "php-fpm@${SLOT}.service" |
1429 |
- fi |
1430 |
- fi |
1431 |
-} |
1432 |
- |
1433 |
-src_test() { |
1434 |
- echo ">>> Test phase [test]: ${CATEGORY}/${PF}" |
1435 |
- PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php" |
1436 |
- if [[ ! -x "${PHP_BIN}" ]] ; then |
1437 |
- ewarn "Test phase requires USE=cli, skipping" |
1438 |
- return |
1439 |
- else |
1440 |
- export TEST_PHP_EXECUTABLE="${PHP_BIN}" |
1441 |
- fi |
1442 |
- |
1443 |
- if [[ -x "${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" ]] ; then |
1444 |
- export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" |
1445 |
- fi |
1446 |
- |
1447 |
- if [[ -x "${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" ]] ; then |
1448 |
- export TEST_PHPDBG_EXECUTABLE="${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" |
1449 |
- fi |
1450 |
- |
1451 |
- REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \ |
1452 |
- "session.save_path=${T}" \ |
1453 |
- "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \ |
1454 |
- "session.save_path=${T}" |
1455 |
- |
1456 |
- for name in ${EXPECTED_TEST_FAILURES}; do |
1457 |
- mv "${name}.out" "${name}.out.orig" 2>/dev/null || die |
1458 |
- done |
1459 |
- |
1460 |
- local failed="$(find -name '*.out')" |
1461 |
- if [[ ${failed} != "" ]] ; then |
1462 |
- ewarn "The following test cases failed unexpectedly:" |
1463 |
- for name in ${failed}; do |
1464 |
- ewarn " ${name/.out/}" |
1465 |
- done |
1466 |
- else |
1467 |
- einfo "No unexpected test failures, all fine" |
1468 |
- fi |
1469 |
- |
1470 |
- if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then |
1471 |
- local passed="" |
1472 |
- for name in ${EXPECTED_TEST_FAILURES}; do |
1473 |
- [[ -f "${name}.diff" ]] && continue |
1474 |
- passed="${passed} ${name}" |
1475 |
- done |
1476 |
- if [[ ${passed} != "" ]] ; then |
1477 |
- einfo "The following test cases passed unexpectedly:" |
1478 |
- for name in ${passed}; do |
1479 |
- ewarn " ${passed}" |
1480 |
- done |
1481 |
- else |
1482 |
- einfo "None of the known-to-fail tests passed, all fine" |
1483 |
- fi |
1484 |
- fi |
1485 |
-} |
1486 |
- |
1487 |
-pkg_postinst() { |
1488 |
- # Output some general info to the user |
1489 |
- if use apache2 ; then |
1490 |
- elog |
1491 |
- elog "To enable PHP in apache, you will need to add \"-D PHP\" to" |
1492 |
- elog "your apache2 command. OpenRC users can append that string to" |
1493 |
- elog "APACHE2_OPTS in /etc/conf.d/apache2." |
1494 |
- elog |
1495 |
- elog "The apache module configuration file 70_mod_php.conf is" |
1496 |
- elog "provided (and maintained) by eselect-php." |
1497 |
- elog |
1498 |
- fi |
1499 |
- |
1500 |
- # Create the symlinks for php |
1501 |
- local m |
1502 |
- for m in ${SAPIS}; do |
1503 |
- [[ ${m} == 'embed' ]] && continue; |
1504 |
- if use $m ; then |
1505 |
- local ci=$(eselect php show $m) |
1506 |
- if [[ -z $ci ]]; then |
1507 |
- eselect php set $m php${SLOT} || die |
1508 |
- einfo "Switched ${m} to use php:${SLOT}" |
1509 |
- einfo |
1510 |
- elif [[ $ci != "php${SLOT}" ]] ; then |
1511 |
- elog "To switch $m to use php:${SLOT}, run" |
1512 |
- elog " eselect php set $m php${SLOT}" |
1513 |
- elog |
1514 |
- fi |
1515 |
- fi |
1516 |
- done |
1517 |
- |
1518 |
- # Remove dead symlinks for SAPIs that were just disabled. For |
1519 |
- # example, if the user has the cgi SAPI enabled, then he has an |
1520 |
- # eselect-php symlink for it. If he later reinstalls PHP with |
1521 |
- # USE="-cgi", that symlink will break. This call to eselect is |
1522 |
- # supposed to remove that dead link per bug 572436. |
1523 |
- eselect php cleanup || die |
1524 |
- |
1525 |
- if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then |
1526 |
- elog "To build extensions for this version of PHP, you will need to" |
1527 |
- elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable." |
1528 |
- elog |
1529 |
- fi |
1530 |
- |
1531 |
- # Warn about the removal of PHP_INI_VERSION if the user has it set. |
1532 |
- if [[ -n "${PHP_INI_VERSION}" ]]; then |
1533 |
- ewarn 'The PHP_INI_VERSION variable has been phased out. You may' |
1534 |
- ewarn 'remove it from your configuration at your convenience. See' |
1535 |
- ewarn |
1536 |
- ewarn ' https://bugs.gentoo.org/611214' |
1537 |
- ewarn |
1538 |
- ewarn 'for more information.' |
1539 |
- fi |
1540 |
- |
1541 |
- elog "For details on how version slotting works, please see" |
1542 |
- elog "the wiki:" |
1543 |
- elog |
1544 |
- elog " https://wiki.gentoo.org/wiki/PHP" |
1545 |
- elog |
1546 |
-} |
1547 |
- |
1548 |
-pkg_postrm() { |
1549 |
- # This serves two purposes. First, if we have just removed the last |
1550 |
- # installed version of PHP, then this will remove any dead symlinks |
1551 |
- # belonging to eselect-php. Second, if a user upgrades slots from |
1552 |
- # (say) 5.6 to 7.0 and depcleans the old slot, then this will update |
1553 |
- # his existing symlinks to point to the new 7.0 installation. The |
1554 |
- # latter is bug 432962. |
1555 |
- # |
1556 |
- # Note: the eselect-php package may not be installed at this point, |
1557 |
- # so we can't die() if this command fails. |
1558 |
- eselect php cleanup |
1559 |
-} |
1560 |
|
1561 |
diff --git a/dev-lang/php/php-7.4.24.ebuild b/dev-lang/php/php-7.4.24.ebuild |
1562 |
deleted file mode 100644 |
1563 |
index 04b3de5679e..00000000000 |
1564 |
--- a/dev-lang/php/php-7.4.24.ebuild |
1565 |
+++ /dev/null |
1566 |
@@ -1,750 +0,0 @@ |
1567 |
-# Copyright 1999-2021 Gentoo Authors |
1568 |
-# Distributed under the terms of the GNU General Public License v2 |
1569 |
- |
1570 |
-EAPI="7" |
1571 |
- |
1572 |
-WANT_AUTOMAKE="none" |
1573 |
- |
1574 |
-inherit flag-o-matic systemd autotools |
1575 |
- |
1576 |
-MY_PV=${PV/_rc/RC} |
1577 |
-DESCRIPTION="The PHP language runtime engine" |
1578 |
-HOMEPAGE="https://www.php.net/" |
1579 |
-SRC_URI="https://www.php.net/distributions/${P}.tar.xz" |
1580 |
- |
1581 |
-LICENSE="PHP-3.01 |
1582 |
- BSD |
1583 |
- Zend-2.0 |
1584 |
- bcmath? ( LGPL-2.1+ ) |
1585 |
- fpm? ( BSD-2 ) |
1586 |
- gd? ( gd ) |
1587 |
- unicode? ( BSD-2 LGPL-2.1 )" |
1588 |
- |
1589 |
-SLOT="$(ver_cut 1-2)" |
1590 |
-KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos" |
1591 |
- |
1592 |
-S="${WORKDIR}/${PN}-${MY_PV}" |
1593 |
- |
1594 |
-# We can build the following SAPIs in the given order |
1595 |
-SAPIS="embed cli cgi fpm apache2 phpdbg" |
1596 |
- |
1597 |
-# SAPIs and SAPI-specific USE flags (cli SAPI is default on): |
1598 |
-IUSE="${IUSE} |
1599 |
- ${SAPIS/cli/+cli} |
1600 |
- threads" |
1601 |
- |
1602 |
-IUSE="${IUSE} acl argon2 bcmath berkdb bzip2 calendar cdb cjk |
1603 |
- coverage +ctype curl debug |
1604 |
- enchant exif ffi +fileinfo +filter firebird |
1605 |
- +flatfile ftp gd gdbm gmp +iconv imap inifile |
1606 |
- intl iodbc ipv6 +jit +json kerberos ldap ldap-sasl libedit lmdb |
1607 |
- mhash mssql mysql mysqli nls |
1608 |
- oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm |
1609 |
- readline selinux +session session-mm sharedmem |
1610 |
- +simplexml snmp soap sockets sodium spell sqlite ssl |
1611 |
- sysvipc systemd test tidy +tokenizer tokyocabinet truetype unicode webp |
1612 |
- +xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib" |
1613 |
- |
1614 |
-# Without USE=readline or libedit, the interactive "php -a" CLI will hang. |
1615 |
-# The Oracle instant client provides its own incompatible ldap library. |
1616 |
-REQUIRED_USE=" |
1617 |
- || ( cli cgi fpm apache2 embed phpdbg ) |
1618 |
- cli? ( ^^ ( readline libedit ) ) |
1619 |
- !cli? ( ?? ( readline libedit ) ) |
1620 |
- truetype? ( gd zlib ) |
1621 |
- webp? ( gd zlib ) |
1622 |
- cjk? ( gd zlib ) |
1623 |
- exif? ( gd zlib ) |
1624 |
- xpm? ( gd zlib ) |
1625 |
- gd? ( zlib ) |
1626 |
- simplexml? ( xml ) |
1627 |
- soap? ( xml ) |
1628 |
- xmlrpc? ( xml iconv ) |
1629 |
- xmlreader? ( xml ) |
1630 |
- xmlwriter? ( xml ) |
1631 |
- xslt? ( xml ) |
1632 |
- ldap-sasl? ( ldap ) |
1633 |
- oci8-instant-client? ( !ldap ) |
1634 |
- qdbm? ( !gdbm ) |
1635 |
- session-mm? ( session !threads ) |
1636 |
- mysql? ( || ( mysqli pdo ) ) |
1637 |
- firebird? ( pdo ) |
1638 |
- mssql? ( pdo ) |
1639 |
-" |
1640 |
- |
1641 |
-RESTRICT="!test? ( test )" |
1642 |
- |
1643 |
-# The supported (that is, autodetected) versions of BDB are listed in |
1644 |
-# the ./configure script. Other versions *work*, but we need to stick to |
1645 |
-# the ones that can be detected to avoid a repeat of bug #564824. |
1646 |
-COMMON_DEPEND=" |
1647 |
- >=app-eselect/eselect-php-0.9.1[apache2?,fpm?] |
1648 |
- >=dev-libs/libpcre2-10.30[jit?,unicode] |
1649 |
- fpm? ( acl? ( sys-apps/acl ) ) |
1650 |
- apache2? ( www-servers/apache[apache2_modules_unixd(+),threads=] ) |
1651 |
- argon2? ( app-crypt/argon2:= ) |
1652 |
- berkdb? ( || ( sys-libs/db:5.3 |
1653 |
- sys-libs/db:5.1 |
1654 |
- sys-libs/db:4.8 |
1655 |
- sys-libs/db:4.7 |
1656 |
- sys-libs/db:4.6 |
1657 |
- sys-libs/db:4.5 ) ) |
1658 |
- bzip2? ( app-arch/bzip2:0= ) |
1659 |
- cdb? ( || ( dev-db/cdb dev-db/tinycdb ) ) |
1660 |
- coverage? ( dev-util/lcov ) |
1661 |
- curl? ( >=net-misc/curl-7.10.5 ) |
1662 |
- enchant? ( <app-text/enchant-2.0:0 ) |
1663 |
- ffi? ( >=dev-libs/libffi-3.0.11:= ) |
1664 |
- firebird? ( dev-db/firebird ) |
1665 |
- gd? ( >=virtual/jpeg-0-r3:0 media-libs/libpng:0= ) |
1666 |
- gdbm? ( >=sys-libs/gdbm-1.8.0:0= ) |
1667 |
- gmp? ( dev-libs/gmp:0= ) |
1668 |
- iconv? ( virtual/libiconv ) |
1669 |
- imap? ( >=virtual/imap-c-client-2[kerberos=,ssl=] ) |
1670 |
- intl? ( dev-libs/icu:= ) |
1671 |
- kerberos? ( virtual/krb5 ) |
1672 |
- ldap? ( >=net-nds/openldap-1.2.11 ) |
1673 |
- ldap-sasl? ( dev-libs/cyrus-sasl ) |
1674 |
- libedit? ( dev-libs/libedit ) |
1675 |
- lmdb? ( dev-db/lmdb:= ) |
1676 |
- mssql? ( dev-db/freetds[mssql] ) |
1677 |
- nls? ( sys-devel/gettext ) |
1678 |
- oci8-instant-client? ( dev-db/oracle-instantclient[sdk] ) |
1679 |
- odbc? ( iodbc? ( dev-db/libiodbc ) !iodbc? ( >=dev-db/unixODBC-1.8.13 ) ) |
1680 |
- postgres? ( dev-db/postgresql:* ) |
1681 |
- qdbm? ( dev-db/qdbm ) |
1682 |
- readline? ( sys-libs/readline:0= ) |
1683 |
- session-mm? ( dev-libs/mm ) |
1684 |
- snmp? ( >=net-analyzer/net-snmp-5.2 ) |
1685 |
- sodium? ( dev-libs/libsodium:=[-minimal] ) |
1686 |
- spell? ( >=app-text/aspell-0.50 ) |
1687 |
- sqlite? ( >=dev-db/sqlite-3.7.6.3 ) |
1688 |
- ssl? ( >=dev-libs/openssl-1.0.1:0= ) |
1689 |
- tidy? ( || ( app-text/tidy-html5 app-text/htmltidy ) ) |
1690 |
- tokyocabinet? ( dev-db/tokyocabinet ) |
1691 |
- truetype? ( =media-libs/freetype-2* ) |
1692 |
- unicode? ( dev-libs/oniguruma:= ) |
1693 |
- webp? ( media-libs/libwebp:0= ) |
1694 |
- xml? ( >=dev-libs/libxml2-2.7.6 ) |
1695 |
- xpm? ( x11-libs/libXpm ) |
1696 |
- xslt? ( dev-libs/libxslt ) |
1697 |
- zip? ( >=dev-libs/libzip-1.2.0:= ) |
1698 |
- zlib? ( >=sys-libs/zlib-1.2.0.4:0= ) |
1699 |
-" |
1700 |
- |
1701 |
-RDEPEND="${COMMON_DEPEND} |
1702 |
- virtual/mta |
1703 |
- fpm? ( |
1704 |
- selinux? ( sec-policy/selinux-phpfpm ) |
1705 |
- systemd? ( sys-apps/systemd ) )" |
1706 |
- |
1707 |
-# Bison isn't actually needed when building from a release tarball |
1708 |
-# However, the configure script will warn if it's absent or if you |
1709 |
-# have an incompatible version installed. See bug 593278. |
1710 |
-DEPEND="${COMMON_DEPEND} |
1711 |
- app-arch/xz-utils |
1712 |
- >=sys-devel/bison-3.0.1" |
1713 |
- |
1714 |
-BDEPEND="virtual/pkgconfig" |
1715 |
- |
1716 |
-PHP_MV="$(ver_cut 1)" |
1717 |
- |
1718 |
-PATCHES=( |
1719 |
- "${FILESDIR}"/php-iodbc-header-location.patch |
1720 |
-) |
1721 |
- |
1722 |
-php_install_ini() { |
1723 |
- local phpsapi="${1}" |
1724 |
- |
1725 |
- # work out where we are installing the ini file |
1726 |
- php_set_ini_dir "${phpsapi}" |
1727 |
- |
1728 |
- # Always install the production INI file, bug 611214. |
1729 |
- local phpinisrc="php.ini-production-${phpsapi}" |
1730 |
- cp php.ini-production "${phpinisrc}" || die |
1731 |
- |
1732 |
- # default to /tmp for save_path, bug #282768 |
1733 |
- sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die |
1734 |
- |
1735 |
- # Set the extension dir |
1736 |
- sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \ |
1737 |
- -i "${phpinisrc}" || die |
1738 |
- |
1739 |
- # Set the include path to point to where we want to find PEAR packages |
1740 |
- sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die |
1741 |
- |
1742 |
- insinto "${PHP_INI_DIR#${EPREFIX}}" |
1743 |
- newins "${phpinisrc}" php.ini |
1744 |
- |
1745 |
- elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}" |
1746 |
- elog |
1747 |
- |
1748 |
- dodir "${PHP_EXT_INI_DIR#${EPREFIX}}" |
1749 |
- dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}" |
1750 |
- |
1751 |
- if use opcache; then |
1752 |
- elog "Adding opcache to $PHP_EXT_INI_DIR" |
1753 |
- echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \ |
1754 |
- "${D}/${PHP_EXT_INI_DIR}"/opcache.ini |
1755 |
- dosym "../ext/opcache.ini" \ |
1756 |
- "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini" |
1757 |
- fi |
1758 |
- |
1759 |
- # SAPI-specific handling |
1760 |
- if [[ "${sapi}" == "fpm" ]] ; then |
1761 |
- einfo "Installing FPM config files php-fpm.conf and www.conf" |
1762 |
- insinto "${PHP_INI_DIR#${EPREFIX}}" |
1763 |
- doins sapi/fpm/php-fpm.conf |
1764 |
- insinto "${PHP_INI_DIR#${EPREFIX}}/fpm.d" |
1765 |
- doins sapi/fpm/www.conf |
1766 |
- fi |
1767 |
- |
1768 |
- dodoc php.ini-{development,production} |
1769 |
-} |
1770 |
- |
1771 |
-php_set_ini_dir() { |
1772 |
- PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}" |
1773 |
- PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext" |
1774 |
- PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active" |
1775 |
-} |
1776 |
- |
1777 |
-src_prepare() { |
1778 |
- default |
1779 |
- |
1780 |
- # In php-7.x, the FPM pool configuration files have been split off |
1781 |
- # of the main config. By default the pool config files go in |
1782 |
- # e.g. /etc/php-fpm.d, which isn't slotted. So here we move the |
1783 |
- # include directory to a subdirectory "fpm.d" of $PHP_INI_DIR. Later |
1784 |
- # we'll install the pool configuration file "www.conf" there. |
1785 |
- php_set_ini_dir fpm |
1786 |
- sed -i "s~^include=.*$~include=${PHP_INI_DIR}/fpm.d/*.conf~" \ |
1787 |
- sapi/fpm/php-fpm.conf.in \ |
1788 |
- || die 'failed to move the include directory in php-fpm.conf' |
1789 |
- |
1790 |
- # Emulate buildconf to support cross-compilation |
1791 |
- rm -fr aclocal.m4 autom4te.cache config.cache \ |
1792 |
- configure main/php_config.h.in || die |
1793 |
- eautoconf --force |
1794 |
- eautoheader |
1795 |
-} |
1796 |
- |
1797 |
-src_configure() { |
1798 |
- addpredict /usr/share/snmp/mibs/.index #nowarn |
1799 |
- addpredict /var/lib/net-snmp/mib_indexes #nowarn |
1800 |
- |
1801 |
- PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}" |
1802 |
- |
1803 |
- # The php-fpm config file wants localstatedir to be ${EPREFIX}/var |
1804 |
- # and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002. |
1805 |
- local our_conf=( |
1806 |
- --prefix="${PHP_DESTDIR}" |
1807 |
- --mandir="${PHP_DESTDIR}/man" |
1808 |
- --infodir="${PHP_DESTDIR}/info" |
1809 |
- --libdir="${PHP_DESTDIR}/lib" |
1810 |
- --with-libdir="$(get_libdir)" |
1811 |
- --localstatedir="${EPREFIX}/var" |
1812 |
- --without-pear |
1813 |
- $(use_enable threads maintainer-zts) |
1814 |
- ) |
1815 |
- |
1816 |
- our_conf+=( |
1817 |
- $(use_with argon2 password-argon2 "${EPREFIX}/usr") |
1818 |
- $(use_enable bcmath) |
1819 |
- $(use_with bzip2 bz2 "${EPREFIX}/usr") |
1820 |
- $(use_enable calendar) |
1821 |
- $(use_enable coverage gcov) |
1822 |
- $(use_enable ctype) |
1823 |
- $(use_with curl) |
1824 |
- $(use_enable xml dom) |
1825 |
- $(use_with enchant) |
1826 |
- $(use_enable exif) |
1827 |
- $(use_with ffi) |
1828 |
- $(use_enable fileinfo) |
1829 |
- $(use_enable filter) |
1830 |
- $(use_enable ftp) |
1831 |
- $(use_with nls gettext "${EPREFIX}/usr") |
1832 |
- $(use_with gmp gmp "${EPREFIX}/usr") |
1833 |
- $(use_with mhash mhash "${EPREFIX}/usr") |
1834 |
- $(use_with iconv iconv \ |
1835 |
- $(use elibc_glibc || use elibc_musl || use elibc_FreeBSD || echo "${EPREFIX}/usr")) |
1836 |
- $(use_enable intl) |
1837 |
- $(use_enable ipv6) |
1838 |
- $(use_enable json) |
1839 |
- $(use_with kerberos) |
1840 |
- $(use_with xml libxml) |
1841 |
- $(use_enable unicode mbstring) |
1842 |
- $(use_with ssl openssl) |
1843 |
- $(use_enable pcntl) |
1844 |
- $(use_enable phar) |
1845 |
- $(use_enable pdo) |
1846 |
- $(use_enable opcache) |
1847 |
- $(use_with postgres pgsql "${EPREFIX}/usr") |
1848 |
- $(use_enable posix) |
1849 |
- $(use_with spell pspell "${EPREFIX}/usr") |
1850 |
- $(use_enable simplexml) |
1851 |
- $(use_enable sharedmem shmop) |
1852 |
- $(use_with snmp snmp "${EPREFIX}/usr") |
1853 |
- $(use_enable soap) |
1854 |
- $(use_enable sockets) |
1855 |
- $(use_with sodium) |
1856 |
- $(use_with sqlite sqlite3) |
1857 |
- $(use_enable sysvipc sysvmsg) |
1858 |
- $(use_enable sysvipc sysvsem) |
1859 |
- $(use_enable sysvipc sysvshm) |
1860 |
- $(use_with tidy tidy "${EPREFIX}/usr") |
1861 |
- $(use_enable tokenizer) |
1862 |
- $(use_enable xml) |
1863 |
- $(use_enable xmlreader) |
1864 |
- $(use_enable xmlwriter) |
1865 |
- $(use_with xmlrpc) |
1866 |
- $(use_with xslt xsl) |
1867 |
- $(use_with zip) |
1868 |
- $(use_with zlib zlib "${EPREFIX}/usr") |
1869 |
- $(use_enable debug) |
1870 |
- ) |
1871 |
- |
1872 |
- # DBA support |
1873 |
- if use cdb || use berkdb || use flatfile || use gdbm || use inifile \ |
1874 |
- || use qdbm || use lmdb || use tokyocabinet ; then |
1875 |
- our_conf+=( "--enable-dba" ) |
1876 |
- fi |
1877 |
- |
1878 |
- # DBA drivers support |
1879 |
- our_conf+=( |
1880 |
- $(use_with cdb) |
1881 |
- $(use_with berkdb db4 "${EPREFIX}/usr") |
1882 |
- $(use_enable flatfile) |
1883 |
- $(use_with gdbm gdbm "${EPREFIX}/usr") |
1884 |
- $(use_enable inifile) |
1885 |
- $(use_with qdbm qdbm "${EPREFIX}/usr") |
1886 |
- $(use_with tokyocabinet tcadb "${EPREFIX}/usr") |
1887 |
- $(use_with lmdb lmdb "${EPREFIX}/usr") |
1888 |
- ) |
1889 |
- |
1890 |
- # Support for the GD graphics library |
1891 |
- our_conf+=( |
1892 |
- $(use_with truetype freetype) |
1893 |
- $(use_enable cjk gd-jis-conv) |
1894 |
- $(use_with gd jpeg) |
1895 |
- $(use_with xpm) |
1896 |
- $(use_with webp) |
1897 |
- ) |
1898 |
- # enable gd last, so configure can pick up the previous settings |
1899 |
- our_conf+=( $(use_enable gd) ) |
1900 |
- |
1901 |
- # IMAP support |
1902 |
- if use imap ; then |
1903 |
- our_conf+=( |
1904 |
- $(use_with imap imap "${EPREFIX}/usr") |
1905 |
- $(use_with ssl imap-ssl "${EPREFIX}/usr") |
1906 |
- ) |
1907 |
- fi |
1908 |
- |
1909 |
- # LDAP support |
1910 |
- if use ldap ; then |
1911 |
- our_conf+=( |
1912 |
- $(use_with ldap ldap "${EPREFIX}/usr") |
1913 |
- $(use_with ldap-sasl) |
1914 |
- ) |
1915 |
- fi |
1916 |
- |
1917 |
- # MySQL support |
1918 |
- local mysqllib="mysqlnd" |
1919 |
- local mysqlilib="mysqlnd" |
1920 |
- |
1921 |
- our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") ) |
1922 |
- |
1923 |
- local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock" |
1924 |
- if use mysql || use mysqli ; then |
1925 |
- our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") ) |
1926 |
- fi |
1927 |
- |
1928 |
- # ODBC support |
1929 |
- if use odbc && use iodbc ; then |
1930 |
- our_conf+=( |
1931 |
- --without-unixODBC |
1932 |
- --with-iodbc |
1933 |
- $(use_with pdo pdo-odbc "iODBC,${EPREFIX}/usr") |
1934 |
- ) |
1935 |
- elif use odbc ; then |
1936 |
- our_conf+=( |
1937 |
- --with-unixODBC="${EPREFIX}/usr" |
1938 |
- --without-iodbc |
1939 |
- $(use_with pdo pdo-odbc "unixODBC,${EPREFIX}/usr") |
1940 |
- ) |
1941 |
- else |
1942 |
- our_conf+=( |
1943 |
- --without-unixODBC |
1944 |
- --without-iodbc |
1945 |
- --without-pdo-odbc |
1946 |
- ) |
1947 |
- fi |
1948 |
- |
1949 |
- # Oracle support |
1950 |
- our_conf+=( $(use_with oci8-instant-client oci8) ) |
1951 |
- |
1952 |
- # PDO support |
1953 |
- if use pdo ; then |
1954 |
- our_conf+=( |
1955 |
- $(use_with mssql pdo-dblib "${EPREFIX}/usr") |
1956 |
- $(use_with mysql pdo-mysql "${mysqllib}") |
1957 |
- $(use_with postgres pdo-pgsql) |
1958 |
- $(use_with sqlite pdo-sqlite) |
1959 |
- $(use_with firebird pdo-firebird "${EPREFIX}/usr") |
1960 |
- $(use_with oci8-instant-client pdo-oci) |
1961 |
- ) |
1962 |
- fi |
1963 |
- |
1964 |
- # readline/libedit support |
1965 |
- our_conf+=( |
1966 |
- $(use_with readline readline "${EPREFIX}/usr") |
1967 |
- $(use_with libedit) |
1968 |
- ) |
1969 |
- |
1970 |
- # Session support |
1971 |
- if use session ; then |
1972 |
- our_conf+=( $(use_with session-mm mm "${EPREFIX}/usr") ) |
1973 |
- else |
1974 |
- our_conf+=( $(use_enable session) ) |
1975 |
- fi |
1976 |
- |
1977 |
- # Use pic for shared modules such as apache2's mod_php |
1978 |
- our_conf+=( --with-pic ) |
1979 |
- |
1980 |
- # we use the system copy of pcre |
1981 |
- # --with-external-pcre affects ext/pcre |
1982 |
- our_conf+=( |
1983 |
- --with-external-pcre |
1984 |
- $(use_with jit pcre-jit) |
1985 |
- ) |
1986 |
- |
1987 |
- # Catch CFLAGS problems |
1988 |
- # Fixes bug #14067. |
1989 |
- # Changed order to run it in reverse for bug #32022 and #12021. |
1990 |
- replace-cpu-flags "k6*" "i586" |
1991 |
- |
1992 |
- # Cache the ./configure test results between SAPIs. |
1993 |
- our_conf+=( --cache-file="${T}/config.cache" ) |
1994 |
- |
1995 |
- # Support user-passed configuration parameters |
1996 |
- our_conf+=( ${EXTRA_ECONF:-} ) |
1997 |
- |
1998 |
- # Support the Apache2 extras, they must be set globally for all |
1999 |
- # SAPIs to work correctly, especially for external PHP extensions |
2000 |
- |
2001 |
- local one_sapi |
2002 |
- local sapi |
2003 |
- mkdir -p "${WORKDIR}/sapis-build" || die |
2004 |
- for one_sapi in $SAPIS ; do |
2005 |
- use "${one_sapi}" || continue |
2006 |
- php_set_ini_dir "${one_sapi}" |
2007 |
- |
2008 |
- # The BUILD_DIR variable is used to determine where to output |
2009 |
- # the files that autotools creates. This was all originally |
2010 |
- # based on the autotools-utils eclass. |
2011 |
- BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}" |
2012 |
- cp -a "${S}" "${BUILD_DIR}" || die |
2013 |
- cd "${BUILD_DIR}" || die |
2014 |
- |
2015 |
- local sapi_conf=( |
2016 |
- --with-config-file-path="${PHP_INI_DIR}" |
2017 |
- --with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}" |
2018 |
- ) |
2019 |
- |
2020 |
- for sapi in $SAPIS ; do |
2021 |
- case "$sapi" in |
2022 |
- cli|cgi|embed|fpm|phpdbg) |
2023 |
- if [[ "${one_sapi}" == "${sapi}" ]] ; then |
2024 |
- sapi_conf+=( "--enable-${sapi}" ) |
2025 |
- if [[ "fpm" == "${sapi}" ]] ; then |
2026 |
- sapi_conf+=( |
2027 |
- $(use_with acl fpm-acl) |
2028 |
- $(use_with systemd fpm-systemd) |
2029 |
- ) |
2030 |
- fi |
2031 |
- else |
2032 |
- sapi_conf+=( "--disable-${sapi}" ) |
2033 |
- fi |
2034 |
- ;; |
2035 |
- |
2036 |
- apache2) |
2037 |
- if [[ "${one_sapi}" == "${sapi}" ]] ; then |
2038 |
- sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" ) |
2039 |
- else |
2040 |
- sapi_conf+=( --without-apxs2 ) |
2041 |
- fi |
2042 |
- ;; |
2043 |
- esac |
2044 |
- done |
2045 |
- |
2046 |
- # Construct the $myeconfargs array by concatenating $our_conf |
2047 |
- # (the common args) and $sapi_conf (the SAPI-specific args). |
2048 |
- local myeconfargs=( "${our_conf[@]}" ) |
2049 |
- myeconfargs+=( "${sapi_conf[@]}" ) |
2050 |
- |
2051 |
- pushd "${BUILD_DIR}" > /dev/null || die |
2052 |
- econf "${myeconfargs[@]}" |
2053 |
- popd > /dev/null || die |
2054 |
- done |
2055 |
-} |
2056 |
- |
2057 |
-src_compile() { |
2058 |
- # snmp seems to run during src_compile, too (bug #324739) |
2059 |
- addpredict /usr/share/snmp/mibs/.index #nowarn |
2060 |
- addpredict /var/lib/net-snmp/mib_indexes #nowarn |
2061 |
- |
2062 |
- local sapi |
2063 |
- for sapi in ${SAPIS} ; do |
2064 |
- if use "${sapi}"; then |
2065 |
- cd "${WORKDIR}/sapis-build/$sapi" || \ |
2066 |
- die "Failed to change dir to ${WORKDIR}/sapis-build/$1" |
2067 |
- emake |
2068 |
- fi |
2069 |
- done |
2070 |
-} |
2071 |
- |
2072 |
-src_install() { |
2073 |
- # see bug #324739 for what happens when we don't have that |
2074 |
- addpredict /usr/share/snmp/mibs/.index #nowarn |
2075 |
- |
2076 |
- # grab the first SAPI that got built and install common files from there |
2077 |
- local first_sapi="", sapi="" |
2078 |
- for sapi in $SAPIS ; do |
2079 |
- if use $sapi ; then |
2080 |
- first_sapi=$sapi |
2081 |
- break |
2082 |
- fi |
2083 |
- done |
2084 |
- |
2085 |
- # Makefile forgets to create this before trying to write to it... |
2086 |
- dodir "${PHP_DESTDIR#${EPREFIX}}/bin" |
2087 |
- |
2088 |
- # Install php environment (without any sapis) |
2089 |
- cd "${WORKDIR}/sapis-build/$first_sapi" || die |
2090 |
- emake INSTALL_ROOT="${D}" \ |
2091 |
- install-build install-headers install-programs |
2092 |
- |
2093 |
- local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)" |
2094 |
- |
2095 |
- # Create the directory where we'll put version-specific php scripts |
2096 |
- keepdir "/usr/share/php${PHP_MV}" |
2097 |
- |
2098 |
- local file="" |
2099 |
- local sapi_list="" |
2100 |
- |
2101 |
- for sapi in ${SAPIS}; do |
2102 |
- if use "${sapi}" ; then |
2103 |
- einfo "Installing SAPI: ${sapi}" |
2104 |
- cd "${WORKDIR}/sapis-build/${sapi}" || die |
2105 |
- |
2106 |
- if [[ "${sapi}" == "apache2" ]] ; then |
2107 |
- # We're specifically not using emake install-sapi as libtool |
2108 |
- # may cause unnecessary relink failures (see bug #351266) |
2109 |
- insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/" |
2110 |
- newins ".libs/libphp${PHP_MV}$(get_libname)" \ |
2111 |
- "libphp${PHP_MV}$(get_libname)" |
2112 |
- keepdir "/usr/$(get_libdir)/apache2/modules" |
2113 |
- else |
2114 |
- # needed each time, php_install_ini would reset it |
2115 |
- local dest="${PHP_DESTDIR#${EPREFIX}}" |
2116 |
- into "${dest}" |
2117 |
- case "$sapi" in |
2118 |
- cli) |
2119 |
- source="sapi/cli/php" |
2120 |
- # Install the "phar" archive utility. |
2121 |
- if use phar ; then |
2122 |
- emake INSTALL_ROOT="${D}" install-pharcmd |
2123 |
- dosym "..${dest#/usr}/bin/phar" "/usr/bin/phar${SLOT}" |
2124 |
- fi |
2125 |
- ;; |
2126 |
- cgi) |
2127 |
- source="sapi/cgi/php-cgi" |
2128 |
- ;; |
2129 |
- fpm) |
2130 |
- source="sapi/fpm/php-fpm" |
2131 |
- ;; |
2132 |
- embed) |
2133 |
- source="libs/libphp${PHP_MV}$(get_libname)" |
2134 |
- ;; |
2135 |
- phpdbg) |
2136 |
- source="sapi/phpdbg/phpdbg" |
2137 |
- ;; |
2138 |
- *) |
2139 |
- die "unhandled sapi in src_install" |
2140 |
- ;; |
2141 |
- esac |
2142 |
- |
2143 |
- if [[ "${source}" == *"$(get_libname)" ]]; then |
2144 |
- dolib.so "${source}" |
2145 |
- else |
2146 |
- dobin "${source}" |
2147 |
- local name="$(basename ${source})" |
2148 |
- dosym "..${dest#/usr}/bin/${name}" "/usr/bin/${name}${SLOT}" |
2149 |
- fi |
2150 |
- fi |
2151 |
- |
2152 |
- php_install_ini "${sapi}" |
2153 |
- |
2154 |
- # construct correct SAPI string for php-config |
2155 |
- # thanks to ferringb for the bash voodoo |
2156 |
- if [[ "${sapi}" == "apache2" ]]; then |
2157 |
- sapi_list="${sapi_list:+${sapi_list} }apache2handler" |
2158 |
- else |
2159 |
- sapi_list="${sapi_list:+${sapi_list} }${sapi}" |
2160 |
- fi |
2161 |
- fi |
2162 |
- done |
2163 |
- |
2164 |
- # Installing opcache module |
2165 |
- if use opcache ; then |
2166 |
- into "${PHP_DESTDIR#${EPREFIX}}" |
2167 |
- dolib.so "modules/opcache$(get_libname)" |
2168 |
- fi |
2169 |
- |
2170 |
- # Install env.d files |
2171 |
- newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}" |
2172 |
- sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die |
2173 |
- sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die |
2174 |
- |
2175 |
- # set php-config variable correctly (bug #278439) |
2176 |
- sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \ |
2177 |
- "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die |
2178 |
- |
2179 |
- if use fpm ; then |
2180 |
- if use systemd; then |
2181 |
- systemd_newunit "${FILESDIR}/php-fpm_at.service" \ |
2182 |
- "php-fpm@${SLOT}.service" |
2183 |
- else |
2184 |
- systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \ |
2185 |
- "php-fpm@${SLOT}.service" |
2186 |
- fi |
2187 |
- fi |
2188 |
-} |
2189 |
- |
2190 |
-src_test() { |
2191 |
- echo ">>> Test phase [test]: ${CATEGORY}/${PF}" |
2192 |
- PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php" |
2193 |
- if [[ ! -x "${PHP_BIN}" ]] ; then |
2194 |
- ewarn "Test phase requires USE=cli, skipping" |
2195 |
- return |
2196 |
- else |
2197 |
- export TEST_PHP_EXECUTABLE="${PHP_BIN}" |
2198 |
- fi |
2199 |
- |
2200 |
- if [[ -x "${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" ]] ; then |
2201 |
- export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" |
2202 |
- fi |
2203 |
- |
2204 |
- if [[ -x "${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" ]] ; then |
2205 |
- export TEST_PHPDBG_EXECUTABLE="${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" |
2206 |
- fi |
2207 |
- |
2208 |
- REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \ |
2209 |
- "session.save_path=${T}" \ |
2210 |
- "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \ |
2211 |
- "session.save_path=${T}" |
2212 |
- |
2213 |
- for name in ${EXPECTED_TEST_FAILURES}; do |
2214 |
- mv "${name}.out" "${name}.out.orig" 2>/dev/null || die |
2215 |
- done |
2216 |
- |
2217 |
- local failed="$(find -name '*.out')" |
2218 |
- if [[ ${failed} != "" ]] ; then |
2219 |
- ewarn "The following test cases failed unexpectedly:" |
2220 |
- for name in ${failed}; do |
2221 |
- ewarn " ${name/.out/}" |
2222 |
- done |
2223 |
- else |
2224 |
- einfo "No unexpected test failures, all fine" |
2225 |
- fi |
2226 |
- |
2227 |
- if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then |
2228 |
- local passed="" |
2229 |
- for name in ${EXPECTED_TEST_FAILURES}; do |
2230 |
- [[ -f "${name}.diff" ]] && continue |
2231 |
- passed="${passed} ${name}" |
2232 |
- done |
2233 |
- if [[ ${passed} != "" ]] ; then |
2234 |
- einfo "The following test cases passed unexpectedly:" |
2235 |
- for name in ${passed}; do |
2236 |
- ewarn " ${passed}" |
2237 |
- done |
2238 |
- else |
2239 |
- einfo "None of the known-to-fail tests passed, all fine" |
2240 |
- fi |
2241 |
- fi |
2242 |
-} |
2243 |
- |
2244 |
-pkg_postinst() { |
2245 |
- # Output some general info to the user |
2246 |
- if use apache2 ; then |
2247 |
- elog |
2248 |
- elog "To enable PHP in apache, you will need to add \"-D PHP\" to" |
2249 |
- elog "your apache2 command. OpenRC users can append that string to" |
2250 |
- elog "APACHE2_OPTS in /etc/conf.d/apache2." |
2251 |
- elog |
2252 |
- elog "The apache module configuration file 70_mod_php.conf is" |
2253 |
- elog "provided (and maintained) by eselect-php." |
2254 |
- elog |
2255 |
- fi |
2256 |
- |
2257 |
- # Create the symlinks for php |
2258 |
- local m |
2259 |
- for m in ${SAPIS}; do |
2260 |
- [[ ${m} == 'embed' ]] && continue; |
2261 |
- if use $m ; then |
2262 |
- local ci=$(eselect php show $m) |
2263 |
- if [[ -z $ci ]]; then |
2264 |
- eselect php set $m php${SLOT} || die |
2265 |
- einfo "Switched ${m} to use php:${SLOT}" |
2266 |
- einfo |
2267 |
- elif [[ $ci != "php${SLOT}" ]] ; then |
2268 |
- elog "To switch $m to use php:${SLOT}, run" |
2269 |
- elog " eselect php set $m php${SLOT}" |
2270 |
- elog |
2271 |
- fi |
2272 |
- fi |
2273 |
- done |
2274 |
- |
2275 |
- # Remove dead symlinks for SAPIs that were just disabled. For |
2276 |
- # example, if the user has the cgi SAPI enabled, then he has an |
2277 |
- # eselect-php symlink for it. If he later reinstalls PHP with |
2278 |
- # USE="-cgi", that symlink will break. This call to eselect is |
2279 |
- # supposed to remove that dead link per bug 572436. |
2280 |
- eselect php cleanup || die |
2281 |
- |
2282 |
- if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then |
2283 |
- elog "To build extensions for this version of PHP, you will need to" |
2284 |
- elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable." |
2285 |
- elog |
2286 |
- fi |
2287 |
- |
2288 |
- # Warn about the removal of PHP_INI_VERSION if the user has it set. |
2289 |
- if [[ -n "${PHP_INI_VERSION}" ]]; then |
2290 |
- ewarn 'The PHP_INI_VERSION variable has been phased out. You may' |
2291 |
- ewarn 'remove it from your configuration at your convenience. See' |
2292 |
- ewarn |
2293 |
- ewarn ' https://bugs.gentoo.org/611214' |
2294 |
- ewarn |
2295 |
- ewarn 'for more information.' |
2296 |
- fi |
2297 |
- |
2298 |
- elog "For details on how version slotting works, please see" |
2299 |
- elog "the wiki:" |
2300 |
- elog |
2301 |
- elog " https://wiki.gentoo.org/wiki/PHP" |
2302 |
- elog |
2303 |
-} |
2304 |
- |
2305 |
-pkg_postrm() { |
2306 |
- # This serves two purposes. First, if we have just removed the last |
2307 |
- # installed version of PHP, then this will remove any dead symlinks |
2308 |
- # belonging to eselect-php. Second, if a user upgrades slots from |
2309 |
- # (say) 5.6 to 7.0 and depcleans the old slot, then this will update |
2310 |
- # his existing symlinks to point to the new 7.0 installation. The |
2311 |
- # latter is bug 432962. |
2312 |
- # |
2313 |
- # Note: the eselect-php package may not be installed at this point, |
2314 |
- # so we can't die() if this command fails. |
2315 |
- eselect php cleanup |
2316 |
-} |
2317 |
|
2318 |
diff --git a/dev-lang/php/php-8.0.11.ebuild b/dev-lang/php/php-8.0.11.ebuild |
2319 |
deleted file mode 100644 |
2320 |
index df8ecdf6d70..00000000000 |
2321 |
--- a/dev-lang/php/php-8.0.11.ebuild |
2322 |
+++ /dev/null |
2323 |
@@ -1,749 +0,0 @@ |
2324 |
-# Copyright 1999-2021 Gentoo Authors |
2325 |
-# Distributed under the terms of the GNU General Public License v2 |
2326 |
- |
2327 |
-EAPI="7" |
2328 |
- |
2329 |
-WANT_AUTOMAKE="none" |
2330 |
- |
2331 |
-inherit flag-o-matic systemd autotools |
2332 |
- |
2333 |
-MY_PV=${PV/_rc/rc} |
2334 |
-DESCRIPTION="The PHP language runtime engine" |
2335 |
-HOMEPAGE="https://www.php.net/" |
2336 |
-SRC_URI="https://www.php.net/distributions/${P}.tar.xz" |
2337 |
- |
2338 |
-LICENSE="PHP-3.01 |
2339 |
- BSD |
2340 |
- Zend-2.0 |
2341 |
- bcmath? ( LGPL-2.1+ ) |
2342 |
- fpm? ( BSD-2 ) |
2343 |
- gd? ( gd ) |
2344 |
- unicode? ( BSD-2 LGPL-2.1 )" |
2345 |
- |
2346 |
-SLOT="$(ver_cut 1-2)" |
2347 |
-KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos" |
2348 |
- |
2349 |
-S="${WORKDIR}/${PN}-${MY_PV}" |
2350 |
- |
2351 |
-# We can build the following SAPIs in the given order |
2352 |
-SAPIS="embed cli cgi fpm apache2 phpdbg" |
2353 |
- |
2354 |
-# SAPIs and SAPI-specific USE flags (cli SAPI is default on): |
2355 |
-IUSE="${IUSE} |
2356 |
- ${SAPIS/cli/+cli} |
2357 |
- threads" |
2358 |
- |
2359 |
-IUSE="${IUSE} acl apparmor argon2 bcmath berkdb bzip2 calendar cdb cjk |
2360 |
- coverage +ctype curl debug |
2361 |
- enchant exif ffi +fileinfo +filter firebird |
2362 |
- +flatfile ftp gd gdbm gmp +iconv imap inifile |
2363 |
- intl iodbc ipv6 +jit kerberos ldap ldap-sasl libedit lmdb |
2364 |
- mhash mssql mysql mysqli nls |
2365 |
- oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm |
2366 |
- readline selinux +session session-mm sharedmem |
2367 |
- +simplexml snmp soap sockets sodium spell sqlite ssl |
2368 |
- sysvipc systemd test tidy +tokenizer tokyocabinet truetype unicode webp |
2369 |
- +xml xmlreader xmlwriter xpm xslt zip zlib" |
2370 |
- |
2371 |
-# Without USE=readline or libedit, the interactive "php -a" CLI will hang. |
2372 |
-# The Oracle instant client provides its own incompatible ldap library. |
2373 |
-REQUIRED_USE=" |
2374 |
- || ( cli cgi fpm apache2 embed phpdbg ) |
2375 |
- cli? ( ^^ ( readline libedit ) ) |
2376 |
- !cli? ( ?? ( readline libedit ) ) |
2377 |
- truetype? ( gd zlib ) |
2378 |
- webp? ( gd zlib ) |
2379 |
- cjk? ( gd zlib ) |
2380 |
- exif? ( gd zlib ) |
2381 |
- xpm? ( gd zlib ) |
2382 |
- gd? ( zlib ) |
2383 |
- simplexml? ( xml ) |
2384 |
- soap? ( xml ) |
2385 |
- xmlreader? ( xml ) |
2386 |
- xmlwriter? ( xml ) |
2387 |
- xslt? ( xml ) |
2388 |
- ldap-sasl? ( ldap ) |
2389 |
- oci8-instant-client? ( !ldap ) |
2390 |
- qdbm? ( !gdbm ) |
2391 |
- session-mm? ( session !threads ) |
2392 |
- mysql? ( || ( mysqli pdo ) ) |
2393 |
- firebird? ( pdo ) |
2394 |
- mssql? ( pdo ) |
2395 |
-" |
2396 |
- |
2397 |
-RESTRICT="!test? ( test )" |
2398 |
- |
2399 |
-# The supported (that is, autodetected) versions of BDB are listed in |
2400 |
-# the ./configure script. Other versions *work*, but we need to stick to |
2401 |
-# the ones that can be detected to avoid a repeat of bug #564824. |
2402 |
-COMMON_DEPEND=" |
2403 |
- >=app-eselect/eselect-php-0.9.7[apache2?,fpm?] |
2404 |
- >=dev-libs/libpcre2-10.30[jit?,unicode] |
2405 |
- fpm? ( acl? ( sys-apps/acl ) apparmor? ( sys-libs/libapparmor ) ) |
2406 |
- apache2? ( www-servers/apache[apache2_modules_unixd(+),threads=] ) |
2407 |
- argon2? ( app-crypt/argon2:= ) |
2408 |
- berkdb? ( || ( sys-libs/db:5.3 |
2409 |
- sys-libs/db:5.1 |
2410 |
- sys-libs/db:4.8 |
2411 |
- sys-libs/db:4.7 |
2412 |
- sys-libs/db:4.6 |
2413 |
- sys-libs/db:4.5 ) ) |
2414 |
- bzip2? ( app-arch/bzip2:0= ) |
2415 |
- cdb? ( || ( dev-db/cdb dev-db/tinycdb ) ) |
2416 |
- coverage? ( dev-util/lcov ) |
2417 |
- curl? ( >=net-misc/curl-7.29.0 ) |
2418 |
- enchant? ( app-text/enchant:2 ) |
2419 |
- ffi? ( >=dev-libs/libffi-3.0.11:= ) |
2420 |
- firebird? ( dev-db/firebird ) |
2421 |
- gd? ( >=virtual/jpeg-0-r3:0 media-libs/libpng:0= ) |
2422 |
- gdbm? ( >=sys-libs/gdbm-1.8.0:0= ) |
2423 |
- gmp? ( dev-libs/gmp:0= ) |
2424 |
- iconv? ( virtual/libiconv ) |
2425 |
- imap? ( >=virtual/imap-c-client-2[kerberos=,ssl=] ) |
2426 |
- intl? ( dev-libs/icu:= ) |
2427 |
- kerberos? ( virtual/krb5 ) |
2428 |
- ldap? ( >=net-nds/openldap-1.2.11 ) |
2429 |
- ldap-sasl? ( dev-libs/cyrus-sasl ) |
2430 |
- libedit? ( dev-libs/libedit ) |
2431 |
- lmdb? ( dev-db/lmdb:= ) |
2432 |
- mssql? ( dev-db/freetds[mssql] ) |
2433 |
- nls? ( sys-devel/gettext ) |
2434 |
- oci8-instant-client? ( dev-db/oracle-instantclient[sdk] ) |
2435 |
- odbc? ( iodbc? ( dev-db/libiodbc ) !iodbc? ( >=dev-db/unixODBC-1.8.13 ) ) |
2436 |
- postgres? ( >=dev-db/postgresql-9.1:* ) |
2437 |
- qdbm? ( dev-db/qdbm ) |
2438 |
- readline? ( sys-libs/readline:0= ) |
2439 |
- session-mm? ( dev-libs/mm ) |
2440 |
- snmp? ( >=net-analyzer/net-snmp-5.2 ) |
2441 |
- sodium? ( dev-libs/libsodium:=[-minimal] ) |
2442 |
- spell? ( >=app-text/aspell-0.50 ) |
2443 |
- sqlite? ( >=dev-db/sqlite-3.7.6.3 ) |
2444 |
- ssl? ( >=dev-libs/openssl-1.0.1:0= ) |
2445 |
- tidy? ( || ( app-text/tidy-html5 app-text/htmltidy ) ) |
2446 |
- tokyocabinet? ( dev-db/tokyocabinet ) |
2447 |
- truetype? ( =media-libs/freetype-2* ) |
2448 |
- unicode? ( dev-libs/oniguruma:= ) |
2449 |
- webp? ( media-libs/libwebp:0= ) |
2450 |
- xml? ( >=dev-libs/libxml2-2.9.0 ) |
2451 |
- xpm? ( x11-libs/libXpm ) |
2452 |
- xslt? ( dev-libs/libxslt ) |
2453 |
- zip? ( >=dev-libs/libzip-1.2.0:= ) |
2454 |
- zlib? ( >=sys-libs/zlib-1.2.0.4:0= ) |
2455 |
-" |
2456 |
- |
2457 |
-RDEPEND="${COMMON_DEPEND} |
2458 |
- virtual/mta |
2459 |
- fpm? ( |
2460 |
- selinux? ( sec-policy/selinux-phpfpm ) |
2461 |
- systemd? ( sys-apps/systemd ) )" |
2462 |
- |
2463 |
-# Bison isn't actually needed when building from a release tarball |
2464 |
-# However, the configure script will warn if it's absent or if you |
2465 |
-# have an incompatible version installed. See bug 593278. |
2466 |
-DEPEND="${COMMON_DEPEND} |
2467 |
- app-arch/xz-utils |
2468 |
- >=sys-devel/bison-3.0.1" |
2469 |
- |
2470 |
-BDEPEND="virtual/pkgconfig" |
2471 |
- |
2472 |
-PHP_MV="$(ver_cut 1)" |
2473 |
- |
2474 |
-PATCHES=( |
2475 |
- "${FILESDIR}/php-iodbc-header-location.patch" |
2476 |
- "${FILESDIR}/php80-firebird-warnings.patch" |
2477 |
-) |
2478 |
- |
2479 |
-php_install_ini() { |
2480 |
- local phpsapi="${1}" |
2481 |
- |
2482 |
- # work out where we are installing the ini file |
2483 |
- php_set_ini_dir "${phpsapi}" |
2484 |
- |
2485 |
- # Always install the production INI file, bug 611214. |
2486 |
- local phpinisrc="php.ini-production-${phpsapi}" |
2487 |
- cp php.ini-production "${phpinisrc}" || die |
2488 |
- |
2489 |
- # default to /tmp for save_path, bug #282768 |
2490 |
- sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die |
2491 |
- |
2492 |
- # Set the extension dir |
2493 |
- sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \ |
2494 |
- -i "${phpinisrc}" || die |
2495 |
- |
2496 |
- # Set the include path to point to where we want to find PEAR packages |
2497 |
- sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die |
2498 |
- |
2499 |
- insinto "${PHP_INI_DIR#${EPREFIX}}" |
2500 |
- newins "${phpinisrc}" php.ini |
2501 |
- |
2502 |
- elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}" |
2503 |
- elog |
2504 |
- |
2505 |
- dodir "${PHP_EXT_INI_DIR#${EPREFIX}}" |
2506 |
- dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}" |
2507 |
- |
2508 |
- if use opcache; then |
2509 |
- elog "Adding opcache to $PHP_EXT_INI_DIR" |
2510 |
- echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \ |
2511 |
- "${D}/${PHP_EXT_INI_DIR}"/opcache.ini |
2512 |
- dosym "../ext/opcache.ini" \ |
2513 |
- "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini" |
2514 |
- fi |
2515 |
- |
2516 |
- # SAPI-specific handling |
2517 |
- if [[ "${sapi}" == "fpm" ]] ; then |
2518 |
- einfo "Installing FPM config files php-fpm.conf and www.conf" |
2519 |
- insinto "${PHP_INI_DIR#${EPREFIX}}" |
2520 |
- doins sapi/fpm/php-fpm.conf |
2521 |
- insinto "${PHP_INI_DIR#${EPREFIX}}/fpm.d" |
2522 |
- doins sapi/fpm/www.conf |
2523 |
- fi |
2524 |
- |
2525 |
- dodoc php.ini-{development,production} |
2526 |
-} |
2527 |
- |
2528 |
-php_set_ini_dir() { |
2529 |
- PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}" |
2530 |
- PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext" |
2531 |
- PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active" |
2532 |
-} |
2533 |
- |
2534 |
-src_prepare() { |
2535 |
- default |
2536 |
- |
2537 |
- # In php-7.x, the FPM pool configuration files have been split off |
2538 |
- # of the main config. By default the pool config files go in |
2539 |
- # e.g. /etc/php-fpm.d, which isn't slotted. So here we move the |
2540 |
- # include directory to a subdirectory "fpm.d" of $PHP_INI_DIR. Later |
2541 |
- # we'll install the pool configuration file "www.conf" there. |
2542 |
- php_set_ini_dir fpm |
2543 |
- sed -i "s~^include=.*$~include=${PHP_INI_DIR}/fpm.d/*.conf~" \ |
2544 |
- sapi/fpm/php-fpm.conf.in \ |
2545 |
- || die 'failed to move the include directory in php-fpm.conf' |
2546 |
- |
2547 |
- # Emulate buildconf to support cross-compilation |
2548 |
- rm -fr aclocal.m4 autom4te.cache config.cache \ |
2549 |
- configure main/php_config.h.in || die |
2550 |
- eautoconf --force |
2551 |
- eautoheader |
2552 |
-} |
2553 |
- |
2554 |
-src_configure() { |
2555 |
- addpredict /usr/share/snmp/mibs/.index #nowarn |
2556 |
- addpredict /var/lib/net-snmp/mib_indexes #nowarn |
2557 |
- |
2558 |
- PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}" |
2559 |
- |
2560 |
- # The php-fpm config file wants localstatedir to be ${EPREFIX}/var |
2561 |
- # and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002. |
2562 |
- local our_conf=( |
2563 |
- --prefix="${PHP_DESTDIR}" |
2564 |
- --mandir="${PHP_DESTDIR}/man" |
2565 |
- --infodir="${PHP_DESTDIR}/info" |
2566 |
- --libdir="${PHP_DESTDIR}/lib" |
2567 |
- --with-libdir="$(get_libdir)" |
2568 |
- --localstatedir="${EPREFIX}/var" |
2569 |
- --without-pear |
2570 |
- $(use_enable threads zts) |
2571 |
- ) |
2572 |
- |
2573 |
- our_conf+=( |
2574 |
- $(use_with apparmor fpm-apparmor) |
2575 |
- $(use_with argon2 password-argon2 "${EPREFIX}/usr") |
2576 |
- $(use_enable bcmath) |
2577 |
- $(use_with bzip2 bz2 "${EPREFIX}/usr") |
2578 |
- $(use_enable calendar) |
2579 |
- $(use_enable coverage gcov) |
2580 |
- $(use_enable ctype) |
2581 |
- $(use_with curl) |
2582 |
- $(use_enable xml dom) |
2583 |
- $(use_with enchant) |
2584 |
- $(use_enable exif) |
2585 |
- $(use_with ffi) |
2586 |
- $(use_enable fileinfo) |
2587 |
- $(use_enable filter) |
2588 |
- $(use_enable ftp) |
2589 |
- $(use_with nls gettext "${EPREFIX}/usr") |
2590 |
- $(use_with gmp gmp "${EPREFIX}/usr") |
2591 |
- $(use_with mhash mhash "${EPREFIX}/usr") |
2592 |
- $(use_with iconv iconv \ |
2593 |
- $(use elibc_glibc || use elibc_musl || use elibc_FreeBSD || echo "${EPREFIX}/usr")) |
2594 |
- $(use_enable intl) |
2595 |
- $(use_enable ipv6) |
2596 |
- $(use_with kerberos) |
2597 |
- $(use_with xml libxml) |
2598 |
- $(use_enable unicode mbstring) |
2599 |
- $(use_with ssl openssl) |
2600 |
- $(use_enable pcntl) |
2601 |
- $(use_enable phar) |
2602 |
- $(use_enable pdo) |
2603 |
- $(use_enable opcache) |
2604 |
- $(use_with postgres pgsql "${EPREFIX}/usr") |
2605 |
- $(use_enable posix) |
2606 |
- $(use_with spell pspell "${EPREFIX}/usr") |
2607 |
- $(use_enable simplexml) |
2608 |
- $(use_enable sharedmem shmop) |
2609 |
- $(use_with snmp snmp "${EPREFIX}/usr") |
2610 |
- $(use_enable soap) |
2611 |
- $(use_enable sockets) |
2612 |
- $(use_with sodium) |
2613 |
- $(use_with sqlite sqlite3) |
2614 |
- $(use_enable sysvipc sysvmsg) |
2615 |
- $(use_enable sysvipc sysvsem) |
2616 |
- $(use_enable sysvipc sysvshm) |
2617 |
- $(use_with tidy tidy "${EPREFIX}/usr") |
2618 |
- $(use_enable tokenizer) |
2619 |
- $(use_enable xml) |
2620 |
- $(use_enable xmlreader) |
2621 |
- $(use_enable xmlwriter) |
2622 |
- $(use_with xslt xsl) |
2623 |
- $(use_with zip) |
2624 |
- $(use_with zlib zlib "${EPREFIX}/usr") |
2625 |
- $(use_enable debug) |
2626 |
- ) |
2627 |
- |
2628 |
- # DBA support |
2629 |
- if use cdb || use berkdb || use flatfile || use gdbm || use inifile \ |
2630 |
- || use qdbm || use lmdb || use tokyocabinet ; then |
2631 |
- our_conf+=( "--enable-dba" ) |
2632 |
- fi |
2633 |
- |
2634 |
- # DBA drivers support |
2635 |
- our_conf+=( |
2636 |
- $(use_with cdb) |
2637 |
- $(use_with berkdb db4 "${EPREFIX}/usr") |
2638 |
- $(use_enable flatfile) |
2639 |
- $(use_with gdbm gdbm "${EPREFIX}/usr") |
2640 |
- $(use_enable inifile) |
2641 |
- $(use_with qdbm qdbm "${EPREFIX}/usr") |
2642 |
- $(use_with tokyocabinet tcadb "${EPREFIX}/usr") |
2643 |
- $(use_with lmdb lmdb "${EPREFIX}/usr") |
2644 |
- ) |
2645 |
- |
2646 |
- # Support for the GD graphics library |
2647 |
- our_conf+=( |
2648 |
- $(use_with truetype freetype) |
2649 |
- $(use_enable cjk gd-jis-conv) |
2650 |
- $(use_with gd jpeg) |
2651 |
- $(use_with xpm) |
2652 |
- $(use_with webp) |
2653 |
- ) |
2654 |
- # enable gd last, so configure can pick up the previous settings |
2655 |
- our_conf+=( $(use_enable gd) ) |
2656 |
- |
2657 |
- # IMAP support |
2658 |
- if use imap ; then |
2659 |
- our_conf+=( |
2660 |
- $(use_with imap imap "${EPREFIX}/usr") |
2661 |
- $(use_with ssl imap-ssl "${EPREFIX}/usr") |
2662 |
- ) |
2663 |
- fi |
2664 |
- |
2665 |
- # LDAP support |
2666 |
- if use ldap ; then |
2667 |
- our_conf+=( |
2668 |
- $(use_with ldap ldap "${EPREFIX}/usr") |
2669 |
- $(use_with ldap-sasl) |
2670 |
- ) |
2671 |
- fi |
2672 |
- |
2673 |
- # MySQL support |
2674 |
- local mysqllib="mysqlnd" |
2675 |
- local mysqlilib="mysqlnd" |
2676 |
- |
2677 |
- our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") ) |
2678 |
- |
2679 |
- local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock" |
2680 |
- if use mysql || use mysqli ; then |
2681 |
- our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") ) |
2682 |
- fi |
2683 |
- |
2684 |
- # ODBC support |
2685 |
- if use odbc && use iodbc ; then |
2686 |
- our_conf+=( |
2687 |
- --without-unixODBC |
2688 |
- --with-iodbc |
2689 |
- $(use_with pdo pdo-odbc "iODBC,${EPREFIX}/usr") |
2690 |
- ) |
2691 |
- elif use odbc ; then |
2692 |
- our_conf+=( |
2693 |
- --with-unixODBC="${EPREFIX}/usr" |
2694 |
- --without-iodbc |
2695 |
- $(use_with pdo pdo-odbc "unixODBC,${EPREFIX}/usr") |
2696 |
- ) |
2697 |
- else |
2698 |
- our_conf+=( |
2699 |
- --without-unixODBC |
2700 |
- --without-iodbc |
2701 |
- --without-pdo-odbc |
2702 |
- ) |
2703 |
- fi |
2704 |
- |
2705 |
- # Oracle support |
2706 |
- our_conf+=( $(use_with oci8-instant-client oci8) ) |
2707 |
- |
2708 |
- # PDO support |
2709 |
- if use pdo ; then |
2710 |
- our_conf+=( |
2711 |
- $(use_with mssql pdo-dblib "${EPREFIX}/usr") |
2712 |
- $(use_with mysql pdo-mysql "${mysqllib}") |
2713 |
- $(use_with postgres pdo-pgsql) |
2714 |
- $(use_with sqlite pdo-sqlite) |
2715 |
- $(use_with firebird pdo-firebird "${EPREFIX}/usr") |
2716 |
- $(use_with oci8-instant-client pdo-oci) |
2717 |
- ) |
2718 |
- fi |
2719 |
- |
2720 |
- # readline/libedit support |
2721 |
- our_conf+=( |
2722 |
- $(use_with readline readline "${EPREFIX}/usr") |
2723 |
- $(use_with libedit) |
2724 |
- ) |
2725 |
- |
2726 |
- # Session support |
2727 |
- if use session ; then |
2728 |
- our_conf+=( $(use_with session-mm mm "${EPREFIX}/usr") ) |
2729 |
- else |
2730 |
- our_conf+=( $(use_enable session) ) |
2731 |
- fi |
2732 |
- |
2733 |
- # Use pic for shared modules such as apache2's mod_php |
2734 |
- our_conf+=( --with-pic ) |
2735 |
- |
2736 |
- # we use the system copy of pcre |
2737 |
- # --with-external-pcre affects ext/pcre |
2738 |
- our_conf+=( |
2739 |
- --with-external-pcre |
2740 |
- $(use_with jit pcre-jit) |
2741 |
- ) |
2742 |
- |
2743 |
- # Catch CFLAGS problems |
2744 |
- # Fixes bug #14067. |
2745 |
- # Changed order to run it in reverse for bug #32022 and #12021. |
2746 |
- replace-cpu-flags "k6*" "i586" |
2747 |
- |
2748 |
- # Cache the ./configure test results between SAPIs. |
2749 |
- our_conf+=( --cache-file="${T}/config.cache" ) |
2750 |
- |
2751 |
- # Support user-passed configuration parameters |
2752 |
- our_conf+=( ${EXTRA_ECONF:-} ) |
2753 |
- |
2754 |
- # Support the Apache2 extras, they must be set globally for all |
2755 |
- # SAPIs to work correctly, especially for external PHP extensions |
2756 |
- |
2757 |
- local one_sapi |
2758 |
- local sapi |
2759 |
- mkdir -p "${WORKDIR}/sapis-build" || die |
2760 |
- for one_sapi in $SAPIS ; do |
2761 |
- use "${one_sapi}" || continue |
2762 |
- php_set_ini_dir "${one_sapi}" |
2763 |
- |
2764 |
- # The BUILD_DIR variable is used to determine where to output |
2765 |
- # the files that autotools creates. This was all originally |
2766 |
- # based on the autotools-utils eclass. |
2767 |
- BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}" |
2768 |
- cp -a "${S}" "${BUILD_DIR}" || die |
2769 |
- cd "${BUILD_DIR}" || die |
2770 |
- |
2771 |
- local sapi_conf=( |
2772 |
- --with-config-file-path="${PHP_INI_DIR}" |
2773 |
- --with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}" |
2774 |
- ) |
2775 |
- |
2776 |
- for sapi in $SAPIS ; do |
2777 |
- case "$sapi" in |
2778 |
- cli|cgi|embed|fpm|phpdbg) |
2779 |
- if [[ "${one_sapi}" == "${sapi}" ]] ; then |
2780 |
- sapi_conf+=( "--enable-${sapi}" ) |
2781 |
- if [[ "fpm" == "${sapi}" ]] ; then |
2782 |
- sapi_conf+=( |
2783 |
- $(use_with acl fpm-acl) |
2784 |
- $(use_with systemd fpm-systemd) |
2785 |
- ) |
2786 |
- fi |
2787 |
- else |
2788 |
- sapi_conf+=( "--disable-${sapi}" ) |
2789 |
- fi |
2790 |
- ;; |
2791 |
- |
2792 |
- apache2) |
2793 |
- if [[ "${one_sapi}" == "${sapi}" ]] ; then |
2794 |
- sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" ) |
2795 |
- else |
2796 |
- sapi_conf+=( --without-apxs2 ) |
2797 |
- fi |
2798 |
- ;; |
2799 |
- esac |
2800 |
- done |
2801 |
- |
2802 |
- # Construct the $myeconfargs array by concatenating $our_conf |
2803 |
- # (the common args) and $sapi_conf (the SAPI-specific args). |
2804 |
- local myeconfargs=( "${our_conf[@]}" ) |
2805 |
- myeconfargs+=( "${sapi_conf[@]}" ) |
2806 |
- |
2807 |
- pushd "${BUILD_DIR}" > /dev/null || die |
2808 |
- econf "${myeconfargs[@]}" |
2809 |
- popd > /dev/null || die |
2810 |
- done |
2811 |
-} |
2812 |
- |
2813 |
-src_compile() { |
2814 |
- # snmp seems to run during src_compile, too (bug #324739) |
2815 |
- addpredict /usr/share/snmp/mibs/.index #nowarn |
2816 |
- addpredict /var/lib/net-snmp/mib_indexes #nowarn |
2817 |
- |
2818 |
- local sapi |
2819 |
- for sapi in ${SAPIS} ; do |
2820 |
- if use "${sapi}"; then |
2821 |
- cd "${WORKDIR}/sapis-build/$sapi" || \ |
2822 |
- die "Failed to change dir to ${WORKDIR}/sapis-build/$1" |
2823 |
- emake |
2824 |
- fi |
2825 |
- done |
2826 |
-} |
2827 |
- |
2828 |
-src_install() { |
2829 |
- # see bug #324739 for what happens when we don't have that |
2830 |
- addpredict /usr/share/snmp/mibs/.index #nowarn |
2831 |
- |
2832 |
- # grab the first SAPI that got built and install common files from there |
2833 |
- local first_sapi="", sapi="" |
2834 |
- for sapi in $SAPIS ; do |
2835 |
- if use $sapi ; then |
2836 |
- first_sapi=$sapi |
2837 |
- break |
2838 |
- fi |
2839 |
- done |
2840 |
- |
2841 |
- # Makefile forgets to create this before trying to write to it... |
2842 |
- dodir "${PHP_DESTDIR#${EPREFIX}}/bin" |
2843 |
- |
2844 |
- # Install php environment (without any sapis) |
2845 |
- cd "${WORKDIR}/sapis-build/$first_sapi" || die |
2846 |
- emake INSTALL_ROOT="${D}" \ |
2847 |
- install-build install-headers install-programs |
2848 |
- |
2849 |
- local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)" |
2850 |
- |
2851 |
- # Create the directory where we'll put version-specific php scripts |
2852 |
- keepdir "/usr/share/php${PHP_MV}" |
2853 |
- |
2854 |
- local file="" |
2855 |
- local sapi_list="" |
2856 |
- |
2857 |
- for sapi in ${SAPIS}; do |
2858 |
- if use "${sapi}" ; then |
2859 |
- einfo "Installing SAPI: ${sapi}" |
2860 |
- cd "${WORKDIR}/sapis-build/${sapi}" || die |
2861 |
- |
2862 |
- if [[ "${sapi}" == "apache2" ]] ; then |
2863 |
- # We're specifically not using emake install-sapi as libtool |
2864 |
- # may cause unnecessary relink failures (see bug #351266) |
2865 |
- insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/" |
2866 |
- newins ".libs/libphp$(get_libname)" \ |
2867 |
- "libphp${PHP_MV}$(get_libname)" |
2868 |
- keepdir "/usr/$(get_libdir)/apache2/modules" |
2869 |
- else |
2870 |
- # needed each time, php_install_ini would reset it |
2871 |
- local dest="${PHP_DESTDIR#${EPREFIX}}" |
2872 |
- into "${dest}" |
2873 |
- case "$sapi" in |
2874 |
- cli) |
2875 |
- source="sapi/cli/php" |
2876 |
- # Install the "phar" archive utility. |
2877 |
- if use phar ; then |
2878 |
- emake INSTALL_ROOT="${D}" install-pharcmd |
2879 |
- dosym "..${dest#/usr}/bin/phar" "/usr/bin/phar${SLOT}" |
2880 |
- fi |
2881 |
- ;; |
2882 |
- cgi) |
2883 |
- source="sapi/cgi/php-cgi" |
2884 |
- ;; |
2885 |
- fpm) |
2886 |
- source="sapi/fpm/php-fpm" |
2887 |
- ;; |
2888 |
- embed) |
2889 |
- source="libs/libphp$(get_libname)" |
2890 |
- ;; |
2891 |
- phpdbg) |
2892 |
- source="sapi/phpdbg/phpdbg" |
2893 |
- ;; |
2894 |
- *) |
2895 |
- die "unhandled sapi in src_install" |
2896 |
- ;; |
2897 |
- esac |
2898 |
- |
2899 |
- if [[ "${source}" == *"$(get_libname)" ]]; then |
2900 |
- dolib.so "${source}" |
2901 |
- else |
2902 |
- dobin "${source}" |
2903 |
- local name="$(basename ${source})" |
2904 |
- dosym "..${dest#/usr}/bin/${name}" "/usr/bin/${name}${SLOT}" |
2905 |
- fi |
2906 |
- fi |
2907 |
- |
2908 |
- php_install_ini "${sapi}" |
2909 |
- |
2910 |
- # construct correct SAPI string for php-config |
2911 |
- # thanks to ferringb for the bash voodoo |
2912 |
- if [[ "${sapi}" == "apache2" ]]; then |
2913 |
- sapi_list="${sapi_list:+${sapi_list} }apache2handler" |
2914 |
- else |
2915 |
- sapi_list="${sapi_list:+${sapi_list} }${sapi}" |
2916 |
- fi |
2917 |
- fi |
2918 |
- done |
2919 |
- |
2920 |
- # Installing opcache module |
2921 |
- if use opcache ; then |
2922 |
- into "${PHP_DESTDIR#${EPREFIX}}" |
2923 |
- dolib.so "modules/opcache$(get_libname)" |
2924 |
- fi |
2925 |
- |
2926 |
- # Install env.d files |
2927 |
- newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}" |
2928 |
- sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die |
2929 |
- sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die |
2930 |
- |
2931 |
- # set php-config variable correctly (bug #278439) |
2932 |
- sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \ |
2933 |
- "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die |
2934 |
- |
2935 |
- if use fpm ; then |
2936 |
- if use systemd; then |
2937 |
- systemd_newunit "${FILESDIR}/php-fpm_at.service" \ |
2938 |
- "php-fpm@${SLOT}.service" |
2939 |
- else |
2940 |
- systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \ |
2941 |
- "php-fpm@${SLOT}.service" |
2942 |
- fi |
2943 |
- fi |
2944 |
-} |
2945 |
- |
2946 |
-src_test() { |
2947 |
- echo ">>> Test phase [test]: ${CATEGORY}/${PF}" |
2948 |
- PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php" |
2949 |
- if [[ ! -x "${PHP_BIN}" ]] ; then |
2950 |
- ewarn "Test phase requires USE=cli, skipping" |
2951 |
- return |
2952 |
- else |
2953 |
- export TEST_PHP_EXECUTABLE="${PHP_BIN}" |
2954 |
- fi |
2955 |
- |
2956 |
- if [[ -x "${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" ]] ; then |
2957 |
- export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" |
2958 |
- fi |
2959 |
- |
2960 |
- if [[ -x "${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" ]] ; then |
2961 |
- export TEST_PHPDBG_EXECUTABLE="${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" |
2962 |
- fi |
2963 |
- |
2964 |
- REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \ |
2965 |
- "session.save_path=${T}" \ |
2966 |
- "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \ |
2967 |
- "session.save_path=${T}" |
2968 |
- |
2969 |
- for name in ${EXPECTED_TEST_FAILURES}; do |
2970 |
- mv "${name}.out" "${name}.out.orig" 2>/dev/null || die |
2971 |
- done |
2972 |
- |
2973 |
- local failed="$(find -name '*.out')" |
2974 |
- if [[ ${failed} != "" ]] ; then |
2975 |
- ewarn "The following test cases failed unexpectedly:" |
2976 |
- for name in ${failed}; do |
2977 |
- ewarn " ${name/.out/}" |
2978 |
- done |
2979 |
- else |
2980 |
- einfo "No unexpected test failures, all fine" |
2981 |
- fi |
2982 |
- |
2983 |
- if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then |
2984 |
- local passed="" |
2985 |
- for name in ${EXPECTED_TEST_FAILURES}; do |
2986 |
- [[ -f "${name}.diff" ]] && continue |
2987 |
- passed="${passed} ${name}" |
2988 |
- done |
2989 |
- if [[ ${passed} != "" ]] ; then |
2990 |
- einfo "The following test cases passed unexpectedly:" |
2991 |
- for name in ${passed}; do |
2992 |
- ewarn " ${passed}" |
2993 |
- done |
2994 |
- else |
2995 |
- einfo "None of the known-to-fail tests passed, all fine" |
2996 |
- fi |
2997 |
- fi |
2998 |
-} |
2999 |
- |
3000 |
-pkg_postinst() { |
3001 |
- # Output some general info to the user |
3002 |
- if use apache2 ; then |
3003 |
- elog |
3004 |
- elog "To enable PHP in apache, you will need to add \"-D PHP\" to" |
3005 |
- elog "your apache2 command. OpenRC users can append that string to" |
3006 |
- elog "APACHE2_OPTS in /etc/conf.d/apache2." |
3007 |
- elog |
3008 |
- elog "The apache module configuration file 70_mod_php.conf is" |
3009 |
- elog "provided (and maintained) by eselect-php." |
3010 |
- elog |
3011 |
- fi |
3012 |
- |
3013 |
- # Create the symlinks for php |
3014 |
- local m |
3015 |
- for m in ${SAPIS}; do |
3016 |
- [[ ${m} == 'embed' ]] && continue; |
3017 |
- if use $m ; then |
3018 |
- local ci=$(eselect php show $m) |
3019 |
- if [[ -z $ci ]]; then |
3020 |
- eselect php set $m php${SLOT} || die |
3021 |
- einfo "Switched ${m} to use php:${SLOT}" |
3022 |
- einfo |
3023 |
- elif [[ $ci != "php${SLOT}" ]] ; then |
3024 |
- elog "To switch $m to use php:${SLOT}, run" |
3025 |
- elog " eselect php set $m php${SLOT}" |
3026 |
- elog |
3027 |
- fi |
3028 |
- fi |
3029 |
- done |
3030 |
- |
3031 |
- # Remove dead symlinks for SAPIs that were just disabled. For |
3032 |
- # example, if the user has the cgi SAPI enabled, then he has an |
3033 |
- # eselect-php symlink for it. If he later reinstalls PHP with |
3034 |
- # USE="-cgi", that symlink will break. This call to eselect is |
3035 |
- # supposed to remove that dead link per bug 572436. |
3036 |
- eselect php cleanup || die |
3037 |
- |
3038 |
- if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then |
3039 |
- elog "To build extensions for this version of PHP, you will need to" |
3040 |
- elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable." |
3041 |
- elog |
3042 |
- fi |
3043 |
- |
3044 |
- # Warn about the removal of PHP_INI_VERSION if the user has it set. |
3045 |
- if [[ -n "${PHP_INI_VERSION}" ]]; then |
3046 |
- ewarn 'The PHP_INI_VERSION variable has been phased out. You may' |
3047 |
- ewarn 'remove it from your configuration at your convenience. See' |
3048 |
- ewarn |
3049 |
- ewarn ' https://bugs.gentoo.org/611214' |
3050 |
- ewarn |
3051 |
- ewarn 'for more information.' |
3052 |
- fi |
3053 |
- |
3054 |
- elog "For details on how version slotting works, please see" |
3055 |
- elog "the wiki:" |
3056 |
- elog |
3057 |
- elog " https://wiki.gentoo.org/wiki/PHP" |
3058 |
- elog |
3059 |
-} |
3060 |
- |
3061 |
-pkg_postrm() { |
3062 |
- # This serves two purposes. First, if we have just removed the last |
3063 |
- # installed version of PHP, then this will remove any dead symlinks |
3064 |
- # belonging to eselect-php. Second, if a user upgrades slots from |
3065 |
- # (say) 5.6 to 7.0 and depcleans the old slot, then this will update |
3066 |
- # his existing symlinks to point to the new 7.0 installation. The |
3067 |
- # latter is bug 432962. |
3068 |
- # |
3069 |
- # Note: the eselect-php package may not be installed at this point, |
3070 |
- # so we can't die() if this command fails. |
3071 |
- eselect php cleanup |
3072 |
-} |
3073 |
|
3074 |
diff --git a/dev-lang/php/php-8.1.0_rc2.ebuild b/dev-lang/php/php-8.1.0_rc2.ebuild |
3075 |
deleted file mode 100644 |
3076 |
index c364c281d1f..00000000000 |
3077 |
--- a/dev-lang/php/php-8.1.0_rc2.ebuild |
3078 |
+++ /dev/null |
3079 |
@@ -1,749 +0,0 @@ |
3080 |
-# Copyright 1999-2021 Gentoo Authors |
3081 |
-# Distributed under the terms of the GNU General Public License v2 |
3082 |
- |
3083 |
-EAPI="7" |
3084 |
- |
3085 |
-WANT_AUTOMAKE="none" |
3086 |
- |
3087 |
-inherit flag-o-matic systemd autotools |
3088 |
- |
3089 |
-MY_PV=${PV/_rc/RC} |
3090 |
-DESCRIPTION="The PHP language runtime engine" |
3091 |
-HOMEPAGE="https://www.php.net/" |
3092 |
-#SRC_URI="https://www.php.net/distributions/${P}.tar.xz" |
3093 |
-SRC_URI="https://downloads.php.net/~patrickallaert/${PN}-${MY_PV}.tar.xz" |
3094 |
- |
3095 |
-LICENSE="PHP-3.01 |
3096 |
- BSD |
3097 |
- Zend-2.0 |
3098 |
- bcmath? ( LGPL-2.1+ ) |
3099 |
- fpm? ( BSD-2 ) |
3100 |
- gd? ( gd ) |
3101 |
- unicode? ( BSD-2 LGPL-2.1 )" |
3102 |
- |
3103 |
-SLOT="$(ver_cut 1-2)" |
3104 |
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos" |
3105 |
- |
3106 |
-S="${WORKDIR}/${PN}-${MY_PV}" |
3107 |
- |
3108 |
-# We can build the following SAPIs in the given order |
3109 |
-SAPIS="embed cli cgi fpm apache2 phpdbg" |
3110 |
- |
3111 |
-# SAPIs and SAPI-specific USE flags (cli SAPI is default on): |
3112 |
-IUSE="${IUSE} |
3113 |
- ${SAPIS/cli/+cli} |
3114 |
- threads" |
3115 |
- |
3116 |
-IUSE="${IUSE} acl apparmor argon2 bcmath berkdb bzip2 calendar cdb cjk |
3117 |
- coverage +ctype curl debug |
3118 |
- enchant exif ffi +fileinfo +filter firebird |
3119 |
- +flatfile ftp gd gdbm gmp +iconv imap inifile |
3120 |
- intl iodbc ipv6 +jit kerberos ldap ldap-sasl libedit lmdb |
3121 |
- mhash mssql mysql mysqli nls |
3122 |
- oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm |
3123 |
- readline selinux +session session-mm sharedmem |
3124 |
- +simplexml snmp soap sockets sodium spell sqlite ssl |
3125 |
- sysvipc systemd test tidy +tokenizer tokyocabinet truetype unicode webp |
3126 |
- +xml xmlreader xmlwriter xpm xslt zip zlib" |
3127 |
- |
3128 |
-# Without USE=readline or libedit, the interactive "php -a" CLI will hang. |
3129 |
-# The Oracle instant client provides its own incompatible ldap library. |
3130 |
-REQUIRED_USE=" |
3131 |
- || ( cli cgi fpm apache2 embed phpdbg ) |
3132 |
- cli? ( ^^ ( readline libedit ) ) |
3133 |
- !cli? ( ?? ( readline libedit ) ) |
3134 |
- truetype? ( gd zlib ) |
3135 |
- webp? ( gd zlib ) |
3136 |
- cjk? ( gd zlib ) |
3137 |
- exif? ( gd zlib ) |
3138 |
- xpm? ( gd zlib ) |
3139 |
- gd? ( zlib ) |
3140 |
- simplexml? ( xml ) |
3141 |
- soap? ( xml ) |
3142 |
- xmlreader? ( xml ) |
3143 |
- xmlwriter? ( xml ) |
3144 |
- xslt? ( xml ) |
3145 |
- ldap-sasl? ( ldap ) |
3146 |
- oci8-instant-client? ( !ldap ) |
3147 |
- qdbm? ( !gdbm ) |
3148 |
- session-mm? ( session !threads ) |
3149 |
- mysql? ( || ( mysqli pdo ) ) |
3150 |
- firebird? ( pdo ) |
3151 |
- mssql? ( pdo ) |
3152 |
-" |
3153 |
- |
3154 |
-RESTRICT="!test? ( test )" |
3155 |
- |
3156 |
-# The supported (that is, autodetected) versions of BDB are listed in |
3157 |
-# the ./configure script. Other versions *work*, but we need to stick to |
3158 |
-# the ones that can be detected to avoid a repeat of bug #564824. |
3159 |
-COMMON_DEPEND=" |
3160 |
- >=app-eselect/eselect-php-0.9.7[apache2?,fpm?] |
3161 |
- >=dev-libs/libpcre2-10.30[jit?,unicode] |
3162 |
- fpm? ( acl? ( sys-apps/acl ) apparmor? ( sys-libs/libapparmor ) ) |
3163 |
- apache2? ( www-servers/apache[apache2_modules_unixd(+),threads=] ) |
3164 |
- argon2? ( app-crypt/argon2:= ) |
3165 |
- berkdb? ( || ( sys-libs/db:5.3 |
3166 |
- sys-libs/db:5.1 |
3167 |
- sys-libs/db:4.8 |
3168 |
- sys-libs/db:4.7 |
3169 |
- sys-libs/db:4.6 |
3170 |
- sys-libs/db:4.5 ) ) |
3171 |
- bzip2? ( app-arch/bzip2:0= ) |
3172 |
- cdb? ( || ( dev-db/cdb dev-db/tinycdb ) ) |
3173 |
- coverage? ( dev-util/lcov ) |
3174 |
- curl? ( >=net-misc/curl-7.29.0 ) |
3175 |
- enchant? ( app-text/enchant:2 ) |
3176 |
- ffi? ( >=dev-libs/libffi-3.0.11:= ) |
3177 |
- firebird? ( dev-db/firebird ) |
3178 |
- gd? ( >=virtual/jpeg-0-r3:0 media-libs/libpng:0= ) |
3179 |
- gdbm? ( >=sys-libs/gdbm-1.8.0:0= ) |
3180 |
- gmp? ( dev-libs/gmp:0= ) |
3181 |
- iconv? ( virtual/libiconv ) |
3182 |
- imap? ( >=virtual/imap-c-client-2[kerberos=,ssl=] ) |
3183 |
- intl? ( dev-libs/icu:= ) |
3184 |
- kerberos? ( virtual/krb5 ) |
3185 |
- ldap? ( >=net-nds/openldap-1.2.11 ) |
3186 |
- ldap-sasl? ( dev-libs/cyrus-sasl ) |
3187 |
- libedit? ( dev-libs/libedit ) |
3188 |
- lmdb? ( dev-db/lmdb:= ) |
3189 |
- mssql? ( dev-db/freetds[mssql] ) |
3190 |
- nls? ( sys-devel/gettext ) |
3191 |
- oci8-instant-client? ( dev-db/oracle-instantclient[sdk] ) |
3192 |
- odbc? ( iodbc? ( dev-db/libiodbc ) !iodbc? ( >=dev-db/unixODBC-1.8.13 ) ) |
3193 |
- postgres? ( >=dev-db/postgresql-9.1:* ) |
3194 |
- qdbm? ( dev-db/qdbm ) |
3195 |
- readline? ( sys-libs/readline:0= ) |
3196 |
- session-mm? ( dev-libs/mm ) |
3197 |
- snmp? ( >=net-analyzer/net-snmp-5.2 ) |
3198 |
- sodium? ( dev-libs/libsodium:=[-minimal] ) |
3199 |
- spell? ( >=app-text/aspell-0.50 ) |
3200 |
- sqlite? ( >=dev-db/sqlite-3.7.6.3 ) |
3201 |
- ssl? ( >=dev-libs/openssl-1.0.2:0= ) |
3202 |
- tidy? ( || ( app-text/tidy-html5 app-text/htmltidy ) ) |
3203 |
- tokyocabinet? ( dev-db/tokyocabinet ) |
3204 |
- truetype? ( =media-libs/freetype-2* ) |
3205 |
- unicode? ( dev-libs/oniguruma:= ) |
3206 |
- webp? ( media-libs/libwebp:0= ) |
3207 |
- xml? ( >=dev-libs/libxml2-2.9.0 ) |
3208 |
- xpm? ( x11-libs/libXpm ) |
3209 |
- xslt? ( dev-libs/libxslt ) |
3210 |
- zip? ( >=dev-libs/libzip-1.2.0:= ) |
3211 |
- zlib? ( >=sys-libs/zlib-1.2.0.4:0= ) |
3212 |
-" |
3213 |
- |
3214 |
-RDEPEND="${COMMON_DEPEND} |
3215 |
- virtual/mta |
3216 |
- fpm? ( |
3217 |
- selinux? ( sec-policy/selinux-phpfpm ) |
3218 |
- systemd? ( sys-apps/systemd ) )" |
3219 |
- |
3220 |
-# Bison isn't actually needed when building from a release tarball |
3221 |
-# However, the configure script will warn if it's absent or if you |
3222 |
-# have an incompatible version installed. See bug 593278. |
3223 |
-DEPEND="${COMMON_DEPEND} |
3224 |
- app-arch/xz-utils |
3225 |
- >=sys-devel/bison-3.0.1" |
3226 |
- |
3227 |
-BDEPEND="virtual/pkgconfig" |
3228 |
- |
3229 |
-PHP_MV="$(ver_cut 1)" |
3230 |
- |
3231 |
-PATCHES=( |
3232 |
- "${FILESDIR}/php-iodbc-header-location.patch" |
3233 |
-) |
3234 |
- |
3235 |
-php_install_ini() { |
3236 |
- local phpsapi="${1}" |
3237 |
- |
3238 |
- # work out where we are installing the ini file |
3239 |
- php_set_ini_dir "${phpsapi}" |
3240 |
- |
3241 |
- # Always install the production INI file, bug 611214. |
3242 |
- local phpinisrc="php.ini-production-${phpsapi}" |
3243 |
- cp php.ini-production "${phpinisrc}" || die |
3244 |
- |
3245 |
- # default to /tmp for save_path, bug #282768 |
3246 |
- sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die |
3247 |
- |
3248 |
- # Set the extension dir |
3249 |
- sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \ |
3250 |
- -i "${phpinisrc}" || die |
3251 |
- |
3252 |
- # Set the include path to point to where we want to find PEAR packages |
3253 |
- sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die |
3254 |
- |
3255 |
- insinto "${PHP_INI_DIR#${EPREFIX}}" |
3256 |
- newins "${phpinisrc}" php.ini |
3257 |
- |
3258 |
- elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}" |
3259 |
- elog |
3260 |
- |
3261 |
- dodir "${PHP_EXT_INI_DIR#${EPREFIX}}" |
3262 |
- dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}" |
3263 |
- |
3264 |
- if use opcache; then |
3265 |
- elog "Adding opcache to $PHP_EXT_INI_DIR" |
3266 |
- echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \ |
3267 |
- "${D}/${PHP_EXT_INI_DIR}"/opcache.ini |
3268 |
- dosym "../ext/opcache.ini" \ |
3269 |
- "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini" |
3270 |
- fi |
3271 |
- |
3272 |
- # SAPI-specific handling |
3273 |
- if [[ "${sapi}" == "fpm" ]] ; then |
3274 |
- einfo "Installing FPM config files php-fpm.conf and www.conf" |
3275 |
- insinto "${PHP_INI_DIR#${EPREFIX}}" |
3276 |
- doins sapi/fpm/php-fpm.conf |
3277 |
- insinto "${PHP_INI_DIR#${EPREFIX}}/fpm.d" |
3278 |
- doins sapi/fpm/www.conf |
3279 |
- fi |
3280 |
- |
3281 |
- dodoc php.ini-{development,production} |
3282 |
-} |
3283 |
- |
3284 |
-php_set_ini_dir() { |
3285 |
- PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}" |
3286 |
- PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext" |
3287 |
- PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active" |
3288 |
-} |
3289 |
- |
3290 |
-src_prepare() { |
3291 |
- default |
3292 |
- |
3293 |
- # In php-7.x, the FPM pool configuration files have been split off |
3294 |
- # of the main config. By default the pool config files go in |
3295 |
- # e.g. /etc/php-fpm.d, which isn't slotted. So here we move the |
3296 |
- # include directory to a subdirectory "fpm.d" of $PHP_INI_DIR. Later |
3297 |
- # we'll install the pool configuration file "www.conf" there. |
3298 |
- php_set_ini_dir fpm |
3299 |
- sed -i "s~^include=.*$~include=${PHP_INI_DIR}/fpm.d/*.conf~" \ |
3300 |
- sapi/fpm/php-fpm.conf.in \ |
3301 |
- || die 'failed to move the include directory in php-fpm.conf' |
3302 |
- |
3303 |
- # Emulate buildconf to support cross-compilation |
3304 |
- rm -fr aclocal.m4 autom4te.cache config.cache \ |
3305 |
- configure main/php_config.h.in || die |
3306 |
- eautoconf --force |
3307 |
- eautoheader |
3308 |
-} |
3309 |
- |
3310 |
-src_configure() { |
3311 |
- addpredict /usr/share/snmp/mibs/.index #nowarn |
3312 |
- addpredict /var/lib/net-snmp/mib_indexes #nowarn |
3313 |
- |
3314 |
- PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}" |
3315 |
- |
3316 |
- # The php-fpm config file wants localstatedir to be ${EPREFIX}/var |
3317 |
- # and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002. |
3318 |
- local our_conf=( |
3319 |
- --prefix="${PHP_DESTDIR}" |
3320 |
- --mandir="${PHP_DESTDIR}/man" |
3321 |
- --infodir="${PHP_DESTDIR}/info" |
3322 |
- --libdir="${PHP_DESTDIR}/lib" |
3323 |
- --with-libdir="$(get_libdir)" |
3324 |
- --localstatedir="${EPREFIX}/var" |
3325 |
- --without-pear |
3326 |
- $(use_enable threads zts) |
3327 |
- ) |
3328 |
- |
3329 |
- our_conf+=( |
3330 |
- $(use_with apparmor fpm-apparmor) |
3331 |
- $(use_with argon2 password-argon2 "${EPREFIX}/usr") |
3332 |
- $(use_enable bcmath) |
3333 |
- $(use_with bzip2 bz2 "${EPREFIX}/usr") |
3334 |
- $(use_enable calendar) |
3335 |
- $(use_enable coverage gcov) |
3336 |
- $(use_enable ctype) |
3337 |
- $(use_with curl) |
3338 |
- $(use_enable xml dom) |
3339 |
- $(use_with enchant) |
3340 |
- $(use_enable exif) |
3341 |
- $(use_with ffi) |
3342 |
- $(use_enable fileinfo) |
3343 |
- $(use_enable filter) |
3344 |
- $(use_enable ftp) |
3345 |
- $(use_with nls gettext "${EPREFIX}/usr") |
3346 |
- $(use_with gmp gmp "${EPREFIX}/usr") |
3347 |
- $(use_with mhash mhash "${EPREFIX}/usr") |
3348 |
- $(use_with iconv iconv \ |
3349 |
- $(use elibc_glibc || use elibc_musl || use elibc_FreeBSD || echo "${EPREFIX}/usr")) |
3350 |
- $(use_enable intl) |
3351 |
- $(use_enable ipv6) |
3352 |
- $(use_with kerberos) |
3353 |
- $(use_with xml libxml) |
3354 |
- $(use_enable unicode mbstring) |
3355 |
- $(use_with ssl openssl) |
3356 |
- $(use_enable pcntl) |
3357 |
- $(use_enable phar) |
3358 |
- $(use_enable pdo) |
3359 |
- $(use_enable opcache) |
3360 |
- $(use_with postgres pgsql "${EPREFIX}/usr") |
3361 |
- $(use_enable posix) |
3362 |
- $(use_with spell pspell "${EPREFIX}/usr") |
3363 |
- $(use_enable simplexml) |
3364 |
- $(use_enable sharedmem shmop) |
3365 |
- $(use_with snmp snmp "${EPREFIX}/usr") |
3366 |
- $(use_enable soap) |
3367 |
- $(use_enable sockets) |
3368 |
- $(use_with sodium) |
3369 |
- $(use_with sqlite sqlite3) |
3370 |
- $(use_enable sysvipc sysvmsg) |
3371 |
- $(use_enable sysvipc sysvsem) |
3372 |
- $(use_enable sysvipc sysvshm) |
3373 |
- $(use_with tidy tidy "${EPREFIX}/usr") |
3374 |
- $(use_enable tokenizer) |
3375 |
- $(use_enable xml) |
3376 |
- $(use_enable xmlreader) |
3377 |
- $(use_enable xmlwriter) |
3378 |
- $(use_with xslt xsl) |
3379 |
- $(use_with zip) |
3380 |
- $(use_with zlib zlib "${EPREFIX}/usr") |
3381 |
- $(use_enable debug) |
3382 |
- ) |
3383 |
- |
3384 |
- # DBA support |
3385 |
- if use cdb || use berkdb || use flatfile || use gdbm || use inifile \ |
3386 |
- || use qdbm || use lmdb || use tokyocabinet ; then |
3387 |
- our_conf+=( "--enable-dba" ) |
3388 |
- fi |
3389 |
- |
3390 |
- # DBA drivers support |
3391 |
- our_conf+=( |
3392 |
- $(use_with cdb) |
3393 |
- $(use_with berkdb db4 "${EPREFIX}/usr") |
3394 |
- $(use_enable flatfile) |
3395 |
- $(use_with gdbm gdbm "${EPREFIX}/usr") |
3396 |
- $(use_enable inifile) |
3397 |
- $(use_with qdbm qdbm "${EPREFIX}/usr") |
3398 |
- $(use_with tokyocabinet tcadb "${EPREFIX}/usr") |
3399 |
- $(use_with lmdb lmdb "${EPREFIX}/usr") |
3400 |
- ) |
3401 |
- |
3402 |
- # Support for the GD graphics library |
3403 |
- our_conf+=( |
3404 |
- $(use_with truetype freetype) |
3405 |
- $(use_enable cjk gd-jis-conv) |
3406 |
- $(use_with gd jpeg) |
3407 |
- $(use_with xpm) |
3408 |
- $(use_with webp) |
3409 |
- ) |
3410 |
- # enable gd last, so configure can pick up the previous settings |
3411 |
- our_conf+=( $(use_enable gd) ) |
3412 |
- |
3413 |
- # IMAP support |
3414 |
- if use imap ; then |
3415 |
- our_conf+=( |
3416 |
- $(use_with imap imap "${EPREFIX}/usr") |
3417 |
- $(use_with ssl imap-ssl "${EPREFIX}/usr") |
3418 |
- ) |
3419 |
- fi |
3420 |
- |
3421 |
- # LDAP support |
3422 |
- if use ldap ; then |
3423 |
- our_conf+=( |
3424 |
- $(use_with ldap ldap "${EPREFIX}/usr") |
3425 |
- $(use_with ldap-sasl) |
3426 |
- ) |
3427 |
- fi |
3428 |
- |
3429 |
- # MySQL support |
3430 |
- local mysqllib="mysqlnd" |
3431 |
- local mysqlilib="mysqlnd" |
3432 |
- |
3433 |
- our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") ) |
3434 |
- |
3435 |
- local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock" |
3436 |
- if use mysql || use mysqli ; then |
3437 |
- our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") ) |
3438 |
- fi |
3439 |
- |
3440 |
- # ODBC support |
3441 |
- if use odbc && use iodbc ; then |
3442 |
- our_conf+=( |
3443 |
- --without-unixODBC |
3444 |
- --with-iodbc |
3445 |
- $(use_with pdo pdo-odbc "iODBC,${EPREFIX}/usr") |
3446 |
- ) |
3447 |
- elif use odbc ; then |
3448 |
- our_conf+=( |
3449 |
- --with-unixODBC="${EPREFIX}/usr" |
3450 |
- --without-iodbc |
3451 |
- $(use_with pdo pdo-odbc "unixODBC,${EPREFIX}/usr") |
3452 |
- ) |
3453 |
- else |
3454 |
- our_conf+=( |
3455 |
- --without-unixODBC |
3456 |
- --without-iodbc |
3457 |
- --without-pdo-odbc |
3458 |
- ) |
3459 |
- fi |
3460 |
- |
3461 |
- # Oracle support |
3462 |
- our_conf+=( $(use_with oci8-instant-client oci8) ) |
3463 |
- |
3464 |
- # PDO support |
3465 |
- if use pdo ; then |
3466 |
- our_conf+=( |
3467 |
- $(use_with mssql pdo-dblib "${EPREFIX}/usr") |
3468 |
- $(use_with mysql pdo-mysql "${mysqllib}") |
3469 |
- $(use_with postgres pdo-pgsql) |
3470 |
- $(use_with sqlite pdo-sqlite) |
3471 |
- $(use_with firebird pdo-firebird "${EPREFIX}/usr") |
3472 |
- $(use_with oci8-instant-client pdo-oci) |
3473 |
- ) |
3474 |
- fi |
3475 |
- |
3476 |
- # readline/libedit support |
3477 |
- our_conf+=( |
3478 |
- $(use_with readline readline "${EPREFIX}/usr") |
3479 |
- $(use_with libedit) |
3480 |
- ) |
3481 |
- |
3482 |
- # Session support |
3483 |
- if use session ; then |
3484 |
- our_conf+=( $(use_with session-mm mm "${EPREFIX}/usr") ) |
3485 |
- else |
3486 |
- our_conf+=( $(use_enable session) ) |
3487 |
- fi |
3488 |
- |
3489 |
- # Use pic for shared modules such as apache2's mod_php |
3490 |
- our_conf+=( --with-pic ) |
3491 |
- |
3492 |
- # we use the system copy of pcre |
3493 |
- # --with-external-pcre affects ext/pcre |
3494 |
- our_conf+=( |
3495 |
- --with-external-pcre |
3496 |
- $(use_with jit pcre-jit) |
3497 |
- ) |
3498 |
- |
3499 |
- # Catch CFLAGS problems |
3500 |
- # Fixes bug #14067. |
3501 |
- # Changed order to run it in reverse for bug #32022 and #12021. |
3502 |
- replace-cpu-flags "k6*" "i586" |
3503 |
- |
3504 |
- # Cache the ./configure test results between SAPIs. |
3505 |
- our_conf+=( --cache-file="${T}/config.cache" ) |
3506 |
- |
3507 |
- # Support user-passed configuration parameters |
3508 |
- our_conf+=( ${EXTRA_ECONF:-} ) |
3509 |
- |
3510 |
- # Support the Apache2 extras, they must be set globally for all |
3511 |
- # SAPIs to work correctly, especially for external PHP extensions |
3512 |
- |
3513 |
- local one_sapi |
3514 |
- local sapi |
3515 |
- mkdir -p "${WORKDIR}/sapis-build" || die |
3516 |
- for one_sapi in $SAPIS ; do |
3517 |
- use "${one_sapi}" || continue |
3518 |
- php_set_ini_dir "${one_sapi}" |
3519 |
- |
3520 |
- # The BUILD_DIR variable is used to determine where to output |
3521 |
- # the files that autotools creates. This was all originally |
3522 |
- # based on the autotools-utils eclass. |
3523 |
- BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}" |
3524 |
- cp -a "${S}" "${BUILD_DIR}" || die |
3525 |
- cd "${BUILD_DIR}" || die |
3526 |
- |
3527 |
- local sapi_conf=( |
3528 |
- --with-config-file-path="${PHP_INI_DIR}" |
3529 |
- --with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}" |
3530 |
- ) |
3531 |
- |
3532 |
- for sapi in $SAPIS ; do |
3533 |
- case "$sapi" in |
3534 |
- cli|cgi|embed|fpm|phpdbg) |
3535 |
- if [[ "${one_sapi}" == "${sapi}" ]] ; then |
3536 |
- sapi_conf+=( "--enable-${sapi}" ) |
3537 |
- if [[ "fpm" == "${sapi}" ]] ; then |
3538 |
- sapi_conf+=( |
3539 |
- $(use_with acl fpm-acl) |
3540 |
- $(use_with systemd fpm-systemd) |
3541 |
- ) |
3542 |
- fi |
3543 |
- else |
3544 |
- sapi_conf+=( "--disable-${sapi}" ) |
3545 |
- fi |
3546 |
- ;; |
3547 |
- |
3548 |
- apache2) |
3549 |
- if [[ "${one_sapi}" == "${sapi}" ]] ; then |
3550 |
- sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" ) |
3551 |
- else |
3552 |
- sapi_conf+=( --without-apxs2 ) |
3553 |
- fi |
3554 |
- ;; |
3555 |
- esac |
3556 |
- done |
3557 |
- |
3558 |
- # Construct the $myeconfargs array by concatenating $our_conf |
3559 |
- # (the common args) and $sapi_conf (the SAPI-specific args). |
3560 |
- local myeconfargs=( "${our_conf[@]}" ) |
3561 |
- myeconfargs+=( "${sapi_conf[@]}" ) |
3562 |
- |
3563 |
- pushd "${BUILD_DIR}" > /dev/null || die |
3564 |
- econf "${myeconfargs[@]}" |
3565 |
- popd > /dev/null || die |
3566 |
- done |
3567 |
-} |
3568 |
- |
3569 |
-src_compile() { |
3570 |
- # snmp seems to run during src_compile, too (bug #324739) |
3571 |
- addpredict /usr/share/snmp/mibs/.index #nowarn |
3572 |
- addpredict /var/lib/net-snmp/mib_indexes #nowarn |
3573 |
- |
3574 |
- local sapi |
3575 |
- for sapi in ${SAPIS} ; do |
3576 |
- if use "${sapi}"; then |
3577 |
- cd "${WORKDIR}/sapis-build/$sapi" || \ |
3578 |
- die "Failed to change dir to ${WORKDIR}/sapis-build/$1" |
3579 |
- emake |
3580 |
- fi |
3581 |
- done |
3582 |
-} |
3583 |
- |
3584 |
-src_install() { |
3585 |
- # see bug #324739 for what happens when we don't have that |
3586 |
- addpredict /usr/share/snmp/mibs/.index #nowarn |
3587 |
- |
3588 |
- # grab the first SAPI that got built and install common files from there |
3589 |
- local first_sapi="", sapi="" |
3590 |
- for sapi in $SAPIS ; do |
3591 |
- if use $sapi ; then |
3592 |
- first_sapi=$sapi |
3593 |
- break |
3594 |
- fi |
3595 |
- done |
3596 |
- |
3597 |
- # Makefile forgets to create this before trying to write to it... |
3598 |
- dodir "${PHP_DESTDIR#${EPREFIX}}/bin" |
3599 |
- |
3600 |
- # Install php environment (without any sapis) |
3601 |
- cd "${WORKDIR}/sapis-build/$first_sapi" || die |
3602 |
- emake INSTALL_ROOT="${D}" \ |
3603 |
- install-build install-headers install-programs |
3604 |
- |
3605 |
- local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)" |
3606 |
- |
3607 |
- # Create the directory where we'll put version-specific php scripts |
3608 |
- keepdir "/usr/share/php${PHP_MV}" |
3609 |
- |
3610 |
- local file="" |
3611 |
- local sapi_list="" |
3612 |
- |
3613 |
- for sapi in ${SAPIS}; do |
3614 |
- if use "${sapi}" ; then |
3615 |
- einfo "Installing SAPI: ${sapi}" |
3616 |
- cd "${WORKDIR}/sapis-build/${sapi}" || die |
3617 |
- |
3618 |
- if [[ "${sapi}" == "apache2" ]] ; then |
3619 |
- # We're specifically not using emake install-sapi as libtool |
3620 |
- # may cause unnecessary relink failures (see bug #351266) |
3621 |
- insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/" |
3622 |
- newins ".libs/libphp$(get_libname)" \ |
3623 |
- "libphp${PHP_MV}$(get_libname)" |
3624 |
- keepdir "/usr/$(get_libdir)/apache2/modules" |
3625 |
- else |
3626 |
- # needed each time, php_install_ini would reset it |
3627 |
- local dest="${PHP_DESTDIR#${EPREFIX}}" |
3628 |
- into "${dest}" |
3629 |
- case "$sapi" in |
3630 |
- cli) |
3631 |
- source="sapi/cli/php" |
3632 |
- # Install the "phar" archive utility. |
3633 |
- if use phar ; then |
3634 |
- emake INSTALL_ROOT="${D}" install-pharcmd |
3635 |
- dosym "..${dest#/usr}/bin/phar" "/usr/bin/phar${SLOT}" |
3636 |
- fi |
3637 |
- ;; |
3638 |
- cgi) |
3639 |
- source="sapi/cgi/php-cgi" |
3640 |
- ;; |
3641 |
- fpm) |
3642 |
- source="sapi/fpm/php-fpm" |
3643 |
- ;; |
3644 |
- embed) |
3645 |
- source="libs/libphp$(get_libname)" |
3646 |
- ;; |
3647 |
- phpdbg) |
3648 |
- source="sapi/phpdbg/phpdbg" |
3649 |
- ;; |
3650 |
- *) |
3651 |
- die "unhandled sapi in src_install" |
3652 |
- ;; |
3653 |
- esac |
3654 |
- |
3655 |
- if [[ "${source}" == *"$(get_libname)" ]]; then |
3656 |
- dolib.so "${source}" |
3657 |
- else |
3658 |
- dobin "${source}" |
3659 |
- local name="$(basename ${source})" |
3660 |
- dosym "..${dest#/usr}/bin/${name}" "/usr/bin/${name}${SLOT}" |
3661 |
- fi |
3662 |
- fi |
3663 |
- |
3664 |
- php_install_ini "${sapi}" |
3665 |
- |
3666 |
- # construct correct SAPI string for php-config |
3667 |
- # thanks to ferringb for the bash voodoo |
3668 |
- if [[ "${sapi}" == "apache2" ]]; then |
3669 |
- sapi_list="${sapi_list:+${sapi_list} }apache2handler" |
3670 |
- else |
3671 |
- sapi_list="${sapi_list:+${sapi_list} }${sapi}" |
3672 |
- fi |
3673 |
- fi |
3674 |
- done |
3675 |
- |
3676 |
- # Installing opcache module |
3677 |
- if use opcache ; then |
3678 |
- into "${PHP_DESTDIR#${EPREFIX}}" |
3679 |
- dolib.so "modules/opcache$(get_libname)" |
3680 |
- fi |
3681 |
- |
3682 |
- # Install env.d files |
3683 |
- newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}" |
3684 |
- sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die |
3685 |
- sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die |
3686 |
- |
3687 |
- # set php-config variable correctly (bug #278439) |
3688 |
- sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \ |
3689 |
- "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die |
3690 |
- |
3691 |
- if use fpm ; then |
3692 |
- if use systemd; then |
3693 |
- systemd_newunit "${FILESDIR}/php-fpm_at.service" \ |
3694 |
- "php-fpm@${SLOT}.service" |
3695 |
- else |
3696 |
- systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \ |
3697 |
- "php-fpm@${SLOT}.service" |
3698 |
- fi |
3699 |
- fi |
3700 |
-} |
3701 |
- |
3702 |
-src_test() { |
3703 |
- echo ">>> Test phase [test]: ${CATEGORY}/${PF}" |
3704 |
- PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php" |
3705 |
- if [[ ! -x "${PHP_BIN}" ]] ; then |
3706 |
- ewarn "Test phase requires USE=cli, skipping" |
3707 |
- return |
3708 |
- else |
3709 |
- export TEST_PHP_EXECUTABLE="${PHP_BIN}" |
3710 |
- fi |
3711 |
- |
3712 |
- if [[ -x "${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" ]] ; then |
3713 |
- export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" |
3714 |
- fi |
3715 |
- |
3716 |
- if [[ -x "${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" ]] ; then |
3717 |
- export TEST_PHPDBG_EXECUTABLE="${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" |
3718 |
- fi |
3719 |
- |
3720 |
- REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \ |
3721 |
- "session.save_path=${T}" \ |
3722 |
- "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \ |
3723 |
- "session.save_path=${T}" |
3724 |
- |
3725 |
- for name in ${EXPECTED_TEST_FAILURES}; do |
3726 |
- mv "${name}.out" "${name}.out.orig" 2>/dev/null || die |
3727 |
- done |
3728 |
- |
3729 |
- local failed="$(find -name '*.out')" |
3730 |
- if [[ ${failed} != "" ]] ; then |
3731 |
- ewarn "The following test cases failed unexpectedly:" |
3732 |
- for name in ${failed}; do |
3733 |
- ewarn " ${name/.out/}" |
3734 |
- done |
3735 |
- else |
3736 |
- einfo "No unexpected test failures, all fine" |
3737 |
- fi |
3738 |
- |
3739 |
- if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then |
3740 |
- local passed="" |
3741 |
- for name in ${EXPECTED_TEST_FAILURES}; do |
3742 |
- [[ -f "${name}.diff" ]] && continue |
3743 |
- passed="${passed} ${name}" |
3744 |
- done |
3745 |
- if [[ ${passed} != "" ]] ; then |
3746 |
- einfo "The following test cases passed unexpectedly:" |
3747 |
- for name in ${passed}; do |
3748 |
- ewarn " ${passed}" |
3749 |
- done |
3750 |
- else |
3751 |
- einfo "None of the known-to-fail tests passed, all fine" |
3752 |
- fi |
3753 |
- fi |
3754 |
-} |
3755 |
- |
3756 |
-pkg_postinst() { |
3757 |
- # Output some general info to the user |
3758 |
- if use apache2 ; then |
3759 |
- elog |
3760 |
- elog "To enable PHP in apache, you will need to add \"-D PHP\" to" |
3761 |
- elog "your apache2 command. OpenRC users can append that string to" |
3762 |
- elog "APACHE2_OPTS in /etc/conf.d/apache2." |
3763 |
- elog |
3764 |
- elog "The apache module configuration file 70_mod_php.conf is" |
3765 |
- elog "provided (and maintained) by eselect-php." |
3766 |
- elog |
3767 |
- fi |
3768 |
- |
3769 |
- # Create the symlinks for php |
3770 |
- local m |
3771 |
- for m in ${SAPIS}; do |
3772 |
- [[ ${m} == 'embed' ]] && continue; |
3773 |
- if use $m ; then |
3774 |
- local ci=$(eselect php show $m) |
3775 |
- if [[ -z $ci ]]; then |
3776 |
- eselect php set $m php${SLOT} || die |
3777 |
- einfo "Switched ${m} to use php:${SLOT}" |
3778 |
- einfo |
3779 |
- elif [[ $ci != "php${SLOT}" ]] ; then |
3780 |
- elog "To switch $m to use php:${SLOT}, run" |
3781 |
- elog " eselect php set $m php${SLOT}" |
3782 |
- elog |
3783 |
- fi |
3784 |
- fi |
3785 |
- done |
3786 |
- |
3787 |
- # Remove dead symlinks for SAPIs that were just disabled. For |
3788 |
- # example, if the user has the cgi SAPI enabled, then he has an |
3789 |
- # eselect-php symlink for it. If he later reinstalls PHP with |
3790 |
- # USE="-cgi", that symlink will break. This call to eselect is |
3791 |
- # supposed to remove that dead link per bug 572436. |
3792 |
- eselect php cleanup || die |
3793 |
- |
3794 |
- if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then |
3795 |
- elog "To build extensions for this version of PHP, you will need to" |
3796 |
- elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable." |
3797 |
- elog |
3798 |
- fi |
3799 |
- |
3800 |
- # Warn about the removal of PHP_INI_VERSION if the user has it set. |
3801 |
- if [[ -n "${PHP_INI_VERSION}" ]]; then |
3802 |
- ewarn 'The PHP_INI_VERSION variable has been phased out. You may' |
3803 |
- ewarn 'remove it from your configuration at your convenience. See' |
3804 |
- ewarn |
3805 |
- ewarn ' https://bugs.gentoo.org/611214' |
3806 |
- ewarn |
3807 |
- ewarn 'for more information.' |
3808 |
- fi |
3809 |
- |
3810 |
- elog "For details on how version slotting works, please see" |
3811 |
- elog "the wiki:" |
3812 |
- elog |
3813 |
- elog " https://wiki.gentoo.org/wiki/PHP" |
3814 |
- elog |
3815 |
-} |
3816 |
- |
3817 |
-pkg_postrm() { |
3818 |
- # This serves two purposes. First, if we have just removed the last |
3819 |
- # installed version of PHP, then this will remove any dead symlinks |
3820 |
- # belonging to eselect-php. Second, if a user upgrades slots from |
3821 |
- # (say) 5.6 to 7.0 and depcleans the old slot, then this will update |
3822 |
- # his existing symlinks to point to the new 7.0 installation. The |
3823 |
- # latter is bug 432962. |
3824 |
- # |
3825 |
- # Note: the eselect-php package may not be installed at this point, |
3826 |
- # so we can't die() if this command fails. |
3827 |
- eselect php cleanup |
3828 |
-} |