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