Diff php-5.6.40-r6 with a php-7.1.31

/usr/portage/dev-lang/php/php-7.1.31.ebuild 2019-10-13 22:09:00.000000000 +0300
3 3

  
4 4
EAPI="7"
5 5

  
6
inherit autotools flag-o-matic systemd
7

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

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

  
121
BDEPEND="virtual/pkgconfig"
147 122

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

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

  
179 154
PHP_MV="$(ver_cut 1)"
180 155

  
......
218 193

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

  
226 203
	dodoc php.ini-{development,production}
......
233 210
}
234 211

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

  
238
	eapply "${patchdir}/"
213
	default
239 214

  
240
	# Copy test binaries from patches
241
	local ext_src
242
	for ext_src in exif iconv ; do
243
		cp "${patchdir}/${ext_src}/"* "ext/${ext_src}/tests/" || die
244
	done
245

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

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

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

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

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

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

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

  
278 228
	eautoreconf
279

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

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

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

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

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

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

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

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

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

  
681 629
	REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n  -d \
Thank you!