Gentoo Archives: gentoo-commits

From: Brian Evans <grknight@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/php/
Date: Fri, 21 Jan 2022 14:35:59
Message-Id: 1642775752.4631cb765c41d0471693a700be739b2cf8f83358.grknight@gentoo
1 commit: 4631cb765c41d0471693a700be739b2cf8f83358
2 Author: Brian Evans <grknight <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jan 21 14:35:20 2022 +0000
4 Commit: Brian Evans <grknight <AT> gentoo <DOT> org>
5 CommitDate: Fri Jan 21 14:35:52 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4631cb76
7
8 dev-lang/php: Drop old
9
10 Signed-off-by: Brian Evans <grknight <AT> gentoo.org>
11
12 dev-lang/php/Manifest | 3 -
13 dev-lang/php/php-8.0.13.ebuild | 758 ----------------------------------------
14 dev-lang/php/php-8.1.0.ebuild | 759 -----------------------------------------
15 dev-lang/php/php-8.1.1.ebuild | 759 -----------------------------------------
16 4 files changed, 2279 deletions(-)
17
18 diff --git a/dev-lang/php/Manifest b/dev-lang/php/Manifest
19 index 33447a6fd6ea..c2a8b81d8572 100644
20 --- a/dev-lang/php/Manifest
21 +++ b/dev-lang/php/Manifest
22 @@ -4,9 +4,6 @@ DIST php-7.4.25.tar.xz 10376304 BLAKE2B 75682840a9e978d2ce350892bb8d743238f1ca86
23 DIST php-7.4.26.tar.xz 10420236 BLAKE2B d4675ecf3632bb63e24d2f3cdef10c01fbf4a7a28384abc1e2eeb9ae7dc4ecfe341b95d946e182647837f4e082f0261e2ba921822ec5844b7fe833bf639197b7 SHA512 36cd493c9c95aabb1ee47e82cb0c20b2be99fe7ebd98743355139064590d0b9a1746d71e31dd47f164df34ebe3f8366a75f3efc149262e1391b43d83d3045c6e
24 DIST php-7.4.27.tar.xz 10419380 BLAKE2B e62218f54f0455377f085499b3fa75d9d9a33c81d621ac4303cee59e70565a3cd9bfa6372ebb3492a4093eb22bf101653b6e8b3804cb8795db5d5ac2845de2f5 SHA512 2401f19d738a511c20efdf199fed7a6bdd02b51d91abf68a410f760cf846df87fce4bbf71acdf209926877cf3e8f8f39f045f1f03755862d09491f6ab6c9cfc8
25 DIST php-8.0.12.tar.xz 10713980 BLAKE2B ce8ca0d671e8613a81744a55cf94ff43254482a08dec365c05eb4ca22c1b31732e5ef93a51d383d2e8daf0cf332ed7946e79ba3b385386ca0773fc673fe58307 SHA512 927b15c4443f3741a5325ec7bf387987b405cd5e64e40fd81f1945bf073adda30eeede8e1f98185f505cb61f969cf1abe05b8dad57a3c4e87971e8037bb16b23
26 -DIST php-8.0.13.tar.xz 10854284 BLAKE2B 7f232dcfc89f0803cf1f1eff664fa9e16436d6b3c5a22c0454432a546e848a8e962057820866a85cb2af1234a0c0fa38f813c62be90526dbeab483f0e9095fd3 SHA512 cb00482b74146670c4644f4b5da63b40d9afd111e198cdf1e67bfcf4280501a657b4fbad8fd7580f4e3f537db3c8a9db5f4115d3a466392cefac9866e233fa49
27 DIST php-8.0.14.tar.xz 10860176 BLAKE2B e63e8e4446c1e1ee0bdf6faf38ce95a793107e582bd74677555d6f3576184af73d454111f14cd680086b11f288222d1ad5fb0e5ee38df53cd476fab6015b7fa7 SHA512 1fb96dd7e229dd71d0e872c8450e18bdefadebaf0b6b6429bd5d054be1b940cd2d53f132ba2d166d454b89374e79e4ea02d483320792e983d572df68ef769788
28 DIST php-8.0.15.tar.xz 10764936 BLAKE2B f7bdc42dd3c9e9b58744dba644720fd5dfe581442f522759cd48b94a30c3fc65167f2b0e670bbbe5d5524ec3a6704e3b432e5af2dc07c6944a93adc52e527e98 SHA512 e6ac50b2e38d6d02cf84ce388826438bb7d339b54d2038ca071874b90c65f80c5c5e0c69f870edd7450d2de8f83788c8855eeb983d0d4528d44e31679caf404f
29 -DIST php-8.1.0.tar.xz 11737524 BLAKE2B 1c1bd664628343f1a0d502a009ab01cccc4cb3cb8239c1882ae1a9c1795db9cf382d5b5648cc83bc4a929a892e637324555cc59a6379118cb04f477d35cfabff SHA512 0f8667ec888dff2f1b7354ff3bd3def4130b1b7145258deb65e4529982383a90c1a7412f298d566f889b4f2c19a72d145ad150501881f8483a07fc9610c9ae49
30 -DIST php-8.1.1.tar.xz 11728680 BLAKE2B a9a6dd380efea7637e92707dfc3f8b0705efdfd6cb2639a69e43fa4d7ac17ba80d12086840d4b7118e8f132c1f7e1638d9df79e03190c1fd9647ffe553003980 SHA512 ab1cca08eb49fc2316f19d9e136a2d6462fe5b33967ecb671564dd9def2a765cc1b864a764c9cfbb8e7853936fb2d4939e7ed4f97220ca30eaf08c3badeb44da
31 DIST php-8.1.2.tar.xz 11681132 BLAKE2B e693237b76d94cd4a50c3df68289d4c2f070c40cc52c099fd91134331377115b7e7df509e5d6cdfc7742da3ae7b27d3cbe7015acc3825b887ba0d7d690663dd4 SHA512 ec68587fc14d4e5aaa19d4a189c74b85e67b8ab4d5a15ef36115b564fc9e2f2b63bd608ea8c0e4a99615a24f38711b233f4e65b3672c3bfb69e1ab9d554a88cd
32
33 diff --git a/dev-lang/php/php-8.0.13.ebuild b/dev-lang/php/php-8.0.13.ebuild
34 deleted file mode 100644
35 index 76be376118a8..000000000000
36 --- a/dev-lang/php/php-8.0.13.ebuild
37 +++ /dev/null
38 @@ -1,758 +0,0 @@
39 -# Copyright 1999-2022 Gentoo Authors
40 -# Distributed under the terms of the GNU General Public License v2
41 -
42 -EAPI="7"
43 -
44 -WANT_AUTOMAKE="none"
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 ~riscv ~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 apparmor argon2 bcmath berkdb bzip2 calendar cdb cjk
75 - coverage +ctype curl debug
76 - enchant exif ffi +fileinfo +filter firebird
77 - +flatfile ftp gd gdbm gmp +iconv imap inifile
78 - intl iodbc ipv6 +jit 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 selinux +session session-mm sharedmem
82 - +simplexml snmp soap sockets sodium spell sqlite ssl
83 - sysvipc systemd test tidy +tokenizer tokyocabinet truetype unicode webp
84 - +xml xmlreader xmlwriter xpm xslt zip zlib"
85 -
86 -# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
87 -# The Oracle instant client provides its own incompatible ldap library.
88 -REQUIRED_USE="
89 - || ( cli cgi fpm apache2 embed phpdbg )
90 - cli? ( ^^ ( readline libedit ) )
91 - !cli? ( ?? ( readline libedit ) )
92 - truetype? ( gd zlib )
93 - webp? ( gd zlib )
94 - cjk? ( gd zlib )
95 - exif? ( gd zlib )
96 - xpm? ( gd zlib )
97 - gd? ( zlib )
98 - simplexml? ( xml )
99 - soap? ( xml )
100 - xmlreader? ( xml )
101 - xmlwriter? ( xml )
102 - xslt? ( xml )
103 - ldap-sasl? ( ldap )
104 - oci8-instant-client? ( !ldap )
105 - qdbm? ( !gdbm )
106 - session-mm? ( session !threads )
107 - mysql? ( || ( mysqli pdo ) )
108 - firebird? ( pdo )
109 - mssql? ( pdo )
110 -"
111 -
112 -RESTRICT="!test? ( test )"
113 -
114 -# The supported (that is, autodetected) versions of BDB are listed in
115 -# the ./configure script. Other versions *work*, but we need to stick to
116 -# the ones that can be detected to avoid a repeat of bug #564824.
117 -COMMON_DEPEND="
118 - >=app-eselect/eselect-php-0.9.7[apache2?,fpm?]
119 - >=dev-libs/libpcre2-10.30[jit?,unicode]
120 - fpm? ( acl? ( sys-apps/acl ) apparmor? ( sys-libs/libapparmor ) )
121 - apache2? ( www-servers/apache[apache2_modules_unixd(+),threads=] )
122 - argon2? ( app-crypt/argon2:= )
123 - berkdb? ( || ( sys-libs/db:5.3 sys-libs/db:4.8 ) )
124 - bzip2? ( app-arch/bzip2:0= )
125 - cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
126 - coverage? ( dev-util/lcov )
127 - curl? ( >=net-misc/curl-7.29.0 )
128 - enchant? ( app-text/enchant:2 )
129 - ffi? ( >=dev-libs/libffi-3.0.11:= )
130 - firebird? ( dev-db/firebird )
131 - gd? ( >=virtual/jpeg-0-r3:0 media-libs/libpng:0= )
132 - gdbm? ( >=sys-libs/gdbm-1.8.0:0= )
133 - gmp? ( dev-libs/gmp:0= )
134 - iconv? ( virtual/libiconv )
135 - imap? ( >=virtual/imap-c-client-2[kerberos=,ssl=] )
136 - intl? ( dev-libs/icu:= )
137 - kerberos? ( virtual/krb5 )
138 - ldap? ( >=net-nds/openldap-1.2.11 )
139 - ldap-sasl? ( dev-libs/cyrus-sasl )
140 - libedit? ( dev-libs/libedit )
141 - lmdb? ( dev-db/lmdb:= )
142 - mssql? ( dev-db/freetds[mssql] )
143 - nls? ( sys-devel/gettext )
144 - oci8-instant-client? ( dev-db/oracle-instantclient[sdk] )
145 - odbc? ( iodbc? ( dev-db/libiodbc ) !iodbc? ( >=dev-db/unixODBC-1.8.13 ) )
146 - postgres? ( >=dev-db/postgresql-9.1:* )
147 - qdbm? ( dev-db/qdbm )
148 - readline? ( sys-libs/readline:0= )
149 - session-mm? ( dev-libs/mm )
150 - snmp? ( >=net-analyzer/net-snmp-5.2 )
151 - sodium? ( dev-libs/libsodium:=[-minimal] )
152 - spell? ( >=app-text/aspell-0.50 )
153 - sqlite? ( >=dev-db/sqlite-3.7.6.3 )
154 - ssl? ( >=dev-libs/openssl-1.0.1:0= )
155 - tidy? ( app-text/htmltidy )
156 - tokyocabinet? ( dev-db/tokyocabinet )
157 - truetype? ( =media-libs/freetype-2* )
158 - unicode? ( dev-libs/oniguruma:= )
159 - webp? ( media-libs/libwebp:0= )
160 - xml? ( >=dev-libs/libxml2-2.9.0 )
161 - xpm? ( x11-libs/libXpm )
162 - xslt? ( dev-libs/libxslt )
163 - zip? ( >=dev-libs/libzip-1.2.0:= )
164 - zlib? ( >=sys-libs/zlib-1.2.0.4:0= )
165 -"
166 -
167 -RDEPEND="${COMMON_DEPEND}
168 - virtual/mta
169 - fpm? (
170 - selinux? ( sec-policy/selinux-phpfpm )
171 - systemd? ( sys-apps/systemd ) )"
172 -
173 -# Bison isn't actually needed when building from a release tarball
174 -# However, the configure script will warn if it's absent or if you
175 -# have an incompatible version installed. See bug 593278.
176 -DEPEND="${COMMON_DEPEND}
177 - app-arch/xz-utils
178 - >=sys-devel/bison-3.0.1"
179 -
180 -BDEPEND="virtual/pkgconfig"
181 -
182 -PHP_MV="$(ver_cut 1)"
183 -
184 -PATCHES=(
185 - "${FILESDIR}/php-iodbc-header-location.patch"
186 - "${FILESDIR}/php80-firebird-warnings.patch"
187 -)
188 -
189 -php_install_ini() {
190 - local phpsapi="${1}"
191 -
192 - # work out where we are installing the ini file
193 - php_set_ini_dir "${phpsapi}"
194 -
195 - # Always install the production INI file, bug 611214.
196 - local phpinisrc="php.ini-production-${phpsapi}"
197 - cp php.ini-production "${phpinisrc}" || die
198 -
199 - # default to /tmp for save_path, bug #282768
200 - sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die
201 -
202 - # Set the extension dir
203 - sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \
204 - -i "${phpinisrc}" || die
205 -
206 - # Set the include path to point to where we want to find PEAR packages
207 - sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die
208 -
209 - insinto "${PHP_INI_DIR#${EPREFIX}}"
210 - newins "${phpinisrc}" php.ini
211 -
212 - elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}"
213 - elog
214 -
215 - dodir "${PHP_EXT_INI_DIR#${EPREFIX}}"
216 - dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}"
217 -
218 - if use opcache; then
219 - elog "Adding opcache to $PHP_EXT_INI_DIR"
220 - echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \
221 - "${D}/${PHP_EXT_INI_DIR}"/opcache.ini
222 - dosym "../ext/opcache.ini" \
223 - "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini"
224 - fi
225 -
226 - # SAPI-specific handling
227 - if [[ "${sapi}" == "fpm" ]] ; then
228 - einfo "Installing FPM config files php-fpm.conf and www.conf"
229 - insinto "${PHP_INI_DIR#${EPREFIX}}"
230 - doins sapi/fpm/php-fpm.conf
231 - insinto "${PHP_INI_DIR#${EPREFIX}}/fpm.d"
232 - doins sapi/fpm/www.conf
233 - fi
234 -
235 - dodoc php.ini-{development,production}
236 -}
237 -
238 -php_set_ini_dir() {
239 - PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}"
240 - PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
241 - PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
242 -}
243 -
244 -src_prepare() {
245 - default
246 -
247 - # In php-7.x, the FPM pool configuration files have been split off
248 - # of the main config. By default the pool config files go in
249 - # e.g. /etc/php-fpm.d, which isn't slotted. So here we move the
250 - # include directory to a subdirectory "fpm.d" of $PHP_INI_DIR. Later
251 - # we'll install the pool configuration file "www.conf" there.
252 - php_set_ini_dir fpm
253 - sed -i "s~^include=.*$~include=${PHP_INI_DIR}/fpm.d/*.conf~" \
254 - sapi/fpm/php-fpm.conf.in \
255 - || die 'failed to move the include directory in php-fpm.conf'
256 -
257 - # Emulate buildconf to support cross-compilation
258 - rm -fr aclocal.m4 autom4te.cache config.cache \
259 - configure main/php_config.h.in || die
260 - eautoconf --force
261 - eautoheader
262 -
263 - # Remove false positive test failures
264 - # stream_isatty fails due to portage redirects
265 - # curl tests here fail for network sandbox issues
266 - # session tests here fail because we set the session directory to $T
267 - rm tests/output/stream_isatty_err.phpt \
268 - tests/output/stream_isatty_out-err.phpt \
269 - tests/output/stream_isatty_out.phpt \
270 - ext/curl/tests/bug76675.phpt \
271 - ext/curl/tests/bug77535.phpt \
272 - ext/curl/tests/curl_error_basic.phpt \
273 - ext/session/tests/bug74514.phpt \
274 - ext/session/tests/bug74936.phpt || die
275 -
276 -}
277 -
278 -src_configure() {
279 - addpredict /usr/share/snmp/mibs/.index #nowarn
280 - addpredict /var/lib/net-snmp/mib_indexes #nowarn
281 -
282 - PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
283 -
284 - # The php-fpm config file wants localstatedir to be ${EPREFIX}/var
285 - # and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002.
286 - local our_conf=(
287 - --prefix="${PHP_DESTDIR}"
288 - --mandir="${PHP_DESTDIR}/man"
289 - --infodir="${PHP_DESTDIR}/info"
290 - --libdir="${PHP_DESTDIR}/lib"
291 - --with-libdir="$(get_libdir)"
292 - --localstatedir="${EPREFIX}/var"
293 - --without-pear
294 - $(use_enable threads zts)
295 - )
296 -
297 - our_conf+=(
298 - $(use_with apparmor fpm-apparmor)
299 - $(use_with argon2 password-argon2 "${EPREFIX}/usr")
300 - $(use_enable bcmath)
301 - $(use_with bzip2 bz2 "${EPREFIX}/usr")
302 - $(use_enable calendar)
303 - $(use_enable coverage gcov)
304 - $(use_enable ctype)
305 - $(use_with curl)
306 - $(use_enable xml dom)
307 - $(use_with enchant)
308 - $(use_enable exif)
309 - $(use_with ffi)
310 - $(use_enable fileinfo)
311 - $(use_enable filter)
312 - $(use_enable ftp)
313 - $(use_with nls gettext "${EPREFIX}/usr")
314 - $(use_with gmp gmp "${EPREFIX}/usr")
315 - $(use_with mhash mhash "${EPREFIX}/usr")
316 - $(use_with iconv iconv \
317 - $(use elibc_glibc || use elibc_musl || echo "${EPREFIX}/usr"))
318 - $(use_enable intl)
319 - $(use_enable ipv6)
320 - $(use_with kerberos)
321 - $(use_with xml libxml)
322 - $(use_enable unicode mbstring)
323 - $(use_with ssl openssl)
324 - $(use_enable pcntl)
325 - $(use_enable phar)
326 - $(use_enable pdo)
327 - $(use_enable opcache)
328 - $(use_with postgres pgsql "${EPREFIX}/usr")
329 - $(use_enable posix)
330 - $(use_with spell pspell "${EPREFIX}/usr")
331 - $(use_enable simplexml)
332 - $(use_enable sharedmem shmop)
333 - $(use_with snmp snmp "${EPREFIX}/usr")
334 - $(use_enable soap)
335 - $(use_enable sockets)
336 - $(use_with sodium)
337 - $(use_with sqlite sqlite3)
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)
343 - $(use_enable xml)
344 - $(use_enable xmlreader)
345 - $(use_enable xmlwriter)
346 - $(use_with xslt xsl)
347 - $(use_with zip)
348 - $(use_with zlib zlib "${EPREFIX}/usr")
349 - $(use_enable debug)
350 - )
351 -
352 - # DBA support
353 - if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
354 - || use qdbm || use lmdb || use tokyocabinet ; then
355 - our_conf+=( "--enable-dba" )
356 - fi
357 -
358 - # DBA drivers support
359 - our_conf+=(
360 - $(use_with cdb)
361 - $(use_with berkdb db4 "${EPREFIX}/usr")
362 - $(use_enable flatfile)
363 - $(use_with gdbm gdbm "${EPREFIX}/usr")
364 - $(use_enable inifile)
365 - $(use_with qdbm qdbm "${EPREFIX}/usr")
366 - $(use_with tokyocabinet tcadb "${EPREFIX}/usr")
367 - $(use_with lmdb lmdb "${EPREFIX}/usr")
368 - )
369 -
370 - # Support for the GD graphics library
371 - our_conf+=(
372 - $(use_with truetype freetype)
373 - $(use_enable cjk gd-jis-conv)
374 - $(use_with gd jpeg)
375 - $(use_with xpm)
376 - $(use_with webp)
377 - )
378 - # enable gd last, so configure can pick up the previous settings
379 - our_conf+=( $(use_enable gd) )
380 -
381 - # IMAP support
382 - if use imap ; then
383 - our_conf+=(
384 - $(use_with imap imap "${EPREFIX}/usr")
385 - $(use_with ssl imap-ssl "${EPREFIX}/usr")
386 - )
387 - fi
388 -
389 - # LDAP support
390 - if use ldap ; then
391 - our_conf+=(
392 - $(use_with ldap ldap "${EPREFIX}/usr")
393 - $(use_with ldap-sasl)
394 - )
395 - fi
396 -
397 - # MySQL support
398 - local mysqllib="mysqlnd"
399 - local mysqlilib="mysqlnd"
400 -
401 - our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
402 -
403 - local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock"
404 - if use mysql || use mysqli ; then
405 - our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") )
406 - fi
407 -
408 - # ODBC support
409 - if use odbc && use iodbc ; then
410 - our_conf+=(
411 - --without-unixODBC
412 - --with-iodbc
413 - $(use_with pdo pdo-odbc "iODBC,${EPREFIX}/usr")
414 - )
415 - elif use odbc ; then
416 - our_conf+=(
417 - --with-unixODBC="${EPREFIX}/usr"
418 - --without-iodbc
419 - $(use_with pdo pdo-odbc "unixODBC,${EPREFIX}/usr")
420 - )
421 - else
422 - our_conf+=(
423 - --without-unixODBC
424 - --without-iodbc
425 - --without-pdo-odbc
426 - )
427 - fi
428 -
429 - # Oracle support
430 - our_conf+=( $(use_with oci8-instant-client oci8) )
431 -
432 - # PDO support
433 - if use pdo ; then
434 - our_conf+=(
435 - $(use_with mssql pdo-dblib "${EPREFIX}/usr")
436 - $(use_with mysql pdo-mysql "${mysqllib}")
437 - $(use_with postgres pdo-pgsql)
438 - $(use_with sqlite pdo-sqlite)
439 - $(use_with firebird pdo-firebird "${EPREFIX}/usr")
440 - $(use_with oci8-instant-client pdo-oci)
441 - )
442 - fi
443 -
444 - # readline/libedit support
445 - our_conf+=(
446 - $(use_with readline readline "${EPREFIX}/usr")
447 - $(use_with libedit)
448 - )
449 -
450 - # Session support
451 - if use session ; then
452 - our_conf+=( $(use_with session-mm mm "${EPREFIX}/usr") )
453 - else
454 - our_conf+=( $(use_enable session) )
455 - fi
456 -
457 - # Use pic for shared modules such as apache2's mod_php
458 - our_conf+=( --with-pic )
459 -
460 - # we use the system copy of pcre
461 - # --with-external-pcre affects ext/pcre
462 - our_conf+=(
463 - --with-external-pcre
464 - $(use_with jit pcre-jit)
465 - )
466 -
467 - # Catch CFLAGS problems
468 - # Fixes bug #14067.
469 - # Changed order to run it in reverse for bug #32022 and #12021.
470 - replace-cpu-flags "k6*" "i586"
471 -
472 - # Cache the ./configure test results between SAPIs.
473 - our_conf+=( --cache-file="${T}/config.cache" )
474 -
475 - # Support user-passed configuration parameters
476 - our_conf+=( ${EXTRA_ECONF:-} )
477 -
478 - # Support the Apache2 extras, they must be set globally for all
479 - # SAPIs to work correctly, especially for external PHP extensions
480 -
481 - local one_sapi
482 - local sapi
483 - mkdir -p "${WORKDIR}/sapis-build" || die
484 - for one_sapi in $SAPIS ; do
485 - use "${one_sapi}" || continue
486 - php_set_ini_dir "${one_sapi}"
487 -
488 - # The BUILD_DIR variable is used to determine where to output
489 - # the files that autotools creates. This was all originally
490 - # based on the autotools-utils eclass.
491 - BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}"
492 - cp -a "${S}" "${BUILD_DIR}" || die
493 - cd "${BUILD_DIR}" || die
494 -
495 - local sapi_conf=(
496 - --with-config-file-path="${PHP_INI_DIR}"
497 - --with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}"
498 - )
499 -
500 - for sapi in $SAPIS ; do
501 - case "$sapi" in
502 - cli|cgi|embed|fpm|phpdbg)
503 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
504 - sapi_conf+=( "--enable-${sapi}" )
505 - if [[ "fpm" == "${sapi}" ]] ; then
506 - sapi_conf+=(
507 - $(use_with acl fpm-acl)
508 - $(use_with systemd fpm-systemd)
509 - )
510 - fi
511 - else
512 - sapi_conf+=( "--disable-${sapi}" )
513 - fi
514 - ;;
515 -
516 - apache2)
517 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
518 - sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" )
519 - else
520 - sapi_conf+=( --without-apxs2 )
521 - fi
522 - ;;
523 - esac
524 - done
525 -
526 - # Construct the $myeconfargs array by concatenating $our_conf
527 - # (the common args) and $sapi_conf (the SAPI-specific args).
528 - local myeconfargs=( "${our_conf[@]}" )
529 - myeconfargs+=( "${sapi_conf[@]}" )
530 -
531 - pushd "${BUILD_DIR}" > /dev/null || die
532 - econf "${myeconfargs[@]}"
533 - popd > /dev/null || die
534 - done
535 -}
536 -
537 -src_compile() {
538 - # snmp seems to run during src_compile, too (bug #324739)
539 - addpredict /usr/share/snmp/mibs/.index #nowarn
540 - addpredict /var/lib/net-snmp/mib_indexes #nowarn
541 -
542 - local sapi
543 - for sapi in ${SAPIS} ; do
544 - if use "${sapi}"; then
545 - cd "${WORKDIR}/sapis-build/$sapi" || \
546 - die "Failed to change dir to ${WORKDIR}/sapis-build/$1"
547 - emake
548 - fi
549 - done
550 -}
551 -
552 -src_install() {
553 - # see bug #324739 for what happens when we don't have that
554 - addpredict /usr/share/snmp/mibs/.index #nowarn
555 -
556 - # grab the first SAPI that got built and install common files from there
557 - local first_sapi="", sapi=""
558 - for sapi in $SAPIS ; do
559 - if use $sapi ; then
560 - first_sapi=$sapi
561 - break
562 - fi
563 - done
564 -
565 - # Makefile forgets to create this before trying to write to it...
566 - dodir "${PHP_DESTDIR#${EPREFIX}}/bin"
567 -
568 - # Install php environment (without any sapis)
569 - cd "${WORKDIR}/sapis-build/$first_sapi" || die
570 - emake INSTALL_ROOT="${D}" \
571 - install-build install-headers install-programs
572 -
573 - local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)"
574 -
575 - # Create the directory where we'll put version-specific php scripts
576 - keepdir "/usr/share/php${PHP_MV}"
577 -
578 - local file=""
579 - local sapi_list=""
580 -
581 - for sapi in ${SAPIS}; do
582 - if use "${sapi}" ; then
583 - einfo "Installing SAPI: ${sapi}"
584 - cd "${WORKDIR}/sapis-build/${sapi}" || die
585 -
586 - if [[ "${sapi}" == "apache2" ]] ; then
587 - # We're specifically not using emake install-sapi as libtool
588 - # may cause unnecessary relink failures (see bug #351266)
589 - insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/"
590 - newins ".libs/libphp$(get_libname)" \
591 - "libphp${PHP_MV}$(get_libname)"
592 - keepdir "/usr/$(get_libdir)/apache2/modules"
593 - else
594 - # needed each time, php_install_ini would reset it
595 - local dest="${PHP_DESTDIR#${EPREFIX}}"
596 - into "${dest}"
597 - case "$sapi" in
598 - cli)
599 - source="sapi/cli/php"
600 - # Install the "phar" archive utility.
601 - if use phar ; then
602 - emake INSTALL_ROOT="${D}" install-pharcmd
603 - dosym "..${dest#/usr}/bin/phar" "/usr/bin/phar${SLOT}"
604 - fi
605 - ;;
606 - cgi)
607 - source="sapi/cgi/php-cgi"
608 - ;;
609 - fpm)
610 - source="sapi/fpm/php-fpm"
611 - ;;
612 - embed)
613 - source="libs/libphp$(get_libname)"
614 - ;;
615 - phpdbg)
616 - source="sapi/phpdbg/phpdbg"
617 - ;;
618 - *)
619 - die "unhandled sapi in src_install"
620 - ;;
621 - esac
622 -
623 - if [[ "${source}" == *"$(get_libname)" ]]; then
624 - dolib.so "${source}"
625 - else
626 - dobin "${source}"
627 - local name="$(basename ${source})"
628 - dosym "..${dest#/usr}/bin/${name}" "/usr/bin/${name}${SLOT}"
629 - fi
630 - fi
631 -
632 - php_install_ini "${sapi}"
633 -
634 - # construct correct SAPI string for php-config
635 - # thanks to ferringb for the bash voodoo
636 - if [[ "${sapi}" == "apache2" ]]; then
637 - sapi_list="${sapi_list:+${sapi_list} }apache2handler"
638 - else
639 - sapi_list="${sapi_list:+${sapi_list} }${sapi}"
640 - fi
641 - fi
642 - done
643 -
644 - # Installing opcache module
645 - if use opcache ; then
646 - into "${PHP_DESTDIR#${EPREFIX}}"
647 - dolib.so "modules/opcache$(get_libname)"
648 - fi
649 -
650 - # Install env.d files
651 - newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}"
652 - sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
653 - sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
654 -
655 - # set php-config variable correctly (bug #278439)
656 - sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \
657 - "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die
658 -
659 - if use fpm ; then
660 - if use systemd; then
661 - systemd_newunit "${FILESDIR}/php-fpm_at.service" \
662 - "php-fpm@${SLOT}.service"
663 - else
664 - systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \
665 - "php-fpm@${SLOT}.service"
666 - fi
667 - fi
668 -}
669 -
670 -src_test() {
671 - echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
672 - PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
673 - if [[ ! -x "${PHP_BIN}" ]] ; then
674 - ewarn "Test phase requires USE=cli, skipping"
675 - return
676 - else
677 - export TEST_PHP_EXECUTABLE="${PHP_BIN}"
678 - fi
679 -
680 - if [[ -x "${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" ]] ; then
681 - export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi"
682 - fi
683 -
684 - if [[ -x "${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" ]] ; then
685 - export TEST_PHPDBG_EXECUTABLE="${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg"
686 - fi
687 -
688 - REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \
689 - "session.save_path=${T}" \
690 - "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \
691 - "session.save_path=${T}"
692 -
693 - for name in ${EXPECTED_TEST_FAILURES}; do
694 - mv "${name}.out" "${name}.out.orig" 2>/dev/null || die
695 - done
696 -
697 - local failed="$(find -name '*.out')"
698 - if [[ ${failed} != "" ]] ; then
699 - ewarn "The following test cases failed unexpectedly:"
700 - for name in ${failed}; do
701 - ewarn " ${name/.out/}"
702 - done
703 - else
704 - einfo "No unexpected test failures, all fine"
705 - fi
706 -
707 - if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
708 - local passed=""
709 - for name in ${EXPECTED_TEST_FAILURES}; do
710 - [[ -f "${name}.diff" ]] && continue
711 - passed="${passed} ${name}"
712 - done
713 - if [[ ${passed} != "" ]] ; then
714 - einfo "The following test cases passed unexpectedly:"
715 - for name in ${passed}; do
716 - ewarn " ${passed}"
717 - done
718 - else
719 - einfo "None of the known-to-fail tests passed, all fine"
720 - fi
721 - fi
722 -}
723 -
724 -pkg_postinst() {
725 - # Output some general info to the user
726 - if use apache2 ; then
727 - elog
728 - elog "To enable PHP in apache, you will need to add \"-D PHP\" to"
729 - elog "your apache2 command. OpenRC users can append that string to"
730 - elog "APACHE2_OPTS in /etc/conf.d/apache2."
731 - elog
732 - elog "The apache module configuration file 70_mod_php.conf is"
733 - elog "provided (and maintained) by eselect-php."
734 - elog
735 - fi
736 -
737 - # Create the symlinks for php
738 - local m
739 - for m in ${SAPIS}; do
740 - [[ ${m} == 'embed' ]] && continue;
741 - if use $m ; then
742 - local ci=$(eselect php show $m)
743 - if [[ -z $ci ]]; then
744 - eselect php set $m php${SLOT} || die
745 - einfo "Switched ${m} to use php:${SLOT}"
746 - einfo
747 - elif [[ $ci != "php${SLOT}" ]] ; then
748 - elog "To switch $m to use php:${SLOT}, run"
749 - elog " eselect php set $m php${SLOT}"
750 - elog
751 - fi
752 - fi
753 - done
754 -
755 - # Remove dead symlinks for SAPIs that were just disabled. For
756 - # example, if the user has the cgi SAPI enabled, then he has an
757 - # eselect-php symlink for it. If he later reinstalls PHP with
758 - # USE="-cgi", that symlink will break. This call to eselect is
759 - # supposed to remove that dead link per bug 572436.
760 - eselect php cleanup || die
761 -
762 - if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then
763 - elog "To build extensions for this version of PHP, you will need to"
764 - elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable."
765 - elog
766 - fi
767 -
768 - # Warn about the removal of PHP_INI_VERSION if the user has it set.
769 - if [[ -n "${PHP_INI_VERSION}" ]]; then
770 - ewarn 'The PHP_INI_VERSION variable has been phased out. You may'
771 - ewarn 'remove it from your configuration at your convenience. See'
772 - ewarn
773 - ewarn ' https://bugs.gentoo.org/611214'
774 - ewarn
775 - ewarn 'for more information.'
776 - fi
777 -
778 - elog "For details on how version slotting works, please see"
779 - elog "the wiki:"
780 - elog
781 - elog " https://wiki.gentoo.org/wiki/PHP"
782 - elog
783 -}
784 -
785 -pkg_postrm() {
786 - # This serves two purposes. First, if we have just removed the last
787 - # installed version of PHP, then this will remove any dead symlinks
788 - # belonging to eselect-php. Second, if a user upgrades slots from
789 - # (say) 5.6 to 7.0 and depcleans the old slot, then this will update
790 - # his existing symlinks to point to the new 7.0 installation. The
791 - # latter is bug 432962.
792 - #
793 - # Note: the eselect-php package may not be installed at this point,
794 - # so we can't die() if this command fails.
795 - eselect php cleanup
796 -}
797
798 diff --git a/dev-lang/php/php-8.1.0.ebuild b/dev-lang/php/php-8.1.0.ebuild
799 deleted file mode 100644
800 index 423e9f806689..000000000000
801 --- a/dev-lang/php/php-8.1.0.ebuild
802 +++ /dev/null
803 @@ -1,759 +0,0 @@
804 -# Copyright 1999-2022 Gentoo Authors
805 -# Distributed under the terms of the GNU General Public License v2
806 -
807 -EAPI="8"
808 -
809 -WANT_AUTOMAKE="none"
810 -
811 -inherit flag-o-matic systemd autotools
812 -
813 -MY_PV=${PV/_rc/RC}
814 -DESCRIPTION="The PHP language runtime engine"
815 -HOMEPAGE="https://www.php.net/"
816 -SRC_URI="https://www.php.net/distributions/${P}.tar.xz"
817 -
818 -LICENSE="PHP-3.01
819 - BSD
820 - Zend-2.0
821 - bcmath? ( LGPL-2.1+ )
822 - fpm? ( BSD-2 )
823 - gd? ( gd )
824 - unicode? ( BSD-2 LGPL-2.1 )"
825 -
826 -SLOT="$(ver_cut 1-2)"
827 -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos"
828 -
829 -S="${WORKDIR}/${PN}-${MY_PV}"
830 -
831 -# We can build the following SAPIs in the given order
832 -SAPIS="embed cli cgi fpm apache2 phpdbg"
833 -
834 -# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
835 -IUSE="${IUSE}
836 - ${SAPIS/cli/+cli}
837 - threads"
838 -
839 -IUSE="${IUSE} acl apparmor argon2 bcmath berkdb bzip2 calendar cdb cjk
840 - coverage +ctype curl debug
841 - enchant exif ffi +fileinfo +filter firebird
842 - +flatfile ftp gd gdbm gmp +iconv imap inifile
843 - intl iodbc ipv6 +jit kerberos ldap ldap-sasl libedit lmdb
844 - mhash mssql mysql mysqli nls
845 - oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
846 - readline selinux +session session-mm sharedmem
847 - +simplexml snmp soap sockets sodium spell sqlite ssl
848 - sysvipc systemd test tidy +tokenizer tokyocabinet truetype unicode webp
849 - +xml xmlreader xmlwriter xpm xslt zip zlib"
850 -
851 -# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
852 -# The Oracle instant client provides its own incompatible ldap library.
853 -REQUIRED_USE="
854 - || ( cli cgi fpm apache2 embed phpdbg )
855 - cli? ( ^^ ( readline libedit ) )
856 - !cli? ( ?? ( readline libedit ) )
857 - truetype? ( gd zlib )
858 - webp? ( gd zlib )
859 - cjk? ( gd zlib )
860 - exif? ( gd zlib )
861 - xpm? ( gd zlib )
862 - gd? ( zlib )
863 - simplexml? ( xml )
864 - soap? ( xml )
865 - xmlreader? ( xml )
866 - xmlwriter? ( xml )
867 - xslt? ( xml )
868 - ldap-sasl? ( ldap )
869 - oci8-instant-client? ( !ldap )
870 - qdbm? ( !gdbm )
871 - session-mm? ( session !threads )
872 - mysql? ( || ( mysqli pdo ) )
873 - firebird? ( pdo )
874 - mssql? ( pdo )
875 -"
876 -
877 -RESTRICT="!test? ( test )"
878 -
879 -# The supported (that is, autodetected) versions of BDB are listed in
880 -# the ./configure script. Other versions *work*, but we need to stick to
881 -# the ones that can be detected to avoid a repeat of bug #564824.
882 -COMMON_DEPEND="
883 - >=app-eselect/eselect-php-0.9.7[apache2?,fpm?]
884 - >=dev-libs/libpcre2-10.30[jit?,unicode]
885 - fpm? ( acl? ( sys-apps/acl ) apparmor? ( sys-libs/libapparmor ) )
886 - apache2? ( www-servers/apache[apache2_modules_unixd(+),threads=] )
887 - argon2? ( app-crypt/argon2:= )
888 - berkdb? ( || ( sys-libs/db:5.3 sys-libs/db:4.8 ) )
889 - bzip2? ( app-arch/bzip2:0= )
890 - cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
891 - coverage? ( dev-util/lcov )
892 - curl? ( >=net-misc/curl-7.29.0 )
893 - enchant? ( app-text/enchant:2 )
894 - ffi? ( >=dev-libs/libffi-3.0.11:= )
895 - firebird? ( dev-db/firebird )
896 - gd? ( >=virtual/jpeg-0-r3:0 media-libs/libpng:0= )
897 - gdbm? ( >=sys-libs/gdbm-1.8.0:0= )
898 - gmp? ( dev-libs/gmp:0= )
899 - iconv? ( virtual/libiconv )
900 - imap? ( >=virtual/imap-c-client-2[kerberos=,ssl=] )
901 - intl? ( dev-libs/icu:= )
902 - kerberos? ( virtual/krb5 )
903 - ldap? ( >=net-nds/openldap-1.2.11 )
904 - ldap-sasl? ( dev-libs/cyrus-sasl )
905 - libedit? ( dev-libs/libedit )
906 - lmdb? ( dev-db/lmdb:= )
907 - mssql? ( dev-db/freetds[mssql] )
908 - nls? ( sys-devel/gettext )
909 - oci8-instant-client? ( dev-db/oracle-instantclient[sdk] )
910 - odbc? ( iodbc? ( dev-db/libiodbc ) !iodbc? ( >=dev-db/unixODBC-1.8.13 ) )
911 - postgres? ( >=dev-db/postgresql-9.1:* )
912 - qdbm? ( dev-db/qdbm )
913 - readline? ( sys-libs/readline:0= )
914 - session-mm? ( dev-libs/mm )
915 - snmp? ( >=net-analyzer/net-snmp-5.2 )
916 - sodium? ( dev-libs/libsodium:=[-minimal] )
917 - spell? ( >=app-text/aspell-0.50 )
918 - sqlite? ( >=dev-db/sqlite-3.7.6.3 )
919 - ssl? ( >=dev-libs/openssl-1.0.2:0= )
920 - tidy? ( app-text/htmltidy )
921 - tokyocabinet? ( dev-db/tokyocabinet )
922 - truetype? ( =media-libs/freetype-2* )
923 - unicode? ( dev-libs/oniguruma:= )
924 - webp? ( media-libs/libwebp:0= )
925 - xml? ( >=dev-libs/libxml2-2.9.0 )
926 - xpm? ( x11-libs/libXpm )
927 - xslt? ( dev-libs/libxslt )
928 - zip? ( >=dev-libs/libzip-1.2.0:= )
929 - zlib? ( >=sys-libs/zlib-1.2.0.4:0= )
930 -"
931 -
932 -IDEPEND=">=app-eselect/eselect-php-0.9.7[apache2?,fpm?]"
933 -
934 -RDEPEND="${COMMON_DEPEND}
935 - virtual/mta
936 - fpm? (
937 - selinux? ( sec-policy/selinux-phpfpm )
938 - systemd? ( sys-apps/systemd ) )"
939 -
940 -# Bison isn't actually needed when building from a release tarball
941 -# However, the configure script will warn if it's absent or if you
942 -# have an incompatible version installed. See bug 593278.
943 -DEPEND="${COMMON_DEPEND}
944 - app-arch/xz-utils
945 - >=sys-devel/bison-3.0.1"
946 -
947 -BDEPEND="virtual/pkgconfig"
948 -
949 -PHP_MV="$(ver_cut 1)"
950 -
951 -PATCHES=(
952 - "${FILESDIR}/php-iodbc-header-location.patch"
953 -)
954 -
955 -php_install_ini() {
956 - local phpsapi="${1}"
957 -
958 - # work out where we are installing the ini file
959 - php_set_ini_dir "${phpsapi}"
960 -
961 - # Always install the production INI file, bug 611214.
962 - local phpinisrc="php.ini-production-${phpsapi}"
963 - cp php.ini-production "${phpinisrc}" || die
964 -
965 - # default to /tmp for save_path, bug #282768
966 - sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die
967 -
968 - # Set the extension dir
969 - sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \
970 - -i "${phpinisrc}" || die
971 -
972 - # Set the include path to point to where we want to find PEAR packages
973 - sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die
974 -
975 - insinto "${PHP_INI_DIR#${EPREFIX}}"
976 - newins "${phpinisrc}" php.ini
977 -
978 - elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}"
979 - elog
980 -
981 - dodir "${PHP_EXT_INI_DIR#${EPREFIX}}"
982 - dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}"
983 -
984 - if use opcache; then
985 - elog "Adding opcache to $PHP_EXT_INI_DIR"
986 - echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \
987 - "${D}/${PHP_EXT_INI_DIR}"/opcache.ini
988 - dosym "../ext/opcache.ini" \
989 - "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini"
990 - fi
991 -
992 - # SAPI-specific handling
993 - if [[ "${sapi}" == "fpm" ]] ; then
994 - einfo "Installing FPM config files php-fpm.conf and www.conf"
995 - insinto "${PHP_INI_DIR#${EPREFIX}}"
996 - doins sapi/fpm/php-fpm.conf
997 - insinto "${PHP_INI_DIR#${EPREFIX}}/fpm.d"
998 - doins sapi/fpm/www.conf
999 - fi
1000 -
1001 - dodoc php.ini-{development,production}
1002 -}
1003 -
1004 -php_set_ini_dir() {
1005 - PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}"
1006 - PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
1007 - PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
1008 -}
1009 -
1010 -src_prepare() {
1011 - default
1012 -
1013 - # In php-7.x, the FPM pool configuration files have been split off
1014 - # of the main config. By default the pool config files go in
1015 - # e.g. /etc/php-fpm.d, which isn't slotted. So here we move the
1016 - # include directory to a subdirectory "fpm.d" of $PHP_INI_DIR. Later
1017 - # we'll install the pool configuration file "www.conf" there.
1018 - php_set_ini_dir fpm
1019 - sed -i "s~^include=.*$~include=${PHP_INI_DIR}/fpm.d/*.conf~" \
1020 - sapi/fpm/php-fpm.conf.in \
1021 - || die 'failed to move the include directory in php-fpm.conf'
1022 -
1023 - # Emulate buildconf to support cross-compilation
1024 - rm -fr aclocal.m4 autom4te.cache config.cache \
1025 - configure main/php_config.h.in || die
1026 - eautoconf --force
1027 - eautoheader
1028 -
1029 - # Remove false positive test failures
1030 - # stream_isatty fails due to portage redirects
1031 - # curl tests here fail for network sandbox issues
1032 - # session tests here fail because we set the session directory to $T
1033 - rm tests/output/stream_isatty_err.phpt \
1034 - tests/output/stream_isatty_out-err.phpt \
1035 - tests/output/stream_isatty_out.phpt \
1036 - ext/curl/tests/bug76675.phpt \
1037 - ext/curl/tests/bug77535.phpt \
1038 - ext/curl/tests/curl_error_basic.phpt \
1039 - ext/session/tests/bug74514.phpt \
1040 - ext/session/tests/bug74936.phpt || die
1041 -
1042 -}
1043 -
1044 -src_configure() {
1045 - addpredict /usr/share/snmp/mibs/.index #nowarn
1046 - addpredict /var/lib/net-snmp/mib_indexes #nowarn
1047 -
1048 - PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
1049 -
1050 - # The php-fpm config file wants localstatedir to be ${EPREFIX}/var
1051 - # and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002.
1052 - local our_conf=(
1053 - --prefix="${PHP_DESTDIR}"
1054 - --mandir="${PHP_DESTDIR}/man"
1055 - --infodir="${PHP_DESTDIR}/info"
1056 - --libdir="${PHP_DESTDIR}/lib"
1057 - --with-libdir="$(get_libdir)"
1058 - --localstatedir="${EPREFIX}/var"
1059 - --without-pear
1060 - $(use_enable threads zts)
1061 - )
1062 -
1063 - our_conf+=(
1064 - $(use_with apparmor fpm-apparmor)
1065 - $(use_with argon2 password-argon2 "${EPREFIX}/usr")
1066 - $(use_enable bcmath)
1067 - $(use_with bzip2 bz2 "${EPREFIX}/usr")
1068 - $(use_enable calendar)
1069 - $(use_enable coverage gcov)
1070 - $(use_enable ctype)
1071 - $(use_with curl)
1072 - $(use_enable xml dom)
1073 - $(use_with enchant)
1074 - $(use_enable exif)
1075 - $(use_with ffi)
1076 - $(use_enable fileinfo)
1077 - $(use_enable filter)
1078 - $(use_enable ftp)
1079 - $(use_with nls gettext "${EPREFIX}/usr")
1080 - $(use_with gmp gmp "${EPREFIX}/usr")
1081 - $(use_with mhash mhash "${EPREFIX}/usr")
1082 - $(use_with iconv iconv \
1083 - $(use elibc_glibc || use elibc_musl || echo "${EPREFIX}/usr"))
1084 - $(use_enable intl)
1085 - $(use_enable ipv6)
1086 - $(use_with kerberos)
1087 - $(use_with xml libxml)
1088 - $(use_enable unicode mbstring)
1089 - $(use_with ssl openssl)
1090 - $(use_enable pcntl)
1091 - $(use_enable phar)
1092 - $(use_enable pdo)
1093 - $(use_enable opcache)
1094 - $(use_with postgres pgsql "${EPREFIX}/usr")
1095 - $(use_enable posix)
1096 - $(use_with spell pspell "${EPREFIX}/usr")
1097 - $(use_enable simplexml)
1098 - $(use_enable sharedmem shmop)
1099 - $(use_with snmp snmp "${EPREFIX}/usr")
1100 - $(use_enable soap)
1101 - $(use_enable sockets)
1102 - $(use_with sodium)
1103 - $(use_with sqlite sqlite3)
1104 - $(use_enable sysvipc sysvmsg)
1105 - $(use_enable sysvipc sysvsem)
1106 - $(use_enable sysvipc sysvshm)
1107 - $(use_with tidy tidy "${EPREFIX}/usr")
1108 - $(use_enable tokenizer)
1109 - $(use_enable xml)
1110 - $(use_enable xmlreader)
1111 - $(use_enable xmlwriter)
1112 - $(use_with xslt xsl)
1113 - $(use_with zip)
1114 - $(use_with zlib zlib "${EPREFIX}/usr")
1115 - $(use_enable debug)
1116 - )
1117 -
1118 - # DBA support
1119 - if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
1120 - || use qdbm || use lmdb || use tokyocabinet ; then
1121 - our_conf+=( "--enable-dba" )
1122 - fi
1123 -
1124 - # DBA drivers support
1125 - our_conf+=(
1126 - $(use_with cdb)
1127 - $(use_with berkdb db4 "${EPREFIX}/usr")
1128 - $(use_enable flatfile)
1129 - $(use_with gdbm gdbm "${EPREFIX}/usr")
1130 - $(use_enable inifile)
1131 - $(use_with qdbm qdbm "${EPREFIX}/usr")
1132 - $(use_with tokyocabinet tcadb "${EPREFIX}/usr")
1133 - $(use_with lmdb lmdb "${EPREFIX}/usr")
1134 - )
1135 -
1136 - # Support for the GD graphics library
1137 - our_conf+=(
1138 - $(use_with truetype freetype)
1139 - $(use_enable cjk gd-jis-conv)
1140 - $(use_with gd jpeg)
1141 - $(use_with xpm)
1142 - $(use_with webp)
1143 - )
1144 - # enable gd last, so configure can pick up the previous settings
1145 - our_conf+=( $(use_enable gd) )
1146 -
1147 - # IMAP support
1148 - if use imap ; then
1149 - our_conf+=(
1150 - $(use_with imap imap "${EPREFIX}/usr")
1151 - $(use_with ssl imap-ssl "${EPREFIX}/usr")
1152 - )
1153 - fi
1154 -
1155 - # LDAP support
1156 - if use ldap ; then
1157 - our_conf+=(
1158 - $(use_with ldap ldap "${EPREFIX}/usr")
1159 - $(use_with ldap-sasl)
1160 - )
1161 - fi
1162 -
1163 - # MySQL support
1164 - local mysqllib="mysqlnd"
1165 - local mysqlilib="mysqlnd"
1166 -
1167 - our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
1168 -
1169 - local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock"
1170 - if use mysql || use mysqli ; then
1171 - our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") )
1172 - fi
1173 -
1174 - # ODBC support
1175 - if use odbc && use iodbc ; then
1176 - our_conf+=(
1177 - --without-unixODBC
1178 - --with-iodbc
1179 - $(use_with pdo pdo-odbc "iODBC,${EPREFIX}/usr")
1180 - )
1181 - elif use odbc ; then
1182 - our_conf+=(
1183 - --with-unixODBC="${EPREFIX}/usr"
1184 - --without-iodbc
1185 - $(use_with pdo pdo-odbc "unixODBC,${EPREFIX}/usr")
1186 - )
1187 - else
1188 - our_conf+=(
1189 - --without-unixODBC
1190 - --without-iodbc
1191 - --without-pdo-odbc
1192 - )
1193 - fi
1194 -
1195 - # Oracle support
1196 - our_conf+=( $(use_with oci8-instant-client oci8) )
1197 -
1198 - # PDO support
1199 - if use pdo ; then
1200 - our_conf+=(
1201 - $(use_with mssql pdo-dblib "${EPREFIX}/usr")
1202 - $(use_with mysql pdo-mysql "${mysqllib}")
1203 - $(use_with postgres pdo-pgsql)
1204 - $(use_with sqlite pdo-sqlite)
1205 - $(use_with firebird pdo-firebird "${EPREFIX}/usr")
1206 - $(use_with oci8-instant-client pdo-oci)
1207 - )
1208 - fi
1209 -
1210 - # readline/libedit support
1211 - our_conf+=(
1212 - $(use_with readline readline "${EPREFIX}/usr")
1213 - $(use_with libedit)
1214 - )
1215 -
1216 - # Session support
1217 - if use session ; then
1218 - our_conf+=( $(use_with session-mm mm "${EPREFIX}/usr") )
1219 - else
1220 - our_conf+=( $(use_enable session) )
1221 - fi
1222 -
1223 - # Use pic for shared modules such as apache2's mod_php
1224 - our_conf+=( --with-pic )
1225 -
1226 - # we use the system copy of pcre
1227 - # --with-external-pcre affects ext/pcre
1228 - our_conf+=(
1229 - --with-external-pcre
1230 - $(use_with jit pcre-jit)
1231 - )
1232 -
1233 - # Catch CFLAGS problems
1234 - # Fixes bug #14067.
1235 - # Changed order to run it in reverse for bug #32022 and #12021.
1236 - replace-cpu-flags "k6*" "i586"
1237 -
1238 - # Cache the ./configure test results between SAPIs.
1239 - our_conf+=( --cache-file="${T}/config.cache" )
1240 -
1241 - # Support user-passed configuration parameters
1242 - our_conf+=( ${EXTRA_ECONF:-} )
1243 -
1244 - # Support the Apache2 extras, they must be set globally for all
1245 - # SAPIs to work correctly, especially for external PHP extensions
1246 -
1247 - local one_sapi
1248 - local sapi
1249 - mkdir -p "${WORKDIR}/sapis-build" || die
1250 - for one_sapi in $SAPIS ; do
1251 - use "${one_sapi}" || continue
1252 - php_set_ini_dir "${one_sapi}"
1253 -
1254 - # The BUILD_DIR variable is used to determine where to output
1255 - # the files that autotools creates. This was all originally
1256 - # based on the autotools-utils eclass.
1257 - BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}"
1258 - cp -a "${S}" "${BUILD_DIR}" || die
1259 - cd "${BUILD_DIR}" || die
1260 -
1261 - local sapi_conf=(
1262 - --with-config-file-path="${PHP_INI_DIR}"
1263 - --with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}"
1264 - )
1265 -
1266 - for sapi in $SAPIS ; do
1267 - case "$sapi" in
1268 - cli|cgi|embed|fpm|phpdbg)
1269 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
1270 - sapi_conf+=( "--enable-${sapi}" )
1271 - if [[ "fpm" == "${sapi}" ]] ; then
1272 - sapi_conf+=(
1273 - $(use_with acl fpm-acl)
1274 - $(use_with systemd fpm-systemd)
1275 - )
1276 - fi
1277 - else
1278 - sapi_conf+=( "--disable-${sapi}" )
1279 - fi
1280 - ;;
1281 -
1282 - apache2)
1283 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
1284 - sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" )
1285 - else
1286 - sapi_conf+=( --without-apxs2 )
1287 - fi
1288 - ;;
1289 - esac
1290 - done
1291 -
1292 - # Construct the $myeconfargs array by concatenating $our_conf
1293 - # (the common args) and $sapi_conf (the SAPI-specific args).
1294 - local myeconfargs=( "${our_conf[@]}" )
1295 - myeconfargs+=( "${sapi_conf[@]}" )
1296 -
1297 - pushd "${BUILD_DIR}" > /dev/null || die
1298 - econf "${myeconfargs[@]}"
1299 - popd > /dev/null || die
1300 - done
1301 -}
1302 -
1303 -src_compile() {
1304 - # snmp seems to run during src_compile, too (bug #324739)
1305 - addpredict /usr/share/snmp/mibs/.index #nowarn
1306 - addpredict /var/lib/net-snmp/mib_indexes #nowarn
1307 -
1308 - local sapi
1309 - for sapi in ${SAPIS} ; do
1310 - if use "${sapi}"; then
1311 - cd "${WORKDIR}/sapis-build/$sapi" || \
1312 - die "Failed to change dir to ${WORKDIR}/sapis-build/$1"
1313 - emake
1314 - fi
1315 - done
1316 -}
1317 -
1318 -src_install() {
1319 - # see bug #324739 for what happens when we don't have that
1320 - addpredict /usr/share/snmp/mibs/.index #nowarn
1321 -
1322 - # grab the first SAPI that got built and install common files from there
1323 - local first_sapi="", sapi=""
1324 - for sapi in $SAPIS ; do
1325 - if use $sapi ; then
1326 - first_sapi=$sapi
1327 - break
1328 - fi
1329 - done
1330 -
1331 - # Makefile forgets to create this before trying to write to it...
1332 - dodir "${PHP_DESTDIR#${EPREFIX}}/bin"
1333 -
1334 - # Install php environment (without any sapis)
1335 - cd "${WORKDIR}/sapis-build/$first_sapi" || die
1336 - emake INSTALL_ROOT="${D}" \
1337 - install-build install-headers install-programs
1338 -
1339 - local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)"
1340 -
1341 - # Create the directory where we'll put version-specific php scripts
1342 - keepdir "/usr/share/php${PHP_MV}"
1343 -
1344 - local file=""
1345 - local sapi_list=""
1346 -
1347 - for sapi in ${SAPIS}; do
1348 - if use "${sapi}" ; then
1349 - einfo "Installing SAPI: ${sapi}"
1350 - cd "${WORKDIR}/sapis-build/${sapi}" || die
1351 -
1352 - if [[ "${sapi}" == "apache2" ]] ; then
1353 - # We're specifically not using emake install-sapi as libtool
1354 - # may cause unnecessary relink failures (see bug #351266)
1355 - insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/"
1356 - newins ".libs/libphp$(get_libname)" \
1357 - "libphp${PHP_MV}$(get_libname)"
1358 - keepdir "/usr/$(get_libdir)/apache2/modules"
1359 - else
1360 - # needed each time, php_install_ini would reset it
1361 - local dest="${PHP_DESTDIR#${EPREFIX}}"
1362 - into "${dest}"
1363 - case "$sapi" in
1364 - cli)
1365 - source="sapi/cli/php"
1366 - # Install the "phar" archive utility.
1367 - if use phar ; then
1368 - emake INSTALL_ROOT="${D}" install-pharcmd
1369 - dosym "..${dest#/usr}/bin/phar" "/usr/bin/phar${SLOT}"
1370 - fi
1371 - ;;
1372 - cgi)
1373 - source="sapi/cgi/php-cgi"
1374 - ;;
1375 - fpm)
1376 - source="sapi/fpm/php-fpm"
1377 - ;;
1378 - embed)
1379 - source="libs/libphp$(get_libname)"
1380 - ;;
1381 - phpdbg)
1382 - source="sapi/phpdbg/phpdbg"
1383 - ;;
1384 - *)
1385 - die "unhandled sapi in src_install"
1386 - ;;
1387 - esac
1388 -
1389 - if [[ "${source}" == *"$(get_libname)" ]]; then
1390 - dolib.so "${source}"
1391 - else
1392 - dobin "${source}"
1393 - local name="$(basename ${source})"
1394 - dosym "..${dest#/usr}/bin/${name}" "/usr/bin/${name}${SLOT}"
1395 - fi
1396 - fi
1397 -
1398 - php_install_ini "${sapi}"
1399 -
1400 - # construct correct SAPI string for php-config
1401 - # thanks to ferringb for the bash voodoo
1402 - if [[ "${sapi}" == "apache2" ]]; then
1403 - sapi_list="${sapi_list:+${sapi_list} }apache2handler"
1404 - else
1405 - sapi_list="${sapi_list:+${sapi_list} }${sapi}"
1406 - fi
1407 - fi
1408 - done
1409 -
1410 - # Installing opcache module
1411 - if use opcache ; then
1412 - into "${PHP_DESTDIR#${EPREFIX}}"
1413 - dolib.so "modules/opcache$(get_libname)"
1414 - fi
1415 -
1416 - # Install env.d files
1417 - newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}"
1418 - sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
1419 - sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
1420 -
1421 - # set php-config variable correctly (bug #278439)
1422 - sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \
1423 - "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die
1424 -
1425 - if use fpm ; then
1426 - if use systemd; then
1427 - systemd_newunit "${FILESDIR}/php-fpm_at.service" \
1428 - "php-fpm@${SLOT}.service"
1429 - else
1430 - systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \
1431 - "php-fpm@${SLOT}.service"
1432 - fi
1433 - fi
1434 -}
1435 -
1436 -src_test() {
1437 - echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
1438 - PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
1439 - if [[ ! -x "${PHP_BIN}" ]] ; then
1440 - ewarn "Test phase requires USE=cli, skipping"
1441 - return
1442 - else
1443 - export TEST_PHP_EXECUTABLE="${PHP_BIN}"
1444 - fi
1445 -
1446 - if [[ -x "${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" ]] ; then
1447 - export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi"
1448 - fi
1449 -
1450 - if [[ -x "${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" ]] ; then
1451 - export TEST_PHPDBG_EXECUTABLE="${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg"
1452 - fi
1453 -
1454 - REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \
1455 - "session.save_path=${T}" \
1456 - "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \
1457 - "session.save_path=${T}"
1458 -
1459 - for name in ${EXPECTED_TEST_FAILURES}; do
1460 - mv "${name}.out" "${name}.out.orig" 2>/dev/null || die
1461 - done
1462 -
1463 - local failed="$(find -name '*.out')"
1464 - if [[ ${failed} != "" ]] ; then
1465 - ewarn "The following test cases failed unexpectedly:"
1466 - for name in ${failed}; do
1467 - ewarn " ${name/.out/}"
1468 - done
1469 - else
1470 - einfo "No unexpected test failures, all fine"
1471 - fi
1472 -
1473 - if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
1474 - local passed=""
1475 - for name in ${EXPECTED_TEST_FAILURES}; do
1476 - [[ -f "${name}.diff" ]] && continue
1477 - passed="${passed} ${name}"
1478 - done
1479 - if [[ ${passed} != "" ]] ; then
1480 - einfo "The following test cases passed unexpectedly:"
1481 - for name in ${passed}; do
1482 - ewarn " ${passed}"
1483 - done
1484 - else
1485 - einfo "None of the known-to-fail tests passed, all fine"
1486 - fi
1487 - fi
1488 -}
1489 -
1490 -pkg_postinst() {
1491 - # Output some general info to the user
1492 - if use apache2 ; then
1493 - elog
1494 - elog "To enable PHP in apache, you will need to add \"-D PHP\" to"
1495 - elog "your apache2 command. OpenRC users can append that string to"
1496 - elog "APACHE2_OPTS in /etc/conf.d/apache2."
1497 - elog
1498 - elog "The apache module configuration file 70_mod_php.conf is"
1499 - elog "provided (and maintained) by eselect-php."
1500 - elog
1501 - fi
1502 -
1503 - # Create the symlinks for php
1504 - local m
1505 - for m in ${SAPIS}; do
1506 - [[ ${m} == 'embed' ]] && continue;
1507 - if use $m ; then
1508 - local ci=$(eselect php show $m)
1509 - if [[ -z $ci ]]; then
1510 - eselect php set $m php${SLOT} || die
1511 - einfo "Switched ${m} to use php:${SLOT}"
1512 - einfo
1513 - elif [[ $ci != "php${SLOT}" ]] ; then
1514 - elog "To switch $m to use php:${SLOT}, run"
1515 - elog " eselect php set $m php${SLOT}"
1516 - elog
1517 - fi
1518 - fi
1519 - done
1520 -
1521 - # Remove dead symlinks for SAPIs that were just disabled. For
1522 - # example, if the user has the cgi SAPI enabled, then he has an
1523 - # eselect-php symlink for it. If he later reinstalls PHP with
1524 - # USE="-cgi", that symlink will break. This call to eselect is
1525 - # supposed to remove that dead link per bug 572436.
1526 - eselect php cleanup || die
1527 -
1528 - if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then
1529 - elog "To build extensions for this version of PHP, you will need to"
1530 - elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable."
1531 - elog
1532 - fi
1533 -
1534 - # Warn about the removal of PHP_INI_VERSION if the user has it set.
1535 - if [[ -n "${PHP_INI_VERSION}" ]]; then
1536 - ewarn 'The PHP_INI_VERSION variable has been phased out. You may'
1537 - ewarn 'remove it from your configuration at your convenience. See'
1538 - ewarn
1539 - ewarn ' https://bugs.gentoo.org/611214'
1540 - ewarn
1541 - ewarn 'for more information.'
1542 - fi
1543 -
1544 - elog "For details on how version slotting works, please see"
1545 - elog "the wiki:"
1546 - elog
1547 - elog " https://wiki.gentoo.org/wiki/PHP"
1548 - elog
1549 -}
1550 -
1551 -pkg_postrm() {
1552 - # This serves two purposes. First, if we have just removed the last
1553 - # installed version of PHP, then this will remove any dead symlinks
1554 - # belonging to eselect-php. Second, if a user upgrades slots from
1555 - # (say) 5.6 to 7.0 and depcleans the old slot, then this will update
1556 - # his existing symlinks to point to the new 7.0 installation. The
1557 - # latter is bug 432962.
1558 - #
1559 - # Note: the eselect-php package may not be installed at this point,
1560 - # so we can't die() if this command fails.
1561 - eselect php cleanup
1562 -}
1563
1564 diff --git a/dev-lang/php/php-8.1.1.ebuild b/dev-lang/php/php-8.1.1.ebuild
1565 deleted file mode 100644
1566 index 423e9f806689..000000000000
1567 --- a/dev-lang/php/php-8.1.1.ebuild
1568 +++ /dev/null
1569 @@ -1,759 +0,0 @@
1570 -# Copyright 1999-2022 Gentoo Authors
1571 -# Distributed under the terms of the GNU General Public License v2
1572 -
1573 -EAPI="8"
1574 -
1575 -WANT_AUTOMAKE="none"
1576 -
1577 -inherit flag-o-matic systemd autotools
1578 -
1579 -MY_PV=${PV/_rc/RC}
1580 -DESCRIPTION="The PHP language runtime engine"
1581 -HOMEPAGE="https://www.php.net/"
1582 -SRC_URI="https://www.php.net/distributions/${P}.tar.xz"
1583 -
1584 -LICENSE="PHP-3.01
1585 - BSD
1586 - Zend-2.0
1587 - bcmath? ( LGPL-2.1+ )
1588 - fpm? ( BSD-2 )
1589 - gd? ( gd )
1590 - unicode? ( BSD-2 LGPL-2.1 )"
1591 -
1592 -SLOT="$(ver_cut 1-2)"
1593 -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos"
1594 -
1595 -S="${WORKDIR}/${PN}-${MY_PV}"
1596 -
1597 -# We can build the following SAPIs in the given order
1598 -SAPIS="embed cli cgi fpm apache2 phpdbg"
1599 -
1600 -# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
1601 -IUSE="${IUSE}
1602 - ${SAPIS/cli/+cli}
1603 - threads"
1604 -
1605 -IUSE="${IUSE} acl apparmor argon2 bcmath berkdb bzip2 calendar cdb cjk
1606 - coverage +ctype curl debug
1607 - enchant exif ffi +fileinfo +filter firebird
1608 - +flatfile ftp gd gdbm gmp +iconv imap inifile
1609 - intl iodbc ipv6 +jit kerberos ldap ldap-sasl libedit lmdb
1610 - mhash mssql mysql mysqli nls
1611 - oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
1612 - readline selinux +session session-mm sharedmem
1613 - +simplexml snmp soap sockets sodium spell sqlite ssl
1614 - sysvipc systemd test tidy +tokenizer tokyocabinet truetype unicode webp
1615 - +xml xmlreader xmlwriter xpm xslt zip zlib"
1616 -
1617 -# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
1618 -# The Oracle instant client provides its own incompatible ldap library.
1619 -REQUIRED_USE="
1620 - || ( cli cgi fpm apache2 embed phpdbg )
1621 - cli? ( ^^ ( readline libedit ) )
1622 - !cli? ( ?? ( readline libedit ) )
1623 - truetype? ( gd zlib )
1624 - webp? ( gd zlib )
1625 - cjk? ( gd zlib )
1626 - exif? ( gd zlib )
1627 - xpm? ( gd zlib )
1628 - gd? ( zlib )
1629 - simplexml? ( xml )
1630 - soap? ( xml )
1631 - xmlreader? ( xml )
1632 - xmlwriter? ( xml )
1633 - xslt? ( xml )
1634 - ldap-sasl? ( ldap )
1635 - oci8-instant-client? ( !ldap )
1636 - qdbm? ( !gdbm )
1637 - session-mm? ( session !threads )
1638 - mysql? ( || ( mysqli pdo ) )
1639 - firebird? ( pdo )
1640 - mssql? ( pdo )
1641 -"
1642 -
1643 -RESTRICT="!test? ( test )"
1644 -
1645 -# The supported (that is, autodetected) versions of BDB are listed in
1646 -# the ./configure script. Other versions *work*, but we need to stick to
1647 -# the ones that can be detected to avoid a repeat of bug #564824.
1648 -COMMON_DEPEND="
1649 - >=app-eselect/eselect-php-0.9.7[apache2?,fpm?]
1650 - >=dev-libs/libpcre2-10.30[jit?,unicode]
1651 - fpm? ( acl? ( sys-apps/acl ) apparmor? ( sys-libs/libapparmor ) )
1652 - apache2? ( www-servers/apache[apache2_modules_unixd(+),threads=] )
1653 - argon2? ( app-crypt/argon2:= )
1654 - berkdb? ( || ( sys-libs/db:5.3 sys-libs/db:4.8 ) )
1655 - bzip2? ( app-arch/bzip2:0= )
1656 - cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
1657 - coverage? ( dev-util/lcov )
1658 - curl? ( >=net-misc/curl-7.29.0 )
1659 - enchant? ( app-text/enchant:2 )
1660 - ffi? ( >=dev-libs/libffi-3.0.11:= )
1661 - firebird? ( dev-db/firebird )
1662 - gd? ( >=virtual/jpeg-0-r3:0 media-libs/libpng:0= )
1663 - gdbm? ( >=sys-libs/gdbm-1.8.0:0= )
1664 - gmp? ( dev-libs/gmp:0= )
1665 - iconv? ( virtual/libiconv )
1666 - imap? ( >=virtual/imap-c-client-2[kerberos=,ssl=] )
1667 - intl? ( dev-libs/icu:= )
1668 - kerberos? ( virtual/krb5 )
1669 - ldap? ( >=net-nds/openldap-1.2.11 )
1670 - ldap-sasl? ( dev-libs/cyrus-sasl )
1671 - libedit? ( dev-libs/libedit )
1672 - lmdb? ( dev-db/lmdb:= )
1673 - mssql? ( dev-db/freetds[mssql] )
1674 - nls? ( sys-devel/gettext )
1675 - oci8-instant-client? ( dev-db/oracle-instantclient[sdk] )
1676 - odbc? ( iodbc? ( dev-db/libiodbc ) !iodbc? ( >=dev-db/unixODBC-1.8.13 ) )
1677 - postgres? ( >=dev-db/postgresql-9.1:* )
1678 - qdbm? ( dev-db/qdbm )
1679 - readline? ( sys-libs/readline:0= )
1680 - session-mm? ( dev-libs/mm )
1681 - snmp? ( >=net-analyzer/net-snmp-5.2 )
1682 - sodium? ( dev-libs/libsodium:=[-minimal] )
1683 - spell? ( >=app-text/aspell-0.50 )
1684 - sqlite? ( >=dev-db/sqlite-3.7.6.3 )
1685 - ssl? ( >=dev-libs/openssl-1.0.2:0= )
1686 - tidy? ( app-text/htmltidy )
1687 - tokyocabinet? ( dev-db/tokyocabinet )
1688 - truetype? ( =media-libs/freetype-2* )
1689 - unicode? ( dev-libs/oniguruma:= )
1690 - webp? ( media-libs/libwebp:0= )
1691 - xml? ( >=dev-libs/libxml2-2.9.0 )
1692 - xpm? ( x11-libs/libXpm )
1693 - xslt? ( dev-libs/libxslt )
1694 - zip? ( >=dev-libs/libzip-1.2.0:= )
1695 - zlib? ( >=sys-libs/zlib-1.2.0.4:0= )
1696 -"
1697 -
1698 -IDEPEND=">=app-eselect/eselect-php-0.9.7[apache2?,fpm?]"
1699 -
1700 -RDEPEND="${COMMON_DEPEND}
1701 - virtual/mta
1702 - fpm? (
1703 - selinux? ( sec-policy/selinux-phpfpm )
1704 - systemd? ( sys-apps/systemd ) )"
1705 -
1706 -# Bison isn't actually needed when building from a release tarball
1707 -# However, the configure script will warn if it's absent or if you
1708 -# have an incompatible version installed. See bug 593278.
1709 -DEPEND="${COMMON_DEPEND}
1710 - app-arch/xz-utils
1711 - >=sys-devel/bison-3.0.1"
1712 -
1713 -BDEPEND="virtual/pkgconfig"
1714 -
1715 -PHP_MV="$(ver_cut 1)"
1716 -
1717 -PATCHES=(
1718 - "${FILESDIR}/php-iodbc-header-location.patch"
1719 -)
1720 -
1721 -php_install_ini() {
1722 - local phpsapi="${1}"
1723 -
1724 - # work out where we are installing the ini file
1725 - php_set_ini_dir "${phpsapi}"
1726 -
1727 - # Always install the production INI file, bug 611214.
1728 - local phpinisrc="php.ini-production-${phpsapi}"
1729 - cp php.ini-production "${phpinisrc}" || die
1730 -
1731 - # default to /tmp for save_path, bug #282768
1732 - sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die
1733 -
1734 - # Set the extension dir
1735 - sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \
1736 - -i "${phpinisrc}" || die
1737 -
1738 - # Set the include path to point to where we want to find PEAR packages
1739 - sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die
1740 -
1741 - insinto "${PHP_INI_DIR#${EPREFIX}}"
1742 - newins "${phpinisrc}" php.ini
1743 -
1744 - elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}"
1745 - elog
1746 -
1747 - dodir "${PHP_EXT_INI_DIR#${EPREFIX}}"
1748 - dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}"
1749 -
1750 - if use opcache; then
1751 - elog "Adding opcache to $PHP_EXT_INI_DIR"
1752 - echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \
1753 - "${D}/${PHP_EXT_INI_DIR}"/opcache.ini
1754 - dosym "../ext/opcache.ini" \
1755 - "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini"
1756 - fi
1757 -
1758 - # SAPI-specific handling
1759 - if [[ "${sapi}" == "fpm" ]] ; then
1760 - einfo "Installing FPM config files php-fpm.conf and www.conf"
1761 - insinto "${PHP_INI_DIR#${EPREFIX}}"
1762 - doins sapi/fpm/php-fpm.conf
1763 - insinto "${PHP_INI_DIR#${EPREFIX}}/fpm.d"
1764 - doins sapi/fpm/www.conf
1765 - fi
1766 -
1767 - dodoc php.ini-{development,production}
1768 -}
1769 -
1770 -php_set_ini_dir() {
1771 - PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}"
1772 - PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
1773 - PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
1774 -}
1775 -
1776 -src_prepare() {
1777 - default
1778 -
1779 - # In php-7.x, the FPM pool configuration files have been split off
1780 - # of the main config. By default the pool config files go in
1781 - # e.g. /etc/php-fpm.d, which isn't slotted. So here we move the
1782 - # include directory to a subdirectory "fpm.d" of $PHP_INI_DIR. Later
1783 - # we'll install the pool configuration file "www.conf" there.
1784 - php_set_ini_dir fpm
1785 - sed -i "s~^include=.*$~include=${PHP_INI_DIR}/fpm.d/*.conf~" \
1786 - sapi/fpm/php-fpm.conf.in \
1787 - || die 'failed to move the include directory in php-fpm.conf'
1788 -
1789 - # Emulate buildconf to support cross-compilation
1790 - rm -fr aclocal.m4 autom4te.cache config.cache \
1791 - configure main/php_config.h.in || die
1792 - eautoconf --force
1793 - eautoheader
1794 -
1795 - # Remove false positive test failures
1796 - # stream_isatty fails due to portage redirects
1797 - # curl tests here fail for network sandbox issues
1798 - # session tests here fail because we set the session directory to $T
1799 - rm tests/output/stream_isatty_err.phpt \
1800 - tests/output/stream_isatty_out-err.phpt \
1801 - tests/output/stream_isatty_out.phpt \
1802 - ext/curl/tests/bug76675.phpt \
1803 - ext/curl/tests/bug77535.phpt \
1804 - ext/curl/tests/curl_error_basic.phpt \
1805 - ext/session/tests/bug74514.phpt \
1806 - ext/session/tests/bug74936.phpt || die
1807 -
1808 -}
1809 -
1810 -src_configure() {
1811 - addpredict /usr/share/snmp/mibs/.index #nowarn
1812 - addpredict /var/lib/net-snmp/mib_indexes #nowarn
1813 -
1814 - PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
1815 -
1816 - # The php-fpm config file wants localstatedir to be ${EPREFIX}/var
1817 - # and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002.
1818 - local our_conf=(
1819 - --prefix="${PHP_DESTDIR}"
1820 - --mandir="${PHP_DESTDIR}/man"
1821 - --infodir="${PHP_DESTDIR}/info"
1822 - --libdir="${PHP_DESTDIR}/lib"
1823 - --with-libdir="$(get_libdir)"
1824 - --localstatedir="${EPREFIX}/var"
1825 - --without-pear
1826 - $(use_enable threads zts)
1827 - )
1828 -
1829 - our_conf+=(
1830 - $(use_with apparmor fpm-apparmor)
1831 - $(use_with argon2 password-argon2 "${EPREFIX}/usr")
1832 - $(use_enable bcmath)
1833 - $(use_with bzip2 bz2 "${EPREFIX}/usr")
1834 - $(use_enable calendar)
1835 - $(use_enable coverage gcov)
1836 - $(use_enable ctype)
1837 - $(use_with curl)
1838 - $(use_enable xml dom)
1839 - $(use_with enchant)
1840 - $(use_enable exif)
1841 - $(use_with ffi)
1842 - $(use_enable fileinfo)
1843 - $(use_enable filter)
1844 - $(use_enable ftp)
1845 - $(use_with nls gettext "${EPREFIX}/usr")
1846 - $(use_with gmp gmp "${EPREFIX}/usr")
1847 - $(use_with mhash mhash "${EPREFIX}/usr")
1848 - $(use_with iconv iconv \
1849 - $(use elibc_glibc || use elibc_musl || echo "${EPREFIX}/usr"))
1850 - $(use_enable intl)
1851 - $(use_enable ipv6)
1852 - $(use_with kerberos)
1853 - $(use_with xml libxml)
1854 - $(use_enable unicode mbstring)
1855 - $(use_with ssl openssl)
1856 - $(use_enable pcntl)
1857 - $(use_enable phar)
1858 - $(use_enable pdo)
1859 - $(use_enable opcache)
1860 - $(use_with postgres pgsql "${EPREFIX}/usr")
1861 - $(use_enable posix)
1862 - $(use_with spell pspell "${EPREFIX}/usr")
1863 - $(use_enable simplexml)
1864 - $(use_enable sharedmem shmop)
1865 - $(use_with snmp snmp "${EPREFIX}/usr")
1866 - $(use_enable soap)
1867 - $(use_enable sockets)
1868 - $(use_with sodium)
1869 - $(use_with sqlite sqlite3)
1870 - $(use_enable sysvipc sysvmsg)
1871 - $(use_enable sysvipc sysvsem)
1872 - $(use_enable sysvipc sysvshm)
1873 - $(use_with tidy tidy "${EPREFIX}/usr")
1874 - $(use_enable tokenizer)
1875 - $(use_enable xml)
1876 - $(use_enable xmlreader)
1877 - $(use_enable xmlwriter)
1878 - $(use_with xslt xsl)
1879 - $(use_with zip)
1880 - $(use_with zlib zlib "${EPREFIX}/usr")
1881 - $(use_enable debug)
1882 - )
1883 -
1884 - # DBA support
1885 - if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
1886 - || use qdbm || use lmdb || use tokyocabinet ; then
1887 - our_conf+=( "--enable-dba" )
1888 - fi
1889 -
1890 - # DBA drivers support
1891 - our_conf+=(
1892 - $(use_with cdb)
1893 - $(use_with berkdb db4 "${EPREFIX}/usr")
1894 - $(use_enable flatfile)
1895 - $(use_with gdbm gdbm "${EPREFIX}/usr")
1896 - $(use_enable inifile)
1897 - $(use_with qdbm qdbm "${EPREFIX}/usr")
1898 - $(use_with tokyocabinet tcadb "${EPREFIX}/usr")
1899 - $(use_with lmdb lmdb "${EPREFIX}/usr")
1900 - )
1901 -
1902 - # Support for the GD graphics library
1903 - our_conf+=(
1904 - $(use_with truetype freetype)
1905 - $(use_enable cjk gd-jis-conv)
1906 - $(use_with gd jpeg)
1907 - $(use_with xpm)
1908 - $(use_with webp)
1909 - )
1910 - # enable gd last, so configure can pick up the previous settings
1911 - our_conf+=( $(use_enable gd) )
1912 -
1913 - # IMAP support
1914 - if use imap ; then
1915 - our_conf+=(
1916 - $(use_with imap imap "${EPREFIX}/usr")
1917 - $(use_with ssl imap-ssl "${EPREFIX}/usr")
1918 - )
1919 - fi
1920 -
1921 - # LDAP support
1922 - if use ldap ; then
1923 - our_conf+=(
1924 - $(use_with ldap ldap "${EPREFIX}/usr")
1925 - $(use_with ldap-sasl)
1926 - )
1927 - fi
1928 -
1929 - # MySQL support
1930 - local mysqllib="mysqlnd"
1931 - local mysqlilib="mysqlnd"
1932 -
1933 - our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
1934 -
1935 - local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock"
1936 - if use mysql || use mysqli ; then
1937 - our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") )
1938 - fi
1939 -
1940 - # ODBC support
1941 - if use odbc && use iodbc ; then
1942 - our_conf+=(
1943 - --without-unixODBC
1944 - --with-iodbc
1945 - $(use_with pdo pdo-odbc "iODBC,${EPREFIX}/usr")
1946 - )
1947 - elif use odbc ; then
1948 - our_conf+=(
1949 - --with-unixODBC="${EPREFIX}/usr"
1950 - --without-iodbc
1951 - $(use_with pdo pdo-odbc "unixODBC,${EPREFIX}/usr")
1952 - )
1953 - else
1954 - our_conf+=(
1955 - --without-unixODBC
1956 - --without-iodbc
1957 - --without-pdo-odbc
1958 - )
1959 - fi
1960 -
1961 - # Oracle support
1962 - our_conf+=( $(use_with oci8-instant-client oci8) )
1963 -
1964 - # PDO support
1965 - if use pdo ; then
1966 - our_conf+=(
1967 - $(use_with mssql pdo-dblib "${EPREFIX}/usr")
1968 - $(use_with mysql pdo-mysql "${mysqllib}")
1969 - $(use_with postgres pdo-pgsql)
1970 - $(use_with sqlite pdo-sqlite)
1971 - $(use_with firebird pdo-firebird "${EPREFIX}/usr")
1972 - $(use_with oci8-instant-client pdo-oci)
1973 - )
1974 - fi
1975 -
1976 - # readline/libedit support
1977 - our_conf+=(
1978 - $(use_with readline readline "${EPREFIX}/usr")
1979 - $(use_with libedit)
1980 - )
1981 -
1982 - # Session support
1983 - if use session ; then
1984 - our_conf+=( $(use_with session-mm mm "${EPREFIX}/usr") )
1985 - else
1986 - our_conf+=( $(use_enable session) )
1987 - fi
1988 -
1989 - # Use pic for shared modules such as apache2's mod_php
1990 - our_conf+=( --with-pic )
1991 -
1992 - # we use the system copy of pcre
1993 - # --with-external-pcre affects ext/pcre
1994 - our_conf+=(
1995 - --with-external-pcre
1996 - $(use_with jit pcre-jit)
1997 - )
1998 -
1999 - # Catch CFLAGS problems
2000 - # Fixes bug #14067.
2001 - # Changed order to run it in reverse for bug #32022 and #12021.
2002 - replace-cpu-flags "k6*" "i586"
2003 -
2004 - # Cache the ./configure test results between SAPIs.
2005 - our_conf+=( --cache-file="${T}/config.cache" )
2006 -
2007 - # Support user-passed configuration parameters
2008 - our_conf+=( ${EXTRA_ECONF:-} )
2009 -
2010 - # Support the Apache2 extras, they must be set globally for all
2011 - # SAPIs to work correctly, especially for external PHP extensions
2012 -
2013 - local one_sapi
2014 - local sapi
2015 - mkdir -p "${WORKDIR}/sapis-build" || die
2016 - for one_sapi in $SAPIS ; do
2017 - use "${one_sapi}" || continue
2018 - php_set_ini_dir "${one_sapi}"
2019 -
2020 - # The BUILD_DIR variable is used to determine where to output
2021 - # the files that autotools creates. This was all originally
2022 - # based on the autotools-utils eclass.
2023 - BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}"
2024 - cp -a "${S}" "${BUILD_DIR}" || die
2025 - cd "${BUILD_DIR}" || die
2026 -
2027 - local sapi_conf=(
2028 - --with-config-file-path="${PHP_INI_DIR}"
2029 - --with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}"
2030 - )
2031 -
2032 - for sapi in $SAPIS ; do
2033 - case "$sapi" in
2034 - cli|cgi|embed|fpm|phpdbg)
2035 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
2036 - sapi_conf+=( "--enable-${sapi}" )
2037 - if [[ "fpm" == "${sapi}" ]] ; then
2038 - sapi_conf+=(
2039 - $(use_with acl fpm-acl)
2040 - $(use_with systemd fpm-systemd)
2041 - )
2042 - fi
2043 - else
2044 - sapi_conf+=( "--disable-${sapi}" )
2045 - fi
2046 - ;;
2047 -
2048 - apache2)
2049 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
2050 - sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" )
2051 - else
2052 - sapi_conf+=( --without-apxs2 )
2053 - fi
2054 - ;;
2055 - esac
2056 - done
2057 -
2058 - # Construct the $myeconfargs array by concatenating $our_conf
2059 - # (the common args) and $sapi_conf (the SAPI-specific args).
2060 - local myeconfargs=( "${our_conf[@]}" )
2061 - myeconfargs+=( "${sapi_conf[@]}" )
2062 -
2063 - pushd "${BUILD_DIR}" > /dev/null || die
2064 - econf "${myeconfargs[@]}"
2065 - popd > /dev/null || die
2066 - done
2067 -}
2068 -
2069 -src_compile() {
2070 - # snmp seems to run during src_compile, too (bug #324739)
2071 - addpredict /usr/share/snmp/mibs/.index #nowarn
2072 - addpredict /var/lib/net-snmp/mib_indexes #nowarn
2073 -
2074 - local sapi
2075 - for sapi in ${SAPIS} ; do
2076 - if use "${sapi}"; then
2077 - cd "${WORKDIR}/sapis-build/$sapi" || \
2078 - die "Failed to change dir to ${WORKDIR}/sapis-build/$1"
2079 - emake
2080 - fi
2081 - done
2082 -}
2083 -
2084 -src_install() {
2085 - # see bug #324739 for what happens when we don't have that
2086 - addpredict /usr/share/snmp/mibs/.index #nowarn
2087 -
2088 - # grab the first SAPI that got built and install common files from there
2089 - local first_sapi="", sapi=""
2090 - for sapi in $SAPIS ; do
2091 - if use $sapi ; then
2092 - first_sapi=$sapi
2093 - break
2094 - fi
2095 - done
2096 -
2097 - # Makefile forgets to create this before trying to write to it...
2098 - dodir "${PHP_DESTDIR#${EPREFIX}}/bin"
2099 -
2100 - # Install php environment (without any sapis)
2101 - cd "${WORKDIR}/sapis-build/$first_sapi" || die
2102 - emake INSTALL_ROOT="${D}" \
2103 - install-build install-headers install-programs
2104 -
2105 - local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)"
2106 -
2107 - # Create the directory where we'll put version-specific php scripts
2108 - keepdir "/usr/share/php${PHP_MV}"
2109 -
2110 - local file=""
2111 - local sapi_list=""
2112 -
2113 - for sapi in ${SAPIS}; do
2114 - if use "${sapi}" ; then
2115 - einfo "Installing SAPI: ${sapi}"
2116 - cd "${WORKDIR}/sapis-build/${sapi}" || die
2117 -
2118 - if [[ "${sapi}" == "apache2" ]] ; then
2119 - # We're specifically not using emake install-sapi as libtool
2120 - # may cause unnecessary relink failures (see bug #351266)
2121 - insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/"
2122 - newins ".libs/libphp$(get_libname)" \
2123 - "libphp${PHP_MV}$(get_libname)"
2124 - keepdir "/usr/$(get_libdir)/apache2/modules"
2125 - else
2126 - # needed each time, php_install_ini would reset it
2127 - local dest="${PHP_DESTDIR#${EPREFIX}}"
2128 - into "${dest}"
2129 - case "$sapi" in
2130 - cli)
2131 - source="sapi/cli/php"
2132 - # Install the "phar" archive utility.
2133 - if use phar ; then
2134 - emake INSTALL_ROOT="${D}" install-pharcmd
2135 - dosym "..${dest#/usr}/bin/phar" "/usr/bin/phar${SLOT}"
2136 - fi
2137 - ;;
2138 - cgi)
2139 - source="sapi/cgi/php-cgi"
2140 - ;;
2141 - fpm)
2142 - source="sapi/fpm/php-fpm"
2143 - ;;
2144 - embed)
2145 - source="libs/libphp$(get_libname)"
2146 - ;;
2147 - phpdbg)
2148 - source="sapi/phpdbg/phpdbg"
2149 - ;;
2150 - *)
2151 - die "unhandled sapi in src_install"
2152 - ;;
2153 - esac
2154 -
2155 - if [[ "${source}" == *"$(get_libname)" ]]; then
2156 - dolib.so "${source}"
2157 - else
2158 - dobin "${source}"
2159 - local name="$(basename ${source})"
2160 - dosym "..${dest#/usr}/bin/${name}" "/usr/bin/${name}${SLOT}"
2161 - fi
2162 - fi
2163 -
2164 - php_install_ini "${sapi}"
2165 -
2166 - # construct correct SAPI string for php-config
2167 - # thanks to ferringb for the bash voodoo
2168 - if [[ "${sapi}" == "apache2" ]]; then
2169 - sapi_list="${sapi_list:+${sapi_list} }apache2handler"
2170 - else
2171 - sapi_list="${sapi_list:+${sapi_list} }${sapi}"
2172 - fi
2173 - fi
2174 - done
2175 -
2176 - # Installing opcache module
2177 - if use opcache ; then
2178 - into "${PHP_DESTDIR#${EPREFIX}}"
2179 - dolib.so "modules/opcache$(get_libname)"
2180 - fi
2181 -
2182 - # Install env.d files
2183 - newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}"
2184 - sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
2185 - sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
2186 -
2187 - # set php-config variable correctly (bug #278439)
2188 - sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \
2189 - "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die
2190 -
2191 - if use fpm ; then
2192 - if use systemd; then
2193 - systemd_newunit "${FILESDIR}/php-fpm_at.service" \
2194 - "php-fpm@${SLOT}.service"
2195 - else
2196 - systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \
2197 - "php-fpm@${SLOT}.service"
2198 - fi
2199 - fi
2200 -}
2201 -
2202 -src_test() {
2203 - echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
2204 - PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
2205 - if [[ ! -x "${PHP_BIN}" ]] ; then
2206 - ewarn "Test phase requires USE=cli, skipping"
2207 - return
2208 - else
2209 - export TEST_PHP_EXECUTABLE="${PHP_BIN}"
2210 - fi
2211 -
2212 - if [[ -x "${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" ]] ; then
2213 - export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi"
2214 - fi
2215 -
2216 - if [[ -x "${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" ]] ; then
2217 - export TEST_PHPDBG_EXECUTABLE="${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg"
2218 - fi
2219 -
2220 - REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \
2221 - "session.save_path=${T}" \
2222 - "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \
2223 - "session.save_path=${T}"
2224 -
2225 - for name in ${EXPECTED_TEST_FAILURES}; do
2226 - mv "${name}.out" "${name}.out.orig" 2>/dev/null || die
2227 - done
2228 -
2229 - local failed="$(find -name '*.out')"
2230 - if [[ ${failed} != "" ]] ; then
2231 - ewarn "The following test cases failed unexpectedly:"
2232 - for name in ${failed}; do
2233 - ewarn " ${name/.out/}"
2234 - done
2235 - else
2236 - einfo "No unexpected test failures, all fine"
2237 - fi
2238 -
2239 - if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
2240 - local passed=""
2241 - for name in ${EXPECTED_TEST_FAILURES}; do
2242 - [[ -f "${name}.diff" ]] && continue
2243 - passed="${passed} ${name}"
2244 - done
2245 - if [[ ${passed} != "" ]] ; then
2246 - einfo "The following test cases passed unexpectedly:"
2247 - for name in ${passed}; do
2248 - ewarn " ${passed}"
2249 - done
2250 - else
2251 - einfo "None of the known-to-fail tests passed, all fine"
2252 - fi
2253 - fi
2254 -}
2255 -
2256 -pkg_postinst() {
2257 - # Output some general info to the user
2258 - if use apache2 ; then
2259 - elog
2260 - elog "To enable PHP in apache, you will need to add \"-D PHP\" to"
2261 - elog "your apache2 command. OpenRC users can append that string to"
2262 - elog "APACHE2_OPTS in /etc/conf.d/apache2."
2263 - elog
2264 - elog "The apache module configuration file 70_mod_php.conf is"
2265 - elog "provided (and maintained) by eselect-php."
2266 - elog
2267 - fi
2268 -
2269 - # Create the symlinks for php
2270 - local m
2271 - for m in ${SAPIS}; do
2272 - [[ ${m} == 'embed' ]] && continue;
2273 - if use $m ; then
2274 - local ci=$(eselect php show $m)
2275 - if [[ -z $ci ]]; then
2276 - eselect php set $m php${SLOT} || die
2277 - einfo "Switched ${m} to use php:${SLOT}"
2278 - einfo
2279 - elif [[ $ci != "php${SLOT}" ]] ; then
2280 - elog "To switch $m to use php:${SLOT}, run"
2281 - elog " eselect php set $m php${SLOT}"
2282 - elog
2283 - fi
2284 - fi
2285 - done
2286 -
2287 - # Remove dead symlinks for SAPIs that were just disabled. For
2288 - # example, if the user has the cgi SAPI enabled, then he has an
2289 - # eselect-php symlink for it. If he later reinstalls PHP with
2290 - # USE="-cgi", that symlink will break. This call to eselect is
2291 - # supposed to remove that dead link per bug 572436.
2292 - eselect php cleanup || die
2293 -
2294 - if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then
2295 - elog "To build extensions for this version of PHP, you will need to"
2296 - elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable."
2297 - elog
2298 - fi
2299 -
2300 - # Warn about the removal of PHP_INI_VERSION if the user has it set.
2301 - if [[ -n "${PHP_INI_VERSION}" ]]; then
2302 - ewarn 'The PHP_INI_VERSION variable has been phased out. You may'
2303 - ewarn 'remove it from your configuration at your convenience. See'
2304 - ewarn
2305 - ewarn ' https://bugs.gentoo.org/611214'
2306 - ewarn
2307 - ewarn 'for more information.'
2308 - fi
2309 -
2310 - elog "For details on how version slotting works, please see"
2311 - elog "the wiki:"
2312 - elog
2313 - elog " https://wiki.gentoo.org/wiki/PHP"
2314 - elog
2315 -}
2316 -
2317 -pkg_postrm() {
2318 - # This serves two purposes. First, if we have just removed the last
2319 - # installed version of PHP, then this will remove any dead symlinks
2320 - # belonging to eselect-php. Second, if a user upgrades slots from
2321 - # (say) 5.6 to 7.0 and depcleans the old slot, then this will update
2322 - # his existing symlinks to point to the new 7.0 installation. The
2323 - # latter is bug 432962.
2324 - #
2325 - # Note: the eselect-php package may not be installed at this point,
2326 - # so we can't die() if this command fails.
2327 - eselect php cleanup
2328 -}