Diff php-5.6.40-r3 with a php-7.1.27

/usr/portage/dev-lang/php/php-7.1.27.ebuild 2019-05-22 14:39:00.000000000 +0300
3 3

  
4 4
EAPI="7"
5 5

  
6
inherit autotools flag-o-matic systemd
7

  
8
PATCH_V="7.1.29bp"
6
inherit flag-o-matic systemd autotools
9 7

  
10 8
DESCRIPTION="The PHP language runtime engine"
11
HOMEPAGE="https://secure.php.net/"
12
SRC_URI="https://php.net/distributions/${P}.tar.xz
13
	https://gitweb.gentoo.org/proj/php-patches.git/snapshot/php-patches-${PATCH_V}.tar.bz2"
9
HOMEPAGE="https://php.net/"
10
SRC_URI="https://php.net/distributions/${P}.tar.xz"
14 11

  
15 12
LICENSE="PHP-3.01
16 13
	BSD
......
21 18
	unicode? ( BSD-2 LGPL-2.1 )"
22 19

  
23 20
SLOT="$(ver_cut 1-2)"
24
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"
21
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"
25 22

  
26 23
# We can build the following SAPIs in the given order
27
SAPIS="embed cli cgi fpm apache2"
24
SAPIS="embed cli cgi fpm apache2 phpdbg"
28 25

  
29 26
# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
30 27
IUSE="${IUSE}
......
36 33
	enchant exif +fileinfo +filter firebird
37 34
	flatfile ftp gd gdbm gmp +hash +iconv imap inifile
38 35
	intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl
39
	mhash mssql mysql libmysqlclient mysqli nls
36
	mhash mssql mysql mysqli nls
40 37
	oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
41
	readline recode selinux +session sharedmem
38
	readline recode selinux +session session-mm sharedmem
42 39
	+simplexml snmp soap sockets spell sqlite ssl
43
	sybase-ct sysvipc systemd tidy +tokenizer truetype unicode vpx wddx
40
	sysvipc systemd test tidy +tokenizer truetype unicode wddx webp
44 41
	+xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib"
45 42

  
46 43
# The supported (that is, autodetected) versions of BDB are listed in
......
60 57
					sys-libs/db:4.5 ) )
61 58
	bzip2? ( app-arch/bzip2:0= )
62 59
	cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
63
	cjk? ( !gd? (
64
		virtual/jpeg:0
65
		media-libs/libpng:0=
66
		sys-libs/zlib:0=
67
	) )
68 60
	coverage? ( dev-util/lcov )
69 61
	crypt? ( >=dev-libs/libmcrypt-2.4 )
70 62
	curl? ( >=net-misc/curl-7.10.5 )
71
	enchant? ( app-text/enchant )
72
	exif? ( !gd? (
73
		virtual/jpeg:0
74
		media-libs/libpng:0=
75
		sys-libs/zlib:0=
76
	) )
63
	enchant? ( <app-text/enchant-2.0:0 )
77 64
	firebird? ( dev-db/firebird )
78
	gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib:0= )
65
	gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib )
79 66
	gdbm? ( >=sys-libs/gdbm-1.8.0:0= )
80 67
	gmp? ( dev-libs/gmp:0= )
81 68
	iconv? ( virtual/libiconv )
......
87 74
	ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 )
88 75
	libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) )
89 76
	mssql? ( dev-db/freetds[mssql] )
90
	libmysqlclient? (
91
		mysql? ( virtual/libmysqlclient:= )
92
		mysqli? ( virtual/libmysqlclient:= )
93
	)
94 77
	nls? ( sys-devel/gettext )
95 78
	oci8-instant-client? ( dev-db/oracle-instantclient-basic )
96 79
	odbc? ( >=dev-db/unixODBC-1.8.13 )
......
98 81
	qdbm? ( dev-db/qdbm )
99 82
	readline? ( sys-libs/readline:0= )
100 83
	recode? ( app-text/recode )
101
	sharedmem? ( dev-libs/mm )
84
	session-mm? ( dev-libs/mm )
102 85
	simplexml? ( >=dev-libs/libxml2-2.6.8 )
103 86
	snmp? ( >=net-analyzer/net-snmp-5.2 )
104 87
	soap? ( >=dev-libs/libxml2-2.6.8 )
......
108 91
		!libressl? ( dev-libs/openssl:0= )
109 92
		libressl? ( dev-libs/libressl:0= )
110 93
	)
111
	sybase-ct? ( dev-db/freetds )
112
	tidy? ( app-text/htmltidy )
113
	truetype? (
114
		=media-libs/freetype-2*
115
		>=media-libs/t1lib-5.0.0
116
		!gd? (
117
			virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib:0= )
118
	)
94
	tidy? ( || ( app-text/tidy-html5 app-text/htmltidy ) )
95
	truetype? ( =media-libs/freetype-2* )
119 96
	unicode? ( dev-libs/oniguruma:= )
120
	vpx? ( media-libs/libvpx:0= )
121 97
	wddx? ( >=dev-libs/libxml2-2.6.8 )
98
	webp? ( media-libs/libwebp:0= )
122 99
	xml? ( >=dev-libs/libxml2-2.6.8 )
123 100
	xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
124 101
	xmlreader? ( >=dev-libs/libxml2-2.6.8 )
125 102
	xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
126
	xpm? (
127
		x11-libs/libXpm
128
		virtual/jpeg:0
129
		media-libs/libpng:0= sys-libs/zlib:0=
130
	)
103
	xpm? ( x11-libs/libXpm )
131 104
	xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
132 105
	zip? ( sys-libs/zlib:0= )
133 106
	zlib? ( sys-libs/zlib:0= )
......
139 112
		selinux? ( sec-policy/selinux-phpfpm )
140 113
		systemd? ( sys-apps/systemd ) )"
141 114

  
115
# Bison isn't actually needed when building from a release tarball
116
# However, the configure script will warn if it's absent or if you
117
# have an incompatible version installed. See bug 593278.
142 118
DEPEND="${COMMON_DEPEND}
143 119
	app-arch/xz-utils
144
	>=sys-devel/bison-3.0.1
145
	sys-devel/flex
146
	>=sys-devel/m4-1.4.3
147
	>=sys-devel/libtool-1.5.18"
120
	>=sys-devel/bison-3.0.1"
121

  
122
BDEPEND="virtual/pkgconfig"
148 123

  
149 124
# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
150 125
REQUIRED_USE="
151
	|| ( cli cgi fpm apache2 embed )
126
	|| ( cli cgi fpm apache2 embed phpdbg )
152 127
	cli? ( ^^ ( readline libedit ) )
153 128
	truetype? ( gd zlib )
154
	vpx? ( gd zlib )
129
	webp? ( gd zlib )
155 130
	cjk? ( gd zlib )
156 131
	exif? ( gd zlib )
157 132
	xpm? ( gd zlib )
......
165 140
	ldap-sasl? ( ldap )
166 141
	mhash? ( hash )
167 142
	phar? ( hash )
168
	recode? ( !imap !mysql !mysqli !libmysqlclient )
169
	libmysqlclient? ( || (
170
		mysql
171
		mysqli
172
		pdo
173
	) )
174

  
175 143
	qdbm? ( !gdbm )
176 144
	readline? ( !libedit )
177
	sharedmem? ( !threads )
145
	recode? ( !imap !mysqli !mysql )
146
	session-mm? ( session !threads )
147
	mysql? ( hash || ( mysqli pdo ) )
148
	mysqli? ( hash )
178 149
"
150
PATCHES=(
151
	"${FILESDIR}/php-freetype-2.9.1.patch"
152
	"${FILESDIR}/php-7.1.25-intl-use-icu-namespace.patch"
153
)
179 154

  
180 155
PHP_MV="$(ver_cut 1)"
181 156

  
......
219 194

  
220 195
	# SAPI-specific handling
221 196
	if [[ "${sapi}" == "fpm" ]] ; then
222
		einfo "Installing FPM config file php-fpm.conf"
197
		einfo "Installing FPM config files php-fpm.conf and www.conf"
223 198
		insinto "${PHP_INI_DIR#${EPREFIX}}"
224 199
		doins sapi/fpm/php-fpm.conf
200
		insinto "${PHP_INI_DIR#${EPREFIX}}/fpm.d"
201
		doins sapi/fpm/www.conf
225 202
	fi
226 203

  
227 204
	dodoc php.ini-{development,production}
......
234 211
}
235 212

  
236 213
src_prepare() {
237
	local patchdir="${WORKDIR}/php-patches-${PATCH_V}"
238

  
239
	eapply "${patchdir}/"
240

  
241
	# Copy test binaries from patches
242
	cp "${patchdir}/bug77540.jpg" \
243
		"${patchdir}/bug77753.tiff" "${patchdir}/bug77831.tiff" \
244
		"${patchdir}/bug77950.tiff" \
245
		"${patchdir}/bug77563.jpg" "ext/exif/tests/" || die
246

  
247
	# Change PHP branding
248
	# Get the alpha/beta/rc version
249
	sed -re	"s|^(PHP_EXTRA_VERSION=\").*(\")|\1-pl${PR/r/}-gentoo\2|g" \
250
		-i configure.in || die "Unable to change PHP branding"
251

  
252
	# Patch PHP to show Gentoo as the server platform
253
	sed -e 's/PHP_UNAME=`uname -a | xargs`/PHP_UNAME=`uname -s -n -r -v | xargs`/g' \
254
		-i configure.in || die "Failed to fix server platform name"
255

  
256
	# Prevent PHP from activating the Apache config,
257
	# as we will do that ourselves
258
	sed -i \
259
		-e "s,-i -a -n php${PHP_MV},-i -n php${PHP_MV},g" \
260
		-e "s,-i -A -n php${PHP_MV},-i -n php${PHP_MV},g" \
261
		configure sapi/apache2filter/config.m4 sapi/apache2handler/config.m4 \
262
		|| die
263

  
264
	# Patch PHP to support heimdal instead of mit-krb5
265
	if has_version "app-crypt/heimdal" ; then
266
		sed -e 's|gssapi_krb5|gssapi|g' -i acinclude.m4 \
267
			|| die "Failed to fix heimdal libname"
268
		sed -e 's|PHP_ADD_LIBRARY(k5crypto, 1, $1)||g' -i acinclude.m4 \
269
			|| die "Failed to fix heimdal crypt library reference"
270
	fi
214
	default
271 215

  
272
	eapply_user
216
	# In php-7.x, the FPM pool configuration files have been split off
217
	# of the main config. By default the pool config files go in
218
	# e.g. /etc/php-fpm.d, which isn't slotted. So here we move the
219
	# include directory to a subdirectory "fpm.d" of $PHP_INI_DIR. Later
220
	# we'll install the pool configuration file "www.conf" there.
221
	php_set_ini_dir fpm
222
	sed -i "s~^include=.*$~include=${PHP_INI_DIR}/fpm.d/*.conf~" \
223
		sapi/fpm/php-fpm.conf.in \
224
		|| die 'failed to move the include directory in php-fpm.conf'
273 225

  
226
	# Bug 669566 - necessary so that build tools are updated for commands like pecl
274 227
	# Force rebuilding aclocal.m4
275 228
	rm -f aclocal.m4 || die "failed to remove aclocal.m4 in src_prepare"
276

  
277
	mv configure.in configure.ac || die
278

  
279 229
	eautoreconf
280

  
281
	if [[ ${CHOST} == *-darwin* ]] ; then
282
		# http://bugs.php.net/bug.php?id=48795, bug #343481
283
		sed -i -e '/BUILD_CGI="\\$(CC)/s/CC/CXX/' configure || die
284
	fi
285 230
}
286 231

  
287 232
src_configure() {
......
330 275
		$(use_with xml libxml-dir "${EPREFIX}/usr")
331 276
		$(use_enable unicode mbstring)
332 277
		$(use_with crypt mcrypt "${EPREFIX}/usr")
333
		$(use_with mssql mssql "${EPREFIX}/usr")
334 278
		$(use_with unicode onig "${EPREFIX}/usr")
335 279
		$(use_with ssl openssl "${EPREFIX}/usr")
336 280
		$(use_with ssl openssl-dir "${EPREFIX}/usr")
......
348 292
		$(use_enable soap soap)
349 293
		$(use_enable sockets sockets)
350 294
		$(use_with sqlite sqlite3 "${EPREFIX}/usr")
351
		$(use_with sybase-ct sybase-ct "${EPREFIX}/usr")
352 295
		$(use_enable sysvipc sysvmsg)
353 296
		$(use_enable sysvipc sysvsem)
354 297
		$(use_enable sysvipc sysvshm)
......
384 327
	# Support for the GD graphics library
385 328
	our_conf+=(
386 329
		$(use_with truetype freetype-dir "${EPREFIX}/usr")
387
		$(use_with truetype t1lib "${EPREFIX}/usr")
388 330
		$(use_enable cjk gd-jis-conv)
389 331
		$(use_with gd jpeg-dir "${EPREFIX}/usr")
390 332
		$(use_with gd png-dir "${EPREFIX}/usr")
391 333
		$(use_with xpm xpm-dir "${EPREFIX}/usr")
392
		$(use_with vpx vpx-dir "${EPREFIX}/usr")
393 334
	)
335
	if use webp; then
336
		our_conf+=( --with-webp-dir="${EPREFIX}/usr" )
337
	fi
394 338
	# enable gd last, so configure can pick up the previous settings
395 339
	our_conf+=( $(use_with gd gd) )
396 340

  
......
416 360
	# MySQL support
417 361
	local mysqllib="mysqlnd"
418 362
	local mysqlilib="mysqlnd"
419
	use libmysqlclient && mysqllib="${EPREFIX}/usr"
420
	use libmysqlclient && mysqlilib="${EPREFIX}/usr/bin/mysql_config"
421 363

  
422
	our_conf+=( $(use_with mysql mysql "${mysqllib}") )
423 364
	our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
424 365

  
425 366
	local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock"
......
439 380
	# PDO support
440 381
	if use pdo ; then
441 382
		our_conf+=(
442
			$(use_with mssql pdo-dblib)
383
			$(use_with mssql pdo-dblib "${EPREFIX}/usr")
443 384
			$(use_with mysql pdo-mysql "${mysqllib}")
444 385
			$(use_with postgres pdo-pgsql)
445 386
			$(use_with sqlite pdo-sqlite "${EPREFIX}/usr")
......
457 398

  
458 399
	# Session support
459 400
	if use session ; then
460
		our_conf+=( $(use_with sharedmem mm "${EPREFIX}/usr") )
401
		our_conf+=( $(use_with session-mm mm "${EPREFIX}/usr") )
461 402
	else
462 403
		our_conf+=( $(use_enable session session) )
463 404
	fi
......
506 447

  
507 448
		for sapi in $SAPIS ; do
508 449
			case "$sapi" in
509
				cli|cgi|embed|fpm)
450
				cli|cgi|embed|fpm|phpdbg)
510 451
					if [[ "${one_sapi}" == "${sapi}" ]] ; then
511 452
						sapi_conf+=( "--enable-${sapi}" )
512 453
						if [[ "fpm" == "${sapi}" ]] ; then
......
593 534
				# We're specifically not using emake install-sapi as libtool
594 535
				# may cause unnecessary relink failures (see bug #351266)
595 536
				insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/"
596
				newins ".libs/libphp5$(get_libname)" \
537
				newins ".libs/libphp${PHP_MV}$(get_libname)" \
597 538
					   "libphp${PHP_MV}$(get_libname)"
598 539
				keepdir "/usr/$(get_libdir)/apache2/modules"
599 540
			else
......
613 554
					embed)
614 555
						source="libs/libphp${PHP_MV}$(get_libname)"
615 556
						;;
557
					phpdbg)
558
						source="sapi/phpdbg/phpdbg"
559
						;;
616 560
					*)
617 561
						die "unhandled sapi in src_install"
618 562
						;;
......
675 619
		export TEST_PHP_EXECUTABLE="${PHP_BIN}"
676 620
	fi
677 621

  
678
	if [[ -x "${WORKDIR}/sapis/cgi/php-cgi" ]] ; then
679
		export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis/cgi/php-cgi"
622
	if [[ -x "${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" ]] ; then
623
		export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi"
624
	fi
625

  
626
	if [[ -x "${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" ]] ; then
627
		export TEST_PHPDBG_EXECUTABLE="${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg"
680 628
	fi
681 629

  
682 630
	REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n  -d \
Thank you!