Gentoo Archives: gentoo-commits

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