1 |
commit: d486568000862c8ce5e54e1e8435e2e9d6502c72 |
2 |
Author: Brian Evans <grknight <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Sep 15 00:56:46 2018 +0000 |
4 |
Commit: Brian Evans <grknight <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Sep 15 03:40:09 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d4865680 |
7 |
|
8 |
dev-lang/php: Version bump for 7.0.32 |
9 |
|
10 |
Package-Manager: Portage-2.3.49, Repoman-2.3.10 |
11 |
|
12 |
dev-lang/php/Manifest | 1 + |
13 |
dev-lang/php/php-7.0.32.ebuild | 751 +++++++++++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 752 insertions(+) |
15 |
|
16 |
diff --git a/dev-lang/php/Manifest b/dev-lang/php/Manifest |
17 |
index e755530cf1c..cbe8de30975 100644 |
18 |
--- a/dev-lang/php/Manifest |
19 |
+++ b/dev-lang/php/Manifest |
20 |
@@ -3,6 +3,7 @@ DIST php-5.6.37.tar.xz 12467912 BLAKE2B e047a7eabf1279c2c0b1e290596aada5d4551bb2 |
21 |
DIST php-5.6.38.tar.xz 12467408 BLAKE2B d9ee47e193d80bce8a9ed6ffd3eb13e67ba6d1f597ece2803cd92fddc6245f46cdfe644d6cda12a6bb409b92c1fe748610cc5eb43dea0bf063fda81188ee8b3d SHA512 66c51a8e954b1496c0bad0a2864a2a1537dd1c1c573b553991d6d5bce85fc7bc340e56a21109bc5e9a03799e703204b980b569c95a5c0a1bddb01c8947e7a682 |
22 |
DIST php-7.0.30.tar.xz 12030228 BLAKE2B cc4c50d108fca68ee98b70a3007893d912d2343dd255faf52e41c1de04f590f427d9edad7b637177ccf1d9c62212ee6060baca13931c0aa14532df548ef159aa SHA512 1f0914ebda79247aa65ace63f6c8c4fcd850b21a82704f7b6482760259239cc5fee4cfd5aa2ed590b56822b4d69330ac472f46537e7f25d59e73ba63a48827c5 |
23 |
DIST php-7.0.31.tar.xz 12029516 BLAKE2B afb3c831b11b3aa4d3660ccef5b97e8282da2ad9362477d79b3beff41ece3321e869aec8de08a999d16b03b23a654f799ba51f60ad727a1baebd373fe0b0f4aa SHA512 be09b810d63d0aa82ec193686f26cb2a76c16064f90a59ae5ade152cff196ece67a7e8bf1e640bf43913309c968c398231384b0b11be2b4429dd4672bcfce43e |
24 |
+DIST php-7.0.32.tar.xz 12030780 BLAKE2B 0c277eac4c931a6e30954cceb7feef8dea1c3ef4aebac91779b7e1a6f90f608faa93d1750a2dc8f354c73304e0f7a9b9ac17bb0d1da4768ddb68925752c11aef SHA512 4a7c9a6b91ad7da69303916202062d639e6f02dcd483e851a44d8c7a2efeb5c9a666097935ab60d700c4445f86a0c68df1515300c57af1cdb76528b54b757608 |
25 |
DIST php-7.1.18.tar.xz 12213396 BLAKE2B f851c6eb261b8b532e84e73e6f173deb6ac00cd5168a02db9811843540aeadc390a4c5416eb17749cc950bbb1eda1045f538e2b80e4734ea2c0c4e264776bffb SHA512 7eacbc3b98d8b668c90d5c93030263f47ba2e0d4d7820594662590b8b68670f734a2274ae476e3aeac7e030c4ef10411a80da3523383e87a6757e87597caee90 |
26 |
DIST php-7.1.20.tar.xz 12227052 BLAKE2B c9872ffd1f8eb1a51a24d669965b0b908c3d233ad3eac86284e1edf7c6fa5e8099d5706bd1dd740cea039aeac2f66e60f96ccd15f1956eefe5635142b75857f1 SHA512 1f84ba63df45b0d32d704b74217b509807976e88ea953a330c06372491d6ca6e41891cf14bd16524b76f4b2f9007f1243845af7e652917de9325c022135ed9cf |
27 |
DIST php-7.1.21.tar.xz 12227636 BLAKE2B a7451d0f7d8d788ee9d2950170364bdd552dd35bf962b6591618dcda163ea26677c22e26342072b17573182bfd91b7f3f55cade3432c3e9800e36264ba72150a SHA512 92266ae2a1880a497e828ec8972fef6a1c20505a1eb39c77590d9469b2ae047c86d3e84c65871475e36fa3f7e9e872e25aca241b33c3d7ed8fa5dc8d511af2cf |
28 |
|
29 |
diff --git a/dev-lang/php/php-7.0.32.ebuild b/dev-lang/php/php-7.0.32.ebuild |
30 |
new file mode 100644 |
31 |
index 00000000000..aeaedb772a1 |
32 |
--- /dev/null |
33 |
+++ b/dev-lang/php/php-7.0.32.ebuild |
34 |
@@ -0,0 +1,751 @@ |
35 |
+# Copyright 1999-2018 Gentoo Foundation |
36 |
+# Distributed under the terms of the GNU General Public License v2 |
37 |
+ |
38 |
+EAPI=6 |
39 |
+ |
40 |
+inherit flag-o-matic eapi7-ver systemd |
41 |
+ |
42 |
+DESCRIPTION="The PHP language runtime engine" |
43 |
+HOMEPAGE="https://secure.php.net/" |
44 |
+SRC_URI="https://secure.php.net/distributions/${P}.tar.xz" |
45 |
+ |
46 |
+LICENSE="PHP-3.01 |
47 |
+ BSD |
48 |
+ Zend-2.0 |
49 |
+ bcmath? ( LGPL-2.1+ ) |
50 |
+ fpm? ( BSD-2 ) |
51 |
+ gd? ( gd ) |
52 |
+ unicode? ( BSD-2 LGPL-2.1 )" |
53 |
+ |
54 |
+SLOT="$(ver_cut 1-2)" |
55 |
+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" |
56 |
+ |
57 |
+# We can build the following SAPIs in the given order |
58 |
+SAPIS="embed cli cgi fpm apache2 phpdbg" |
59 |
+ |
60 |
+# SAPIs and SAPI-specific USE flags (cli SAPI is default on): |
61 |
+IUSE="${IUSE} |
62 |
+ ${SAPIS/cli/+cli} |
63 |
+ threads" |
64 |
+ |
65 |
+IUSE="${IUSE} acl bcmath berkdb bzip2 calendar cdb cjk |
66 |
+ coverage crypt +ctype curl debug |
67 |
+ enchant exif +fileinfo +filter firebird |
68 |
+ flatfile ftp gd gdbm gmp +hash +iconv imap inifile |
69 |
+ intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl |
70 |
+ mhash mssql mysql mysqli nls |
71 |
+ oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm |
72 |
+ readline recode selinux +session sharedmem |
73 |
+ +simplexml snmp soap sockets spell sqlite ssl |
74 |
+ sysvipc systemd tidy +tokenizer truetype unicode wddx webp |
75 |
+ +xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib" |
76 |
+ |
77 |
+# The supported (that is, autodetected) versions of BDB are listed in |
78 |
+# the ./configure script. Other versions *work*, but we need to stick to |
79 |
+# the ones that can be detected to avoid a repeat of bug #564824. |
80 |
+COMMON_DEPEND=" |
81 |
+ >=app-eselect/eselect-php-0.9.1[apache2?,fpm?] |
82 |
+ >=dev-libs/libpcre-8.32[unicode] |
83 |
+ fpm? ( acl? ( sys-apps/acl ) ) |
84 |
+ apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=] |
85 |
+ <www-servers/apache-2.4[threads=] ) ) |
86 |
+ berkdb? ( || ( sys-libs/db:5.3 |
87 |
+ sys-libs/db:5.1 |
88 |
+ sys-libs/db:4.8 |
89 |
+ sys-libs/db:4.7 |
90 |
+ sys-libs/db:4.6 |
91 |
+ sys-libs/db:4.5 ) ) |
92 |
+ bzip2? ( app-arch/bzip2:0= ) |
93 |
+ cdb? ( || ( dev-db/cdb dev-db/tinycdb ) ) |
94 |
+ cjk? ( !gd? ( |
95 |
+ virtual/jpeg:0 |
96 |
+ media-libs/libpng:0= |
97 |
+ sys-libs/zlib:0= |
98 |
+ ) ) |
99 |
+ coverage? ( dev-util/lcov ) |
100 |
+ crypt? ( >=dev-libs/libmcrypt-2.4 ) |
101 |
+ curl? ( >=net-misc/curl-7.10.5 ) |
102 |
+ enchant? ( app-text/enchant ) |
103 |
+ exif? ( !gd? ( |
104 |
+ virtual/jpeg:0 |
105 |
+ media-libs/libpng:0= |
106 |
+ sys-libs/zlib:0= |
107 |
+ ) ) |
108 |
+ firebird? ( dev-db/firebird ) |
109 |
+ gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib:0= ) |
110 |
+ gdbm? ( >=sys-libs/gdbm-1.8.0:0= ) |
111 |
+ gmp? ( dev-libs/gmp:0= ) |
112 |
+ iconv? ( virtual/libiconv ) |
113 |
+ imap? ( virtual/imap-c-client[kerberos=,ssl=] ) |
114 |
+ intl? ( <dev-libs/icu-61.1:= ) |
115 |
+ iodbc? ( dev-db/libiodbc ) |
116 |
+ kerberos? ( virtual/krb5 ) |
117 |
+ ldap? ( >=net-nds/openldap-1.2.11 ) |
118 |
+ ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 ) |
119 |
+ libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) ) |
120 |
+ mssql? ( dev-db/freetds[mssql] ) |
121 |
+ nls? ( sys-devel/gettext ) |
122 |
+ oci8-instant-client? ( dev-db/oracle-instantclient-basic ) |
123 |
+ odbc? ( >=dev-db/unixODBC-1.8.13 ) |
124 |
+ postgres? ( dev-db/postgresql:* ) |
125 |
+ qdbm? ( dev-db/qdbm ) |
126 |
+ readline? ( sys-libs/readline:0= ) |
127 |
+ recode? ( app-text/recode ) |
128 |
+ sharedmem? ( dev-libs/mm ) |
129 |
+ simplexml? ( >=dev-libs/libxml2-2.6.8 ) |
130 |
+ snmp? ( >=net-analyzer/net-snmp-5.2 ) |
131 |
+ soap? ( >=dev-libs/libxml2-2.6.8 ) |
132 |
+ spell? ( >=app-text/aspell-0.50 ) |
133 |
+ sqlite? ( >=dev-db/sqlite-3.7.6.3 ) |
134 |
+ ssl? ( |
135 |
+ !libressl? ( dev-libs/openssl:0= ) |
136 |
+ libressl? ( dev-libs/libressl:0= ) |
137 |
+ ) |
138 |
+ tidy? ( app-text/htmltidy ) |
139 |
+ truetype? ( |
140 |
+ =media-libs/freetype-2* |
141 |
+ !gd? ( |
142 |
+ virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib:0= ) |
143 |
+ ) |
144 |
+ unicode? ( dev-libs/oniguruma:= ) |
145 |
+ wddx? ( >=dev-libs/libxml2-2.6.8 ) |
146 |
+ webp? ( media-libs/libwebp:0= ) |
147 |
+ xml? ( >=dev-libs/libxml2-2.6.8 ) |
148 |
+ xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv ) |
149 |
+ xmlreader? ( >=dev-libs/libxml2-2.6.8 ) |
150 |
+ xmlwriter? ( >=dev-libs/libxml2-2.6.8 ) |
151 |
+ xpm? ( |
152 |
+ x11-libs/libXpm |
153 |
+ virtual/jpeg:0 |
154 |
+ media-libs/libpng:0= sys-libs/zlib:0= |
155 |
+ ) |
156 |
+ xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 ) |
157 |
+ zip? ( sys-libs/zlib:0= ) |
158 |
+ zlib? ( sys-libs/zlib:0= ) |
159 |
+" |
160 |
+ |
161 |
+RDEPEND="${COMMON_DEPEND} |
162 |
+ virtual/mta |
163 |
+ fpm? ( |
164 |
+ selinux? ( sec-policy/selinux-phpfpm ) |
165 |
+ systemd? ( sys-apps/systemd ) )" |
166 |
+ |
167 |
+DEPEND="${COMMON_DEPEND} |
168 |
+ app-arch/xz-utils |
169 |
+ >=sys-devel/bison-3.0.1 |
170 |
+ sys-devel/flex |
171 |
+ >=sys-devel/m4-1.4.3 |
172 |
+ >=sys-devel/libtool-1.5.18" |
173 |
+ |
174 |
+# Without USE=readline or libedit, the interactive "php -a" CLI will hang. |
175 |
+REQUIRED_USE=" |
176 |
+ || ( cli cgi fpm apache2 embed phpdbg ) |
177 |
+ cli? ( ^^ ( readline libedit ) ) |
178 |
+ truetype? ( gd zlib ) |
179 |
+ webp? ( gd zlib ) |
180 |
+ cjk? ( gd zlib ) |
181 |
+ exif? ( gd zlib ) |
182 |
+ xpm? ( gd zlib ) |
183 |
+ gd? ( zlib ) |
184 |
+ simplexml? ( xml ) |
185 |
+ soap? ( xml ) |
186 |
+ wddx? ( xml ) |
187 |
+ xmlrpc? ( || ( xml iconv ) ) |
188 |
+ xmlreader? ( xml ) |
189 |
+ xslt? ( xml ) |
190 |
+ ldap-sasl? ( ldap ) |
191 |
+ mhash? ( hash ) |
192 |
+ phar? ( hash ) |
193 |
+ qdbm? ( !gdbm ) |
194 |
+ readline? ( !libedit ) |
195 |
+ recode? ( !imap !mysqli !mysql ) |
196 |
+ sharedmem? ( !threads ) |
197 |
+ mysql? ( || ( mysqli pdo ) ) |
198 |
+" |
199 |
+ |
200 |
+PATCHES=( |
201 |
+ "${FILESDIR}/mbstring-oniguruma-6.8.patch" |
202 |
+ # hopefully upstream will include the same version check fixes in upcoming releases |
203 |
+ # patch added 20180429 |
204 |
+ "${FILESDIR}/libressl-compatibility.patch" |
205 |
+ "${FILESDIR}/php-freetype-2.9.1.patch" |
206 |
+) |
207 |
+ |
208 |
+PHP_MV="$(ver_cut 1)" |
209 |
+ |
210 |
+php_install_ini() { |
211 |
+ local phpsapi="${1}" |
212 |
+ |
213 |
+ # work out where we are installing the ini file |
214 |
+ php_set_ini_dir "${phpsapi}" |
215 |
+ |
216 |
+ # Always install the production INI file, bug 611214. |
217 |
+ local phpinisrc="php.ini-production-${phpsapi}" |
218 |
+ cp php.ini-production "${phpinisrc}" || die |
219 |
+ |
220 |
+ # default to /tmp for save_path, bug #282768 |
221 |
+ sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die |
222 |
+ |
223 |
+ # Set the extension dir |
224 |
+ sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \ |
225 |
+ -i "${phpinisrc}" || die |
226 |
+ |
227 |
+ # Set the include path to point to where we want to find PEAR packages |
228 |
+ sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die |
229 |
+ |
230 |
+ dodir "${PHP_INI_DIR#${EPREFIX}}" |
231 |
+ insinto "${PHP_INI_DIR#${EPREFIX}}" |
232 |
+ newins "${phpinisrc}" php.ini |
233 |
+ |
234 |
+ elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}" |
235 |
+ elog |
236 |
+ |
237 |
+ dodir "${PHP_EXT_INI_DIR#${EPREFIX}}" |
238 |
+ dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}" |
239 |
+ |
240 |
+ if use opcache; then |
241 |
+ elog "Adding opcache to $PHP_EXT_INI_DIR" |
242 |
+ echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \ |
243 |
+ "${D}/${PHP_EXT_INI_DIR}"/opcache.ini |
244 |
+ dosym "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" \ |
245 |
+ "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini" |
246 |
+ fi |
247 |
+ |
248 |
+ # SAPI-specific handling |
249 |
+ if [[ "${sapi}" == "fpm" ]] ; then |
250 |
+ einfo "Installing FPM config files php-fpm.conf and www.conf" |
251 |
+ insinto "${PHP_INI_DIR#${EPREFIX}}" |
252 |
+ doins sapi/fpm/php-fpm.conf |
253 |
+ insinto "${PHP_INI_DIR#${EPREFIX}}/fpm.d" |
254 |
+ doins sapi/fpm/www.conf |
255 |
+ fi |
256 |
+ |
257 |
+ dodoc php.ini-{development,production} |
258 |
+} |
259 |
+ |
260 |
+php_set_ini_dir() { |
261 |
+ PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}" |
262 |
+ PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext" |
263 |
+ PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active" |
264 |
+} |
265 |
+ |
266 |
+src_prepare() { |
267 |
+ default |
268 |
+ |
269 |
+ # In php-7.x, the FPM pool configuration files have been split off |
270 |
+ # of the main config. By default the pool config files go in |
271 |
+ # e.g. /etc/php-fpm.d, which isn't slotted. So here we move the |
272 |
+ # include directory to a subdirectory "fpm.d" of $PHP_INI_DIR. Later |
273 |
+ # we'll install the pool configuration file "www.conf" there. |
274 |
+ php_set_ini_dir fpm |
275 |
+ sed -i "s~^include=.*$~include=${PHP_INI_DIR}/fpm.d/*.conf~" \ |
276 |
+ sapi/fpm/php-fpm.conf.in \ |
277 |
+ || die 'failed to move the include directory in php-fpm.conf' |
278 |
+} |
279 |
+ |
280 |
+src_configure() { |
281 |
+ addpredict /usr/share/snmp/mibs/.index #nowarn |
282 |
+ addpredict /var/lib/net-snmp/mib_indexes #nowarn |
283 |
+ |
284 |
+ PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}" |
285 |
+ |
286 |
+ # The php-fpm config file wants localstatedir to be ${EPREFIX}/var |
287 |
+ # and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002. |
288 |
+ local our_conf=( |
289 |
+ --prefix="${PHP_DESTDIR}" |
290 |
+ --mandir="${PHP_DESTDIR}/man" |
291 |
+ --infodir="${PHP_DESTDIR}/info" |
292 |
+ --libdir="${PHP_DESTDIR}/lib" |
293 |
+ --with-libdir="$(get_libdir)" |
294 |
+ --localstatedir="${EPREFIX}/var" |
295 |
+ --without-pear |
296 |
+ $(use_enable threads maintainer-zts) |
297 |
+ ) |
298 |
+ |
299 |
+ our_conf+=( |
300 |
+ $(use_enable bcmath bcmath) |
301 |
+ $(use_with bzip2 bz2 "${EPREFIX}/usr") |
302 |
+ $(use_enable calendar calendar) |
303 |
+ $(use_enable coverage gcov) |
304 |
+ $(use_enable ctype ctype) |
305 |
+ $(use_with curl curl "${EPREFIX}/usr") |
306 |
+ $(use_enable xml dom) |
307 |
+ $(use_with enchant enchant "${EPREFIX}/usr") |
308 |
+ $(use_enable exif exif) |
309 |
+ $(use_enable fileinfo fileinfo) |
310 |
+ $(use_enable filter filter) |
311 |
+ $(use_enable ftp ftp) |
312 |
+ $(use_with nls gettext "${EPREFIX}/usr") |
313 |
+ $(use_with gmp gmp "${EPREFIX}/usr") |
314 |
+ $(use_enable hash hash) |
315 |
+ $(use_with mhash mhash "${EPREFIX}/usr") |
316 |
+ $(use_with iconv iconv \ |
317 |
+ $(use elibc_glibc || use elibc_musl || use elibc_FreeBSD || echo "${EPREFIX}/usr")) |
318 |
+ $(use_enable intl intl) |
319 |
+ $(use_enable ipv6 ipv6) |
320 |
+ $(use_enable json json) |
321 |
+ $(use_with kerberos kerberos "${EPREFIX}/usr") |
322 |
+ $(use_enable xml libxml) |
323 |
+ $(use_with xml libxml-dir "${EPREFIX}/usr") |
324 |
+ $(use_enable unicode mbstring) |
325 |
+ $(use_with crypt mcrypt "${EPREFIX}/usr") |
326 |
+ $(use_with unicode onig "${EPREFIX}/usr") |
327 |
+ $(use_with ssl openssl "${EPREFIX}/usr") |
328 |
+ $(use_with ssl openssl-dir "${EPREFIX}/usr") |
329 |
+ $(use_enable pcntl pcntl) |
330 |
+ $(use_enable phar phar) |
331 |
+ $(use_enable pdo pdo) |
332 |
+ $(use_enable opcache opcache) |
333 |
+ $(use_with postgres pgsql "${EPREFIX}/usr") |
334 |
+ $(use_enable posix posix) |
335 |
+ $(use_with spell pspell "${EPREFIX}/usr") |
336 |
+ $(use_with recode recode "${EPREFIX}/usr") |
337 |
+ $(use_enable simplexml simplexml) |
338 |
+ $(use_enable sharedmem shmop) |
339 |
+ $(use_with snmp snmp "${EPREFIX}/usr") |
340 |
+ $(use_enable soap soap) |
341 |
+ $(use_enable sockets sockets) |
342 |
+ $(use_with sqlite sqlite3 "${EPREFIX}/usr") |
343 |
+ $(use_enable sysvipc sysvmsg) |
344 |
+ $(use_enable sysvipc sysvsem) |
345 |
+ $(use_enable sysvipc sysvshm) |
346 |
+ $(use_with tidy tidy "${EPREFIX}/usr") |
347 |
+ $(use_enable tokenizer tokenizer) |
348 |
+ $(use_enable wddx wddx) |
349 |
+ $(use_enable xml xml) |
350 |
+ $(use_enable xmlreader xmlreader) |
351 |
+ $(use_enable xmlwriter xmlwriter) |
352 |
+ $(use_with xmlrpc xmlrpc) |
353 |
+ $(use_with xslt xsl "${EPREFIX}/usr") |
354 |
+ $(use_enable zip zip) |
355 |
+ $(use_with zlib zlib "${EPREFIX}/usr") |
356 |
+ $(use_enable debug debug) |
357 |
+ ) |
358 |
+ |
359 |
+ # DBA support |
360 |
+ if use cdb || use berkdb || use flatfile || use gdbm || use inifile \ |
361 |
+ || use qdbm ; then |
362 |
+ our_conf+=( "--enable-dba${shared}" ) |
363 |
+ fi |
364 |
+ |
365 |
+ # DBA drivers support |
366 |
+ our_conf+=( |
367 |
+ $(use_with cdb cdb) |
368 |
+ $(use_with berkdb db4 "${EPREFIX}/usr") |
369 |
+ $(use_enable flatfile flatfile) |
370 |
+ $(use_with gdbm gdbm "${EPREFIX}/usr") |
371 |
+ $(use_enable inifile inifile) |
372 |
+ $(use_with qdbm qdbm "${EPREFIX}/usr") |
373 |
+ ) |
374 |
+ |
375 |
+ # Support for the GD graphics library |
376 |
+ our_conf+=( |
377 |
+ $(use_with truetype freetype-dir "${EPREFIX}/usr") |
378 |
+ $(use_enable cjk gd-jis-conv) |
379 |
+ $(use_with gd jpeg-dir "${EPREFIX}/usr") |
380 |
+ $(use_with gd png-dir "${EPREFIX}/usr") |
381 |
+ $(use_with xpm xpm-dir "${EPREFIX}/usr") |
382 |
+ ) |
383 |
+ if use webp; then |
384 |
+ our_conf+=( --with-webp-dir="${EPREFIX}/usr" ) |
385 |
+ fi |
386 |
+ # enable gd last, so configure can pick up the previous settings |
387 |
+ our_conf+=( $(use_with gd gd) ) |
388 |
+ |
389 |
+ # IMAP support |
390 |
+ if use imap ; then |
391 |
+ our_conf+=( |
392 |
+ $(use_with imap imap "${EPREFIX}/usr") |
393 |
+ $(use_with ssl imap-ssl "${EPREFIX}/usr") |
394 |
+ ) |
395 |
+ fi |
396 |
+ |
397 |
+ # Interbase/firebird support |
398 |
+ our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") ) |
399 |
+ |
400 |
+ # LDAP support |
401 |
+ if use ldap ; then |
402 |
+ our_conf+=( |
403 |
+ $(use_with ldap ldap "${EPREFIX}/usr") |
404 |
+ $(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr") |
405 |
+ ) |
406 |
+ fi |
407 |
+ |
408 |
+ # MySQL support |
409 |
+ local mysqllib="mysqlnd" |
410 |
+ local mysqlilib="mysqlnd" |
411 |
+ |
412 |
+ our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") ) |
413 |
+ |
414 |
+ local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock" |
415 |
+ if use mysql || use mysqli ; then |
416 |
+ our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") ) |
417 |
+ fi |
418 |
+ |
419 |
+ # ODBC support |
420 |
+ our_conf+=( |
421 |
+ $(use_with odbc unixODBC "${EPREFIX}/usr") |
422 |
+ $(use_with iodbc iodbc "${EPREFIX}/usr") |
423 |
+ ) |
424 |
+ |
425 |
+ # Oracle support |
426 |
+ our_conf+=( $(use_with oci8-instant-client oci8) ) |
427 |
+ |
428 |
+ # PDO support |
429 |
+ if use pdo ; then |
430 |
+ our_conf+=( |
431 |
+ $(use_with mssql pdo-dblib "${EPREFIX}/usr") |
432 |
+ $(use_with mysql pdo-mysql "${mysqllib}") |
433 |
+ $(use_with postgres pdo-pgsql) |
434 |
+ $(use_with sqlite pdo-sqlite "${EPREFIX}/usr") |
435 |
+ $(use_with firebird pdo-firebird "${EPREFIX}/usr") |
436 |
+ $(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr") |
437 |
+ $(use_with oci8-instant-client pdo-oci) |
438 |
+ ) |
439 |
+ fi |
440 |
+ |
441 |
+ # readline/libedit support |
442 |
+ our_conf+=( |
443 |
+ $(use_with readline readline "${EPREFIX}/usr") |
444 |
+ $(use_with libedit libedit "${EPREFIX}/usr") |
445 |
+ ) |
446 |
+ |
447 |
+ # Session support |
448 |
+ if use session ; then |
449 |
+ our_conf+=( $(use_with sharedmem mm "${EPREFIX}/usr") ) |
450 |
+ else |
451 |
+ our_conf+=( $(use_enable session session) ) |
452 |
+ fi |
453 |
+ |
454 |
+ # Use pic for shared modules such as apache2's mod_php |
455 |
+ our_conf+=( --with-pic ) |
456 |
+ |
457 |
+ # we use the system copy of pcre |
458 |
+ # --with-pcre-regex affects ext/pcre |
459 |
+ # --with-pcre-dir affects ext/filter and ext/zip |
460 |
+ our_conf+=( |
461 |
+ --with-pcre-regex="${EPREFIX}/usr" |
462 |
+ --with-pcre-dir="${EPREFIX}/usr" |
463 |
+ ) |
464 |
+ |
465 |
+ # Catch CFLAGS problems |
466 |
+ # Fixes bug #14067. |
467 |
+ # Changed order to run it in reverse for bug #32022 and #12021. |
468 |
+ replace-cpu-flags "k6*" "i586" |
469 |
+ |
470 |
+ # Cache the ./configure test results between SAPIs. |
471 |
+ our_conf+=( --cache-file="${T}/config.cache" ) |
472 |
+ |
473 |
+ # Support user-passed configuration parameters |
474 |
+ our_conf+=( ${EXTRA_ECONF:-} ) |
475 |
+ |
476 |
+ # Support the Apache2 extras, they must be set globally for all |
477 |
+ # SAPIs to work correctly, especially for external PHP extensions |
478 |
+ |
479 |
+ mkdir -p "${WORKDIR}/sapis-build" || die |
480 |
+ for one_sapi in $SAPIS ; do |
481 |
+ use "${one_sapi}" || continue |
482 |
+ php_set_ini_dir "${one_sapi}" |
483 |
+ |
484 |
+ # The BUILD_DIR variable is used to determine where to output |
485 |
+ # the files that autotools creates. This was all originally |
486 |
+ # based on the autotools-utils eclass. |
487 |
+ BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}" |
488 |
+ cp -a "${S}" "${BUILD_DIR}" || die |
489 |
+ cd "${BUILD_DIR}" || die |
490 |
+ |
491 |
+ local sapi_conf=( |
492 |
+ --with-config-file-path="${PHP_INI_DIR}" |
493 |
+ --with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}" |
494 |
+ ) |
495 |
+ |
496 |
+ for sapi in $SAPIS ; do |
497 |
+ case "$sapi" in |
498 |
+ cli|cgi|embed|fpm|phpdbg) |
499 |
+ if [[ "${one_sapi}" == "${sapi}" ]] ; then |
500 |
+ sapi_conf+=( "--enable-${sapi}" ) |
501 |
+ if [[ "fpm" == "${sapi}" ]] ; then |
502 |
+ sapi_conf+=( |
503 |
+ $(use_with acl fpm-acl) |
504 |
+ $(use_with systemd fpm-systemd) |
505 |
+ ) |
506 |
+ fi |
507 |
+ else |
508 |
+ sapi_conf+=( "--disable-${sapi}" ) |
509 |
+ fi |
510 |
+ ;; |
511 |
+ |
512 |
+ apache2) |
513 |
+ if [[ "${one_sapi}" == "${sapi}" ]] ; then |
514 |
+ sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" ) |
515 |
+ else |
516 |
+ sapi_conf+=( --without-apxs2 ) |
517 |
+ fi |
518 |
+ ;; |
519 |
+ esac |
520 |
+ done |
521 |
+ |
522 |
+ # Construct the $myeconfargs array by concatenating $our_conf |
523 |
+ # (the common args) and $sapi_conf (the SAPI-specific args). |
524 |
+ local myeconfargs=( "${our_conf[@]}" ) |
525 |
+ myeconfargs+=( "${sapi_conf[@]}" ) |
526 |
+ |
527 |
+ pushd "${BUILD_DIR}" > /dev/null || die |
528 |
+ econf "${myeconfargs[@]}" |
529 |
+ popd > /dev/null || die |
530 |
+ done |
531 |
+} |
532 |
+ |
533 |
+src_compile() { |
534 |
+ # snmp seems to run during src_compile, too (bug #324739) |
535 |
+ addpredict /usr/share/snmp/mibs/.index #nowarn |
536 |
+ addpredict /var/lib/net-snmp/mib_indexes #nowarn |
537 |
+ |
538 |
+ for sapi in ${SAPIS} ; do |
539 |
+ if use "${sapi}"; then |
540 |
+ cd "${WORKDIR}/sapis-build/$sapi" || \ |
541 |
+ die "Failed to change dir to ${WORKDIR}/sapis-build/$1" |
542 |
+ emake |
543 |
+ fi |
544 |
+ done |
545 |
+} |
546 |
+ |
547 |
+src_install() { |
548 |
+ # see bug #324739 for what happens when we don't have that |
549 |
+ addpredict /usr/share/snmp/mibs/.index #nowarn |
550 |
+ |
551 |
+ # grab the first SAPI that got built and install common files from there |
552 |
+ local first_sapi="" |
553 |
+ for sapi in $SAPIS ; do |
554 |
+ if use $sapi ; then |
555 |
+ first_sapi=$sapi |
556 |
+ break |
557 |
+ fi |
558 |
+ done |
559 |
+ |
560 |
+ # Makefile forgets to create this before trying to write to it... |
561 |
+ dodir "${PHP_DESTDIR#${EPREFIX}}/bin" |
562 |
+ |
563 |
+ # Install php environment (without any sapis) |
564 |
+ cd "${WORKDIR}/sapis-build/$first_sapi" || die |
565 |
+ emake INSTALL_ROOT="${D}" \ |
566 |
+ install-build install-headers install-programs |
567 |
+ |
568 |
+ local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)" |
569 |
+ |
570 |
+ # Create the directory where we'll put version-specific php scripts |
571 |
+ keepdir "/usr/share/php${PHP_MV}" |
572 |
+ |
573 |
+ local sapi="", file="" |
574 |
+ local sapi_list="" |
575 |
+ |
576 |
+ for sapi in ${SAPIS}; do |
577 |
+ if use "${sapi}" ; then |
578 |
+ einfo "Installing SAPI: ${sapi}" |
579 |
+ cd "${WORKDIR}/sapis-build/${sapi}" || die |
580 |
+ |
581 |
+ if [[ "${sapi}" == "apache2" ]] ; then |
582 |
+ # We're specifically not using emake install-sapi as libtool |
583 |
+ # may cause unnecessary relink failures (see bug #351266) |
584 |
+ insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/" |
585 |
+ newins ".libs/libphp${PHP_MV}$(get_libname)" \ |
586 |
+ "libphp${PHP_MV}$(get_libname)" |
587 |
+ keepdir "/usr/$(get_libdir)/apache2/modules" |
588 |
+ else |
589 |
+ # needed each time, php_install_ini would reset it |
590 |
+ local dest="${PHP_DESTDIR#${EPREFIX}}" |
591 |
+ into "${dest}" |
592 |
+ case "$sapi" in |
593 |
+ cli) |
594 |
+ source="sapi/cli/php" |
595 |
+ ;; |
596 |
+ cgi) |
597 |
+ source="sapi/cgi/php-cgi" |
598 |
+ ;; |
599 |
+ fpm) |
600 |
+ source="sapi/fpm/php-fpm" |
601 |
+ ;; |
602 |
+ embed) |
603 |
+ source="libs/libphp${PHP_MV}$(get_libname)" |
604 |
+ ;; |
605 |
+ phpdbg) |
606 |
+ source="sapi/phpdbg/phpdbg" |
607 |
+ ;; |
608 |
+ *) |
609 |
+ die "unhandled sapi in src_install" |
610 |
+ ;; |
611 |
+ esac |
612 |
+ |
613 |
+ if [[ "${source}" == *"$(get_libname)" ]]; then |
614 |
+ dolib.so "${source}" |
615 |
+ else |
616 |
+ dobin "${source}" |
617 |
+ local name="$(basename ${source})" |
618 |
+ dosym "${dest}/bin/${name}" "/usr/bin/${name}${SLOT}" |
619 |
+ fi |
620 |
+ fi |
621 |
+ |
622 |
+ php_install_ini "${sapi}" |
623 |
+ |
624 |
+ # construct correct SAPI string for php-config |
625 |
+ # thanks to ferringb for the bash voodoo |
626 |
+ if [[ "${sapi}" == "apache2" ]]; then |
627 |
+ sapi_list="${sapi_list:+${sapi_list} }apache2handler" |
628 |
+ else |
629 |
+ sapi_list="${sapi_list:+${sapi_list} }${sapi}" |
630 |
+ fi |
631 |
+ fi |
632 |
+ done |
633 |
+ |
634 |
+ # Installing opcache module |
635 |
+ if use opcache ; then |
636 |
+ into "${PHP_DESTDIR#${EPREFIX}}" |
637 |
+ dolib.so "modules/opcache$(get_libname)" |
638 |
+ fi |
639 |
+ |
640 |
+ # Install env.d files |
641 |
+ newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}" |
642 |
+ sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die |
643 |
+ sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die |
644 |
+ |
645 |
+ # set php-config variable correctly (bug #278439) |
646 |
+ sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \ |
647 |
+ "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die |
648 |
+ |
649 |
+ if use fpm ; then |
650 |
+ if use systemd; then |
651 |
+ systemd_newunit "${FILESDIR}/php-fpm_at.service" \ |
652 |
+ "php-fpm@${SLOT}.service" |
653 |
+ else |
654 |
+ systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \ |
655 |
+ "php-fpm@${SLOT}.service" |
656 |
+ fi |
657 |
+ fi |
658 |
+} |
659 |
+ |
660 |
+src_test() { |
661 |
+ echo ">>> Test phase [test]: ${CATEGORY}/${PF}" |
662 |
+ PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php" |
663 |
+ if [[ ! -x "${PHP_BIN}" ]] ; then |
664 |
+ ewarn "Test phase requires USE=cli, skipping" |
665 |
+ return |
666 |
+ else |
667 |
+ export TEST_PHP_EXECUTABLE="${PHP_BIN}" |
668 |
+ fi |
669 |
+ |
670 |
+ if [[ -x "${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" ]] ; then |
671 |
+ export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" |
672 |
+ fi |
673 |
+ |
674 |
+ if [[ -x "${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" ]] ; then |
675 |
+ export TEST_PHPDBG_EXECUTABLE="${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" |
676 |
+ fi |
677 |
+ |
678 |
+ REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \ |
679 |
+ "session.save_path=${T}" \ |
680 |
+ "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \ |
681 |
+ "session.save_path=${T}" |
682 |
+ |
683 |
+ for name in ${EXPECTED_TEST_FAILURES}; do |
684 |
+ mv "${name}.out" "${name}.out.orig" 2>/dev/null || die |
685 |
+ done |
686 |
+ |
687 |
+ local failed="$(find -name '*.out')" |
688 |
+ if [[ ${failed} != "" ]] ; then |
689 |
+ ewarn "The following test cases failed unexpectedly:" |
690 |
+ for name in ${failed}; do |
691 |
+ ewarn " ${name/.out/}" |
692 |
+ done |
693 |
+ else |
694 |
+ einfo "No unexpected test failures, all fine" |
695 |
+ fi |
696 |
+ |
697 |
+ if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then |
698 |
+ local passed="" |
699 |
+ for name in ${EXPECTED_TEST_FAILURES}; do |
700 |
+ [[ -f "${name}.diff" ]] && continue |
701 |
+ passed="${passed} ${name}" |
702 |
+ done |
703 |
+ if [[ ${passed} != "" ]] ; then |
704 |
+ einfo "The following test cases passed unexpectedly:" |
705 |
+ for name in ${passed}; do |
706 |
+ ewarn " ${passed}" |
707 |
+ done |
708 |
+ else |
709 |
+ einfo "None of the known-to-fail tests passed, all fine" |
710 |
+ fi |
711 |
+ fi |
712 |
+} |
713 |
+ |
714 |
+pkg_postinst() { |
715 |
+ # Output some general info to the user |
716 |
+ if use apache2 ; then |
717 |
+ elog |
718 |
+ elog "To enable PHP in apache, you will need to add \"-D PHP\" to" |
719 |
+ elog "your apache2 command. OpenRC users can append that string to" |
720 |
+ elog "APACHE2_OPTS in /etc/conf.d/apache2." |
721 |
+ elog |
722 |
+ elog "The apache module configuration file 70_mod_php.conf is" |
723 |
+ elog "provided (and maintained) by eselect-php." |
724 |
+ elog |
725 |
+ fi |
726 |
+ |
727 |
+ # Create the symlinks for php |
728 |
+ for m in ${SAPIS}; do |
729 |
+ [[ ${m} == 'embed' ]] && continue; |
730 |
+ if use $m ; then |
731 |
+ local ci=$(eselect php show $m) |
732 |
+ if [[ -z $ci ]]; then |
733 |
+ eselect php set $m php${SLOT} || die |
734 |
+ einfo "Switched ${m} to use php:${SLOT}" |
735 |
+ einfo |
736 |
+ elif [[ $ci != "php${SLOT}" ]] ; then |
737 |
+ elog "To switch $m to use php:${SLOT}, run" |
738 |
+ elog " eselect php set $m php${SLOT}" |
739 |
+ elog |
740 |
+ fi |
741 |
+ fi |
742 |
+ done |
743 |
+ |
744 |
+ # Remove dead symlinks for SAPIs that were just disabled. For |
745 |
+ # example, if the user has the cgi SAPI enabled, then he has an |
746 |
+ # eselect-php symlink for it. If he later reinstalls PHP with |
747 |
+ # USE="-cgi", that symlink will break. This call to eselect is |
748 |
+ # supposed to remove that dead link per bug 572436. |
749 |
+ eselect php cleanup || die |
750 |
+ |
751 |
+ if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then |
752 |
+ elog "To build extensions for this version of PHP, you will need to" |
753 |
+ elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable." |
754 |
+ elog |
755 |
+ fi |
756 |
+ |
757 |
+ # Warn about the removal of PHP_INI_VERSION if the user has it set. |
758 |
+ if [[ -n "${PHP_INI_VERSION}" ]]; then |
759 |
+ ewarn 'The PHP_INI_VERSION variable has been phased out. You may' |
760 |
+ ewarn 'remove it from your configuration at your convenience. See' |
761 |
+ ewarn |
762 |
+ ewarn ' https://bugs.gentoo.org/611214' |
763 |
+ ewarn |
764 |
+ ewarn 'for more information.' |
765 |
+ fi |
766 |
+ |
767 |
+ elog "For details on how version slotting works, please see" |
768 |
+ elog "the wiki:" |
769 |
+ elog |
770 |
+ elog " https://wiki.gentoo.org/wiki/PHP" |
771 |
+ elog |
772 |
+} |
773 |
+ |
774 |
+pkg_postrm() { |
775 |
+ # This serves two purposes. First, if we have just removed the last |
776 |
+ # installed version of PHP, then this will remove any dead symlinks |
777 |
+ # belonging to eselect-php. Second, if a user upgrades slots from |
778 |
+ # (say) 5.6 to 7.0 and depcleans the old slot, then this will update |
779 |
+ # his existing symlinks to point to the new 7.0 installation. The |
780 |
+ # latter is bug 432962. |
781 |
+ # |
782 |
+ # Note: the eselect-php package may not be installed at this point, |
783 |
+ # so we can't die() if this command fails. |
784 |
+ eselect php cleanup |
785 |
+} |