public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-lang/php/files/, dev-lang/php/
@ 2020-12-23  0:39 Thomas Deutschmann
  0 siblings, 0 replies; 21+ messages in thread
From: Thomas Deutschmann @ 2020-12-23  0:39 UTC (permalink / raw
  To: gentoo-commits

commit:     280c5e27b96f27eed2f3325576d74361abb36294
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Wed Dec 23 00:38:40 2020 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Wed Dec 23 00:39:05 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=280c5e27

dev-lang/php: fix use-after-free when accessing already destructed backtrace arguments

Bug: https://bugs.gentoo.org/711140
Package-Manager: Portage-3.0.12, Repoman-3.0.2
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>

 .../files/php-7.2.34-use-after-free-bug76047.patch | 174 +++++++++++++++++++++
 .../{php-7.2.34.ebuild => php-7.2.34-r1.ebuild}    |   1 +
 2 files changed, 175 insertions(+)

diff --git a/dev-lang/php/files/php-7.2.34-use-after-free-bug76047.patch b/dev-lang/php/files/php-7.2.34-use-after-free-bug76047.patch
new file mode 100644
index 00000000000..b3a864ee82a
--- /dev/null
+++ b/dev-lang/php/files/php-7.2.34-use-after-free-bug76047.patch
@@ -0,0 +1,174 @@
+Backport of https://git.php.net/?p=php-src.git;a=commit;h=ef1e4891b47949c8dc0f9482eef9454a0ecdfa1d
+
+--- a/Zend/tests/bug52361.phpt
++++ b/Zend/tests/bug52361.phpt
+@@ -25,9 +25,8 @@ try {
+ --EXPECTF--
+ 1. Exception: aaa in %sbug52361.php:5
+ Stack trace:
+-#0 %sbug52361.php(13): aaa->__destruct()
+-#1 %sbug52361.php(16): bbb()
+-#2 {main}
++#0 %sbug52361.php(16): aaa->__destruct()
++#1 {main}
+ 2. Exception: bbb in %sbug52361.php:13
+ Stack trace:
+ #0 %sbug52361.php(16): bbb()
+--- /dev/null
++++ b/Zend/tests/bug76047.phpt
+@@ -0,0 +1,68 @@
++--TEST--
++Bug #76047: Use-after-free when accessing already destructed backtrace arguments
++--FILE--
++<?php
++
++class Vuln {
++    public $a;
++    public function __destruct() {
++        unset($this->a);
++        $backtrace = (new Exception)->getTrace();
++        var_dump($backtrace);
++    }
++}
++
++function test($arg) {
++    $arg = str_shuffle(str_repeat('A', 79));
++    $vuln = new Vuln();
++    $vuln->a = $arg;
++}
++
++function test2($arg) {
++    $$arg = 1; // Trigger symbol table
++    $arg = str_shuffle(str_repeat('A', 79));
++    $vuln = new Vuln();
++    $vuln->a = $arg;
++}
++
++test('x');
++test2('x');
++
++?>
++--EXPECTF--
++array(1) {
++  [0]=>
++  array(6) {
++    ["file"]=>
++    string(%d) "%s"
++    ["line"]=>
++    int(%d)
++    ["function"]=>
++    string(10) "__destruct"
++    ["class"]=>
++    string(4) "Vuln"
++    ["type"]=>
++    string(2) "->"
++    ["args"]=>
++    array(0) {
++    }
++  }
++}
++array(1) {
++  [0]=>
++  array(6) {
++    ["file"]=>
++    string(%d) "%s"
++    ["line"]=>
++    int(%d)
++    ["function"]=>
++    string(10) "__destruct"
++    ["class"]=>
++    string(4) "Vuln"
++    ["type"]=>
++    string(2) "->"
++    ["args"]=>
++    array(0) {
++    }
++  }
++}
+--- a/Zend/zend_vm_def.h
++++ b/Zend/zend_vm_def.h
+@@ -2366,9 +2366,9 @@ ZEND_VM_HELPER(zend_leave_helper, ANY, ANY)
+ 	uint32_t call_info = EX_CALL_INFO();
+ 
+ 	if (EXPECTED((call_info & (ZEND_CALL_CODE|ZEND_CALL_TOP|ZEND_CALL_HAS_SYMBOL_TABLE|ZEND_CALL_FREE_EXTRA_ARGS|ZEND_CALL_ALLOCATED)) == 0)) {
++		EG(current_execute_data) = EX(prev_execute_data);
+ 		i_free_compiled_variables(execute_data);
+ 
+-		EG(current_execute_data) = EX(prev_execute_data);
+ 		if (UNEXPECTED(call_info & ZEND_CALL_RELEASE_THIS)) {
+ 			zend_object *object = Z_OBJ(execute_data->This);
+ #if 0
+@@ -2394,12 +2394,12 @@ ZEND_VM_HELPER(zend_leave_helper, ANY, ANY)
+ 		LOAD_NEXT_OPLINE();
+ 		ZEND_VM_LEAVE();
+ 	} else if (EXPECTED((call_info & (ZEND_CALL_CODE|ZEND_CALL_TOP)) == 0)) {
++		EG(current_execute_data) = EX(prev_execute_data);
+ 		i_free_compiled_variables(execute_data);
+ 
+ 		if (UNEXPECTED(call_info & ZEND_CALL_HAS_SYMBOL_TABLE)) {
+ 			zend_clean_and_cache_symbol_table(EX(symbol_table));
+ 		}
+-		EG(current_execute_data) = EX(prev_execute_data);
+ 
+ 		/* Free extra args before releasing the closure,
+ 		 * as that may free the op_array. */
+@@ -2449,6 +2449,7 @@ ZEND_VM_HELPER(zend_leave_helper, ANY, ANY)
+ 		ZEND_VM_LEAVE();
+ 	} else {
+ 		if (EXPECTED((call_info & ZEND_CALL_CODE) == 0)) {
++			EG(current_execute_data) = EX(prev_execute_data);
+ 			i_free_compiled_variables(execute_data);
+ 			if (UNEXPECTED(call_info & (ZEND_CALL_HAS_SYMBOL_TABLE|ZEND_CALL_FREE_EXTRA_ARGS))) {
+ 				if (UNEXPECTED(call_info & ZEND_CALL_HAS_SYMBOL_TABLE)) {
+@@ -2456,7 +2457,6 @@ ZEND_VM_HELPER(zend_leave_helper, ANY, ANY)
+ 				}
+ 				zend_vm_stack_free_extra_args_ex(call_info, execute_data);
+ 			}
+-			EG(current_execute_data) = EX(prev_execute_data);
+ 			if (UNEXPECTED(call_info & ZEND_CALL_CLOSURE)) {
+ 				OBJ_RELEASE((zend_object*)EX(func)->op_array.prototype);
+ 			}
+--- a/Zend/zend_vm_execute.h
++++ b/Zend/zend_vm_execute.h
+@@ -434,9 +434,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_leave_helper_SPEC(ZEND_OPCODE_
+ 	uint32_t call_info = EX_CALL_INFO();
+ 
+ 	if (EXPECTED((call_info & (ZEND_CALL_CODE|ZEND_CALL_TOP|ZEND_CALL_HAS_SYMBOL_TABLE|ZEND_CALL_FREE_EXTRA_ARGS|ZEND_CALL_ALLOCATED)) == 0)) {
++		EG(current_execute_data) = EX(prev_execute_data);
+ 		i_free_compiled_variables(execute_data);
+ 
+-		EG(current_execute_data) = EX(prev_execute_data);
+ 		if (UNEXPECTED(call_info & ZEND_CALL_RELEASE_THIS)) {
+ 			zend_object *object = Z_OBJ(execute_data->This);
+ #if 0
+@@ -462,12 +462,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_leave_helper_SPEC(ZEND_OPCODE_
+ 		LOAD_NEXT_OPLINE();
+ 		ZEND_VM_LEAVE();
+ 	} else if (EXPECTED((call_info & (ZEND_CALL_CODE|ZEND_CALL_TOP)) == 0)) {
++		EG(current_execute_data) = EX(prev_execute_data);
+ 		i_free_compiled_variables(execute_data);
+ 
+ 		if (UNEXPECTED(call_info & ZEND_CALL_HAS_SYMBOL_TABLE)) {
+ 			zend_clean_and_cache_symbol_table(EX(symbol_table));
+ 		}
+-		EG(current_execute_data) = EX(prev_execute_data);
+ 
+ 		/* Free extra args before releasing the closure,
+ 		 * as that may free the op_array. */
+@@ -517,6 +517,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_leave_helper_SPEC(ZEND_OPCODE_
+ 		ZEND_VM_LEAVE();
+ 	} else {
+ 		if (EXPECTED((call_info & ZEND_CALL_CODE) == 0)) {
++			EG(current_execute_data) = EX(prev_execute_data);
+ 			i_free_compiled_variables(execute_data);
+ 			if (UNEXPECTED(call_info & (ZEND_CALL_HAS_SYMBOL_TABLE|ZEND_CALL_FREE_EXTRA_ARGS))) {
+ 				if (UNEXPECTED(call_info & ZEND_CALL_HAS_SYMBOL_TABLE)) {
+@@ -524,7 +525,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_leave_helper_SPEC(ZEND_OPCODE_
+ 				}
+ 				zend_vm_stack_free_extra_args_ex(call_info, execute_data);
+ 			}
+-			EG(current_execute_data) = EX(prev_execute_data);
+ 			if (UNEXPECTED(call_info & ZEND_CALL_CLOSURE)) {
+ 				OBJ_RELEASE((zend_object*)EX(func)->op_array.prototype);
+ 			}
+ 

diff --git a/dev-lang/php/php-7.2.34.ebuild b/dev-lang/php/php-7.2.34-r1.ebuild
similarity index 99%
rename from dev-lang/php/php-7.2.34.ebuild
rename to dev-lang/php/php-7.2.34-r1.ebuild
index b7fe1520efb..a534bc594e5 100644
--- a/dev-lang/php/php-7.2.34.ebuild
+++ b/dev-lang/php/php-7.2.34-r1.ebuild
@@ -157,6 +157,7 @@ RESTRICT="!test? ( test )"
 PATCHES=(
 	"${FILESDIR}/php-freetype-2.9.1.patch"
 	"${FILESDIR}/php-7.2.13-intl-use-icu-namespace.patch"
+	"${FILESDIR}/php-7.2.34-use-after-free-bug76047.patch"
 )
 
 PHP_MV="$(ver_cut 1)"


^ permalink raw reply related	[flat|nested] 21+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-lang/php/files/, dev-lang/php/
@ 2024-07-10 14:50 Michael Orlitzky
  0 siblings, 0 replies; 21+ messages in thread
From: Michael Orlitzky @ 2024-07-10 14:50 UTC (permalink / raw
  To: gentoo-commits

commit:     0771e0a34345350b76153a1d4826dbec82e0dbea
Author:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
AuthorDate: Tue Jul  9 19:16:23 2024 +0000
Commit:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
CommitDate: Wed Jul 10 14:07:08 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0771e0a3

dev-lang/php: add 8.3.9, drop 8.3.8

Various improvements on top of the version bump:

  * The system copy of media-libs/gd is now used.
  * Autoconf cache variables are overridden to allow
    cross-compiles with external libraries.
  * New USE=opcache-jit flag to control the use of a
    JIT within the opcache extension.

Closes: https://bugs.gentoo.org/857597
Closes: https://bugs.gentoo.org/906585
Bug: https://bugs.gentoo.org/931884
Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org>

 dev-lang/php/Manifest                              |    2 +-
 dev-lang/php/files/php-8.3.9-gd-cachevars.patch    |   68 ++
 .../files/php-8.3.9-optional-png-testfixen.patch   | 1277 ++++++++++++++++++++
 dev-lang/php/metadata.xml                          |    3 +
 .../php/{php-8.3.8.ebuild => php-8.3.9.ebuild}     |   89 +-
 5 files changed, 1406 insertions(+), 33 deletions(-)

diff --git a/dev-lang/php/Manifest b/dev-lang/php/Manifest
index d558144544a8..56ca4d9663cd 100644
--- a/dev-lang/php/Manifest
+++ b/dev-lang/php/Manifest
@@ -4,4 +4,4 @@ DIST php-8.1.29.tar.xz 11826292 BLAKE2B 471f85504531c61e534c857a854de2ce9935b263
 DIST php-8.2.15.tar.xz 12075384 BLAKE2B cef15868968538e232093bd66d862a88f0960325f2274eaf53a3d114d01787c58844aa3bce8bc09a723acd95801e1935a60e79fc189317e7f1ba19196dbfcdc4 SHA512 56c94bcafe07cf4bf5eb5fc6c67fcf16654c44a262ffb18188fc3ffac5e9bb11d39093bfb26c26bc8d2dec7e530d1a175180909262c9b5c30130cf5a4a293166
 DIST php-8.2.18.tar.xz 12089400 BLAKE2B 82a4ef0aee7fa66018cb528e6fc2da40f67be2a75449ed85c54881e6725cfa9fe82d6d5655c12d2e92f3fd685479367b7c038df5af0d7a0a122d627c78c50514 SHA512 8bdd6e5aa19dac80745d258a43f7330a3096d47dc66cbef0054b8f9eb9ace5e87d841a4001185a783241a416975753c922425e977f50b2716ce643b6a7bf351f
 DIST php-8.2.20.tar.xz 12097568 BLAKE2B 1e38e48ea9c28abfe2c3bd860bc5d959fbe327669c007f2e2a665ae14f5a045f6ad8a0a972f32618f88ea1ff3636c2692504478b5b094b48404d6c4a214f863b SHA512 c659ed4809b6507aa428b483c85c7322815ac9d7d8e4bfe575513a5e69c5a680b8d089fd98a19f83d3a00df3de61468809f21408455913aa24d519776e44abc5
-DIST php-8.3.8.tar.xz 12480896 BLAKE2B 477129fcd766f2235e3d776c923ba51b76539f074245e8041a861db09ebbc648658b2756e6a23051a75a512fdc6e5c129633d1471213dec6f7e24d4da0d317e8 SHA512 1a2840f0b5dcbea6dfcc3894cb9e38d103bf4110c1b956438199deee0b60e5ae63cce34be25ca6f03ac8d26581a852657f8800f92fefe38345e20443b646bb3e
+DIST php-8.3.9.tar.xz 12470616 BLAKE2B 44cc360c91b121f6fe1c768134d2e5e355fe1ab23ebefb98e60e878755e79b0bd31fa46a435eb5c3dabf034fb7b4bd785db014dc63f40331a6b168a14d849571 SHA512 f6291b71cf2c66f9effc2a8a7b0365364481cd5532551161194376893074f1f20dc7e9dbd628727e3b07460ac63b6d38bf4871bf4976e2b3b290f230b0111360

diff --git a/dev-lang/php/files/php-8.3.9-gd-cachevars.patch b/dev-lang/php/files/php-8.3.9-gd-cachevars.patch
new file mode 100644
index 000000000000..cb6ae9f3479d
--- /dev/null
+++ b/dev-lang/php/files/php-8.3.9-gd-cachevars.patch
@@ -0,0 +1,68 @@
+From b5e5a42d145be30be3856ff4be9af7978adec5c5 Mon Sep 17 00:00:00 2001
+From: Peter Kokot <peterkokot@gmail.com>
+Date: Sun, 2 Jun 2024 19:47:39 +0200
+Subject: [PATCH] Wrap gdImageCreateFrom* checks in AC_CACHE_CHECK
+
+This enables cross-compiling edge cases to manually override the checks
+with the php_cv_lib_gd_gdImageCreateFrom* cache variables.
+---
+ ext/gd/config.m4 | 39 ++++++++++++++++++++-------------------
+ 1 file changed, 20 insertions(+), 19 deletions(-)
+
+diff --git a/ext/gd/config.m4 b/ext/gd/config.m4
+index d9c6d4f6ee0c2..5c1c7a867c2f8 100644
+--- a/ext/gd/config.m4
++++ b/ext/gd/config.m4
+@@ -147,14 +147,15 @@ dnl that gd defines "junk" versions of each gdImageCreateFromFoo function
+ dnl even when it does not support the Foo format. Those junk functions
+ dnl display a warning but eventually return normally, making a simple link
+ dnl or run test insufficient.
+-AC_DEFUN([PHP_GD_CHECK_FORMAT],[
+-  old_LIBS="${LIBS}"
+-  LIBS="${LIBS} ${GD_SHARED_LIBADD}"
+-  old_CFLAGS="${CFLAGS}"
+-  CFLAGS="${CFLAGS} ${GDLIB_CFLAGS}"
+-  AC_MSG_CHECKING([for working gdImageCreateFrom$1 in libgd])
+-  AC_LANG_PUSH([C])
+-  AC_RUN_IFELSE([AC_LANG_SOURCE([
++AC_DEFUN([PHP_GD_CHECK_FORMAT],
++[AS_VAR_PUSHDEF([php_var], [php_cv_lib_gd_gdImageCreateFrom$1])
++old_LIBS="${LIBS}"
++LIBS="${LIBS} ${GD_SHARED_LIBADD}"
++old_CFLAGS="${CFLAGS}"
++CFLAGS="${CFLAGS} ${GDLIB_CFLAGS}"
++AC_LANG_PUSH([C])
++AC_CACHE_CHECK([for working gdImageCreateFrom$1 in libgd], [php_var],
++  [AC_RUN_IFELSE([AC_LANG_SOURCE([
+ #include <stdio.h>
+ #include <unistd.h>
+ #include <gd.h>
+@@ -173,17 +174,17 @@ int main(int argc, char** argv) {
+   gdSetErrorMethod(exit1);
+   gdImagePtr p = gdImageCreateFrom$1(f);
+   return 0;
+-}])],[
+-    AC_MSG_RESULT([yes])
+-    AC_DEFINE($2, 1, [Does gdImageCreateFrom$1 work?])
+-  ],[
+-    AC_MSG_RESULT([no])
+-  ],[
+-    AC_MSG_RESULT([no])
+-  ])
+-  AC_LANG_POP([C])
+-  CFLAGS="${old_CFLAGS}"
+-  LIBS="${old_LIBS}"
++}])],
++  [AS_VAR_SET([php_var], [yes])],
++  [AS_VAR_SET([php_var], [no])],
++  [AS_VAR_SET([php_var], [no])])])
++AS_VAR_IF([php_var], [yes],
++  [AC_DEFINE_UNQUOTED([$2], [1],
++    [Define to 1 if GD library has 'gdImageCreateFrom$1'.])])
++AC_LANG_POP([C])
++CFLAGS="${old_CFLAGS}"
++LIBS="${old_LIBS}"
++AS_VAR_POPDEF([php_var])
+ ])
+ 
+ AC_DEFUN([PHP_GD_CHECK_VERSION],[

diff --git a/dev-lang/php/files/php-8.3.9-optional-png-testfixen.patch b/dev-lang/php/files/php-8.3.9-optional-png-testfixen.patch
new file mode 100644
index 000000000000..04b55b3b6b81
--- /dev/null
+++ b/dev-lang/php/files/php-8.3.9-optional-png-testfixen.patch
@@ -0,0 +1,1277 @@
+From e25636b087c507bf12922c8faf9f526aa87153a6 Mon Sep 17 00:00:00 2001
+From: Michael Orlitzky <michael@orlitzky.com>
+Date: Wed, 23 Aug 2023 18:42:17 -0400
+Subject: [PATCH 1/3] ext/gd/tests: fix three misleading die() messages
+
+Three of our gd tests could be skipped with a message about requiring
+bundled GD, but those tests don't actually require bundled GD. We
+update the messages to mention the specific functions that are
+required.
+---
+ ext/gd/tests/bug24155.phpt    | 2 +-
+ ext/gd/tests/bug39366.phpt    | 2 +-
+ ext/gd/tests/imagefilter.phpt | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/ext/gd/tests/bug24155.phpt b/ext/gd/tests/bug24155.phpt
+index 42c5e3d7926f5..7c12c38a1a6d7 100644
+--- a/ext/gd/tests/bug24155.phpt
++++ b/ext/gd/tests/bug24155.phpt
+@@ -4,7 +4,7 @@ Bug #24155 (gdImageRotate270 rotation problem).
+ gd
+ --SKIPIF--
+ <?php
+-    if (!function_exists("imagerotate")) die("skip requires bundled GD library\n");
++    if (!function_exists("imagerotate")) die("skip requires imagerotate function");
+ ?>
+ --FILE--
+ <?php
+diff --git a/ext/gd/tests/bug39366.phpt b/ext/gd/tests/bug39366.phpt
+index 2fedbcef43dfe..81e81059c27e8 100644
+--- a/ext/gd/tests/bug39366.phpt
++++ b/ext/gd/tests/bug39366.phpt
+@@ -4,7 +4,7 @@ Bug #39366 (imagerotate does not respect alpha with angles>45)
+ gd
+ --SKIPIF--
+ <?php
+-    if (!function_exists("imagerotate")) die("skip requires bundled GD library\n");
++    if (!function_exists("imagerotate")) die("skip requires imagerotate function");
+ ?>
+ --FILE--
+ <?php
+diff --git a/ext/gd/tests/imagefilter.phpt b/ext/gd/tests/imagefilter.phpt
+index 156f465da6016..79a73472511c7 100644
+--- a/ext/gd/tests/imagefilter.phpt
++++ b/ext/gd/tests/imagefilter.phpt
+@@ -4,7 +4,7 @@ imagefilter() function test
+ gd
+ --SKIPIF--
+ <?php
+-    if (!function_exists("imagefilter")) die("skip requires bundled GD library\n");
++    if (!function_exists("imagefilter")) die("skip requires imagefilter function");
+ ?>
+ --FILE--
+ <?php
+
+From 68a5f3f0a8e6299dddaafa2118ff322c532f1ae1 Mon Sep 17 00:00:00 2001
+From: Michael Orlitzky <michael@orlitzky.com>
+Date: Wed, 23 Aug 2023 19:56:10 -0400
+Subject: [PATCH 2/3] ext/gd/tests: add SKIPIF stanzas for missing PNG support
+
+The bundled libgd always has PNG support, but an external one may not.
+---
+ ext/gd/tests/bug22544-mb.phpt                    | 6 ++++++
+ ext/gd/tests/bug22544.phpt                       | 6 ++++++
+ ext/gd/tests/bug24155.phpt                       | 3 +++
+ ext/gd/tests/bug27582_1.phpt                     | 6 ++++++
+ ext/gd/tests/bug39780_extern.phpt                | 3 +++
+ ext/gd/tests/bug43073.phpt                       | 3 +++
+ ext/gd/tests/bug43475.phpt                       | 3 +++
+ ext/gd/tests/bug43828.phpt                       | 3 +++
+ ext/gd/tests/bug45799.phpt                       | 6 ++++++
+ ext/gd/tests/bug47946.phpt                       | 3 +++
+ ext/gd/tests/bug48732-mb.phpt                    | 3 +++
+ ext/gd/tests/bug48732.phpt                       | 4 ++++
+ ext/gd/tests/bug50194.phpt                       | 4 +++-
+ ext/gd/tests/bug51498.phpt                       | 3 +++
+ ext/gd/tests/bug52070.phpt                       | 6 ++++++
+ ext/gd/tests/bug53504.phpt                       | 3 +++
+ ext/gd/tests/bug64641.phpt                       | 3 +++
+ ext/gd/tests/bug66005.phpt                       | 6 ++++++
+ ext/gd/tests/bug72482_2.phpt                     | 6 ++++++
+ ext/gd/tests/bug72604.phpt                       | 6 ++++++
+ ext/gd/tests/bug72913.phpt                       | 6 ++++++
+ ext/gd/tests/bug73213.phpt                       | 6 ++++++
+ ext/gd/tests/bug73272.phpt                       | 6 ++++++
+ ext/gd/tests/bug73549.phpt                       | 6 ++++++
+ ext/gd/tests/bug73614.phpt                       | 3 +++
+ ext/gd/tests/bug74031.phpt                       | 6 ++++++
+ ext/gd/tests/bug75124.phpt                       | 3 +++
+ ext/gd/tests/bug77943.phpt                       | 6 ++++++
+ ext/gd/tests/bug79945.phpt                       | 3 +++
+ ext/gd/tests/imagearc_basic.phpt                 | 6 ++++++
+ ext/gd/tests/imagearc_variation1.phpt            | 6 ++++++
+ ext/gd/tests/imagearc_variation2.phpt            | 6 ++++++
+ ext/gd/tests/imagechar_basic.phpt                | 6 ++++++
+ ext/gd/tests/imagecharup_basic.phpt              | 6 ++++++
+ ext/gd/tests/imagecolorallocatealpha_basic.phpt  | 3 +++
+ ext/gd/tests/imagecolorset_basic.phpt            | 6 ++++++
+ ext/gd/tests/imageconvolution_basic.phpt         | 6 ++++++
+ ext/gd/tests/imagecopyresampled_basic.phpt       | 6 ++++++
+ ext/gd/tests/imagecreatefrombmp_basic.phpt       | 3 +++
+ ext/gd/tests/imagecreatefromstring_bmp.phpt      | 3 +++
+ ext/gd/tests/imagecreatefromtga_basic.phpt       | 3 +++
+ ext/gd/tests/imagecreatefromtga_variation.phpt   | 3 +++
+ ext/gd/tests/imagecreatetruecolor_basic.phpt     | 3 +++
+ ext/gd/tests/imagecrop_auto.phpt                 | 3 +++
+ ext/gd/tests/imagedashedline_basic.phpt          | 3 +++
+ ext/gd/tests/imageellipse_basic.phpt             | 6 ++++++
+ ext/gd/tests/imagefilledarc_basic.phpt           | 3 +++
+ ext/gd/tests/imagefilledarc_variation1.phpt      | 3 +++
+ ext/gd/tests/imagefilledarc_variation2.phpt      | 3 +++
+ ext/gd/tests/imagefilledellipse_basic.phpt       | 6 ++++++
+ ext/gd/tests/imagefilledpolygon_basic.phpt       | 3 +++
+ ext/gd/tests/imagefilltoborder_basic.phpt        | 6 ++++++
+ ext/gd/tests/imagefilter.phpt                    | 3 +++
+ ext/gd/tests/imagegammacorrect_basic.phpt        | 3 +++
+ ext/gd/tests/imagegammacorrect_variation1.phpt   | 3 +++
+ ext/gd/tests/imagegammacorrect_variation2.phpt   | 6 ++++++
+ ext/gd/tests/imageopenpolygon_basic.phpt         | 6 ++++++
+ ext/gd/tests/imagepolygon_aa.phpt                | 6 ++++++
+ ext/gd/tests/imagepolygon_basic.phpt             | 3 +++
+ ext/gd/tests/imagerectangle_basic.phpt           | 6 ++++++
+ ext/gd/tests/imageresolution_png.phpt            | 6 ++++++
+ ext/gd/tests/imagesetbrush_basic.phpt            | 6 ++++++
+ ext/gd/tests/imagesetthickness_basic.phpt        | 3 +++
+ ext/gd/tests/imagestring_basic.phpt              | 6 ++++++
+ ext/gd/tests/imagestringup_basic.phpt            | 6 ++++++
+ ext/gd/tests/imagetruecolortopalette_basic.phpt  | 3 +++
+ ext/gd/tests/libgd00086_extern.phpt              | 3 +++
+ ext/gd/tests/test_image_equals_file_palette.phpt | 6 ++++++
+ 68 files changed, 307 insertions(+), 1 deletion(-)
+
+diff --git a/ext/gd/tests/bug22544-mb.phpt b/ext/gd/tests/bug22544-mb.phpt
+index b67478e558c47..f99307df1212b 100644
+--- a/ext/gd/tests/bug22544-mb.phpt
++++ b/ext/gd/tests/bug22544-mb.phpt
+@@ -2,6 +2,12 @@
+ Bug #22544 (TrueColor transparency in PNG images).
+ --EXTENSIONS--
+ gd
++--SKIPIF--
++<?php
++if (!(imagetypes() & IMG_PNG)) {
++    die("skip No PNG support");
++}
++?>
+ --FILE--
+ <?php
+     $image = imageCreateTruecolor(640, 100);
+diff --git a/ext/gd/tests/bug22544.phpt b/ext/gd/tests/bug22544.phpt
+index 1fba04d93739c..28fc6bdfbb0c1 100644
+--- a/ext/gd/tests/bug22544.phpt
++++ b/ext/gd/tests/bug22544.phpt
+@@ -2,6 +2,12 @@
+ Bug #22544 (TrueColor transparency in PNG images).
+ --EXTENSIONS--
+ gd
++--SKIPIF--
++<?php
++if (!(imagetypes() & IMG_PNG)) {
++    die("skip No PNG support");
++}
++?>
+ --FILE--
+ <?php
+     $image = imageCreateTruecolor(640, 100);
+diff --git a/ext/gd/tests/bug24155.phpt b/ext/gd/tests/bug24155.phpt
+index 7c12c38a1a6d7..d78ee9b77816f 100644
+--- a/ext/gd/tests/bug24155.phpt
++++ b/ext/gd/tests/bug24155.phpt
+@@ -5,6 +5,9 @@ gd
+ --SKIPIF--
+ <?php
+     if (!function_exists("imagerotate")) die("skip requires imagerotate function");
++    if (!(imagetypes() & IMG_PNG)) {
++        die("skip No PNG support");
++    }
+ ?>
+ --FILE--
+ <?php
+diff --git a/ext/gd/tests/bug27582_1.phpt b/ext/gd/tests/bug27582_1.phpt
+index 2604c5fcaa9fd..1f15474f50d4b 100644
+--- a/ext/gd/tests/bug27582_1.phpt
++++ b/ext/gd/tests/bug27582_1.phpt
+@@ -2,6 +2,12 @@
+ Bug #27582 (ImageFillToBorder() on alphablending image looses alpha on fill color)
+ --EXTENSIONS--
+ gd
++--SKIPIF--
++<?php
++if (!(imagetypes() & IMG_PNG)) {
++    die("skip No PNG support");
++}
++?>
+ --FILE--
+ <?php
+ $dest = dirname(realpath(__FILE__)) . '/bug27582.png';
+diff --git a/ext/gd/tests/bug39780_extern.phpt b/ext/gd/tests/bug39780_extern.phpt
+index 2330bd65e57ab..438816fe22c6a 100644
+--- a/ext/gd/tests/bug39780_extern.phpt
++++ b/ext/gd/tests/bug39780_extern.phpt
+@@ -5,6 +5,9 @@ gd
+ --SKIPIF--
+ <?php
+     if (GD_BUNDLED) die("skip requires extern GD\n");
++    if (!(imagetypes() & IMG_PNG)) {
++        die("skip No PNG support");
++    }
+ ?>
+ --FILE--
+ <?php
+diff --git a/ext/gd/tests/bug43073.phpt b/ext/gd/tests/bug43073.phpt
+index 5c54d8770f86b..80c6480fea576 100644
+--- a/ext/gd/tests/bug43073.phpt
++++ b/ext/gd/tests/bug43073.phpt
+@@ -5,6 +5,9 @@ gd
+ --SKIPIF--
+ <?php
+     if(!function_exists('imagettftext')) die('skip imagettftext() not available');
++    if (!(imagetypes() & IMG_PNG)) {
++        die("skip No PNG support");
++    }
+ ?>
+ --FILE--
+ <?php
+diff --git a/ext/gd/tests/bug43475.phpt b/ext/gd/tests/bug43475.phpt
+index 8944b57e3cde7..454d2daad0f1a 100644
+--- a/ext/gd/tests/bug43475.phpt
++++ b/ext/gd/tests/bug43475.phpt
+@@ -7,6 +7,9 @@ gd
+     if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.2', '<')) {
+         die("skip test requires GD 2.2.2 or higher");
+     }
++    if (!(imagetypes() & IMG_PNG)) {
++        die("skip No PNG support");
++    }
+ ?>
+ --FILE--
+ <?php
+diff --git a/ext/gd/tests/bug43828.phpt b/ext/gd/tests/bug43828.phpt
+index 8a0caf5decc35..8bc3f9bbcaf83 100644
+--- a/ext/gd/tests/bug43828.phpt
++++ b/ext/gd/tests/bug43828.phpt
+@@ -7,6 +7,9 @@ gd
+ if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.2', '<')) {
+     die("skip test requires GD 2.2.2 or higher");
+ }
++if (!(imagetypes() & IMG_PNG)) {
++    die("skip No PNG support");
++}
+ ?>
+ --FILE--
+ <?php
+diff --git a/ext/gd/tests/bug45799.phpt b/ext/gd/tests/bug45799.phpt
+index 8576b4d007822..f7124ce5b9713 100644
+--- a/ext/gd/tests/bug45799.phpt
++++ b/ext/gd/tests/bug45799.phpt
+@@ -2,6 +2,12 @@
+ Bug #45799 (imagepng() crashes on empty image).
+ --EXTENSIONS--
+ gd
++--SKIPIF--
++<?php
++if (!(imagetypes() & IMG_PNG)) {
++    die("skip No PNG support");
++}
++?>
+ --FILE--
+ <?php
+ $img = imagecreate(500,500);
+diff --git a/ext/gd/tests/bug47946.phpt b/ext/gd/tests/bug47946.phpt
+index 39e5aef9edffc..a87300568326f 100644
+--- a/ext/gd/tests/bug47946.phpt
++++ b/ext/gd/tests/bug47946.phpt
+@@ -5,6 +5,9 @@ gd
+ --SKIPIF--
+ <?php
+ if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.5', '<=')) die('skip upstream fix not yet released');
++if (!(imagetypes() & IMG_PNG)) {
++    die("skip No PNG support");
++}
+ ?>
+ --FILE--
+ <?php
+diff --git a/ext/gd/tests/bug48732-mb.phpt b/ext/gd/tests/bug48732-mb.phpt
+index 13a881254c203..361c1ac4d88f8 100644
+--- a/ext/gd/tests/bug48732-mb.phpt
++++ b/ext/gd/tests/bug48732-mb.phpt
+@@ -6,6 +6,9 @@ gd
+ <?php
+     if(!function_exists('imagefttext')) die('skip imagefttext() not available');
+     if (substr(PHP_OS, 0, 3) == 'WIN') die('skip UTF-8 font file names not yet supported on Windows');
++    if (!(imagetypes() & IMG_PNG)) {
++        die("skip No PNG support");
++    }
+ ?>
+ --FILE--
+ <?php
+diff --git a/ext/gd/tests/bug48732.phpt b/ext/gd/tests/bug48732.phpt
+index 44e4204503ef7..ed73954de3337 100644
+--- a/ext/gd/tests/bug48732.phpt
++++ b/ext/gd/tests/bug48732.phpt
+@@ -2,9 +2,13 @@
+ Bug #48732 (TTF Bounding box wrong for letters below baseline)
+ --EXTENSIONS--
+ gd
++
+ --SKIPIF--
+ <?php
+     if(!function_exists('imagefttext')) die('skip imagefttext() not available');
++    if (!(imagetypes() & IMG_PNG)) {
++        die("skip No PNG support");
++    }
+ ?>
+ --FILE--
+ <?php
+diff --git a/ext/gd/tests/bug50194.phpt b/ext/gd/tests/bug50194.phpt
+index 2addfe0e8325d..33d2400c46e80 100644
+--- a/ext/gd/tests/bug50194.phpt
++++ b/ext/gd/tests/bug50194.phpt
+@@ -5,7 +5,9 @@ gd
+ --SKIPIF--
+ <?php
+ if (!function_exists('imagettftext')) die('skip imagettftext() not available');
+-//die('skip freetype issues');
++if (!(imagetypes() & IMG_PNG)) {
++    die("skip No PNG support");
++}
+ ?>
+ --FILE--
+ <?php
+diff --git a/ext/gd/tests/bug51498.phpt b/ext/gd/tests/bug51498.phpt
+index 808444376525e..756ba1f71dc33 100644
+--- a/ext/gd/tests/bug51498.phpt
++++ b/ext/gd/tests/bug51498.phpt
+@@ -7,6 +7,9 @@ gd
+ if (!GD_BUNDLED && version_compare(GD_VERSION, "2.3.0") < 0) {
+     die("skip test requires GD 2.3.0 or higher");
+ }
++if (!(imagetypes() & IMG_PNG)) {
++    die("skip No PNG support");
++}
+ ?>
+ --FILE--
+ <?php
+diff --git a/ext/gd/tests/bug52070.phpt b/ext/gd/tests/bug52070.phpt
+index 1ba28affdbfcd..6bbe2363a650b 100644
+--- a/ext/gd/tests/bug52070.phpt
++++ b/ext/gd/tests/bug52070.phpt
+@@ -2,6 +2,12 @@
+ Bug #52070 (imagedashedline() - dashed line sometimes is not visible)
+ --EXTENSIONS--
+ gd
++--SKIPIF--
++<?php
++if (!(imagetypes() & IMG_PNG)) {
++    die("skip No PNG support");
++}
++?>
+ --FILE--
+ <?php
+ $im = imagecreate(1200, 800);
+diff --git a/ext/gd/tests/bug53504.phpt b/ext/gd/tests/bug53504.phpt
+index bb74497af05ab..5bd81f35aa0cb 100644
+--- a/ext/gd/tests/bug53504.phpt
++++ b/ext/gd/tests/bug53504.phpt
+@@ -5,6 +5,9 @@ gd
+ --SKIPIF--
+ <?php
+     if(!function_exists('imageftbbox')) die('skip imageftbbox() not available');
++    if (!(imagetypes() & IMG_PNG)) {
++        die("skip No PNG support");
++    }
+ ?>
+ --FILE--
+ <?php
+diff --git a/ext/gd/tests/bug64641.phpt b/ext/gd/tests/bug64641.phpt
+index d300bd8fc6a0a..edfebee99c92a 100644
+--- a/ext/gd/tests/bug64641.phpt
++++ b/ext/gd/tests/bug64641.phpt
+@@ -7,6 +7,9 @@ gd
+ if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.2', '<')) {
+     die("skip test requires GD 2.2.2 or higher");
+ }
++if (!(imagetypes() & IMG_PNG)) {
++    die("skip No PNG support");
++}
+ ?>
+ --FILE--
+ <?php
+diff --git a/ext/gd/tests/bug66005.phpt b/ext/gd/tests/bug66005.phpt
+index 78e0f481dab17..3f3b421b8856a 100644
+--- a/ext/gd/tests/bug66005.phpt
++++ b/ext/gd/tests/bug66005.phpt
+@@ -2,6 +2,12 @@
+ Bug #66005 (imagecopy does not support 1bit transparency on truecolor images)
+ --EXTENSIONS--
+ gd
++--SKIPIF--
++<?php
++if (!(imagetypes() & IMG_PNG)) {
++    die("skip No PNG support");
++}
++?>
+ --FILE--
+ <?php
+ $dest = imagecreatetruecolor(150, 50);
+diff --git a/ext/gd/tests/bug72482_2.phpt b/ext/gd/tests/bug72482_2.phpt
+index 89f5bb28a77bd..0583fa4dedde3 100644
+--- a/ext/gd/tests/bug72482_2.phpt
++++ b/ext/gd/tests/bug72482_2.phpt
+@@ -2,6 +2,12 @@
+ Bug 72482 (Ilegal write/read access caused by gdImageAALine overflow)
+ --EXTENSIONS--
+ gd
++--SKIPIF--
++<?php
++if (!(imagetypes() & IMG_PNG)) {
++    die("skip No PNG support");
++}
++?>
+ --FILE--
+ <?php
+ require_once __DIR__ . DIRECTORY_SEPARATOR . 'func.inc';
+diff --git a/ext/gd/tests/bug72604.phpt b/ext/gd/tests/bug72604.phpt
+index 706d7891c3220..a7d24e78dfefe 100644
+--- a/ext/gd/tests/bug72604.phpt
++++ b/ext/gd/tests/bug72604.phpt
+@@ -2,6 +2,12 @@
+ Bug #72604 (imagearc() ignores thickness for full arcs)
+ --EXTENSIONS--
+ gd
++--SKIPIF--
++<?php
++if (!(imagetypes() & IMG_PNG)) {
++    die("skip No PNG support");
++}
++?>
+ --FILE--
+ <?php
+ $im = imagecreatetruecolor(100, 100);
+diff --git a/ext/gd/tests/bug72913.phpt b/ext/gd/tests/bug72913.phpt
+index c3a7e9f9f56cf..9eb9c24653530 100644
+--- a/ext/gd/tests/bug72913.phpt
++++ b/ext/gd/tests/bug72913.phpt
+@@ -2,6 +2,12 @@
+ Bug #72913 (imagecopy() loses single-color transparency on palette images)
+ --EXTENSIONS--
+ gd
++--SKIPIF--
++<?php
++if (!(imagetypes() & IMG_PNG)) {
++    die("skip No PNG support");
++}
++?>
+ --FILE--
+ <?php
+ $base64 = 'iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAIAAACRXR/mAAAABnRSTlMAAAAAAABu'
+diff --git a/ext/gd/tests/bug73213.phpt b/ext/gd/tests/bug73213.phpt
+index c4c4bd6feeaf1..47fe8043135f8 100644
+--- a/ext/gd/tests/bug73213.phpt
++++ b/ext/gd/tests/bug73213.phpt
+@@ -2,6 +2,12 @@
+ Bug #73213 (Integer overflow in imageline() with antialiasing)
+ --EXTENSIONS--
+ gd
++--SKIPIF--
++<?php
++if (!(imagetypes() & IMG_PNG)) {
++    die("skip No PNG support");
++}
++?>
+ --FILE--
+ <?php
+ require_once __DIR__ . DIRECTORY_SEPARATOR . 'func.inc';
+diff --git a/ext/gd/tests/bug73272.phpt b/ext/gd/tests/bug73272.phpt
+index cf10eb227ae11..0f0920b2687db 100644
+--- a/ext/gd/tests/bug73272.phpt
++++ b/ext/gd/tests/bug73272.phpt
+@@ -2,6 +2,12 @@
+ Bug #73272 (imagescale() is not affected by, but affects imagesetinterpolation())
+ --EXTENSIONS--
+ gd
++--SKIPIF--
++<?php
++if (!(imagetypes() & IMG_PNG)) {
++    die("skip No PNG support");
++}
++?>
+ --FILE--
+ <?php
+ require_once __DIR__ . DIRECTORY_SEPARATOR . 'func.inc';
+diff --git a/ext/gd/tests/bug73549.phpt b/ext/gd/tests/bug73549.phpt
+index d25941dd565d3..26a7474b7d5b4 100644
+--- a/ext/gd/tests/bug73549.phpt
++++ b/ext/gd/tests/bug73549.phpt
+@@ -2,6 +2,12 @@
+ Bug #73549 (Use after free when stream is passed to imagepng)
+ --EXTENSIONS--
+ gd
++--SKIPIF--
++<?php
++if (!(imagetypes() & IMG_PNG)) {
++    die("skip No PNG support");
++}
++?>
+ --FILE--
+ <?php
+ $stream = fopen(__DIR__ . DIRECTORY_SEPARATOR . 'bug73549.png', 'w');
+diff --git a/ext/gd/tests/bug73614.phpt b/ext/gd/tests/bug73614.phpt
+index def4d37421160..e1261643f7116 100644
+--- a/ext/gd/tests/bug73614.phpt
++++ b/ext/gd/tests/bug73614.phpt
+@@ -5,6 +5,9 @@ gd
+ --SKIPIF--
+ <?php
+ if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.5', '<=')) die('skip upstream bugfix not yet released');
++if (!(imagetypes() & IMG_PNG)) {
++    die("skip No PNG support");
++}
+ ?>
+ --FILE--
+ <?php
+diff --git a/ext/gd/tests/bug74031.phpt b/ext/gd/tests/bug74031.phpt
+index b4efa6b749e8e..6dfb351fcff97 100644
+--- a/ext/gd/tests/bug74031.phpt
++++ b/ext/gd/tests/bug74031.phpt
+@@ -2,6 +2,12 @@
+ (Bug #74031) ReflectionFunction for imagepng returns wrong number of parameters
+ --EXTENSIONS--
+ gd
++--SKIPIF--
++<?php
++if (!(imagetypes() & IMG_PNG)) {
++    die("skip No PNG support");
++}
++?>
+ --FILE--
+ <?php
+ 
+diff --git a/ext/gd/tests/bug75124.phpt b/ext/gd/tests/bug75124.phpt
+index 47b36157fec90..26e44f1d6a011 100644
+--- a/ext/gd/tests/bug75124.phpt
++++ b/ext/gd/tests/bug75124.phpt
+@@ -7,6 +7,9 @@ gd
+ if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.5', '<')) {
+     die('skip only for bundled libgd or external libgd >= 2.2.5');
+ }
++if (!(imagetypes() & IMG_PNG)) {
++    die("skip No PNG support");
++}
+ ?>
+ --FILE--
+ <?php
+diff --git a/ext/gd/tests/bug77943.phpt b/ext/gd/tests/bug77943.phpt
+index 8ed4114128f25..d7d71ceca84ae 100644
+--- a/ext/gd/tests/bug77943.phpt
++++ b/ext/gd/tests/bug77943.phpt
+@@ -2,6 +2,12 @@
+ Bug #77943 (imageantialias($image, false); does not work)
+ --EXTENSIONS--
+ gd
++--SKIPIF--
++<?php
++if (!(imagetypes() & IMG_PNG)) {
++    die("skip No PNG support");
++}
++?>
+ --FILE--
+ <?php
+ require_once __DIR__ . '/func.inc';
+diff --git a/ext/gd/tests/bug79945.phpt b/ext/gd/tests/bug79945.phpt
+index b985ddd48be31..5db958e36d358 100644
+--- a/ext/gd/tests/bug79945.phpt
++++ b/ext/gd/tests/bug79945.phpt
+@@ -4,6 +4,9 @@ Bug #79945 (using php wrappers in imagecreatefrompng causes segmentation fault)
+ gd
+ --SKIPIF--
+ <?php
++if (!(imagetypes() & IMG_PNG)) {
++    die("skip No PNG support");
++}
+ set_error_handler(function($errno, $errstr) {
+     if (str_contains($errstr, 'Cannot cast a filtered stream on this system')) {
+         die('skip: fopencookie not support on this system');
+diff --git a/ext/gd/tests/imagearc_basic.phpt b/ext/gd/tests/imagearc_basic.phpt
+index be80f6c5f2317..339ea0b79d18d 100644
+--- a/ext/gd/tests/imagearc_basic.phpt
++++ b/ext/gd/tests/imagearc_basic.phpt
+@@ -5,6 +5,12 @@ Edgar Ferreira da Silva <contato [at] edgarfs [dot] com [dot] br>
+ #testfest PHPSP on 2009-06-20
+ --EXTENSIONS--
+ gd
++--SKIPIF--
++<?php
++if (!(imagetypes() & IMG_PNG)) {
++    die("skip No PNG support");
++}
++?>
+ --FILE--
+ <?php
+ 
+diff --git a/ext/gd/tests/imagearc_variation1.phpt b/ext/gd/tests/imagearc_variation1.phpt
+index 89719aa60b494..bf20c74f0ce40 100644
+--- a/ext/gd/tests/imagearc_variation1.phpt
++++ b/ext/gd/tests/imagearc_variation1.phpt
+@@ -5,6 +5,12 @@ Edgar Ferreira da Silva <contato [at] edgarfs [dot] com [dot] br>
+ #testfest PHPSP on 2009-06-20
+ --EXTENSIONS--
+ gd
++--SKIPIF--
++<?php
++if (!(imagetypes() & IMG_PNG)) {
++    die("skip No PNG support");
++}
++?>
+ --FILE--
+ <?php
+ 
+diff --git a/ext/gd/tests/imagearc_variation2.phpt b/ext/gd/tests/imagearc_variation2.phpt
+index 4597cf3a8ff89..c23bca840bf4e 100644
+--- a/ext/gd/tests/imagearc_variation2.phpt
++++ b/ext/gd/tests/imagearc_variation2.phpt
+@@ -5,6 +5,12 @@ Edgar Ferreira da Silva <contato [at] edgarfs [dot] com [dot] br>
+ #testfest PHPSP on 2009-06-20
+ --EXTENSIONS--
+ gd
++--SKIPIF--
++<?php
++if (!(imagetypes() & IMG_PNG)) {
++    die("skip No PNG support");
++}
++?>
+ --FILE--
+ <?php
+ 
+diff --git a/ext/gd/tests/imagechar_basic.phpt b/ext/gd/tests/imagechar_basic.phpt
+index 3195eb82d4d4f..649dcccc2de87 100644
+--- a/ext/gd/tests/imagechar_basic.phpt
++++ b/ext/gd/tests/imagechar_basic.phpt
+@@ -5,6 +5,12 @@ Rafael Dohms <rdohms [at] gmail [dot] com>
+ #testfest PHPSP on 2009-06-20
+ --EXTENSIONS--
+ gd
++--SKIPIF--
++<?php
++if (!(imagetypes() & IMG_PNG)) {
++    die("skip No PNG support");
++}
++?>
+ --FILE--
+ <?php
+ $image = imagecreatetruecolor(180, 30);
+diff --git a/ext/gd/tests/imagecharup_basic.phpt b/ext/gd/tests/imagecharup_basic.phpt
+index 82bc18d6ad609..7ebbb8fce9a07 100644
+--- a/ext/gd/tests/imagecharup_basic.phpt
++++ b/ext/gd/tests/imagecharup_basic.phpt
+@@ -5,6 +5,12 @@ Rafael Dohms <rdohms [at] gmail [dot] com>
+ #testfest PHPSP on 2009-06-20
+ --EXTENSIONS--
+ gd
++--SKIPIF--
++<?php
++if (!(imagetypes() & IMG_PNG)) {
++    die("skip No PNG support");
++}
++?>
+ --FILE--
+ <?php
+ $image = imagecreatetruecolor(180, 30);
+diff --git a/ext/gd/tests/imagecolorallocatealpha_basic.phpt b/ext/gd/tests/imagecolorallocatealpha_basic.phpt
+index cc02aaed0d8b3..24ac882d550d5 100644
+--- a/ext/gd/tests/imagecolorallocatealpha_basic.phpt
++++ b/ext/gd/tests/imagecolorallocatealpha_basic.phpt
+@@ -9,6 +9,9 @@ gd
+     if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.2', '<')) {
+         die("skip test requires GD 2.2.2 or higher");
+     }
++    if (!(imagetypes() & IMG_PNG)) {
++        die("skip No PNG support");
++    }
+ ?>
+ --FILE--
+ <?php
+diff --git a/ext/gd/tests/imagecolorset_basic.phpt b/ext/gd/tests/imagecolorset_basic.phpt
+index cb9b3683aa8ee..5ed9a1ab8600e 100644
+--- a/ext/gd/tests/imagecolorset_basic.phpt
++++ b/ext/gd/tests/imagecolorset_basic.phpt
+@@ -5,6 +5,12 @@ Erick Belluci Tedeschi <erickbt86 [at] gmail [dot] com>
+ #testfest PHPSP on 2009-06-20
+ --EXTENSIONS--
+ gd
++--SKIPIF--
++<?php
++if (!(imagetypes() & IMG_PNG)) {
++    die("skip No PNG support");
++}
++?>
+ --FILE--
+ <?php
+ // Create a 300x100 image
+diff --git a/ext/gd/tests/imageconvolution_basic.phpt b/ext/gd/tests/imageconvolution_basic.phpt
+index aa8347884999a..d8204e2d7eb28 100644
+--- a/ext/gd/tests/imageconvolution_basic.phpt
++++ b/ext/gd/tests/imageconvolution_basic.phpt
+@@ -5,6 +5,12 @@ Guilherme Blanco <guilhermeblanco [at] hotmail [dot] com>
+ #testfest PHPSP on 2009-06-20
+ --EXTENSIONS--
+ gd
++--SKIPIF--
++<?php
++if (!(imagetypes() & IMG_PNG)) {
++    die("skip No PNG support");
++}
++?>
+ --FILE--
+ <?php
+ $image = imagecreatetruecolor(180, 30);
+diff --git a/ext/gd/tests/imagecopyresampled_basic.phpt b/ext/gd/tests/imagecopyresampled_basic.phpt
+index a3200b3537809..9fb1178e540ae 100644
+--- a/ext/gd/tests/imagecopyresampled_basic.phpt
++++ b/ext/gd/tests/imagecopyresampled_basic.phpt
+@@ -2,6 +2,12 @@
+ imagecopyresampled()
+ --EXTENSIONS--
+ gd
++--SKIPIF--
++<?php
++if (!(imagetypes() & IMG_PNG)) {
++    die("skip No PNG support");
++}
++?>
+ --FILE--
+ <?php
+ 
+diff --git a/ext/gd/tests/imagecreatefrombmp_basic.phpt b/ext/gd/tests/imagecreatefrombmp_basic.phpt
+index 51eb22c71adf0..4989e617b4719 100644
+--- a/ext/gd/tests/imagecreatefrombmp_basic.phpt
++++ b/ext/gd/tests/imagecreatefrombmp_basic.phpt
+@@ -5,6 +5,9 @@ gd
+ --SKIPIF--
+ <?php
+ if (!(imagetypes() & IMG_BMP)) die('skip BMP support required');
++if (!(imagetypes() & IMG_PNG)) {
++    die("skip No PNG support");
++}
+ ?>
+ --FILE--
+ <?php
+diff --git a/ext/gd/tests/imagecreatefromstring_bmp.phpt b/ext/gd/tests/imagecreatefromstring_bmp.phpt
+index 8f9e1dd675b91..34db04297e3aa 100644
+--- a/ext/gd/tests/imagecreatefromstring_bmp.phpt
++++ b/ext/gd/tests/imagecreatefromstring_bmp.phpt
+@@ -5,6 +5,9 @@ gd
+ --SKIPIF--
+ <?php
+ if (!(imagetypes() & IMG_BMP)) die('skip BMP support required');
++if (!(imagetypes() & IMG_PNG)) {
++    die("skip No PNG support");
++}
+ ?>
+ --FILE--
+ <?php
+diff --git a/ext/gd/tests/imagecreatefromtga_basic.phpt b/ext/gd/tests/imagecreatefromtga_basic.phpt
+index 25f034878b0c6..c66f66efbd638 100644
+--- a/ext/gd/tests/imagecreatefromtga_basic.phpt
++++ b/ext/gd/tests/imagecreatefromtga_basic.phpt
+@@ -5,6 +5,9 @@ gd
+ --SKIPIF--
+ <?php
+ if (!(imagetypes() & IMG_TGA)) die('skip TGA support required');
++if (!(imagetypes() & IMG_PNG)) {
++    die("skip No PNG support");
++}
+ ?>
+ --FILE--
+ <?php
+diff --git a/ext/gd/tests/imagecreatefromtga_variation.phpt b/ext/gd/tests/imagecreatefromtga_variation.phpt
+index 0948f978f2f6a..be9c7977bd6a7 100644
+--- a/ext/gd/tests/imagecreatefromtga_variation.phpt
++++ b/ext/gd/tests/imagecreatefromtga_variation.phpt
+@@ -5,6 +5,9 @@ gd
+ --SKIPIF--
+ <?php
+ if (!(imagetypes() & IMG_TGA)) die('skip TGA support required');
++if (!(imagetypes() & IMG_PNG)) {
++    die("skip No PNG support");
++}
+ ?>
+ --FILE--
+ <?php
+diff --git a/ext/gd/tests/imagecreatetruecolor_basic.phpt b/ext/gd/tests/imagecreatetruecolor_basic.phpt
+index 5af8a0a1a32bc..2e8a1ef983bd3 100644
+--- a/ext/gd/tests/imagecreatetruecolor_basic.phpt
++++ b/ext/gd/tests/imagecreatetruecolor_basic.phpt
+@@ -7,6 +7,9 @@ gd
+ --SKIPIF--
+ <?php
+     if (!function_exists("imagecreatetruecolor")) die("skip GD Version not compatible");
++    if (!(imagetypes() & IMG_PNG)) {
++        die("skip No PNG support");
++    }
+ ?>
+ --FILE--
+ <?php
+diff --git a/ext/gd/tests/imagecrop_auto.phpt b/ext/gd/tests/imagecrop_auto.phpt
+index 5d3d50b3ef317..5ed8e446a7f26 100644
+--- a/ext/gd/tests/imagecrop_auto.phpt
++++ b/ext/gd/tests/imagecrop_auto.phpt
+@@ -5,6 +5,9 @@ gd
+ --SKIPIF--
+ <?php
+ if (!function_exists('imagecrop')) die( 'skip GD imagecropauto not present; skipping test' );
++if (!(imagetypes() & IMG_PNG)) {
++    die("skip No PNG support");
++}
+ ?>
+ --FILE--
+ <?php
+diff --git a/ext/gd/tests/imagedashedline_basic.phpt b/ext/gd/tests/imagedashedline_basic.phpt
+index b36ffbfc6f593..d9ca69ad5f0b8 100644
+--- a/ext/gd/tests/imagedashedline_basic.phpt
++++ b/ext/gd/tests/imagedashedline_basic.phpt
+@@ -5,6 +5,9 @@ gd
+ --SKIPIF--
+ <?php
+     if (!function_exists('imagedashedline')) die('skip imagedashedline() not available');
++    if (!(imagetypes() & IMG_PNG)) {
++        die("skip No PNG support");
++    }
+ ?>
+ --FILE--
+ <?php
+diff --git a/ext/gd/tests/imageellipse_basic.phpt b/ext/gd/tests/imageellipse_basic.phpt
+index 0c86e7cfcb859..da1e0e9926086 100644
+--- a/ext/gd/tests/imageellipse_basic.phpt
++++ b/ext/gd/tests/imageellipse_basic.phpt
+@@ -5,6 +5,12 @@ Ivan Rosolen <contato [at] ivanrosolen [dot] com>
+ #testfest PHPSP on 2009-06-20
+ --EXTENSIONS--
+ gd
++--SKIPIF--
++<?php
++if (!(imagetypes() & IMG_PNG)) {
++    die("skip No PNG support");
++}
++?>
+ --FILE--
+ <?php
+ 
+diff --git a/ext/gd/tests/imagefilledarc_basic.phpt b/ext/gd/tests/imagefilledarc_basic.phpt
+index f3b8c7ac8e89e..006ed4aaa23b4 100644
+--- a/ext/gd/tests/imagefilledarc_basic.phpt
++++ b/ext/gd/tests/imagefilledarc_basic.phpt
+@@ -10,6 +10,9 @@ gd
+ if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.2', '<')) {
+     die("skip test requires GD 2.2.2 or higher");
+ }
++if (!(imagetypes() & IMG_PNG)) {
++    die("skip No PNG support");
++}
+ ?>
+ --FILE--
+ <?php
+diff --git a/ext/gd/tests/imagefilledarc_variation1.phpt b/ext/gd/tests/imagefilledarc_variation1.phpt
+index d25d2afc87987..d00c9b6c0be1e 100644
+--- a/ext/gd/tests/imagefilledarc_variation1.phpt
++++ b/ext/gd/tests/imagefilledarc_variation1.phpt
+@@ -10,6 +10,9 @@ gd
+ if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.2', '<')) {
+     die("skip test requires GD 2.2.2 or higher");
+ }
++if (!(imagetypes() & IMG_PNG)) {
++    die("skip No PNG support");
++}
+ ?>
+ --FILE--
+ <?php
+diff --git a/ext/gd/tests/imagefilledarc_variation2.phpt b/ext/gd/tests/imagefilledarc_variation2.phpt
+index fb4675ec5dd69..61157a0173158 100644
+--- a/ext/gd/tests/imagefilledarc_variation2.phpt
++++ b/ext/gd/tests/imagefilledarc_variation2.phpt
+@@ -10,6 +10,9 @@ gd
+ if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.2', '<')) {
+     die("skip test requires GD 2.2.2 or higher");
+ }
++if (!(imagetypes() & IMG_PNG)) {
++    die("skip No PNG support");
++}
+ ?>
+ --FILE--
+ <?php
+diff --git a/ext/gd/tests/imagefilledellipse_basic.phpt b/ext/gd/tests/imagefilledellipse_basic.phpt
+index 19a94b1200e24..a494b15c28e2e 100644
+--- a/ext/gd/tests/imagefilledellipse_basic.phpt
++++ b/ext/gd/tests/imagefilledellipse_basic.phpt
+@@ -2,6 +2,12 @@
+ Testing imagefilledellipse() of GD library
+ --EXTENSIONS--
+ gd
++--SKIPIF--
++<?php
++if (!(imagetypes() & IMG_PNG)) {
++    die("skip No PNG support");
++}
++?>
+ --FILE--
+ <?php
+ 
+diff --git a/ext/gd/tests/imagefilledpolygon_basic.phpt b/ext/gd/tests/imagefilledpolygon_basic.phpt
+index 6cba5238d3246..bbb8f9c2eb044 100644
+--- a/ext/gd/tests/imagefilledpolygon_basic.phpt
++++ b/ext/gd/tests/imagefilledpolygon_basic.phpt
+@@ -5,6 +5,9 @@ gd
+ --SKIPIF--
+ <?php
+     if (!function_exists('imagefilledpolygon')) die('skip imagefilledpolygon() not available');
++    if (!(imagetypes() & IMG_PNG)) {
++        die("skip No PNG support");
++    }
+ ?>
+ --FILE--
+ <?php
+diff --git a/ext/gd/tests/imagefilltoborder_basic.phpt b/ext/gd/tests/imagefilltoborder_basic.phpt
+index 7e79ea47b46b6..f8ebe86bb2c6d 100644
+--- a/ext/gd/tests/imagefilltoborder_basic.phpt
++++ b/ext/gd/tests/imagefilltoborder_basic.phpt
+@@ -5,6 +5,12 @@ Ivan Rosolen <contato [at] ivanrosolen [dot] com>
+ #testfest PHPSP on 2009-06-30
+ --EXTENSIONS--
+ gd
++--SKIPIF--
++<?php
++if (!(imagetypes() & IMG_PNG)) {
++    die("skip No PNG support");
++}
++?>
+ --FILE--
+ <?php
+ // Create a image
+diff --git a/ext/gd/tests/imagefilter.phpt b/ext/gd/tests/imagefilter.phpt
+index 79a73472511c7..c8cf182d9d4eb 100644
+--- a/ext/gd/tests/imagefilter.phpt
++++ b/ext/gd/tests/imagefilter.phpt
+@@ -5,6 +5,9 @@ gd
+ --SKIPIF--
+ <?php
+     if (!function_exists("imagefilter")) die("skip requires imagefilter function");
++    if (!(imagetypes() & IMG_PNG)) {
++        die("skip No PNG support");
++    }
+ ?>
+ --FILE--
+ <?php
+diff --git a/ext/gd/tests/imagegammacorrect_basic.phpt b/ext/gd/tests/imagegammacorrect_basic.phpt
+index 67b2a36a1657a..4f52309c825bf 100644
+--- a/ext/gd/tests/imagegammacorrect_basic.phpt
++++ b/ext/gd/tests/imagegammacorrect_basic.phpt
+@@ -10,6 +10,9 @@ gd
+     if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.2', '<')) {
+         die("skip test requires GD 2.2.2 or higher");
+     }
++    if (!(imagetypes() & IMG_PNG)) {
++        die("skip No PNG support");
++    }
+ ?>
+ --FILE--
+ <?php
+diff --git a/ext/gd/tests/imagegammacorrect_variation1.phpt b/ext/gd/tests/imagegammacorrect_variation1.phpt
+index 1c41a257b9ec4..55370aa49cf87 100644
+--- a/ext/gd/tests/imagegammacorrect_variation1.phpt
++++ b/ext/gd/tests/imagegammacorrect_variation1.phpt
+@@ -10,6 +10,9 @@ gd
+     if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.2', '<')) {
+         die("skip test requires GD 2.2.2 or higher");
+     }
++    if (!(imagetypes() & IMG_PNG)) {
++        die("skip No PNG support");
++    }
+ ?>
+ --FILE--
+ <?php
+diff --git a/ext/gd/tests/imagegammacorrect_variation2.phpt b/ext/gd/tests/imagegammacorrect_variation2.phpt
+index c75c728296bec..33c89d205a1a7 100644
+--- a/ext/gd/tests/imagegammacorrect_variation2.phpt
++++ b/ext/gd/tests/imagegammacorrect_variation2.phpt
+@@ -2,6 +2,12 @@
+ Apply imagegammacorrect() to a step wedge
+ --EXTENSIONS--
+ gd
++--SKIPIF--
++<?php
++if (!(imagetypes() & IMG_PNG)) {
++    die("skip No PNG support");
++}
++?>
+ --FILE--
+ <?php
+ require __DIR__ . DIRECTORY_SEPARATOR . 'func.inc';
+diff --git a/ext/gd/tests/imageopenpolygon_basic.phpt b/ext/gd/tests/imageopenpolygon_basic.phpt
+index 6ed6d63a5ac47..ed8d3b698d11c 100644
+--- a/ext/gd/tests/imageopenpolygon_basic.phpt
++++ b/ext/gd/tests/imageopenpolygon_basic.phpt
+@@ -2,6 +2,12 @@
+ imageopenpolygon(): basic test
+ --EXTENSIONS--
+ gd
++--SKIPIF--
++<?php
++if (!(imagetypes() & IMG_PNG)) {
++    die("skip No PNG support");
++}
++?>
+ --FILE--
+ <?php
+ require_once __DIR__ . DIRECTORY_SEPARATOR . 'func.inc';
+diff --git a/ext/gd/tests/imagepolygon_aa.phpt b/ext/gd/tests/imagepolygon_aa.phpt
+index 77fef3beed9a5..a0fded6e5e06c 100644
+--- a/ext/gd/tests/imagepolygon_aa.phpt
++++ b/ext/gd/tests/imagepolygon_aa.phpt
+@@ -2,6 +2,12 @@
+ antialiased imagepolygon()
+ --EXTENSIONS--
+ gd
++--SKIPIF--
++<?php
++if (!(imagetypes() & IMG_PNG)) {
++    die("skip No PNG support");
++}
++?>
+ --FILE--
+ <?php
+ require_once __DIR__ . DIRECTORY_SEPARATOR . 'func.inc';
+diff --git a/ext/gd/tests/imagepolygon_basic.phpt b/ext/gd/tests/imagepolygon_basic.phpt
+index 4d17b30eacfa9..c41b0710ef435 100644
+--- a/ext/gd/tests/imagepolygon_basic.phpt
++++ b/ext/gd/tests/imagepolygon_basic.phpt
+@@ -5,6 +5,9 @@ gd
+ --SKIPIF--
+ <?php
+     if (!function_exists('imagepolygon')) die('skip imagepolygon() not available');
++    if (!(imagetypes() & IMG_PNG)) {
++        die("skip No PNG support");
++    }
+ ?>
+ --FILE--
+ <?php
+diff --git a/ext/gd/tests/imagerectangle_basic.phpt b/ext/gd/tests/imagerectangle_basic.phpt
+index d71c44156f98c..a40b130cba7d2 100644
+--- a/ext/gd/tests/imagerectangle_basic.phpt
++++ b/ext/gd/tests/imagerectangle_basic.phpt
+@@ -5,6 +5,12 @@ Ivan Rosolen <contato [at] ivanrosolen [dot] com>
+ #testfest PHPSP on 2009-06-30
+ --EXTENSIONS--
+ gd
++--SKIPIF--
++<?php
++if (!(imagetypes() & IMG_PNG)) {
++    die("skip No PNG support");
++}
++?>
+ --FILE--
+ <?php
+ // Create a image
+diff --git a/ext/gd/tests/imageresolution_png.phpt b/ext/gd/tests/imageresolution_png.phpt
+index a72f351a156bf..13f51cd8f3a4a 100644
+--- a/ext/gd/tests/imageresolution_png.phpt
++++ b/ext/gd/tests/imageresolution_png.phpt
+@@ -2,6 +2,12 @@
+ Set and get image resolution of PNG images
+ --EXTENSIONS--
+ gd
++--SKIPIF--
++<?php
++if (!(imagetypes() & IMG_PNG)) {
++    die("skip No PNG support");
++}
++?>
+ --FILE--
+ <?php
+ $filename = __DIR__ . DIRECTORY_SEPARATOR . 'imageresolution_png.png';
+diff --git a/ext/gd/tests/imagesetbrush_basic.phpt b/ext/gd/tests/imagesetbrush_basic.phpt
+index be8a3d33e4ad7..5142e3690b85f 100644
+--- a/ext/gd/tests/imagesetbrush_basic.phpt
++++ b/ext/gd/tests/imagesetbrush_basic.phpt
+@@ -5,6 +5,12 @@ Erick Belluci Tedeschi <erickbt86 [at] gmail [dot] com>
+ #testfest PHPSP on 2009-06-20
+ --EXTENSIONS--
+ gd
++--SKIPIF--
++<?php
++if (!(imagetypes() & IMG_PNG)) {
++    die("skip No PNG support");
++}
++?>
+ --FILE--
+ <?php
+ // Create the brush image
+diff --git a/ext/gd/tests/imagesetthickness_basic.phpt b/ext/gd/tests/imagesetthickness_basic.phpt
+index 88f7803dcf610..745dfcf905b92 100644
+--- a/ext/gd/tests/imagesetthickness_basic.phpt
++++ b/ext/gd/tests/imagesetthickness_basic.phpt
+@@ -7,6 +7,9 @@ gd
+ --SKIPIF--
+ <?php
+     if (!function_exists("imagecreatetruecolor")) die("skip GD Version not compatible");
++    if (!(imagetypes() & IMG_PNG)) {
++        die("skip No PNG support");
++    }
+ ?>
+ --FILE--
+ <?php
+diff --git a/ext/gd/tests/imagestring_basic.phpt b/ext/gd/tests/imagestring_basic.phpt
+index 1a71ba173c820..8a8e247eb0731 100644
+--- a/ext/gd/tests/imagestring_basic.phpt
++++ b/ext/gd/tests/imagestring_basic.phpt
+@@ -5,6 +5,12 @@ Rafael Dohms <rdohms [at] gmail [dot] com>
+ #testfest PHPSP on 2009-06-20
+ --EXTENSIONS--
+ gd
++--SKIPIF--
++<?php
++if (!(imagetypes() & IMG_PNG)) {
++    die("skip No PNG support");
++}
++?>
+ --FILE--
+ <?php
+ $image = imagecreatetruecolor(180, 30);
+diff --git a/ext/gd/tests/imagestringup_basic.phpt b/ext/gd/tests/imagestringup_basic.phpt
+index 85b85e1e31c51..f1e30a782fb88 100644
+--- a/ext/gd/tests/imagestringup_basic.phpt
++++ b/ext/gd/tests/imagestringup_basic.phpt
+@@ -5,6 +5,12 @@ Rafael Dohms <rdohms [at] gmail [dot] com>
+ #testfest PHPSP on 2009-06-20
+ --EXTENSIONS--
+ gd
++--SKIPIF--
++<?php
++if (!(imagetypes() & IMG_PNG)) {
++    die("skip No PNG support");
++}
++?>
+ --FILE--
+ <?php
+ $image = imagecreatetruecolor(180, 30);
+diff --git a/ext/gd/tests/imagetruecolortopalette_basic.phpt b/ext/gd/tests/imagetruecolortopalette_basic.phpt
+index ae4555bb2ad72..2f1c2961a603c 100644
+--- a/ext/gd/tests/imagetruecolortopalette_basic.phpt
++++ b/ext/gd/tests/imagetruecolortopalette_basic.phpt
+@@ -10,6 +10,9 @@ gd
+         die("skip test requires GD 2.2.2 or higher");
+     }
+     if (!function_exists("imagecreatetruecolor")) die("skip GD Version not compatible");
++    if (!(imagetypes() & IMG_PNG)) {
++        die("skip No PNG support");
++    }
+ ?>
+ --FILE--
+ <?php
+diff --git a/ext/gd/tests/libgd00086_extern.phpt b/ext/gd/tests/libgd00086_extern.phpt
+index 8d2b0b7d8dbe8..a3585180b83e8 100644
+--- a/ext/gd/tests/libgd00086_extern.phpt
++++ b/ext/gd/tests/libgd00086_extern.phpt
+@@ -5,6 +5,9 @@ gd
+ --SKIPIF--
+ <?php
+     if (GD_BUNDLED) die("skip requires external GD library\n");
++    if (!(imagetypes() & IMG_PNG)) {
++        die("skip No PNG support");
++    }
+ ?>
+ --FILE--
+ <?php
+diff --git a/ext/gd/tests/test_image_equals_file_palette.phpt b/ext/gd/tests/test_image_equals_file_palette.phpt
+index a1022138230f6..2e294c04c4066 100644
+--- a/ext/gd/tests/test_image_equals_file_palette.phpt
++++ b/ext/gd/tests/test_image_equals_file_palette.phpt
+@@ -2,6 +2,12 @@
+ test_image_equals_file(): comparing palette images
+ --EXTENSIONS--
+ gd
++--SKIPIF--
++<?php
++if (!(imagetypes() & IMG_PNG)) {
++    die("skip No PNG support");
++}
++?>
+ --FILE--
+ <?php
+ require_once __DIR__ . DIRECTORY_SEPARATOR . 'func.inc';
+
+From 14d9f2349274597bfc81c46222ea7e808d372bdb Mon Sep 17 00:00:00 2001
+From: Michael Orlitzky <michael@orlitzky.com>
+Date: Sat, 30 Dec 2023 16:13:40 -0500
+Subject: [PATCH 3/3] ext/gd/tests: imagerotate() is always available
+
+Following 59ec80c5, the imagerotate() function is always available. We
+may therefore remove its function_exists() checks without harm.
+---
+ ext/gd/tests/bug24155.phpt             | 1 -
+ ext/gd/tests/bug39366.phpt             | 4 ----
+ ext/gd/tests/imagerotate_overflow.phpt | 6 ------
+ 3 files changed, 11 deletions(-)
+
+diff --git a/ext/gd/tests/bug24155.phpt b/ext/gd/tests/bug24155.phpt
+index d78ee9b77816f..c93c3bbbcb586 100644
+--- a/ext/gd/tests/bug24155.phpt
++++ b/ext/gd/tests/bug24155.phpt
+@@ -4,7 +4,6 @@ Bug #24155 (gdImageRotate270 rotation problem).
+ gd
+ --SKIPIF--
+ <?php
+-    if (!function_exists("imagerotate")) die("skip requires imagerotate function");
+     if (!(imagetypes() & IMG_PNG)) {
+         die("skip No PNG support");
+     }
+diff --git a/ext/gd/tests/bug39366.phpt b/ext/gd/tests/bug39366.phpt
+index 81e81059c27e8..3c8b0130a410a 100644
+--- a/ext/gd/tests/bug39366.phpt
++++ b/ext/gd/tests/bug39366.phpt
+@@ -2,10 +2,6 @@
+ Bug #39366 (imagerotate does not respect alpha with angles>45)
+ --EXTENSIONS--
+ gd
+---SKIPIF--
+-<?php
+-    if (!function_exists("imagerotate")) die("skip requires imagerotate function");
+-?>
+ --FILE--
+ <?php
+ 
+diff --git a/ext/gd/tests/imagerotate_overflow.phpt b/ext/gd/tests/imagerotate_overflow.phpt
+index 29cc89c1c56eb..a7be335ca92a6 100644
+--- a/ext/gd/tests/imagerotate_overflow.phpt
++++ b/ext/gd/tests/imagerotate_overflow.phpt
+@@ -2,12 +2,6 @@
+ imagerotate() overflow with negative numbers
+ --EXTENSIONS--
+ gd
+---SKIPIF--
+-<?php
+-    if (!function_exists('imagerotate')) {
+-        die("skip imagerotate() not available.");
+-    }
+-?>
+ --FILE--
+ <?php
+ 
+From fa043f4716dcbd21630e16584e2d8d6baf17c77d Mon Sep 17 00:00:00 2001
+From: Michael Orlitzky <michael@orlitzky.com>
+Date: Wed, 10 Jul 2024 08:20:31 -0400
+Subject: [PATCH 1/1] ext/gd/tests/gh10614.phpt: skip if no PNG support
+
+This test uses imagecreatefrompng(), which won't be there if libgd was
+built without PNG support.
+---
+ ext/gd/tests/gh10614.phpt | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/ext/gd/tests/gh10614.phpt b/ext/gd/tests/gh10614.phpt
+index c068914183..1b91115d74 100644
+--- a/ext/gd/tests/gh10614.phpt
++++ b/ext/gd/tests/gh10614.phpt
+@@ -5,6 +5,9 @@
+ --SKIPIF--
+ <?php
+ if (!GD_BUNDLED && version_compare(GD_VERSION, '2.3.4', '>=')) die("skip test requires GD 2.3.4 or older");
++if (!(imagetypes() & IMG_PNG)) {
++    die("skip No PNG support");
++}
+ ?>
+ --FILE--
+ <?php
+-- 
+2.44.2
+

diff --git a/dev-lang/php/metadata.xml b/dev-lang/php/metadata.xml
index b903ac6d3745..ca91577505a3 100644
--- a/dev-lang/php/metadata.xml
+++ b/dev-lang/php/metadata.xml
@@ -86,6 +86,9 @@
     <flag name="opcache">
       Enables built-in opcode cache, replacing pecl-apc et al.
     </flag>
+    <flag name="opcache-jit">
+      Enable Just In Time (JIT) compilation within the opcache extension
+    </flag>
     <flag name="pcntl">
       Enable the Process Control extension
     </flag>

diff --git a/dev-lang/php/php-8.3.8.ebuild b/dev-lang/php/php-8.3.9.ebuild
similarity index 92%
rename from dev-lang/php/php-8.3.8.ebuild
rename to dev-lang/php/php-8.3.9.ebuild
index 8ea0dd1af24f..f0b4e07fb29d 100644
--- a/dev-lang/php/php-8.3.8.ebuild
+++ b/dev-lang/php/php-8.3.9.ebuild
@@ -5,7 +5,7 @@ EAPI=8
 
 WANT_AUTOMAKE="none"
 
-inherit flag-o-matic multilib systemd
+inherit autotools flag-o-matic multilib systemd
 
 DESCRIPTION="The PHP language runtime engine"
 HOMEPAGE="https://www.php.net/"
@@ -16,7 +16,6 @@ LICENSE="PHP-3.01
 	Zend-2.0
 	bcmath? ( LGPL-2.1+ )
 	fpm? ( BSD-2 )
-	gd? ( gd )
 	unicode? ( BSD-2 LGPL-2.1 )"
 
 SLOT="$(ver_cut 1-2)"
@@ -31,13 +30,13 @@ IUSE="${IUSE}
 	threads"
 
 IUSE="${IUSE} acl apparmor argon2 avif bcmath berkdb bzip2 calendar
-	capstone cdb cjk +ctype curl debug
+	capstone cdb +ctype curl debug
 	enchant exif ffi +fileinfo +filter firebird
 	+flatfile ftp gd gdbm gmp +iconv imap inifile
-	intl iodbc ipv6 +jit kerberos ldap ldap-sasl libedit lmdb
+	intl iodbc ipv6 +jit jpeg kerberos ldap ldap-sasl libedit lmdb
 	mhash mssql mysql mysqli nls
-	odbc +opcache pcntl pdo +phar +posix postgres qdbm
-	readline selinux +session session-mm sharedmem
+	odbc +opcache +opcache-jit pcntl pdo +phar +posix postgres png
+	qdbm readline selinux +session session-mm sharedmem
 	+simplexml snmp soap sockets sodium spell sqlite ssl
 	sysvipc systemd test tidy +tokenizer tokyocabinet truetype unicode
 	valgrind webp +xml xmlreader xmlwriter xpm xslt zip zlib"
@@ -45,14 +44,8 @@ IUSE="${IUSE} acl apparmor argon2 avif bcmath berkdb bzip2 calendar
 # Without USE=readline or libedit, the interactive "php -a" CLI will hang.
 REQUIRED_USE="
 	|| ( cli cgi fpm apache2 embed phpdbg )
-	avif? ( gd zlib )
 	cli? ( ^^ ( readline libedit ) )
 	!cli? ( ?? ( readline libedit ) )
-	truetype? ( gd zlib )
-	webp? ( gd zlib )
-	cjk? ( gd zlib )
-	exif? ( gd zlib )
-	xpm? ( gd zlib )
 	gd? ( zlib )
 	simplexml? ( xml )
 	soap? ( xml )
@@ -80,7 +73,6 @@ COMMON_DEPEND="
 	fpm? ( acl? ( sys-apps/acl ) apparmor? ( sys-libs/libapparmor ) selinux? ( sys-libs/libselinux ) )
 	apache2? ( www-servers/apache[apache2_modules_unixd(+),threads=] )
 	argon2? ( app-crypt/argon2:= )
-	avif? ( media-libs/libavif:= )
 	berkdb? ( || (	sys-libs/db:5.3 sys-libs/db:4.8 ) )
 	bzip2? ( app-arch/bzip2:0= )
 	capstone? ( dev-libs/capstone )
@@ -89,7 +81,9 @@ COMMON_DEPEND="
 	enchant? ( app-text/enchant:2 )
 	ffi? ( dev-libs/libffi:= )
 	firebird? ( dev-db/firebird )
-	gd? ( media-libs/libjpeg-turbo:0= media-libs/libpng:0= )
+	gd? (
+		>=media-libs/gd-2.3.3-r4[avif?,jpeg?,png?,truetype?,webp?,xpm?]
+	)
 	gdbm? ( sys-libs/gdbm:0= )
 	gmp? ( dev-libs/gmp:0= )
 	iconv? ( virtual/libiconv )
@@ -117,9 +111,7 @@ COMMON_DEPEND="
 	truetype? ( media-libs/freetype )
 	unicode? ( dev-libs/oniguruma:= )
 	valgrind? ( dev-debug/valgrind )
-	webp? ( media-libs/libwebp:0= )
 	xml? ( >=dev-libs/libxml2-2.12.5 )
-	xpm? ( x11-libs/libXpm )
 	xslt? ( dev-libs/libxslt )
 	zip? ( dev-libs/libzip:= )
 	zlib? ( sys-libs/zlib:0= )
@@ -142,6 +134,11 @@ DEPEND="${COMMON_DEPEND}
 
 BDEPEND="virtual/pkgconfig"
 
+PATCHES=(
+	"${FILESDIR}/php-8.3.9-optional-png-testfixen.patch"
+	"${FILESDIR}/php-8.3.9-gd-cachevars.patch"
+)
+
 PHP_MV="$(ver_cut 1)"
 
 # ARM/Windows functions (bug 923335)
@@ -254,13 +251,6 @@ src_prepare() {
 	# be running pre-install, in my opinion. Bug 927461.
 	rm ext/fileinfo/tests/bug78987.phpt || die
 
-	# The expected warnings aren't triggered in this test because we
-	# define session.save_path on the CLI:
-	#
-	#   https://github.com/php/php-src/issues/14368
-	#
-	rm ext/session/tests/gh13856.phpt || die
-
 	# Bug 935382, fixed eventually by
 	#
 	# - https://github.com/php/php-src/pull/14788
@@ -275,6 +265,26 @@ src_prepare() {
 	# - https://github.com/php/php-src/issues/14786
 	#
 	rm ext/dba/tests/dba_gdbm.phpt || die
+
+	# Most tests failing with an external libgd have been fixed,
+	# but there are a few stragglers:
+	#
+	#  * https://github.com/php/php-src/issues/11252
+	#
+	rm ext/gd/tests/bug43073.phpt \
+	   ext/gd/tests/bug48732.phpt \
+	   ext/gd/tests/bug48732-mb.phpt \
+	   ext/gd/tests/bug48801.phpt \
+	   ext/gd/tests/bug48801-mb.phpt \
+	   ext/gd/tests/bug53504.phpt \
+	   ext/gd/tests/bug65148.phpt \
+	   ext/gd/tests/bug73272.phpt \
+	   || die
+
+	# One-off, somebody forgot to update a version constant
+	rm ext/reflection/tests/ReflectionZendExtension.phpt || die
+
+	eautoconf --force
 }
 
 src_configure() {
@@ -313,7 +323,6 @@ src_configure() {
 	our_conf+=(
 		$(use_with apparmor fpm-apparmor)
 		$(use_with argon2 password-argon2 "${EPREFIX}/usr")
-		$(use_with avif)
 		$(use_enable bcmath)
 		$(use_with bzip2 bz2 "${EPREFIX}/usr")
 		$(use_enable calendar)
@@ -342,6 +351,7 @@ src_configure() {
 		$(use_enable phar)
 		$(use_enable pdo)
 		$(use_enable opcache)
+		$(use_enable opcache-jit)
 		$(use_with postgres pgsql "${EPREFIX}/usr")
 		$(use_enable posix)
 		$(use_with selinux fpm-selinux)
@@ -368,6 +378,17 @@ src_configure() {
 		$(use_with valgrind)
 	)
 
+	# Override autoconf cache variables for libcrypt algorithms.These
+	# otherwise cannot be detected when cross-compiling. Bug 931884.
+	our_conf+=(
+		ac_cv_crypt_blowfish=yes
+		ac_cv_crypt_des=yes
+		ac_cv_crypt_ext_des=yes
+		ac_cv_crypt_md5=yes
+		ac_cv_crypt_sha512=yes
+		ac_cv_crypt_sha256=yes
+	)
+
 	# DBA support
 	if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
 		|| use qdbm || use lmdb || use tokyocabinet ; then
@@ -386,16 +407,20 @@ src_configure() {
 		$(use_with lmdb lmdb "${EPREFIX}/usr")
 	)
 
-	# Support for the GD graphics library
+	# Use the system copy of GD. The autoconf cache variable overrides
+	# allow cross-compilation to proceed since the corresponding
+	# features cannot be detected by running a program.
 	our_conf+=(
-		$(use_with truetype freetype)
-		$(use_enable cjk gd-jis-conv)
-		$(use_with gd jpeg)
-		$(use_with xpm)
-		$(use_with webp)
+		$(use_enable gd gd)
+		$(use_with gd external-gd)
+		php_cv_lib_gd_gdImageCreateFromAvif=$(usex avif)
+		php_cv_lib_gd_gdImageCreateFromBmp=yes
+		php_cv_lib_gd_gdImageCreateFromJpeg=$(usex jpeg)
+		php_cv_lib_gd_gdImageCreateFromPng=$(usex png)
+		php_cv_lib_gd_gdImageCreateFromTga=yes
+		php_cv_lib_gd_gdImageCreateFromWebp=$(usex webp)
+		php_cv_lib_gd_gdImageCreateFromXpm=$(usex xpm)
 	)
-	# enable gd last, so configure can pick up the previous settings
-	our_conf+=( $(use_enable gd) )
 
 	# IMAP support
 	if use imap ; then


^ permalink raw reply related	[flat|nested] 21+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-lang/php/files/, dev-lang/php/
@ 2024-04-09 13:51 Michael Orlitzky
  0 siblings, 0 replies; 21+ messages in thread
From: Michael Orlitzky @ 2024-04-09 13:51 UTC (permalink / raw
  To: gentoo-commits

commit:     ccc5cdc89ecf3ad501acfa34650e63b3329e18da
Author:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
AuthorDate: Tue Apr  9 13:08:47 2024 +0000
Commit:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
CommitDate: Tue Apr  9 13:50:55 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ccc5cdc8

dev-lang/php: fix a failing test and a musl compatibility issue

Closes: https://bugs.gentoo.org/927461
Closes: https://bugs.gentoo.org/928072
Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org>

 dev-lang/php/files/fix-musl-llvm.patch | 37 ++++++++++++++++++++++++++++++++++
 dev-lang/php/php-8.1.27-r2.ebuild      |  5 +++--
 dev-lang/php/php-8.2.17.ebuild         |  7 +++++++
 dev-lang/php/php-8.3.4.ebuild          |  7 +++++++
 4 files changed, 54 insertions(+), 2 deletions(-)

diff --git a/dev-lang/php/files/fix-musl-llvm.patch b/dev-lang/php/files/fix-musl-llvm.patch
new file mode 100644
index 000000000000..bf299837829c
--- /dev/null
+++ b/dev-lang/php/files/fix-musl-llvm.patch
@@ -0,0 +1,37 @@
+From 684f0d9e5946e92008404b3d5a131edc4f34f7da Mon Sep 17 00:00:00 2001
+From: Arnaud Le Blanc <arnaud.lb@gmail.com>
+Date: Thu, 4 Apr 2024 16:10:28 +0200
+Subject: [PATCH] Fix stream_cookie_seeker signature under musl
+
+---
+ main/streams/cast.c | 10 +++-------
+ 1 file changed, 3 insertions(+), 7 deletions(-)
+
+diff --git a/main/streams/cast.c b/main/streams/cast.c
+index 3bad65fbac1f5..8d9f4a9d2d54b 100644
+--- a/main/streams/cast.c
++++ b/main/streams/cast.c
+@@ -104,6 +104,9 @@ static ssize_t stream_cookie_writer(void *cookie, const char *buffer, size_t siz
+ 
+ # ifdef COOKIE_SEEKER_USES_OFF64_T
+ static int stream_cookie_seeker(void *cookie, off64_t *position, int whence)
++# else
++static int stream_cookie_seeker(void *cookie, off_t *position, int whence)
++# endif
+ {
+ 
+ 	*position = php_stream_seek((php_stream *)cookie, (zend_off_t)*position, whence);
+@@ -113,13 +116,6 @@ static int stream_cookie_seeker(void *cookie, off64_t *position, int whence)
+ 	}
+ 	return 0;
+ }
+-# else
+-static int stream_cookie_seeker(void *cookie, zend_off_t position, int whence)
+-{
+-
+-	return php_stream_seek((php_stream *)cookie, position, whence);
+-}
+-# endif
+ 
+ static int stream_cookie_closer(void *cookie)
+ {

diff --git a/dev-lang/php/php-8.1.27-r2.ebuild b/dev-lang/php/php-8.1.27-r2.ebuild
index 38bbbc21e31c..f434f0df4366 100644
--- a/dev-lang/php/php-8.1.27-r2.ebuild
+++ b/dev-lang/php/php-8.1.27-r2.ebuild
@@ -150,6 +150,7 @@ PATCHES=(
 	"${FILESDIR}/php-capstone-optional.patch"
 	"${FILESDIR}/php-8.1.27-gcc14-libxml.patch"
 	"${FILESDIR}/php-8.1.27-implicit-decls.patch"
+	"${FILESDIR}/fix-musl-llvm.patch"
 )
 
 # ARM/Windows functions that are expected to be undefined.
@@ -250,8 +251,8 @@ src_prepare() {
 	   ext/curl/tests/bug77535.phpt \
 	   ext/curl/tests/curl_error_basic.phpt \
 	   ext/session/tests/bug74514.phpt \
-	   ext/session/tests/bug74936.phpt || die
-
+	   ext/session/tests/bug74936.phpt \
+	   ext/fileinfo/tests/bug78987.phpt || die
 }
 
 src_configure() {

diff --git a/dev-lang/php/php-8.2.17.ebuild b/dev-lang/php/php-8.2.17.ebuild
index f27df005dc4f..abe657f95e1d 100644
--- a/dev-lang/php/php-8.2.17.ebuild
+++ b/dev-lang/php/php-8.2.17.ebuild
@@ -151,6 +151,7 @@ PATCHES=(
 	"${FILESDIR}/php-capstone-optional.patch"
 	"${FILESDIR}/php-8.2.8-openssl-tests.patch"
 	"${FILESDIR}/php-8.1.27-implicit-decls.patch"
+	"${FILESDIR}/fix-musl-llvm.patch"
 )
 
 # ARM/Windows functions (bug 923335)
@@ -322,6 +323,12 @@ src_prepare() {
 
 	# https://github.com/php/php-src/issues/12801
 	rm ext/pcre/tests/gh11374.phpt || die
+
+	# This is a memory usage test with hard-coded limits. Whenever the
+	# limits are surpassed... they get increased... but in the meantime,
+	# the tests fail. This is not really a test that end users should
+	# be running pre-install, in my opinion. Bug 927461.
+	rm ext/fileinfo/tests/bug78987.phpt || die
 }
 
 src_configure() {

diff --git a/dev-lang/php/php-8.3.4.ebuild b/dev-lang/php/php-8.3.4.ebuild
index f4f263225218..7242d6432c71 100644
--- a/dev-lang/php/php-8.3.4.ebuild
+++ b/dev-lang/php/php-8.3.4.ebuild
@@ -146,6 +146,7 @@ PHP_MV="$(ver_cut 1)"
 
 PATCHES=(
 	"${FILESDIR}/php-iodbc-header-location.patch"
+	"${FILESDIR}/fix-musl-llvm.patch"
 )
 
 # ARM/Windows functions (bug 923335)
@@ -267,6 +268,12 @@ src_prepare() {
 	#   https://github.com/php/php-src/pull/13017
 	#
 	rm ext/dom/tests/DOMNode_isEqualNode.phpt || die
+
+	# This is a memory usage test with hard-coded limits. Whenever the
+	# limits are surpassed... they get increased... but in the meantime,
+	# the tests fail. This is not really a test that end users should
+	# be running pre-install, in my opinion. Bug 927461.
+	rm ext/fileinfo/tests/bug78987.phpt || die
 }
 
 src_configure() {


^ permalink raw reply related	[flat|nested] 21+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-lang/php/files/, dev-lang/php/
@ 2024-03-04 17:00 Michael Orlitzky
  0 siblings, 0 replies; 21+ messages in thread
From: Michael Orlitzky @ 2024-03-04 17:00 UTC (permalink / raw
  To: gentoo-commits

commit:     65a1a144e66496d746998a54d2c5ad7cf53252cb
Author:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
AuthorDate: Mon Mar  4 16:42:16 2024 +0000
Commit:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
CommitDate: Mon Mar  4 16:49:07 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=65a1a144

dev-lang/php: some more implicit function decl fixes for 8.1.x

Closes: https://bugs.gentoo.org/925877
Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org>

 dev-lang/php/files/php-8.1.27-implicit-decls.patch | 72 ++++++++++++++++++++++
 .../{php-8.1.27-r1.ebuild => php-8.1.27-r2.ebuild} |  7 +++
 2 files changed, 79 insertions(+)

diff --git a/dev-lang/php/files/php-8.1.27-implicit-decls.patch b/dev-lang/php/files/php-8.1.27-implicit-decls.patch
new file mode 100644
index 000000000000..443b02ba17c2
--- /dev/null
+++ b/dev-lang/php/files/php-8.1.27-implicit-decls.patch
@@ -0,0 +1,72 @@
+From 79df2b9dcbe0388667c832b2c702ca3158330ed7 Mon Sep 17 00:00:00 2001
+From: Michael Orlitzky <michael@orlitzky.com>
+Date: Mon, 4 Mar 2024 11:48:01 -0500
+Subject: [PATCH] ext/iconv/config.m4: add missing stdio.h include.
+
+The next generation of C compilers is going to enforce the C standard
+more strictly:
+
+  https://wiki.gentoo.org/wiki/Modern_C_porting
+
+One warning that will eventually become an error is
+-Wimplicit-function-declaration. This is relatively easy to catch in
+most code (it will fail to compile), but inside of autoconf tests it
+can go unnoticed because many feature-test compilations fail by
+design. For example,
+
+  AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <iconv.h>]],
+                 [[iconv_ccs_init(NULL, NULL);]])]...
+
+is designed to fail if iconv_ccs_init() is not in iconv.h. On the
+other hand,
+
+  AC_RUN_IFELSE([AC_LANG_SOURCE([[
+  #include <iconv.h>
+  int main() {
+    printf("%d", _libiconv_version);
+    return 0;
+  }
+
+should pass if _libiconv_version is defined. If the user has
+-Werror=implicit-function-declaration in his CFLAGS, however,
+it will not:
+
+  $ export CFLAGS="$CFLAGS -Werror=implicit-function-declaration"
+  $ ./configure
+  ...
+  checking if using GNU libiconv... no
+
+This is because the stdio.h header that defines printf() is missing:
+
+  conftest.c:240:3: error: implicit declaration of function 'printf'
+  [-Werror=implicit-function-declaration]
+    240 |   printf("%d", _libiconv_version);
+        |   ^~~~~~
+  conftest.c:239:1: note: include '<stdio.h>' or provide a declaration
+  of 'printf'
+
+This commit adds the include, correcting the test with any compiler
+that balks at implicit function definitions.
+
+(Backport to php-8.1.27)
+
+Closes GH-10751
+---
+ ext/iconv/config.m4 | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/ext/iconv/config.m4 b/ext/iconv/config.m4
+index ac57c81e..b8044bf2 100644
+--- a/ext/iconv/config.m4
++++ b/ext/iconv/config.m4
+@@ -30,6 +30,7 @@ if test "$PHP_ICONV" != "no"; then
+       AC_MSG_CHECKING([if using GNU libiconv])
+       AC_RUN_IFELSE([AC_LANG_SOURCE([[
+ #include <iconv.h>
++#include <stdio.h>
+ int main() {
+   printf("%d", _libiconv_version);
+   return 0;
+-- 
+2.43.0
+

diff --git a/dev-lang/php/php-8.1.27-r1.ebuild b/dev-lang/php/php-8.1.27-r2.ebuild
similarity index 99%
rename from dev-lang/php/php-8.1.27-r1.ebuild
rename to dev-lang/php/php-8.1.27-r2.ebuild
index ee3853ec5893..38bbbc21e31c 100644
--- a/dev-lang/php/php-8.1.27-r1.ebuild
+++ b/dev-lang/php/php-8.1.27-r2.ebuild
@@ -149,6 +149,7 @@ PATCHES=(
 	"${FILESDIR}/php-iodbc-header-location.patch"
 	"${FILESDIR}/php-capstone-optional.patch"
 	"${FILESDIR}/php-8.1.27-gcc14-libxml.patch"
+	"${FILESDIR}/php-8.1.27-implicit-decls.patch"
 )
 
 # ARM/Windows functions that are expected to be undefined.
@@ -158,6 +159,12 @@ QA_CONFIG_IMPL_DECL_SKIP=(
 	_controlfp_s
 )
 
+# Functions from alternate iconv implementations (bug 925268)
+QA_CONFIG_IMPL_DECL_SKIP+=(
+	iconv_ccs_init
+	cstoccsid
+)
+
 php_install_ini() {
 	local phpsapi="${1}"
 


^ permalink raw reply related	[flat|nested] 21+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-lang/php/files/, dev-lang/php/
@ 2024-02-18 23:54 Michael Orlitzky
  0 siblings, 0 replies; 21+ messages in thread
From: Michael Orlitzky @ 2024-02-18 23:54 UTC (permalink / raw
  To: gentoo-commits

commit:     4a5ef8029ab6211cfc7b710e1c0e49375dd1d0a7
Author:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
AuthorDate: Sun Feb 18 22:57:48 2024 +0000
Commit:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
CommitDate: Sun Feb 18 23:54:38 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4a5ef802

dev-lang/php: replace 8.2.15-r1 and 8.3.2-r1 with 8.2.16 and 8.3.3

Closes: https://bugs.gentoo.org/923335
Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org>

 dev-lang/php/Manifest                                    |  3 ++-
 dev-lang/php/files/php-8.2.15-gcc14-build-fix.patch      | 16 ----------------
 dev-lang/php/{php-8.2.15-r1.ebuild => php-8.2.16.ebuild} |  8 +++++++-
 dev-lang/php/{php-8.3.2-r1.ebuild => php-8.3.3.ebuild}   |  8 +++++++-
 4 files changed, 16 insertions(+), 19 deletions(-)

diff --git a/dev-lang/php/Manifest b/dev-lang/php/Manifest
index f0d120a348b5..1924401cad65 100644
--- a/dev-lang/php/Manifest
+++ b/dev-lang/php/Manifest
@@ -1,4 +1,5 @@
 DIST php-8.1.26.tar.xz 11809448 BLAKE2B e1d50f1de572580a207586b3c3b57081f7b9f1b680ffe8f9e82c88c9285af117dd7e9e2576fcb13119176cb9cd02b39481b6f40e9a1df81aa90b8c4d3e59e4b1 SHA512 5bc40077e57c0fccdf17810d688baea416f22ac248bb01b73d2e2590fc4cfabc7001c1c3833281a60870c74178f7b06cbc85474eba695aabf969ad0081a98417
 DIST php-8.1.27.tar.xz 11915228 BLAKE2B 83f4f3c25435b26dc526dc1fd7aff44cd03157349f9bb6454e216525a16c2bbc3bfac47cce6b5ea8bfdfcf3c7f27e342fc602ca7d2491fe89db06ea93f686f0e SHA512 07fb2b8e10e2487635e26bfd8a27949a26b85f76bc3984ad8599224bb7a7f9498d84299335ae5a0bba16599275e9747ab141f73f4f2076ddf49ebec8e76fd0ed
 DIST php-8.2.15.tar.xz 12075384 BLAKE2B cef15868968538e232093bd66d862a88f0960325f2274eaf53a3d114d01787c58844aa3bce8bc09a723acd95801e1935a60e79fc189317e7f1ba19196dbfcdc4 SHA512 56c94bcafe07cf4bf5eb5fc6c67fcf16654c44a262ffb18188fc3ffac5e9bb11d39093bfb26c26bc8d2dec7e530d1a175180909262c9b5c30130cf5a4a293166
-DIST php-8.3.2.tar.xz 12440200 BLAKE2B 90ab2fe220d99cc1da47162e04c768dc35ed4044ea9154f67bbc9124372859b85a33270bc38d41e9ab28df4b0defaf0e78cffe8eb8bd6fdfbec296a31ea4beab SHA512 acf9013d35ae639558fd4816d12dcae03f8af7944c2639f33cd33517503c6170d30101da6c72ebdaf5542bcaf858a54a22ecc8f86822a128f52938bd6ea9606c
+DIST php-8.2.16.tar.xz 12085228 BLAKE2B 6fcf3f5be8443c70e88746fdd609016c322b86ebc0257ee8db0f8551c73804bae2ecb156ee835b09aedb23bb2026658c3f24a8f722dce80e427bdab844bc27ce SHA512 99e5c9eee4c5a35b3e1939c748ded87c8bff4a340d677516ed24dcf4207c51403d38524c46d6e79de5efe90d7368ba82052ec8a29dd5955f549e8198c1e917f6
+DIST php-8.3.3.tar.xz 12463880 BLAKE2B ac0baabe875be8ce42c26713f78733140d47f33636aa0e16e2685c83f558afea905707ca133b06ea28ad8de043d7db7d0931259c7c07a2de2c04a935d76db365 SHA512 42141cc46b6abb11fa51cc96c34424cbf9990150b973d84488fa39a07935b22552a1316978f5a4e48762bf3c94eee3d7dfe741c4ee1a12bf752ce1c2660cc8b0

diff --git a/dev-lang/php/files/php-8.2.15-gcc14-build-fix.patch b/dev-lang/php/files/php-8.2.15-gcc14-build-fix.patch
deleted file mode 100644
index 5f21f442ee06..000000000000
--- a/dev-lang/php/files/php-8.2.15-gcc14-build-fix.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-https://github.com/php/php-src/commit/72526609413e8a8cd768ed4966c17b1a9db6c12c.patch
-From: Remi Collet <remi@remirepo.net>
-Date: Mon, 22 Jan 2024 10:01:25 +0100
-Subject: [PATCH] Fix GH-13215 GCC 14 build
-
---- a/Zend/zend_atomic.h
-+++ b/Zend/zend_atomic.h
-@@ -23,7 +23,7 @@
- 	((__GNUC__ == (x) && __GNUC_MINOR__ >= (y)) || (__GNUC__ > (x)))
- 
- /* Builtins are used to avoid library linkage */
--#if __has_feature(c_atomic)
-+#if __has_feature(c_atomic) && defined(__clang__)
- #define	HAVE_C11_ATOMICS 1
- #elif ZEND_GCC_PREREQ(4, 7)
- #define	HAVE_GNUC_ATOMICS 1

diff --git a/dev-lang/php/php-8.2.15-r1.ebuild b/dev-lang/php/php-8.2.16.ebuild
similarity index 99%
rename from dev-lang/php/php-8.2.15-r1.ebuild
rename to dev-lang/php/php-8.2.16.ebuild
index 66bb272f5852..b577e38682dd 100644
--- a/dev-lang/php/php-8.2.15-r1.ebuild
+++ b/dev-lang/php/php-8.2.16.ebuild
@@ -150,7 +150,13 @@ PATCHES=(
 	"${FILESDIR}/php-iodbc-header-location.patch"
 	"${FILESDIR}/php-capstone-optional.patch"
 	"${FILESDIR}/php-8.2.8-openssl-tests.patch"
-	"${FILESDIR}/php-8.2.15-gcc14-build-fix.patch"
+)
+
+# ARM/Windows functions that are expected to be undefined.
+QA_CONFIG_IMPL_DECL_SKIP=(
+	__crc32d
+	_controlfp
+	_controlfp_s
 )
 
 php_install_ini() {

diff --git a/dev-lang/php/php-8.3.2-r1.ebuild b/dev-lang/php/php-8.3.3.ebuild
similarity index 99%
rename from dev-lang/php/php-8.3.2-r1.ebuild
rename to dev-lang/php/php-8.3.3.ebuild
index e2dff19d343f..c914d8167246 100644
--- a/dev-lang/php/php-8.3.2-r1.ebuild
+++ b/dev-lang/php/php-8.3.3.ebuild
@@ -149,7 +149,13 @@ PHP_MV="$(ver_cut 1)"
 
 PATCHES=(
 	"${FILESDIR}/php-iodbc-header-location.patch"
-	"${FILESDIR}/php-8.2.15-gcc14-build-fix.patch"
+)
+
+# ARM/Windows functions that are expected to be undefined.
+QA_CONFIG_IMPL_DECL_SKIP=(
+	__crc32d
+	_controlfp
+	_controlfp_s
 )
 
 php_install_ini() {


^ permalink raw reply related	[flat|nested] 21+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-lang/php/files/, dev-lang/php/
@ 2023-05-05 13:18 Brian Evans
  0 siblings, 0 replies; 21+ messages in thread
From: Brian Evans @ 2023-05-05 13:18 UTC (permalink / raw
  To: gentoo-commits

commit:     e3633b3970dbbde652043324504ce21064668f8f
Author:     Brian Evans <grknight <AT> gentoo <DOT> org>
AuthorDate: Fri May  5 13:11:26 2023 +0000
Commit:     Brian Evans <grknight <AT> gentoo <DOT> org>
CommitDate: Fri May  5 13:18:36 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e3633b39

dev-lang/php: Backport capstone detection added upstream

This is a trimmed down version of mjo's patch to apply to a wider array
of versions.  The oprofile bits omiitted are not important as defines
block their calling and the defines are removed from the configure.

Fixes: https://bugs.gentoo.org/905725
Signed-off-by: Brian Evans <grknight <AT> gentoo.org>

 dev-lang/php/files/php-capstone-optional.patch | 78 ++++++++++++++++++++++++++
 dev-lang/php/php-8.1.18.ebuild                 |  1 +
 dev-lang/php/php-8.2.5.ebuild                  |  1 +
 3 files changed, 80 insertions(+)

diff --git a/dev-lang/php/files/php-capstone-optional.patch b/dev-lang/php/files/php-capstone-optional.patch
new file mode 100644
index 000000000000..a4719bbb6857
--- /dev/null
+++ b/dev-lang/php/files/php-capstone-optional.patch
@@ -0,0 +1,78 @@
+diff --git a/ext/opcache/config.m4 b/ext/opcache/config.m4
+index 444ded9976ac..fb3324cf82a3 100644
+--- a/ext/opcache/config.m4
++++ b/ext/opcache/config.m4
+@@ -18,6 +18,12 @@ PHP_ARG_ENABLE([opcache-jit],
+   [yes],
+   [no])
+ 
++PHP_ARG_WITH([opcache-capstone],,
++  [AS_HELP_STRING([--with-opcache-capstone],
++    [support opcache JIT disassembly through capstone])],
++  [no],
++  [no])
++
+ if test "$PHP_OPCACHE" != "no"; then
+ 
+   dnl Always build as shared extension
+@@ -68,41 +74,18 @@ if test "$PHP_OPCACHE" != "no"; then
+       DASM_FLAGS="$DASM_FLAGS -D ZTS=1"
+     fi
+ 
+-    PKG_CHECK_MODULES([CAPSTONE], [capstone >= 3.0.0],
+-        [have_capstone="yes"], [have_capstone="no"])
+-    if test "$have_capstone" = "yes"; then
+-        AC_DEFINE(HAVE_CAPSTONE, 1, [ ])
++    AS_IF([test x"$with_opcache_capstone" = "xyes"],[
++      PKG_CHECK_MODULES([CAPSTONE],[capstone >= 3.0.0],[
++        AC_DEFINE([HAVE_CAPSTONE], [1], [Capstone is available])
+         PHP_EVAL_LIBLINE($CAPSTONE_LIBS, OPCACHE_SHARED_LIBADD)
+         PHP_EVAL_INCLINE($CAPSTONE_CFLAGS)
+-    fi
+-
+-    PHP_SUBST(DASM_FLAGS)
+-    PHP_SUBST(DASM_ARCH)
+-
+-    AC_MSG_CHECKING(for opagent in default path)
+-    for i in /usr/local /usr; do
+-      if test -r $i/include/opagent.h; then
+-        OPAGENT_DIR=$i
+-        AC_MSG_RESULT(found in $i)
+-        break
+-      fi
+-    done
+-    if test -z "$OPAGENT_DIR"; then
+-      AC_MSG_RESULT(not found)
+-    else
+-      PHP_CHECK_LIBRARY(opagent, op_write_native_code,
+-      [
+-        AC_DEFINE(HAVE_OPROFILE,1,[ ])
+-        PHP_ADD_INCLUDE($OPAGENT_DIR/include)
+-        PHP_ADD_LIBRARY_WITH_PATH(opagent, $OPAGENT_DIR/$PHP_LIBDIR/oprofile, OPCACHE_SHARED_LIBADD)
+-        PHP_SUBST(OPCACHE_SHARED_LIBADD)
+-      ],[
+-        AC_MSG_RESULT(not found)
+       ],[
+-        -L$OPAGENT_DIR/$PHP_LIBDIR/oprofile
++        AC_MSG_ERROR([capstone >= 3.0 required but not found])
+       ])
+-    fi
++    ])
+ 
++    PHP_SUBST(DASM_FLAGS)
++    PHP_SUBST(DASM_ARCH)
+   fi
+ 
+   AC_CHECK_FUNCS([mprotect memfd_create])
+diff --git a/ext/opcache/jit/Makefile.frag b/ext/opcache/jit/Makefile.frag
+index 98c5cdaea249..f9ae2e0cf4b9 100644
+--- a/ext/opcache/jit/Makefile.frag
++++ b/ext/opcache/jit/Makefile.frag
+@@ -11,7 +11,6 @@ $(builddir)/jit/zend_jit.lo: \
+ 	$(srcdir)/jit/zend_jit_disasm.c \
+ 	$(srcdir)/jit/zend_jit_gdb.c \
+ 	$(srcdir)/jit/zend_jit_perf_dump.c \
+-	$(srcdir)/jit/zend_jit_oprofile.c \
+ 	$(srcdir)/jit/zend_jit_vtune.c \
+ 	$(srcdir)/jit/zend_jit_trace.c \
+ 	$(srcdir)/jit/zend_elf.c

diff --git a/dev-lang/php/php-8.1.18.ebuild b/dev-lang/php/php-8.1.18.ebuild
index 20d68c6387fd..7a0c8ba9fcf7 100644
--- a/dev-lang/php/php-8.1.18.ebuild
+++ b/dev-lang/php/php-8.1.18.ebuild
@@ -147,6 +147,7 @@ PHP_MV="$(ver_cut 1)"
 
 PATCHES=(
 	"${FILESDIR}/php-iodbc-header-location.patch"
+	"${FILESDIR}/php-capstone-optional.patch"
 )
 
 php_install_ini() {

diff --git a/dev-lang/php/php-8.2.5.ebuild b/dev-lang/php/php-8.2.5.ebuild
index bb2d5ee06588..d8e80841110d 100644
--- a/dev-lang/php/php-8.2.5.ebuild
+++ b/dev-lang/php/php-8.2.5.ebuild
@@ -148,6 +148,7 @@ PHP_MV="$(ver_cut 1)"
 
 PATCHES=(
 	"${FILESDIR}/php-iodbc-header-location.patch"
+	"${FILESDIR}/php-capstone-optional.patch"
 )
 
 php_install_ini() {


^ permalink raw reply related	[flat|nested] 21+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-lang/php/files/, dev-lang/php/
@ 2023-01-05 21:30 Brian Evans
  0 siblings, 0 replies; 21+ messages in thread
From: Brian Evans @ 2023-01-05 21:30 UTC (permalink / raw
  To: gentoo-commits

commit:     7cb74e0dfb7422871ba57d0dc76fc8531576f32e
Author:     Brian Evans <grknight <AT> gentoo <DOT> org>
AuthorDate: Thu Jan  5 20:46:07 2023 +0000
Commit:     Brian Evans <grknight <AT> gentoo <DOT> org>
CommitDate: Thu Jan  5 21:30:13 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7cb74e0d

dev-lang/php: Apply CVE-2022-31631 patch to 7.4.33

Bug: https://bugs.gentoo.org/889882
Signed-off-by: Brian Evans <grknight <AT> gentoo.org>

 dev-lang/php/files/php-7.4.33-CVE-2022-31631.patch |  50 ++
 dev-lang/php/php-7.4.33-r1.ebuild                  | 750 +++++++++++++++++++++
 2 files changed, 800 insertions(+)

diff --git a/dev-lang/php/files/php-7.4.33-CVE-2022-31631.patch b/dev-lang/php/files/php-7.4.33-CVE-2022-31631.patch
new file mode 100644
index 000000000000..6aa309549c88
--- /dev/null
+++ b/dev-lang/php/files/php-7.4.33-CVE-2022-31631.patch
@@ -0,0 +1,50 @@
+From 921b6813da3237a83e908998483f46ae3d8bacba Mon Sep 17 00:00:00 2001
+From: "Christoph M. Becker" <cmbecker69@gmx.de>
+Date: Mon, 31 Oct 2022 17:20:23 +0100
+Subject: [PATCH] Fix #81740: PDO::quote() may return unquoted string
+
+`sqlite3_snprintf()` expects its first parameter to be `int`; we need
+to avoid overflow.
+---
+ ext/pdo_sqlite/sqlite_driver.c     |  3 +++
+ ext/pdo_sqlite/tests/bug81740.phpt | 17 +++++++++++++++++
+ 2 files changed, 20 insertions(+)
+ create mode 100644 ext/pdo_sqlite/tests/bug81740.phpt
+
+diff --git a/ext/pdo_sqlite/sqlite_driver.c b/ext/pdo_sqlite/sqlite_driver.c
+index 4233ff10ff2e..5a72a1eda23f 100644
+--- a/ext/pdo_sqlite/sqlite_driver.c
++++ b/ext/pdo_sqlite/sqlite_driver.c
+@@ -232,6 +232,9 @@ static char *pdo_sqlite_last_insert_id(pdo_dbh_t *dbh, const char *name, size_t
+ /* NB: doesn't handle binary strings... use prepared stmts for that */
+ static int sqlite_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, size_t unquotedlen, char **quoted, size_t *quotedlen, enum pdo_param_type paramtype )
+ {
++	if (unquotedlen > (INT_MAX - 3) / 2) {
++		return 0;
++	}
+ 	*quoted = safe_emalloc(2, unquotedlen, 3);
+ 	sqlite3_snprintf(2*unquotedlen + 3, *quoted, "'%q'", unquoted);
+ 	*quotedlen = strlen(*quoted);
+diff --git a/ext/pdo_sqlite/tests/bug81740.phpt b/ext/pdo_sqlite/tests/bug81740.phpt
+new file mode 100644
+index 000000000000..99fb07c3048b
+--- /dev/null
++++ b/ext/pdo_sqlite/tests/bug81740.phpt
+@@ -0,0 +1,17 @@
++--TEST--
++Bug #81740 (PDO::quote() may return unquoted string)
++--SKIPIF--
++<?php
++if (!extension_loaded('pdo_sqlite')) print 'skip not loaded';
++if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
++?>
++--INI--
++memory_limit=-1
++--FILE--
++<?php
++$pdo = new PDO("sqlite::memory:");
++$string = str_repeat("a", 0x80000000);
++var_dump($pdo->quote($string));
++?>
++--EXPECT--
++bool(false)

diff --git a/dev-lang/php/php-7.4.33-r1.ebuild b/dev-lang/php/php-7.4.33-r1.ebuild
new file mode 100644
index 000000000000..782d2e8f7e1d
--- /dev/null
+++ b/dev-lang/php/php-7.4.33-r1.ebuild
@@ -0,0 +1,750 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="7"
+
+WANT_AUTOMAKE="none"
+
+inherit flag-o-matic systemd autotools
+
+MY_PV=${PV/_rc/RC}
+DESCRIPTION="The PHP language runtime engine"
+HOMEPAGE="https://www.php.net/"
+SRC_URI="https://www.php.net/distributions/${P}.tar.xz"
+
+LICENSE="PHP-3.01
+	BSD
+	Zend-2.0
+	bcmath? ( LGPL-2.1+ )
+	fpm? ( BSD-2 )
+	gd? ( gd )
+	unicode? ( BSD-2 LGPL-2.1 )"
+
+SLOT="$(ver_cut 1-2)"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos"
+
+S="${WORKDIR}/${PN}-${MY_PV}"
+
+# We can build the following SAPIs in the given order
+SAPIS="embed cli cgi fpm apache2 phpdbg"
+
+# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
+IUSE="${IUSE}
+	${SAPIS/cli/+cli}
+	threads"
+
+IUSE="${IUSE} acl argon2 bcmath berkdb bzip2 calendar cdb cjk
+	coverage +ctype curl debug
+	enchant exif ffi +fileinfo +filter firebird
+	+flatfile ftp gd gdbm gmp +iconv imap inifile
+	intl iodbc ipv6 +jit +json kerberos ldap ldap-sasl libedit lmdb
+	mhash mssql mysql mysqli nls
+	oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
+	readline selinux +session session-mm sharedmem
+	+simplexml snmp soap sockets sodium spell sqlite ssl
+	sysvipc systemd test tidy +tokenizer tokyocabinet truetype unicode webp
+	+xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib"
+
+# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
+# The Oracle instant client provides its own incompatible ldap library.
+REQUIRED_USE="
+	|| ( cli cgi fpm apache2 embed phpdbg )
+	cli? ( ^^ ( readline libedit ) )
+	!cli? ( ?? ( readline libedit ) )
+	truetype? ( gd zlib )
+	webp? ( gd zlib )
+	cjk? ( gd zlib )
+	exif? ( gd zlib )
+	xpm? ( gd zlib )
+	gd? ( zlib )
+	simplexml? ( xml )
+	soap? ( xml )
+	xmlrpc? ( xml iconv )
+	xmlreader? ( xml )
+	xmlwriter? ( xml )
+	xslt? ( xml )
+	ldap-sasl? ( ldap )
+	oci8-instant-client? ( !ldap )
+	qdbm? ( !gdbm )
+	session-mm? ( session !threads )
+	mysql? ( || ( mysqli pdo ) )
+	firebird? ( pdo )
+	mssql? ( pdo )
+"
+
+RESTRICT="!test? ( test )"
+
+# The supported (that is, autodetected) versions of BDB are listed in
+# the ./configure script. Other versions *work*, but we need to stick to
+# the ones that can be detected to avoid a repeat of bug #564824.
+COMMON_DEPEND="
+	>=app-eselect/eselect-php-0.9.1[apache2?,fpm?]
+	>=dev-libs/libpcre2-10.30[jit?,unicode]
+	fpm? ( acl? ( sys-apps/acl ) )
+	apache2? ( www-servers/apache[apache2_modules_unixd(+),threads=] )
+	argon2? ( app-crypt/argon2:= )
+	berkdb? ( || (  sys-libs/db:5.3 sys-libs/db:4.8 ) )
+	bzip2? ( app-arch/bzip2:0= )
+	cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
+	coverage? ( dev-util/lcov )
+	curl? ( >=net-misc/curl-7.10.5 )
+	enchant? ( <app-text/enchant-2.0:0 )
+	ffi? ( >=dev-libs/libffi-3.0.11:= )
+	firebird? ( dev-db/firebird )
+	gd? ( media-libs/libjpeg-turbo:0= media-libs/libpng:0= )
+	gdbm? ( >=sys-libs/gdbm-1.8.0:0= )
+	gmp? ( dev-libs/gmp:0= )
+	iconv? ( virtual/libiconv )
+	imap? ( net-libs/c-client[kerberos=,ssl=] )
+	intl? ( dev-libs/icu:= )
+	kerberos? ( virtual/krb5 )
+	ldap? ( >=net-nds/openldap-1.2.11:= )
+	ldap-sasl? ( dev-libs/cyrus-sasl )
+	libedit? ( dev-libs/libedit )
+	lmdb? ( dev-db/lmdb:= )
+	mssql? ( dev-db/freetds[mssql] )
+	nls? ( sys-devel/gettext )
+	oci8-instant-client? ( dev-db/oracle-instantclient[sdk] )
+	odbc? ( iodbc? ( dev-db/libiodbc ) !iodbc? ( >=dev-db/unixODBC-1.8.13 ) )
+	postgres? ( dev-db/postgresql:* )
+	qdbm? ( dev-db/qdbm )
+	readline? ( sys-libs/readline:0= )
+	session-mm? ( dev-libs/mm )
+	snmp? ( >=net-analyzer/net-snmp-5.2 )
+	sodium? ( dev-libs/libsodium:=[-minimal] )
+	spell? ( >=app-text/aspell-0.50 )
+	sqlite? ( >=dev-db/sqlite-3.7.6.3 )
+	ssl? ( >=dev-libs/openssl-1.0.1:0= <dev-libs/openssl-3.0 )
+	tidy? ( app-text/htmltidy )
+	tokyocabinet? ( dev-db/tokyocabinet )
+	truetype? ( =media-libs/freetype-2* )
+	unicode? ( dev-libs/oniguruma:= )
+	webp? ( media-libs/libwebp:0= )
+	xml? ( >=dev-libs/libxml2-2.7.6 )
+	xpm? ( x11-libs/libXpm )
+	xslt? ( dev-libs/libxslt )
+	zip? ( >=dev-libs/libzip-1.2.0:= )
+	zlib? ( >=sys-libs/zlib-1.2.0.4:0= )
+"
+
+RDEPEND="${COMMON_DEPEND}
+	virtual/mta
+	fpm? (
+		selinux? ( sec-policy/selinux-phpfpm )
+		systemd? ( sys-apps/systemd ) )"
+
+# Bison isn't actually needed when building from a release tarball
+# However, the configure script will warn if it's absent or if you
+# have an incompatible version installed. See bug 593278.
+DEPEND="${COMMON_DEPEND}
+	app-arch/xz-utils
+	>=sys-devel/bison-3.0.1"
+
+BDEPEND="virtual/pkgconfig"
+
+PHP_MV="$(ver_cut 1)"
+
+PATCHES=(
+	"${FILESDIR}"/php-iodbc-header-location.patch
+	"${FILESDIR}"/bug81656-gcc-11.patch
+	"${FILESDIR}"/php-7.4.33-CVE-2022-31631.patch
+)
+
+php_install_ini() {
+	local phpsapi="${1}"
+
+	# work out where we are installing the ini file
+	php_set_ini_dir "${phpsapi}"
+
+	# Always install the production INI file, bug 611214.
+	local phpinisrc="php.ini-production-${phpsapi}"
+	cp php.ini-production "${phpinisrc}" || die
+
+	# default to /tmp for save_path, bug #282768
+	sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die
+
+	# Set the extension dir
+	sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \
+		-i "${phpinisrc}" || die
+
+	# Set the include path to point to where we want to find PEAR packages
+	sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die
+
+	insinto "${PHP_INI_DIR#${EPREFIX}}"
+	newins "${phpinisrc}" php.ini
+
+	elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}"
+	elog
+
+	dodir "${PHP_EXT_INI_DIR#${EPREFIX}}"
+	dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}"
+
+	if use opcache; then
+		elog "Adding opcache to $PHP_EXT_INI_DIR"
+		echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \
+			 "${D}/${PHP_EXT_INI_DIR}"/opcache.ini
+		dosym "../ext/opcache.ini" \
+			  "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini"
+	fi
+
+	# SAPI-specific handling
+	if [[ "${sapi}" == "fpm" ]] ; then
+		einfo "Installing FPM config files php-fpm.conf and www.conf"
+		insinto "${PHP_INI_DIR#${EPREFIX}}"
+		doins sapi/fpm/php-fpm.conf
+		insinto "${PHP_INI_DIR#${EPREFIX}}/fpm.d"
+		doins sapi/fpm/www.conf
+	fi
+
+	dodoc php.ini-{development,production}
+}
+
+php_set_ini_dir() {
+	PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}"
+	PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
+	PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
+}
+
+src_prepare() {
+	default
+
+	# In php-7.x, the FPM pool configuration files have been split off
+	# of the main config. By default the pool config files go in
+	# e.g. /etc/php-fpm.d, which isn't slotted. So here we move the
+	# include directory to a subdirectory "fpm.d" of $PHP_INI_DIR. Later
+	# we'll install the pool configuration file "www.conf" there.
+	php_set_ini_dir fpm
+	sed -i "s~^include=.*$~include=${PHP_INI_DIR}/fpm.d/*.conf~" \
+		sapi/fpm/php-fpm.conf.in \
+		|| die 'failed to move the include directory in php-fpm.conf'
+
+	# Emulate buildconf to support cross-compilation
+	rm -fr aclocal.m4 autom4te.cache config.cache \
+		configure main/php_config.h.in || die
+	eautoconf --force
+	eautoheader
+}
+
+src_configure() {
+	filter-lto # bug 855644
+
+	addpredict /usr/share/snmp/mibs/.index #nowarn
+	addpredict /var/lib/net-snmp/mib_indexes #nowarn
+
+	PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
+
+	# The php-fpm config file wants localstatedir to be ${EPREFIX}/var
+	# and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002.
+	local our_conf=(
+		--prefix="${PHP_DESTDIR}"
+		--mandir="${PHP_DESTDIR}/man"
+		--infodir="${PHP_DESTDIR}/info"
+		--libdir="${PHP_DESTDIR}/lib"
+		--with-libdir="$(get_libdir)"
+		--localstatedir="${EPREFIX}/var"
+		--without-pear
+		--without-valgrind
+		$(use_enable threads maintainer-zts)
+	)
+
+	our_conf+=(
+		$(use_with argon2 password-argon2 "${EPREFIX}/usr")
+		$(use_enable bcmath)
+		$(use_with bzip2 bz2 "${EPREFIX}/usr")
+		$(use_enable calendar)
+		$(use_enable coverage gcov)
+		$(use_enable ctype)
+		$(use_with curl)
+		$(use_enable xml dom)
+		$(use_with enchant)
+		$(use_enable exif)
+		$(use_with ffi)
+		$(use_enable fileinfo)
+		$(use_enable filter)
+		$(use_enable ftp)
+		$(use_with nls gettext "${EPREFIX}/usr")
+		$(use_with gmp gmp "${EPREFIX}/usr")
+		$(use_with mhash mhash "${EPREFIX}/usr")
+		$(use_with iconv iconv \
+			$(use elibc_glibc || use elibc_musl || echo "${EPREFIX}/usr"))
+		$(use_enable intl)
+		$(use_enable ipv6)
+		$(use_enable json)
+		$(use_with kerberos)
+		$(use_with xml libxml)
+		$(use_enable unicode mbstring)
+		$(use_with ssl openssl)
+		$(use_enable pcntl)
+		$(use_enable phar)
+		$(use_enable pdo)
+		$(use_enable opcache)
+		$(use_with postgres pgsql "${EPREFIX}/usr")
+		$(use_enable posix)
+		$(use_with spell pspell "${EPREFIX}/usr")
+		$(use_enable simplexml)
+		$(use_enable sharedmem shmop)
+		$(use_with snmp snmp "${EPREFIX}/usr")
+		$(use_enable soap)
+		$(use_enable sockets)
+		$(use_with sodium)
+		$(use_with sqlite sqlite3)
+		$(use_enable sysvipc sysvmsg)
+		$(use_enable sysvipc sysvsem)
+		$(use_enable sysvipc sysvshm)
+		$(use_with tidy tidy "${EPREFIX}/usr")
+		$(use_enable tokenizer)
+		$(use_enable xml)
+		$(use_enable xmlreader)
+		$(use_enable xmlwriter)
+		$(use_with xmlrpc)
+		$(use_with xslt xsl)
+		$(use_with zip)
+		$(use_with zlib zlib "${EPREFIX}/usr")
+		$(use_enable debug)
+	)
+
+	# DBA support
+	if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
+		|| use qdbm || use lmdb || use tokyocabinet ; then
+		our_conf+=( "--enable-dba" )
+	fi
+
+	# DBA drivers support
+	our_conf+=(
+		$(use_with cdb)
+		$(use_with berkdb db4 "${EPREFIX}/usr")
+		$(use_enable flatfile)
+		$(use_with gdbm gdbm "${EPREFIX}/usr")
+		$(use_enable inifile)
+		$(use_with qdbm qdbm "${EPREFIX}/usr")
+		$(use_with tokyocabinet tcadb "${EPREFIX}/usr")
+		$(use_with lmdb lmdb "${EPREFIX}/usr")
+	)
+
+	# Support for the GD graphics library
+	our_conf+=(
+		$(use_with truetype freetype)
+		$(use_enable cjk gd-jis-conv)
+		$(use_with gd jpeg)
+		$(use_with xpm)
+		$(use_with webp)
+	)
+	# enable gd last, so configure can pick up the previous settings
+	our_conf+=( $(use_enable gd) )
+
+	# IMAP support
+	if use imap ; then
+		our_conf+=(
+			$(use_with imap imap "${EPREFIX}/usr")
+			$(use_with ssl imap-ssl "${EPREFIX}/usr")
+		)
+	fi
+
+	# LDAP support
+	if use ldap ; then
+		our_conf+=(
+			$(use_with ldap ldap "${EPREFIX}/usr")
+			$(use_with ldap-sasl)
+		)
+	fi
+
+	# MySQL support
+	local mysqllib="mysqlnd"
+	local mysqlilib="mysqlnd"
+
+	our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
+
+	local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock"
+	if use mysql || use mysqli ; then
+		our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") )
+	fi
+
+	# ODBC support
+	if use odbc && use iodbc ; then
+		our_conf+=(
+			--without-unixODBC
+			--with-iodbc
+			$(use_with pdo pdo-odbc "iODBC,${EPREFIX}/usr")
+		)
+	elif use odbc ; then
+		our_conf+=(
+			--with-unixODBC="${EPREFIX}/usr"
+			--without-iodbc
+			$(use_with pdo pdo-odbc "unixODBC,${EPREFIX}/usr")
+		)
+	else
+		our_conf+=(
+			--without-unixODBC
+			--without-iodbc
+			--without-pdo-odbc
+		)
+	fi
+
+	# Oracle support
+	our_conf+=( $(use_with oci8-instant-client oci8) )
+
+	# PDO support
+	if use pdo ; then
+		our_conf+=(
+			$(use_with mssql pdo-dblib "${EPREFIX}/usr")
+			$(use_with mysql pdo-mysql "${mysqllib}")
+			$(use_with postgres pdo-pgsql)
+			$(use_with sqlite pdo-sqlite)
+			$(use_with firebird pdo-firebird "${EPREFIX}/usr")
+			$(use_with oci8-instant-client pdo-oci)
+		)
+	fi
+
+	# readline/libedit support
+	our_conf+=(
+		$(use_with readline readline "${EPREFIX}/usr")
+		$(use_with libedit)
+	)
+
+	# Session support
+	if use session ; then
+		our_conf+=( $(use_with session-mm mm "${EPREFIX}/usr") )
+	else
+		our_conf+=( $(use_enable session) )
+	fi
+
+	# Use pic for shared modules such as apache2's mod_php
+	our_conf+=( --with-pic )
+
+	# we use the system copy of pcre
+	# --with-external-pcre affects ext/pcre
+	our_conf+=(
+		--with-external-pcre
+		$(use_with jit pcre-jit)
+	)
+
+	# Catch CFLAGS problems
+	# Fixes bug #14067.
+	# Changed order to run it in reverse for bug #32022 and #12021.
+	replace-cpu-flags "k6*" "i586"
+
+	# Cache the ./configure test results between SAPIs.
+	our_conf+=( --cache-file="${T}/config.cache" )
+
+	# Support user-passed configuration parameters
+	our_conf+=( ${EXTRA_ECONF:-} )
+
+	# Support the Apache2 extras, they must be set globally for all
+	# SAPIs to work correctly, especially for external PHP extensions
+
+	local one_sapi
+	local sapi
+	mkdir -p "${WORKDIR}/sapis-build" || die
+	for one_sapi in $SAPIS ; do
+		use "${one_sapi}" || continue
+		php_set_ini_dir "${one_sapi}"
+
+		# The BUILD_DIR variable is used to determine where to output
+		# the files that autotools creates. This was all originally
+		# based on the autotools-utils eclass.
+		BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}"
+		cp -a "${S}" "${BUILD_DIR}" || die
+		cd "${BUILD_DIR}" || die
+
+		local sapi_conf=(
+			--with-config-file-path="${PHP_INI_DIR}"
+			--with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}"
+		)
+
+		for sapi in $SAPIS ; do
+			case "$sapi" in
+				cli|cgi|embed|fpm|phpdbg)
+					if [[ "${one_sapi}" == "${sapi}" ]] ; then
+						sapi_conf+=( "--enable-${sapi}" )
+						if [[ "fpm" == "${sapi}" ]] ; then
+							sapi_conf+=(
+								$(use_with acl fpm-acl)
+								$(use_with systemd fpm-systemd)
+							)
+						fi
+					else
+						sapi_conf+=( "--disable-${sapi}" )
+					fi
+					;;
+
+				apache2)
+					if [[ "${one_sapi}" == "${sapi}" ]] ; then
+						sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" )
+					else
+						sapi_conf+=( --without-apxs2 )
+					fi
+					;;
+			esac
+		done
+
+		# Construct the $myeconfargs array by concatenating $our_conf
+		# (the common args) and $sapi_conf (the SAPI-specific args).
+		local myeconfargs=( "${our_conf[@]}" )
+		myeconfargs+=( "${sapi_conf[@]}" )
+
+		pushd "${BUILD_DIR}" > /dev/null || die
+		econf "${myeconfargs[@]}"
+		popd > /dev/null || die
+	done
+}
+
+src_compile() {
+	# snmp seems to run during src_compile, too (bug #324739)
+	addpredict /usr/share/snmp/mibs/.index #nowarn
+	addpredict /var/lib/net-snmp/mib_indexes #nowarn
+
+	local sapi
+	for sapi in ${SAPIS} ; do
+		if use "${sapi}"; then
+			cd "${WORKDIR}/sapis-build/$sapi" || \
+				die "Failed to change dir to ${WORKDIR}/sapis-build/$1"
+			emake
+		fi
+	done
+}
+
+src_install() {
+	# see bug #324739 for what happens when we don't have that
+	addpredict /usr/share/snmp/mibs/.index #nowarn
+
+	# grab the first SAPI that got built and install common files from there
+	local first_sapi="", sapi=""
+	for sapi in $SAPIS ; do
+		if use $sapi ; then
+			first_sapi=$sapi
+			break
+		fi
+	done
+
+	# Makefile forgets to create this before trying to write to it...
+	dodir "${PHP_DESTDIR#${EPREFIX}}/bin"
+
+	# Install php environment (without any sapis)
+	cd "${WORKDIR}/sapis-build/$first_sapi" || die
+	emake INSTALL_ROOT="${D}" \
+		install-build install-headers install-programs
+
+	local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)"
+
+	# Create the directory where we'll put version-specific php scripts
+	keepdir "/usr/share/php${PHP_MV}"
+
+	local file=""
+	local sapi_list=""
+
+	for sapi in ${SAPIS}; do
+		if use "${sapi}" ; then
+			einfo "Installing SAPI: ${sapi}"
+			cd "${WORKDIR}/sapis-build/${sapi}" || die
+
+			if [[ "${sapi}" == "apache2" ]] ; then
+				# We're specifically not using emake install-sapi as libtool
+				# may cause unnecessary relink failures (see bug #351266)
+				insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/"
+				newins ".libs/libphp${PHP_MV}$(get_libname)" \
+					   "libphp${PHP_MV}$(get_libname)"
+				keepdir "/usr/$(get_libdir)/apache2/modules"
+			else
+				# needed each time, php_install_ini would reset it
+				local dest="${PHP_DESTDIR#${EPREFIX}}"
+				into "${dest}"
+				case "$sapi" in
+					cli)
+						source="sapi/cli/php"
+						# Install the "phar" archive utility.
+						if use phar ; then
+							emake INSTALL_ROOT="${D}" install-pharcmd
+							dosym "..${dest#/usr}/bin/phar" "/usr/bin/phar${SLOT}"
+						fi
+						;;
+					cgi)
+						source="sapi/cgi/php-cgi"
+						;;
+					fpm)
+						source="sapi/fpm/php-fpm"
+						;;
+					embed)
+						source="libs/libphp${PHP_MV}$(get_libname)"
+						;;
+					phpdbg)
+						source="sapi/phpdbg/phpdbg"
+						;;
+					*)
+						die "unhandled sapi in src_install"
+						;;
+				esac
+
+				if [[ "${source}" == *"$(get_libname)" ]]; then
+					dolib.so "${source}"
+				else
+					dobin "${source}"
+					local name="$(basename ${source})"
+					dosym "..${dest#/usr}/bin/${name}" "/usr/bin/${name}${SLOT}"
+				fi
+			fi
+
+			php_install_ini "${sapi}"
+
+			# construct correct SAPI string for php-config
+			# thanks to ferringb for the bash voodoo
+			if [[ "${sapi}" == "apache2" ]]; then
+				sapi_list="${sapi_list:+${sapi_list} }apache2handler"
+			else
+				sapi_list="${sapi_list:+${sapi_list} }${sapi}"
+			fi
+		fi
+	done
+
+	# Installing opcache module
+	if use opcache ; then
+		into "${PHP_DESTDIR#${EPREFIX}}"
+		dolib.so "modules/opcache$(get_libname)"
+	fi
+
+	# Install env.d files
+	newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}"
+	sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
+	sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
+
+	# set php-config variable correctly (bug #278439)
+	sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \
+		"${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die
+
+	if use fpm ; then
+		if use systemd; then
+			systemd_newunit "${FILESDIR}/php-fpm_at.service" \
+							"php-fpm@${SLOT}.service"
+		else
+			systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \
+							"php-fpm@${SLOT}.service"
+		fi
+	fi
+}
+
+src_test() {
+	echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
+	PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
+	if [[ ! -x "${PHP_BIN}" ]] ; then
+		ewarn "Test phase requires USE=cli, skipping"
+		return
+	else
+		export TEST_PHP_EXECUTABLE="${PHP_BIN}"
+	fi
+
+	if [[ -x "${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" ]] ; then
+		export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi"
+	fi
+
+	if [[ -x "${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" ]] ; then
+		export TEST_PHPDBG_EXECUTABLE="${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg"
+	fi
+
+	REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n  -d \
+					  "session.save_path=${T}" \
+					  "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \
+					  "session.save_path=${T}"
+
+	for name in ${EXPECTED_TEST_FAILURES}; do
+		mv "${name}.out" "${name}.out.orig" 2>/dev/null || die
+	done
+
+	local failed="$(find -name '*.out')"
+	if [[ ${failed} != "" ]] ; then
+		ewarn "The following test cases failed unexpectedly:"
+		for name in ${failed}; do
+			ewarn "  ${name/.out/}"
+		done
+	else
+		einfo "No unexpected test failures, all fine"
+	fi
+
+	if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
+		local passed=""
+		for name in ${EXPECTED_TEST_FAILURES}; do
+			[[ -f "${name}.diff" ]] && continue
+			passed="${passed} ${name}"
+		done
+		if [[ ${passed} != "" ]] ; then
+			einfo "The following test cases passed unexpectedly:"
+			for name in ${passed}; do
+				ewarn "  ${passed}"
+			done
+		else
+			einfo "None of the known-to-fail tests passed, all fine"
+		fi
+	fi
+}
+
+pkg_postinst() {
+	# Output some general info to the user
+	if use apache2 ; then
+		elog
+		elog "To enable PHP in apache, you will need to add \"-D PHP\" to"
+		elog "your apache2 command. OpenRC users can append that string to"
+		elog "APACHE2_OPTS in /etc/conf.d/apache2."
+		elog
+		elog "The apache module configuration file 70_mod_php.conf is"
+		elog "provided (and maintained) by eselect-php."
+		elog
+	fi
+
+	# Create the symlinks for php
+	local m
+	for m in ${SAPIS}; do
+		[[ ${m} == 'embed' ]] && continue;
+		if use $m ; then
+			local ci=$(eselect php show $m)
+			if [[ -z $ci ]]; then
+				eselect php set $m php${SLOT} || die
+				einfo "Switched ${m} to use php:${SLOT}"
+				einfo
+			elif [[ $ci != "php${SLOT}" ]] ; then
+				elog "To switch $m to use php:${SLOT}, run"
+				elog "    eselect php set $m php${SLOT}"
+				elog
+			fi
+		fi
+	done
+
+	# Remove dead symlinks for SAPIs that were just disabled. For
+	# example, if the user has the cgi SAPI enabled, then he has an
+	# eselect-php symlink for it. If he later reinstalls PHP with
+	# USE="-cgi", that symlink will break. This call to eselect is
+	# supposed to remove that dead link per bug 572436.
+	eselect php cleanup || die
+
+	if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then
+	   elog "To build extensions for this version of PHP, you will need to"
+	   elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable."
+	   elog
+	fi
+
+	# Warn about the removal of PHP_INI_VERSION if the user has it set.
+	if [[ -n "${PHP_INI_VERSION}" ]]; then
+		ewarn 'The PHP_INI_VERSION variable has been phased out. You may'
+		ewarn 'remove it from your configuration at your convenience. See'
+		ewarn
+		ewarn '  https://bugs.gentoo.org/611214'
+		ewarn
+		ewarn 'for more information.'
+	fi
+
+	elog "For details on how version slotting works, please see"
+	elog "the wiki:"
+	elog
+	elog "  https://wiki.gentoo.org/wiki/PHP"
+	elog
+}
+
+pkg_postrm() {
+	# This serves two purposes. First, if we have just removed the last
+	# installed version of PHP, then this will remove any dead symlinks
+	# belonging to eselect-php. Second, if a user upgrades slots from
+	# (say) 5.6 to 7.0 and depcleans the old slot, then this will update
+	# his existing symlinks to point to the new 7.0 installation. The
+	# latter is bug 432962.
+	#
+	# Note: the eselect-php package may not be installed at this point,
+	# so we can't die() if this command fails.
+	eselect php cleanup
+}


^ permalink raw reply related	[flat|nested] 21+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-lang/php/files/, dev-lang/php/
@ 2022-04-05 19:03 Brian Evans
  0 siblings, 0 replies; 21+ messages in thread
From: Brian Evans @ 2022-04-05 19:03 UTC (permalink / raw
  To: gentoo-commits

commit:     0b3af89c17ec692f4dc4c73bf062b4495be26a28
Author:     Brian Evans <grknight <AT> gentoo <DOT> org>
AuthorDate: Tue Apr  5 19:02:25 2022 +0000
Commit:     Brian Evans <grknight <AT> gentoo <DOT> org>
CommitDate: Tue Apr  5 19:02:25 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0b3af89c

dev-lang/php: Drop 7.3 slot

Signed-off-by: Brian Evans <grknight <AT> gentoo.org>

 dev-lang/php/Manifest                       |   2 -
 dev-lang/php/files/php-freetype-2.9.1.patch | 233 ---------
 dev-lang/php/files/php-icu-70.patch         |  45 --
 dev-lang/php/php-7.3.32-r1.ebuild           | 754 ----------------------------
 dev-lang/php/php-7.3.33-r1.ebuild           | 754 ----------------------------
 5 files changed, 1788 deletions(-)

diff --git a/dev-lang/php/Manifest b/dev-lang/php/Manifest
index 915425358534..4dada26aa33b 100644
--- a/dev-lang/php/Manifest
+++ b/dev-lang/php/Manifest
@@ -1,5 +1,3 @@
-DIST php-7.3.32.tar.xz 12142436 BLAKE2B 375092f7fade8b93d2fbf409552cda42a685267248e3bce373913eeae5f133e7773554c2302b12bf09588d74a76898b138c47287f7d9a721f294635799ca46f6 SHA512 afed20a90aa7d207f9b409fb2066789a637b24d6c6874fc5733bbe6e9972616b387669ce40cba16b606893d88572f398e34aff7a36626308e3ede312f09fcc56
-DIST php-7.3.33.tar.xz 12143820 BLAKE2B 77b5ada50169b308b42dbf2c69b5aebd6e9ab9663be8de5bd26391e42015d856631f12b0268b98889f2c3058564a6c71ad298b725b8afff920e277aa3e787422 SHA512 b05edb3e87775c0b2d7bd5990e47751279076e6ef2356f59dc917f4a1447d95894f596cd8de711f03278650ff74ff9f2687ed96cec69d2d669a6af563a455e25
 DIST php-7.4.28.tar.xz 10418352 BLAKE2B 27673b5a891723a4c20a19fa22708f733b8ff12e16e5bbd727ed841845bcb8802ea98e8c2a4936b184704cde96f8725a2c338470ba573e8d3a0732a3f449e7e5 SHA512 e7fa281a3be9ec46b7fa69619fd417fc04200dc64fd153f9670184d84b0aa3d5f3698536cf18476a96d8a42ba40b856ff57ab18e8e8a485dd9b95467d1952fa8
 DIST php-8.0.16.tar.xz 10864076 BLAKE2B e5820ecd40632e458a0ada1d1886cd054520ab7f1492766fd8d5c3561977359abddd886b47f7d7255bcc80d00c96afeceb5cbd515eb779ed4ac15db9e01f1fe3 SHA512 68952638f2965752be26dc0a49f938eb4f251f2d5a7b309a2983c4f9bc064738c9da2e8015ec9b2ecc0dc06e014ace3c0348222166b898a4a38c31ab8b0fd139
 DIST php-8.0.17.tar.xz 10771016 BLAKE2B ed2b9fb4f8c2210e112d27e43acff2a71c57802c5fd72429ffc716f6b7666d00a24d35166e5e85d20d7f67e00d5cdae89eaf5d30238a0758b42964e27422507b SHA512 9e1e44860be8f5ddf0c264f791e2c8936ca3abd02c18c432ff340057e94f0fbc5f40f1ee8f4feee60416eb4ce712f43764d3757f2e667dc78150d2d86d3c02e3

diff --git a/dev-lang/php/files/php-freetype-2.9.1.patch b/dev-lang/php/files/php-freetype-2.9.1.patch
deleted file mode 100644
index 02dfd9ce3cd4..000000000000
--- a/dev-lang/php/files/php-freetype-2.9.1.patch
+++ /dev/null
@@ -1,233 +0,0 @@
---- a/ext/gd/config.m4	2018-04-24 11:09:54.000000000 -0400
-+++ b/ext/gd/config.m4	2018-05-04 15:18:49.867283889 -0400
-@@ -186,21 +186,36 @@
- AC_DEFUN([PHP_GD_FREETYPE2],[
-   if test "$PHP_FREETYPE_DIR" != "no"; then
- 
--    for i in $PHP_FREETYPE_DIR /usr/local /usr; do
--      if test -f "$i/bin/freetype-config"; then
--        FREETYPE2_DIR=$i
--        FREETYPE2_CONFIG="$i/bin/freetype-config"
--        break
-+    AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
-+    AC_MSG_CHECKING(for freetype2)
-+
-+    if test -x "$PKG_CONFIG" && $PKG_CONFIG --exists freetype2 ; then
-+
-+      FREETYPE2_CFLAGS=`$PKG_CONFIG --cflags freetype2`
-+      FREETYPE2_LIBS=`$PKG_CONFIG --libs freetype2`
-+      FREETYPE2_VERSION=`$PKG_CONFIG --modversion freetype2`
-+      FREETYPE2_DIR="found"
-+
-+      AC_MSG_RESULT(from pkgconfig: version $FREETYPE2_VERSION found)
-+    else
-+
-+      for i in $PHP_FREETYPE_DIR /usr/local /usr; do
-+        if test -f "$i/bin/freetype-config"; then
-+          FREETYPE2_DIR=$i
-+          FREETYPE2_CONFIG="$i/bin/freetype-config"
-+          break
-+        fi
-+      done
-+
-+      if test -z "$FREETYPE2_DIR"; then
-+        AC_MSG_ERROR([freetype-config not found.])
-       fi
--    done
- 
--    if test -z "$FREETYPE2_DIR"; then
--      AC_MSG_ERROR([freetype-config not found.])
-+      FREETYPE2_CFLAGS=`$FREETYPE2_CONFIG --cflags`
-+      FREETYPE2_LIBS=`$FREETYPE2_CONFIG --libs`
-+      AC_MSG_RESULT(found via freetype-config)
-     fi
- 
--    FREETYPE2_CFLAGS=`$FREETYPE2_CONFIG --cflags`
--    FREETYPE2_LIBS=`$FREETYPE2_CONFIG --libs`
--
-     PHP_EVAL_INCLINE($FREETYPE2_CFLAGS)
-     PHP_EVAL_LIBLINE($FREETYPE2_LIBS, GD_SHARED_LIBADD)
-     AC_DEFINE(HAVE_LIBFREETYPE,1,[ ])
---- a/configure	2018-04-24 11:10:05.000000000 -0400
-+++ b/configure	2018-05-04 15:18:45.626367913 -0400
-@@ -34348,21 +34348,79 @@
- 
-   if test "$PHP_FREETYPE_DIR" != "no"; then
- 
--    for i in $PHP_FREETYPE_DIR /usr/local /usr; do
--      if test -f "$i/bin/freetype-config"; then
--        FREETYPE2_DIR=$i
--        FREETYPE2_CONFIG="$i/bin/freetype-config"
--        break
-+    # Extract the first word of "pkg-config", so it can be a program name with args.
-+set dummy pkg-config; ac_word=$2
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-+$as_echo_n "checking for $ac_word... " >&6; }
-+if ${ac_cv_path_PKG_CONFIG+:} false; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  case $PKG_CONFIG in
-+  [\\/]* | ?:[\\/]*)
-+  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
-+  ;;
-+  *)
-+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-+for as_dir in $PATH
-+do
-+  IFS=$as_save_IFS
-+  test -z "$as_dir" && as_dir=.
-+    for ac_exec_ext in '' $ac_executable_extensions; do
-+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-+    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
-+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-+    break 2
-+  fi
-+done
-+  done
-+IFS=$as_save_IFS
-+
-+  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
-+  ;;
-+esac
-+fi
-+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
-+if test -n "$PKG_CONFIG"; then
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
-+$as_echo "$PKG_CONFIG" >&6; }
-+else
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-+$as_echo "no" >&6; }
-+fi
-+
-+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype2" >&5
-+$as_echo_n "checking for freetype2... " >&6; }
-+
-+
-+    if test -x "$PKG_CONFIG" && $PKG_CONFIG --exists freetype2 ; then
-+
-+      FREETYPE2_CFLAGS=`$PKG_CONFIG --cflags freetype2`
-+      FREETYPE2_LIBS=`$PKG_CONFIG --libs freetype2`
-+      FREETYPE2_VERSION=`$PKG_CONFIG --modversion freetype2`
-+      FREETYPE2_DIR="found"
-+
-+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: from pkgconfig: version $FREETYPE2_VERSION found" >&5
-+$as_echo "from pkgconfig: version $FREETYPE2_VERSION found" >&6; }
-+    else
-+
-+      for i in $PHP_FREETYPE_DIR /usr/local /usr; do
-+        if test -f "$i/bin/freetype-config"; then
-+          FREETYPE2_DIR=$i
-+          FREETYPE2_CONFIG="$i/bin/freetype-config"
-+          break
-+        fi
-+      done
-+
-+      if test -z "$FREETYPE2_DIR"; then
-+        as_fn_error $? "freetype-config not found." "$LINENO" 5
-       fi
--    done
- 
--    if test -z "$FREETYPE2_DIR"; then
--      as_fn_error $? "freetype-config not found." "$LINENO" 5
-+      FREETYPE2_CFLAGS=`$FREETYPE2_CONFIG --cflags`
-+      FREETYPE2_LIBS=`$FREETYPE2_CONFIG --libs`
-+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: found via freetype-config" >&5
-+$as_echo "found via freetype-config" >&6; }
-     fi
- 
--    FREETYPE2_CFLAGS=`$FREETYPE2_CONFIG --cflags`
--    FREETYPE2_LIBS=`$FREETYPE2_CONFIG --libs`
--
- 
-   for ac_i in $FREETYPE2_CFLAGS; do
-     case $ac_i in
-@@ -36019,21 +36076,78 @@
- 
-   if test "$PHP_FREETYPE_DIR" != "no"; then
- 
--    for i in $PHP_FREETYPE_DIR /usr/local /usr; do
--      if test -f "$i/bin/freetype-config"; then
--        FREETYPE2_DIR=$i
--        FREETYPE2_CONFIG="$i/bin/freetype-config"
--        break
-+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype2" >&5
-+$as_echo_n "checking for freetype2... " >&6; }
-+    # Extract the first word of "pkg-config", so it can be a program name with args.
-+set dummy pkg-config; ac_word=$2
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-+$as_echo_n "checking for $ac_word... " >&6; }
-+if ${ac_cv_path_PKG_CONFIG+:} false; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  case $PKG_CONFIG in
-+  [\\/]* | ?:[\\/]*)
-+  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
-+  ;;
-+  *)
-+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-+for as_dir in $PATH
-+do
-+  IFS=$as_save_IFS
-+  test -z "$as_dir" && as_dir=.
-+    for ac_exec_ext in '' $ac_executable_extensions; do
-+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-+    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
-+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-+    break 2
-+  fi
-+done
-+  done
-+IFS=$as_save_IFS
-+
-+  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
-+  ;;
-+esac
-+fi
-+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
-+if test -n "$PKG_CONFIG"; then
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
-+$as_echo "$PKG_CONFIG" >&6; }
-+else
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-+$as_echo "no" >&6; }
-+fi
-+
-+
-+
-+    if test -x "$PKG_CONFIG" && $PKG_CONFIG --exists freetype2 ; then
-+
-+      FREETYPE2_CFLAGS=`$PKG_CONFIG --cflags freetype2`
-+      FREETYPE2_LIBS=`$PKG_CONFIG --libs freetype2`
-+      FREETYPE2_VERSION=`$PKG_CONFIG --modversion freetype2`
-+
-+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: from pkgconfig: version $FREETYPE_VERSON found" >&5
-+$as_echo "from pkgconfig: version $FREETYPE_VERSON found" >&6; }
-+    else
-+
-+      for i in $PHP_FREETYPE_DIR /usr/local /usr; do
-+        if test -f "$i/bin/freetype-config"; then
-+          FREETYPE2_DIR=$i
-+          FREETYPE2_CONFIG="$i/bin/freetype-config"
-+          break
-+        fi
-+      done
-+
-+      if test -z "$FREETYPE2_DIR"; then
-+        as_fn_error $? "freetype-config not found." "$LINENO" 5
-       fi
--    done
- 
--    if test -z "$FREETYPE2_DIR"; then
--      as_fn_error $? "freetype-config not found." "$LINENO" 5
-+      FREETYPE2_CFLAGS=`$FREETYPE2_CONFIG --cflags`
-+      FREETYPE2_LIBS=`$FREETYPE2_CONFIG --libs`
-+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: found via freetype-config" >&5
-+$as_echo "found via freetype-config" >&6; }
-     fi
- 
--    FREETYPE2_CFLAGS=`$FREETYPE2_CONFIG --cflags`
--    FREETYPE2_LIBS=`$FREETYPE2_CONFIG --libs`
--
- 
-   for ac_i in $FREETYPE2_CFLAGS; do
-     case $ac_i in

diff --git a/dev-lang/php/files/php-icu-70.patch b/dev-lang/php/files/php-icu-70.patch
deleted file mode 100644
index 63bcb8533f7a..000000000000
--- a/dev-lang/php/files/php-icu-70.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-diff --git a/ext/intl/locale/locale_methods.c b/ext/intl/locale/locale_methods.c
-index 1c4ba327bd83..1bdfb27b7e2e 100644
---- a/ext/intl/locale/locale_methods.c
-+++ b/ext/intl/locale/locale_methods.c
-@@ -1326,7 +1326,7 @@ PHP_FUNCTION(locale_filter_matches)
- 		if( token && (token==cur_lang_tag) ){
- 			/* check if the char. after match is SEPARATOR */
- 			chrcheck = token + (strlen(cur_loc_range));
--			if( isIDSeparator(*chrcheck) || isEndOfTag(*chrcheck) ){
-+			if( isIDSeparator(*chrcheck) || isKeywordSeparator(*chrcheck) || isEndOfTag(*chrcheck) ){
- 				efree( cur_lang_tag );
- 				efree( cur_loc_range );
- 				if( can_lang_tag){
-diff --git a/ext/intl/breakiterator/codepointiterator_internal.cpp b/ext/intl/breakiterator/codepointiterator_internal.cpp
-index bf44678efc06..143c181590e9 100644
---- a/ext/intl/breakiterator/codepointiterator_internal.cpp
-+++ b/ext/intl/breakiterator/codepointiterator_internal.cpp
-@@ -75,7 +75,11 @@ CodePointBreakIterator::~CodePointBreakIterator()
- 	clearCurrentCharIter();
- }
- 
-+#if U_ICU_VERSION_MAJOR_NUM >= 70
-+bool CodePointBreakIterator::operator==(const BreakIterator& that) const
-+#else
- UBool CodePointBreakIterator::operator==(const BreakIterator& that) const
-+#endif
- {
- 	if (typeid(*this) != typeid(that)) {
- 		return FALSE;
-diff --git a/ext/intl/breakiterator/codepointiterator_internal.h b/ext/intl/breakiterator/codepointiterator_internal.h
-index 7ecf12deb5ae..0baf607782d0 100644
---- a/ext/intl/breakiterator/codepointiterator_internal.h
-+++ b/ext/intl/breakiterator/codepointiterator_internal.h
-@@ -39,7 +39,11 @@ namespace PHP {
- 
- 		virtual ~CodePointBreakIterator();
- 
-+#if U_ICU_VERSION_MAJOR_NUM >= 70
-+		virtual bool operator==(const BreakIterator& that) const;
-+#else
- 		virtual UBool operator==(const BreakIterator& that) const;
-+#endif
- 
- 		virtual CodePointBreakIterator* clone(void) const;
- 

diff --git a/dev-lang/php/php-7.3.32-r1.ebuild b/dev-lang/php/php-7.3.32-r1.ebuild
deleted file mode 100644
index caea763d84c8..000000000000
--- a/dev-lang/php/php-7.3.32-r1.ebuild
+++ /dev/null
@@ -1,754 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="7"
-
-inherit flag-o-matic systemd autotools
-
-MY_PV=${PV/_rc/RC}
-DESCRIPTION="The PHP language runtime engine"
-HOMEPAGE="https://www.php.net/"
-SRC_URI="https://www.php.net/distributions/${P}.tar.xz"
-
-LICENSE="PHP-3.01
-	BSD
-	Zend-2.0
-	bcmath? ( LGPL-2.1+ )
-	fpm? ( BSD-2 )
-	gd? ( gd )
-	unicode? ( BSD-2 LGPL-2.1 )"
-
-SLOT="$(ver_cut 1-2)"
-KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos"
-
-S="${WORKDIR}/${PN}-${MY_PV}"
-
-# We can build the following SAPIs in the given order
-SAPIS="embed cli cgi fpm apache2 phpdbg"
-
-# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
-IUSE="${IUSE}
-	${SAPIS/cli/+cli}
-	threads"
-
-IUSE="${IUSE} acl argon2 bcmath berkdb bzip2 calendar cdb cjk
-	coverage +ctype curl debug
-	enchant exif +fileinfo +filter firebird
-	+flatfile ftp gd gdbm gmp +hash +iconv imap inifile
-	intl iodbc ipv6 +jit +json kerberos ldap ldap-sasl libedit lmdb
-	mhash mssql mysql mysqli nls
-	oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
-	readline recode selinux +session session-mm sharedmem
-	+simplexml snmp soap sockets sodium spell sqlite ssl
-	sysvipc systemd test tidy +tokenizer tokyocabinet truetype unicode wddx webp
-	+xml xmlreader xmlwriter xmlrpc xpm xslt zip zip-encryption zlib"
-
-# The supported (that is, autodetected) versions of BDB are listed in
-# the ./configure script. Other versions *work*, but we need to stick to
-# the ones that can be detected to avoid a repeat of bug #564824.
-COMMON_DEPEND="
-	>=app-eselect/eselect-php-0.9.1[apache2?,fpm?]
-	>=dev-libs/libpcre2-10.30[jit?,unicode]
-	fpm? ( acl? ( sys-apps/acl ) )
-	apache2? ( www-servers/apache[apache2_modules_unixd(+),threads=] )
-	argon2? ( app-crypt/argon2:= )
-	berkdb? ( || (  sys-libs/db:5.3 sys-libs/db:4.8 ) )
-	bzip2? ( app-arch/bzip2:0= )
-	cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
-	coverage? ( dev-util/lcov )
-	curl? ( >=net-misc/curl-7.10.5 )
-	enchant? ( <app-text/enchant-2.0:0 )
-	firebird? ( dev-db/firebird )
-	gd? ( >=virtual/jpeg-0-r3:0 media-libs/libpng:0= >=sys-libs/zlib-1.2.0.4 )
-	gdbm? ( >=sys-libs/gdbm-1.8.0:0= )
-	gmp? ( dev-libs/gmp:0= )
-	iconv? ( virtual/libiconv )
-	imap? ( >=virtual/imap-c-client-2[kerberos=,ssl=] )
-	intl? ( dev-libs/icu:= )
-	iodbc? ( dev-db/libiodbc )
-	kerberos? ( virtual/krb5 )
-	ldap? ( >=net-nds/openldap-1.2.11:= )
-	ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11:= )
-	libedit? ( dev-libs/libedit )
-	lmdb? ( dev-db/lmdb:= )
-	mssql? ( dev-db/freetds[mssql] )
-	nls? ( sys-devel/gettext )
-	oci8-instant-client? ( dev-db/oracle-instantclient[sdk] )
-	odbc? ( >=dev-db/unixODBC-1.8.13 )
-	postgres? ( dev-db/postgresql:* )
-	qdbm? ( dev-db/qdbm )
-	readline? ( sys-libs/readline:0= )
-	recode? ( app-text/recode:0= )
-	session-mm? ( dev-libs/mm )
-	simplexml? ( >=dev-libs/libxml2-2.6.8 )
-	snmp? ( >=net-analyzer/net-snmp-5.2 )
-	soap? ( >=dev-libs/libxml2-2.6.8 )
-	sodium? ( dev-libs/libsodium:=[-minimal] )
-	spell? ( >=app-text/aspell-0.50 )
-	sqlite? ( >=dev-db/sqlite-3.7.6.3 )
-	ssl? ( >=dev-libs/openssl-1.0.1:0= )
-	tidy? ( app-text/htmltidy )
-	tokyocabinet? ( dev-db/tokyocabinet )
-	truetype? ( =media-libs/freetype-2* )
-	unicode? ( dev-libs/oniguruma:= )
-	wddx? ( >=dev-libs/libxml2-2.6.8 )
-	webp? ( media-libs/libwebp:0= )
-	xml? ( >=dev-libs/libxml2-2.6.8 )
-	xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
-	xmlreader? ( >=dev-libs/libxml2-2.6.8 )
-	xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
-	xpm? ( x11-libs/libXpm )
-	xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
-	zip? ( >=sys-libs/zlib-1.2.0.4:0= )
-	zip-encryption? ( >=dev-libs/libzip-1.2.0:= )
-	zlib? ( >=sys-libs/zlib-1.2.0.4:0= )
-"
-
-RDEPEND="${COMMON_DEPEND}
-	virtual/mta
-	fpm? (
-		selinux? ( sec-policy/selinux-phpfpm )
-		systemd? ( sys-apps/systemd ) )"
-
-# Bison isn't actually needed when building from a release tarball
-# However, the configure script will warn if it's absent or if you
-# have an incompatible version installed. See bug 593278.
-DEPEND="${COMMON_DEPEND}
-	app-arch/xz-utils
-	>=sys-devel/bison-3.0.1"
-
-BDEPEND="virtual/pkgconfig"
-
-# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
-# The Oracle instant client provides its own incompatible ldap library.
-REQUIRED_USE="
-	|| ( cli cgi fpm apache2 embed phpdbg )
-	cli? ( ^^ ( readline libedit ) )
-	truetype? ( gd zlib )
-	webp? ( gd zlib )
-	cjk? ( gd zlib )
-	exif? ( gd zlib )
-	xpm? ( gd zlib )
-	gd? ( zlib )
-	simplexml? ( xml )
-	soap? ( xml )
-	wddx? ( xml )
-	xmlrpc? ( || ( xml iconv ) )
-	xmlreader? ( xml )
-	xslt? ( xml )
-	ldap-sasl? ( ldap )
-	mhash? ( hash )
-	oci8-instant-client? ( !ldap )
-	phar? ( hash )
-	qdbm? ( !gdbm )
-	readline? ( !libedit )
-	recode? ( !imap !mysqli !mysql )
-	session-mm? ( session !threads )
-	mysql? ( || ( mysqli pdo ) )
-	zip-encryption? ( zip )
-"
-
-RESTRICT="!test? ( test )"
-
-PATCHES=(
-	"${FILESDIR}/php-freetype-2.9.1.patch"
-	"${FILESDIR}/php-icu-70.patch"
-)
-
-PHP_MV="$(ver_cut 1)"
-
-php_install_ini() {
-	local phpsapi="${1}"
-
-	# work out where we are installing the ini file
-	php_set_ini_dir "${phpsapi}"
-
-	# Always install the production INI file, bug 611214.
-	local phpinisrc="php.ini-production-${phpsapi}"
-	cp php.ini-production "${phpinisrc}" || die
-
-	# default to /tmp for save_path, bug #282768
-	sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die
-
-	# Set the extension dir
-	sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \
-		-i "${phpinisrc}" || die
-
-	# Set the include path to point to where we want to find PEAR packages
-	sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die
-
-	insinto "${PHP_INI_DIR#${EPREFIX}}"
-	newins "${phpinisrc}" php.ini
-
-	elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}"
-	elog
-
-	dodir "${PHP_EXT_INI_DIR#${EPREFIX}}"
-	dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}"
-
-	if use opcache; then
-		elog "Adding opcache to $PHP_EXT_INI_DIR"
-		echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \
-			 "${D}/${PHP_EXT_INI_DIR}"/opcache.ini
-		dosym "../ext/opcache.ini" \
-			  "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini"
-	fi
-
-	# SAPI-specific handling
-	if [[ "${sapi}" == "fpm" ]] ; then
-		einfo "Installing FPM config files php-fpm.conf and www.conf"
-		insinto "${PHP_INI_DIR#${EPREFIX}}"
-		doins sapi/fpm/php-fpm.conf
-		insinto "${PHP_INI_DIR#${EPREFIX}}/fpm.d"
-		doins sapi/fpm/www.conf
-	fi
-
-	dodoc php.ini-{development,production}
-}
-
-php_set_ini_dir() {
-	PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}"
-	PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
-	PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
-}
-
-src_prepare() {
-	default
-
-	# In php-7.x, the FPM pool configuration files have been split off
-	# of the main config. By default the pool config files go in
-	# e.g. /etc/php-fpm.d, which isn't slotted. So here we move the
-	# include directory to a subdirectory "fpm.d" of $PHP_INI_DIR. Later
-	# we'll install the pool configuration file "www.conf" there.
-	php_set_ini_dir fpm
-	sed -i "s~^include=.*$~include=${PHP_INI_DIR}/fpm.d/*.conf~" \
-		sapi/fpm/php-fpm.conf.in \
-		|| die 'failed to move the include directory in php-fpm.conf'
-
-	# Bug 669566 - necessary so that build tools are updated for commands like pecl
-	# Force rebuilding aclocal.m4
-	rm -f aclocal.m4 || die "failed to remove aclocal.m4 in src_prepare"
-	eautoreconf
-}
-
-src_configure() {
-	addpredict /usr/share/snmp/mibs/.index #nowarn
-	addpredict /var/lib/net-snmp/mib_indexes #nowarn
-
-	PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
-
-	# The php-fpm config file wants localstatedir to be ${EPREFIX}/var
-	# and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002.
-	local our_conf=(
-		--prefix="${PHP_DESTDIR}"
-		--mandir="${PHP_DESTDIR}/man"
-		--infodir="${PHP_DESTDIR}/info"
-		--libdir="${PHP_DESTDIR}/lib"
-		--with-libdir="$(get_libdir)"
-		--localstatedir="${EPREFIX}/var"
-		--without-pear
-		$(use_enable threads maintainer-zts)
-	)
-
-	our_conf+=(
-		$(use_with argon2 password-argon2 "${EPREFIX}/usr")
-		$(use_enable bcmath bcmath)
-		$(use_with bzip2 bz2 "${EPREFIX}/usr")
-		$(use_enable calendar calendar)
-		$(use_enable coverage gcov)
-		$(use_enable ctype ctype)
-		$(use_with curl curl "${EPREFIX}/usr")
-		$(use_enable xml dom)
-		$(use_with enchant enchant "${EPREFIX}/usr")
-		$(use_enable exif exif)
-		$(use_enable fileinfo fileinfo)
-		$(use_enable filter filter)
-		$(use_enable ftp ftp)
-		$(use_with nls gettext "${EPREFIX}/usr")
-		$(use_with gmp gmp "${EPREFIX}/usr")
-		$(use_enable hash hash)
-		$(use_with mhash mhash "${EPREFIX}/usr")
-		$(use_with iconv iconv \
-			$(use elibc_glibc || use elibc_musl || echo "${EPREFIX}/usr"))
-		$(use_enable intl intl)
-		$(use_enable ipv6 ipv6)
-		$(use_enable json json)
-		$(use_with kerberos kerberos "${EPREFIX}/usr")
-		$(use_enable xml libxml)
-		$(use_with xml libxml-dir "${EPREFIX}/usr")
-		$(use_enable unicode mbstring)
-		$(use_with unicode onig "${EPREFIX}/usr")
-		$(use_with ssl openssl "${EPREFIX}/usr")
-		$(use_with ssl openssl-dir "${EPREFIX}/usr")
-		$(use_enable pcntl pcntl)
-		$(use_enable phar phar)
-		$(use_enable pdo pdo)
-		$(use_enable opcache opcache)
-		$(use_with postgres pgsql "${EPREFIX}/usr")
-		$(use_enable posix posix)
-		$(use_with spell pspell "${EPREFIX}/usr")
-		$(use_with recode recode "${EPREFIX}/usr")
-		$(use_enable simplexml simplexml)
-		$(use_enable sharedmem shmop)
-		$(use_with snmp snmp "${EPREFIX}/usr")
-		$(use_enable soap soap)
-		$(use_enable sockets sockets)
-		$(use_with sodium sodium "${EPREFIX}/usr")
-		$(use_with sqlite sqlite3 "${EPREFIX}/usr")
-		$(use_enable sysvipc sysvmsg)
-		$(use_enable sysvipc sysvsem)
-		$(use_enable sysvipc sysvshm)
-		$(use_with tidy tidy "${EPREFIX}/usr")
-		$(use_enable tokenizer tokenizer)
-		$(use_enable wddx wddx)
-		$(use_enable xml xml)
-		$(use_enable xmlreader xmlreader)
-		$(use_enable xmlwriter xmlwriter)
-		$(use_with xmlrpc xmlrpc)
-		$(use_with xslt xsl "${EPREFIX}/usr")
-		$(use_enable zip zip)
-		$(use_with zip-encryption libzip "${EPREFIX}/usr")
-		$(use_with zlib zlib "${EPREFIX}/usr")
-		$(use_enable debug debug)
-	)
-
-	# DBA support
-	if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
-		|| use qdbm || use lmdb || use tokyocabinet ; then
-		our_conf+=( "--enable-dba${shared}" )
-	fi
-
-	# DBA drivers support
-	our_conf+=(
-		$(use_with cdb cdb)
-		$(use_with berkdb db4 "${EPREFIX}/usr")
-		$(use_enable flatfile flatfile)
-		$(use_with gdbm gdbm "${EPREFIX}/usr")
-		$(use_enable inifile inifile)
-		$(use_with qdbm qdbm "${EPREFIX}/usr")
-		$(use_with lmdb lmdb "${EPREFIX}/usr")
-	)
-
-	# Support for the GD graphics library
-	our_conf+=(
-		$(use_with truetype freetype-dir "${EPREFIX}/usr")
-		$(use_enable cjk gd-jis-conv)
-		$(use_with gd jpeg-dir "${EPREFIX}/usr")
-		$(use_with gd png-dir "${EPREFIX}/usr")
-		$(use_with xpm xpm-dir "${EPREFIX}/usr")
-	)
-	if use webp; then
-		our_conf+=( --with-webp-dir="${EPREFIX}/usr" )
-	fi
-	# enable gd last, so configure can pick up the previous settings
-	our_conf+=( $(use_with gd gd) )
-
-	# IMAP support
-	if use imap ; then
-		our_conf+=(
-			$(use_with imap imap "${EPREFIX}/usr")
-			$(use_with ssl imap-ssl "${EPREFIX}/usr")
-		)
-	fi
-
-	# Interbase/firebird support
-	our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") )
-
-	# LDAP support
-	if use ldap ; then
-		our_conf+=(
-			$(use_with ldap ldap "${EPREFIX}/usr")
-			$(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr")
-		)
-	fi
-
-	# MySQL support
-	local mysqllib="mysqlnd"
-	local mysqlilib="mysqlnd"
-
-	our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
-
-	local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock"
-	if use mysql || use mysqli ; then
-		our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") )
-	fi
-
-	# ODBC support
-	our_conf+=(
-		$(use_with odbc unixODBC "${EPREFIX}/usr")
-		$(use_with iodbc iodbc "${EPREFIX}/usr")
-	)
-
-	# Oracle support
-	our_conf+=( $(use_with oci8-instant-client oci8) )
-
-	# PDO support
-	if use pdo ; then
-		our_conf+=(
-			$(use_with mssql pdo-dblib "${EPREFIX}/usr")
-			$(use_with mysql pdo-mysql "${mysqllib}")
-			$(use_with postgres pdo-pgsql)
-			$(use_with sqlite pdo-sqlite "${EPREFIX}/usr")
-			$(use_with firebird pdo-firebird "${EPREFIX}/usr")
-			$(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr")
-			$(use_with oci8-instant-client pdo-oci)
-		)
-	fi
-
-	# readline/libedit support
-	our_conf+=(
-		$(use_with readline readline "${EPREFIX}/usr")
-		$(use_with libedit libedit "${EPREFIX}/usr")
-	)
-
-	# Session support
-	if use session ; then
-		our_conf+=( $(use_with session-mm mm "${EPREFIX}/usr") )
-	else
-		our_conf+=( $(use_enable session session) )
-	fi
-
-	# Use pic for shared modules such as apache2's mod_php
-	our_conf+=( --with-pic )
-
-	# we use the system copy of pcre
-	# --with-pcre-regex affects ext/pcre
-	# --with-pcre-dir affects ext/filter and ext/zip
-	# --with-pcre-valgrind cannot be enabled with system pcre
-	our_conf+=(
-		--with-pcre-regex="${EPREFIX}/usr"
-		--with-pcre-dir="${EPREFIX}/usr"
-		--without-pcre-valgrind
-		$(use_with jit pcre-jit)
-	)
-
-	# Catch CFLAGS problems
-	# Fixes bug #14067.
-	# Changed order to run it in reverse for bug #32022 and #12021.
-	replace-cpu-flags "k6*" "i586"
-
-	# Cache the ./configure test results between SAPIs.
-	our_conf+=( --cache-file="${T}/config.cache" )
-
-	# Support user-passed configuration parameters
-	our_conf+=( ${EXTRA_ECONF:-} )
-
-	# Support the Apache2 extras, they must be set globally for all
-	# SAPIs to work correctly, especially for external PHP extensions
-
-	local one_sapi
-	local sapi
-	mkdir -p "${WORKDIR}/sapis-build" || die
-	for one_sapi in $SAPIS ; do
-		use "${one_sapi}" || continue
-		php_set_ini_dir "${one_sapi}"
-
-		# The BUILD_DIR variable is used to determine where to output
-		# the files that autotools creates. This was all originally
-		# based on the autotools-utils eclass.
-		BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}"
-		cp -a "${S}" "${BUILD_DIR}" || die
-		cd "${BUILD_DIR}" || die
-
-		local sapi_conf=(
-			--with-config-file-path="${PHP_INI_DIR}"
-			--with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}"
-		)
-
-		for sapi in $SAPIS ; do
-			case "$sapi" in
-				cli|cgi|embed|fpm|phpdbg)
-					if [[ "${one_sapi}" == "${sapi}" ]] ; then
-						sapi_conf+=( "--enable-${sapi}" )
-						if [[ "fpm" == "${sapi}" ]] ; then
-							sapi_conf+=(
-								$(use_with acl fpm-acl)
-								$(use_with systemd fpm-systemd)
-							)
-						fi
-					else
-						sapi_conf+=( "--disable-${sapi}" )
-					fi
-					;;
-
-				apache2)
-					if [[ "${one_sapi}" == "${sapi}" ]] ; then
-						sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" )
-					else
-						sapi_conf+=( --without-apxs2 )
-					fi
-					;;
-			esac
-		done
-
-		# Construct the $myeconfargs array by concatenating $our_conf
-		# (the common args) and $sapi_conf (the SAPI-specific args).
-		local myeconfargs=( "${our_conf[@]}" )
-		myeconfargs+=( "${sapi_conf[@]}" )
-
-		pushd "${BUILD_DIR}" > /dev/null || die
-		econf "${myeconfargs[@]}"
-		popd > /dev/null || die
-	done
-}
-
-src_compile() {
-	# snmp seems to run during src_compile, too (bug #324739)
-	addpredict /usr/share/snmp/mibs/.index #nowarn
-	addpredict /var/lib/net-snmp/mib_indexes #nowarn
-
-	local sapi
-	for sapi in ${SAPIS} ; do
-		if use "${sapi}"; then
-			cd "${WORKDIR}/sapis-build/$sapi" || \
-				die "Failed to change dir to ${WORKDIR}/sapis-build/$1"
-			emake
-		fi
-	done
-}
-
-src_install() {
-	# see bug #324739 for what happens when we don't have that
-	addpredict /usr/share/snmp/mibs/.index #nowarn
-
-	# grab the first SAPI that got built and install common files from there
-	local first_sapi="", sapi=""
-	for sapi in $SAPIS ; do
-		if use $sapi ; then
-			first_sapi=$sapi
-			break
-		fi
-	done
-
-	# Makefile forgets to create this before trying to write to it...
-	dodir "${PHP_DESTDIR#${EPREFIX}}/bin"
-
-	# Install php environment (without any sapis)
-	cd "${WORKDIR}/sapis-build/$first_sapi" || die
-	emake INSTALL_ROOT="${D}" \
-		install-build install-headers install-programs
-
-	local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)"
-
-	# Create the directory where we'll put version-specific php scripts
-	keepdir "/usr/share/php${PHP_MV}"
-
-	local file=""
-	local sapi_list=""
-
-	for sapi in ${SAPIS}; do
-		if use "${sapi}" ; then
-			einfo "Installing SAPI: ${sapi}"
-			cd "${WORKDIR}/sapis-build/${sapi}" || die
-
-			if [[ "${sapi}" == "apache2" ]] ; then
-				# We're specifically not using emake install-sapi as libtool
-				# may cause unnecessary relink failures (see bug #351266)
-				insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/"
-				newins ".libs/libphp${PHP_MV}$(get_libname)" \
-					   "libphp${PHP_MV}$(get_libname)"
-				keepdir "/usr/$(get_libdir)/apache2/modules"
-			else
-				# needed each time, php_install_ini would reset it
-				local dest="${PHP_DESTDIR#${EPREFIX}}"
-				into "${dest}"
-				case "$sapi" in
-					cli)
-						source="sapi/cli/php"
-						# Install the "phar" archive utility.
-						if use phar ; then
-							emake INSTALL_ROOT="${D}" install-pharcmd
-							dosym "..${dest#/usr}/bin/phar" "/usr/bin/phar${SLOT}"
-						fi
-						;;
-					cgi)
-						source="sapi/cgi/php-cgi"
-						;;
-					fpm)
-						source="sapi/fpm/php-fpm"
-						;;
-					embed)
-						source="libs/libphp${PHP_MV}$(get_libname)"
-						;;
-					phpdbg)
-						source="sapi/phpdbg/phpdbg"
-						;;
-					*)
-						die "unhandled sapi in src_install"
-						;;
-				esac
-
-				if [[ "${source}" == *"$(get_libname)" ]]; then
-					dolib.so "${source}"
-				else
-					dobin "${source}"
-					local name="$(basename ${source})"
-					dosym "..${dest#/usr}/bin/${name}" "/usr/bin/${name}${SLOT}"
-				fi
-			fi
-
-			php_install_ini "${sapi}"
-
-			# construct correct SAPI string for php-config
-			# thanks to ferringb for the bash voodoo
-			if [[ "${sapi}" == "apache2" ]]; then
-				sapi_list="${sapi_list:+${sapi_list} }apache2handler"
-			else
-				sapi_list="${sapi_list:+${sapi_list} }${sapi}"
-			fi
-		fi
-	done
-
-	# Installing opcache module
-	if use opcache ; then
-		into "${PHP_DESTDIR#${EPREFIX}}"
-		dolib.so "modules/opcache$(get_libname)"
-	fi
-
-	# Install env.d files
-	newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}"
-	sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
-	sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
-
-	# set php-config variable correctly (bug #278439)
-	sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \
-		"${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die
-
-	if use fpm ; then
-		if use systemd; then
-			systemd_newunit "${FILESDIR}/php-fpm_at.service" \
-							"php-fpm@${SLOT}.service"
-		else
-			systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \
-							"php-fpm@${SLOT}.service"
-		fi
-	fi
-}
-
-src_test() {
-	echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
-	PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
-	if [[ ! -x "${PHP_BIN}" ]] ; then
-		ewarn "Test phase requires USE=cli, skipping"
-		return
-	else
-		export TEST_PHP_EXECUTABLE="${PHP_BIN}"
-	fi
-
-	if [[ -x "${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" ]] ; then
-		export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi"
-	fi
-
-	if [[ -x "${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" ]] ; then
-		export TEST_PHPDBG_EXECUTABLE="${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg"
-	fi
-
-	REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n  -d \
-					  "session.save_path=${T}" \
-					  "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \
-					  "session.save_path=${T}"
-
-	for name in ${EXPECTED_TEST_FAILURES}; do
-		mv "${name}.out" "${name}.out.orig" 2>/dev/null || die
-	done
-
-	local failed="$(find -name '*.out')"
-	if [[ ${failed} != "" ]] ; then
-		ewarn "The following test cases failed unexpectedly:"
-		for name in ${failed}; do
-			ewarn "  ${name/.out/}"
-		done
-	else
-		einfo "No unexpected test failures, all fine"
-	fi
-
-	if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
-		local passed=""
-		for name in ${EXPECTED_TEST_FAILURES}; do
-			[[ -f "${name}.diff" ]] && continue
-			passed="${passed} ${name}"
-		done
-		if [[ ${passed} != "" ]] ; then
-			einfo "The following test cases passed unexpectedly:"
-			for name in ${passed}; do
-				ewarn "  ${passed}"
-			done
-		else
-			einfo "None of the known-to-fail tests passed, all fine"
-		fi
-	fi
-}
-
-pkg_postinst() {
-	# Output some general info to the user
-	if use apache2 ; then
-		elog
-		elog "To enable PHP in apache, you will need to add \"-D PHP\" to"
-		elog "your apache2 command. OpenRC users can append that string to"
-		elog "APACHE2_OPTS in /etc/conf.d/apache2."
-		elog
-		elog "The apache module configuration file 70_mod_php.conf is"
-		elog "provided (and maintained) by eselect-php."
-		elog
-	fi
-
-	# Create the symlinks for php
-	local m
-	for m in ${SAPIS}; do
-		[[ ${m} == 'embed' ]] && continue;
-		if use $m ; then
-			local ci=$(eselect php show $m)
-			if [[ -z $ci ]]; then
-				eselect php set $m php${SLOT} || die
-				einfo "Switched ${m} to use php:${SLOT}"
-				einfo
-			elif [[ $ci != "php${SLOT}" ]] ; then
-				elog "To switch $m to use php:${SLOT}, run"
-				elog "    eselect php set $m php${SLOT}"
-				elog
-			fi
-		fi
-	done
-
-	# Remove dead symlinks for SAPIs that were just disabled. For
-	# example, if the user has the cgi SAPI enabled, then he has an
-	# eselect-php symlink for it. If he later reinstalls PHP with
-	# USE="-cgi", that symlink will break. This call to eselect is
-	# supposed to remove that dead link per bug 572436.
-	eselect php cleanup || die
-
-	if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then
-	   elog "To build extensions for this version of PHP, you will need to"
-	   elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable."
-	   elog
-	fi
-
-	# Warn about the removal of PHP_INI_VERSION if the user has it set.
-	if [[ -n "${PHP_INI_VERSION}" ]]; then
-		ewarn 'The PHP_INI_VERSION variable has been phased out. You may'
-		ewarn 'remove it from your configuration at your convenience. See'
-		ewarn
-		ewarn '  https://bugs.gentoo.org/611214'
-		ewarn
-		ewarn 'for more information.'
-	fi
-
-	elog "For details on how version slotting works, please see"
-	elog "the wiki:"
-	elog
-	elog "  https://wiki.gentoo.org/wiki/PHP"
-	elog
-}
-
-pkg_postrm() {
-	# This serves two purposes. First, if we have just removed the last
-	# installed version of PHP, then this will remove any dead symlinks
-	# belonging to eselect-php. Second, if a user upgrades slots from
-	# (say) 5.6 to 7.0 and depcleans the old slot, then this will update
-	# his existing symlinks to point to the new 7.0 installation. The
-	# latter is bug 432962.
-	#
-	# Note: the eselect-php package may not be installed at this point,
-	# so we can't die() if this command fails.
-	eselect php cleanup
-}

diff --git a/dev-lang/php/php-7.3.33-r1.ebuild b/dev-lang/php/php-7.3.33-r1.ebuild
deleted file mode 100644
index baddf8055972..000000000000
--- a/dev-lang/php/php-7.3.33-r1.ebuild
+++ /dev/null
@@ -1,754 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="7"
-
-inherit flag-o-matic systemd autotools
-
-MY_PV=${PV/_rc/RC}
-DESCRIPTION="The PHP language runtime engine"
-HOMEPAGE="https://www.php.net/"
-SRC_URI="https://www.php.net/distributions/${P}.tar.xz"
-
-LICENSE="PHP-3.01
-	BSD
-	Zend-2.0
-	bcmath? ( LGPL-2.1+ )
-	fpm? ( BSD-2 )
-	gd? ( gd )
-	unicode? ( BSD-2 LGPL-2.1 )"
-
-SLOT="$(ver_cut 1-2)"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos"
-
-S="${WORKDIR}/${PN}-${MY_PV}"
-
-# We can build the following SAPIs in the given order
-SAPIS="embed cli cgi fpm apache2 phpdbg"
-
-# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
-IUSE="${IUSE}
-	${SAPIS/cli/+cli}
-	threads"
-
-IUSE="${IUSE} acl argon2 bcmath berkdb bzip2 calendar cdb cjk
-	coverage +ctype curl debug
-	enchant exif +fileinfo +filter firebird
-	+flatfile ftp gd gdbm gmp +hash +iconv imap inifile
-	intl iodbc ipv6 +jit +json kerberos ldap ldap-sasl libedit lmdb
-	mhash mssql mysql mysqli nls
-	oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
-	readline recode selinux +session session-mm sharedmem
-	+simplexml snmp soap sockets sodium spell sqlite ssl
-	sysvipc systemd test tidy +tokenizer tokyocabinet truetype unicode wddx webp
-	+xml xmlreader xmlwriter xmlrpc xpm xslt zip zip-encryption zlib"
-
-# The supported (that is, autodetected) versions of BDB are listed in
-# the ./configure script. Other versions *work*, but we need to stick to
-# the ones that can be detected to avoid a repeat of bug #564824.
-COMMON_DEPEND="
-	>=app-eselect/eselect-php-0.9.1[apache2?,fpm?]
-	>=dev-libs/libpcre2-10.30[jit?,unicode]
-	fpm? ( acl? ( sys-apps/acl ) )
-	apache2? ( www-servers/apache[apache2_modules_unixd(+),threads=] )
-	argon2? ( app-crypt/argon2:= )
-	berkdb? ( || (  sys-libs/db:5.3 sys-libs/db:4.8 ) )
-	bzip2? ( app-arch/bzip2:0= )
-	cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
-	coverage? ( dev-util/lcov )
-	curl? ( >=net-misc/curl-7.10.5 )
-	enchant? ( <app-text/enchant-2.0:0 )
-	firebird? ( dev-db/firebird )
-	gd? ( >=virtual/jpeg-0-r3:0 media-libs/libpng:0= >=sys-libs/zlib-1.2.0.4 )
-	gdbm? ( >=sys-libs/gdbm-1.8.0:0= )
-	gmp? ( dev-libs/gmp:0= )
-	iconv? ( virtual/libiconv )
-	imap? ( >=virtual/imap-c-client-2[kerberos=,ssl=] )
-	intl? ( dev-libs/icu:= )
-	iodbc? ( dev-db/libiodbc )
-	kerberos? ( virtual/krb5 )
-	ldap? ( >=net-nds/openldap-1.2.11:= )
-	ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11:= )
-	libedit? ( dev-libs/libedit )
-	lmdb? ( dev-db/lmdb:= )
-	mssql? ( dev-db/freetds[mssql] )
-	nls? ( sys-devel/gettext )
-	oci8-instant-client? ( dev-db/oracle-instantclient[sdk] )
-	odbc? ( >=dev-db/unixODBC-1.8.13 )
-	postgres? ( dev-db/postgresql:* )
-	qdbm? ( dev-db/qdbm )
-	readline? ( sys-libs/readline:0= )
-	recode? ( app-text/recode:0= )
-	session-mm? ( dev-libs/mm )
-	simplexml? ( >=dev-libs/libxml2-2.6.8 )
-	snmp? ( >=net-analyzer/net-snmp-5.2 )
-	soap? ( >=dev-libs/libxml2-2.6.8 )
-	sodium? ( dev-libs/libsodium:=[-minimal] )
-	spell? ( >=app-text/aspell-0.50 )
-	sqlite? ( >=dev-db/sqlite-3.7.6.3 )
-	ssl? ( >=dev-libs/openssl-1.0.1:0= )
-	tidy? ( app-text/htmltidy )
-	tokyocabinet? ( dev-db/tokyocabinet )
-	truetype? ( =media-libs/freetype-2* )
-	unicode? ( dev-libs/oniguruma:= )
-	wddx? ( >=dev-libs/libxml2-2.6.8 )
-	webp? ( media-libs/libwebp:0= )
-	xml? ( >=dev-libs/libxml2-2.6.8 )
-	xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
-	xmlreader? ( >=dev-libs/libxml2-2.6.8 )
-	xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
-	xpm? ( x11-libs/libXpm )
-	xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
-	zip? ( >=sys-libs/zlib-1.2.0.4:0= )
-	zip-encryption? ( >=dev-libs/libzip-1.2.0:= )
-	zlib? ( >=sys-libs/zlib-1.2.0.4:0= )
-"
-
-RDEPEND="${COMMON_DEPEND}
-	virtual/mta
-	fpm? (
-		selinux? ( sec-policy/selinux-phpfpm )
-		systemd? ( sys-apps/systemd ) )"
-
-# Bison isn't actually needed when building from a release tarball
-# However, the configure script will warn if it's absent or if you
-# have an incompatible version installed. See bug 593278.
-DEPEND="${COMMON_DEPEND}
-	app-arch/xz-utils
-	>=sys-devel/bison-3.0.1"
-
-BDEPEND="virtual/pkgconfig"
-
-# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
-# The Oracle instant client provides its own incompatible ldap library.
-REQUIRED_USE="
-	|| ( cli cgi fpm apache2 embed phpdbg )
-	cli? ( ^^ ( readline libedit ) )
-	truetype? ( gd zlib )
-	webp? ( gd zlib )
-	cjk? ( gd zlib )
-	exif? ( gd zlib )
-	xpm? ( gd zlib )
-	gd? ( zlib )
-	simplexml? ( xml )
-	soap? ( xml )
-	wddx? ( xml )
-	xmlrpc? ( || ( xml iconv ) )
-	xmlreader? ( xml )
-	xslt? ( xml )
-	ldap-sasl? ( ldap )
-	mhash? ( hash )
-	oci8-instant-client? ( !ldap )
-	phar? ( hash )
-	qdbm? ( !gdbm )
-	readline? ( !libedit )
-	recode? ( !imap !mysqli !mysql )
-	session-mm? ( session !threads )
-	mysql? ( || ( mysqli pdo ) )
-	zip-encryption? ( zip )
-"
-
-RESTRICT="!test? ( test )"
-
-PATCHES=(
-	"${FILESDIR}/php-freetype-2.9.1.patch"
-	"${FILESDIR}/php-icu-70.patch"
-)
-
-PHP_MV="$(ver_cut 1)"
-
-php_install_ini() {
-	local phpsapi="${1}"
-
-	# work out where we are installing the ini file
-	php_set_ini_dir "${phpsapi}"
-
-	# Always install the production INI file, bug 611214.
-	local phpinisrc="php.ini-production-${phpsapi}"
-	cp php.ini-production "${phpinisrc}" || die
-
-	# default to /tmp for save_path, bug #282768
-	sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die
-
-	# Set the extension dir
-	sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \
-		-i "${phpinisrc}" || die
-
-	# Set the include path to point to where we want to find PEAR packages
-	sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die
-
-	insinto "${PHP_INI_DIR#${EPREFIX}}"
-	newins "${phpinisrc}" php.ini
-
-	elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}"
-	elog
-
-	dodir "${PHP_EXT_INI_DIR#${EPREFIX}}"
-	dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}"
-
-	if use opcache; then
-		elog "Adding opcache to $PHP_EXT_INI_DIR"
-		echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \
-			 "${D}/${PHP_EXT_INI_DIR}"/opcache.ini
-		dosym "../ext/opcache.ini" \
-			  "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini"
-	fi
-
-	# SAPI-specific handling
-	if [[ "${sapi}" == "fpm" ]] ; then
-		einfo "Installing FPM config files php-fpm.conf and www.conf"
-		insinto "${PHP_INI_DIR#${EPREFIX}}"
-		doins sapi/fpm/php-fpm.conf
-		insinto "${PHP_INI_DIR#${EPREFIX}}/fpm.d"
-		doins sapi/fpm/www.conf
-	fi
-
-	dodoc php.ini-{development,production}
-}
-
-php_set_ini_dir() {
-	PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}"
-	PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
-	PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
-}
-
-src_prepare() {
-	default
-
-	# In php-7.x, the FPM pool configuration files have been split off
-	# of the main config. By default the pool config files go in
-	# e.g. /etc/php-fpm.d, which isn't slotted. So here we move the
-	# include directory to a subdirectory "fpm.d" of $PHP_INI_DIR. Later
-	# we'll install the pool configuration file "www.conf" there.
-	php_set_ini_dir fpm
-	sed -i "s~^include=.*$~include=${PHP_INI_DIR}/fpm.d/*.conf~" \
-		sapi/fpm/php-fpm.conf.in \
-		|| die 'failed to move the include directory in php-fpm.conf'
-
-	# Bug 669566 - necessary so that build tools are updated for commands like pecl
-	# Force rebuilding aclocal.m4
-	rm -f aclocal.m4 || die "failed to remove aclocal.m4 in src_prepare"
-	eautoreconf
-}
-
-src_configure() {
-	addpredict /usr/share/snmp/mibs/.index #nowarn
-	addpredict /var/lib/net-snmp/mib_indexes #nowarn
-
-	PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
-
-	# The php-fpm config file wants localstatedir to be ${EPREFIX}/var
-	# and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002.
-	local our_conf=(
-		--prefix="${PHP_DESTDIR}"
-		--mandir="${PHP_DESTDIR}/man"
-		--infodir="${PHP_DESTDIR}/info"
-		--libdir="${PHP_DESTDIR}/lib"
-		--with-libdir="$(get_libdir)"
-		--localstatedir="${EPREFIX}/var"
-		--without-pear
-		$(use_enable threads maintainer-zts)
-	)
-
-	our_conf+=(
-		$(use_with argon2 password-argon2 "${EPREFIX}/usr")
-		$(use_enable bcmath bcmath)
-		$(use_with bzip2 bz2 "${EPREFIX}/usr")
-		$(use_enable calendar calendar)
-		$(use_enable coverage gcov)
-		$(use_enable ctype ctype)
-		$(use_with curl curl "${EPREFIX}/usr")
-		$(use_enable xml dom)
-		$(use_with enchant enchant "${EPREFIX}/usr")
-		$(use_enable exif exif)
-		$(use_enable fileinfo fileinfo)
-		$(use_enable filter filter)
-		$(use_enable ftp ftp)
-		$(use_with nls gettext "${EPREFIX}/usr")
-		$(use_with gmp gmp "${EPREFIX}/usr")
-		$(use_enable hash hash)
-		$(use_with mhash mhash "${EPREFIX}/usr")
-		$(use_with iconv iconv \
-			$(use elibc_glibc || use elibc_musl || echo "${EPREFIX}/usr"))
-		$(use_enable intl intl)
-		$(use_enable ipv6 ipv6)
-		$(use_enable json json)
-		$(use_with kerberos kerberos "${EPREFIX}/usr")
-		$(use_enable xml libxml)
-		$(use_with xml libxml-dir "${EPREFIX}/usr")
-		$(use_enable unicode mbstring)
-		$(use_with unicode onig "${EPREFIX}/usr")
-		$(use_with ssl openssl "${EPREFIX}/usr")
-		$(use_with ssl openssl-dir "${EPREFIX}/usr")
-		$(use_enable pcntl pcntl)
-		$(use_enable phar phar)
-		$(use_enable pdo pdo)
-		$(use_enable opcache opcache)
-		$(use_with postgres pgsql "${EPREFIX}/usr")
-		$(use_enable posix posix)
-		$(use_with spell pspell "${EPREFIX}/usr")
-		$(use_with recode recode "${EPREFIX}/usr")
-		$(use_enable simplexml simplexml)
-		$(use_enable sharedmem shmop)
-		$(use_with snmp snmp "${EPREFIX}/usr")
-		$(use_enable soap soap)
-		$(use_enable sockets sockets)
-		$(use_with sodium sodium "${EPREFIX}/usr")
-		$(use_with sqlite sqlite3 "${EPREFIX}/usr")
-		$(use_enable sysvipc sysvmsg)
-		$(use_enable sysvipc sysvsem)
-		$(use_enable sysvipc sysvshm)
-		$(use_with tidy tidy "${EPREFIX}/usr")
-		$(use_enable tokenizer tokenizer)
-		$(use_enable wddx wddx)
-		$(use_enable xml xml)
-		$(use_enable xmlreader xmlreader)
-		$(use_enable xmlwriter xmlwriter)
-		$(use_with xmlrpc xmlrpc)
-		$(use_with xslt xsl "${EPREFIX}/usr")
-		$(use_enable zip zip)
-		$(use_with zip-encryption libzip "${EPREFIX}/usr")
-		$(use_with zlib zlib "${EPREFIX}/usr")
-		$(use_enable debug debug)
-	)
-
-	# DBA support
-	if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
-		|| use qdbm || use lmdb || use tokyocabinet ; then
-		our_conf+=( "--enable-dba${shared}" )
-	fi
-
-	# DBA drivers support
-	our_conf+=(
-		$(use_with cdb cdb)
-		$(use_with berkdb db4 "${EPREFIX}/usr")
-		$(use_enable flatfile flatfile)
-		$(use_with gdbm gdbm "${EPREFIX}/usr")
-		$(use_enable inifile inifile)
-		$(use_with qdbm qdbm "${EPREFIX}/usr")
-		$(use_with lmdb lmdb "${EPREFIX}/usr")
-	)
-
-	# Support for the GD graphics library
-	our_conf+=(
-		$(use_with truetype freetype-dir "${EPREFIX}/usr")
-		$(use_enable cjk gd-jis-conv)
-		$(use_with gd jpeg-dir "${EPREFIX}/usr")
-		$(use_with gd png-dir "${EPREFIX}/usr")
-		$(use_with xpm xpm-dir "${EPREFIX}/usr")
-	)
-	if use webp; then
-		our_conf+=( --with-webp-dir="${EPREFIX}/usr" )
-	fi
-	# enable gd last, so configure can pick up the previous settings
-	our_conf+=( $(use_with gd gd) )
-
-	# IMAP support
-	if use imap ; then
-		our_conf+=(
-			$(use_with imap imap "${EPREFIX}/usr")
-			$(use_with ssl imap-ssl "${EPREFIX}/usr")
-		)
-	fi
-
-	# Interbase/firebird support
-	our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") )
-
-	# LDAP support
-	if use ldap ; then
-		our_conf+=(
-			$(use_with ldap ldap "${EPREFIX}/usr")
-			$(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr")
-		)
-	fi
-
-	# MySQL support
-	local mysqllib="mysqlnd"
-	local mysqlilib="mysqlnd"
-
-	our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
-
-	local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock"
-	if use mysql || use mysqli ; then
-		our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") )
-	fi
-
-	# ODBC support
-	our_conf+=(
-		$(use_with odbc unixODBC "${EPREFIX}/usr")
-		$(use_with iodbc iodbc "${EPREFIX}/usr")
-	)
-
-	# Oracle support
-	our_conf+=( $(use_with oci8-instant-client oci8) )
-
-	# PDO support
-	if use pdo ; then
-		our_conf+=(
-			$(use_with mssql pdo-dblib "${EPREFIX}/usr")
-			$(use_with mysql pdo-mysql "${mysqllib}")
-			$(use_with postgres pdo-pgsql)
-			$(use_with sqlite pdo-sqlite "${EPREFIX}/usr")
-			$(use_with firebird pdo-firebird "${EPREFIX}/usr")
-			$(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr")
-			$(use_with oci8-instant-client pdo-oci)
-		)
-	fi
-
-	# readline/libedit support
-	our_conf+=(
-		$(use_with readline readline "${EPREFIX}/usr")
-		$(use_with libedit libedit "${EPREFIX}/usr")
-	)
-
-	# Session support
-	if use session ; then
-		our_conf+=( $(use_with session-mm mm "${EPREFIX}/usr") )
-	else
-		our_conf+=( $(use_enable session session) )
-	fi
-
-	# Use pic for shared modules such as apache2's mod_php
-	our_conf+=( --with-pic )
-
-	# we use the system copy of pcre
-	# --with-pcre-regex affects ext/pcre
-	# --with-pcre-dir affects ext/filter and ext/zip
-	# --with-pcre-valgrind cannot be enabled with system pcre
-	our_conf+=(
-		--with-pcre-regex="${EPREFIX}/usr"
-		--with-pcre-dir="${EPREFIX}/usr"
-		--without-pcre-valgrind
-		$(use_with jit pcre-jit)
-	)
-
-	# Catch CFLAGS problems
-	# Fixes bug #14067.
-	# Changed order to run it in reverse for bug #32022 and #12021.
-	replace-cpu-flags "k6*" "i586"
-
-	# Cache the ./configure test results between SAPIs.
-	our_conf+=( --cache-file="${T}/config.cache" )
-
-	# Support user-passed configuration parameters
-	our_conf+=( ${EXTRA_ECONF:-} )
-
-	# Support the Apache2 extras, they must be set globally for all
-	# SAPIs to work correctly, especially for external PHP extensions
-
-	local one_sapi
-	local sapi
-	mkdir -p "${WORKDIR}/sapis-build" || die
-	for one_sapi in $SAPIS ; do
-		use "${one_sapi}" || continue
-		php_set_ini_dir "${one_sapi}"
-
-		# The BUILD_DIR variable is used to determine where to output
-		# the files that autotools creates. This was all originally
-		# based on the autotools-utils eclass.
-		BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}"
-		cp -a "${S}" "${BUILD_DIR}" || die
-		cd "${BUILD_DIR}" || die
-
-		local sapi_conf=(
-			--with-config-file-path="${PHP_INI_DIR}"
-			--with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}"
-		)
-
-		for sapi in $SAPIS ; do
-			case "$sapi" in
-				cli|cgi|embed|fpm|phpdbg)
-					if [[ "${one_sapi}" == "${sapi}" ]] ; then
-						sapi_conf+=( "--enable-${sapi}" )
-						if [[ "fpm" == "${sapi}" ]] ; then
-							sapi_conf+=(
-								$(use_with acl fpm-acl)
-								$(use_with systemd fpm-systemd)
-							)
-						fi
-					else
-						sapi_conf+=( "--disable-${sapi}" )
-					fi
-					;;
-
-				apache2)
-					if [[ "${one_sapi}" == "${sapi}" ]] ; then
-						sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" )
-					else
-						sapi_conf+=( --without-apxs2 )
-					fi
-					;;
-			esac
-		done
-
-		# Construct the $myeconfargs array by concatenating $our_conf
-		# (the common args) and $sapi_conf (the SAPI-specific args).
-		local myeconfargs=( "${our_conf[@]}" )
-		myeconfargs+=( "${sapi_conf[@]}" )
-
-		pushd "${BUILD_DIR}" > /dev/null || die
-		econf "${myeconfargs[@]}"
-		popd > /dev/null || die
-	done
-}
-
-src_compile() {
-	# snmp seems to run during src_compile, too (bug #324739)
-	addpredict /usr/share/snmp/mibs/.index #nowarn
-	addpredict /var/lib/net-snmp/mib_indexes #nowarn
-
-	local sapi
-	for sapi in ${SAPIS} ; do
-		if use "${sapi}"; then
-			cd "${WORKDIR}/sapis-build/$sapi" || \
-				die "Failed to change dir to ${WORKDIR}/sapis-build/$1"
-			emake
-		fi
-	done
-}
-
-src_install() {
-	# see bug #324739 for what happens when we don't have that
-	addpredict /usr/share/snmp/mibs/.index #nowarn
-
-	# grab the first SAPI that got built and install common files from there
-	local first_sapi="", sapi=""
-	for sapi in $SAPIS ; do
-		if use $sapi ; then
-			first_sapi=$sapi
-			break
-		fi
-	done
-
-	# Makefile forgets to create this before trying to write to it...
-	dodir "${PHP_DESTDIR#${EPREFIX}}/bin"
-
-	# Install php environment (without any sapis)
-	cd "${WORKDIR}/sapis-build/$first_sapi" || die
-	emake INSTALL_ROOT="${D}" \
-		install-build install-headers install-programs
-
-	local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)"
-
-	# Create the directory where we'll put version-specific php scripts
-	keepdir "/usr/share/php${PHP_MV}"
-
-	local file=""
-	local sapi_list=""
-
-	for sapi in ${SAPIS}; do
-		if use "${sapi}" ; then
-			einfo "Installing SAPI: ${sapi}"
-			cd "${WORKDIR}/sapis-build/${sapi}" || die
-
-			if [[ "${sapi}" == "apache2" ]] ; then
-				# We're specifically not using emake install-sapi as libtool
-				# may cause unnecessary relink failures (see bug #351266)
-				insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/"
-				newins ".libs/libphp${PHP_MV}$(get_libname)" \
-					   "libphp${PHP_MV}$(get_libname)"
-				keepdir "/usr/$(get_libdir)/apache2/modules"
-			else
-				# needed each time, php_install_ini would reset it
-				local dest="${PHP_DESTDIR#${EPREFIX}}"
-				into "${dest}"
-				case "$sapi" in
-					cli)
-						source="sapi/cli/php"
-						# Install the "phar" archive utility.
-						if use phar ; then
-							emake INSTALL_ROOT="${D}" install-pharcmd
-							dosym "..${dest#/usr}/bin/phar" "/usr/bin/phar${SLOT}"
-						fi
-						;;
-					cgi)
-						source="sapi/cgi/php-cgi"
-						;;
-					fpm)
-						source="sapi/fpm/php-fpm"
-						;;
-					embed)
-						source="libs/libphp${PHP_MV}$(get_libname)"
-						;;
-					phpdbg)
-						source="sapi/phpdbg/phpdbg"
-						;;
-					*)
-						die "unhandled sapi in src_install"
-						;;
-				esac
-
-				if [[ "${source}" == *"$(get_libname)" ]]; then
-					dolib.so "${source}"
-				else
-					dobin "${source}"
-					local name="$(basename ${source})"
-					dosym "..${dest#/usr}/bin/${name}" "/usr/bin/${name}${SLOT}"
-				fi
-			fi
-
-			php_install_ini "${sapi}"
-
-			# construct correct SAPI string for php-config
-			# thanks to ferringb for the bash voodoo
-			if [[ "${sapi}" == "apache2" ]]; then
-				sapi_list="${sapi_list:+${sapi_list} }apache2handler"
-			else
-				sapi_list="${sapi_list:+${sapi_list} }${sapi}"
-			fi
-		fi
-	done
-
-	# Installing opcache module
-	if use opcache ; then
-		into "${PHP_DESTDIR#${EPREFIX}}"
-		dolib.so "modules/opcache$(get_libname)"
-	fi
-
-	# Install env.d files
-	newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}"
-	sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
-	sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
-
-	# set php-config variable correctly (bug #278439)
-	sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \
-		"${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die
-
-	if use fpm ; then
-		if use systemd; then
-			systemd_newunit "${FILESDIR}/php-fpm_at.service" \
-							"php-fpm@${SLOT}.service"
-		else
-			systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \
-							"php-fpm@${SLOT}.service"
-		fi
-	fi
-}
-
-src_test() {
-	echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
-	PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
-	if [[ ! -x "${PHP_BIN}" ]] ; then
-		ewarn "Test phase requires USE=cli, skipping"
-		return
-	else
-		export TEST_PHP_EXECUTABLE="${PHP_BIN}"
-	fi
-
-	if [[ -x "${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" ]] ; then
-		export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi"
-	fi
-
-	if [[ -x "${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" ]] ; then
-		export TEST_PHPDBG_EXECUTABLE="${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg"
-	fi
-
-	REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n  -d \
-					  "session.save_path=${T}" \
-					  "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \
-					  "session.save_path=${T}"
-
-	for name in ${EXPECTED_TEST_FAILURES}; do
-		mv "${name}.out" "${name}.out.orig" 2>/dev/null || die
-	done
-
-	local failed="$(find -name '*.out')"
-	if [[ ${failed} != "" ]] ; then
-		ewarn "The following test cases failed unexpectedly:"
-		for name in ${failed}; do
-			ewarn "  ${name/.out/}"
-		done
-	else
-		einfo "No unexpected test failures, all fine"
-	fi
-
-	if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
-		local passed=""
-		for name in ${EXPECTED_TEST_FAILURES}; do
-			[[ -f "${name}.diff" ]] && continue
-			passed="${passed} ${name}"
-		done
-		if [[ ${passed} != "" ]] ; then
-			einfo "The following test cases passed unexpectedly:"
-			for name in ${passed}; do
-				ewarn "  ${passed}"
-			done
-		else
-			einfo "None of the known-to-fail tests passed, all fine"
-		fi
-	fi
-}
-
-pkg_postinst() {
-	# Output some general info to the user
-	if use apache2 ; then
-		elog
-		elog "To enable PHP in apache, you will need to add \"-D PHP\" to"
-		elog "your apache2 command. OpenRC users can append that string to"
-		elog "APACHE2_OPTS in /etc/conf.d/apache2."
-		elog
-		elog "The apache module configuration file 70_mod_php.conf is"
-		elog "provided (and maintained) by eselect-php."
-		elog
-	fi
-
-	# Create the symlinks for php
-	local m
-	for m in ${SAPIS}; do
-		[[ ${m} == 'embed' ]] && continue;
-		if use $m ; then
-			local ci=$(eselect php show $m)
-			if [[ -z $ci ]]; then
-				eselect php set $m php${SLOT} || die
-				einfo "Switched ${m} to use php:${SLOT}"
-				einfo
-			elif [[ $ci != "php${SLOT}" ]] ; then
-				elog "To switch $m to use php:${SLOT}, run"
-				elog "    eselect php set $m php${SLOT}"
-				elog
-			fi
-		fi
-	done
-
-	# Remove dead symlinks for SAPIs that were just disabled. For
-	# example, if the user has the cgi SAPI enabled, then he has an
-	# eselect-php symlink for it. If he later reinstalls PHP with
-	# USE="-cgi", that symlink will break. This call to eselect is
-	# supposed to remove that dead link per bug 572436.
-	eselect php cleanup || die
-
-	if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then
-	   elog "To build extensions for this version of PHP, you will need to"
-	   elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable."
-	   elog
-	fi
-
-	# Warn about the removal of PHP_INI_VERSION if the user has it set.
-	if [[ -n "${PHP_INI_VERSION}" ]]; then
-		ewarn 'The PHP_INI_VERSION variable has been phased out. You may'
-		ewarn 'remove it from your configuration at your convenience. See'
-		ewarn
-		ewarn '  https://bugs.gentoo.org/611214'
-		ewarn
-		ewarn 'for more information.'
-	fi
-
-	elog "For details on how version slotting works, please see"
-	elog "the wiki:"
-	elog
-	elog "  https://wiki.gentoo.org/wiki/PHP"
-	elog
-}
-
-pkg_postrm() {
-	# This serves two purposes. First, if we have just removed the last
-	# installed version of PHP, then this will remove any dead symlinks
-	# belonging to eselect-php. Second, if a user upgrades slots from
-	# (say) 5.6 to 7.0 and depcleans the old slot, then this will update
-	# his existing symlinks to point to the new 7.0 installation. The
-	# latter is bug 432962.
-	#
-	# Note: the eselect-php package may not be installed at this point,
-	# so we can't die() if this command fails.
-	eselect php cleanup
-}


^ permalink raw reply related	[flat|nested] 21+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-lang/php/files/, dev-lang/php/
@ 2021-03-25 15:56 Brian Evans
  0 siblings, 0 replies; 21+ messages in thread
From: Brian Evans @ 2021-03-25 15:56 UTC (permalink / raw
  To: gentoo-commits

commit:     c2d94c33c28a931a2c4371fafb335b7e5d84aadb
Author:     Brian Evans <grknight <AT> gentoo <DOT> org>
AuthorDate: Thu Mar 25 15:53:03 2021 +0000
Commit:     Brian Evans <grknight <AT> gentoo <DOT> org>
CommitDate: Thu Mar 25 15:53:03 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c2d94c33

dev-lang/php: Include upstream patch on 8.0 slot for pdo_firebird

This patch eliminates several warnings which are normally harmless.
However, with certain CFLAGS, the linking may fail as can be seen with
the coverage USE.

This is taken from upstream development branch but has not been
backported to the 8.0 branch.

Closes: https://bugs.gentoo.org/778053
Signed-off-by: Brian Evans <grknight <AT> gentoo.org>

 dev-lang/php/files/php80-firebird-warnings.patch | 56 ++++++++++++++++++++++++
 dev-lang/php/php-8.0.3.ebuild                    |  5 ++-
 2 files changed, 60 insertions(+), 1 deletion(-)

diff --git a/dev-lang/php/files/php80-firebird-warnings.patch b/dev-lang/php/files/php80-firebird-warnings.patch
new file mode 100644
index 00000000000..48e38c2135f
--- /dev/null
+++ b/dev-lang/php/files/php80-firebird-warnings.patch
@@ -0,0 +1,56 @@
+From c288b5294bb0e13ad2904a3ec79265f727baaea3 Mon Sep 17 00:00:00 2001
+From: Nikita Popov <nikita.ppv@gmail.com>
+Date: Mon, 14 Dec 2020 10:36:36 +0100
+Subject: [PATCH] Fix compile warnings in PDO Firebird
+
+---
+ ext/pdo_firebird/firebird_driver.c      | 9 +++++----
+ ext/pdo_firebird/php_pdo_firebird_int.h | 3 +--
+ 2 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/ext/pdo_firebird/firebird_driver.c b/ext/pdo_firebird/firebird_driver.c
+index c299907f0fea1..390871cc200c8 100644
+--- a/ext/pdo_firebird/firebird_driver.c
++++ b/ext/pdo_firebird/firebird_driver.c
+@@ -171,10 +171,11 @@ static const char classes_array[] = {
+ 	/* 127     */ 0
+ };
+ 
+-inline char classes(char idx)
++static inline char classes(char idx)
+ {
+-	if (idx > 127) return 0;
+-	return classes_array[idx];
++	unsigned char uidx = (unsigned char) idx;
++	if (uidx > 127) return 0;
++	return classes_array[uidx];
+ }
+ 
+ typedef enum {
+@@ -1085,7 +1086,7 @@ static int pdo_firebird_handle_factory(pdo_dbh_t *dbh, zval *driver_options) /*
+ 		char errmsg[512];
+ 		const ISC_STATUS *s = H->isc_status;
+ 		fb_interpret(errmsg, sizeof(errmsg),&s);
+-		zend_throw_exception_ex(php_pdo_get_exception(), H->isc_status[1], "SQLSTATE[%s] [%d] %s",
++		zend_throw_exception_ex(php_pdo_get_exception(), H->isc_status[1], "SQLSTATE[%s] [%ld] %s",
+ 				"HY000", H->isc_status[1], errmsg);
+ 	}
+ 
+diff --git a/ext/pdo_firebird/php_pdo_firebird_int.h b/ext/pdo_firebird/php_pdo_firebird_int.h
+index 094767fa355d3..70a895b4b9f83 100644
+--- a/ext/pdo_firebird/php_pdo_firebird_int.h
++++ b/ext/pdo_firebird/php_pdo_firebird_int.h
+@@ -34,12 +34,11 @@
+ #define SHORT_MAX (1 << (8*sizeof(short)-1))
+ 
+ #if SIZEOF_ZEND_LONG == 8 && !defined(PHP_WIN32)
+-# define LL_MASK "l"
+ # define LL_LIT(lit) lit ## L
+ #else
+-# define LL_MASK "ll"
+ # define LL_LIT(lit) lit ## LL
+ #endif
++#define LL_MASK "ll"
+ 
+ /* Firebird API has a couple of missing const decls in its API */
+ #define const_cast(s) ((char*)(s))

diff --git a/dev-lang/php/php-8.0.3.ebuild b/dev-lang/php/php-8.0.3.ebuild
index c3b57be91fa..599f1188e1c 100644
--- a/dev-lang/php/php-8.0.3.ebuild
+++ b/dev-lang/php/php-8.0.3.ebuild
@@ -151,7 +151,10 @@ BDEPEND="virtual/pkgconfig"
 
 PHP_MV="$(ver_cut 1)"
 
-PATCHES=( "${FILESDIR}/php-iodbc-header-location.patch" )
+PATCHES=(
+	"${FILESDIR}/php-iodbc-header-location.patch"
+	"${FILESDIR}/php80-firebird-warnings.patch"
+)
 
 php_install_ini() {
 	local phpsapi="${1}"


^ permalink raw reply related	[flat|nested] 21+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-lang/php/files/, dev-lang/php/
@ 2021-02-25 19:23 Brian Evans
  0 siblings, 0 replies; 21+ messages in thread
From: Brian Evans @ 2021-02-25 19:23 UTC (permalink / raw
  To: gentoo-commits

commit:     99ef9ab9765aaa94a90c9bc74275672417a75fbb
Author:     Brian Evans <grknight <AT> gentoo <DOT> org>
AuthorDate: Thu Feb 25 19:14:02 2021 +0000
Commit:     Brian Evans <grknight <AT> gentoo <DOT> org>
CommitDate: Thu Feb 25 19:14:02 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=99ef9ab9

dev-lang/php: Drop end-of-life 7.2 slot

Signed-off-by: Brian Evans <grknight <AT> gentoo.org>

 dev-lang/php/Manifest                              |   1 -
 .../files/php-7.2.13-intl-use-icu-namespace.patch  | 379 ----------
 .../files/php-7.2.34-use-after-free-bug76047.patch | 174 -----
 dev-lang/php/php-7.2.34-r1.ebuild                  | 764 ---------------------
 dev-lang/php/php-7.2.34-r2.ebuild                  | 764 ---------------------
 5 files changed, 2082 deletions(-)

diff --git a/dev-lang/php/Manifest b/dev-lang/php/Manifest
index e4b919001b1..b27a5dce1c2 100644
--- a/dev-lang/php/Manifest
+++ b/dev-lang/php/Manifest
@@ -1,4 +1,3 @@
-DIST php-7.2.34.tar.xz 12309432 BLAKE2B 50522786d39296bc7411931c4f357d53c7a25da264192a6a6e7f7594f3dee108e22974e00a4bdc4d3af269ab63d07b28045ff6b4f4f0c79672ed059882647b93 SHA512 7ecc3de3b5db41ec4ff6a5ce6c7e77dc330753c6f3fd87db4d07d6bb763a0b047e83afeef2251b4c6a5d2ff53fd9f3d7e99d091ef2e2c6ab8f18db7447d8a97d
 DIST php-7.3.25.tar.xz 12136668 BLAKE2B b9bfb1de15a3f02bf5d228a2cf9b307c9eeadaea10cac22d40647db0147f4f93b41858ea4affa0701478dd397f0a87cae4e2f29a378f7c6730fdf7da5c48e0e8 SHA512 30b27deab12cf2544671afbbdaefd4bfea308eeed8e9c2150751c5bc9ece18d981bcc020eace35cbdbe88b45cffba8a1fca718fc4e74c3a7903d8b038015d31e
 DIST php-7.3.26.tar.xz 12138088 BLAKE2B eb0090d1edff251341a9d7668a9a6d9ad2f45f7db902e7a51b133d77b0ac155248643ea2bb5fb68b9ba5f363bfdecf1db58dc41b78e5ae24ad66e4443f7c607e SHA512 36494c7907adf75378bcd2c8e5a4761271307d2b507df09c35b8f1114d189320bc7e73f1b05cb171aa93209dc2c3026256f7826e5563f13b99f1b4dbe9741732
 DIST php-7.3.27.tar.xz 12137924 BLAKE2B f4648fdc2b8903ce1b68221eeb49e7764c5446a3d0d0d93e9cd2d8b4cb08e57229261f6fac4ebf35127e94afd5f157ec8f27659ce463e281784c755a3759481e SHA512 a5c186663d656b473f6165b433077057972b1454013ca0f99831be61bd7b7f1c841b8dae69951fa371f678ea3f0e5410518427ee08cb20611bfc00f263d4d47a

diff --git a/dev-lang/php/files/php-7.2.13-intl-use-icu-namespace.patch b/dev-lang/php/files/php-7.2.13-intl-use-icu-namespace.patch
deleted file mode 100644
index b5d2b473f1a..00000000000
--- a/dev-lang/php/files/php-7.2.13-intl-use-icu-namespace.patch
+++ /dev/null
@@ -1,379 +0,0 @@
-Based on the following upstream commits:
-
-https://github.com/php/php-src/commit/8d35a423838eb462cd39ee535c5d003073cc5f22
-https://github.com/php/php-src/commit/d8200e48857aeaf09f7127751efc5632ef7660a7
-https://github.com/php/php-src/commit/9a8e7b571896f39f83cb000fdb7c466b6d328d52
-
---- a/ext/intl/breakiterator/breakiterator_class.cpp
-+++ b/ext/intl/breakiterator/breakiterator_class.cpp
-@@ -38,6 +38,7 @@ extern "C" {
- }
- 
- using PHP::CodePointBreakIterator;
-+using icu::RuleBasedBreakIterator;
- 
- /* {{{ Global variables */
- zend_class_entry *BreakIterator_ce_ptr;
---- a/ext/intl/breakiterator/breakiterator_class.h
-+++ b/ext/intl/breakiterator/breakiterator_class.h
-@@ -26,6 +26,8 @@
- 
- #ifndef USE_BREAKITERATOR_POINTER
- typedef void BreakIterator;
-+#else
-+using icu::BreakIterator;
- #endif
- 
- typedef struct {
---- a/ext/intl/breakiterator/breakiterator_methods.cpp
-+++ b/ext/intl/breakiterator/breakiterator_methods.cpp
-@@ -32,6 +32,8 @@ extern "C" {
- }
- 
- using PHP::CodePointBreakIterator;
-+using icu::BreakIterator;
-+using icu::Locale;
- 
- U_CFUNC PHP_METHOD(BreakIterator, __construct)
- {
---- a/ext/intl/breakiterator/codepointiterator_internal.cpp
-+++ b/ext/intl/breakiterator/codepointiterator_internal.cpp
-@@ -33,6 +33,8 @@ typedef union {
- 
- using namespace PHP;
- 
-+using icu::UCharCharacterIterator;
-+
- UOBJECT_DEFINE_RTTI_IMPLEMENTATION(CodePointBreakIterator);
- 
- CodePointBreakIterator::CodePointBreakIterator()
---- a/ext/intl/breakiterator/codepointiterator_internal.h
-+++ b/ext/intl/breakiterator/codepointiterator_internal.h
-@@ -18,8 +18,11 @@
- #define CODEPOINTITERATOR_INTERNAL_H
- 
- #include <unicode/brkiter.h>
-+#include <unicode/unistr.h>
- 
--using U_ICU_NAMESPACE::BreakIterator;
-+using icu::BreakIterator;
-+using icu::CharacterIterator;
-+using icu::UnicodeString;
- 
- namespace PHP {
- 
---- a/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp
-+++ b/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp
-@@ -26,6 +26,9 @@ extern "C" {
- #include "../intl_convertcpp.h"
- #include "../intl_common.h"
- 
-+using icu::RuleBasedBreakIterator;
-+using icu::Locale;
-+
- static inline RuleBasedBreakIterator *fetch_rbbi(BreakIterator_object *bio) {
- 	return (RuleBasedBreakIterator*)bio->biter;
- }
---- a/ext/intl/calendar/calendar_class.cpp
-+++ b/ext/intl/calendar/calendar_class.cpp
-@@ -34,6 +34,9 @@ extern "C" {
- #include <assert.h>
- }
- 
-+using icu::GregorianCalendar;
-+using icu::Locale;
-+
- /* {{{ Global variables */
- zend_class_entry *Calendar_ce_ptr;
- zend_class_entry *GregorianCalendar_ce_ptr;
---- a/ext/intl/calendar/calendar_class.h
-+++ b/ext/intl/calendar/calendar_class.h
-@@ -26,6 +26,8 @@
- 
- #ifndef USE_CALENDAR_POINTER
- typedef void Calendar;
-+#else
-+using icu::Calendar;
- #endif
- 
- typedef struct {
---- a/ext/intl/calendar/calendar_methods.cpp
-+++ b/ext/intl/calendar/calendar_methods.cpp
-@@ -40,6 +40,8 @@ extern "C" {
- }
- #include "../common/common_enum.h"
- 
-+using icu::Locale;
-+
- U_CFUNC PHP_METHOD(IntlCalendar, __construct)
- {
- 	zend_throw_exception( NULL,
---- a/ext/intl/calendar/gregoriancalendar_methods.cpp
-+++ b/ext/intl/calendar/gregoriancalendar_methods.cpp
-@@ -23,6 +23,8 @@
- #include <unicode/locid.h>
- #include <unicode/calendar.h>
- #include <unicode/gregocal.h>
-+#include <unicode/ustring.h>
-+
- extern "C" {
- #include "../php_intl.h"
- #include "../intl_common.h"
-@@ -34,6 +36,11 @@ extern "C" {
- #include "zend_exceptions.h"
- }
- 
-+using icu::GregorianCalendar;
-+using icu::Locale;
-+using icu::UnicodeString;
-+using icu::StringPiece;
-+
- static inline GregorianCalendar *fetch_greg(Calendar_object *co) {
- 	return (GregorianCalendar*)co->ucal;
- }
---- a/ext/intl/common/common_date.cpp
-+++ b/ext/intl/common/common_date.cpp
-@@ -27,6 +27,9 @@ extern "C" {
- 
- #include "zend_portability.h"
- 
-+using icu::TimeZone;
-+using icu::UnicodeString;
-+
- /* {{{ timezone_convert_datetimezone
-  *      The timezone in DateTime and DateTimeZone is not unified. */
- U_CFUNC TimeZone *timezone_convert_datetimezone(int type,
---- a/ext/intl/common/common_date.h
-+++ b/ext/intl/common/common_date.h
-@@ -28,6 +28,8 @@ U_CDECL_END
- 
- #include <unicode/timezone.h>
- 
-+using icu::TimeZone;
-+
- U_CFUNC TimeZone *timezone_convert_datetimezone(int type, void *object, int is_datetime, intl_error *outside_error, const char *func);
- U_CFUNC int intl_datetime_decompose(zval *z, double *millis, TimeZone **tz,
- 		intl_error *err, const char *func);
---- a/ext/intl/common/common_enum.h
-+++ b/ext/intl/common/common_enum.h
-@@ -75,6 +75,7 @@ U_CFUNC zval *zoi_with_current_get_current_data(zend_object_iterator *iter);
- U_CFUNC void zoi_with_current_invalidate_current(zend_object_iterator *iter);
- 
- #ifdef __cplusplus
-+using icu::StringEnumeration;
- U_CFUNC void IntlIterator_from_StringEnumeration(StringEnumeration *se, zval *object);
- #endif
- 
---- a/ext/intl/converter/converter.c
-+++ b/ext/intl/converter/converter.c
-@@ -18,6 +18,8 @@
- #include "zend_exceptions.h"
- 
- #include <unicode/utypes.h>
-+#include <unicode/utf8.h>
-+#include <unicode/utf16.h>
- #include <unicode/ucnv.h>
- #include <unicode/ustring.h>
- 
---- a/ext/intl/dateformat/dateformat_format_object.cpp
-+++ b/ext/intl/dateformat/dateformat_format_object.cpp
-@@ -33,6 +33,12 @@ extern "C" {
- #include "../common/common_date.h"
- }
- 
-+using icu::Locale;
-+using icu::DateFormat;
-+using icu::GregorianCalendar;
-+using icu::StringPiece;
-+using icu::SimpleDateFormat;
-+
- static const DateFormat::EStyle valid_styles[] = {
- 		DateFormat::kNone,
- 		DateFormat::kFull,
---- a/ext/intl/dateformat/dateformat_helpers.cpp
-+++ b/ext/intl/dateformat/dateformat_helpers.cpp
-@@ -28,6 +28,8 @@ extern "C" {
- #include "../calendar/calendar_class.h"
- }
- 
-+using icu::GregorianCalendar;
-+
- int datefmt_process_calendar_arg(zval* calendar_zv,
- 								 Locale const& locale,
- 								 const char *func_name,
---- a/ext/intl/dateformat/dateformat_helpers.h
-+++ b/ext/intl/dateformat/dateformat_helpers.h
-@@ -22,11 +22,16 @@
- #endif
- 
- #include <unicode/calendar.h>
-+#include <unicode/datefmt.h>
- 
- extern "C" {
- #include "../php_intl.h"
- }
- 
-+using icu::Locale;
-+using icu::Calendar;
-+using icu::DateFormat;
-+
- int datefmt_process_calendar_arg(zval* calendar_zv,
- 								 Locale const& locale,
- 								 const char *func_name,
---- a/ext/intl/grapheme/grapheme_string.c
-+++ b/ext/intl/grapheme/grapheme_string.c
-@@ -24,6 +24,7 @@
- #include "grapheme_util.h"
- 
- #include <unicode/utypes.h>
-+#include <unicode/utf8.h>
- #include <unicode/ucol.h>
- #include <unicode/ustring.h>
- #include <unicode/ubrk.h>
-@@ -834,10 +835,10 @@ PHP_FUNCTION(grapheme_extract)
- 	pstr = str + start;
- 
- 	/* just in case pstr points in the middle of a character, move forward to the start of the next char */
--	if ( !UTF8_IS_SINGLE(*pstr) && !U8_IS_LEAD(*pstr) ) {
--		char *str_end = str + str_len;
-+	if ( !U8_IS_SINGLE(*pstr) && !U8_IS_LEAD(*pstr) ) {
-+		unsigned char *str_end = str + str_len;
- 
--		while ( !UTF8_IS_SINGLE(*pstr) && !U8_IS_LEAD(*pstr) ) {
-+		while ( !U8_IS_SINGLE(*pstr) && !U8_IS_LEAD(*pstr) ) {
- 			pstr++;
- 			if ( pstr >= str_end ) {
- 				intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
---- a/ext/intl/intl_convertcpp.h
-+++ b/ext/intl/intl_convertcpp.h
-@@ -26,6 +26,8 @@
- #include <unicode/unistr.h>
- #include <zend_types.h>
- 
-+using icu::UnicodeString;
-+
- int intl_stringFromChar(UnicodeString &ret, char *str, size_t str_len, UErrorCode *status);
- 
- zend_string* intl_charFromString(const UnicodeString &from, UErrorCode *status);
---- a/ext/intl/msgformat/msgformat_helpers.cpp
-+++ b/ext/intl/msgformat/msgformat_helpers.cpp
-@@ -78,6 +78,16 @@ MessageFormatAdapter::getMessagePattern(MessageFormat* m) {
- #endif
- U_NAMESPACE_END
- 
-+using icu::Formattable;
-+using icu::Format;
-+using icu::DateFormat;
-+using icu::MessageFormat;
-+#ifdef HAS_MESSAGE_PATTERN
-+using icu::MessagePattern;
-+#endif
-+using icu::MessageFormatAdapter;
-+using icu::FieldPosition;
-+
- U_CFUNC int32_t umsg_format_arg_count(UMessageFormat *fmt)
- {
- 	int32_t fmt_count = 0;
-@@ -229,15 +239,16 @@ static HashTable *umsg_parse_format(MessageFormatter_object *mfo,
- 					UnicodeString typeString = mp.getSubstring(type_part);
- 					/* This is all based on the rules in the docs for MessageFormat
- 					 * @see http://icu-project.org/apiref/icu4c/classMessageFormat.html */
--					if (typeString == "number") {
-+#define ASCII_LITERAL(s) UNICODE_STRING(s, sizeof(s)-1)
-+					if (typeString == ASCII_LITERAL("number")) {
- 						MessagePattern::Part style_part = mp.getPart(i + 1); /* Not advancing i */
- 						if (style_part.getType() == UMSGPAT_PART_TYPE_ARG_STYLE) {
- 							UnicodeString styleString = mp.getSubstring(style_part);
--							if (styleString == "integer") {
-+							if (styleString == ASCII_LITERAL("integer")) {
- 								type = Formattable::kInt64;
--							} else if (styleString == "currency") {
-+							} else if (styleString == ASCII_LITERAL("currency")) {
- 								type = Formattable::kDouble;
--							} else if (styleString == "percent") {
-+							} else if (styleString == ASCII_LITERAL("percent")) {
- 								type = Formattable::kDouble;
- 							} else { /* some style invalid/unknown to us */
- 								type = Formattable::kDouble;
-@@ -245,12 +256,13 @@ static HashTable *umsg_parse_format(MessageFormatter_object *mfo,
- 						} else { // if missing style, part, make it a double
- 							type = Formattable::kDouble;
- 						}
--					} else if ((typeString == "date") || (typeString == "time")) {
-+					} else if ((typeString == ASCII_LITERAL("date")) || (typeString == ASCII_LITERAL("time"))) {
- 						type = Formattable::kDate;
--					} else if ((typeString == "spellout") || (typeString == "ordinal")
--							|| (typeString == "duration")) {
-+					} else if ((typeString == ASCII_LITERAL("spellout")) || (typeString == ASCII_LITERAL("ordinal"))
-+							|| (typeString == ASCII_LITERAL("duration"))) {
- 						type = Formattable::kDouble;
- 					}
-+#undef ASCII_LITERAL
- 				} else {
- 					/* If there's no UMSGPAT_PART_TYPE_ARG_TYPE right after a
- 					 * UMSGPAT_ARG_TYPE_SIMPLE argument, then the pattern
---- a/ext/intl/normalizer/normalizer_normalize.c
-+++ b/ext/intl/normalizer/normalizer_normalize.c
-@@ -24,6 +24,7 @@
- #include "normalizer_class.h"
- #include "normalizer_normalize.h"
- #include "intl_convert.h"
-+#include <unicode/utf8.h>
- 
- /* {{{ proto string Normalizer::normalize( string $input [, string $form = FORM_C] )
-  * Normalize a string. }}} */
---- a/ext/intl/timezone/timezone_class.cpp
-+++ b/ext/intl/timezone/timezone_class.cpp
-@@ -37,6 +37,8 @@ extern "C" {
- #include <ext/date/php_date.h>
- }
- 
-+using icu::Calendar;
-+
- /* {{{ Global variables */
- U_CDECL_BEGIN
- zend_class_entry *TimeZone_ce_ptr = NULL;
---- a/ext/intl/timezone/timezone_class.h
-+++ b/ext/intl/timezone/timezone_class.h
-@@ -29,6 +29,8 @@
- 
- #ifndef USE_TIMEZONE_POINTER
- typedef void TimeZone;
-+#else
-+using icu::TimeZone;
- #endif
- 
- typedef struct {
---- a/ext/intl/timezone/timezone_methods.cpp
-+++ b/ext/intl/timezone/timezone_methods.cpp
-@@ -23,6 +23,7 @@
- #include <unicode/locid.h>
- #include <unicode/timezone.h>
- #include <unicode/ustring.h>
-+#include <unicode/calendar.h>
- #include "intl_convertcpp.h"
- 
- #include "../common/common_date.h"
-@@ -37,6 +38,9 @@ extern "C" {
- }
- #include "common/common_enum.h"
- 
-+using icu::Locale;
-+using icu::Calendar;
-+
- U_CFUNC PHP_METHOD(IntlTimeZone, __construct)
- {
- 	zend_throw_exception( NULL,
---- a/ext/intl/uchar/uchar.c
-+++ b/ext/intl/uchar/uchar.c
-@@ -3,6 +3,7 @@
- #include "intl_convert.h"
- 
- #include <unicode/uchar.h>
-+#include <unicode/utf8.h>
- 
- #define IC_METHOD(mname) PHP_METHOD(IntlChar, mname)
- 
--- 
-2.19.2
-

diff --git a/dev-lang/php/files/php-7.2.34-use-after-free-bug76047.patch b/dev-lang/php/files/php-7.2.34-use-after-free-bug76047.patch
deleted file mode 100644
index b3a864ee82a..00000000000
--- a/dev-lang/php/files/php-7.2.34-use-after-free-bug76047.patch
+++ /dev/null
@@ -1,174 +0,0 @@
-Backport of https://git.php.net/?p=php-src.git;a=commit;h=ef1e4891b47949c8dc0f9482eef9454a0ecdfa1d
-
---- a/Zend/tests/bug52361.phpt
-+++ b/Zend/tests/bug52361.phpt
-@@ -25,9 +25,8 @@ try {
- --EXPECTF--
- 1. Exception: aaa in %sbug52361.php:5
- Stack trace:
--#0 %sbug52361.php(13): aaa->__destruct()
--#1 %sbug52361.php(16): bbb()
--#2 {main}
-+#0 %sbug52361.php(16): aaa->__destruct()
-+#1 {main}
- 2. Exception: bbb in %sbug52361.php:13
- Stack trace:
- #0 %sbug52361.php(16): bbb()
---- /dev/null
-+++ b/Zend/tests/bug76047.phpt
-@@ -0,0 +1,68 @@
-+--TEST--
-+Bug #76047: Use-after-free when accessing already destructed backtrace arguments
-+--FILE--
-+<?php
-+
-+class Vuln {
-+    public $a;
-+    public function __destruct() {
-+        unset($this->a);
-+        $backtrace = (new Exception)->getTrace();
-+        var_dump($backtrace);
-+    }
-+}
-+
-+function test($arg) {
-+    $arg = str_shuffle(str_repeat('A', 79));
-+    $vuln = new Vuln();
-+    $vuln->a = $arg;
-+}
-+
-+function test2($arg) {
-+    $$arg = 1; // Trigger symbol table
-+    $arg = str_shuffle(str_repeat('A', 79));
-+    $vuln = new Vuln();
-+    $vuln->a = $arg;
-+}
-+
-+test('x');
-+test2('x');
-+
-+?>
-+--EXPECTF--
-+array(1) {
-+  [0]=>
-+  array(6) {
-+    ["file"]=>
-+    string(%d) "%s"
-+    ["line"]=>
-+    int(%d)
-+    ["function"]=>
-+    string(10) "__destruct"
-+    ["class"]=>
-+    string(4) "Vuln"
-+    ["type"]=>
-+    string(2) "->"
-+    ["args"]=>
-+    array(0) {
-+    }
-+  }
-+}
-+array(1) {
-+  [0]=>
-+  array(6) {
-+    ["file"]=>
-+    string(%d) "%s"
-+    ["line"]=>
-+    int(%d)
-+    ["function"]=>
-+    string(10) "__destruct"
-+    ["class"]=>
-+    string(4) "Vuln"
-+    ["type"]=>
-+    string(2) "->"
-+    ["args"]=>
-+    array(0) {
-+    }
-+  }
-+}
---- a/Zend/zend_vm_def.h
-+++ b/Zend/zend_vm_def.h
-@@ -2366,9 +2366,9 @@ ZEND_VM_HELPER(zend_leave_helper, ANY, ANY)
- 	uint32_t call_info = EX_CALL_INFO();
- 
- 	if (EXPECTED((call_info & (ZEND_CALL_CODE|ZEND_CALL_TOP|ZEND_CALL_HAS_SYMBOL_TABLE|ZEND_CALL_FREE_EXTRA_ARGS|ZEND_CALL_ALLOCATED)) == 0)) {
-+		EG(current_execute_data) = EX(prev_execute_data);
- 		i_free_compiled_variables(execute_data);
- 
--		EG(current_execute_data) = EX(prev_execute_data);
- 		if (UNEXPECTED(call_info & ZEND_CALL_RELEASE_THIS)) {
- 			zend_object *object = Z_OBJ(execute_data->This);
- #if 0
-@@ -2394,12 +2394,12 @@ ZEND_VM_HELPER(zend_leave_helper, ANY, ANY)
- 		LOAD_NEXT_OPLINE();
- 		ZEND_VM_LEAVE();
- 	} else if (EXPECTED((call_info & (ZEND_CALL_CODE|ZEND_CALL_TOP)) == 0)) {
-+		EG(current_execute_data) = EX(prev_execute_data);
- 		i_free_compiled_variables(execute_data);
- 
- 		if (UNEXPECTED(call_info & ZEND_CALL_HAS_SYMBOL_TABLE)) {
- 			zend_clean_and_cache_symbol_table(EX(symbol_table));
- 		}
--		EG(current_execute_data) = EX(prev_execute_data);
- 
- 		/* Free extra args before releasing the closure,
- 		 * as that may free the op_array. */
-@@ -2449,6 +2449,7 @@ ZEND_VM_HELPER(zend_leave_helper, ANY, ANY)
- 		ZEND_VM_LEAVE();
- 	} else {
- 		if (EXPECTED((call_info & ZEND_CALL_CODE) == 0)) {
-+			EG(current_execute_data) = EX(prev_execute_data);
- 			i_free_compiled_variables(execute_data);
- 			if (UNEXPECTED(call_info & (ZEND_CALL_HAS_SYMBOL_TABLE|ZEND_CALL_FREE_EXTRA_ARGS))) {
- 				if (UNEXPECTED(call_info & ZEND_CALL_HAS_SYMBOL_TABLE)) {
-@@ -2456,7 +2457,6 @@ ZEND_VM_HELPER(zend_leave_helper, ANY, ANY)
- 				}
- 				zend_vm_stack_free_extra_args_ex(call_info, execute_data);
- 			}
--			EG(current_execute_data) = EX(prev_execute_data);
- 			if (UNEXPECTED(call_info & ZEND_CALL_CLOSURE)) {
- 				OBJ_RELEASE((zend_object*)EX(func)->op_array.prototype);
- 			}
---- a/Zend/zend_vm_execute.h
-+++ b/Zend/zend_vm_execute.h
-@@ -434,9 +434,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_leave_helper_SPEC(ZEND_OPCODE_
- 	uint32_t call_info = EX_CALL_INFO();
- 
- 	if (EXPECTED((call_info & (ZEND_CALL_CODE|ZEND_CALL_TOP|ZEND_CALL_HAS_SYMBOL_TABLE|ZEND_CALL_FREE_EXTRA_ARGS|ZEND_CALL_ALLOCATED)) == 0)) {
-+		EG(current_execute_data) = EX(prev_execute_data);
- 		i_free_compiled_variables(execute_data);
- 
--		EG(current_execute_data) = EX(prev_execute_data);
- 		if (UNEXPECTED(call_info & ZEND_CALL_RELEASE_THIS)) {
- 			zend_object *object = Z_OBJ(execute_data->This);
- #if 0
-@@ -462,12 +462,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_leave_helper_SPEC(ZEND_OPCODE_
- 		LOAD_NEXT_OPLINE();
- 		ZEND_VM_LEAVE();
- 	} else if (EXPECTED((call_info & (ZEND_CALL_CODE|ZEND_CALL_TOP)) == 0)) {
-+		EG(current_execute_data) = EX(prev_execute_data);
- 		i_free_compiled_variables(execute_data);
- 
- 		if (UNEXPECTED(call_info & ZEND_CALL_HAS_SYMBOL_TABLE)) {
- 			zend_clean_and_cache_symbol_table(EX(symbol_table));
- 		}
--		EG(current_execute_data) = EX(prev_execute_data);
- 
- 		/* Free extra args before releasing the closure,
- 		 * as that may free the op_array. */
-@@ -517,6 +517,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_leave_helper_SPEC(ZEND_OPCODE_
- 		ZEND_VM_LEAVE();
- 	} else {
- 		if (EXPECTED((call_info & ZEND_CALL_CODE) == 0)) {
-+			EG(current_execute_data) = EX(prev_execute_data);
- 			i_free_compiled_variables(execute_data);
- 			if (UNEXPECTED(call_info & (ZEND_CALL_HAS_SYMBOL_TABLE|ZEND_CALL_FREE_EXTRA_ARGS))) {
- 				if (UNEXPECTED(call_info & ZEND_CALL_HAS_SYMBOL_TABLE)) {
-@@ -524,7 +525,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_leave_helper_SPEC(ZEND_OPCODE_
- 				}
- 				zend_vm_stack_free_extra_args_ex(call_info, execute_data);
- 			}
--			EG(current_execute_data) = EX(prev_execute_data);
- 			if (UNEXPECTED(call_info & ZEND_CALL_CLOSURE)) {
- 				OBJ_RELEASE((zend_object*)EX(func)->op_array.prototype);
- 			}
- 

diff --git a/dev-lang/php/php-7.2.34-r1.ebuild b/dev-lang/php/php-7.2.34-r1.ebuild
deleted file mode 100644
index 331c786bb1a..00000000000
--- a/dev-lang/php/php-7.2.34-r1.ebuild
+++ /dev/null
@@ -1,764 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="7"
-
-inherit flag-o-matic systemd autotools toolchain-funcs
-
-DESCRIPTION="The PHP language runtime engine"
-HOMEPAGE="https://www.php.net/"
-SRC_URI="https://www.php.net/distributions/${P}.tar.xz"
-
-LICENSE="PHP-3.01
-	BSD
-	Zend-2.0
-	bcmath? ( LGPL-2.1+ )
-	fpm? ( BSD-2 )
-	gd? ( gd )
-	unicode? ( BSD-2 LGPL-2.1 )"
-
-SLOT="$(ver_cut 1-2)"
-KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos"
-
-# We can build the following SAPIs in the given order
-SAPIS="embed cli cgi fpm apache2 phpdbg"
-
-# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
-IUSE="${IUSE}
-	${SAPIS/cli/+cli}
-	threads"
-
-IUSE="${IUSE} acl argon2 bcmath berkdb bzip2 calendar cdb cjk
-	coverage +ctype curl debug
-	enchant exif +fileinfo +filter firebird
-	+flatfile ftp gd gdbm gmp +hash +iconv imap inifile
-	intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl lmdb
-	mhash mssql mysql mysqli nls
-	oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
-	readline recode selinux +session session-mm sharedmem
-	+simplexml snmp soap sockets sodium spell sqlite ssl
-	sysvipc systemd test tidy +tokenizer tokyocabinet truetype unicode wddx webp
-	+xml xmlreader xmlwriter xmlrpc xpm xslt zip zip-encryption zlib"
-
-# The supported (that is, autodetected) versions of BDB are listed in
-# the ./configure script. Other versions *work*, but we need to stick to
-# the ones that can be detected to avoid a repeat of bug #564824.
-COMMON_DEPEND="
-	>=app-eselect/eselect-php-0.9.1[apache2?,fpm?]
-	>=dev-libs/libpcre-8.32[unicode]
-	fpm? ( acl? ( sys-apps/acl ) )
-	apache2? ( www-servers/apache[apache2_modules_unixd(+),threads=] )
-	argon2? ( app-crypt/argon2:= )
-	berkdb? ( || (	sys-libs/db:5.3
-					sys-libs/db:5.1
-					sys-libs/db:4.8
-					sys-libs/db:4.7
-					sys-libs/db:4.6
-					sys-libs/db:4.5 ) )
-	bzip2? ( app-arch/bzip2:0= )
-	cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
-	coverage? ( dev-util/lcov )
-	curl? ( >=net-misc/curl-7.10.5 )
-	enchant? ( <app-text/enchant-2.0:0 )
-	firebird? ( dev-db/firebird )
-	gd? ( >=virtual/jpeg-0-r3:0 media-libs/libpng:0= sys-libs/zlib )
-	gdbm? ( >=sys-libs/gdbm-1.8.0:0= )
-	gmp? ( dev-libs/gmp:0= )
-	iconv? ( virtual/libiconv )
-	imap? ( >=virtual/imap-c-client-2[kerberos=,ssl=] )
-	intl? ( dev-libs/icu:= )
-	iodbc? ( dev-db/libiodbc )
-	kerberos? ( virtual/krb5 )
-	ldap? ( >=net-nds/openldap-1.2.11 )
-	ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 )
-	libedit? ( dev-libs/libedit )
-	lmdb? ( dev-db/lmdb:= )
-	mssql? ( dev-db/freetds[mssql] )
-	nls? ( sys-devel/gettext )
-	oci8-instant-client? ( dev-db/oracle-instantclient-basic )
-	odbc? ( >=dev-db/unixODBC-1.8.13 )
-	postgres? ( dev-db/postgresql:* )
-	qdbm? ( dev-db/qdbm )
-	readline? ( sys-libs/readline:0= )
-	recode? ( app-text/recode )
-	session-mm? ( dev-libs/mm )
-	simplexml? ( >=dev-libs/libxml2-2.6.8 )
-	snmp? ( >=net-analyzer/net-snmp-5.2 )
-	soap? ( >=dev-libs/libxml2-2.6.8 )
-	sodium? ( dev-libs/libsodium:= )
-	spell? ( >=app-text/aspell-0.50 )
-	sqlite? ( >=dev-db/sqlite-3.7.6.3 )
-	ssl? (
-		!libressl? ( dev-libs/openssl:0= )
-		libressl? ( dev-libs/libressl:0= )
-	)
-	tidy? ( || ( app-text/tidy-html5 app-text/htmltidy ) )
-	tokyocabinet? ( dev-db/tokyocabinet )
-	truetype? ( =media-libs/freetype-2* )
-	unicode? ( dev-libs/oniguruma:= )
-	wddx? ( >=dev-libs/libxml2-2.6.8 )
-	webp? ( media-libs/libwebp:0= )
-	xml? ( >=dev-libs/libxml2-2.6.8 )
-	xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
-	xmlreader? ( >=dev-libs/libxml2-2.6.8 )
-	xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
-	xpm? ( x11-libs/libXpm )
-	xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
-	zip? ( sys-libs/zlib:0= )
-	zip-encryption? ( >=dev-libs/libzip-1.2.0:= )
-	zlib? ( sys-libs/zlib:0= )
-"
-
-RDEPEND="${COMMON_DEPEND}
-	virtual/mta
-	fpm? (
-		selinux? ( sec-policy/selinux-phpfpm )
-		systemd? ( sys-apps/systemd ) )"
-
-# Bison isn't actually needed when building from a release tarball
-# However, the configure script will warn if it's absent or if you
-# have an incompatible version installed. See bug 593278.
-DEPEND="${COMMON_DEPEND}
-	app-arch/xz-utils
-	>=sys-devel/bison-3.0.1"
-
-BDEPEND="virtual/pkgconfig"
-
-# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
-REQUIRED_USE="
-	|| ( cli cgi fpm apache2 embed phpdbg )
-	cli? ( ^^ ( readline libedit ) )
-	truetype? ( gd zlib )
-	webp? ( gd zlib )
-	cjk? ( gd zlib )
-	exif? ( gd zlib )
-	xpm? ( gd zlib )
-	gd? ( zlib )
-	simplexml? ( xml )
-	soap? ( xml )
-	wddx? ( xml )
-	xmlrpc? ( || ( xml iconv ) )
-	xmlreader? ( xml )
-	xslt? ( xml )
-	ldap-sasl? ( ldap )
-	mhash? ( hash )
-	phar? ( hash )
-	qdbm? ( !gdbm )
-	readline? ( !libedit )
-	recode? ( !imap !mysqli !mysql )
-	session-mm? ( session !threads )
-	mysql? ( hash || ( mysqli pdo ) )
-	mysqli? ( hash )
-	zip-encryption? ( zip )
-"
-
-RESTRICT="!test? ( test )"
-
-PATCHES=(
-	"${FILESDIR}/php-freetype-2.9.1.patch"
-	"${FILESDIR}/php-7.2.13-intl-use-icu-namespace.patch"
-	"${FILESDIR}/php-7.2.34-use-after-free-bug76047.patch"
-)
-
-PHP_MV="$(ver_cut 1)"
-
-php_install_ini() {
-	local phpsapi="${1}"
-
-	# work out where we are installing the ini file
-	php_set_ini_dir "${phpsapi}"
-
-	# Always install the production INI file, bug 611214.
-	local phpinisrc="php.ini-production-${phpsapi}"
-	cp php.ini-production "${phpinisrc}" || die
-
-	# default to /tmp for save_path, bug #282768
-	sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die
-
-	# Set the extension dir
-	sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \
-		-i "${phpinisrc}" || die
-
-	# Set the include path to point to where we want to find PEAR packages
-	sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die
-
-	insinto "${PHP_INI_DIR#${EPREFIX}}"
-	newins "${phpinisrc}" php.ini
-
-	elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}"
-	elog
-
-	dodir "${PHP_EXT_INI_DIR#${EPREFIX}}"
-	dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}"
-
-	if use opcache; then
-		elog "Adding opcache to $PHP_EXT_INI_DIR"
-		echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \
-			 "${D}/${PHP_EXT_INI_DIR}"/opcache.ini
-		dosym "../ext/opcache.ini" \
-			  "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini"
-	fi
-
-	# SAPI-specific handling
-	if [[ "${sapi}" == "fpm" ]] ; then
-		einfo "Installing FPM config files php-fpm.conf and www.conf"
-		insinto "${PHP_INI_DIR#${EPREFIX}}"
-		doins sapi/fpm/php-fpm.conf
-		insinto "${PHP_INI_DIR#${EPREFIX}}/fpm.d"
-		doins sapi/fpm/www.conf
-	fi
-
-	dodoc php.ini-{development,production}
-}
-
-php_set_ini_dir() {
-	PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}"
-	PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
-	PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
-}
-
-src_prepare() {
-	default
-
-	# In php-7.x, the FPM pool configuration files have been split off
-	# of the main config. By default the pool config files go in
-	# e.g. /etc/php-fpm.d, which isn't slotted. So here we move the
-	# include directory to a subdirectory "fpm.d" of $PHP_INI_DIR. Later
-	# we'll install the pool configuration file "www.conf" there.
-	php_set_ini_dir fpm
-	sed -i "s~^include=.*$~include=${PHP_INI_DIR}/fpm.d/*.conf~" \
-		sapi/fpm/php-fpm.conf.in \
-		|| die 'failed to move the include directory in php-fpm.conf'
-
-	# Bug 669566 - necessary so that build tools are updated for commands like pecl
-	# Force rebuilding aclocal.m4
-	rm -f aclocal.m4 || die "failed to remove aclocal.m4 in src_prepare"
-	eautoreconf
-}
-
-src_configure() {
-	addpredict /usr/share/snmp/mibs/.index #nowarn
-	addpredict /var/lib/net-snmp/mib_indexes #nowarn
-
-	# Fix building against >=ICU-68, https://bugs.php.net/80310
-	append-cflags -DU_DEFINE_FALSE_AND_TRUE=1
-	append-cxxflags -DU_DEFINE_FALSE_AND_TRUE=1
-
-	PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
-
-	# The php-fpm config file wants localstatedir to be ${EPREFIX}/var
-	# and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002.
-	local our_conf=(
-		--prefix="${PHP_DESTDIR}"
-		--mandir="${PHP_DESTDIR}/man"
-		--infodir="${PHP_DESTDIR}/info"
-		--libdir="${PHP_DESTDIR}/lib"
-		--with-libdir="$(get_libdir)"
-		--localstatedir="${EPREFIX}/var"
-		--without-pear
-		$(use_enable threads maintainer-zts)
-	)
-
-	our_conf+=(
-		$(use_with argon2 password-argon2 "${EPREFIX}/usr")
-		$(use_enable bcmath bcmath)
-		$(use_with bzip2 bz2 "${EPREFIX}/usr")
-		$(use_enable calendar calendar)
-		$(use_enable coverage gcov)
-		$(use_enable ctype ctype)
-		$(use_with curl curl "${EPREFIX}/usr")
-		$(use_enable xml dom)
-		$(use_with enchant enchant "${EPREFIX}/usr")
-		$(use_enable exif exif)
-		$(use_enable fileinfo fileinfo)
-		$(use_enable filter filter)
-		$(use_enable ftp ftp)
-		$(use_with nls gettext "${EPREFIX}/usr")
-		$(use_with gmp gmp "${EPREFIX}/usr")
-		$(use_enable hash hash)
-		$(use_with mhash mhash "${EPREFIX}/usr")
-		$(use_with iconv iconv \
-			$(use elibc_glibc || use elibc_musl || use elibc_FreeBSD || echo "${EPREFIX}/usr"))
-		$(use_enable intl intl)
-		$(use_enable ipv6 ipv6)
-		$(use_enable json json)
-		$(use_with kerberos kerberos "${EPREFIX}/usr")
-		$(use_enable xml libxml)
-		$(use_with xml libxml-dir "${EPREFIX}/usr")
-		$(use_enable unicode mbstring)
-		$(use_with unicode onig "${EPREFIX}/usr")
-		$(use_with ssl openssl "${EPREFIX}/usr")
-		$(use_with ssl openssl-dir "${EPREFIX}/usr")
-		$(use_enable pcntl pcntl)
-		$(use_enable phar phar)
-		$(use_enable pdo pdo)
-		$(use_enable opcache opcache)
-		$(use_with postgres pgsql "${EPREFIX}/usr")
-		$(use_enable posix posix)
-		$(use_with spell pspell "${EPREFIX}/usr")
-		$(use_with recode recode "${EPREFIX}/usr")
-		$(use_enable simplexml simplexml)
-		$(use_enable sharedmem shmop)
-		$(use_with snmp snmp "${EPREFIX}/usr")
-		$(use_enable soap soap)
-		$(use_enable sockets sockets)
-		$(use_with sodium sodium "${EPREFIX}/usr")
-		$(use_with sqlite sqlite3 "${EPREFIX}/usr")
-		$(use_enable sysvipc sysvmsg)
-		$(use_enable sysvipc sysvsem)
-		$(use_enable sysvipc sysvshm)
-		$(use_with tidy tidy "${EPREFIX}/usr")
-		$(use_enable tokenizer tokenizer)
-		$(use_enable wddx wddx)
-		$(use_enable xml xml)
-		$(use_enable xmlreader xmlreader)
-		$(use_enable xmlwriter xmlwriter)
-		$(use_with xmlrpc xmlrpc)
-		$(use_with xslt xsl "${EPREFIX}/usr")
-		$(use_enable zip zip)
-		$(use_with zip-encryption libzip "${EPREFIX}/usr")
-		$(use_with zlib zlib "${EPREFIX}/usr")
-		$(use_enable debug debug)
-	)
-
-	# DBA support
-	if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
-		|| use qdbm || use lmdb || use tokyocabinet ; then
-		our_conf+=( "--enable-dba${shared}" )
-	fi
-
-	# DBA drivers support
-	our_conf+=(
-		$(use_with cdb cdb)
-		$(use_with berkdb db4 "${EPREFIX}/usr")
-		$(use_enable flatfile flatfile)
-		$(use_with gdbm gdbm "${EPREFIX}/usr")
-		$(use_enable inifile inifile)
-		$(use_with qdbm qdbm "${EPREFIX}/usr")
-		$(use_with lmdb lmdb "${EPREFIX}/usr")
-	)
-
-	# Support for the GD graphics library
-	our_conf+=(
-		$(use_with truetype freetype-dir "${EPREFIX}/usr")
-		$(use_enable cjk gd-jis-conv)
-		$(use_with gd jpeg-dir "${EPREFIX}/usr")
-		$(use_with gd png-dir "${EPREFIX}/usr")
-		$(use_with xpm xpm-dir "${EPREFIX}/usr")
-	)
-	if use webp; then
-		our_conf+=( --with-webp-dir="${EPREFIX}/usr" )
-	fi
-	# enable gd last, so configure can pick up the previous settings
-	our_conf+=( $(use_with gd gd) )
-
-	# IMAP support
-	if use imap ; then
-		our_conf+=(
-			$(use_with imap imap "${EPREFIX}/usr")
-			$(use_with ssl imap-ssl "${EPREFIX}/usr")
-		)
-	fi
-
-	# Interbase/firebird support
-	our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") )
-
-	# LDAP support
-	if use ldap ; then
-		our_conf+=(
-			$(use_with ldap ldap "${EPREFIX}/usr")
-			$(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr")
-		)
-	fi
-
-	# MySQL support
-	local mysqllib="mysqlnd"
-	local mysqlilib="mysqlnd"
-
-	our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
-
-	local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock"
-	if use mysql || use mysqli ; then
-		our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") )
-	fi
-
-	# ODBC support
-	our_conf+=(
-		$(use_with odbc unixODBC "${EPREFIX}/usr")
-		$(use_with iodbc iodbc "${EPREFIX}/usr")
-	)
-
-	# Oracle support
-	our_conf+=( $(use_with oci8-instant-client oci8) )
-
-	# PDO support
-	if use pdo ; then
-		our_conf+=(
-			$(use_with mssql pdo-dblib "${EPREFIX}/usr")
-			$(use_with mysql pdo-mysql "${mysqllib}")
-			$(use_with postgres pdo-pgsql)
-			$(use_with sqlite pdo-sqlite "${EPREFIX}/usr")
-			$(use_with firebird pdo-firebird "${EPREFIX}/usr")
-			$(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr")
-			$(use_with oci8-instant-client pdo-oci)
-		)
-	fi
-
-	# readline/libedit support
-	our_conf+=(
-		$(use_with readline readline "${EPREFIX}/usr")
-		$(use_with libedit libedit "${EPREFIX}/usr")
-	)
-
-	# Session support
-	if use session ; then
-		our_conf+=( $(use_with session-mm mm "${EPREFIX}/usr") )
-	else
-		our_conf+=( $(use_enable session session) )
-	fi
-
-	# Use pic for shared modules such as apache2's mod_php
-	our_conf+=( --with-pic )
-
-	# we use the system copy of pcre
-	# --with-pcre-regex affects ext/pcre
-	# --with-pcre-dir affects ext/filter and ext/zip
-	# --with-pcre-valgrind cannot be enabled with system pcre
-	# Many arches don't support pcre-jit
-	our_conf+=(
-		--with-pcre-regex="${EPREFIX}/usr"
-		--with-pcre-dir="${EPREFIX}/usr"
-		--without-pcre-valgrind
-		--without-pcre-jit
-	)
-
-	# Catch CFLAGS problems
-	# Fixes bug #14067.
-	# Changed order to run it in reverse for bug #32022 and #12021.
-	replace-cpu-flags "k6*" "i586"
-
-	# Cache the ./configure test results between SAPIs.
-	our_conf+=( --cache-file="${T}/config.cache" )
-
-	# Support user-passed configuration parameters
-	our_conf+=( ${EXTRA_ECONF:-} )
-
-	# Support the Apache2 extras, they must be set globally for all
-	# SAPIs to work correctly, especially for external PHP extensions
-
-	local one_sapi
-	local sapi
-	mkdir -p "${WORKDIR}/sapis-build" || die
-	for one_sapi in $SAPIS ; do
-		use "${one_sapi}" || continue
-		php_set_ini_dir "${one_sapi}"
-
-		# The BUILD_DIR variable is used to determine where to output
-		# the files that autotools creates. This was all originally
-		# based on the autotools-utils eclass.
-		BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}"
-		cp -a "${S}" "${BUILD_DIR}" || die
-		cd "${BUILD_DIR}" || die
-
-		local sapi_conf=(
-			--with-config-file-path="${PHP_INI_DIR}"
-			--with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}"
-		)
-
-		for sapi in $SAPIS ; do
-			case "$sapi" in
-				cli|cgi|embed|fpm|phpdbg)
-					if [[ "${one_sapi}" == "${sapi}" ]] ; then
-						sapi_conf+=( "--enable-${sapi}" )
-						if [[ "fpm" == "${sapi}" ]] ; then
-							sapi_conf+=(
-								$(use_with acl fpm-acl)
-								$(use_with systemd fpm-systemd)
-							)
-						fi
-					else
-						sapi_conf+=( "--disable-${sapi}" )
-					fi
-					;;
-
-				apache2)
-					if [[ "${one_sapi}" == "${sapi}" ]] ; then
-						sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" )
-					else
-						sapi_conf+=( --without-apxs2 )
-					fi
-					;;
-			esac
-		done
-
-		# Construct the $myeconfargs array by concatenating $our_conf
-		# (the common args) and $sapi_conf (the SAPI-specific args).
-		local myeconfargs=( "${our_conf[@]}" )
-		myeconfargs+=( "${sapi_conf[@]}" )
-
-		pushd "${BUILD_DIR}" > /dev/null || die
-		econf "${myeconfargs[@]}"
-		popd > /dev/null || die
-	done
-}
-
-src_compile() {
-	# snmp seems to run during src_compile, too (bug #324739)
-	addpredict /usr/share/snmp/mibs/.index #nowarn
-	addpredict /var/lib/net-snmp/mib_indexes #nowarn
-
-	local sapi
-	for sapi in ${SAPIS} ; do
-		if use "${sapi}"; then
-			cd "${WORKDIR}/sapis-build/$sapi" || \
-				die "Failed to change dir to ${WORKDIR}/sapis-build/$1"
-			emake
-		fi
-	done
-}
-
-src_install() {
-	# see bug #324739 for what happens when we don't have that
-	addpredict /usr/share/snmp/mibs/.index #nowarn
-
-	# grab the first SAPI that got built and install common files from there
-	local first_sapi="",sapi=""
-	for sapi in $SAPIS ; do
-		if use $sapi ; then
-			first_sapi=$sapi
-			break
-		fi
-	done
-
-	# Makefile forgets to create this before trying to write to it...
-	dodir "${PHP_DESTDIR#${EPREFIX}}/bin"
-
-	# Install php environment (without any sapis)
-	cd "${WORKDIR}/sapis-build/$first_sapi" || die
-	emake INSTALL_ROOT="${D}" \
-		install-build install-headers install-programs
-
-	local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)"
-
-	# Create the directory where we'll put version-specific php scripts
-	keepdir "/usr/share/php${PHP_MV}"
-
-	local file=""
-	local sapi_list=""
-
-	for sapi in ${SAPIS}; do
-		if use "${sapi}" ; then
-			einfo "Installing SAPI: ${sapi}"
-			cd "${WORKDIR}/sapis-build/${sapi}" || die
-
-			if [[ "${sapi}" == "apache2" ]] ; then
-				# We're specifically not using emake install-sapi as libtool
-				# may cause unnecessary relink failures (see bug #351266)
-				insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/"
-				newins ".libs/libphp${PHP_MV}$(get_libname)" \
-					   "libphp${PHP_MV}$(get_libname)"
-				keepdir "/usr/$(get_libdir)/apache2/modules"
-			else
-				# needed each time, php_install_ini would reset it
-				local dest="${PHP_DESTDIR#${EPREFIX}}"
-				into "${dest}"
-				case "$sapi" in
-					cli)
-						source="sapi/cli/php"
-						# Install the "phar" archive utility.
-						if use phar ; then
-							emake INSTALL_ROOT="${D}" install-pharcmd
-							dosym "..${dest#/usr}/bin/phar" "/usr/bin/phar${SLOT}"
-						fi
-						;;
-					cgi)
-						source="sapi/cgi/php-cgi"
-						;;
-					fpm)
-						source="sapi/fpm/php-fpm"
-						;;
-					embed)
-						source="libs/libphp${PHP_MV}$(get_libname)"
-						;;
-					phpdbg)
-						source="sapi/phpdbg/phpdbg"
-						;;
-					*)
-						die "unhandled sapi in src_install"
-						;;
-				esac
-
-				if [[ "${source}" == *"$(get_libname)" ]]; then
-					dolib.so "${source}"
-				else
-					dobin "${source}"
-					local name="$(basename ${source})"
-					dosym "..${dest#/usr}/bin/${name}" "/usr/bin/${name}${SLOT}"
-				fi
-			fi
-
-			php_install_ini "${sapi}"
-
-			# construct correct SAPI string for php-config
-			# thanks to ferringb for the bash voodoo
-			if [[ "${sapi}" == "apache2" ]]; then
-				sapi_list="${sapi_list:+${sapi_list} }apache2handler"
-			else
-				sapi_list="${sapi_list:+${sapi_list} }${sapi}"
-			fi
-		fi
-	done
-
-	# Installing opcache module
-	if use opcache ; then
-		into "${PHP_DESTDIR#${EPREFIX}}"
-		dolib.so "modules/opcache$(get_libname)"
-	fi
-
-	# Install env.d files
-	newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}"
-	sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
-	sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
-
-	# set php-config variable correctly (bug #278439)
-	sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \
-		"${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die
-
-	if use fpm ; then
-		if use systemd; then
-			systemd_newunit "${FILESDIR}/php-fpm_at.service" \
-							"php-fpm@${SLOT}.service"
-		else
-			systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \
-							"php-fpm@${SLOT}.service"
-		fi
-	fi
-}
-
-src_test() {
-	echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
-	PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
-	if [[ ! -x "${PHP_BIN}" ]] ; then
-		ewarn "Test phase requires USE=cli, skipping"
-		return
-	else
-		export TEST_PHP_EXECUTABLE="${PHP_BIN}"
-	fi
-
-	if [[ -x "${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" ]] ; then
-		export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi"
-	fi
-
-	if [[ -x "${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" ]] ; then
-		export TEST_PHPDBG_EXECUTABLE="${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg"
-	fi
-
-	REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n  -d \
-					  "session.save_path=${T}" \
-					  "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \
-					  "session.save_path=${T}"
-
-	for name in ${EXPECTED_TEST_FAILURES}; do
-		mv "${name}.out" "${name}.out.orig" 2>/dev/null || die
-	done
-
-	local failed="$(find -name '*.out')"
-	if [[ ${failed} != "" ]] ; then
-		ewarn "The following test cases failed unexpectedly:"
-		for name in ${failed}; do
-			ewarn "  ${name/.out/}"
-		done
-	else
-		einfo "No unexpected test failures, all fine"
-	fi
-
-	if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
-		local passed=""
-		for name in ${EXPECTED_TEST_FAILURES}; do
-			[[ -f "${name}.diff" ]] && continue
-			passed="${passed} ${name}"
-		done
-		if [[ ${passed} != "" ]] ; then
-			einfo "The following test cases passed unexpectedly:"
-			for name in ${passed}; do
-				ewarn "  ${passed}"
-			done
-		else
-			einfo "None of the known-to-fail tests passed, all fine"
-		fi
-	fi
-}
-
-pkg_postinst() {
-	# Output some general info to the user
-	if use apache2 ; then
-		elog
-		elog "To enable PHP in apache, you will need to add \"-D PHP\" to"
-		elog "your apache2 command. OpenRC users can append that string to"
-		elog "APACHE2_OPTS in /etc/conf.d/apache2."
-		elog
-		elog "The apache module configuration file 70_mod_php.conf is"
-		elog "provided (and maintained) by eselect-php."
-		elog
-	fi
-
-	# Create the symlinks for php
-	local m
-	for m in ${SAPIS}; do
-		[[ ${m} == 'embed' ]] && continue;
-		if use $m ; then
-			local ci=$(eselect php show $m)
-			if [[ -z $ci ]]; then
-				eselect php set $m php${SLOT} || die
-				einfo "Switched ${m} to use php:${SLOT}"
-				einfo
-			elif [[ $ci != "php${SLOT}" ]] ; then
-				elog "To switch $m to use php:${SLOT}, run"
-				elog "    eselect php set $m php${SLOT}"
-				elog
-			fi
-		fi
-	done
-
-	# Remove dead symlinks for SAPIs that were just disabled. For
-	# example, if the user has the cgi SAPI enabled, then he has an
-	# eselect-php symlink for it. If he later reinstalls PHP with
-	# USE="-cgi", that symlink will break. This call to eselect is
-	# supposed to remove that dead link per bug 572436.
-	eselect php cleanup || die
-
-	if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then
-	   elog "To build extensions for this version of PHP, you will need to"
-	   elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable."
-	   elog
-	fi
-
-	# Warn about the removal of PHP_INI_VERSION if the user has it set.
-	if [[ -n "${PHP_INI_VERSION}" ]]; then
-		ewarn 'The PHP_INI_VERSION variable has been phased out. You may'
-		ewarn 'remove it from your configuration at your convenience. See'
-		ewarn
-		ewarn '  https://bugs.gentoo.org/611214'
-		ewarn
-		ewarn 'for more information.'
-	fi
-
-	elog "For details on how version slotting works, please see"
-	elog "the wiki:"
-	elog
-	elog "  https://wiki.gentoo.org/wiki/PHP"
-	elog
-}
-
-pkg_postrm() {
-	# This serves two purposes. First, if we have just removed the last
-	# installed version of PHP, then this will remove any dead symlinks
-	# belonging to eselect-php. Second, if a user upgrades slots from
-	# (say) 5.6 to 7.0 and depcleans the old slot, then this will update
-	# his existing symlinks to point to the new 7.0 installation. The
-	# latter is bug 432962.
-	#
-	# Note: the eselect-php package may not be installed at this point,
-	# so we can't die() if this command fails.
-	eselect php cleanup
-}

diff --git a/dev-lang/php/php-7.2.34-r2.ebuild b/dev-lang/php/php-7.2.34-r2.ebuild
deleted file mode 100644
index 643a7372408..00000000000
--- a/dev-lang/php/php-7.2.34-r2.ebuild
+++ /dev/null
@@ -1,764 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="7"
-
-inherit flag-o-matic systemd autotools toolchain-funcs
-
-DESCRIPTION="The PHP language runtime engine"
-HOMEPAGE="https://www.php.net/"
-SRC_URI="https://www.php.net/distributions/${P}.tar.xz"
-
-LICENSE="PHP-3.01
-	BSD
-	Zend-2.0
-	bcmath? ( LGPL-2.1+ )
-	fpm? ( BSD-2 )
-	gd? ( gd )
-	unicode? ( BSD-2 LGPL-2.1 )"
-
-SLOT="$(ver_cut 1-2)"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos"
-
-# We can build the following SAPIs in the given order
-SAPIS="embed cli cgi fpm apache2 phpdbg"
-
-# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
-IUSE="${IUSE}
-	${SAPIS/cli/+cli}
-	threads"
-
-IUSE="${IUSE} acl argon2 bcmath berkdb bzip2 calendar cdb cjk
-	coverage +ctype curl debug
-	enchant exif +fileinfo +filter firebird
-	+flatfile ftp gd gdbm gmp +hash +iconv imap inifile
-	intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl lmdb
-	mhash mssql mysql mysqli nls
-	oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
-	readline recode selinux +session session-mm sharedmem
-	+simplexml snmp soap sockets sodium spell sqlite ssl
-	sysvipc systemd test tidy +tokenizer tokyocabinet truetype unicode wddx webp
-	+xml xmlreader xmlwriter xmlrpc xpm xslt zip zip-encryption zlib"
-
-# The supported (that is, autodetected) versions of BDB are listed in
-# the ./configure script. Other versions *work*, but we need to stick to
-# the ones that can be detected to avoid a repeat of bug #564824.
-COMMON_DEPEND="
-	>=app-eselect/eselect-php-0.9.1[apache2?,fpm?]
-	>=dev-libs/libpcre-8.32[unicode]
-	fpm? ( acl? ( sys-apps/acl ) )
-	apache2? ( www-servers/apache[apache2_modules_unixd(+),threads=] )
-	argon2? ( app-crypt/argon2:= )
-	berkdb? ( || (	sys-libs/db:5.3
-					sys-libs/db:5.1
-					sys-libs/db:4.8
-					sys-libs/db:4.7
-					sys-libs/db:4.6
-					sys-libs/db:4.5 ) )
-	bzip2? ( app-arch/bzip2:0= )
-	cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
-	coverage? ( dev-util/lcov )
-	curl? ( >=net-misc/curl-7.10.5 )
-	enchant? ( <app-text/enchant-2.0:0 )
-	firebird? ( dev-db/firebird )
-	gd? ( >=virtual/jpeg-0-r3:0 media-libs/libpng:0= sys-libs/zlib )
-	gdbm? ( >=sys-libs/gdbm-1.8.0:0= )
-	gmp? ( dev-libs/gmp:0= )
-	iconv? ( virtual/libiconv )
-	imap? ( >=virtual/imap-c-client-2[kerberos=,ssl=] )
-	intl? ( dev-libs/icu:= )
-	iodbc? ( dev-db/libiodbc )
-	kerberos? ( virtual/krb5 )
-	ldap? ( >=net-nds/openldap-1.2.11 )
-	ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 )
-	libedit? ( dev-libs/libedit )
-	lmdb? ( dev-db/lmdb:= )
-	mssql? ( dev-db/freetds[mssql] )
-	nls? ( sys-devel/gettext )
-	oci8-instant-client? ( dev-db/oracle-instantclient-basic )
-	odbc? ( >=dev-db/unixODBC-1.8.13 )
-	postgres? ( dev-db/postgresql:* )
-	qdbm? ( dev-db/qdbm )
-	readline? ( sys-libs/readline:0= )
-	recode? ( app-text/recode:0= )
-	session-mm? ( dev-libs/mm )
-	simplexml? ( >=dev-libs/libxml2-2.6.8 )
-	snmp? ( >=net-analyzer/net-snmp-5.2 )
-	soap? ( >=dev-libs/libxml2-2.6.8 )
-	sodium? ( dev-libs/libsodium:= )
-	spell? ( >=app-text/aspell-0.50 )
-	sqlite? ( >=dev-db/sqlite-3.7.6.3 )
-	ssl? (
-		!libressl? ( dev-libs/openssl:0= )
-		libressl? ( dev-libs/libressl:0= )
-	)
-	tidy? ( || ( app-text/tidy-html5 app-text/htmltidy ) )
-	tokyocabinet? ( dev-db/tokyocabinet )
-	truetype? ( =media-libs/freetype-2* )
-	unicode? ( dev-libs/oniguruma:= )
-	wddx? ( >=dev-libs/libxml2-2.6.8 )
-	webp? ( media-libs/libwebp:0= )
-	xml? ( >=dev-libs/libxml2-2.6.8 )
-	xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
-	xmlreader? ( >=dev-libs/libxml2-2.6.8 )
-	xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
-	xpm? ( x11-libs/libXpm )
-	xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
-	zip? ( sys-libs/zlib:0= )
-	zip-encryption? ( >=dev-libs/libzip-1.2.0:= )
-	zlib? ( sys-libs/zlib:0= )
-"
-
-RDEPEND="${COMMON_DEPEND}
-	virtual/mta
-	fpm? (
-		selinux? ( sec-policy/selinux-phpfpm )
-		systemd? ( sys-apps/systemd ) )"
-
-# Bison isn't actually needed when building from a release tarball
-# However, the configure script will warn if it's absent or if you
-# have an incompatible version installed. See bug 593278.
-DEPEND="${COMMON_DEPEND}
-	app-arch/xz-utils
-	>=sys-devel/bison-3.0.1"
-
-BDEPEND="virtual/pkgconfig"
-
-# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
-REQUIRED_USE="
-	|| ( cli cgi fpm apache2 embed phpdbg )
-	cli? ( ^^ ( readline libedit ) )
-	truetype? ( gd zlib )
-	webp? ( gd zlib )
-	cjk? ( gd zlib )
-	exif? ( gd zlib )
-	xpm? ( gd zlib )
-	gd? ( zlib )
-	simplexml? ( xml )
-	soap? ( xml )
-	wddx? ( xml )
-	xmlrpc? ( || ( xml iconv ) )
-	xmlreader? ( xml )
-	xslt? ( xml )
-	ldap-sasl? ( ldap )
-	mhash? ( hash )
-	phar? ( hash )
-	qdbm? ( !gdbm )
-	readline? ( !libedit )
-	recode? ( !imap !mysqli !mysql )
-	session-mm? ( session !threads )
-	mysql? ( hash || ( mysqli pdo ) )
-	mysqli? ( hash )
-	zip-encryption? ( zip )
-"
-
-RESTRICT="!test? ( test )"
-
-PATCHES=(
-	"${FILESDIR}/php-freetype-2.9.1.patch"
-	"${FILESDIR}/php-7.2.13-intl-use-icu-namespace.patch"
-	"${FILESDIR}/php-7.2.34-use-after-free-bug76047.patch"
-)
-
-PHP_MV="$(ver_cut 1)"
-
-php_install_ini() {
-	local phpsapi="${1}"
-
-	# work out where we are installing the ini file
-	php_set_ini_dir "${phpsapi}"
-
-	# Always install the production INI file, bug 611214.
-	local phpinisrc="php.ini-production-${phpsapi}"
-	cp php.ini-production "${phpinisrc}" || die
-
-	# default to /tmp for save_path, bug #282768
-	sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die
-
-	# Set the extension dir
-	sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \
-		-i "${phpinisrc}" || die
-
-	# Set the include path to point to where we want to find PEAR packages
-	sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die
-
-	insinto "${PHP_INI_DIR#${EPREFIX}}"
-	newins "${phpinisrc}" php.ini
-
-	elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}"
-	elog
-
-	dodir "${PHP_EXT_INI_DIR#${EPREFIX}}"
-	dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}"
-
-	if use opcache; then
-		elog "Adding opcache to $PHP_EXT_INI_DIR"
-		echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \
-			 "${D}/${PHP_EXT_INI_DIR}"/opcache.ini
-		dosym "../ext/opcache.ini" \
-			  "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini"
-	fi
-
-	# SAPI-specific handling
-	if [[ "${sapi}" == "fpm" ]] ; then
-		einfo "Installing FPM config files php-fpm.conf and www.conf"
-		insinto "${PHP_INI_DIR#${EPREFIX}}"
-		doins sapi/fpm/php-fpm.conf
-		insinto "${PHP_INI_DIR#${EPREFIX}}/fpm.d"
-		doins sapi/fpm/www.conf
-	fi
-
-	dodoc php.ini-{development,production}
-}
-
-php_set_ini_dir() {
-	PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}"
-	PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
-	PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
-}
-
-src_prepare() {
-	default
-
-	# In php-7.x, the FPM pool configuration files have been split off
-	# of the main config. By default the pool config files go in
-	# e.g. /etc/php-fpm.d, which isn't slotted. So here we move the
-	# include directory to a subdirectory "fpm.d" of $PHP_INI_DIR. Later
-	# we'll install the pool configuration file "www.conf" there.
-	php_set_ini_dir fpm
-	sed -i "s~^include=.*$~include=${PHP_INI_DIR}/fpm.d/*.conf~" \
-		sapi/fpm/php-fpm.conf.in \
-		|| die 'failed to move the include directory in php-fpm.conf'
-
-	# Bug 669566 - necessary so that build tools are updated for commands like pecl
-	# Force rebuilding aclocal.m4
-	rm -f aclocal.m4 || die "failed to remove aclocal.m4 in src_prepare"
-	eautoreconf
-}
-
-src_configure() {
-	addpredict /usr/share/snmp/mibs/.index #nowarn
-	addpredict /var/lib/net-snmp/mib_indexes #nowarn
-
-	# Fix building against >=ICU-68, https://bugs.php.net/80310
-	append-cflags -DU_DEFINE_FALSE_AND_TRUE=1
-	append-cxxflags -DU_DEFINE_FALSE_AND_TRUE=1
-
-	PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
-
-	# The php-fpm config file wants localstatedir to be ${EPREFIX}/var
-	# and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002.
-	local our_conf=(
-		--prefix="${PHP_DESTDIR}"
-		--mandir="${PHP_DESTDIR}/man"
-		--infodir="${PHP_DESTDIR}/info"
-		--libdir="${PHP_DESTDIR}/lib"
-		--with-libdir="$(get_libdir)"
-		--localstatedir="${EPREFIX}/var"
-		--without-pear
-		$(use_enable threads maintainer-zts)
-	)
-
-	our_conf+=(
-		$(use_with argon2 password-argon2 "${EPREFIX}/usr")
-		$(use_enable bcmath bcmath)
-		$(use_with bzip2 bz2 "${EPREFIX}/usr")
-		$(use_enable calendar calendar)
-		$(use_enable coverage gcov)
-		$(use_enable ctype ctype)
-		$(use_with curl curl "${EPREFIX}/usr")
-		$(use_enable xml dom)
-		$(use_with enchant enchant "${EPREFIX}/usr")
-		$(use_enable exif exif)
-		$(use_enable fileinfo fileinfo)
-		$(use_enable filter filter)
-		$(use_enable ftp ftp)
-		$(use_with nls gettext "${EPREFIX}/usr")
-		$(use_with gmp gmp "${EPREFIX}/usr")
-		$(use_enable hash hash)
-		$(use_with mhash mhash "${EPREFIX}/usr")
-		$(use_with iconv iconv \
-			$(use elibc_glibc || use elibc_musl || use elibc_FreeBSD || echo "${EPREFIX}/usr"))
-		$(use_enable intl intl)
-		$(use_enable ipv6 ipv6)
-		$(use_enable json json)
-		$(use_with kerberos kerberos "${EPREFIX}/usr")
-		$(use_enable xml libxml)
-		$(use_with xml libxml-dir "${EPREFIX}/usr")
-		$(use_enable unicode mbstring)
-		$(use_with unicode onig "${EPREFIX}/usr")
-		$(use_with ssl openssl "${EPREFIX}/usr")
-		$(use_with ssl openssl-dir "${EPREFIX}/usr")
-		$(use_enable pcntl pcntl)
-		$(use_enable phar phar)
-		$(use_enable pdo pdo)
-		$(use_enable opcache opcache)
-		$(use_with postgres pgsql "${EPREFIX}/usr")
-		$(use_enable posix posix)
-		$(use_with spell pspell "${EPREFIX}/usr")
-		$(use_with recode recode "${EPREFIX}/usr")
-		$(use_enable simplexml simplexml)
-		$(use_enable sharedmem shmop)
-		$(use_with snmp snmp "${EPREFIX}/usr")
-		$(use_enable soap soap)
-		$(use_enable sockets sockets)
-		$(use_with sodium sodium "${EPREFIX}/usr")
-		$(use_with sqlite sqlite3 "${EPREFIX}/usr")
-		$(use_enable sysvipc sysvmsg)
-		$(use_enable sysvipc sysvsem)
-		$(use_enable sysvipc sysvshm)
-		$(use_with tidy tidy "${EPREFIX}/usr")
-		$(use_enable tokenizer tokenizer)
-		$(use_enable wddx wddx)
-		$(use_enable xml xml)
-		$(use_enable xmlreader xmlreader)
-		$(use_enable xmlwriter xmlwriter)
-		$(use_with xmlrpc xmlrpc)
-		$(use_with xslt xsl "${EPREFIX}/usr")
-		$(use_enable zip zip)
-		$(use_with zip-encryption libzip "${EPREFIX}/usr")
-		$(use_with zlib zlib "${EPREFIX}/usr")
-		$(use_enable debug debug)
-	)
-
-	# DBA support
-	if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
-		|| use qdbm || use lmdb || use tokyocabinet ; then
-		our_conf+=( "--enable-dba${shared}" )
-	fi
-
-	# DBA drivers support
-	our_conf+=(
-		$(use_with cdb cdb)
-		$(use_with berkdb db4 "${EPREFIX}/usr")
-		$(use_enable flatfile flatfile)
-		$(use_with gdbm gdbm "${EPREFIX}/usr")
-		$(use_enable inifile inifile)
-		$(use_with qdbm qdbm "${EPREFIX}/usr")
-		$(use_with lmdb lmdb "${EPREFIX}/usr")
-	)
-
-	# Support for the GD graphics library
-	our_conf+=(
-		$(use_with truetype freetype-dir "${EPREFIX}/usr")
-		$(use_enable cjk gd-jis-conv)
-		$(use_with gd jpeg-dir "${EPREFIX}/usr")
-		$(use_with gd png-dir "${EPREFIX}/usr")
-		$(use_with xpm xpm-dir "${EPREFIX}/usr")
-	)
-	if use webp; then
-		our_conf+=( --with-webp-dir="${EPREFIX}/usr" )
-	fi
-	# enable gd last, so configure can pick up the previous settings
-	our_conf+=( $(use_with gd gd) )
-
-	# IMAP support
-	if use imap ; then
-		our_conf+=(
-			$(use_with imap imap "${EPREFIX}/usr")
-			$(use_with ssl imap-ssl "${EPREFIX}/usr")
-		)
-	fi
-
-	# Interbase/firebird support
-	our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") )
-
-	# LDAP support
-	if use ldap ; then
-		our_conf+=(
-			$(use_with ldap ldap "${EPREFIX}/usr")
-			$(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr")
-		)
-	fi
-
-	# MySQL support
-	local mysqllib="mysqlnd"
-	local mysqlilib="mysqlnd"
-
-	our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
-
-	local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock"
-	if use mysql || use mysqli ; then
-		our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") )
-	fi
-
-	# ODBC support
-	our_conf+=(
-		$(use_with odbc unixODBC "${EPREFIX}/usr")
-		$(use_with iodbc iodbc "${EPREFIX}/usr")
-	)
-
-	# Oracle support
-	our_conf+=( $(use_with oci8-instant-client oci8) )
-
-	# PDO support
-	if use pdo ; then
-		our_conf+=(
-			$(use_with mssql pdo-dblib "${EPREFIX}/usr")
-			$(use_with mysql pdo-mysql "${mysqllib}")
-			$(use_with postgres pdo-pgsql)
-			$(use_with sqlite pdo-sqlite "${EPREFIX}/usr")
-			$(use_with firebird pdo-firebird "${EPREFIX}/usr")
-			$(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr")
-			$(use_with oci8-instant-client pdo-oci)
-		)
-	fi
-
-	# readline/libedit support
-	our_conf+=(
-		$(use_with readline readline "${EPREFIX}/usr")
-		$(use_with libedit libedit "${EPREFIX}/usr")
-	)
-
-	# Session support
-	if use session ; then
-		our_conf+=( $(use_with session-mm mm "${EPREFIX}/usr") )
-	else
-		our_conf+=( $(use_enable session session) )
-	fi
-
-	# Use pic for shared modules such as apache2's mod_php
-	our_conf+=( --with-pic )
-
-	# we use the system copy of pcre
-	# --with-pcre-regex affects ext/pcre
-	# --with-pcre-dir affects ext/filter and ext/zip
-	# --with-pcre-valgrind cannot be enabled with system pcre
-	# Many arches don't support pcre-jit
-	our_conf+=(
-		--with-pcre-regex="${EPREFIX}/usr"
-		--with-pcre-dir="${EPREFIX}/usr"
-		--without-pcre-valgrind
-		--without-pcre-jit
-	)
-
-	# Catch CFLAGS problems
-	# Fixes bug #14067.
-	# Changed order to run it in reverse for bug #32022 and #12021.
-	replace-cpu-flags "k6*" "i586"
-
-	# Cache the ./configure test results between SAPIs.
-	our_conf+=( --cache-file="${T}/config.cache" )
-
-	# Support user-passed configuration parameters
-	our_conf+=( ${EXTRA_ECONF:-} )
-
-	# Support the Apache2 extras, they must be set globally for all
-	# SAPIs to work correctly, especially for external PHP extensions
-
-	local one_sapi
-	local sapi
-	mkdir -p "${WORKDIR}/sapis-build" || die
-	for one_sapi in $SAPIS ; do
-		use "${one_sapi}" || continue
-		php_set_ini_dir "${one_sapi}"
-
-		# The BUILD_DIR variable is used to determine where to output
-		# the files that autotools creates. This was all originally
-		# based on the autotools-utils eclass.
-		BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}"
-		cp -a "${S}" "${BUILD_DIR}" || die
-		cd "${BUILD_DIR}" || die
-
-		local sapi_conf=(
-			--with-config-file-path="${PHP_INI_DIR}"
-			--with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}"
-		)
-
-		for sapi in $SAPIS ; do
-			case "$sapi" in
-				cli|cgi|embed|fpm|phpdbg)
-					if [[ "${one_sapi}" == "${sapi}" ]] ; then
-						sapi_conf+=( "--enable-${sapi}" )
-						if [[ "fpm" == "${sapi}" ]] ; then
-							sapi_conf+=(
-								$(use_with acl fpm-acl)
-								$(use_with systemd fpm-systemd)
-							)
-						fi
-					else
-						sapi_conf+=( "--disable-${sapi}" )
-					fi
-					;;
-
-				apache2)
-					if [[ "${one_sapi}" == "${sapi}" ]] ; then
-						sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" )
-					else
-						sapi_conf+=( --without-apxs2 )
-					fi
-					;;
-			esac
-		done
-
-		# Construct the $myeconfargs array by concatenating $our_conf
-		# (the common args) and $sapi_conf (the SAPI-specific args).
-		local myeconfargs=( "${our_conf[@]}" )
-		myeconfargs+=( "${sapi_conf[@]}" )
-
-		pushd "${BUILD_DIR}" > /dev/null || die
-		econf "${myeconfargs[@]}"
-		popd > /dev/null || die
-	done
-}
-
-src_compile() {
-	# snmp seems to run during src_compile, too (bug #324739)
-	addpredict /usr/share/snmp/mibs/.index #nowarn
-	addpredict /var/lib/net-snmp/mib_indexes #nowarn
-
-	local sapi
-	for sapi in ${SAPIS} ; do
-		if use "${sapi}"; then
-			cd "${WORKDIR}/sapis-build/$sapi" || \
-				die "Failed to change dir to ${WORKDIR}/sapis-build/$1"
-			emake
-		fi
-	done
-}
-
-src_install() {
-	# see bug #324739 for what happens when we don't have that
-	addpredict /usr/share/snmp/mibs/.index #nowarn
-
-	# grab the first SAPI that got built and install common files from there
-	local first_sapi="",sapi=""
-	for sapi in $SAPIS ; do
-		if use $sapi ; then
-			first_sapi=$sapi
-			break
-		fi
-	done
-
-	# Makefile forgets to create this before trying to write to it...
-	dodir "${PHP_DESTDIR#${EPREFIX}}/bin"
-
-	# Install php environment (without any sapis)
-	cd "${WORKDIR}/sapis-build/$first_sapi" || die
-	emake INSTALL_ROOT="${D}" \
-		install-build install-headers install-programs
-
-	local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)"
-
-	# Create the directory where we'll put version-specific php scripts
-	keepdir "/usr/share/php${PHP_MV}"
-
-	local file=""
-	local sapi_list=""
-
-	for sapi in ${SAPIS}; do
-		if use "${sapi}" ; then
-			einfo "Installing SAPI: ${sapi}"
-			cd "${WORKDIR}/sapis-build/${sapi}" || die
-
-			if [[ "${sapi}" == "apache2" ]] ; then
-				# We're specifically not using emake install-sapi as libtool
-				# may cause unnecessary relink failures (see bug #351266)
-				insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/"
-				newins ".libs/libphp${PHP_MV}$(get_libname)" \
-					   "libphp${PHP_MV}$(get_libname)"
-				keepdir "/usr/$(get_libdir)/apache2/modules"
-			else
-				# needed each time, php_install_ini would reset it
-				local dest="${PHP_DESTDIR#${EPREFIX}}"
-				into "${dest}"
-				case "$sapi" in
-					cli)
-						source="sapi/cli/php"
-						# Install the "phar" archive utility.
-						if use phar ; then
-							emake INSTALL_ROOT="${D}" install-pharcmd
-							dosym "..${dest#/usr}/bin/phar" "/usr/bin/phar${SLOT}"
-						fi
-						;;
-					cgi)
-						source="sapi/cgi/php-cgi"
-						;;
-					fpm)
-						source="sapi/fpm/php-fpm"
-						;;
-					embed)
-						source="libs/libphp${PHP_MV}$(get_libname)"
-						;;
-					phpdbg)
-						source="sapi/phpdbg/phpdbg"
-						;;
-					*)
-						die "unhandled sapi in src_install"
-						;;
-				esac
-
-				if [[ "${source}" == *"$(get_libname)" ]]; then
-					dolib.so "${source}"
-				else
-					dobin "${source}"
-					local name="$(basename ${source})"
-					dosym "..${dest#/usr}/bin/${name}" "/usr/bin/${name}${SLOT}"
-				fi
-			fi
-
-			php_install_ini "${sapi}"
-
-			# construct correct SAPI string for php-config
-			# thanks to ferringb for the bash voodoo
-			if [[ "${sapi}" == "apache2" ]]; then
-				sapi_list="${sapi_list:+${sapi_list} }apache2handler"
-			else
-				sapi_list="${sapi_list:+${sapi_list} }${sapi}"
-			fi
-		fi
-	done
-
-	# Installing opcache module
-	if use opcache ; then
-		into "${PHP_DESTDIR#${EPREFIX}}"
-		dolib.so "modules/opcache$(get_libname)"
-	fi
-
-	# Install env.d files
-	newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}"
-	sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
-	sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
-
-	# set php-config variable correctly (bug #278439)
-	sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \
-		"${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die
-
-	if use fpm ; then
-		if use systemd; then
-			systemd_newunit "${FILESDIR}/php-fpm_at.service" \
-							"php-fpm@${SLOT}.service"
-		else
-			systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \
-							"php-fpm@${SLOT}.service"
-		fi
-	fi
-}
-
-src_test() {
-	echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
-	PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
-	if [[ ! -x "${PHP_BIN}" ]] ; then
-		ewarn "Test phase requires USE=cli, skipping"
-		return
-	else
-		export TEST_PHP_EXECUTABLE="${PHP_BIN}"
-	fi
-
-	if [[ -x "${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" ]] ; then
-		export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi"
-	fi
-
-	if [[ -x "${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" ]] ; then
-		export TEST_PHPDBG_EXECUTABLE="${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg"
-	fi
-
-	REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n  -d \
-					  "session.save_path=${T}" \
-					  "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \
-					  "session.save_path=${T}"
-
-	for name in ${EXPECTED_TEST_FAILURES}; do
-		mv "${name}.out" "${name}.out.orig" 2>/dev/null || die
-	done
-
-	local failed="$(find -name '*.out')"
-	if [[ ${failed} != "" ]] ; then
-		ewarn "The following test cases failed unexpectedly:"
-		for name in ${failed}; do
-			ewarn "  ${name/.out/}"
-		done
-	else
-		einfo "No unexpected test failures, all fine"
-	fi
-
-	if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
-		local passed=""
-		for name in ${EXPECTED_TEST_FAILURES}; do
-			[[ -f "${name}.diff" ]] && continue
-			passed="${passed} ${name}"
-		done
-		if [[ ${passed} != "" ]] ; then
-			einfo "The following test cases passed unexpectedly:"
-			for name in ${passed}; do
-				ewarn "  ${passed}"
-			done
-		else
-			einfo "None of the known-to-fail tests passed, all fine"
-		fi
-	fi
-}
-
-pkg_postinst() {
-	# Output some general info to the user
-	if use apache2 ; then
-		elog
-		elog "To enable PHP in apache, you will need to add \"-D PHP\" to"
-		elog "your apache2 command. OpenRC users can append that string to"
-		elog "APACHE2_OPTS in /etc/conf.d/apache2."
-		elog
-		elog "The apache module configuration file 70_mod_php.conf is"
-		elog "provided (and maintained) by eselect-php."
-		elog
-	fi
-
-	# Create the symlinks for php
-	local m
-	for m in ${SAPIS}; do
-		[[ ${m} == 'embed' ]] && continue;
-		if use $m ; then
-			local ci=$(eselect php show $m)
-			if [[ -z $ci ]]; then
-				eselect php set $m php${SLOT} || die
-				einfo "Switched ${m} to use php:${SLOT}"
-				einfo
-			elif [[ $ci != "php${SLOT}" ]] ; then
-				elog "To switch $m to use php:${SLOT}, run"
-				elog "    eselect php set $m php${SLOT}"
-				elog
-			fi
-		fi
-	done
-
-	# Remove dead symlinks for SAPIs that were just disabled. For
-	# example, if the user has the cgi SAPI enabled, then he has an
-	# eselect-php symlink for it. If he later reinstalls PHP with
-	# USE="-cgi", that symlink will break. This call to eselect is
-	# supposed to remove that dead link per bug 572436.
-	eselect php cleanup || die
-
-	if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then
-	   elog "To build extensions for this version of PHP, you will need to"
-	   elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable."
-	   elog
-	fi
-
-	# Warn about the removal of PHP_INI_VERSION if the user has it set.
-	if [[ -n "${PHP_INI_VERSION}" ]]; then
-		ewarn 'The PHP_INI_VERSION variable has been phased out. You may'
-		ewarn 'remove it from your configuration at your convenience. See'
-		ewarn
-		ewarn '  https://bugs.gentoo.org/611214'
-		ewarn
-		ewarn 'for more information.'
-	fi
-
-	elog "For details on how version slotting works, please see"
-	elog "the wiki:"
-	elog
-	elog "  https://wiki.gentoo.org/wiki/PHP"
-	elog
-}
-
-pkg_postrm() {
-	# This serves two purposes. First, if we have just removed the last
-	# installed version of PHP, then this will remove any dead symlinks
-	# belonging to eselect-php. Second, if a user upgrades slots from
-	# (say) 5.6 to 7.0 and depcleans the old slot, then this will update
-	# his existing symlinks to point to the new 7.0 installation. The
-	# latter is bug 432962.
-	#
-	# Note: the eselect-php package may not be installed at this point,
-	# so we can't die() if this command fails.
-	eselect php cleanup
-}


^ permalink raw reply related	[flat|nested] 21+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-lang/php/files/, dev-lang/php/
@ 2020-12-03 20:48 Thomas Deutschmann
  0 siblings, 0 replies; 21+ messages in thread
From: Thomas Deutschmann @ 2020-12-03 20:48 UTC (permalink / raw
  To: gentoo-commits

commit:     ac8830e5ca56ab4ba2a047220e5462024b32444d
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Thu Dec  3 20:47:25 2020 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Thu Dec  3 20:48:16 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ac8830e5

dev-lang/php: fix building against libressl

Fixes

  ext/openssl/openssl.c:6501:8: error: ‘EVP_CIPH_OCB_MODE’ undeclared (first use in this function)

when building against >=dev-libs/libressl-3.3.

Closes: https://bugs.gentoo.org/757123
Package-Manager: Portage-3.0.10, Repoman-3.0.2
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>

 dev-lang/php/files/php-7.4.13-issue80368.patch | 17 +++++++++++++++++
 dev-lang/php/php-7.4.13.ebuild                 |  5 ++++-
 2 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/dev-lang/php/files/php-7.4.13-issue80368.patch b/dev-lang/php/files/php-7.4.13-issue80368.patch
new file mode 100644
index 00000000000..adad8f864ec
--- /dev/null
+++ b/dev-lang/php/files/php-7.4.13-issue80368.patch
@@ -0,0 +1,17 @@
+https://github.com/php/php-src/commit/0f579fd7c8171cb0f7ecc8db912933df450f3861
+https://github.com/php/php-src/commit/ecee3f1209a7c0ac9f99c7f640b2f5df56656e58
+
+--- a/ext/openssl/openssl.c
++++ b/ext/openssl/openssl.c
+@@ -6496,7 +6496,9 @@ static void php_openssl_load_cipher_mode(struct php_openssl_cipher_mode *mode, c
+ 	int cipher_mode = EVP_CIPHER_mode(cipher_type);
+ 	memset(mode, 0, sizeof(struct php_openssl_cipher_mode));
+ 	switch (cipher_mode) {
+-#if PHP_OPENSSL_API_VERSION >= 0x10100
++#ifdef EVP_CIPH_OCB_MODE
++		/* Since OpenSSL 1.1, all AEAD ciphers use a common framework. We check for
++		 * EVP_CIPH_OCB_MODE, because LibreSSL does not support it. */
+ 		case EVP_CIPH_GCM_MODE:
+ 		case EVP_CIPH_OCB_MODE:
+ 		case EVP_CIPH_CCM_MODE:
+ 

diff --git a/dev-lang/php/php-7.4.13.ebuild b/dev-lang/php/php-7.4.13.ebuild
index 3ac0d8c9ace..97ccf43d8c7 100644
--- a/dev-lang/php/php-7.4.13.ebuild
+++ b/dev-lang/php/php-7.4.13.ebuild
@@ -150,7 +150,10 @@ BDEPEND="virtual/pkgconfig"
 
 PHP_MV="$(ver_cut 1)"
 
-PATCHES=( "${FILESDIR}/php-iodbc-header-location.patch" )
+PATCHES=(
+	"${FILESDIR}"/php-iodbc-header-location.patch
+	"${FILESDIR}"/${P}-issue80368.patch
+)
 
 php_install_ini() {
 	local phpsapi="${1}"


^ permalink raw reply related	[flat|nested] 21+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-lang/php/files/, dev-lang/php/
@ 2019-02-11 14:21 Brian Evans
  0 siblings, 0 replies; 21+ messages in thread
From: Brian Evans @ 2019-02-11 14:21 UTC (permalink / raw
  To: gentoo-commits

commit:     4e0b35ca89aef4813880834c5efdfdd0881391dd
Author:     Brian Evans <grknight <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 11 14:17:26 2019 +0000
Commit:     Brian Evans <grknight <AT> gentoo <DOT> org>
CommitDate: Mon Feb 11 14:20:56 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4e0b35ca

dev-lang/php: Drop support for 7.0

Package-Manager: Portage-2.3.59, Repoman-2.3.12
Signed-off-by: Brian Evans <grknight <AT> gentoo.org>

 dev-lang/php/Manifest                              |   2 -
 dev-lang/php/files/libressl-compatibility.patch    |  65 --
 dev-lang/php/files/mbstring-oniguruma-6.8.patch    |  30 -
 ...php-7.0.33-intl-detect-icu-via-pkg-config.patch | 159 -----
 .../php-7.0.33-intl-icu-memory-corruption.patch    |  91 ---
 .../files/php-7.0.33-intl-use-icu-namespace.patch  | 369 ----------
 dev-lang/php/php-7.0.32.ebuild                     | 751 --------------------
 dev-lang/php/php-7.0.33.ebuild                     | 754 ---------------------
 8 files changed, 2221 deletions(-)

diff --git a/dev-lang/php/Manifest b/dev-lang/php/Manifest
index aca5c7dfd36..8f9044d2808 100644
--- a/dev-lang/php/Manifest
+++ b/dev-lang/php/Manifest
@@ -1,7 +1,5 @@
 DIST php-5.6-openssl-1.1-compatibility.patch 42559 BLAKE2B b7f13866cd8545543143932930f31bcd928fa0b4b36ef63f04798b9ef4699f12b4f4227772ac9e6e5c498aaeacf7b106abcfa48031a12214e123de4b79d3a4cd SHA512 eed695a3dd7ce27e8651b4a4b96ccd0514f256e7d2f0214fac899e9eeea6412aa24f863f1b5d13305bcac50667ccb62709597fb34da1002b005ebf411dd2f5df
 DIST php-5.6.40.tar.xz 12472236 BLAKE2B f41147eaec9b15e965540f9e871691cc88848dd619bae6af85e7bba0130b71ce91bad5cdbbadbb537c42df83369f5c731007339a9d9e21e689e913c135201afc SHA512 997b5a952a60cf9166671cc91fcc34c674dd62bfd5cb0a9cdf3fdf2d088b5d19943d94c1cf193f8ab71fc4957d9a9a4c7c2fb8826f937501c1c0a0858f10e329
-DIST php-7.0.32.tar.xz 12030780 BLAKE2B 0c277eac4c931a6e30954cceb7feef8dea1c3ef4aebac91779b7e1a6f90f608faa93d1750a2dc8f354c73304e0f7a9b9ac17bb0d1da4768ddb68925752c11aef SHA512 4a7c9a6b91ad7da69303916202062d639e6f02dcd483e851a44d8c7a2efeb5c9a666097935ab60d700c4445f86a0c68df1515300c57af1cdb76528b54b757608
-DIST php-7.0.33.tar.xz 12033040 BLAKE2B cb7a4eb3ba8ede93ae8e85b6a11664f33654f7e94fa077ac9a33ab95157c0c2b3b05f98413e13e36f710c6d00b35d49d38bf26092a36e508b88805d092764287 SHA512 9298e185702ea801e9243671ecb0b781c2b04181a2f9fd6490bc14897a333a2c0cc88fe27b0c69c6dd0079629a71c330ed1aa337f48cac6cbd624addb8855500
 DIST php-7.1.26.tar.xz 12206956 BLAKE2B af78f764349a05905d7db22260c8a6415a2755b29e0dd01225160235b3b38ea76c8910d79c69798aa2de3fc6d4d41e45ab951161b54e62753111f81ac9d85bc2 SHA512 3c80dce2d5dcbf6f253ca4ca4e4ce01fdd3a3d31a6e6045f539fefadc1ea3c391d4d4995600a4ff758ab0361e0ec2244e2eaa6591ecb3e9b8e8a9c44f67a5b32
 DIST php-7.2.14.tar.xz 12156460 BLAKE2B 88727241ca3fd68238ce50dcb4c12868f8e6df54213b04dba7650c5f98c3f18a3d02e0a191c0ebd13d85c83cc686fef60135f69ca7cc3e425bd5d7f80035fdd7 SHA512 13f2c97b730e3e872bd24bcc004c6cff5e2cc633c37a4eb60b8b5d1d4454bc5985f7d52943448d61cf4a227c64be770edc5eadd2c9612b297d71c0840b4b1259
 DIST php-7.2.15.tar.xz 12164460 BLAKE2B 16ab89c1deee7fcb1edd49b5227456f6bcf40a43668b5e1ffbab41a9f4c48a24fd318122886521838a687a52e36cb77258f6ca266046605441b835904c2dde23 SHA512 feecabb6ee1ec4bc98cf1aa868190c758ee57e5f2d80c91376a2d91082d01f481b0a2e3d7dbae4822d6cfbafe8bccffed15335ff561f8b239e16028ed6bdbee7

diff --git a/dev-lang/php/files/libressl-compatibility.patch b/dev-lang/php/files/libressl-compatibility.patch
deleted file mode 100644
index 3b9c39dcc59..00000000000
--- a/dev-lang/php/files/libressl-compatibility.patch
+++ /dev/null
@@ -1,65 +0,0 @@
---- a/ext/openssl/openssl.c	2018-04-04 14:26:34.583000000 +0000
-+++ b/ext/openssl/openssl.c	2018-04-04 14:20:16.907000000 +0000
-@@ -73,7 +73,7 @@
- #ifdef HAVE_OPENSSL_MD2_H
- #define OPENSSL_ALGO_MD2	4
- #endif
--#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined (LIBRESSL_VERSION_NUMBER)
-+#if OPENSSL_VERSION_NUMBER < 0x10100000L || (defined (LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x20700000L)
- #define OPENSSL_ALGO_DSS1	5
- #endif
- #define OPENSSL_ALGO_SHA224 6
-@@ -560,7 +560,7 @@
- #endif
- 
- /* {{{ OpenSSL compatibility functions and macros */
--#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined (LIBRESSL_VERSION_NUMBER)
-+#if OPENSSL_VERSION_NUMBER < 0x10100000L || (defined (LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x20700000L)
- #define EVP_PKEY_get0_RSA(_pkey) _pkey->pkey.rsa
- #define EVP_PKEY_get0_DH(_pkey) _pkey->pkey.dh
- #define EVP_PKEY_get0_DSA(_pkey) _pkey->pkey.dsa
-@@ -677,7 +677,7 @@
- 	return M_ASN1_STRING_data(asn1);
- }
- 
--#if OPENSSL_VERSION_NUMBER < 0x10002000L || defined (LIBRESSL_VERSION_NUMBER)
-+#if OPENSSL_VERSION_NUMBER < 0x10002000L || (defined (LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x20700000L)
- 
- static int X509_get_signature_nid(const X509 *x)
- {
-@@ -1324,7 +1324,7 @@
- 			mdtype = (EVP_MD *) EVP_md2();
- 			break;
- #endif
--#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined (LIBRESSL_VERSION_NUMBER)
-+#if OPENSSL_VERSION_NUMBER < 0x10100000L || (defined (LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x20700000L)
- 		case OPENSSL_ALGO_DSS1:
- 			mdtype = (EVP_MD *) EVP_dss1();
- 			break;
-@@ -1450,7 +1450,7 @@
- #ifdef HAVE_OPENSSL_MD2_H
- 	REGISTER_LONG_CONSTANT("OPENSSL_ALGO_MD2", OPENSSL_ALGO_MD2, CONST_CS|CONST_PERSISTENT);
- #endif
--#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined (LIBRESSL_VERSION_NUMBER)
-+#if OPENSSL_VERSION_NUMBER < 0x10100000L || (defined (LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x20700000L)
- 	REGISTER_LONG_CONSTANT("OPENSSL_ALGO_DSS1", OPENSSL_ALGO_DSS1, CONST_CS|CONST_PERSISTENT);
- #endif
- 	REGISTER_LONG_CONSTANT("OPENSSL_ALGO_SHA224", OPENSSL_ALGO_SHA224, CONST_CS|CONST_PERSISTENT);
-@@ -3620,7 +3620,7 @@
- 		RETURN_FALSE;
- 	}
- 
--#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
-+#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !(defined (LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x20700000L)
- 	/* Due to changes in OpenSSL 1.1 related to locking when decoding CSR,
- 	 * the pub key is not changed after assigning. It means if we pass
- 	 * a private key, it will be returned including the private part.
-@@ -3631,7 +3631,7 @@
- 	/* Retrieve the public key from the CSR */
- 	tpubkey = X509_REQ_get_pubkey(csr);
- 
--#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
-+#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !(defined (LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x20700000L)
- 	/* We need to free the CSR as it was duplicated */
- 	X509_REQ_free(csr);
- #endif

diff --git a/dev-lang/php/files/mbstring-oniguruma-6.8.patch b/dev-lang/php/files/mbstring-oniguruma-6.8.patch
deleted file mode 100644
index c238f88007c..00000000000
--- a/dev-lang/php/files/mbstring-oniguruma-6.8.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From 4072b2787074ee8e247a6639585b49e10c5a55fe Mon Sep 17 00:00:00 2001
-From: "Christoph M. Becker" <cmbecker69@gmx.de>
-Date: Tue, 20 Mar 2018 16:35:39 +0100
-Subject: [PATCH] Fix #76113: mbstring does not build with Oniguruma 6.8.1
-
-As of Oniguruma 6.8.1, the regex structure has been moved from the
-public `oniguruma.h` to the private `regint.h`.  Thus, it is no longer
-possible to directly access the struct's members, and actually, there
-is no need to, since there are respective accessor functions available
-at least of 2.3.1.
----
- ext/mbstring/php_mbregex.c | 2 +-
- 1 file changed, 1 insertions(+), 1 deletion(-)
-
-diff --git a/ext/mbstring/php_mbregex.c b/ext/mbstring/php_mbregex.c
-index a5a6cd0..7a70c63 100644
---- a/ext/mbstring/php_mbregex.c
-+++ b/ext/mbstring/php_mbregex.c
-@@ -452,7 +452,7 @@ static php_mb_regex_t *php_mbregex_compile_pattern(const char *pattern, int patl
- 	OnigUChar err_str[ONIG_MAX_ERROR_MESSAGE_LEN];
- 
- 	rc = zend_hash_str_find_ptr(&MBREX(ht_rc), (char *)pattern, patlen);
--	if (!rc || rc->options != options || rc->enc != enc || rc->syntax != syntax) {
-+	if (!rc || onig_get_options(rc) != options || onig_get_encoding(rc) != enc || onig_get_syntax(rc) != syntax) {
- 		if ((err_code = onig_new(&retval, (OnigUChar *)pattern, (OnigUChar *)(pattern + patlen), options, enc, syntax, &err_info)) != ONIG_NORMAL) {
- 			onig_error_code_to_str(err_str, err_code, &err_info);
- 			php_error_docref(NULL, E_WARNING, "mbregex compile err: %s", err_str);
--- 
-2.1.4
-

diff --git a/dev-lang/php/files/php-7.0.33-intl-detect-icu-via-pkg-config.patch b/dev-lang/php/files/php-7.0.33-intl-detect-icu-via-pkg-config.patch
deleted file mode 100644
index d23ec91fc83..00000000000
--- a/dev-lang/php/files/php-7.0.33-intl-detect-icu-via-pkg-config.patch
+++ /dev/null
@@ -1,159 +0,0 @@
-Based on the following upstream commits:
-
-https://github.com/php/php-src/commit/9a8e7b571896f39f83cb000fdb7c466b6d328d52
-https://github.com/php/php-src/pull/3701
-https://github.com/php/php-src/commit/2bd299f7318492fd7e5cafffa562d76ba60e69d4
-
---- a/acinclude.m4
-+++ b/acinclude.m4
-@@ -2205,49 +2205,16 @@ dnl
- dnl Common setup macro for ICU
- dnl
- AC_DEFUN([PHP_SETUP_ICU],[
--  PHP_ARG_WITH(icu-dir,,
--  [  --with-icu-dir=DIR      Specify where ICU libraries and headers can be found], DEFAULT, no)
-+  PKG_CHECK_MODULES([ICU], [icu-io >= 50.1])
- 
--  if test "$PHP_ICU_DIR" = "no"; then
--    PHP_ICU_DIR=DEFAULT
--  fi
--
--  if test "$PHP_ICU_DIR" = "DEFAULT"; then
--    dnl Try to find icu-config
--    AC_PATH_PROG(ICU_CONFIG, icu-config, no, [$PATH:/usr/local/bin])
--  else
--    ICU_CONFIG="$PHP_ICU_DIR/bin/icu-config"
--  fi
--
--  AC_MSG_CHECKING([for location of ICU headers and libraries])
--
--  dnl Trust icu-config to know better what the install prefix is..
--  icu_install_prefix=`$ICU_CONFIG --prefix 2> /dev/null`
--  if test "$?" != "0" || test -z "$icu_install_prefix"; then
--    AC_MSG_RESULT([not found])
--    AC_MSG_ERROR([Unable to detect ICU prefix or $ICU_CONFIG failed. Please verify ICU install prefix and make sure icu-config works.])
--  else
--    AC_MSG_RESULT([$icu_install_prefix])
--
--    dnl Check ICU version
--    AC_MSG_CHECKING([for ICU 4.0 or greater])
--    icu_version_full=`$ICU_CONFIG --version`
--    ac_IFS=$IFS
--    IFS="."
--    set $icu_version_full
--    IFS=$ac_IFS
--    icu_version=`expr [$]1 \* 1000 + [$]2`
--    AC_MSG_RESULT([found $icu_version_full])
-+  PHP_EVAL_INCLINE($ICU_CFLAGS)
-+  PHP_EVAL_LIBLINE($ICU_LIBS, $1)
- 
--    if test "$icu_version" -lt "4000"; then
--      AC_MSG_ERROR([ICU version 4.0 or later is required])
--    fi
-+  ICU_CFLAGS="$ICU_CFLAGS -DU_NO_DEFAULT_INCLUDE_UTF_HEADERS=1"
-+  ICU_CXXFLAGS="$ICU_CXXFLAGS -DUNISTR_FROM_CHAR_EXPLICIT=explicit -DUNISTR_FROM_STRING_EXPLICIT=explicit"
- 
--    ICU_VERSION=$icu_version
--    ICU_INCS=`$ICU_CONFIG --cppflags-searchpath`
--    ICU_LIBS=`$ICU_CONFIG --ldflags --ldflags-icuio`
--    PHP_EVAL_INCLINE($ICU_INCS)
--    PHP_EVAL_LIBLINE($ICU_LIBS, $1)
-+  if test "$PKG_CONFIG icu-io --atleast-version=60"; then
-+    ICU_CFLAGS="$ICU_CFLAGS -DU_HIDE_OBSOLETE_UTF_OLD_H=1"
-   fi
- ])
- 
---- a/ext/intl/config.m4
-+++ b/ext/intl/config.m4
-@@ -9,18 +9,10 @@ if test "$PHP_INTL" != "no"; then
-   PHP_SETUP_ICU(INTL_SHARED_LIBADD)
-   PHP_SUBST(INTL_SHARED_LIBADD)
-   PHP_REQUIRE_CXX()
--  if test "$icu_version" -ge "4002"; then
--    icu_spoof_src=" spoofchecker/spoofchecker_class.c \
--    spoofchecker/spoofchecker.c\
--    spoofchecker/spoofchecker_create.c\
--    spoofchecker/spoofchecker_main.c"
--  else
--    icu_spoof_src=""
--  fi
-+  INTL_COMMON_FLAGS="$ICU_CFLAGS -Wno-write-strings -D__STDC_LIMIT_MACROS -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"
-   PHP_NEW_EXTENSION(intl, php_intl.c \
-     intl_error.c \
-     intl_convert.c \
--	intl_convertcpp.cpp \
-     collator/collator.c \
-     collator/collator_class.c \
-     collator/collator_sort.c \
-@@ -32,8 +24,6 @@ if test "$PHP_INTL" != "no"; then
-     collator/collator_is_numeric.c \
-     collator/collator_error.c \
-     common/common_error.c \
--	common/common_enum.cpp \
--	common/common_date.cpp \
-     converter/converter.c \
-     formatter/formatter.c \
-     formatter/formatter_main.c \
-@@ -53,17 +43,12 @@ if test "$PHP_INTL" != "no"; then
-     dateformat/dateformat_attr.c \
-     dateformat/dateformat_data.c \
-     dateformat/dateformat_format.c \
--    dateformat/dateformat_format_object.cpp \
-     dateformat/dateformat_parse.c \
--    dateformat/dateformat_create.cpp \
--    dateformat/dateformat_attrcpp.cpp \
--    dateformat/dateformat_helpers.cpp \
-     msgformat/msgformat.c \
-     msgformat/msgformat_attr.c \
-     msgformat/msgformat_class.c \
-     msgformat/msgformat_data.c  \
-     msgformat/msgformat_format.c \
--    msgformat/msgformat_helpers.cpp \
-     msgformat/msgformat_parse.c \
-     grapheme/grapheme_string.c \
-     grapheme/grapheme_util.c \
-@@ -73,6 +58,21 @@ if test "$PHP_INTL" != "no"; then
-     transliterator/transliterator.c \
-     transliterator/transliterator_class.c \
-     transliterator/transliterator_methods.c \
-+    uchar/uchar.c \
-+    idn/idn.c \
-+    spoofchecker/spoofchecker_class.c \
-+    spoofchecker/spoofchecker.c\
-+    spoofchecker/spoofchecker_create.c\
-+    spoofchecker/spoofchecker_main.c, $ext_shared,,$INTL_COMMON_FLAGS,cxx)
-+
-+  PHP_INTL_CPP_SOURCES="intl_convertcpp.cpp \
-+    common/common_enum.cpp \
-+    common/common_date.cpp \
-+    dateformat/dateformat_format_object.cpp \
-+    dateformat/dateformat_create.cpp \
-+    dateformat/dateformat_attrcpp.cpp \
-+    dateformat/dateformat_helpers.cpp \
-+    msgformat/msgformat_helpers.cpp \
-     timezone/timezone_class.cpp \
-     timezone/timezone_methods.cpp \
-     calendar/calendar_class.cpp \
-@@ -83,10 +83,15 @@ if test "$PHP_INTL" != "no"; then
-     breakiterator/breakiterator_methods.cpp \
-     breakiterator/rulebasedbreakiterator_methods.cpp \
-     breakiterator/codepointiterator_internal.cpp \
--    breakiterator/codepointiterator_methods.cpp \
--    uchar/uchar.c \
--    idn/idn.c \
--    $icu_spoof_src, $ext_shared,,$ICU_INCS -Wno-write-strings -D__STDC_LIMIT_MACROS -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1,cxx)
-+    breakiterator/codepointiterator_methods.cpp"
-+
-+  PHP_INTL_CPP_FLAGS="$ICU_CXXFLAGS -Wno-write-strings -D__STDC_LIMIT_MACROS -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"
-+  if test "$ext_shared" = "no"; then
-+    PHP_ADD_SOURCES(PHP_EXT_DIR(intl), $PHP_INTL_CPP_SOURCES, $PHP_INTL_CPP_FLAGS)
-+  else
-+    PHP_ADD_SOURCES_X(PHP_EXT_DIR(intl), $PHP_INTL_CPP_SOURCES, $PHP_INTL_CPP_FLAGS, shared_objects_intl, yes)
-+  fi
-+
-   PHP_ADD_BUILD_DIR($ext_builddir/collator)
-   PHP_ADD_BUILD_DIR($ext_builddir/converter)
-   PHP_ADD_BUILD_DIR($ext_builddir/common)
--- 
-2.19.2
-

diff --git a/dev-lang/php/files/php-7.0.33-intl-icu-memory-corruption.patch b/dev-lang/php/files/php-7.0.33-intl-icu-memory-corruption.patch
deleted file mode 100644
index e6e7f5917c5..00000000000
--- a/dev-lang/php/files/php-7.0.33-intl-icu-memory-corruption.patch
+++ /dev/null
@@ -1,91 +0,0 @@
-Based on the following upstream commits:
-
-https://github.com/php/php-src/commit/45a05f38410d4a67c8c83c09906e2cfb42fc6e4c
-https://github.com/php/php-src/commit/534684d1042978f3c21caf9b665a7aca27f3f325
-
---- a/ext/intl/msgformat/msgformat_helpers.cpp
-+++ b/ext/intl/msgformat/msgformat_helpers.cpp
-@@ -27,6 +27,7 @@
- #include <unicode/timezone.h>
- #include <unicode/datefmt.h>
- #include <unicode/calendar.h>
-+#include <unicode/strenum.h>
- 
- #include <vector>
- 
-@@ -45,6 +46,7 @@ extern "C" {
- 
- #if U_ICU_VERSION_MAJOR_NUM * 10 + U_ICU_VERSION_MINOR_NUM >= 48
- #define HAS_MESSAGE_PATTERN 1
-+#define HAS_MISALLOCATE_MEMORY_BUG 1
- #endif
- 
- U_NAMESPACE_BEGIN
-@@ -345,6 +347,26 @@ static void umsg_set_timezone(MessageFormatter_object *mfo,
- 		return; /* already done */
- 	}
- 
-+#ifdef HAS_MISALLOCATE_MEMORY_BUG
-+	/* There is a bug in ICU which prevents MessageFormatter::getFormats()
-+	   to handle more than 10 formats correctly. The enumerator could be
-+	   used to walk through the present formatters using getFormat(), which
-+	   however seems to provide just a readonly access. This workaround
-+	   prevents crash when there are > 10 formats but doesn't set any error.
-+	   As a result, only DateFormatters with > 10 subformats are affected.
-+	   This workaround should be ifdef'd out, when the bug has been fixed
-+	   in ICU. */
-+	icu::StringEnumeration* fnames = mf->getFormatNames(err.code);
-+	if (!fnames || U_FAILURE(err.code)) {
-+		return;
-+	}
-+	count = fnames->count(err.code);
-+	delete fnames;
-+	if (count > 10) {
-+		return;
-+	}
-+#endif
-+
- 	formats = mf->getFormats(count);
- 
- 	if (formats == NULL) {
---- /dev/null
-+++ b/ext/intl/tests/bug74484_MessageFormatter.phpt
-@@ -0,0 +1,35 @@
-+--TEST--
-+Bug #74484 MessageFormatter::formatMessage memory corruption with 11+ named placeholder
-+--SKIPIF--
-+<?php
-+if (!extension_loaded('intl'))
-+	die('skip intl extension not enabled');
-+if (version_compare(INTL_ICU_VERSION, '4.8') < 0)
-+	die('skip for ICU 4.8+');
-+?>
-+--FILE--
-+<?php
-+$text = "{a} {b} {c} {d} {e} {f} {g} {h} {i} {j} {k} {l}";
-+
-+$vars = array(
-+  'a' => 1,
-+  'b' => 2,
-+  'c' => 3,
-+  'd' => 4,
-+  'e' => 5,
-+  'f' => 6,
-+  'g' => 7,
-+  'h' => 8,
-+  'i' => 9,
-+  'j' => 10,
-+  'k' => 11,
-+  'l' => 12
-+);
-+
-+var_dump(MessageFormatter::formatMessage('en_US', $text, $vars));
-+
-+?>
-+==DONE==
-+--EXPECT--
-+string(26) "1 2 3 4 5 6 7 8 9 10 11 12"
-+==DONE==
--- 
-2.19.2
-

diff --git a/dev-lang/php/files/php-7.0.33-intl-use-icu-namespace.patch b/dev-lang/php/files/php-7.0.33-intl-use-icu-namespace.patch
deleted file mode 100644
index 4b25abe2055..00000000000
--- a/dev-lang/php/files/php-7.0.33-intl-use-icu-namespace.patch
+++ /dev/null
@@ -1,369 +0,0 @@
-Based on the following upstream commits:
-
-https://github.com/php/php-src/commit/8d35a423838eb462cd39ee535c5d003073cc5f22
-https://github.com/php/php-src/commit/d8200e48857aeaf09f7127751efc5632ef7660a7
-https://github.com/php/php-src/commit/9a8e7b571896f39f83cb000fdb7c466b6d328d52
-
---- a/ext/intl/breakiterator/breakiterator_class.cpp
-+++ b/ext/intl/breakiterator/breakiterator_class.cpp
-@@ -38,6 +38,7 @@ extern "C" {
- }
- 
- using PHP::CodePointBreakIterator;
-+using icu::RuleBasedBreakIterator;
- 
- /* {{{ Global variables */
- zend_class_entry *BreakIterator_ce_ptr;
---- a/ext/intl/breakiterator/breakiterator_class.h
-+++ b/ext/intl/breakiterator/breakiterator_class.h
-@@ -26,6 +26,8 @@
- 
- #ifndef USE_BREAKITERATOR_POINTER
- typedef void BreakIterator;
-+#else
-+using icu::BreakIterator;
- #endif
- 
- typedef struct {
---- a/ext/intl/breakiterator/breakiterator_methods.cpp
-+++ b/ext/intl/breakiterator/breakiterator_methods.cpp
-@@ -32,6 +32,8 @@ extern "C" {
- }
- 
- using PHP::CodePointBreakIterator;
-+using icu::BreakIterator;
-+using icu::Locale;
- 
- U_CFUNC PHP_METHOD(BreakIterator, __construct)
- {
---- a/ext/intl/breakiterator/codepointiterator_internal.cpp
-+++ b/ext/intl/breakiterator/codepointiterator_internal.cpp
-@@ -33,6 +33,8 @@ typedef union {
- 
- using namespace PHP;
- 
-+using icu::UCharCharacterIterator;
-+
- UOBJECT_DEFINE_RTTI_IMPLEMENTATION(CodePointBreakIterator);
- 
- CodePointBreakIterator::CodePointBreakIterator()
---- a/ext/intl/breakiterator/codepointiterator_internal.h
-+++ b/ext/intl/breakiterator/codepointiterator_internal.h
-@@ -18,8 +18,11 @@
- #define CODEPOINTITERATOR_INTERNAL_H
- 
- #include <unicode/brkiter.h>
-+#include <unicode/unistr.h>
- 
--using U_ICU_NAMESPACE::BreakIterator;
-+using icu::BreakIterator;
-+using icu::CharacterIterator;
-+using icu::UnicodeString;
- 
- namespace PHP {
- 
---- a/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp
-+++ b/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp
-@@ -26,6 +26,9 @@ extern "C" {
- #include "../intl_convertcpp.h"
- #include "../intl_common.h"
- 
-+using icu::RuleBasedBreakIterator;
-+using icu::Locale;
-+
- static inline RuleBasedBreakIterator *fetch_rbbi(BreakIterator_object *bio) {
- 	return (RuleBasedBreakIterator*)bio->biter;
- }
---- a/ext/intl/calendar/calendar_class.cpp
-+++ b/ext/intl/calendar/calendar_class.cpp
-@@ -34,6 +34,9 @@ extern "C" {
- #include <assert.h>
- }
- 
-+using icu::GregorianCalendar;
-+using icu::Locale;
-+
- /* {{{ Global variables */
- zend_class_entry *Calendar_ce_ptr;
- zend_class_entry *GregorianCalendar_ce_ptr;
---- a/ext/intl/calendar/calendar_class.h
-+++ b/ext/intl/calendar/calendar_class.h
-@@ -26,6 +26,8 @@
- 
- #ifndef USE_CALENDAR_POINTER
- typedef void Calendar;
-+#else
-+using icu::Calendar;
- #endif
- 
- typedef struct {
---- a/ext/intl/calendar/calendar_methods.cpp
-+++ b/ext/intl/calendar/calendar_methods.cpp
-@@ -40,6 +40,8 @@ extern "C" {
- }
- #include "../common/common_enum.h"
- 
-+using icu::Locale;
-+
- U_CFUNC PHP_METHOD(IntlCalendar, __construct)
- {
- 	zend_throw_exception( NULL,
---- a/ext/intl/calendar/gregoriancalendar_methods.cpp
-+++ b/ext/intl/calendar/gregoriancalendar_methods.cpp
-@@ -23,6 +23,8 @@
- #include <unicode/locid.h>
- #include <unicode/calendar.h>
- #include <unicode/gregocal.h>
-+#include <unicode/ustring.h>
-+
- extern "C" {
- #include "../php_intl.h"
- #include "../intl_common.h"
-@@ -34,6 +36,11 @@ extern "C" {
- #include "zend_exceptions.h"
- }
- 
-+using icu::GregorianCalendar;
-+using icu::Locale;
-+using icu::UnicodeString;
-+using icu::StringPiece;
-+
- static inline GregorianCalendar *fetch_greg(Calendar_object *co) {
- 	return (GregorianCalendar*)co->ucal;
- }
---- a/ext/intl/common/common_date.cpp
-+++ b/ext/intl/common/common_date.cpp
-@@ -25,6 +25,9 @@ extern "C" {
- #include <ext/date/php_date.h>
- }
- 
-+using icu::TimeZone;
-+using icu::UnicodeString;
-+
- #ifndef INFINITY
- #define INFINITY (DBL_MAX+DBL_MAX)
- #endif
---- a/ext/intl/common/common_date.h
-+++ b/ext/intl/common/common_date.h
-@@ -28,6 +28,8 @@ U_CDECL_END
- 
- #include <unicode/timezone.h>
- 
-+using icu::TimeZone;
-+
- U_CFUNC TimeZone *timezone_convert_datetimezone(int type, void *object, int is_datetime, intl_error *outside_error, const char *func);
- U_CFUNC int intl_datetime_decompose(zval *z, double *millis, TimeZone **tz,
- 		intl_error *err, const char *func);
---- a/ext/intl/common/common_enum.h
-+++ b/ext/intl/common/common_enum.h
-@@ -75,6 +75,7 @@ U_CFUNC zval *zoi_with_current_get_current_data(zend_object_iterator *iter);
- U_CFUNC void zoi_with_current_invalidate_current(zend_object_iterator *iter);
- 
- #ifdef __cplusplus
-+using icu::StringEnumeration;
- U_CFUNC void IntlIterator_from_StringEnumeration(StringEnumeration *se, zval *object);
- #endif
- 
---- a/ext/intl/converter/converter.c
-+++ b/ext/intl/converter/converter.c
-@@ -18,6 +18,8 @@
- #include "zend_exceptions.h"
- 
- #include <unicode/utypes.h>
-+#include <unicode/utf8.h>
-+#include <unicode/utf16.h>
- #include <unicode/ucnv.h>
- #include <unicode/ustring.h>
- 
---- a/ext/intl/dateformat/dateformat_format_object.cpp
-+++ b/ext/intl/dateformat/dateformat_format_object.cpp
-@@ -33,6 +33,12 @@ extern "C" {
- #include "../common/common_date.h"
- }
- 
-+using icu::Locale;
-+using icu::DateFormat;
-+using icu::GregorianCalendar;
-+using icu::StringPiece;
-+using icu::SimpleDateFormat;
-+
- static const DateFormat::EStyle valid_styles[] = {
- 		DateFormat::kNone,
- 		DateFormat::kFull,
---- a/ext/intl/dateformat/dateformat_helpers.cpp
-+++ b/ext/intl/dateformat/dateformat_helpers.cpp
-@@ -28,6 +28,8 @@ extern "C" {
- #include "../calendar/calendar_class.h"
- }
- 
-+using icu::GregorianCalendar;
-+
- int datefmt_process_calendar_arg(zval* calendar_zv,
- 								 Locale const& locale,
- 								 const char *func_name,
---- a/ext/intl/dateformat/dateformat_helpers.h
-+++ b/ext/intl/dateformat/dateformat_helpers.h
-@@ -22,11 +22,16 @@
- #endif
- 
- #include <unicode/calendar.h>
-+#include <unicode/datefmt.h>
- 
- extern "C" {
- #include "../php_intl.h"
- }
- 
-+using icu::Locale;
-+using icu::Calendar;
-+using icu::DateFormat;
-+
- int datefmt_process_calendar_arg(zval* calendar_zv,
- 								 Locale const& locale,
- 								 const char *func_name,
---- a/ext/intl/grapheme/grapheme_string.c
-+++ b/ext/intl/grapheme/grapheme_string.c
-@@ -24,6 +24,7 @@
- #include "grapheme_util.h"
- 
- #include <unicode/utypes.h>
-+#include <unicode/utf8.h>
- #include <unicode/ucol.h>
- #include <unicode/ustring.h>
- #include <unicode/ubrk.h>
-@@ -831,10 +832,10 @@ PHP_FUNCTION(grapheme_extract)
- 	pstr = str + start;
- 
- 	/* just in case pstr points in the middle of a character, move forward to the start of the next char */
--	if ( !UTF8_IS_SINGLE(*pstr) && !U8_IS_LEAD(*pstr) ) {
--		char *str_end = str + str_len;
-+	if ( !U8_IS_SINGLE(*pstr) && !U8_IS_LEAD(*pstr) ) {
-+		unsigned char *str_end = str + str_len;
- 
--		while ( !UTF8_IS_SINGLE(*pstr) && !U8_IS_LEAD(*pstr) ) {
-+		while ( !U8_IS_SINGLE(*pstr) && !U8_IS_LEAD(*pstr) ) {
- 			pstr++;
- 			if ( pstr >= str_end ) {
- 				intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
---- a/ext/intl/intl_convertcpp.h
-+++ b/ext/intl/intl_convertcpp.h
-@@ -26,6 +26,8 @@
- #include <unicode/unistr.h>
- #include <zend_types.h>
- 
-+using icu::UnicodeString;
-+
- int intl_stringFromChar(UnicodeString &ret, char *str, size_t str_len, UErrorCode *status);
- 
- zend_string* intl_charFromString(const UnicodeString &from, UErrorCode *status);
---- a/ext/intl/msgformat/msgformat_helpers.cpp
-+++ b/ext/intl/msgformat/msgformat_helpers.cpp
-@@ -76,6 +76,16 @@ MessageFormatAdapter::getMessagePattern(MessageFormat* m) {
- #endif
- U_NAMESPACE_END
- 
-+using icu::Formattable;
-+using icu::Format;
-+using icu::DateFormat;
-+using icu::MessageFormat;
-+#ifdef HAS_MESSAGE_PATTERN
-+using icu::MessagePattern;
-+#endif
-+using icu::MessageFormatAdapter;
-+using icu::FieldPosition;
-+
- U_CFUNC int32_t umsg_format_arg_count(UMessageFormat *fmt)
- {
- 	int32_t fmt_count = 0;
-@@ -227,15 +237,16 @@ static HashTable *umsg_parse_format(MessageFormatter_object *mfo,
- 					UnicodeString typeString = mp.getSubstring(type_part);
- 					/* This is all based on the rules in the docs for MessageFormat
- 					 * @see http://icu-project.org/apiref/icu4c/classMessageFormat.html */
--					if (typeString == "number") {
-+#define ASCII_LITERAL(s) UNICODE_STRING(s, sizeof(s)-1)
-+					if (typeString == ASCII_LITERAL("number")) {
- 						MessagePattern::Part style_part = mp.getPart(i + 1); /* Not advancing i */
- 						if (style_part.getType() == UMSGPAT_PART_TYPE_ARG_STYLE) {
- 							UnicodeString styleString = mp.getSubstring(style_part);
--							if (styleString == "integer") {
-+							if (styleString == ASCII_LITERAL("integer")) {
- 								type = Formattable::kInt64;
--							} else if (styleString == "currency") {
-+							} else if (styleString == ASCII_LITERAL("currency")) {
- 								type = Formattable::kDouble;
--							} else if (styleString == "percent") {
-+							} else if (styleString == ASCII_LITERAL("percent")) {
- 								type = Formattable::kDouble;
- 							} else { /* some style invalid/unknown to us */
- 								type = Formattable::kDouble;
-@@ -243,12 +254,13 @@ static HashTable *umsg_parse_format(MessageFormatter_object *mfo,
- 						} else { // if missing style, part, make it a double
- 							type = Formattable::kDouble;
- 						}
--					} else if ((typeString == "date") || (typeString == "time")) {
-+					} else if ((typeString == ASCII_LITERAL("date")) || (typeString == ASCII_LITERAL("time"))) {
- 						type = Formattable::kDate;
--					} else if ((typeString == "spellout") || (typeString == "ordinal")
--							|| (typeString == "duration")) {
-+					} else if ((typeString == ASCII_LITERAL("spellout")) || (typeString == ASCII_LITERAL("ordinal"))
-+							|| (typeString == ASCII_LITERAL("duration"))) {
- 						type = Formattable::kDouble;
- 					}
-+#undef ASCII_LITERAL
- 				} else {
- 					/* If there's no UMSGPAT_PART_TYPE_ARG_TYPE right after a
- 					 * UMSGPAT_ARG_TYPE_SIMPLE argument, then the pattern
---- a/ext/intl/normalizer/normalizer_normalize.c
-+++ b/ext/intl/normalizer/normalizer_normalize.c
-@@ -24,6 +24,7 @@
- #include "normalizer_class.h"
- #include "normalizer_normalize.h"
- #include "intl_convert.h"
-+#include <unicode/utf8.h>
- 
- /* {{{ proto string Normalizer::normalize( string $input [, string $form = FORM_C] )
-  * Normalize a string. }}} */
---- a/ext/intl/timezone/timezone_class.cpp
-+++ b/ext/intl/timezone/timezone_class.cpp
-@@ -37,6 +37,8 @@ extern "C" {
- #include <ext/date/php_date.h>
- }
- 
-+using icu::Calendar;
-+
- /* {{{ Global variables */
- U_CDECL_BEGIN
- zend_class_entry *TimeZone_ce_ptr = NULL;
---- a/ext/intl/timezone/timezone_class.h
-+++ b/ext/intl/timezone/timezone_class.h
-@@ -29,6 +29,8 @@
- 
- #ifndef USE_TIMEZONE_POINTER
- typedef void TimeZone;
-+#else
-+using icu::TimeZone;
- #endif
- 
- typedef struct {
---- a/ext/intl/timezone/timezone_methods.cpp
-+++ b/ext/intl/timezone/timezone_methods.cpp
-@@ -23,6 +23,7 @@
- #include <unicode/locid.h>
- #include <unicode/timezone.h>
- #include <unicode/ustring.h>
-+#include <unicode/calendar.h>
- #include "intl_convertcpp.h"
- 
- #include "../common/common_date.h"
-@@ -37,6 +38,9 @@ extern "C" {
- }
- #include "common/common_enum.h"
- 
-+using icu::Locale;
-+using icu::Calendar;
-+
- U_CFUNC PHP_METHOD(IntlTimeZone, __construct)
- {
- 	zend_throw_exception( NULL,
--- 
-2.19.2
-

diff --git a/dev-lang/php/php-7.0.32.ebuild b/dev-lang/php/php-7.0.32.ebuild
deleted file mode 100644
index be14985636a..00000000000
--- a/dev-lang/php/php-7.0.32.ebuild
+++ /dev/null
@@ -1,751 +0,0 @@
-# Copyright 1999-2018 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-inherit flag-o-matic eapi7-ver systemd
-
-DESCRIPTION="The PHP language runtime engine"
-HOMEPAGE="https://secure.php.net/"
-SRC_URI="https://secure.php.net/distributions/${P}.tar.xz"
-
-LICENSE="PHP-3.01
-	BSD
-	Zend-2.0
-	bcmath? ( LGPL-2.1+ )
-	fpm? ( BSD-2 )
-	gd? ( gd )
-	unicode? ( BSD-2 LGPL-2.1 )"
-
-SLOT="$(ver_cut 1-2)"
-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"
-
-# We can build the following SAPIs in the given order
-SAPIS="embed cli cgi fpm apache2 phpdbg"
-
-# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
-IUSE="${IUSE}
-	${SAPIS/cli/+cli}
-	threads"
-
-IUSE="${IUSE} acl bcmath berkdb bzip2 calendar cdb cjk
-	coverage crypt +ctype curl debug
-	enchant exif +fileinfo +filter firebird
-	flatfile ftp gd gdbm gmp +hash +iconv imap inifile
-	intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl
-	mhash mssql mysql mysqli nls
-	oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
-	readline recode selinux +session sharedmem
-	+simplexml snmp soap sockets spell sqlite ssl
-	sysvipc systemd tidy +tokenizer truetype unicode wddx webp
-	+xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib"
-
-# The supported (that is, autodetected) versions of BDB are listed in
-# the ./configure script. Other versions *work*, but we need to stick to
-# the ones that can be detected to avoid a repeat of bug #564824.
-COMMON_DEPEND="
-	>=app-eselect/eselect-php-0.9.1[apache2?,fpm?]
-	>=dev-libs/libpcre-8.32[unicode]
-	fpm? ( acl? ( sys-apps/acl ) )
-	apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=]
-		<www-servers/apache-2.4[threads=] ) )
-	berkdb? ( || ( sys-libs/db:5.3
-					sys-libs/db:5.1
-					sys-libs/db:4.8
-					sys-libs/db:4.7
-					sys-libs/db:4.6
-					sys-libs/db:4.5 ) )
-	bzip2? ( app-arch/bzip2:0= )
-	cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
-	cjk? ( !gd? (
-		virtual/jpeg:0
-		media-libs/libpng:0=
-		sys-libs/zlib:0=
-	) )
-	coverage? ( dev-util/lcov )
-	crypt? ( >=dev-libs/libmcrypt-2.4 )
-	curl? ( >=net-misc/curl-7.10.5 )
-	enchant? ( app-text/enchant )
-	exif? ( !gd? (
-		virtual/jpeg:0
-		media-libs/libpng:0=
-		sys-libs/zlib:0=
-	) )
-	firebird? ( dev-db/firebird )
-	gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib:0= )
-	gdbm? ( >=sys-libs/gdbm-1.8.0:0= )
-	gmp? ( dev-libs/gmp:0= )
-	iconv? ( virtual/libiconv )
-	imap? ( virtual/imap-c-client[kerberos=,ssl=] )
-	intl? ( <dev-libs/icu-61.1:= )
-	iodbc? ( dev-db/libiodbc )
-	kerberos? ( virtual/krb5 )
-	ldap? ( >=net-nds/openldap-1.2.11 )
-	ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 )
-	libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) )
-	mssql? ( dev-db/freetds[mssql] )
-	nls? ( sys-devel/gettext )
-	oci8-instant-client? ( dev-db/oracle-instantclient-basic )
-	odbc? ( >=dev-db/unixODBC-1.8.13 )
-	postgres? ( dev-db/postgresql:* )
-	qdbm? ( dev-db/qdbm )
-	readline? ( sys-libs/readline:0= )
-	recode? ( app-text/recode )
-	sharedmem? ( dev-libs/mm )
-	simplexml? ( >=dev-libs/libxml2-2.6.8 )
-	snmp? ( >=net-analyzer/net-snmp-5.2 )
-	soap? ( >=dev-libs/libxml2-2.6.8 )
-	spell? ( >=app-text/aspell-0.50 )
-	sqlite? ( >=dev-db/sqlite-3.7.6.3 )
-	ssl? (
-		!libressl? ( dev-libs/openssl:0= )
-		libressl? ( dev-libs/libressl:0= )
-	)
-	tidy? ( app-text/htmltidy )
-	truetype? (
-		=media-libs/freetype-2*
-		!gd? (
-			virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib:0= )
-	)
-	unicode? ( dev-libs/oniguruma:= )
-	wddx? ( >=dev-libs/libxml2-2.6.8 )
-	webp? ( media-libs/libwebp:0= )
-	xml? ( >=dev-libs/libxml2-2.6.8 )
-	xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
-	xmlreader? ( >=dev-libs/libxml2-2.6.8 )
-	xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
-	xpm? (
-		x11-libs/libXpm
-		virtual/jpeg:0
-		media-libs/libpng:0= sys-libs/zlib:0=
-	)
-	xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
-	zip? ( sys-libs/zlib:0= )
-	zlib? ( sys-libs/zlib:0= )
-"
-
-RDEPEND="${COMMON_DEPEND}
-	virtual/mta
-	fpm? (
-		selinux? ( sec-policy/selinux-phpfpm )
-		systemd? ( sys-apps/systemd ) )"
-
-DEPEND="${COMMON_DEPEND}
-	app-arch/xz-utils
-	>=sys-devel/bison-3.0.1
-	sys-devel/flex
-	>=sys-devel/m4-1.4.3
-	>=sys-devel/libtool-1.5.18"
-
-# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
-REQUIRED_USE="
-	|| ( cli cgi fpm apache2 embed phpdbg )
-	cli? ( ^^ ( readline libedit ) )
-	truetype? ( gd zlib )
-	webp? ( gd zlib )
-	cjk? ( gd zlib )
-	exif? ( gd zlib )
-	xpm? ( gd zlib )
-	gd? ( zlib )
-	simplexml? ( xml )
-	soap? ( xml )
-	wddx? ( xml )
-	xmlrpc? ( || ( xml iconv ) )
-	xmlreader? ( xml )
-	xslt? ( xml )
-	ldap-sasl? ( ldap )
-	mhash? ( hash )
-	phar? ( hash )
-	qdbm? ( !gdbm )
-	readline? ( !libedit )
-	recode? ( !imap !mysqli !mysql )
-	sharedmem? ( !threads )
-	mysql? ( || ( mysqli pdo ) )
-"
-
-PATCHES=(
-	"${FILESDIR}/mbstring-oniguruma-6.8.patch"
-	# hopefully upstream will include the same version check fixes in upcoming releases
-	# patch added 20180429
-	"${FILESDIR}/libressl-compatibility.patch"
-	"${FILESDIR}/php-freetype-2.9.1.patch"
-)
-
-PHP_MV="$(ver_cut 1)"
-
-php_install_ini() {
-	local phpsapi="${1}"
-
-	# work out where we are installing the ini file
-	php_set_ini_dir "${phpsapi}"
-
-	# Always install the production INI file, bug 611214.
-	local phpinisrc="php.ini-production-${phpsapi}"
-	cp php.ini-production "${phpinisrc}" || die
-
-	# default to /tmp for save_path, bug #282768
-	sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die
-
-	# Set the extension dir
-	sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \
-		-i "${phpinisrc}" || die
-
-	# Set the include path to point to where we want to find PEAR packages
-	sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die
-
-	dodir "${PHP_INI_DIR#${EPREFIX}}"
-	insinto "${PHP_INI_DIR#${EPREFIX}}"
-	newins "${phpinisrc}" php.ini
-
-	elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}"
-	elog
-
-	dodir "${PHP_EXT_INI_DIR#${EPREFIX}}"
-	dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}"
-
-	if use opcache; then
-		elog "Adding opcache to $PHP_EXT_INI_DIR"
-		echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \
-			 "${D}/${PHP_EXT_INI_DIR}"/opcache.ini
-		dosym "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" \
-			  "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini"
-	fi
-
-	# SAPI-specific handling
-	if [[ "${sapi}" == "fpm" ]] ; then
-		einfo "Installing FPM config files php-fpm.conf and www.conf"
-		insinto "${PHP_INI_DIR#${EPREFIX}}"
-		doins sapi/fpm/php-fpm.conf
-		insinto "${PHP_INI_DIR#${EPREFIX}}/fpm.d"
-		doins sapi/fpm/www.conf
-	fi
-
-	dodoc php.ini-{development,production}
-}
-
-php_set_ini_dir() {
-	PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}"
-	PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
-	PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
-}
-
-src_prepare() {
-	default
-
-	# In php-7.x, the FPM pool configuration files have been split off
-	# of the main config. By default the pool config files go in
-	# e.g. /etc/php-fpm.d, which isn't slotted. So here we move the
-	# include directory to a subdirectory "fpm.d" of $PHP_INI_DIR. Later
-	# we'll install the pool configuration file "www.conf" there.
-	php_set_ini_dir fpm
-	sed -i "s~^include=.*$~include=${PHP_INI_DIR}/fpm.d/*.conf~" \
-		sapi/fpm/php-fpm.conf.in \
-		|| die 'failed to move the include directory in php-fpm.conf'
-}
-
-src_configure() {
-	addpredict /usr/share/snmp/mibs/.index #nowarn
-	addpredict /var/lib/net-snmp/mib_indexes #nowarn
-
-	PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
-
-	# The php-fpm config file wants localstatedir to be ${EPREFIX}/var
-	# and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002.
-	local our_conf=(
-		--prefix="${PHP_DESTDIR}"
-		--mandir="${PHP_DESTDIR}/man"
-		--infodir="${PHP_DESTDIR}/info"
-		--libdir="${PHP_DESTDIR}/lib"
-		--with-libdir="$(get_libdir)"
-		--localstatedir="${EPREFIX}/var"
-		--without-pear
-		$(use_enable threads maintainer-zts)
-	)
-
-	our_conf+=(
-		$(use_enable bcmath bcmath)
-		$(use_with bzip2 bz2 "${EPREFIX}/usr")
-		$(use_enable calendar calendar)
-		$(use_enable coverage gcov)
-		$(use_enable ctype ctype)
-		$(use_with curl curl "${EPREFIX}/usr")
-		$(use_enable xml dom)
-		$(use_with enchant enchant "${EPREFIX}/usr")
-		$(use_enable exif exif)
-		$(use_enable fileinfo fileinfo)
-		$(use_enable filter filter)
-		$(use_enable ftp ftp)
-		$(use_with nls gettext "${EPREFIX}/usr")
-		$(use_with gmp gmp "${EPREFIX}/usr")
-		$(use_enable hash hash)
-		$(use_with mhash mhash "${EPREFIX}/usr")
-		$(use_with iconv iconv \
-			$(use elibc_glibc || use elibc_musl || use elibc_FreeBSD || echo "${EPREFIX}/usr"))
-		$(use_enable intl intl)
-		$(use_enable ipv6 ipv6)
-		$(use_enable json json)
-		$(use_with kerberos kerberos "${EPREFIX}/usr")
-		$(use_enable xml libxml)
-		$(use_with xml libxml-dir "${EPREFIX}/usr")
-		$(use_enable unicode mbstring)
-		$(use_with crypt mcrypt "${EPREFIX}/usr")
-		$(use_with unicode onig "${EPREFIX}/usr")
-		$(use_with ssl openssl "${EPREFIX}/usr")
-		$(use_with ssl openssl-dir "${EPREFIX}/usr")
-		$(use_enable pcntl pcntl)
-		$(use_enable phar phar)
-		$(use_enable pdo pdo)
-		$(use_enable opcache opcache)
-		$(use_with postgres pgsql "${EPREFIX}/usr")
-		$(use_enable posix posix)
-		$(use_with spell pspell "${EPREFIX}/usr")
-		$(use_with recode recode "${EPREFIX}/usr")
-		$(use_enable simplexml simplexml)
-		$(use_enable sharedmem shmop)
-		$(use_with snmp snmp "${EPREFIX}/usr")
-		$(use_enable soap soap)
-		$(use_enable sockets sockets)
-		$(use_with sqlite sqlite3 "${EPREFIX}/usr")
-		$(use_enable sysvipc sysvmsg)
-		$(use_enable sysvipc sysvsem)
-		$(use_enable sysvipc sysvshm)
-		$(use_with tidy tidy "${EPREFIX}/usr")
-		$(use_enable tokenizer tokenizer)
-		$(use_enable wddx wddx)
-		$(use_enable xml xml)
-		$(use_enable xmlreader xmlreader)
-		$(use_enable xmlwriter xmlwriter)
-		$(use_with xmlrpc xmlrpc)
-		$(use_with xslt xsl "${EPREFIX}/usr")
-		$(use_enable zip zip)
-		$(use_with zlib zlib "${EPREFIX}/usr")
-		$(use_enable debug debug)
-	)
-
-	# DBA support
-	if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
-		|| use qdbm ; then
-		our_conf+=( "--enable-dba${shared}" )
-	fi
-
-	# DBA drivers support
-	our_conf+=(
-		$(use_with cdb cdb)
-		$(use_with berkdb db4 "${EPREFIX}/usr")
-		$(use_enable flatfile flatfile)
-		$(use_with gdbm gdbm "${EPREFIX}/usr")
-		$(use_enable inifile inifile)
-		$(use_with qdbm qdbm "${EPREFIX}/usr")
-	)
-
-	# Support for the GD graphics library
-	our_conf+=(
-		$(use_with truetype freetype-dir "${EPREFIX}/usr")
-		$(use_enable cjk gd-jis-conv)
-		$(use_with gd jpeg-dir "${EPREFIX}/usr")
-		$(use_with gd png-dir "${EPREFIX}/usr")
-		$(use_with xpm xpm-dir "${EPREFIX}/usr")
-	)
-	if use webp; then
-		our_conf+=( --with-webp-dir="${EPREFIX}/usr" )
-	fi
-	# enable gd last, so configure can pick up the previous settings
-	our_conf+=( $(use_with gd gd) )
-
-	# IMAP support
-	if use imap ; then
-		our_conf+=(
-			$(use_with imap imap "${EPREFIX}/usr")
-			$(use_with ssl imap-ssl "${EPREFIX}/usr")
-		)
-	fi
-
-	# Interbase/firebird support
-	our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") )
-
-	# LDAP support
-	if use ldap ; then
-		our_conf+=(
-			$(use_with ldap ldap "${EPREFIX}/usr")
-			$(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr")
-		)
-	fi
-
-	# MySQL support
-	local mysqllib="mysqlnd"
-	local mysqlilib="mysqlnd"
-
-	our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
-
-	local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock"
-	if use mysql || use mysqli ; then
-		our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") )
-	fi
-
-	# ODBC support
-	our_conf+=(
-		$(use_with odbc unixODBC "${EPREFIX}/usr")
-		$(use_with iodbc iodbc "${EPREFIX}/usr")
-	)
-
-	# Oracle support
-	our_conf+=( $(use_with oci8-instant-client oci8) )
-
-	# PDO support
-	if use pdo ; then
-		our_conf+=(
-			$(use_with mssql pdo-dblib "${EPREFIX}/usr")
-			$(use_with mysql pdo-mysql "${mysqllib}")
-			$(use_with postgres pdo-pgsql)
-			$(use_with sqlite pdo-sqlite "${EPREFIX}/usr")
-			$(use_with firebird pdo-firebird "${EPREFIX}/usr")
-			$(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr")
-			$(use_with oci8-instant-client pdo-oci)
-		)
-	fi
-
-	# readline/libedit support
-	our_conf+=(
-		$(use_with readline readline "${EPREFIX}/usr")
-		$(use_with libedit libedit "${EPREFIX}/usr")
-	)
-
-	# Session support
-	if use session ; then
-		our_conf+=( $(use_with sharedmem mm "${EPREFIX}/usr") )
-	else
-		our_conf+=( $(use_enable session session) )
-	fi
-
-	# Use pic for shared modules such as apache2's mod_php
-	our_conf+=( --with-pic )
-
-	# we use the system copy of pcre
-	# --with-pcre-regex affects ext/pcre
-	# --with-pcre-dir affects ext/filter and ext/zip
-	our_conf+=(
-		--with-pcre-regex="${EPREFIX}/usr"
-		--with-pcre-dir="${EPREFIX}/usr"
-	)
-
-	# Catch CFLAGS problems
-	# Fixes bug #14067.
-	# Changed order to run it in reverse for bug #32022 and #12021.
-	replace-cpu-flags "k6*" "i586"
-
-	# Cache the ./configure test results between SAPIs.
-	our_conf+=( --cache-file="${T}/config.cache" )
-
-	# Support user-passed configuration parameters
-	our_conf+=( ${EXTRA_ECONF:-} )
-
-	# Support the Apache2 extras, they must be set globally for all
-	# SAPIs to work correctly, especially for external PHP extensions
-
-	mkdir -p "${WORKDIR}/sapis-build" || die
-	for one_sapi in $SAPIS ; do
-		use "${one_sapi}" || continue
-		php_set_ini_dir "${one_sapi}"
-
-		# The BUILD_DIR variable is used to determine where to output
-		# the files that autotools creates. This was all originally
-		# based on the autotools-utils eclass.
-		BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}"
-		cp -a "${S}" "${BUILD_DIR}" || die
-		cd "${BUILD_DIR}" || die
-
-		local sapi_conf=(
-			--with-config-file-path="${PHP_INI_DIR}"
-			--with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}"
-		)
-
-		for sapi in $SAPIS ; do
-			case "$sapi" in
-				cli|cgi|embed|fpm|phpdbg)
-					if [[ "${one_sapi}" == "${sapi}" ]] ; then
-						sapi_conf+=( "--enable-${sapi}" )
-						if [[ "fpm" == "${sapi}" ]] ; then
-							sapi_conf+=(
-								$(use_with acl fpm-acl)
-								$(use_with systemd fpm-systemd)
-							)
-						fi
-					else
-						sapi_conf+=( "--disable-${sapi}" )
-					fi
-					;;
-
-				apache2)
-					if [[ "${one_sapi}" == "${sapi}" ]] ; then
-						sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" )
-					else
-						sapi_conf+=( --without-apxs2 )
-					fi
-					;;
-			esac
-		done
-
-		# Construct the $myeconfargs array by concatenating $our_conf
-		# (the common args) and $sapi_conf (the SAPI-specific args).
-		local myeconfargs=( "${our_conf[@]}" )
-		myeconfargs+=( "${sapi_conf[@]}" )
-
-		pushd "${BUILD_DIR}" > /dev/null || die
-		econf "${myeconfargs[@]}"
-		popd > /dev/null || die
-	done
-}
-
-src_compile() {
-	# snmp seems to run during src_compile, too (bug #324739)
-	addpredict /usr/share/snmp/mibs/.index #nowarn
-	addpredict /var/lib/net-snmp/mib_indexes #nowarn
-
-	for sapi in ${SAPIS} ; do
-		if use "${sapi}"; then
-			cd "${WORKDIR}/sapis-build/$sapi" || \
-				die "Failed to change dir to ${WORKDIR}/sapis-build/$1"
-			emake
-		fi
-	done
-}
-
-src_install() {
-	# see bug #324739 for what happens when we don't have that
-	addpredict /usr/share/snmp/mibs/.index #nowarn
-
-	# grab the first SAPI that got built and install common files from there
-	local first_sapi=""
-	for sapi in $SAPIS ; do
-		if use $sapi ; then
-			first_sapi=$sapi
-			break
-		fi
-	done
-
-	# Makefile forgets to create this before trying to write to it...
-	dodir "${PHP_DESTDIR#${EPREFIX}}/bin"
-
-	# Install php environment (without any sapis)
-	cd "${WORKDIR}/sapis-build/$first_sapi" || die
-	emake INSTALL_ROOT="${D}" \
-		install-build install-headers install-programs
-
-	local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)"
-
-	# Create the directory where we'll put version-specific php scripts
-	keepdir "/usr/share/php${PHP_MV}"
-
-	local sapi="", file=""
-	local sapi_list=""
-
-	for sapi in ${SAPIS}; do
-		if use "${sapi}" ; then
-			einfo "Installing SAPI: ${sapi}"
-			cd "${WORKDIR}/sapis-build/${sapi}" || die
-
-			if [[ "${sapi}" == "apache2" ]] ; then
-				# We're specifically not using emake install-sapi as libtool
-				# may cause unnecessary relink failures (see bug #351266)
-				insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/"
-				newins ".libs/libphp${PHP_MV}$(get_libname)" \
-					   "libphp${PHP_MV}$(get_libname)"
-				keepdir "/usr/$(get_libdir)/apache2/modules"
-			else
-				# needed each time, php_install_ini would reset it
-				local dest="${PHP_DESTDIR#${EPREFIX}}"
-				into "${dest}"
-				case "$sapi" in
-					cli)
-						source="sapi/cli/php"
-						;;
-					cgi)
-						source="sapi/cgi/php-cgi"
-						;;
-					fpm)
-						source="sapi/fpm/php-fpm"
-						;;
-					embed)
-						source="libs/libphp${PHP_MV}$(get_libname)"
-						;;
-					phpdbg)
-						source="sapi/phpdbg/phpdbg"
-						;;
-					*)
-						die "unhandled sapi in src_install"
-						;;
-				esac
-
-				if [[ "${source}" == *"$(get_libname)" ]]; then
-					dolib.so "${source}"
-				else
-					dobin "${source}"
-					local name="$(basename ${source})"
-					dosym "${dest}/bin/${name}" "/usr/bin/${name}${SLOT}"
-				fi
-			fi
-
-			php_install_ini "${sapi}"
-
-			# construct correct SAPI string for php-config
-			# thanks to ferringb for the bash voodoo
-			if [[ "${sapi}" == "apache2" ]]; then
-				sapi_list="${sapi_list:+${sapi_list} }apache2handler"
-			else
-				sapi_list="${sapi_list:+${sapi_list} }${sapi}"
-			fi
-		fi
-	done
-
-	# Installing opcache module
-	if use opcache ; then
-		into "${PHP_DESTDIR#${EPREFIX}}"
-		dolib.so "modules/opcache$(get_libname)"
-	fi
-
-	# Install env.d files
-	newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}"
-	sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
-	sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
-
-	# set php-config variable correctly (bug #278439)
-	sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \
-		"${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die
-
-	if use fpm ; then
-		if use systemd; then
-			systemd_newunit "${FILESDIR}/php-fpm_at.service" \
-							"php-fpm@${SLOT}.service"
-		else
-			systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \
-							"php-fpm@${SLOT}.service"
-		fi
-	fi
-}
-
-src_test() {
-	echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
-	PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
-	if [[ ! -x "${PHP_BIN}" ]] ; then
-		ewarn "Test phase requires USE=cli, skipping"
-		return
-	else
-		export TEST_PHP_EXECUTABLE="${PHP_BIN}"
-	fi
-
-	if [[ -x "${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" ]] ; then
-		export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi"
-	fi
-
-	if [[ -x "${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" ]] ; then
-		export TEST_PHPDBG_EXECUTABLE="${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg"
-	fi
-
-	REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n  -d \
-					  "session.save_path=${T}" \
-					  "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \
-					  "session.save_path=${T}"
-
-	for name in ${EXPECTED_TEST_FAILURES}; do
-		mv "${name}.out" "${name}.out.orig" 2>/dev/null || die
-	done
-
-	local failed="$(find -name '*.out')"
-	if [[ ${failed} != "" ]] ; then
-		ewarn "The following test cases failed unexpectedly:"
-		for name in ${failed}; do
-			ewarn "  ${name/.out/}"
-		done
-	else
-		einfo "No unexpected test failures, all fine"
-	fi
-
-	if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
-		local passed=""
-		for name in ${EXPECTED_TEST_FAILURES}; do
-			[[ -f "${name}.diff" ]] && continue
-			passed="${passed} ${name}"
-		done
-		if [[ ${passed} != "" ]] ; then
-			einfo "The following test cases passed unexpectedly:"
-			for name in ${passed}; do
-				ewarn "  ${passed}"
-			done
-		else
-			einfo "None of the known-to-fail tests passed, all fine"
-		fi
-	fi
-}
-
-pkg_postinst() {
-	# Output some general info to the user
-	if use apache2 ; then
-		elog
-		elog "To enable PHP in apache, you will need to add \"-D PHP\" to"
-		elog "your apache2 command. OpenRC users can append that string to"
-		elog "APACHE2_OPTS in /etc/conf.d/apache2."
-		elog
-		elog "The apache module configuration file 70_mod_php.conf is"
-		elog "provided (and maintained) by eselect-php."
-		elog
-	fi
-
-	# Create the symlinks for php
-	for m in ${SAPIS}; do
-		[[ ${m} == 'embed' ]] && continue;
-		if use $m ; then
-			local ci=$(eselect php show $m)
-			if [[ -z $ci ]]; then
-				eselect php set $m php${SLOT} || die
-				einfo "Switched ${m} to use php:${SLOT}"
-				einfo
-			elif [[ $ci != "php${SLOT}" ]] ; then
-				elog "To switch $m to use php:${SLOT}, run"
-				elog "    eselect php set $m php${SLOT}"
-				elog
-			fi
-		fi
-	done
-
-	# Remove dead symlinks for SAPIs that were just disabled. For
-	# example, if the user has the cgi SAPI enabled, then he has an
-	# eselect-php symlink for it. If he later reinstalls PHP with
-	# USE="-cgi", that symlink will break. This call to eselect is
-	# supposed to remove that dead link per bug 572436.
-	eselect php cleanup || die
-
-	if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then
-	   elog "To build extensions for this version of PHP, you will need to"
-	   elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable."
-	   elog
-	fi
-
-	# Warn about the removal of PHP_INI_VERSION if the user has it set.
-	if [[ -n "${PHP_INI_VERSION}" ]]; then
-		ewarn 'The PHP_INI_VERSION variable has been phased out. You may'
-		ewarn 'remove it from your configuration at your convenience. See'
-		ewarn
-		ewarn '  https://bugs.gentoo.org/611214'
-		ewarn
-		ewarn 'for more information.'
-	fi
-
-	elog "For details on how version slotting works, please see"
-	elog "the wiki:"
-	elog
-	elog "  https://wiki.gentoo.org/wiki/PHP"
-	elog
-}
-
-pkg_postrm() {
-	# This serves two purposes. First, if we have just removed the last
-	# installed version of PHP, then this will remove any dead symlinks
-	# belonging to eselect-php. Second, if a user upgrades slots from
-	# (say) 5.6 to 7.0 and depcleans the old slot, then this will update
-	# his existing symlinks to point to the new 7.0 installation. The
-	# latter is bug 432962.
-	#
-	# Note: the eselect-php package may not be installed at this point,
-	# so we can't die() if this command fails.
-	eselect php cleanup
-}

diff --git a/dev-lang/php/php-7.0.33.ebuild b/dev-lang/php/php-7.0.33.ebuild
deleted file mode 100644
index 2974d4b991d..00000000000
--- a/dev-lang/php/php-7.0.33.ebuild
+++ /dev/null
@@ -1,754 +0,0 @@
-# Copyright 1999-2018 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="7"
-
-inherit flag-o-matic systemd
-
-DESCRIPTION="The PHP language runtime engine"
-HOMEPAGE="https://secure.php.net/"
-SRC_URI="https://php.net/distributions/${P}.tar.xz"
-
-LICENSE="PHP-3.01
-	BSD
-	Zend-2.0
-	bcmath? ( LGPL-2.1+ )
-	fpm? ( BSD-2 )
-	gd? ( gd )
-	unicode? ( BSD-2 LGPL-2.1 )"
-
-SLOT="$(ver_cut 1-2)"
-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"
-
-# We can build the following SAPIs in the given order
-SAPIS="embed cli cgi fpm apache2 phpdbg"
-
-# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
-IUSE="${IUSE}
-	${SAPIS/cli/+cli}
-	threads"
-
-IUSE="${IUSE} acl bcmath berkdb bzip2 calendar cdb cjk
-	coverage crypt +ctype curl debug
-	enchant exif +fileinfo +filter firebird
-	flatfile ftp gd gdbm gmp +hash +iconv imap inifile
-	intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl
-	mhash mssql mysql mysqli nls
-	oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
-	readline recode selinux +session sharedmem
-	+simplexml snmp soap sockets spell sqlite ssl
-	sysvipc systemd tidy +tokenizer truetype unicode wddx webp
-	+xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib"
-
-# The supported (that is, autodetected) versions of BDB are listed in
-# the ./configure script. Other versions *work*, but we need to stick to
-# the ones that can be detected to avoid a repeat of bug #564824.
-COMMON_DEPEND="
-	>=app-eselect/eselect-php-0.9.1[apache2?,fpm?]
-	>=dev-libs/libpcre-8.32[unicode]
-	fpm? ( acl? ( sys-apps/acl ) )
-	apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=]
-		<www-servers/apache-2.4[threads=] ) )
-	berkdb? ( || ( sys-libs/db:5.3
-					sys-libs/db:5.1
-					sys-libs/db:4.8
-					sys-libs/db:4.7
-					sys-libs/db:4.6
-					sys-libs/db:4.5 ) )
-	bzip2? ( app-arch/bzip2:0= )
-	cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
-	cjk? ( !gd? (
-		virtual/jpeg:0
-		media-libs/libpng:0=
-		sys-libs/zlib:0=
-	) )
-	coverage? ( dev-util/lcov )
-	crypt? ( >=dev-libs/libmcrypt-2.4 )
-	curl? ( >=net-misc/curl-7.10.5 )
-	enchant? ( app-text/enchant )
-	exif? ( !gd? (
-		virtual/jpeg:0
-		media-libs/libpng:0=
-		sys-libs/zlib:0=
-	) )
-	firebird? ( dev-db/firebird )
-	gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib:0= )
-	gdbm? ( >=sys-libs/gdbm-1.8.0:0= )
-	gmp? ( dev-libs/gmp:0= )
-	iconv? ( virtual/libiconv )
-	imap? ( virtual/imap-c-client[kerberos=,ssl=] )
-	intl? ( dev-libs/icu:= )
-	iodbc? ( dev-db/libiodbc )
-	kerberos? ( virtual/krb5 )
-	ldap? ( >=net-nds/openldap-1.2.11 )
-	ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 )
-	libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) )
-	mssql? ( dev-db/freetds[mssql] )
-	nls? ( sys-devel/gettext )
-	oci8-instant-client? ( dev-db/oracle-instantclient-basic )
-	odbc? ( >=dev-db/unixODBC-1.8.13 )
-	postgres? ( dev-db/postgresql:* )
-	qdbm? ( dev-db/qdbm )
-	readline? ( sys-libs/readline:0= )
-	recode? ( app-text/recode )
-	sharedmem? ( dev-libs/mm )
-	simplexml? ( >=dev-libs/libxml2-2.6.8 )
-	snmp? ( >=net-analyzer/net-snmp-5.2 )
-	soap? ( >=dev-libs/libxml2-2.6.8 )
-	spell? ( >=app-text/aspell-0.50 )
-	sqlite? ( >=dev-db/sqlite-3.7.6.3 )
-	ssl? (
-		!libressl? ( dev-libs/openssl:0= )
-		libressl? ( dev-libs/libressl:0= )
-	)
-	tidy? ( app-text/htmltidy )
-	truetype? (
-		=media-libs/freetype-2*
-		!gd? (
-			virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib:0= )
-	)
-	unicode? ( dev-libs/oniguruma:= )
-	wddx? ( >=dev-libs/libxml2-2.6.8 )
-	webp? ( media-libs/libwebp:0= )
-	xml? ( >=dev-libs/libxml2-2.6.8 )
-	xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
-	xmlreader? ( >=dev-libs/libxml2-2.6.8 )
-	xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
-	xpm? (
-		x11-libs/libXpm
-		virtual/jpeg:0
-		media-libs/libpng:0= sys-libs/zlib:0=
-	)
-	xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
-	zip? ( sys-libs/zlib:0= )
-	zlib? ( sys-libs/zlib:0= )
-"
-
-RDEPEND="${COMMON_DEPEND}
-	virtual/mta
-	fpm? (
-		selinux? ( sec-policy/selinux-phpfpm )
-		systemd? ( sys-apps/systemd ) )"
-
-DEPEND="${COMMON_DEPEND}
-	app-arch/xz-utils
-	>=sys-devel/bison-3.0.1
-	sys-devel/flex
-	>=sys-devel/m4-1.4.3
-	>=sys-devel/libtool-1.5.18"
-
-# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
-REQUIRED_USE="
-	|| ( cli cgi fpm apache2 embed phpdbg )
-	cli? ( ^^ ( readline libedit ) )
-	truetype? ( gd zlib )
-	webp? ( gd zlib )
-	cjk? ( gd zlib )
-	exif? ( gd zlib )
-	xpm? ( gd zlib )
-	gd? ( zlib )
-	simplexml? ( xml )
-	soap? ( xml )
-	wddx? ( xml )
-	xmlrpc? ( || ( xml iconv ) )
-	xmlreader? ( xml )
-	xslt? ( xml )
-	ldap-sasl? ( ldap )
-	mhash? ( hash )
-	phar? ( hash )
-	qdbm? ( !gdbm )
-	readline? ( !libedit )
-	recode? ( !imap !mysqli !mysql )
-	sharedmem? ( !threads )
-	mysql? ( || ( mysqli pdo ) )
-"
-
-PATCHES=(
-	"${FILESDIR}/mbstring-oniguruma-6.8.patch"
-	# hopefully upstream will include the same version check fixes in upcoming releases
-	# patch added 20180429
-	"${FILESDIR}/libressl-compatibility.patch"
-	"${FILESDIR}/php-freetype-2.9.1.patch"
-	"${FILESDIR}/php-7.0.33-intl-detect-icu-via-pkg-config.patch"
-	"${FILESDIR}/php-7.0.33-intl-use-icu-namespace.patch"
-	"${FILESDIR}/php-7.0.33-intl-icu-memory-corruption.patch"
-)
-
-PHP_MV="$(ver_cut 1)"
-
-php_install_ini() {
-	local phpsapi="${1}"
-
-	# work out where we are installing the ini file
-	php_set_ini_dir "${phpsapi}"
-
-	# Always install the production INI file, bug 611214.
-	local phpinisrc="php.ini-production-${phpsapi}"
-	cp php.ini-production "${phpinisrc}" || die
-
-	# default to /tmp for save_path, bug #282768
-	sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die
-
-	# Set the extension dir
-	sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \
-		-i "${phpinisrc}" || die
-
-	# Set the include path to point to where we want to find PEAR packages
-	sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die
-
-	dodir "${PHP_INI_DIR#${EPREFIX}}"
-	insinto "${PHP_INI_DIR#${EPREFIX}}"
-	newins "${phpinisrc}" php.ini
-
-	elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}"
-	elog
-
-	dodir "${PHP_EXT_INI_DIR#${EPREFIX}}"
-	dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}"
-
-	if use opcache; then
-		elog "Adding opcache to $PHP_EXT_INI_DIR"
-		echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \
-			 "${D}/${PHP_EXT_INI_DIR}"/opcache.ini
-		dosym "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" \
-			  "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini"
-	fi
-
-	# SAPI-specific handling
-	if [[ "${sapi}" == "fpm" ]] ; then
-		einfo "Installing FPM config files php-fpm.conf and www.conf"
-		insinto "${PHP_INI_DIR#${EPREFIX}}"
-		doins sapi/fpm/php-fpm.conf
-		insinto "${PHP_INI_DIR#${EPREFIX}}/fpm.d"
-		doins sapi/fpm/www.conf
-	fi
-
-	dodoc php.ini-{development,production}
-}
-
-php_set_ini_dir() {
-	PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}"
-	PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
-	PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
-}
-
-src_prepare() {
-	default
-
-	# In php-7.x, the FPM pool configuration files have been split off
-	# of the main config. By default the pool config files go in
-	# e.g. /etc/php-fpm.d, which isn't slotted. So here we move the
-	# include directory to a subdirectory "fpm.d" of $PHP_INI_DIR. Later
-	# we'll install the pool configuration file "www.conf" there.
-	php_set_ini_dir fpm
-	sed -i "s~^include=.*$~include=${PHP_INI_DIR}/fpm.d/*.conf~" \
-		sapi/fpm/php-fpm.conf.in \
-		|| die 'failed to move the include directory in php-fpm.conf'
-}
-
-src_configure() {
-	addpredict /usr/share/snmp/mibs/.index #nowarn
-	addpredict /var/lib/net-snmp/mib_indexes #nowarn
-
-	PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
-
-	# The php-fpm config file wants localstatedir to be ${EPREFIX}/var
-	# and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002.
-	local our_conf=(
-		--prefix="${PHP_DESTDIR}"
-		--mandir="${PHP_DESTDIR}/man"
-		--infodir="${PHP_DESTDIR}/info"
-		--libdir="${PHP_DESTDIR}/lib"
-		--with-libdir="$(get_libdir)"
-		--localstatedir="${EPREFIX}/var"
-		--without-pear
-		$(use_enable threads maintainer-zts)
-	)
-
-	our_conf+=(
-		$(use_enable bcmath bcmath)
-		$(use_with bzip2 bz2 "${EPREFIX}/usr")
-		$(use_enable calendar calendar)
-		$(use_enable coverage gcov)
-		$(use_enable ctype ctype)
-		$(use_with curl curl "${EPREFIX}/usr")
-		$(use_enable xml dom)
-		$(use_with enchant enchant "${EPREFIX}/usr")
-		$(use_enable exif exif)
-		$(use_enable fileinfo fileinfo)
-		$(use_enable filter filter)
-		$(use_enable ftp ftp)
-		$(use_with nls gettext "${EPREFIX}/usr")
-		$(use_with gmp gmp "${EPREFIX}/usr")
-		$(use_enable hash hash)
-		$(use_with mhash mhash "${EPREFIX}/usr")
-		$(use_with iconv iconv \
-			$(use elibc_glibc || use elibc_musl || use elibc_FreeBSD || echo "${EPREFIX}/usr"))
-		$(use_enable intl intl)
-		$(use_enable ipv6 ipv6)
-		$(use_enable json json)
-		$(use_with kerberos kerberos "${EPREFIX}/usr")
-		$(use_enable xml libxml)
-		$(use_with xml libxml-dir "${EPREFIX}/usr")
-		$(use_enable unicode mbstring)
-		$(use_with crypt mcrypt "${EPREFIX}/usr")
-		$(use_with unicode onig "${EPREFIX}/usr")
-		$(use_with ssl openssl "${EPREFIX}/usr")
-		$(use_with ssl openssl-dir "${EPREFIX}/usr")
-		$(use_enable pcntl pcntl)
-		$(use_enable phar phar)
-		$(use_enable pdo pdo)
-		$(use_enable opcache opcache)
-		$(use_with postgres pgsql "${EPREFIX}/usr")
-		$(use_enable posix posix)
-		$(use_with spell pspell "${EPREFIX}/usr")
-		$(use_with recode recode "${EPREFIX}/usr")
-		$(use_enable simplexml simplexml)
-		$(use_enable sharedmem shmop)
-		$(use_with snmp snmp "${EPREFIX}/usr")
-		$(use_enable soap soap)
-		$(use_enable sockets sockets)
-		$(use_with sqlite sqlite3 "${EPREFIX}/usr")
-		$(use_enable sysvipc sysvmsg)
-		$(use_enable sysvipc sysvsem)
-		$(use_enable sysvipc sysvshm)
-		$(use_with tidy tidy "${EPREFIX}/usr")
-		$(use_enable tokenizer tokenizer)
-		$(use_enable wddx wddx)
-		$(use_enable xml xml)
-		$(use_enable xmlreader xmlreader)
-		$(use_enable xmlwriter xmlwriter)
-		$(use_with xmlrpc xmlrpc)
-		$(use_with xslt xsl "${EPREFIX}/usr")
-		$(use_enable zip zip)
-		$(use_with zlib zlib "${EPREFIX}/usr")
-		$(use_enable debug debug)
-	)
-
-	# DBA support
-	if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
-		|| use qdbm ; then
-		our_conf+=( "--enable-dba${shared}" )
-	fi
-
-	# DBA drivers support
-	our_conf+=(
-		$(use_with cdb cdb)
-		$(use_with berkdb db4 "${EPREFIX}/usr")
-		$(use_enable flatfile flatfile)
-		$(use_with gdbm gdbm "${EPREFIX}/usr")
-		$(use_enable inifile inifile)
-		$(use_with qdbm qdbm "${EPREFIX}/usr")
-	)
-
-	# Support for the GD graphics library
-	our_conf+=(
-		$(use_with truetype freetype-dir "${EPREFIX}/usr")
-		$(use_enable cjk gd-jis-conv)
-		$(use_with gd jpeg-dir "${EPREFIX}/usr")
-		$(use_with gd png-dir "${EPREFIX}/usr")
-		$(use_with xpm xpm-dir "${EPREFIX}/usr")
-	)
-	if use webp; then
-		our_conf+=( --with-webp-dir="${EPREFIX}/usr" )
-	fi
-	# enable gd last, so configure can pick up the previous settings
-	our_conf+=( $(use_with gd gd) )
-
-	# IMAP support
-	if use imap ; then
-		our_conf+=(
-			$(use_with imap imap "${EPREFIX}/usr")
-			$(use_with ssl imap-ssl "${EPREFIX}/usr")
-		)
-	fi
-
-	# Interbase/firebird support
-	our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") )
-
-	# LDAP support
-	if use ldap ; then
-		our_conf+=(
-			$(use_with ldap ldap "${EPREFIX}/usr")
-			$(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr")
-		)
-	fi
-
-	# MySQL support
-	local mysqllib="mysqlnd"
-	local mysqlilib="mysqlnd"
-
-	our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
-
-	local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock"
-	if use mysql || use mysqli ; then
-		our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") )
-	fi
-
-	# ODBC support
-	our_conf+=(
-		$(use_with odbc unixODBC "${EPREFIX}/usr")
-		$(use_with iodbc iodbc "${EPREFIX}/usr")
-	)
-
-	# Oracle support
-	our_conf+=( $(use_with oci8-instant-client oci8) )
-
-	# PDO support
-	if use pdo ; then
-		our_conf+=(
-			$(use_with mssql pdo-dblib "${EPREFIX}/usr")
-			$(use_with mysql pdo-mysql "${mysqllib}")
-			$(use_with postgres pdo-pgsql)
-			$(use_with sqlite pdo-sqlite "${EPREFIX}/usr")
-			$(use_with firebird pdo-firebird "${EPREFIX}/usr")
-			$(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr")
-			$(use_with oci8-instant-client pdo-oci)
-		)
-	fi
-
-	# readline/libedit support
-	our_conf+=(
-		$(use_with readline readline "${EPREFIX}/usr")
-		$(use_with libedit libedit "${EPREFIX}/usr")
-	)
-
-	# Session support
-	if use session ; then
-		our_conf+=( $(use_with sharedmem mm "${EPREFIX}/usr") )
-	else
-		our_conf+=( $(use_enable session session) )
-	fi
-
-	# Use pic for shared modules such as apache2's mod_php
-	our_conf+=( --with-pic )
-
-	# we use the system copy of pcre
-	# --with-pcre-regex affects ext/pcre
-	# --with-pcre-dir affects ext/filter and ext/zip
-	our_conf+=(
-		--with-pcre-regex="${EPREFIX}/usr"
-		--with-pcre-dir="${EPREFIX}/usr"
-	)
-
-	# Catch CFLAGS problems
-	# Fixes bug #14067.
-	# Changed order to run it in reverse for bug #32022 and #12021.
-	replace-cpu-flags "k6*" "i586"
-
-	# Cache the ./configure test results between SAPIs.
-	our_conf+=( --cache-file="${T}/config.cache" )
-
-	# Support user-passed configuration parameters
-	our_conf+=( ${EXTRA_ECONF:-} )
-
-	# Support the Apache2 extras, they must be set globally for all
-	# SAPIs to work correctly, especially for external PHP extensions
-
-	mkdir -p "${WORKDIR}/sapis-build" || die
-	for one_sapi in $SAPIS ; do
-		use "${one_sapi}" || continue
-		php_set_ini_dir "${one_sapi}"
-
-		# The BUILD_DIR variable is used to determine where to output
-		# the files that autotools creates. This was all originally
-		# based on the autotools-utils eclass.
-		BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}"
-		cp -a "${S}" "${BUILD_DIR}" || die
-		cd "${BUILD_DIR}" || die
-
-		local sapi_conf=(
-			--with-config-file-path="${PHP_INI_DIR}"
-			--with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}"
-		)
-
-		for sapi in $SAPIS ; do
-			case "$sapi" in
-				cli|cgi|embed|fpm|phpdbg)
-					if [[ "${one_sapi}" == "${sapi}" ]] ; then
-						sapi_conf+=( "--enable-${sapi}" )
-						if [[ "fpm" == "${sapi}" ]] ; then
-							sapi_conf+=(
-								$(use_with acl fpm-acl)
-								$(use_with systemd fpm-systemd)
-							)
-						fi
-					else
-						sapi_conf+=( "--disable-${sapi}" )
-					fi
-					;;
-
-				apache2)
-					if [[ "${one_sapi}" == "${sapi}" ]] ; then
-						sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" )
-					else
-						sapi_conf+=( --without-apxs2 )
-					fi
-					;;
-			esac
-		done
-
-		# Construct the $myeconfargs array by concatenating $our_conf
-		# (the common args) and $sapi_conf (the SAPI-specific args).
-		local myeconfargs=( "${our_conf[@]}" )
-		myeconfargs+=( "${sapi_conf[@]}" )
-
-		pushd "${BUILD_DIR}" > /dev/null || die
-		econf "${myeconfargs[@]}"
-		popd > /dev/null || die
-	done
-}
-
-src_compile() {
-	# snmp seems to run during src_compile, too (bug #324739)
-	addpredict /usr/share/snmp/mibs/.index #nowarn
-	addpredict /var/lib/net-snmp/mib_indexes #nowarn
-
-	for sapi in ${SAPIS} ; do
-		if use "${sapi}"; then
-			cd "${WORKDIR}/sapis-build/$sapi" || \
-				die "Failed to change dir to ${WORKDIR}/sapis-build/$1"
-			emake
-		fi
-	done
-}
-
-src_install() {
-	# see bug #324739 for what happens when we don't have that
-	addpredict /usr/share/snmp/mibs/.index #nowarn
-
-	# grab the first SAPI that got built and install common files from there
-	local first_sapi=""
-	for sapi in $SAPIS ; do
-		if use $sapi ; then
-			first_sapi=$sapi
-			break
-		fi
-	done
-
-	# Makefile forgets to create this before trying to write to it...
-	dodir "${PHP_DESTDIR#${EPREFIX}}/bin"
-
-	# Install php environment (without any sapis)
-	cd "${WORKDIR}/sapis-build/$first_sapi" || die
-	emake INSTALL_ROOT="${D}" \
-		install-build install-headers install-programs
-
-	local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)"
-
-	# Create the directory where we'll put version-specific php scripts
-	keepdir "/usr/share/php${PHP_MV}"
-
-	local sapi="", file=""
-	local sapi_list=""
-
-	for sapi in ${SAPIS}; do
-		if use "${sapi}" ; then
-			einfo "Installing SAPI: ${sapi}"
-			cd "${WORKDIR}/sapis-build/${sapi}" || die
-
-			if [[ "${sapi}" == "apache2" ]] ; then
-				# We're specifically not using emake install-sapi as libtool
-				# may cause unnecessary relink failures (see bug #351266)
-				insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/"
-				newins ".libs/libphp${PHP_MV}$(get_libname)" \
-					   "libphp${PHP_MV}$(get_libname)"
-				keepdir "/usr/$(get_libdir)/apache2/modules"
-			else
-				# needed each time, php_install_ini would reset it
-				local dest="${PHP_DESTDIR#${EPREFIX}}"
-				into "${dest}"
-				case "$sapi" in
-					cli)
-						source="sapi/cli/php"
-						;;
-					cgi)
-						source="sapi/cgi/php-cgi"
-						;;
-					fpm)
-						source="sapi/fpm/php-fpm"
-						;;
-					embed)
-						source="libs/libphp${PHP_MV}$(get_libname)"
-						;;
-					phpdbg)
-						source="sapi/phpdbg/phpdbg"
-						;;
-					*)
-						die "unhandled sapi in src_install"
-						;;
-				esac
-
-				if [[ "${source}" == *"$(get_libname)" ]]; then
-					dolib.so "${source}"
-				else
-					dobin "${source}"
-					local name="$(basename ${source})"
-					dosym "${dest}/bin/${name}" "/usr/bin/${name}${SLOT}"
-				fi
-			fi
-
-			php_install_ini "${sapi}"
-
-			# construct correct SAPI string for php-config
-			# thanks to ferringb for the bash voodoo
-			if [[ "${sapi}" == "apache2" ]]; then
-				sapi_list="${sapi_list:+${sapi_list} }apache2handler"
-			else
-				sapi_list="${sapi_list:+${sapi_list} }${sapi}"
-			fi
-		fi
-	done
-
-	# Installing opcache module
-	if use opcache ; then
-		into "${PHP_DESTDIR#${EPREFIX}}"
-		dolib.so "modules/opcache$(get_libname)"
-	fi
-
-	# Install env.d files
-	newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}"
-	sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
-	sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
-
-	# set php-config variable correctly (bug #278439)
-	sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \
-		"${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die
-
-	if use fpm ; then
-		if use systemd; then
-			systemd_newunit "${FILESDIR}/php-fpm_at.service" \
-							"php-fpm@${SLOT}.service"
-		else
-			systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \
-							"php-fpm@${SLOT}.service"
-		fi
-	fi
-}
-
-src_test() {
-	echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
-	PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
-	if [[ ! -x "${PHP_BIN}" ]] ; then
-		ewarn "Test phase requires USE=cli, skipping"
-		return
-	else
-		export TEST_PHP_EXECUTABLE="${PHP_BIN}"
-	fi
-
-	if [[ -x "${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" ]] ; then
-		export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi"
-	fi
-
-	if [[ -x "${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" ]] ; then
-		export TEST_PHPDBG_EXECUTABLE="${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg"
-	fi
-
-	REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n  -d \
-					  "session.save_path=${T}" \
-					  "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \
-					  "session.save_path=${T}"
-
-	for name in ${EXPECTED_TEST_FAILURES}; do
-		mv "${name}.out" "${name}.out.orig" 2>/dev/null || die
-	done
-
-	local failed="$(find -name '*.out')"
-	if [[ ${failed} != "" ]] ; then
-		ewarn "The following test cases failed unexpectedly:"
-		for name in ${failed}; do
-			ewarn "  ${name/.out/}"
-		done
-	else
-		einfo "No unexpected test failures, all fine"
-	fi
-
-	if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
-		local passed=""
-		for name in ${EXPECTED_TEST_FAILURES}; do
-			[[ -f "${name}.diff" ]] && continue
-			passed="${passed} ${name}"
-		done
-		if [[ ${passed} != "" ]] ; then
-			einfo "The following test cases passed unexpectedly:"
-			for name in ${passed}; do
-				ewarn "  ${passed}"
-			done
-		else
-			einfo "None of the known-to-fail tests passed, all fine"
-		fi
-	fi
-}
-
-pkg_postinst() {
-	# Output some general info to the user
-	if use apache2 ; then
-		elog
-		elog "To enable PHP in apache, you will need to add \"-D PHP\" to"
-		elog "your apache2 command. OpenRC users can append that string to"
-		elog "APACHE2_OPTS in /etc/conf.d/apache2."
-		elog
-		elog "The apache module configuration file 70_mod_php.conf is"
-		elog "provided (and maintained) by eselect-php."
-		elog
-	fi
-
-	# Create the symlinks for php
-	for m in ${SAPIS}; do
-		[[ ${m} == 'embed' ]] && continue;
-		if use $m ; then
-			local ci=$(eselect php show $m)
-			if [[ -z $ci ]]; then
-				eselect php set $m php${SLOT} || die
-				einfo "Switched ${m} to use php:${SLOT}"
-				einfo
-			elif [[ $ci != "php${SLOT}" ]] ; then
-				elog "To switch $m to use php:${SLOT}, run"
-				elog "    eselect php set $m php${SLOT}"
-				elog
-			fi
-		fi
-	done
-
-	# Remove dead symlinks for SAPIs that were just disabled. For
-	# example, if the user has the cgi SAPI enabled, then he has an
-	# eselect-php symlink for it. If he later reinstalls PHP with
-	# USE="-cgi", that symlink will break. This call to eselect is
-	# supposed to remove that dead link per bug 572436.
-	eselect php cleanup || die
-
-	if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then
-	   elog "To build extensions for this version of PHP, you will need to"
-	   elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable."
-	   elog
-	fi
-
-	# Warn about the removal of PHP_INI_VERSION if the user has it set.
-	if [[ -n "${PHP_INI_VERSION}" ]]; then
-		ewarn 'The PHP_INI_VERSION variable has been phased out. You may'
-		ewarn 'remove it from your configuration at your convenience. See'
-		ewarn
-		ewarn '  https://bugs.gentoo.org/611214'
-		ewarn
-		ewarn 'for more information.'
-	fi
-
-	elog "For details on how version slotting works, please see"
-	elog "the wiki:"
-	elog
-	elog "  https://wiki.gentoo.org/wiki/PHP"
-	elog
-}
-
-pkg_postrm() {
-	# This serves two purposes. First, if we have just removed the last
-	# installed version of PHP, then this will remove any dead symlinks
-	# belonging to eselect-php. Second, if a user upgrades slots from
-	# (say) 5.6 to 7.0 and depcleans the old slot, then this will update
-	# his existing symlinks to point to the new 7.0 installation. The
-	# latter is bug 432962.
-	#
-	# Note: the eselect-php package may not be installed at this point,
-	# so we can't die() if this command fails.
-	eselect php cleanup
-}


^ permalink raw reply related	[flat|nested] 21+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-lang/php/files/, dev-lang/php/
@ 2019-02-06 18:26 Thomas Deutschmann
  0 siblings, 0 replies; 21+ messages in thread
From: Thomas Deutschmann @ 2019-02-06 18:26 UTC (permalink / raw
  To: gentoo-commits

commit:     95c0ba4995b7c9d11f5525da518fa082def059c9
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Wed Feb  6 18:25:45 2019 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Wed Feb  6 18:26:00 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=95c0ba49

dev-lang/php: bump to v7.3.2

- Fix iptcembed [bug 77546]

Bug: https://bugs.php.net/bug.php?id=77546
Package-Manager: Portage-2.3.59, Repoman-2.3.12
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>

 dev-lang/php/Manifest                              |   1 +
 .../files/php-7.3.2-fix-iptcembed-bug77546.patch   | 127 ++++
 dev-lang/php/php-7.3.2.ebuild                      | 749 +++++++++++++++++++++
 3 files changed, 877 insertions(+)

diff --git a/dev-lang/php/Manifest b/dev-lang/php/Manifest
index 0197e3ec413..892bc832a35 100644
--- a/dev-lang/php/Manifest
+++ b/dev-lang/php/Manifest
@@ -5,3 +5,4 @@ DIST php-7.0.33.tar.xz 12033040 BLAKE2B cb7a4eb3ba8ede93ae8e85b6a11664f33654f7e9
 DIST php-7.1.26.tar.xz 12206956 BLAKE2B af78f764349a05905d7db22260c8a6415a2755b29e0dd01225160235b3b38ea76c8910d79c69798aa2de3fc6d4d41e45ab951161b54e62753111f81ac9d85bc2 SHA512 3c80dce2d5dcbf6f253ca4ca4e4ce01fdd3a3d31a6e6045f539fefadc1ea3c391d4d4995600a4ff758ab0361e0ec2244e2eaa6591ecb3e9b8e8a9c44f67a5b32
 DIST php-7.2.14.tar.xz 12156460 BLAKE2B 88727241ca3fd68238ce50dcb4c12868f8e6df54213b04dba7650c5f98c3f18a3d02e0a191c0ebd13d85c83cc686fef60135f69ca7cc3e425bd5d7f80035fdd7 SHA512 13f2c97b730e3e872bd24bcc004c6cff5e2cc633c37a4eb60b8b5d1d4454bc5985f7d52943448d61cf4a227c64be770edc5eadd2c9612b297d71c0840b4b1259
 DIST php-7.3.1.tar.xz 11944376 BLAKE2B 55b3192774c08b1e4c6621e16176a1e352ff6ba5540794a5d769b6416929723638f1409f2f8224c7fe3db99c9b020fa51db7b78d50eaa00e790308562a0a5334 SHA512 0663d90537fe3901cad00ba1056782050b8a61e8edb49f01851add4992df21d23aee3e9468e32b76b7f53ffd513f1ba10c9513c549e247d796416ed176355348
+DIST php-7.3.2.tar.xz 11966760 BLAKE2B bb913e754e86ebbbef641d0516eb1fff7dfd7d7fe54776d4de0312175cdbc292694addd60e8ad863726796d482517e9312d83754eb70201de1a8a21e892cd87e SHA512 e49eaf1f0811098910beddc407d5047e09a0f528baf4b62f2a42e8faba9d3d7a0ae82a0fd7a5bec265e22ef1bcf0cdcc4e9f0a521258412405923800798cba66

diff --git a/dev-lang/php/files/php-7.3.2-fix-iptcembed-bug77546.patch b/dev-lang/php/files/php-7.3.2-fix-iptcembed-bug77546.patch
new file mode 100644
index 00000000000..e157d250f2f
--- /dev/null
+++ b/dev-lang/php/files/php-7.3.2-fix-iptcembed-bug77546.patch
@@ -0,0 +1,127 @@
+https://git.php.net/?p=php-src.git;a=commit;h=f27f9022660d28c13c6209f4679768dcbd961b43
+
+--- a/ext/standard/iptc.c
++++ b/ext/standard/iptc.c
+@@ -273,7 +273,7 @@ PHP_FUNCTION(iptcembed)
+ 					iptcdata_len++; /* make the length even */
+ 				}
+ 
+-				psheader[ 2 ] = (char) (iptcdata_len+28)>>8;
++				psheader[ 2 ] = (char) ((iptcdata_len+28)>>8);
+ 				psheader[ 3 ] = (iptcdata_len+28)&0xff;
+ 
+ 				for (inx = 0; inx < 28; inx++) {
+--- /dev/null
++++ b/ext/standard/tests/image/iptcembed_002.phpt
+@@ -0,0 +1,110 @@
++--TEST--
++iptcembed() valid jpg stream
++--FILE--
++<?php
++/*
++# source code to generate base64 use behind as $base64_1x1_jpeg
++# we don't want to be gd library dependant for this test
++$file="1x1.jpg";
++$ret=imagejpeg(imagecreatetruecolor(1, 1), $file, 100);
++echo md5(file_get_contents($file)).PHP_EOL;
++echo base64_encode(file_get_contents($file)).PHP_EOL;
++unlink($file);
++*/
++
++/*
++test description :
++1) create local file 1x1 jpeg (without iptc) (use base64 content to create file)
++2) generate iptcdata string with function iptc_make_tag describe behind
++3) use iptcembed php function with our 1x1 jpeg file and our iptcdata string
++4) write local file2 with iptcembed return content
++5) various check on file2 to verify that's a valid jpeg file with our tags
++*/
++
++
++#iptc_make_tag function from http://php.net/iptcembed
++function iptc_make_tag($rec, $data, $value)
++  {
++    $length = strlen($value);
++    $retval = chr(0x1C) . chr($rec) . chr($data);
++    if($length < 0x8000) { $retval .= chr($length >> 8) .  chr($length & 0xFF); }
++    else { $retval .= chr(0x80) .  chr(0x04) .  chr(($length >> 24) & 0xFF) .  chr(($length >> 16) & 0xFF) .  chr(($length >> 8) & 0xFF) .  chr($length & 0xFF); }
++    return $retval . $value;
++  }
++
++
++$file="1x1.jpg";
++$file2="1x1_with_iptc_tags.jpg";
++$base64_1x1_jpeg="/9j/4AAQSkZJRgABAQEAYABgAAD//gA8Q1JFQVRPUjogZ2QtanBlZyB2MS4wICh1c2luZyBJSkcgSlBFRyB2ODApLCBxdWFsaXR5ID0gMTAwCv/bAEMAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/bAEMBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAEAAQMBEQACEQEDEQH/xAAfAAABBQEBAQEBAQAAAAAAAAAAAQIDBAUGBwgJCgv/xAC1EAACAQMDAgQDBQUEBAAAAX0BAgMABBEFEiExQQYTUWEHInEUMoGRoQgjQrHBFVLR8CQzYnKCCQoWFxgZGiUmJygpKjQ1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4eLj5OXm5+jp6vHy8/T19vf4+fr/xAAfAQADAQEBAQEBAQEBAAAAAAAAAQIDBAUGBwgJCgv/xAC1EQACAQIEBAMEBwUEBAABAncAAQIDEQQFITEGEkFRB2FxEyIygQgUQpGhscEJIzNS8BVictEKFiQ04SXxFxgZGiYnKCkqNTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqCg4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2dri4+Tl5ufo6ery8/T19vf4+fr/2gAMAwEAAhEDEQA/AP8AP/oA/9k=";
++#write file
++$fd=fopen($file,"wb");
++if ($fd) { fputs($fd,base64_decode($base64_1x1_jpeg)); fclose($fd); }
++else { echo "error cant write $file".PHP_EOL;exit(1); }
++#check file md5
++$md5=md5_file($file);
++if ($md5!="07dd8594450e8c18ab8a79d7cb4573c7") { echo "md5 error".PHP_EOL;exit(1); }
++#check jpeg properties
++list($width, $height, $type, $attr) = getimagesize($file,$info);
++if ($width!=1) { echo "width error".PHP_EOL;exit(1); }
++if ($height!=1) { echo "height error".PHP_EOL;exit(1); }
++if ($type!=2) { echo "type error".PHP_EOL;exit(1); }
++if (!isset($info["APP0"])) { echo "APP0 error".PHP_EOL;exit(1); }
++
++#our iptc tags
++$tags=array();
++$tags["2#105"]= "Tauren";
++$tags["2#120"]= "Tauren with Trunk";
++$tags["2#110"]= "Copyright 2004-2016, Blizzard";
++$tags["2#025"]= "Tauren, Chaman, Blizzard";
++$tags["2#090"]= "Thunder Bluffs";
++#feed iptc string for iptcembed
++$iptc='';
++foreach ($tags as $tag => $string) { $rec=$tag[0]; $tag = substr($tag, 2); $iptc .= iptc_make_tag($rec, $tag, $string); }
++#check iptc string md5
++if (md5(base64_encode($iptc))!="7056c4b3060f92a4f9e5b7d0caa61859") { echo "iptc md5 error".PHP_EOL;exit(1); }
++
++#use iptcembed to get jpeg stream content with iptc tags
++$content = iptcembed($iptc, $file,0);
++
++#write new image with iptc tags
++if ($content === false) {echo "iptcembed error".PHP_EOL;exit(1); }
++$fd=fopen($file2,"wb");
++if ($fd) { fputs($fd,$content); fclose($fd); }
++else { echo "error cant write $file2".PHP_EOL;exit(1); }
++
++
++#check jpeg properties for new image with iptc tags
++echo "new generated image with itpc tags : $file2".PHP_EOL;
++$ret = getimagesize($file2,$info);
++if ($ret===false) { echo "getimagesize error".PHP_EOL;exit(1); }
++list($width, $height, $type, $attr) = $ret;
++if ($width!=1) { echo "width error".PHP_EOL;exit(1); }
++if ($height!=1) { echo "height error".PHP_EOL;exit(1); }
++if ($type!=2) { echo "type error".PHP_EOL;exit(1); }
++if (!isset($info["APP0"])) { echo "APP0 error".PHP_EOL;exit(1); }
++if (!isset($info["APP13"])) { echo "APP13 error".PHP_EOL;exit(1); }
++
++$error=0;
++$iptc_data_from_created_image = iptcparse($info['APP13']);
++foreach ($tags as $tag => $string) {
++  #check if tag exists
++  if (!isset($iptc_data_from_created_image[$tag])) {
++    echo "error iptc tag $tag not found".PHP_EOL;
++    $error++;
++  } else {
++    #check value
++    if ($iptc_data_from_created_image[$tag][0]!=$string) {
++      echo "error tag $tag : bad value ($string != ".$iptc_data_from_created_image[$tag][0].")".PHP_EOL;
++      $error++;
++    }
++  }
++}
++#clean before exit
++@unlink($file);
++@unlink($file2);
++if ($error==0) { echo "OK".PHP_EOL;exit(0);}
++echo "something wrong: $error errors".PHP_EOL;
++?>
++--EXPECT--
++new generated image with itpc tags : 1x1_with_iptc_tags.jpg
++OK
+-- 

diff --git a/dev-lang/php/php-7.3.2.ebuild b/dev-lang/php/php-7.3.2.ebuild
new file mode 100644
index 00000000000..1b24d9164c0
--- /dev/null
+++ b/dev-lang/php/php-7.3.2.ebuild
@@ -0,0 +1,749 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit flag-o-matic eapi7-ver systemd autotools
+
+MY_PV=${PV/_rc/RC}
+DESCRIPTION="The PHP language runtime engine"
+HOMEPAGE="https://secure.php.net/"
+SRC_URI="https://secure.php.net/distributions/${P}.tar.xz"
+
+LICENSE="PHP-3.01
+	BSD
+	Zend-2.0
+	bcmath? ( LGPL-2.1+ )
+	fpm? ( BSD-2 )
+	gd? ( gd )
+	unicode? ( BSD-2 LGPL-2.1 )"
+
+SLOT="$(ver_cut 1-2)"
+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"
+
+S="${WORKDIR}/${PN}-${MY_PV}"
+
+# We can build the following SAPIs in the given order
+SAPIS="embed cli cgi fpm apache2 phpdbg"
+
+# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
+IUSE="${IUSE}
+	${SAPIS/cli/+cli}
+	threads"
+
+IUSE="${IUSE} acl argon2 bcmath berkdb bzip2 calendar cdb cjk
+	coverage +ctype curl debug
+	enchant exif +fileinfo +filter firebird
+	flatfile ftp gd gdbm gmp +hash +iconv imap inifile
+	intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl lmdb
+	mhash mssql mysql mysqli nls
+	oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
+	readline recode selinux +session session-mm sharedmem
+	+simplexml snmp soap sockets sodium spell sqlite ssl
+	sysvipc systemd test tidy +tokenizer tokyocabinet truetype unicode wddx webp
+	+xml xmlreader xmlwriter xmlrpc xpm xslt zip zip-encryption zlib"
+
+# The supported (that is, autodetected) versions of BDB are listed in
+# the ./configure script. Other versions *work*, but we need to stick to
+# the ones that can be detected to avoid a repeat of bug #564824.
+COMMON_DEPEND="
+	>=app-eselect/eselect-php-0.9.1[apache2?,fpm?]
+	>=dev-libs/libpcre2-10.30[unicode]
+	fpm? ( acl? ( sys-apps/acl ) )
+	apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=]
+		<www-servers/apache-2.4[threads=] ) )
+	argon2? ( app-crypt/argon2:= )
+	berkdb? ( || (	sys-libs/db:5.3
+					sys-libs/db:5.1
+					sys-libs/db:4.8
+					sys-libs/db:4.7
+					sys-libs/db:4.6
+					sys-libs/db:4.5 ) )
+	bzip2? ( app-arch/bzip2:0= )
+	cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
+	coverage? ( dev-util/lcov )
+	curl? ( >=net-misc/curl-7.10.5 )
+	enchant? ( <app-text/enchant-2.0:0 )
+	firebird? ( dev-db/firebird )
+	gd? ( virtual/jpeg:0 media-libs/libpng:0= >=sys-libs/zlib-1.2.0.4 )
+	gdbm? ( >=sys-libs/gdbm-1.8.0:0= )
+	gmp? ( dev-libs/gmp:0= )
+	iconv? ( virtual/libiconv )
+	imap? ( virtual/imap-c-client[kerberos=,ssl=] )
+	intl? ( dev-libs/icu:= )
+	iodbc? ( dev-db/libiodbc )
+	kerberos? ( virtual/krb5 )
+	ldap? ( >=net-nds/openldap-1.2.11 )
+	ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 )
+	libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) )
+	lmdb? ( dev-db/lmdb:= )
+	mssql? ( dev-db/freetds[mssql] )
+	nls? ( sys-devel/gettext )
+	oci8-instant-client? ( dev-db/oracle-instantclient-basic )
+	odbc? ( >=dev-db/unixODBC-1.8.13 )
+	postgres? ( dev-db/postgresql:* )
+	qdbm? ( dev-db/qdbm )
+	readline? ( sys-libs/readline:0= )
+	recode? ( app-text/recode )
+	session-mm? ( dev-libs/mm )
+	simplexml? ( >=dev-libs/libxml2-2.6.8 )
+	snmp? ( >=net-analyzer/net-snmp-5.2 )
+	soap? ( >=dev-libs/libxml2-2.6.8 )
+	sodium? ( dev-libs/libsodium:= )
+	spell? ( >=app-text/aspell-0.50 )
+	sqlite? ( >=dev-db/sqlite-3.7.6.3 )
+	ssl? (
+		!libressl? ( >=dev-libs/openssl-1.0.1:0= )
+		libressl? ( dev-libs/libressl:0= )
+	)
+	tidy? ( || ( app-text/tidy-html5 app-text/htmltidy ) )
+	tokyocabinet? ( dev-db/tokyocabinet )
+	truetype? ( =media-libs/freetype-2* )
+	unicode? ( dev-libs/oniguruma:= )
+	wddx? ( >=dev-libs/libxml2-2.6.8 )
+	webp? ( media-libs/libwebp:0= )
+	xml? ( >=dev-libs/libxml2-2.6.8 )
+	xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
+	xmlreader? ( >=dev-libs/libxml2-2.6.8 )
+	xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
+	xpm? ( x11-libs/libXpm )
+	xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
+	zip? ( >=sys-libs/zlib-1.2.0.4:0= )
+	zip-encryption? ( >=dev-libs/libzip-1.2.0:= )
+	zlib? ( >=sys-libs/zlib-1.2.0.4:0= )
+"
+
+RDEPEND="${COMMON_DEPEND}
+	virtual/mta
+	fpm? (
+		selinux? ( sec-policy/selinux-phpfpm )
+		systemd? ( sys-apps/systemd ) )"
+
+# Bison isn't actually needed when building from a release tarball
+# However, the configure script will warn if it's absent or if you
+# have an incompatible version installed. See bug 593278.
+DEPEND="${COMMON_DEPEND}
+	app-arch/xz-utils
+	>=sys-devel/bison-3.0.1"
+
+# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
+REQUIRED_USE="
+	|| ( cli cgi fpm apache2 embed phpdbg )
+	cli? ( ^^ ( readline libedit ) )
+	truetype? ( gd zlib )
+	webp? ( gd zlib )
+	cjk? ( gd zlib )
+	exif? ( gd zlib )
+	xpm? ( gd zlib )
+	gd? ( zlib )
+	simplexml? ( xml )
+	soap? ( xml )
+	wddx? ( xml )
+	xmlrpc? ( || ( xml iconv ) )
+	xmlreader? ( xml )
+	xslt? ( xml )
+	ldap-sasl? ( ldap )
+	mhash? ( hash )
+	phar? ( hash )
+	qdbm? ( !gdbm )
+	readline? ( !libedit )
+	recode? ( !imap !mysqli !mysql )
+	session-mm? ( session !threads )
+	mysql? ( || ( mysqli pdo ) )
+	zip-encryption? ( zip )
+"
+PATCHES=(
+	"${FILESDIR}/php-freetype-2.9.1.patch"
+	"${FILESDIR}/php-7.3.2-fix-iptcembed-bug77546.patch"
+)
+
+PHP_MV="$(ver_cut 1)"
+
+php_install_ini() {
+	local phpsapi="${1}"
+
+	# work out where we are installing the ini file
+	php_set_ini_dir "${phpsapi}"
+
+	# Always install the production INI file, bug 611214.
+	local phpinisrc="php.ini-production-${phpsapi}"
+	cp php.ini-production "${phpinisrc}" || die
+
+	# default to /tmp for save_path, bug #282768
+	sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die
+
+	# Set the extension dir
+	sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \
+		-i "${phpinisrc}" || die
+
+	# Set the include path to point to where we want to find PEAR packages
+	sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die
+
+	dodir "${PHP_INI_DIR#${EPREFIX}}"
+	insinto "${PHP_INI_DIR#${EPREFIX}}"
+	newins "${phpinisrc}" php.ini
+
+	elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}"
+	elog
+
+	dodir "${PHP_EXT_INI_DIR#${EPREFIX}}"
+	dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}"
+
+	if use opcache; then
+		elog "Adding opcache to $PHP_EXT_INI_DIR"
+		echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \
+			 "${D}/${PHP_EXT_INI_DIR}"/opcache.ini
+		dosym "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" \
+			  "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini"
+	fi
+
+	# SAPI-specific handling
+	if [[ "${sapi}" == "fpm" ]] ; then
+		einfo "Installing FPM config files php-fpm.conf and www.conf"
+		insinto "${PHP_INI_DIR#${EPREFIX}}"
+		doins sapi/fpm/php-fpm.conf
+		insinto "${PHP_INI_DIR#${EPREFIX}}/fpm.d"
+		doins sapi/fpm/www.conf
+	fi
+
+	dodoc php.ini-{development,production}
+}
+
+php_set_ini_dir() {
+	PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}"
+	PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
+	PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
+}
+
+src_prepare() {
+	default
+
+	# In php-7.x, the FPM pool configuration files have been split off
+	# of the main config. By default the pool config files go in
+	# e.g. /etc/php-fpm.d, which isn't slotted. So here we move the
+	# include directory to a subdirectory "fpm.d" of $PHP_INI_DIR. Later
+	# we'll install the pool configuration file "www.conf" there.
+	php_set_ini_dir fpm
+	sed -i "s~^include=.*$~include=${PHP_INI_DIR}/fpm.d/*.conf~" \
+		sapi/fpm/php-fpm.conf.in \
+		|| die 'failed to move the include directory in php-fpm.conf'
+
+	# Bug 669566 - necessary so that build tools are updated for commands like pecl
+	# Force rebuilding aclocal.m4
+	rm -f aclocal.m4 || die "failed to remove aclocal.m4 in src_prepare"
+	eautoreconf
+}
+
+src_configure() {
+	addpredict /usr/share/snmp/mibs/.index #nowarn
+	addpredict /var/lib/net-snmp/mib_indexes #nowarn
+
+	PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
+
+	# The php-fpm config file wants localstatedir to be ${EPREFIX}/var
+	# and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002.
+	local our_conf=(
+		--prefix="${PHP_DESTDIR}"
+		--mandir="${PHP_DESTDIR}/man"
+		--infodir="${PHP_DESTDIR}/info"
+		--libdir="${PHP_DESTDIR}/lib"
+		--with-libdir="$(get_libdir)"
+		--localstatedir="${EPREFIX}/var"
+		--without-pear
+		$(use_enable threads maintainer-zts)
+	)
+
+	our_conf+=(
+		$(use_with argon2 password-argon2 "${EPREFIX}/usr")
+		$(use_enable bcmath bcmath)
+		$(use_with bzip2 bz2 "${EPREFIX}/usr")
+		$(use_enable calendar calendar)
+		$(use_enable coverage gcov)
+		$(use_enable ctype ctype)
+		$(use_with curl curl "${EPREFIX}/usr")
+		$(use_enable xml dom)
+		$(use_with enchant enchant "${EPREFIX}/usr")
+		$(use_enable exif exif)
+		$(use_enable fileinfo fileinfo)
+		$(use_enable filter filter)
+		$(use_enable ftp ftp)
+		$(use_with nls gettext "${EPREFIX}/usr")
+		$(use_with gmp gmp "${EPREFIX}/usr")
+		$(use_enable hash hash)
+		$(use_with mhash mhash "${EPREFIX}/usr")
+		$(use_with iconv iconv \
+			$(use elibc_glibc || use elibc_musl || use elibc_FreeBSD || echo "${EPREFIX}/usr"))
+		$(use_enable intl intl)
+		$(use_enable ipv6 ipv6)
+		$(use_enable json json)
+		$(use_with kerberos kerberos "${EPREFIX}/usr")
+		$(use_enable xml libxml)
+		$(use_with xml libxml-dir "${EPREFIX}/usr")
+		$(use_enable unicode mbstring)
+		$(use_with unicode onig "${EPREFIX}/usr")
+		$(use_with ssl openssl "${EPREFIX}/usr")
+		$(use_with ssl openssl-dir "${EPREFIX}/usr")
+		$(use_enable pcntl pcntl)
+		$(use_enable phar phar)
+		$(use_enable pdo pdo)
+		$(use_enable opcache opcache)
+		$(use_with postgres pgsql "${EPREFIX}/usr")
+		$(use_enable posix posix)
+		$(use_with spell pspell "${EPREFIX}/usr")
+		$(use_with recode recode "${EPREFIX}/usr")
+		$(use_enable simplexml simplexml)
+		$(use_enable sharedmem shmop)
+		$(use_with snmp snmp "${EPREFIX}/usr")
+		$(use_enable soap soap)
+		$(use_enable sockets sockets)
+		$(use_with sodium sodium "${EPREFIX}/usr")
+		$(use_with sqlite sqlite3 "${EPREFIX}/usr")
+		$(use_enable sysvipc sysvmsg)
+		$(use_enable sysvipc sysvsem)
+		$(use_enable sysvipc sysvshm)
+		$(use_with tidy tidy "${EPREFIX}/usr")
+		$(use_enable tokenizer tokenizer)
+		$(use_enable wddx wddx)
+		$(use_enable xml xml)
+		$(use_enable xmlreader xmlreader)
+		$(use_enable xmlwriter xmlwriter)
+		$(use_with xmlrpc xmlrpc)
+		$(use_with xslt xsl "${EPREFIX}/usr")
+		$(use_enable zip zip)
+		$(use_with zip-encryption libzip "${EPREFIX}/usr")
+		$(use_with zlib zlib "${EPREFIX}/usr")
+		$(use_enable debug debug)
+	)
+
+	# DBA support
+	if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
+		|| use qdbm || use lmdb || use tokyocabinet ; then
+		our_conf+=( "--enable-dba${shared}" )
+	fi
+
+	# DBA drivers support
+	our_conf+=(
+		$(use_with cdb cdb)
+		$(use_with berkdb db4 "${EPREFIX}/usr")
+		$(use_enable flatfile flatfile)
+		$(use_with gdbm gdbm "${EPREFIX}/usr")
+		$(use_enable inifile inifile)
+		$(use_with qdbm qdbm "${EPREFIX}/usr")
+		$(use_with lmdb lmdb "${EPREFIX}/usr")
+	)
+
+	# Support for the GD graphics library
+	our_conf+=(
+		$(use_with truetype freetype-dir "${EPREFIX}/usr")
+		$(use_enable cjk gd-jis-conv)
+		$(use_with gd jpeg-dir "${EPREFIX}/usr")
+		$(use_with gd png-dir "${EPREFIX}/usr")
+		$(use_with xpm xpm-dir "${EPREFIX}/usr")
+	)
+	if use webp; then
+		our_conf+=( --with-webp-dir="${EPREFIX}/usr" )
+	fi
+	# enable gd last, so configure can pick up the previous settings
+	our_conf+=( $(use_with gd gd) )
+
+	# IMAP support
+	if use imap ; then
+		our_conf+=(
+			$(use_with imap imap "${EPREFIX}/usr")
+			$(use_with ssl imap-ssl "${EPREFIX}/usr")
+		)
+	fi
+
+	# Interbase/firebird support
+	our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") )
+
+	# LDAP support
+	if use ldap ; then
+		our_conf+=(
+			$(use_with ldap ldap "${EPREFIX}/usr")
+			$(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr")
+		)
+	fi
+
+	# MySQL support
+	local mysqllib="mysqlnd"
+	local mysqlilib="mysqlnd"
+
+	our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
+
+	local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock"
+	if use mysql || use mysqli ; then
+		our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") )
+	fi
+
+	# ODBC support
+	our_conf+=(
+		$(use_with odbc unixODBC "${EPREFIX}/usr")
+		$(use_with iodbc iodbc "${EPREFIX}/usr")
+	)
+
+	# Oracle support
+	our_conf+=( $(use_with oci8-instant-client oci8) )
+
+	# PDO support
+	if use pdo ; then
+		our_conf+=(
+			$(use_with mssql pdo-dblib "${EPREFIX}/usr")
+			$(use_with mysql pdo-mysql "${mysqllib}")
+			$(use_with postgres pdo-pgsql)
+			$(use_with sqlite pdo-sqlite "${EPREFIX}/usr")
+			$(use_with firebird pdo-firebird "${EPREFIX}/usr")
+			$(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr")
+			$(use_with oci8-instant-client pdo-oci)
+		)
+	fi
+
+	# readline/libedit support
+	our_conf+=(
+		$(use_with readline readline "${EPREFIX}/usr")
+		$(use_with libedit libedit "${EPREFIX}/usr")
+	)
+
+	# Session support
+	if use session ; then
+		our_conf+=( $(use_with session-mm mm "${EPREFIX}/usr") )
+	else
+		our_conf+=( $(use_enable session session) )
+	fi
+
+	# Use pic for shared modules such as apache2's mod_php
+	our_conf+=( --with-pic )
+
+	# we use the system copy of pcre
+	# --with-pcre-regex affects ext/pcre
+	# --with-pcre-dir affects ext/filter and ext/zip
+	# --with-pcre-valgrind cannot be enabled with system pcre
+	# Many arches don't support pcre-jit
+	our_conf+=(
+		--with-pcre-regex="${EPREFIX}/usr"
+		--with-pcre-dir="${EPREFIX}/usr"
+		--without-pcre-valgrind
+		--without-pcre-jit
+	)
+
+	# Catch CFLAGS problems
+	# Fixes bug #14067.
+	# Changed order to run it in reverse for bug #32022 and #12021.
+	replace-cpu-flags "k6*" "i586"
+
+	# Cache the ./configure test results between SAPIs.
+	our_conf+=( --cache-file="${T}/config.cache" )
+
+	# Support user-passed configuration parameters
+	our_conf+=( ${EXTRA_ECONF:-} )
+
+	# Support the Apache2 extras, they must be set globally for all
+	# SAPIs to work correctly, especially for external PHP extensions
+
+	mkdir -p "${WORKDIR}/sapis-build" || die
+	for one_sapi in $SAPIS ; do
+		use "${one_sapi}" || continue
+		php_set_ini_dir "${one_sapi}"
+
+		# The BUILD_DIR variable is used to determine where to output
+		# the files that autotools creates. This was all originally
+		# based on the autotools-utils eclass.
+		BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}"
+		cp -a "${S}" "${BUILD_DIR}" || die
+		cd "${BUILD_DIR}" || die
+
+		local sapi_conf=(
+			--with-config-file-path="${PHP_INI_DIR}"
+			--with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}"
+		)
+
+		for sapi in $SAPIS ; do
+			case "$sapi" in
+				cli|cgi|embed|fpm|phpdbg)
+					if [[ "${one_sapi}" == "${sapi}" ]] ; then
+						sapi_conf+=( "--enable-${sapi}" )
+						if [[ "fpm" == "${sapi}" ]] ; then
+							sapi_conf+=(
+								$(use_with acl fpm-acl)
+								$(use_with systemd fpm-systemd)
+							)
+						fi
+					else
+						sapi_conf+=( "--disable-${sapi}" )
+					fi
+					;;
+
+				apache2)
+					if [[ "${one_sapi}" == "${sapi}" ]] ; then
+						sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" )
+					else
+						sapi_conf+=( --without-apxs2 )
+					fi
+					;;
+			esac
+		done
+
+		# Construct the $myeconfargs array by concatenating $our_conf
+		# (the common args) and $sapi_conf (the SAPI-specific args).
+		local myeconfargs=( "${our_conf[@]}" )
+		myeconfargs+=( "${sapi_conf[@]}" )
+
+		pushd "${BUILD_DIR}" > /dev/null || die
+		econf "${myeconfargs[@]}"
+		popd > /dev/null || die
+	done
+}
+
+src_compile() {
+	# snmp seems to run during src_compile, too (bug #324739)
+	addpredict /usr/share/snmp/mibs/.index #nowarn
+	addpredict /var/lib/net-snmp/mib_indexes #nowarn
+
+	for sapi in ${SAPIS} ; do
+		if use "${sapi}"; then
+			cd "${WORKDIR}/sapis-build/$sapi" || \
+				die "Failed to change dir to ${WORKDIR}/sapis-build/$1"
+			emake
+		fi
+	done
+}
+
+src_install() {
+	# see bug #324739 for what happens when we don't have that
+	addpredict /usr/share/snmp/mibs/.index #nowarn
+
+	# grab the first SAPI that got built and install common files from there
+	local first_sapi=""
+	for sapi in $SAPIS ; do
+		if use $sapi ; then
+			first_sapi=$sapi
+			break
+		fi
+	done
+
+	# Makefile forgets to create this before trying to write to it...
+	dodir "${PHP_DESTDIR#${EPREFIX}}/bin"
+
+	# Install php environment (without any sapis)
+	cd "${WORKDIR}/sapis-build/$first_sapi" || die
+	emake INSTALL_ROOT="${D}" \
+		install-build install-headers install-programs
+
+	local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)"
+
+	# Create the directory where we'll put version-specific php scripts
+	keepdir "/usr/share/php${PHP_MV}"
+
+	local sapi="", file=""
+	local sapi_list=""
+
+	for sapi in ${SAPIS}; do
+		if use "${sapi}" ; then
+			einfo "Installing SAPI: ${sapi}"
+			cd "${WORKDIR}/sapis-build/${sapi}" || die
+
+			if [[ "${sapi}" == "apache2" ]] ; then
+				# We're specifically not using emake install-sapi as libtool
+				# may cause unnecessary relink failures (see bug #351266)
+				insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/"
+				newins ".libs/libphp${PHP_MV}$(get_libname)" \
+					   "libphp${PHP_MV}$(get_libname)"
+				keepdir "/usr/$(get_libdir)/apache2/modules"
+			else
+				# needed each time, php_install_ini would reset it
+				local dest="${PHP_DESTDIR#${EPREFIX}}"
+				into "${dest}"
+				case "$sapi" in
+					cli)
+						source="sapi/cli/php"
+						;;
+					cgi)
+						source="sapi/cgi/php-cgi"
+						;;
+					fpm)
+						source="sapi/fpm/php-fpm"
+						;;
+					embed)
+						source="libs/libphp${PHP_MV}$(get_libname)"
+						;;
+					phpdbg)
+						source="sapi/phpdbg/phpdbg"
+						;;
+					*)
+						die "unhandled sapi in src_install"
+						;;
+				esac
+
+				if [[ "${source}" == *"$(get_libname)" ]]; then
+					dolib.so "${source}"
+				else
+					dobin "${source}"
+					local name="$(basename ${source})"
+					dosym "${dest}/bin/${name}" "/usr/bin/${name}${SLOT}"
+				fi
+			fi
+
+			php_install_ini "${sapi}"
+
+			# construct correct SAPI string for php-config
+			# thanks to ferringb for the bash voodoo
+			if [[ "${sapi}" == "apache2" ]]; then
+				sapi_list="${sapi_list:+${sapi_list} }apache2handler"
+			else
+				sapi_list="${sapi_list:+${sapi_list} }${sapi}"
+			fi
+		fi
+	done
+
+	# Installing opcache module
+	if use opcache ; then
+		into "${PHP_DESTDIR#${EPREFIX}}"
+		dolib.so "modules/opcache$(get_libname)"
+	fi
+
+	# Install env.d files
+	newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}"
+	sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
+	sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
+
+	# set php-config variable correctly (bug #278439)
+	sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \
+		"${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die
+
+	if use fpm ; then
+		if use systemd; then
+			systemd_newunit "${FILESDIR}/php-fpm_at.service" \
+							"php-fpm@${SLOT}.service"
+		else
+			systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \
+							"php-fpm@${SLOT}.service"
+		fi
+	fi
+}
+
+src_test() {
+	echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
+	PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
+	if [[ ! -x "${PHP_BIN}" ]] ; then
+		ewarn "Test phase requires USE=cli, skipping"
+		return
+	else
+		export TEST_PHP_EXECUTABLE="${PHP_BIN}"
+	fi
+
+	if [[ -x "${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" ]] ; then
+		export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi"
+	fi
+
+	if [[ -x "${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" ]] ; then
+		export TEST_PHPDBG_EXECUTABLE="${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg"
+	fi
+
+	REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n  -d \
+					  "session.save_path=${T}" \
+					  "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \
+					  "session.save_path=${T}"
+
+	for name in ${EXPECTED_TEST_FAILURES}; do
+		mv "${name}.out" "${name}.out.orig" 2>/dev/null || die
+	done
+
+	local failed="$(find -name '*.out')"
+	if [[ ${failed} != "" ]] ; then
+		ewarn "The following test cases failed unexpectedly:"
+		for name in ${failed}; do
+			ewarn "  ${name/.out/}"
+		done
+	else
+		einfo "No unexpected test failures, all fine"
+	fi
+
+	if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
+		local passed=""
+		for name in ${EXPECTED_TEST_FAILURES}; do
+			[[ -f "${name}.diff" ]] && continue
+			passed="${passed} ${name}"
+		done
+		if [[ ${passed} != "" ]] ; then
+			einfo "The following test cases passed unexpectedly:"
+			for name in ${passed}; do
+				ewarn "  ${passed}"
+			done
+		else
+			einfo "None of the known-to-fail tests passed, all fine"
+		fi
+	fi
+}
+
+pkg_postinst() {
+	# Output some general info to the user
+	if use apache2 ; then
+		elog
+		elog "To enable PHP in apache, you will need to add \"-D PHP\" to"
+		elog "your apache2 command. OpenRC users can append that string to"
+		elog "APACHE2_OPTS in /etc/conf.d/apache2."
+		elog
+		elog "The apache module configuration file 70_mod_php.conf is"
+		elog "provided (and maintained) by eselect-php."
+		elog
+	fi
+
+	# Create the symlinks for php
+	for m in ${SAPIS}; do
+		[[ ${m} == 'embed' ]] && continue;
+		if use $m ; then
+			local ci=$(eselect php show $m)
+			if [[ -z $ci ]]; then
+				eselect php set $m php${SLOT} || die
+				einfo "Switched ${m} to use php:${SLOT}"
+				einfo
+			elif [[ $ci != "php${SLOT}" ]] ; then
+				elog "To switch $m to use php:${SLOT}, run"
+				elog "    eselect php set $m php${SLOT}"
+				elog
+			fi
+		fi
+	done
+
+	# Remove dead symlinks for SAPIs that were just disabled. For
+	# example, if the user has the cgi SAPI enabled, then he has an
+	# eselect-php symlink for it. If he later reinstalls PHP with
+	# USE="-cgi", that symlink will break. This call to eselect is
+	# supposed to remove that dead link per bug 572436.
+	eselect php cleanup || die
+
+	if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then
+	   elog "To build extensions for this version of PHP, you will need to"
+	   elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable."
+	   elog
+	fi
+
+	# Warn about the removal of PHP_INI_VERSION if the user has it set.
+	if [[ -n "${PHP_INI_VERSION}" ]]; then
+		ewarn 'The PHP_INI_VERSION variable has been phased out. You may'
+		ewarn 'remove it from your configuration at your convenience. See'
+		ewarn
+		ewarn '  https://bugs.gentoo.org/611214'
+		ewarn
+		ewarn 'for more information.'
+	fi
+
+	elog "For details on how version slotting works, please see"
+	elog "the wiki:"
+	elog
+	elog "  https://wiki.gentoo.org/wiki/PHP"
+	elog
+}
+
+pkg_postrm() {
+	# This serves two purposes. First, if we have just removed the last
+	# installed version of PHP, then this will remove any dead symlinks
+	# belonging to eselect-php. Second, if a user upgrades slots from
+	# (say) 5.6 to 7.0 and depcleans the old slot, then this will update
+	# his existing symlinks to point to the new 7.0 installation. The
+	# latter is bug 432962.
+	#
+	# Note: the eselect-php package may not be installed at this point,
+	# so we can't die() if this command fails.
+	eselect php cleanup
+}


^ permalink raw reply related	[flat|nested] 21+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-lang/php/files/, dev-lang/php/
@ 2018-12-07  1:16 Thomas Deutschmann
  0 siblings, 0 replies; 21+ messages in thread
From: Thomas Deutschmann @ 2018-12-07  1:16 UTC (permalink / raw
  To: gentoo-commits

commit:     169d25ffd06419b07d213a1adbef8ee370be9d97
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Fri Dec  7 01:15:56 2018 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Fri Dec  7 01:16:08 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=169d25ff

dev-lang/php: bump to v7.2.13

- EAPI bump to EAPI=7

- Use pkg-config for detecting ICU

- Proper ICU namespace usage backported

Package-Manager: Portage-2.3.52, Repoman-2.3.12
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>

 dev-lang/php/Manifest                              |   1 +
 .../files/php-7.2.13-intl-use-icu-namespace.patch  | 379 +++++++++++
 dev-lang/php/php-7.2.13.ebuild                     | 748 +++++++++++++++++++++
 3 files changed, 1128 insertions(+)

diff --git a/dev-lang/php/Manifest b/dev-lang/php/Manifest
index 7b889cd1d3f..01e629a8190 100644
--- a/dev-lang/php/Manifest
+++ b/dev-lang/php/Manifest
@@ -10,4 +10,5 @@ DIST php-7.1.25.tar.xz 12205972 BLAKE2B 3d69cc87d75ee45dc85e5e672ddb6c312fcba128
 DIST php-7.2.10.tar.xz 12160864 BLAKE2B f1959a00622c1bd11fa87c61d152c802b307f0b9e89b51ed86b40086cda03eeb6652d47b59df8cc7c9b4e79ab687ae1292b978f453e9f07ac352d209b64c62d8 SHA512 aa90fce17034b2649012d66461626ae74c21ea938b1c71c7eb12419e562c641b432df87a7e900c245ad28df39624cf64a1b2f8ffb123608d94cd35e41f09c0fe
 DIST php-7.2.11.tar.xz 12132268 BLAKE2B 8007f6a8f4236efb796681d25f2066deeba98e6e136def0c323aa13399951d58d7f218b3544b3bd0418dfe220f87a38b6515547c50f65c641bd09a2d440eb4e1 SHA512 0cd8578147d17d612e013dfc22b73977719177058b39c7b61dd0bfdfb8c2441aba78af49f58c824f7e66c89b5ad201c36fafb89ccf1e2d20f19b79d6a8fed7e5
 DIST php-7.2.12.tar.xz 12141472 BLAKE2B 25d55fcbe63aab64c658e9c4ab52b552831d5c03a8887e1c64f0cadbb8b0d9f3c38cd5d15dac89002c328b737ad864fce392baa0891292ee77d1975562a2bc17 SHA512 bbeaed1278d0d2f1ecb2249dab1ebaab1489ef43be0797dac57d8b523d8e5d284166e6cbf52095f5d34eef447fbdeb0c6916caaa5770221a180ec064f4ffcad8
+DIST php-7.2.13.tar.xz 12116484 BLAKE2B 00d265c10343e590772a4de103ae885149a56a7c0ef957cb24d5e81f86021231da5e75b655081e9fcba99b83956d55265b6af1d779ee65cebee9a974f936a634 SHA512 9df1d43e9cd701db10281811b328721b85cb90c6c8dae1842b0fd848cb5388328918b3040bbad7634b340550d82b93746ea479ed45f4d8a80e8a316e6324115d
 DIST php-7.3.0.tar.xz 11928820 BLAKE2B 36fee652cbbc28bbeb1b2df037b4b05084910d94af86c16150d776b82f91fb85691f9846c51538dbf6f3e64ece26894fe9c7a5f272d2848d41cdf8e1338b9805 SHA512 d991101eb833d3a47833aa930341e75c56f26c4cb0249896728ebe209c6c02af1704fccc3052128d8f9fdffc60dcef0ece38a532697131141946898d8b1abcda

diff --git a/dev-lang/php/files/php-7.2.13-intl-use-icu-namespace.patch b/dev-lang/php/files/php-7.2.13-intl-use-icu-namespace.patch
new file mode 100644
index 00000000000..b5d2b473f1a
--- /dev/null
+++ b/dev-lang/php/files/php-7.2.13-intl-use-icu-namespace.patch
@@ -0,0 +1,379 @@
+Based on the following upstream commits:
+
+https://github.com/php/php-src/commit/8d35a423838eb462cd39ee535c5d003073cc5f22
+https://github.com/php/php-src/commit/d8200e48857aeaf09f7127751efc5632ef7660a7
+https://github.com/php/php-src/commit/9a8e7b571896f39f83cb000fdb7c466b6d328d52
+
+--- a/ext/intl/breakiterator/breakiterator_class.cpp
++++ b/ext/intl/breakiterator/breakiterator_class.cpp
+@@ -38,6 +38,7 @@ extern "C" {
+ }
+ 
+ using PHP::CodePointBreakIterator;
++using icu::RuleBasedBreakIterator;
+ 
+ /* {{{ Global variables */
+ zend_class_entry *BreakIterator_ce_ptr;
+--- a/ext/intl/breakiterator/breakiterator_class.h
++++ b/ext/intl/breakiterator/breakiterator_class.h
+@@ -26,6 +26,8 @@
+ 
+ #ifndef USE_BREAKITERATOR_POINTER
+ typedef void BreakIterator;
++#else
++using icu::BreakIterator;
+ #endif
+ 
+ typedef struct {
+--- a/ext/intl/breakiterator/breakiterator_methods.cpp
++++ b/ext/intl/breakiterator/breakiterator_methods.cpp
+@@ -32,6 +32,8 @@ extern "C" {
+ }
+ 
+ using PHP::CodePointBreakIterator;
++using icu::BreakIterator;
++using icu::Locale;
+ 
+ U_CFUNC PHP_METHOD(BreakIterator, __construct)
+ {
+--- a/ext/intl/breakiterator/codepointiterator_internal.cpp
++++ b/ext/intl/breakiterator/codepointiterator_internal.cpp
+@@ -33,6 +33,8 @@ typedef union {
+ 
+ using namespace PHP;
+ 
++using icu::UCharCharacterIterator;
++
+ UOBJECT_DEFINE_RTTI_IMPLEMENTATION(CodePointBreakIterator);
+ 
+ CodePointBreakIterator::CodePointBreakIterator()
+--- a/ext/intl/breakiterator/codepointiterator_internal.h
++++ b/ext/intl/breakiterator/codepointiterator_internal.h
+@@ -18,8 +18,11 @@
+ #define CODEPOINTITERATOR_INTERNAL_H
+ 
+ #include <unicode/brkiter.h>
++#include <unicode/unistr.h>
+ 
+-using U_ICU_NAMESPACE::BreakIterator;
++using icu::BreakIterator;
++using icu::CharacterIterator;
++using icu::UnicodeString;
+ 
+ namespace PHP {
+ 
+--- a/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp
++++ b/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp
+@@ -26,6 +26,9 @@ extern "C" {
+ #include "../intl_convertcpp.h"
+ #include "../intl_common.h"
+ 
++using icu::RuleBasedBreakIterator;
++using icu::Locale;
++
+ static inline RuleBasedBreakIterator *fetch_rbbi(BreakIterator_object *bio) {
+ 	return (RuleBasedBreakIterator*)bio->biter;
+ }
+--- a/ext/intl/calendar/calendar_class.cpp
++++ b/ext/intl/calendar/calendar_class.cpp
+@@ -34,6 +34,9 @@ extern "C" {
+ #include <assert.h>
+ }
+ 
++using icu::GregorianCalendar;
++using icu::Locale;
++
+ /* {{{ Global variables */
+ zend_class_entry *Calendar_ce_ptr;
+ zend_class_entry *GregorianCalendar_ce_ptr;
+--- a/ext/intl/calendar/calendar_class.h
++++ b/ext/intl/calendar/calendar_class.h
+@@ -26,6 +26,8 @@
+ 
+ #ifndef USE_CALENDAR_POINTER
+ typedef void Calendar;
++#else
++using icu::Calendar;
+ #endif
+ 
+ typedef struct {
+--- a/ext/intl/calendar/calendar_methods.cpp
++++ b/ext/intl/calendar/calendar_methods.cpp
+@@ -40,6 +40,8 @@ extern "C" {
+ }
+ #include "../common/common_enum.h"
+ 
++using icu::Locale;
++
+ U_CFUNC PHP_METHOD(IntlCalendar, __construct)
+ {
+ 	zend_throw_exception( NULL,
+--- a/ext/intl/calendar/gregoriancalendar_methods.cpp
++++ b/ext/intl/calendar/gregoriancalendar_methods.cpp
+@@ -23,6 +23,8 @@
+ #include <unicode/locid.h>
+ #include <unicode/calendar.h>
+ #include <unicode/gregocal.h>
++#include <unicode/ustring.h>
++
+ extern "C" {
+ #include "../php_intl.h"
+ #include "../intl_common.h"
+@@ -34,6 +36,11 @@ extern "C" {
+ #include "zend_exceptions.h"
+ }
+ 
++using icu::GregorianCalendar;
++using icu::Locale;
++using icu::UnicodeString;
++using icu::StringPiece;
++
+ static inline GregorianCalendar *fetch_greg(Calendar_object *co) {
+ 	return (GregorianCalendar*)co->ucal;
+ }
+--- a/ext/intl/common/common_date.cpp
++++ b/ext/intl/common/common_date.cpp
+@@ -27,6 +27,9 @@ extern "C" {
+ 
+ #include "zend_portability.h"
+ 
++using icu::TimeZone;
++using icu::UnicodeString;
++
+ /* {{{ timezone_convert_datetimezone
+  *      The timezone in DateTime and DateTimeZone is not unified. */
+ U_CFUNC TimeZone *timezone_convert_datetimezone(int type,
+--- a/ext/intl/common/common_date.h
++++ b/ext/intl/common/common_date.h
+@@ -28,6 +28,8 @@ U_CDECL_END
+ 
+ #include <unicode/timezone.h>
+ 
++using icu::TimeZone;
++
+ U_CFUNC TimeZone *timezone_convert_datetimezone(int type, void *object, int is_datetime, intl_error *outside_error, const char *func);
+ U_CFUNC int intl_datetime_decompose(zval *z, double *millis, TimeZone **tz,
+ 		intl_error *err, const char *func);
+--- a/ext/intl/common/common_enum.h
++++ b/ext/intl/common/common_enum.h
+@@ -75,6 +75,7 @@ U_CFUNC zval *zoi_with_current_get_current_data(zend_object_iterator *iter);
+ U_CFUNC void zoi_with_current_invalidate_current(zend_object_iterator *iter);
+ 
+ #ifdef __cplusplus
++using icu::StringEnumeration;
+ U_CFUNC void IntlIterator_from_StringEnumeration(StringEnumeration *se, zval *object);
+ #endif
+ 
+--- a/ext/intl/converter/converter.c
++++ b/ext/intl/converter/converter.c
+@@ -18,6 +18,8 @@
+ #include "zend_exceptions.h"
+ 
+ #include <unicode/utypes.h>
++#include <unicode/utf8.h>
++#include <unicode/utf16.h>
+ #include <unicode/ucnv.h>
+ #include <unicode/ustring.h>
+ 
+--- a/ext/intl/dateformat/dateformat_format_object.cpp
++++ b/ext/intl/dateformat/dateformat_format_object.cpp
+@@ -33,6 +33,12 @@ extern "C" {
+ #include "../common/common_date.h"
+ }
+ 
++using icu::Locale;
++using icu::DateFormat;
++using icu::GregorianCalendar;
++using icu::StringPiece;
++using icu::SimpleDateFormat;
++
+ static const DateFormat::EStyle valid_styles[] = {
+ 		DateFormat::kNone,
+ 		DateFormat::kFull,
+--- a/ext/intl/dateformat/dateformat_helpers.cpp
++++ b/ext/intl/dateformat/dateformat_helpers.cpp
+@@ -28,6 +28,8 @@ extern "C" {
+ #include "../calendar/calendar_class.h"
+ }
+ 
++using icu::GregorianCalendar;
++
+ int datefmt_process_calendar_arg(zval* calendar_zv,
+ 								 Locale const& locale,
+ 								 const char *func_name,
+--- a/ext/intl/dateformat/dateformat_helpers.h
++++ b/ext/intl/dateformat/dateformat_helpers.h
+@@ -22,11 +22,16 @@
+ #endif
+ 
+ #include <unicode/calendar.h>
++#include <unicode/datefmt.h>
+ 
+ extern "C" {
+ #include "../php_intl.h"
+ }
+ 
++using icu::Locale;
++using icu::Calendar;
++using icu::DateFormat;
++
+ int datefmt_process_calendar_arg(zval* calendar_zv,
+ 								 Locale const& locale,
+ 								 const char *func_name,
+--- a/ext/intl/grapheme/grapheme_string.c
++++ b/ext/intl/grapheme/grapheme_string.c
+@@ -24,6 +24,7 @@
+ #include "grapheme_util.h"
+ 
+ #include <unicode/utypes.h>
++#include <unicode/utf8.h>
+ #include <unicode/ucol.h>
+ #include <unicode/ustring.h>
+ #include <unicode/ubrk.h>
+@@ -834,10 +835,10 @@ PHP_FUNCTION(grapheme_extract)
+ 	pstr = str + start;
+ 
+ 	/* just in case pstr points in the middle of a character, move forward to the start of the next char */
+-	if ( !UTF8_IS_SINGLE(*pstr) && !U8_IS_LEAD(*pstr) ) {
+-		char *str_end = str + str_len;
++	if ( !U8_IS_SINGLE(*pstr) && !U8_IS_LEAD(*pstr) ) {
++		unsigned char *str_end = str + str_len;
+ 
+-		while ( !UTF8_IS_SINGLE(*pstr) && !U8_IS_LEAD(*pstr) ) {
++		while ( !U8_IS_SINGLE(*pstr) && !U8_IS_LEAD(*pstr) ) {
+ 			pstr++;
+ 			if ( pstr >= str_end ) {
+ 				intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
+--- a/ext/intl/intl_convertcpp.h
++++ b/ext/intl/intl_convertcpp.h
+@@ -26,6 +26,8 @@
+ #include <unicode/unistr.h>
+ #include <zend_types.h>
+ 
++using icu::UnicodeString;
++
+ int intl_stringFromChar(UnicodeString &ret, char *str, size_t str_len, UErrorCode *status);
+ 
+ zend_string* intl_charFromString(const UnicodeString &from, UErrorCode *status);
+--- a/ext/intl/msgformat/msgformat_helpers.cpp
++++ b/ext/intl/msgformat/msgformat_helpers.cpp
+@@ -78,6 +78,16 @@ MessageFormatAdapter::getMessagePattern(MessageFormat* m) {
+ #endif
+ U_NAMESPACE_END
+ 
++using icu::Formattable;
++using icu::Format;
++using icu::DateFormat;
++using icu::MessageFormat;
++#ifdef HAS_MESSAGE_PATTERN
++using icu::MessagePattern;
++#endif
++using icu::MessageFormatAdapter;
++using icu::FieldPosition;
++
+ U_CFUNC int32_t umsg_format_arg_count(UMessageFormat *fmt)
+ {
+ 	int32_t fmt_count = 0;
+@@ -229,15 +239,16 @@ static HashTable *umsg_parse_format(MessageFormatter_object *mfo,
+ 					UnicodeString typeString = mp.getSubstring(type_part);
+ 					/* This is all based on the rules in the docs for MessageFormat
+ 					 * @see http://icu-project.org/apiref/icu4c/classMessageFormat.html */
+-					if (typeString == "number") {
++#define ASCII_LITERAL(s) UNICODE_STRING(s, sizeof(s)-1)
++					if (typeString == ASCII_LITERAL("number")) {
+ 						MessagePattern::Part style_part = mp.getPart(i + 1); /* Not advancing i */
+ 						if (style_part.getType() == UMSGPAT_PART_TYPE_ARG_STYLE) {
+ 							UnicodeString styleString = mp.getSubstring(style_part);
+-							if (styleString == "integer") {
++							if (styleString == ASCII_LITERAL("integer")) {
+ 								type = Formattable::kInt64;
+-							} else if (styleString == "currency") {
++							} else if (styleString == ASCII_LITERAL("currency")) {
+ 								type = Formattable::kDouble;
+-							} else if (styleString == "percent") {
++							} else if (styleString == ASCII_LITERAL("percent")) {
+ 								type = Formattable::kDouble;
+ 							} else { /* some style invalid/unknown to us */
+ 								type = Formattable::kDouble;
+@@ -245,12 +256,13 @@ static HashTable *umsg_parse_format(MessageFormatter_object *mfo,
+ 						} else { // if missing style, part, make it a double
+ 							type = Formattable::kDouble;
+ 						}
+-					} else if ((typeString == "date") || (typeString == "time")) {
++					} else if ((typeString == ASCII_LITERAL("date")) || (typeString == ASCII_LITERAL("time"))) {
+ 						type = Formattable::kDate;
+-					} else if ((typeString == "spellout") || (typeString == "ordinal")
+-							|| (typeString == "duration")) {
++					} else if ((typeString == ASCII_LITERAL("spellout")) || (typeString == ASCII_LITERAL("ordinal"))
++							|| (typeString == ASCII_LITERAL("duration"))) {
+ 						type = Formattable::kDouble;
+ 					}
++#undef ASCII_LITERAL
+ 				} else {
+ 					/* If there's no UMSGPAT_PART_TYPE_ARG_TYPE right after a
+ 					 * UMSGPAT_ARG_TYPE_SIMPLE argument, then the pattern
+--- a/ext/intl/normalizer/normalizer_normalize.c
++++ b/ext/intl/normalizer/normalizer_normalize.c
+@@ -24,6 +24,7 @@
+ #include "normalizer_class.h"
+ #include "normalizer_normalize.h"
+ #include "intl_convert.h"
++#include <unicode/utf8.h>
+ 
+ /* {{{ proto string Normalizer::normalize( string $input [, string $form = FORM_C] )
+  * Normalize a string. }}} */
+--- a/ext/intl/timezone/timezone_class.cpp
++++ b/ext/intl/timezone/timezone_class.cpp
+@@ -37,6 +37,8 @@ extern "C" {
+ #include <ext/date/php_date.h>
+ }
+ 
++using icu::Calendar;
++
+ /* {{{ Global variables */
+ U_CDECL_BEGIN
+ zend_class_entry *TimeZone_ce_ptr = NULL;
+--- a/ext/intl/timezone/timezone_class.h
++++ b/ext/intl/timezone/timezone_class.h
+@@ -29,6 +29,8 @@
+ 
+ #ifndef USE_TIMEZONE_POINTER
+ typedef void TimeZone;
++#else
++using icu::TimeZone;
+ #endif
+ 
+ typedef struct {
+--- a/ext/intl/timezone/timezone_methods.cpp
++++ b/ext/intl/timezone/timezone_methods.cpp
+@@ -23,6 +23,7 @@
+ #include <unicode/locid.h>
+ #include <unicode/timezone.h>
+ #include <unicode/ustring.h>
++#include <unicode/calendar.h>
+ #include "intl_convertcpp.h"
+ 
+ #include "../common/common_date.h"
+@@ -37,6 +38,9 @@ extern "C" {
+ }
+ #include "common/common_enum.h"
+ 
++using icu::Locale;
++using icu::Calendar;
++
+ U_CFUNC PHP_METHOD(IntlTimeZone, __construct)
+ {
+ 	zend_throw_exception( NULL,
+--- a/ext/intl/uchar/uchar.c
++++ b/ext/intl/uchar/uchar.c
+@@ -3,6 +3,7 @@
+ #include "intl_convert.h"
+ 
+ #include <unicode/uchar.h>
++#include <unicode/utf8.h>
+ 
+ #define IC_METHOD(mname) PHP_METHOD(IntlChar, mname)
+ 
+-- 
+2.19.2
+

diff --git a/dev-lang/php/php-7.2.13.ebuild b/dev-lang/php/php-7.2.13.ebuild
new file mode 100644
index 00000000000..8c9fb3ab302
--- /dev/null
+++ b/dev-lang/php/php-7.2.13.ebuild
@@ -0,0 +1,748 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit flag-o-matic systemd autotools
+
+DESCRIPTION="The PHP language runtime engine"
+HOMEPAGE="https://secure.php.net/"
+SRC_URI="https://php.net/distributions/${P}.tar.xz"
+
+LICENSE="PHP-3.01
+	BSD
+	Zend-2.0
+	bcmath? ( LGPL-2.1+ )
+	fpm? ( BSD-2 )
+	gd? ( gd )
+	unicode? ( BSD-2 LGPL-2.1 )"
+
+SLOT="$(ver_cut 1-2)"
+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"
+
+# We can build the following SAPIs in the given order
+SAPIS="embed cli cgi fpm apache2 phpdbg"
+
+# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
+IUSE="${IUSE}
+	${SAPIS/cli/+cli}
+	threads"
+
+IUSE="${IUSE} acl argon2 bcmath berkdb bzip2 calendar cdb cjk
+	coverage +ctype curl debug
+	enchant exif +fileinfo +filter firebird
+	flatfile ftp gd gdbm gmp +hash +iconv imap inifile
+	intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl lmdb
+	mhash mssql mysql mysqli nls
+	oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
+	readline recode selinux +session session-mm sharedmem
+	+simplexml snmp soap sockets sodium spell sqlite ssl
+	sysvipc systemd test tidy +tokenizer tokyocabinet truetype unicode wddx webp
+	+xml xmlreader xmlwriter xmlrpc xpm xslt zip zip-encryption zlib"
+
+# The supported (that is, autodetected) versions of BDB are listed in
+# the ./configure script. Other versions *work*, but we need to stick to
+# the ones that can be detected to avoid a repeat of bug #564824.
+COMMON_DEPEND="
+	>=app-eselect/eselect-php-0.9.1[apache2?,fpm?]
+	>=dev-libs/libpcre-8.32[unicode]
+	fpm? ( acl? ( sys-apps/acl ) )
+	apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=]
+		<www-servers/apache-2.4[threads=] ) )
+	argon2? ( app-crypt/argon2:= )
+	berkdb? ( || (	sys-libs/db:5.3
+					sys-libs/db:5.1
+					sys-libs/db:4.8
+					sys-libs/db:4.7
+					sys-libs/db:4.6
+					sys-libs/db:4.5 ) )
+	bzip2? ( app-arch/bzip2:0= )
+	cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
+	coverage? ( dev-util/lcov )
+	curl? ( >=net-misc/curl-7.10.5 )
+	enchant? ( <app-text/enchant-2.0:0 )
+	firebird? ( dev-db/firebird )
+	gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib )
+	gdbm? ( >=sys-libs/gdbm-1.8.0:0= )
+	gmp? ( dev-libs/gmp:0= )
+	iconv? ( virtual/libiconv )
+	imap? ( virtual/imap-c-client[kerberos=,ssl=] )
+	intl? ( dev-libs/icu:= )
+	iodbc? ( dev-db/libiodbc )
+	kerberos? ( virtual/krb5 )
+	ldap? ( >=net-nds/openldap-1.2.11 )
+	ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 )
+	libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) )
+	lmdb? ( dev-db/lmdb:= )
+	mssql? ( dev-db/freetds[mssql] )
+	nls? ( sys-devel/gettext )
+	oci8-instant-client? ( dev-db/oracle-instantclient-basic )
+	odbc? ( >=dev-db/unixODBC-1.8.13 )
+	postgres? ( dev-db/postgresql:* )
+	qdbm? ( dev-db/qdbm )
+	readline? ( sys-libs/readline:0= )
+	recode? ( app-text/recode )
+	session-mm? ( dev-libs/mm )
+	simplexml? ( >=dev-libs/libxml2-2.6.8 )
+	snmp? ( >=net-analyzer/net-snmp-5.2 )
+	soap? ( >=dev-libs/libxml2-2.6.8 )
+	sodium? ( dev-libs/libsodium:= )
+	spell? ( >=app-text/aspell-0.50 )
+	sqlite? ( >=dev-db/sqlite-3.7.6.3 )
+	ssl? (
+		!libressl? ( dev-libs/openssl:0= )
+		libressl? ( dev-libs/libressl:0= )
+	)
+	tidy? ( || ( app-text/tidy-html5 app-text/htmltidy ) )
+	tokyocabinet? ( dev-db/tokyocabinet )
+	truetype? ( =media-libs/freetype-2* )
+	unicode? ( dev-libs/oniguruma:= )
+	wddx? ( >=dev-libs/libxml2-2.6.8 )
+	webp? ( media-libs/libwebp:0= )
+	xml? ( >=dev-libs/libxml2-2.6.8 )
+	xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
+	xmlreader? ( >=dev-libs/libxml2-2.6.8 )
+	xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
+	xpm? ( x11-libs/libXpm )
+	xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
+	zip? ( sys-libs/zlib:0= )
+	zip-encryption? ( >=dev-libs/libzip-1.2.0:= )
+	zlib? ( sys-libs/zlib:0= )
+"
+
+RDEPEND="${COMMON_DEPEND}
+	virtual/mta
+	fpm? (
+		selinux? ( sec-policy/selinux-phpfpm )
+		systemd? ( sys-apps/systemd ) )"
+
+# Bison isn't actually needed when building from a release tarball
+# However, the configure script will warn if it's absent or if you
+# have an incompatible version installed. See bug 593278.
+DEPEND="${COMMON_DEPEND}
+	app-arch/xz-utils
+	>=sys-devel/bison-3.0.1"
+
+# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
+REQUIRED_USE="
+	|| ( cli cgi fpm apache2 embed phpdbg )
+	cli? ( ^^ ( readline libedit ) )
+	truetype? ( gd zlib )
+	webp? ( gd zlib )
+	cjk? ( gd zlib )
+	exif? ( gd zlib )
+	xpm? ( gd zlib )
+	gd? ( zlib )
+	simplexml? ( xml )
+	soap? ( xml )
+	wddx? ( xml )
+	xmlrpc? ( || ( xml iconv ) )
+	xmlreader? ( xml )
+	xslt? ( xml )
+	ldap-sasl? ( ldap )
+	mhash? ( hash )
+	phar? ( hash )
+	qdbm? ( !gdbm )
+	readline? ( !libedit )
+	recode? ( !imap !mysqli !mysql )
+	session-mm? ( session !threads )
+	mysql? ( hash || ( mysqli pdo ) )
+	mysqli? ( hash )
+	zip-encryption? ( zip )
+"
+PATCHES=(
+	"${FILESDIR}/php-freetype-2.9.1.patch"
+	"${FILESDIR}/php-7.1.25-intl-detect-icu-via-pkg-config.patch"
+	"${FILESDIR}/php-7.2.13-intl-use-icu-namespace.patch"
+)
+
+PHP_MV="$(ver_cut 1)"
+
+php_install_ini() {
+	local phpsapi="${1}"
+
+	# work out where we are installing the ini file
+	php_set_ini_dir "${phpsapi}"
+
+	# Always install the production INI file, bug 611214.
+	local phpinisrc="php.ini-production-${phpsapi}"
+	cp php.ini-production "${phpinisrc}" || die
+
+	# default to /tmp for save_path, bug #282768
+	sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die
+
+	# Set the extension dir
+	sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \
+		-i "${phpinisrc}" || die
+
+	# Set the include path to point to where we want to find PEAR packages
+	sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die
+
+	dodir "${PHP_INI_DIR#${EPREFIX}}"
+	insinto "${PHP_INI_DIR#${EPREFIX}}"
+	newins "${phpinisrc}" php.ini
+
+	elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}"
+	elog
+
+	dodir "${PHP_EXT_INI_DIR#${EPREFIX}}"
+	dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}"
+
+	if use opcache; then
+		elog "Adding opcache to $PHP_EXT_INI_DIR"
+		echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \
+			 "${D}/${PHP_EXT_INI_DIR}"/opcache.ini
+		dosym "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" \
+			  "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini"
+	fi
+
+	# SAPI-specific handling
+	if [[ "${sapi}" == "fpm" ]] ; then
+		einfo "Installing FPM config files php-fpm.conf and www.conf"
+		insinto "${PHP_INI_DIR#${EPREFIX}}"
+		doins sapi/fpm/php-fpm.conf
+		insinto "${PHP_INI_DIR#${EPREFIX}}/fpm.d"
+		doins sapi/fpm/www.conf
+	fi
+
+	dodoc php.ini-{development,production}
+}
+
+php_set_ini_dir() {
+	PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}"
+	PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
+	PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
+}
+
+src_prepare() {
+	default
+
+	# In php-7.x, the FPM pool configuration files have been split off
+	# of the main config. By default the pool config files go in
+	# e.g. /etc/php-fpm.d, which isn't slotted. So here we move the
+	# include directory to a subdirectory "fpm.d" of $PHP_INI_DIR. Later
+	# we'll install the pool configuration file "www.conf" there.
+	php_set_ini_dir fpm
+	sed -i "s~^include=.*$~include=${PHP_INI_DIR}/fpm.d/*.conf~" \
+		sapi/fpm/php-fpm.conf.in \
+		|| die 'failed to move the include directory in php-fpm.conf'
+
+	# Bug 669566 - necessary so that build tools are updated for commands like pecl
+	# Force rebuilding aclocal.m4
+	rm -f aclocal.m4 || die "failed to remove aclocal.m4 in src_prepare"
+	eautoreconf
+}
+
+src_configure() {
+	addpredict /usr/share/snmp/mibs/.index #nowarn
+	addpredict /var/lib/net-snmp/mib_indexes #nowarn
+
+	PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
+
+	# The php-fpm config file wants localstatedir to be ${EPREFIX}/var
+	# and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002.
+	local our_conf=(
+		--prefix="${PHP_DESTDIR}"
+		--mandir="${PHP_DESTDIR}/man"
+		--infodir="${PHP_DESTDIR}/info"
+		--libdir="${PHP_DESTDIR}/lib"
+		--with-libdir="$(get_libdir)"
+		--localstatedir="${EPREFIX}/var"
+		--without-pear
+		$(use_enable threads maintainer-zts)
+	)
+
+	our_conf+=(
+		$(use_with argon2 password-argon2 "${EPREFIX}/usr")
+		$(use_enable bcmath bcmath)
+		$(use_with bzip2 bz2 "${EPREFIX}/usr")
+		$(use_enable calendar calendar)
+		$(use_enable coverage gcov)
+		$(use_enable ctype ctype)
+		$(use_with curl curl "${EPREFIX}/usr")
+		$(use_enable xml dom)
+		$(use_with enchant enchant "${EPREFIX}/usr")
+		$(use_enable exif exif)
+		$(use_enable fileinfo fileinfo)
+		$(use_enable filter filter)
+		$(use_enable ftp ftp)
+		$(use_with nls gettext "${EPREFIX}/usr")
+		$(use_with gmp gmp "${EPREFIX}/usr")
+		$(use_enable hash hash)
+		$(use_with mhash mhash "${EPREFIX}/usr")
+		$(use_with iconv iconv \
+			$(use elibc_glibc || use elibc_musl || use elibc_FreeBSD || echo "${EPREFIX}/usr"))
+		$(use_enable intl intl)
+		$(use_enable ipv6 ipv6)
+		$(use_enable json json)
+		$(use_with kerberos kerberos "${EPREFIX}/usr")
+		$(use_enable xml libxml)
+		$(use_with xml libxml-dir "${EPREFIX}/usr")
+		$(use_enable unicode mbstring)
+		$(use_with unicode onig "${EPREFIX}/usr")
+		$(use_with ssl openssl "${EPREFIX}/usr")
+		$(use_with ssl openssl-dir "${EPREFIX}/usr")
+		$(use_enable pcntl pcntl)
+		$(use_enable phar phar)
+		$(use_enable pdo pdo)
+		$(use_enable opcache opcache)
+		$(use_with postgres pgsql "${EPREFIX}/usr")
+		$(use_enable posix posix)
+		$(use_with spell pspell "${EPREFIX}/usr")
+		$(use_with recode recode "${EPREFIX}/usr")
+		$(use_enable simplexml simplexml)
+		$(use_enable sharedmem shmop)
+		$(use_with snmp snmp "${EPREFIX}/usr")
+		$(use_enable soap soap)
+		$(use_enable sockets sockets)
+		$(use_with sodium sodium "${EPREFIX}/usr")
+		$(use_with sqlite sqlite3 "${EPREFIX}/usr")
+		$(use_enable sysvipc sysvmsg)
+		$(use_enable sysvipc sysvsem)
+		$(use_enable sysvipc sysvshm)
+		$(use_with tidy tidy "${EPREFIX}/usr")
+		$(use_enable tokenizer tokenizer)
+		$(use_enable wddx wddx)
+		$(use_enable xml xml)
+		$(use_enable xmlreader xmlreader)
+		$(use_enable xmlwriter xmlwriter)
+		$(use_with xmlrpc xmlrpc)
+		$(use_with xslt xsl "${EPREFIX}/usr")
+		$(use_enable zip zip)
+		$(use_with zip-encryption libzip "${EPREFIX}/usr")
+		$(use_with zlib zlib "${EPREFIX}/usr")
+		$(use_enable debug debug)
+	)
+
+	# DBA support
+	if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
+		|| use qdbm || use lmdb || use tokyocabinet ; then
+		our_conf+=( "--enable-dba${shared}" )
+	fi
+
+	# DBA drivers support
+	our_conf+=(
+		$(use_with cdb cdb)
+		$(use_with berkdb db4 "${EPREFIX}/usr")
+		$(use_enable flatfile flatfile)
+		$(use_with gdbm gdbm "${EPREFIX}/usr")
+		$(use_enable inifile inifile)
+		$(use_with qdbm qdbm "${EPREFIX}/usr")
+		$(use_with lmdb lmdb "${EPREFIX}/usr")
+	)
+
+	# Support for the GD graphics library
+	our_conf+=(
+		$(use_with truetype freetype-dir "${EPREFIX}/usr")
+		$(use_enable cjk gd-jis-conv)
+		$(use_with gd jpeg-dir "${EPREFIX}/usr")
+		$(use_with gd png-dir "${EPREFIX}/usr")
+		$(use_with xpm xpm-dir "${EPREFIX}/usr")
+	)
+	if use webp; then
+		our_conf+=( --with-webp-dir="${EPREFIX}/usr" )
+	fi
+	# enable gd last, so configure can pick up the previous settings
+	our_conf+=( $(use_with gd gd) )
+
+	# IMAP support
+	if use imap ; then
+		our_conf+=(
+			$(use_with imap imap "${EPREFIX}/usr")
+			$(use_with ssl imap-ssl "${EPREFIX}/usr")
+		)
+	fi
+
+	# Interbase/firebird support
+	our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") )
+
+	# LDAP support
+	if use ldap ; then
+		our_conf+=(
+			$(use_with ldap ldap "${EPREFIX}/usr")
+			$(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr")
+		)
+	fi
+
+	# MySQL support
+	local mysqllib="mysqlnd"
+	local mysqlilib="mysqlnd"
+
+	our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
+
+	local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock"
+	if use mysql || use mysqli ; then
+		our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") )
+	fi
+
+	# ODBC support
+	our_conf+=(
+		$(use_with odbc unixODBC "${EPREFIX}/usr")
+		$(use_with iodbc iodbc "${EPREFIX}/usr")
+	)
+
+	# Oracle support
+	our_conf+=( $(use_with oci8-instant-client oci8) )
+
+	# PDO support
+	if use pdo ; then
+		our_conf+=(
+			$(use_with mssql pdo-dblib "${EPREFIX}/usr")
+			$(use_with mysql pdo-mysql "${mysqllib}")
+			$(use_with postgres pdo-pgsql)
+			$(use_with sqlite pdo-sqlite "${EPREFIX}/usr")
+			$(use_with firebird pdo-firebird "${EPREFIX}/usr")
+			$(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr")
+			$(use_with oci8-instant-client pdo-oci)
+		)
+	fi
+
+	# readline/libedit support
+	our_conf+=(
+		$(use_with readline readline "${EPREFIX}/usr")
+		$(use_with libedit libedit "${EPREFIX}/usr")
+	)
+
+	# Session support
+	if use session ; then
+		our_conf+=( $(use_with session-mm mm "${EPREFIX}/usr") )
+	else
+		our_conf+=( $(use_enable session session) )
+	fi
+
+	# Use pic for shared modules such as apache2's mod_php
+	our_conf+=( --with-pic )
+
+	# we use the system copy of pcre
+	# --with-pcre-regex affects ext/pcre
+	# --with-pcre-dir affects ext/filter and ext/zip
+	# --with-pcre-valgrind cannot be enabled with system pcre
+	# Many arches don't support pcre-jit
+	our_conf+=(
+		--with-pcre-regex="${EPREFIX}/usr"
+		--with-pcre-dir="${EPREFIX}/usr"
+		--without-pcre-valgrind
+		--without-pcre-jit
+	)
+
+	# Catch CFLAGS problems
+	# Fixes bug #14067.
+	# Changed order to run it in reverse for bug #32022 and #12021.
+	replace-cpu-flags "k6*" "i586"
+
+	# Cache the ./configure test results between SAPIs.
+	our_conf+=( --cache-file="${T}/config.cache" )
+
+	# Support user-passed configuration parameters
+	our_conf+=( ${EXTRA_ECONF:-} )
+
+	# Support the Apache2 extras, they must be set globally for all
+	# SAPIs to work correctly, especially for external PHP extensions
+
+	mkdir -p "${WORKDIR}/sapis-build" || die
+	for one_sapi in $SAPIS ; do
+		use "${one_sapi}" || continue
+		php_set_ini_dir "${one_sapi}"
+
+		# The BUILD_DIR variable is used to determine where to output
+		# the files that autotools creates. This was all originally
+		# based on the autotools-utils eclass.
+		BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}"
+		cp -a "${S}" "${BUILD_DIR}" || die
+		cd "${BUILD_DIR}" || die
+
+		local sapi_conf=(
+			--with-config-file-path="${PHP_INI_DIR}"
+			--with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}"
+		)
+
+		for sapi in $SAPIS ; do
+			case "$sapi" in
+				cli|cgi|embed|fpm|phpdbg)
+					if [[ "${one_sapi}" == "${sapi}" ]] ; then
+						sapi_conf+=( "--enable-${sapi}" )
+						if [[ "fpm" == "${sapi}" ]] ; then
+							sapi_conf+=(
+								$(use_with acl fpm-acl)
+								$(use_with systemd fpm-systemd)
+							)
+						fi
+					else
+						sapi_conf+=( "--disable-${sapi}" )
+					fi
+					;;
+
+				apache2)
+					if [[ "${one_sapi}" == "${sapi}" ]] ; then
+						sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" )
+					else
+						sapi_conf+=( --without-apxs2 )
+					fi
+					;;
+			esac
+		done
+
+		# Construct the $myeconfargs array by concatenating $our_conf
+		# (the common args) and $sapi_conf (the SAPI-specific args).
+		local myeconfargs=( "${our_conf[@]}" )
+		myeconfargs+=( "${sapi_conf[@]}" )
+
+		pushd "${BUILD_DIR}" > /dev/null || die
+		econf "${myeconfargs[@]}"
+		popd > /dev/null || die
+	done
+}
+
+src_compile() {
+	# snmp seems to run during src_compile, too (bug #324739)
+	addpredict /usr/share/snmp/mibs/.index #nowarn
+	addpredict /var/lib/net-snmp/mib_indexes #nowarn
+
+	for sapi in ${SAPIS} ; do
+		if use "${sapi}"; then
+			cd "${WORKDIR}/sapis-build/$sapi" || \
+				die "Failed to change dir to ${WORKDIR}/sapis-build/$1"
+			emake
+		fi
+	done
+}
+
+src_install() {
+	# see bug #324739 for what happens when we don't have that
+	addpredict /usr/share/snmp/mibs/.index #nowarn
+
+	# grab the first SAPI that got built and install common files from there
+	local first_sapi=""
+	for sapi in $SAPIS ; do
+		if use $sapi ; then
+			first_sapi=$sapi
+			break
+		fi
+	done
+
+	# Makefile forgets to create this before trying to write to it...
+	dodir "${PHP_DESTDIR#${EPREFIX}}/bin"
+
+	# Install php environment (without any sapis)
+	cd "${WORKDIR}/sapis-build/$first_sapi" || die
+	emake INSTALL_ROOT="${D}" \
+		install-build install-headers install-programs
+
+	local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)"
+
+	# Create the directory where we'll put version-specific php scripts
+	keepdir "/usr/share/php${PHP_MV}"
+
+	local sapi="", file=""
+	local sapi_list=""
+
+	for sapi in ${SAPIS}; do
+		if use "${sapi}" ; then
+			einfo "Installing SAPI: ${sapi}"
+			cd "${WORKDIR}/sapis-build/${sapi}" || die
+
+			if [[ "${sapi}" == "apache2" ]] ; then
+				# We're specifically not using emake install-sapi as libtool
+				# may cause unnecessary relink failures (see bug #351266)
+				insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/"
+				newins ".libs/libphp${PHP_MV}$(get_libname)" \
+					   "libphp${PHP_MV}$(get_libname)"
+				keepdir "/usr/$(get_libdir)/apache2/modules"
+			else
+				# needed each time, php_install_ini would reset it
+				local dest="${PHP_DESTDIR#${EPREFIX}}"
+				into "${dest}"
+				case "$sapi" in
+					cli)
+						source="sapi/cli/php"
+						;;
+					cgi)
+						source="sapi/cgi/php-cgi"
+						;;
+					fpm)
+						source="sapi/fpm/php-fpm"
+						;;
+					embed)
+						source="libs/libphp${PHP_MV}$(get_libname)"
+						;;
+					phpdbg)
+						source="sapi/phpdbg/phpdbg"
+						;;
+					*)
+						die "unhandled sapi in src_install"
+						;;
+				esac
+
+				if [[ "${source}" == *"$(get_libname)" ]]; then
+					dolib.so "${source}"
+				else
+					dobin "${source}"
+					local name="$(basename ${source})"
+					dosym "${dest}/bin/${name}" "/usr/bin/${name}${SLOT}"
+				fi
+			fi
+
+			php_install_ini "${sapi}"
+
+			# construct correct SAPI string for php-config
+			# thanks to ferringb for the bash voodoo
+			if [[ "${sapi}" == "apache2" ]]; then
+				sapi_list="${sapi_list:+${sapi_list} }apache2handler"
+			else
+				sapi_list="${sapi_list:+${sapi_list} }${sapi}"
+			fi
+		fi
+	done
+
+	# Installing opcache module
+	if use opcache ; then
+		into "${PHP_DESTDIR#${EPREFIX}}"
+		dolib.so "modules/opcache$(get_libname)"
+	fi
+
+	# Install env.d files
+	newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}"
+	sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
+	sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
+
+	# set php-config variable correctly (bug #278439)
+	sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \
+		"${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die
+
+	if use fpm ; then
+		if use systemd; then
+			systemd_newunit "${FILESDIR}/php-fpm_at.service" \
+							"php-fpm@${SLOT}.service"
+		else
+			systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \
+							"php-fpm@${SLOT}.service"
+		fi
+	fi
+}
+
+src_test() {
+	echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
+	PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
+	if [[ ! -x "${PHP_BIN}" ]] ; then
+		ewarn "Test phase requires USE=cli, skipping"
+		return
+	else
+		export TEST_PHP_EXECUTABLE="${PHP_BIN}"
+	fi
+
+	if [[ -x "${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" ]] ; then
+		export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi"
+	fi
+
+	if [[ -x "${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" ]] ; then
+		export TEST_PHPDBG_EXECUTABLE="${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg"
+	fi
+
+	REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n  -d \
+					  "session.save_path=${T}" \
+					  "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \
+					  "session.save_path=${T}"
+
+	for name in ${EXPECTED_TEST_FAILURES}; do
+		mv "${name}.out" "${name}.out.orig" 2>/dev/null || die
+	done
+
+	local failed="$(find -name '*.out')"
+	if [[ ${failed} != "" ]] ; then
+		ewarn "The following test cases failed unexpectedly:"
+		for name in ${failed}; do
+			ewarn "  ${name/.out/}"
+		done
+	else
+		einfo "No unexpected test failures, all fine"
+	fi
+
+	if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
+		local passed=""
+		for name in ${EXPECTED_TEST_FAILURES}; do
+			[[ -f "${name}.diff" ]] && continue
+			passed="${passed} ${name}"
+		done
+		if [[ ${passed} != "" ]] ; then
+			einfo "The following test cases passed unexpectedly:"
+			for name in ${passed}; do
+				ewarn "  ${passed}"
+			done
+		else
+			einfo "None of the known-to-fail tests passed, all fine"
+		fi
+	fi
+}
+
+pkg_postinst() {
+	# Output some general info to the user
+	if use apache2 ; then
+		elog
+		elog "To enable PHP in apache, you will need to add \"-D PHP\" to"
+		elog "your apache2 command. OpenRC users can append that string to"
+		elog "APACHE2_OPTS in /etc/conf.d/apache2."
+		elog
+		elog "The apache module configuration file 70_mod_php.conf is"
+		elog "provided (and maintained) by eselect-php."
+		elog
+	fi
+
+	# Create the symlinks for php
+	for m in ${SAPIS}; do
+		[[ ${m} == 'embed' ]] && continue;
+		if use $m ; then
+			local ci=$(eselect php show $m)
+			if [[ -z $ci ]]; then
+				eselect php set $m php${SLOT} || die
+				einfo "Switched ${m} to use php:${SLOT}"
+				einfo
+			elif [[ $ci != "php${SLOT}" ]] ; then
+				elog "To switch $m to use php:${SLOT}, run"
+				elog "    eselect php set $m php${SLOT}"
+				elog
+			fi
+		fi
+	done
+
+	# Remove dead symlinks for SAPIs that were just disabled. For
+	# example, if the user has the cgi SAPI enabled, then he has an
+	# eselect-php symlink for it. If he later reinstalls PHP with
+	# USE="-cgi", that symlink will break. This call to eselect is
+	# supposed to remove that dead link per bug 572436.
+	eselect php cleanup || die
+
+	if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then
+	   elog "To build extensions for this version of PHP, you will need to"
+	   elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable."
+	   elog
+	fi
+
+	# Warn about the removal of PHP_INI_VERSION if the user has it set.
+	if [[ -n "${PHP_INI_VERSION}" ]]; then
+		ewarn 'The PHP_INI_VERSION variable has been phased out. You may'
+		ewarn 'remove it from your configuration at your convenience. See'
+		ewarn
+		ewarn '  https://bugs.gentoo.org/611214'
+		ewarn
+		ewarn 'for more information.'
+	fi
+
+	elog "For details on how version slotting works, please see"
+	elog "the wiki:"
+	elog
+	elog "  https://wiki.gentoo.org/wiki/PHP"
+	elog
+}
+
+pkg_postrm() {
+	# This serves two purposes. First, if we have just removed the last
+	# installed version of PHP, then this will remove any dead symlinks
+	# belonging to eselect-php. Second, if a user upgrades slots from
+	# (say) 5.6 to 7.0 and depcleans the old slot, then this will update
+	# his existing symlinks to point to the new 7.0 installation. The
+	# latter is bug 432962.
+	#
+	# Note: the eselect-php package may not be installed at this point,
+	# so we can't die() if this command fails.
+	eselect php cleanup
+}


^ permalink raw reply related	[flat|nested] 21+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-lang/php/files/, dev-lang/php/
@ 2018-12-07  0:41 Thomas Deutschmann
  0 siblings, 0 replies; 21+ messages in thread
From: Thomas Deutschmann @ 2018-12-07  0:41 UTC (permalink / raw
  To: gentoo-commits

commit:     8afd29d91effe9a8e70bad4c15cbe7f1b581d97d
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Fri Dec  7 00:27:48 2018 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Fri Dec  7 00:41:37 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8afd29d9

dev-lang/php: bump to v7.1.25

- EAPI bump to EAPI=7

- Use pkg-config for detecting ICU

- Proper ICU namespace usage backported

Package-Manager: Portage-2.3.52, Repoman-2.3.12
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>

 dev-lang/php/Manifest                              |   1 +
 ...php-7.1.25-intl-detect-icu-via-pkg-config.patch | 121 ++++
 .../files/php-7.1.25-intl-use-icu-namespace.patch  | 379 +++++++++++
 dev-lang/php/php-7.1.25.ebuild                     | 736 +++++++++++++++++++++
 4 files changed, 1237 insertions(+)

diff --git a/dev-lang/php/Manifest b/dev-lang/php/Manifest
index daea28268f7..7b889cd1d3f 100644
--- a/dev-lang/php/Manifest
+++ b/dev-lang/php/Manifest
@@ -6,6 +6,7 @@ DIST php-7.0.33.tar.xz 12033040 BLAKE2B cb7a4eb3ba8ede93ae8e85b6a11664f33654f7e9
 DIST php-7.1.22.tar.xz 12227848 BLAKE2B 72fab94b1c7ecfd3479f6d6c9a76a9d8813f7789402664201615d79ab8b5bb26fb1b7273769c4898a36f0336e0ce4d50bf2f17b81ddb54acc9583e39623e3a5b SHA512 0fc0907d303711dbc4ba0a18618e3e73550c73d13988c769f8d50066017b1efe3feb0d22d5539f69271ea4e9532a3d997e22841cb59bdbf96313169e1c03538d
 DIST php-7.1.23.tar.xz 12227528 BLAKE2B d03470b07ae041c4677e100c1b4f7994d3e15d4830eccba3c654c1f3546345c8205cac057011d2d43ab962ebbc01652f6748270daa40aa1e540453923500288c SHA512 d5a451f1a48415175e3117ffa84ef3504275a407698b59c13eeb403958aa27342e04dc4ffea9791b923ac0cc5d6fdacf2e8672f0e19755bae858707c7fc3627f
 DIST php-7.1.24.tar.xz 12205112 BLAKE2B d4dd8bdd980cbb2c8cd813cad44da7a322d75641bb5f4eb986f6be44acf61898e64e43a3206da08b6c68fb1213a95cf5c6bf28bc75356d9abd9711330fa04554 SHA512 ee54d04fa1bb049807e7876baf6a4d12ab8360367bb44ac77c71e53ee8ca078342b4a86f2bc4587838ead27fb8204fea8e739bd582a9e146513ae5d465e59202
+DIST php-7.1.25.tar.xz 12205972 BLAKE2B 3d69cc87d75ee45dc85e5e672ddb6c312fcba12882e227d28e397e1e796e0149588b9519beeb990111315a747a07fa5349ad5f9662c0725b4551478f9e95b51d SHA512 10a75b96d5fa104bc1d5b63f4606d9cfacfc594f7d6ab34f9c5e9e8f209b896516c4121b9cbd323a862724d6dfbd275ef902993cfab619d9a4b9518790b9147c
 DIST php-7.2.10.tar.xz 12160864 BLAKE2B f1959a00622c1bd11fa87c61d152c802b307f0b9e89b51ed86b40086cda03eeb6652d47b59df8cc7c9b4e79ab687ae1292b978f453e9f07ac352d209b64c62d8 SHA512 aa90fce17034b2649012d66461626ae74c21ea938b1c71c7eb12419e562c641b432df87a7e900c245ad28df39624cf64a1b2f8ffb123608d94cd35e41f09c0fe
 DIST php-7.2.11.tar.xz 12132268 BLAKE2B 8007f6a8f4236efb796681d25f2066deeba98e6e136def0c323aa13399951d58d7f218b3544b3bd0418dfe220f87a38b6515547c50f65c641bd09a2d440eb4e1 SHA512 0cd8578147d17d612e013dfc22b73977719177058b39c7b61dd0bfdfb8c2441aba78af49f58c824f7e66c89b5ad201c36fafb89ccf1e2d20f19b79d6a8fed7e5
 DIST php-7.2.12.tar.xz 12141472 BLAKE2B 25d55fcbe63aab64c658e9c4ab52b552831d5c03a8887e1c64f0cadbb8b0d9f3c38cd5d15dac89002c328b737ad864fce392baa0891292ee77d1975562a2bc17 SHA512 bbeaed1278d0d2f1ecb2249dab1ebaab1489ef43be0797dac57d8b523d8e5d284166e6cbf52095f5d34eef447fbdeb0c6916caaa5770221a180ec064f4ffcad8

diff --git a/dev-lang/php/files/php-7.1.25-intl-detect-icu-via-pkg-config.patch b/dev-lang/php/files/php-7.1.25-intl-detect-icu-via-pkg-config.patch
new file mode 100644
index 00000000000..2d4254d6e59
--- /dev/null
+++ b/dev-lang/php/files/php-7.1.25-intl-detect-icu-via-pkg-config.patch
@@ -0,0 +1,121 @@
+Based on the following upstream commits:
+
+https://github.com/php/php-src/commit/9a8e7b571896f39f83cb000fdb7c466b6d328d52
+https://github.com/php/php-src/pull/3701
+https://github.com/php/php-src/commit/2bd299f7318492fd7e5cafffa562d76ba60e69d4
+
+--- a/acinclude.m4
++++ b/acinclude.m4
+@@ -2205,52 +2205,16 @@ dnl
+ dnl Common setup macro for ICU
+ dnl
+ AC_DEFUN([PHP_SETUP_ICU],[
+-  PHP_ARG_WITH(icu-dir,,
+-  [  --with-icu-dir=DIR      Specify where ICU libraries and headers can be found], DEFAULT, no)
++  PKG_CHECK_MODULES([ICU], [icu-io >= 50.1])
+ 
+-  if test "$PHP_ICU_DIR" = "no"; then
+-    PHP_ICU_DIR=DEFAULT
+-  fi
+-
+-  if test "$PHP_ICU_DIR" = "DEFAULT"; then
+-    dnl Try to find icu-config
+-    AC_PATH_PROG(ICU_CONFIG, icu-config, no, [$PATH:/usr/local/bin])
+-  else
+-    ICU_CONFIG="$PHP_ICU_DIR/bin/icu-config"
+-  fi
+-
+-  AC_MSG_CHECKING([for location of ICU headers and libraries])
+-
+-  dnl Trust icu-config to know better what the install prefix is..
+-  icu_install_prefix=`$ICU_CONFIG --prefix 2> /dev/null`
+-  if test "$?" != "0" || test -z "$icu_install_prefix"; then
+-    AC_MSG_RESULT([not found])
+-    AC_MSG_ERROR([Unable to detect ICU prefix or $ICU_CONFIG failed. Please verify ICU install prefix and make sure icu-config works.])
+-  else
+-    AC_MSG_RESULT([$icu_install_prefix])
+-
+-    dnl Check ICU version
+-    AC_MSG_CHECKING([for ICU 4.0 or greater])
+-    icu_version_full=`$ICU_CONFIG --version`
+-    ac_IFS=$IFS
+-    IFS="."
+-    set $icu_version_full
+-    IFS=$ac_IFS
+-    icu_version=`expr [$]1 \* 1000 + [$]2`
+-    AC_MSG_RESULT([found $icu_version_full])
+-
+-    if test "$icu_version" -lt "4000"; then
+-      AC_MSG_ERROR([ICU version 4.0 or later is required])
+-    fi
++  PHP_EVAL_INCLINE($ICU_CFLAGS)
++  PHP_EVAL_LIBLINE($ICU_LIBS, $1)
+ 
+-    ICU_VERSION=$icu_version
+-    ICU_INCS=`$ICU_CONFIG --cppflags-searchpath`
+-    ICU_LIBS=`$ICU_CONFIG --ldflags --ldflags-icuio`
+-    PHP_EVAL_INCLINE($ICU_INCS)
+-    PHP_EVAL_LIBLINE($ICU_LIBS, $1)
++  ICU_CFLAGS="$ICU_CFLAGS -DU_NO_DEFAULT_INCLUDE_UTF_HEADERS=1"
++  ICU_CXXFLAGS="$ICU_CXXFLAGS -DUNISTR_FROM_CHAR_EXPLICIT=explicit -DUNISTR_FROM_STRING_EXPLICIT=explicit"
+ 
+-    ICU_CXXFLAGS=`$ICU_CONFIG --cxxflags`
+-    ICU_CXXFLAGS="$ICU_CXXFLAGS -DU_USING_ICU_NAMESPACE=1"
++  if test "$PKG_CONFIG icu-io --atleast-version=60"; then
++    ICU_CFLAGS="$ICU_CFLAGS -DU_HIDE_OBSOLETE_UTF_OLD_H=1"
+   fi
+ ])
+ 
+--- a/ext/intl/config.m4
++++ b/ext/intl/config.m4
+@@ -9,15 +9,7 @@ if test "$PHP_INTL" != "no"; then
+   PHP_SETUP_ICU(INTL_SHARED_LIBADD)
+   PHP_SUBST(INTL_SHARED_LIBADD)
+   PHP_REQUIRE_CXX()
+-  INTL_COMMON_FLAGS="$ICU_INCS -Wno-write-strings -D__STDC_LIMIT_MACROS -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"
+-  if test "$icu_version" -ge "4002"; then
+-    icu_spoof_src=" spoofchecker/spoofchecker_class.c \
+-    spoofchecker/spoofchecker.c\
+-    spoofchecker/spoofchecker_create.c\
+-    spoofchecker/spoofchecker_main.c"
+-  else
+-    icu_spoof_src=""
+-  fi
++  INTL_COMMON_FLAGS="$ICU_CFLAGS -Wno-write-strings -D__STDC_LIMIT_MACROS -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"
+   PHP_NEW_EXTENSION(intl, php_intl.c \
+     intl_error.c \
+     intl_convert.c \
+@@ -68,9 +60,12 @@ if test "$PHP_INTL" != "no"; then
+     transliterator/transliterator_methods.c \
+     uchar/uchar.c \
+     idn/idn.c \
+-    $icu_spoof_src, $ext_shared,,$INTL_COMMON_FLAGS,cxx)
++    spoofchecker/spoofchecker_class.c \
++    spoofchecker/spoofchecker.c\
++    spoofchecker/spoofchecker_create.c\
++    spoofchecker/spoofchecker_main.c, $ext_shared,,$INTL_COMMON_FLAGS,cxx)
+ 
+-  PHP_INTL_CXX_SOURCES="intl_convertcpp.cpp \
++  PHP_INTL_CPP_SOURCES="intl_convertcpp.cpp \
+     common/common_enum.cpp \
+     common/common_date.cpp \
+     dateformat/dateformat_format_object.cpp \
+@@ -89,11 +84,12 @@ if test "$PHP_INTL" != "no"; then
+     breakiterator/rulebasedbreakiterator_methods.cpp \
+     breakiterator/codepointiterator_internal.cpp \
+     breakiterator/codepointiterator_methods.cpp"
+-  PHP_INTL_CXX_FLAGS="$INTL_COMMON_FLAGS $ICU_CXXFLAGS"
++
++  PHP_INTL_CPP_FLAGS="$ICU_CXXFLAGS -Wno-write-strings -D__STDC_LIMIT_MACROS -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"
+   if test "$ext_shared" = "no"; then
+-    PHP_ADD_SOURCES(PHP_EXT_DIR(intl), $PHP_INTL_CXX_SOURCES, $PHP_INTL_CXX_FLAGS)
++    PHP_ADD_SOURCES(PHP_EXT_DIR(intl), $PHP_INTL_CPP_SOURCES, $PHP_INTL_CPP_FLAGS)
+   else
+-    PHP_ADD_SOURCES_X(PHP_EXT_DIR(intl), $PHP_INTL_CXX_SOURCES, $PHP_INTL_CXX_FLAGS, shared_objects_intl, yes)
++    PHP_ADD_SOURCES_X(PHP_EXT_DIR(intl), $PHP_INTL_CPP_SOURCES, $PHP_INTL_CPP_FLAGS, shared_objects_intl, yes)
+   fi
+ 
+   PHP_ADD_BUILD_DIR($ext_builddir/collator)
+-- 
+2.19.2
+

diff --git a/dev-lang/php/files/php-7.1.25-intl-use-icu-namespace.patch b/dev-lang/php/files/php-7.1.25-intl-use-icu-namespace.patch
new file mode 100644
index 00000000000..5a1cc472f10
--- /dev/null
+++ b/dev-lang/php/files/php-7.1.25-intl-use-icu-namespace.patch
@@ -0,0 +1,379 @@
+Based on the following upstream commits:
+
+https://github.com/php/php-src/commit/8d35a423838eb462cd39ee535c5d003073cc5f22
+https://github.com/php/php-src/commit/d8200e48857aeaf09f7127751efc5632ef7660a7
+https://github.com/php/php-src/commit/9a8e7b571896f39f83cb000fdb7c466b6d328d52
+
+--- a/ext/intl/breakiterator/breakiterator_class.cpp
++++ b/ext/intl/breakiterator/breakiterator_class.cpp
+@@ -38,6 +38,7 @@ extern "C" {
+ }
+ 
+ using PHP::CodePointBreakIterator;
++using icu::RuleBasedBreakIterator;
+ 
+ /* {{{ Global variables */
+ zend_class_entry *BreakIterator_ce_ptr;
+--- a/ext/intl/breakiterator/breakiterator_class.h
++++ b/ext/intl/breakiterator/breakiterator_class.h
+@@ -26,6 +26,8 @@
+ 
+ #ifndef USE_BREAKITERATOR_POINTER
+ typedef void BreakIterator;
++#else
++using icu::BreakIterator;
+ #endif
+ 
+ typedef struct {
+--- a/ext/intl/breakiterator/breakiterator_methods.cpp
++++ b/ext/intl/breakiterator/breakiterator_methods.cpp
+@@ -32,6 +32,8 @@ extern "C" {
+ }
+ 
+ using PHP::CodePointBreakIterator;
++using icu::BreakIterator;
++using icu::Locale;
+ 
+ U_CFUNC PHP_METHOD(BreakIterator, __construct)
+ {
+--- a/ext/intl/breakiterator/codepointiterator_internal.cpp
++++ b/ext/intl/breakiterator/codepointiterator_internal.cpp
+@@ -33,6 +33,8 @@ typedef union {
+ 
+ using namespace PHP;
+ 
++using icu::UCharCharacterIterator;
++
+ UOBJECT_DEFINE_RTTI_IMPLEMENTATION(CodePointBreakIterator);
+ 
+ CodePointBreakIterator::CodePointBreakIterator()
+--- a/ext/intl/breakiterator/codepointiterator_internal.h
++++ b/ext/intl/breakiterator/codepointiterator_internal.h
+@@ -18,8 +18,11 @@
+ #define CODEPOINTITERATOR_INTERNAL_H
+ 
+ #include <unicode/brkiter.h>
++#include <unicode/unistr.h>
+ 
+-using U_ICU_NAMESPACE::BreakIterator;
++using icu::BreakIterator;
++using icu::CharacterIterator;
++using icu::UnicodeString;
+ 
+ namespace PHP {
+ 
+--- a/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp
++++ b/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp
+@@ -26,6 +26,9 @@ extern "C" {
+ #include "../intl_convertcpp.h"
+ #include "../intl_common.h"
+ 
++using icu::RuleBasedBreakIterator;
++using icu::Locale;
++
+ static inline RuleBasedBreakIterator *fetch_rbbi(BreakIterator_object *bio) {
+ 	return (RuleBasedBreakIterator*)bio->biter;
+ }
+--- a/ext/intl/calendar/calendar_class.cpp
++++ b/ext/intl/calendar/calendar_class.cpp
+@@ -34,6 +34,9 @@ extern "C" {
+ #include <assert.h>
+ }
+ 
++using icu::GregorianCalendar;
++using icu::Locale;
++
+ /* {{{ Global variables */
+ zend_class_entry *Calendar_ce_ptr;
+ zend_class_entry *GregorianCalendar_ce_ptr;
+--- a/ext/intl/calendar/calendar_class.h
++++ b/ext/intl/calendar/calendar_class.h
+@@ -26,6 +26,8 @@
+ 
+ #ifndef USE_CALENDAR_POINTER
+ typedef void Calendar;
++#else
++using icu::Calendar;
+ #endif
+ 
+ typedef struct {
+--- a/ext/intl/calendar/calendar_methods.cpp
++++ b/ext/intl/calendar/calendar_methods.cpp
+@@ -40,6 +40,8 @@ extern "C" {
+ }
+ #include "../common/common_enum.h"
+ 
++using icu::Locale;
++
+ U_CFUNC PHP_METHOD(IntlCalendar, __construct)
+ {
+ 	zend_throw_exception( NULL,
+--- a/ext/intl/calendar/gregoriancalendar_methods.cpp
++++ b/ext/intl/calendar/gregoriancalendar_methods.cpp
+@@ -23,6 +23,8 @@
+ #include <unicode/locid.h>
+ #include <unicode/calendar.h>
+ #include <unicode/gregocal.h>
++#include <unicode/ustring.h>
++
+ extern "C" {
+ #include "../php_intl.h"
+ #include "../intl_common.h"
+@@ -34,6 +36,11 @@ extern "C" {
+ #include "zend_exceptions.h"
+ }
+ 
++using icu::GregorianCalendar;
++using icu::Locale;
++using icu::UnicodeString;
++using icu::StringPiece;
++
+ static inline GregorianCalendar *fetch_greg(Calendar_object *co) {
+ 	return (GregorianCalendar*)co->ucal;
+ }
+--- a/ext/intl/common/common_date.cpp
++++ b/ext/intl/common/common_date.cpp
+@@ -25,6 +25,9 @@ extern "C" {
+ #include <ext/date/php_date.h>
+ }
+ 
++using icu::TimeZone;
++using icu::UnicodeString;
++
+ #ifndef INFINITY
+ #define INFINITY (DBL_MAX+DBL_MAX)
+ #endif
+--- a/ext/intl/common/common_date.h
++++ b/ext/intl/common/common_date.h
+@@ -28,6 +28,8 @@ U_CDECL_END
+ 
+ #include <unicode/timezone.h>
+ 
++using icu::TimeZone;
++
+ U_CFUNC TimeZone *timezone_convert_datetimezone(int type, void *object, int is_datetime, intl_error *outside_error, const char *func);
+ U_CFUNC int intl_datetime_decompose(zval *z, double *millis, TimeZone **tz,
+ 		intl_error *err, const char *func);
+--- a/ext/intl/common/common_enum.h
++++ b/ext/intl/common/common_enum.h
+@@ -75,6 +75,7 @@ U_CFUNC zval *zoi_with_current_get_current_data(zend_object_iterator *iter);
+ U_CFUNC void zoi_with_current_invalidate_current(zend_object_iterator *iter);
+ 
+ #ifdef __cplusplus
++using icu::StringEnumeration;
+ U_CFUNC void IntlIterator_from_StringEnumeration(StringEnumeration *se, zval *object);
+ #endif
+ 
+--- a/ext/intl/converter/converter.c
++++ b/ext/intl/converter/converter.c
+@@ -18,6 +18,8 @@
+ #include "zend_exceptions.h"
+ 
+ #include <unicode/utypes.h>
++#include <unicode/utf8.h>
++#include <unicode/utf16.h>
+ #include <unicode/ucnv.h>
+ #include <unicode/ustring.h>
+ 
+--- a/ext/intl/dateformat/dateformat_format_object.cpp
++++ b/ext/intl/dateformat/dateformat_format_object.cpp
+@@ -33,6 +33,12 @@ extern "C" {
+ #include "../common/common_date.h"
+ }
+ 
++using icu::Locale;
++using icu::DateFormat;
++using icu::GregorianCalendar;
++using icu::StringPiece;
++using icu::SimpleDateFormat;
++
+ static const DateFormat::EStyle valid_styles[] = {
+ 		DateFormat::kNone,
+ 		DateFormat::kFull,
+--- a/ext/intl/dateformat/dateformat_helpers.cpp
++++ b/ext/intl/dateformat/dateformat_helpers.cpp
+@@ -28,6 +28,8 @@ extern "C" {
+ #include "../calendar/calendar_class.h"
+ }
+ 
++using icu::GregorianCalendar;
++
+ int datefmt_process_calendar_arg(zval* calendar_zv,
+ 								 Locale const& locale,
+ 								 const char *func_name,
+--- a/ext/intl/dateformat/dateformat_helpers.h
++++ b/ext/intl/dateformat/dateformat_helpers.h
+@@ -22,11 +22,16 @@
+ #endif
+ 
+ #include <unicode/calendar.h>
++#include <unicode/datefmt.h>
+ 
+ extern "C" {
+ #include "../php_intl.h"
+ }
+ 
++using icu::Locale;
++using icu::Calendar;
++using icu::DateFormat;
++
+ int datefmt_process_calendar_arg(zval* calendar_zv,
+ 								 Locale const& locale,
+ 								 const char *func_name,
+--- a/ext/intl/grapheme/grapheme_string.c
++++ b/ext/intl/grapheme/grapheme_string.c
+@@ -24,6 +24,7 @@
+ #include "grapheme_util.h"
+ 
+ #include <unicode/utypes.h>
++#include <unicode/utf8.h>
+ #include <unicode/ucol.h>
+ #include <unicode/ustring.h>
+ #include <unicode/ubrk.h>
+@@ -835,10 +836,10 @@ PHP_FUNCTION(grapheme_extract)
+ 	pstr = str + start;
+ 
+ 	/* just in case pstr points in the middle of a character, move forward to the start of the next char */
+-	if ( !UTF8_IS_SINGLE(*pstr) && !U8_IS_LEAD(*pstr) ) {
+-		char *str_end = str + str_len;
++	if ( !U8_IS_SINGLE(*pstr) && !U8_IS_LEAD(*pstr) ) {
++		unsigned char *str_end = str + str_len;
+ 
+-		while ( !UTF8_IS_SINGLE(*pstr) && !U8_IS_LEAD(*pstr) ) {
++		while ( !U8_IS_SINGLE(*pstr) && !U8_IS_LEAD(*pstr) ) {
+ 			pstr++;
+ 			if ( pstr >= str_end ) {
+ 				intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
+--- a/ext/intl/intl_convertcpp.h
++++ b/ext/intl/intl_convertcpp.h
+@@ -26,6 +26,8 @@
+ #include <unicode/unistr.h>
+ #include <zend_types.h>
+ 
++using icu::UnicodeString;
++
+ int intl_stringFromChar(UnicodeString &ret, char *str, size_t str_len, UErrorCode *status);
+ 
+ zend_string* intl_charFromString(const UnicodeString &from, UErrorCode *status);
+--- a/ext/intl/msgformat/msgformat_helpers.cpp
++++ b/ext/intl/msgformat/msgformat_helpers.cpp
+@@ -78,6 +78,16 @@ MessageFormatAdapter::getMessagePattern(MessageFormat* m) {
+ #endif
+ U_NAMESPACE_END
+ 
++using icu::Formattable;
++using icu::Format;
++using icu::DateFormat;
++using icu::MessageFormat;
++#ifdef HAS_MESSAGE_PATTERN
++using icu::MessagePattern;
++#endif
++using icu::MessageFormatAdapter;
++using icu::FieldPosition;
++
+ U_CFUNC int32_t umsg_format_arg_count(UMessageFormat *fmt)
+ {
+ 	int32_t fmt_count = 0;
+@@ -229,15 +239,16 @@ static HashTable *umsg_parse_format(MessageFormatter_object *mfo,
+ 					UnicodeString typeString = mp.getSubstring(type_part);
+ 					/* This is all based on the rules in the docs for MessageFormat
+ 					 * @see http://icu-project.org/apiref/icu4c/classMessageFormat.html */
+-					if (typeString == "number") {
++#define ASCII_LITERAL(s) UNICODE_STRING(s, sizeof(s)-1)
++					if (typeString == ASCII_LITERAL("number")) {
+ 						MessagePattern::Part style_part = mp.getPart(i + 1); /* Not advancing i */
+ 						if (style_part.getType() == UMSGPAT_PART_TYPE_ARG_STYLE) {
+ 							UnicodeString styleString = mp.getSubstring(style_part);
+-							if (styleString == "integer") {
++							if (styleString == ASCII_LITERAL("integer")) {
+ 								type = Formattable::kInt64;
+-							} else if (styleString == "currency") {
++							} else if (styleString == ASCII_LITERAL("currency")) {
+ 								type = Formattable::kDouble;
+-							} else if (styleString == "percent") {
++							} else if (styleString == ASCII_LITERAL("percent")) {
+ 								type = Formattable::kDouble;
+ 							} else { /* some style invalid/unknown to us */
+ 								type = Formattable::kDouble;
+@@ -245,12 +256,13 @@ static HashTable *umsg_parse_format(MessageFormatter_object *mfo,
+ 						} else { // if missing style, part, make it a double
+ 							type = Formattable::kDouble;
+ 						}
+-					} else if ((typeString == "date") || (typeString == "time")) {
++					} else if ((typeString == ASCII_LITERAL("date")) || (typeString == ASCII_LITERAL("time"))) {
+ 						type = Formattable::kDate;
+-					} else if ((typeString == "spellout") || (typeString == "ordinal")
+-							|| (typeString == "duration")) {
++					} else if ((typeString == ASCII_LITERAL("spellout")) || (typeString == ASCII_LITERAL("ordinal"))
++							|| (typeString == ASCII_LITERAL("duration"))) {
+ 						type = Formattable::kDouble;
+ 					}
++#undef ASCII_LITERAL
+ 				} else {
+ 					/* If there's no UMSGPAT_PART_TYPE_ARG_TYPE right after a
+ 					 * UMSGPAT_ARG_TYPE_SIMPLE argument, then the pattern
+--- a/ext/intl/normalizer/normalizer_normalize.c
++++ b/ext/intl/normalizer/normalizer_normalize.c
+@@ -24,6 +24,7 @@
+ #include "normalizer_class.h"
+ #include "normalizer_normalize.h"
+ #include "intl_convert.h"
++#include <unicode/utf8.h>
+ 
+ /* {{{ proto string Normalizer::normalize( string $input [, string $form = FORM_C] )
+  * Normalize a string. }}} */
+--- a/ext/intl/timezone/timezone_class.cpp
++++ b/ext/intl/timezone/timezone_class.cpp
+@@ -37,6 +37,8 @@ extern "C" {
+ #include <ext/date/php_date.h>
+ }
+ 
++using icu::Calendar;
++
+ /* {{{ Global variables */
+ U_CDECL_BEGIN
+ zend_class_entry *TimeZone_ce_ptr = NULL;
+--- a/ext/intl/timezone/timezone_class.h
++++ b/ext/intl/timezone/timezone_class.h
+@@ -29,6 +29,8 @@
+ 
+ #ifndef USE_TIMEZONE_POINTER
+ typedef void TimeZone;
++#else
++using icu::TimeZone;
+ #endif
+ 
+ typedef struct {
+--- a/ext/intl/timezone/timezone_methods.cpp
++++ b/ext/intl/timezone/timezone_methods.cpp
+@@ -23,6 +23,7 @@
+ #include <unicode/locid.h>
+ #include <unicode/timezone.h>
+ #include <unicode/ustring.h>
++#include <unicode/calendar.h>
+ #include "intl_convertcpp.h"
+ 
+ #include "../common/common_date.h"
+@@ -37,6 +38,9 @@ extern "C" {
+ }
+ #include "common/common_enum.h"
+ 
++using icu::Locale;
++using icu::Calendar;
++
+ U_CFUNC PHP_METHOD(IntlTimeZone, __construct)
+ {
+ 	zend_throw_exception( NULL,
+--- a/ext/intl/uchar/uchar.c
++++ b/ext/intl/uchar/uchar.c
+@@ -3,6 +3,7 @@
+ #include "intl_convert.h"
+ 
+ #include <unicode/uchar.h>
++#include <unicode/utf8.h>
+ 
+ #define IC_METHOD(mname) PHP_METHOD(IntlChar, mname)
+ 
+-- 
+2.19.2
+

diff --git a/dev-lang/php/php-7.1.25.ebuild b/dev-lang/php/php-7.1.25.ebuild
new file mode 100644
index 00000000000..4f5aca9bdc9
--- /dev/null
+++ b/dev-lang/php/php-7.1.25.ebuild
@@ -0,0 +1,736 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit flag-o-matic systemd autotools
+
+DESCRIPTION="The PHP language runtime engine"
+HOMEPAGE="https://secure.php.net/"
+SRC_URI="https://secure.php.net/distributions/${P}.tar.xz"
+
+LICENSE="PHP-3.01
+	BSD
+	Zend-2.0
+	bcmath? ( LGPL-2.1+ )
+	fpm? ( BSD-2 )
+	gd? ( gd )
+	unicode? ( BSD-2 LGPL-2.1 )"
+
+SLOT="$(ver_cut 1-2)"
+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"
+
+# We can build the following SAPIs in the given order
+SAPIS="embed cli cgi fpm apache2 phpdbg"
+
+# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
+IUSE="${IUSE}
+	${SAPIS/cli/+cli}
+	threads"
+
+IUSE="${IUSE} acl bcmath berkdb bzip2 calendar cdb cjk
+	coverage crypt +ctype curl debug
+	enchant exif +fileinfo +filter firebird
+	flatfile ftp gd gdbm gmp +hash +iconv imap inifile
+	intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl
+	mhash mssql mysql mysqli nls
+	oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
+	readline recode selinux +session session-mm sharedmem
+	+simplexml snmp soap sockets spell sqlite ssl
+	sysvipc systemd test tidy +tokenizer truetype unicode wddx webp
+	+xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib"
+
+# The supported (that is, autodetected) versions of BDB are listed in
+# the ./configure script. Other versions *work*, but we need to stick to
+# the ones that can be detected to avoid a repeat of bug #564824.
+COMMON_DEPEND="
+	>=app-eselect/eselect-php-0.9.1[apache2?,fpm?]
+	>=dev-libs/libpcre-8.32[unicode]
+	fpm? ( acl? ( sys-apps/acl ) )
+	apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=]
+		<www-servers/apache-2.4[threads=] ) )
+	berkdb? ( || (	sys-libs/db:5.3
+					sys-libs/db:5.1
+					sys-libs/db:4.8
+					sys-libs/db:4.7
+					sys-libs/db:4.6
+					sys-libs/db:4.5 ) )
+	bzip2? ( app-arch/bzip2:0= )
+	cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
+	coverage? ( dev-util/lcov )
+	crypt? ( >=dev-libs/libmcrypt-2.4 )
+	curl? ( >=net-misc/curl-7.10.5 )
+	enchant? ( <app-text/enchant-2.0:0 )
+	firebird? ( dev-db/firebird )
+	gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib )
+	gdbm? ( >=sys-libs/gdbm-1.8.0:0= )
+	gmp? ( dev-libs/gmp:0= )
+	iconv? ( virtual/libiconv )
+	imap? ( virtual/imap-c-client[kerberos=,ssl=] )
+	intl? ( dev-libs/icu:= )
+	iodbc? ( dev-db/libiodbc )
+	kerberos? ( virtual/krb5 )
+	ldap? ( >=net-nds/openldap-1.2.11 )
+	ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 )
+	libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) )
+	mssql? ( dev-db/freetds[mssql] )
+	nls? ( sys-devel/gettext )
+	oci8-instant-client? ( dev-db/oracle-instantclient-basic )
+	odbc? ( >=dev-db/unixODBC-1.8.13 )
+	postgres? ( dev-db/postgresql:* )
+	qdbm? ( dev-db/qdbm )
+	readline? ( sys-libs/readline:0= )
+	recode? ( app-text/recode )
+	session-mm? ( dev-libs/mm )
+	simplexml? ( >=dev-libs/libxml2-2.6.8 )
+	snmp? ( >=net-analyzer/net-snmp-5.2 )
+	soap? ( >=dev-libs/libxml2-2.6.8 )
+	spell? ( >=app-text/aspell-0.50 )
+	sqlite? ( >=dev-db/sqlite-3.7.6.3 )
+	ssl? (
+		!libressl? ( dev-libs/openssl:0= )
+		libressl? ( dev-libs/libressl:0= )
+	)
+	tidy? ( || ( app-text/tidy-html5 app-text/htmltidy ) )
+	truetype? ( =media-libs/freetype-2* )
+	unicode? ( dev-libs/oniguruma:= )
+	wddx? ( >=dev-libs/libxml2-2.6.8 )
+	webp? ( media-libs/libwebp:0= )
+	xml? ( >=dev-libs/libxml2-2.6.8 )
+	xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
+	xmlreader? ( >=dev-libs/libxml2-2.6.8 )
+	xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
+	xpm? ( x11-libs/libXpm )
+	xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
+	zip? ( sys-libs/zlib:0= )
+	zlib? ( sys-libs/zlib:0= )
+"
+
+RDEPEND="${COMMON_DEPEND}
+	virtual/mta
+	fpm? (
+		selinux? ( sec-policy/selinux-phpfpm )
+		systemd? ( sys-apps/systemd ) )"
+
+# Bison isn't actually needed when building from a release tarball
+# However, the configure script will warn if it's absent or if you
+# have an incompatible version installed. See bug 593278.
+DEPEND="${COMMON_DEPEND}
+	app-arch/xz-utils
+	>=sys-devel/bison-3.0.1"
+
+# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
+REQUIRED_USE="
+	|| ( cli cgi fpm apache2 embed phpdbg )
+	cli? ( ^^ ( readline libedit ) )
+	truetype? ( gd zlib )
+	webp? ( gd zlib )
+	cjk? ( gd zlib )
+	exif? ( gd zlib )
+	xpm? ( gd zlib )
+	gd? ( zlib )
+	simplexml? ( xml )
+	soap? ( xml )
+	wddx? ( xml )
+	xmlrpc? ( || ( xml iconv ) )
+	xmlreader? ( xml )
+	xslt? ( xml )
+	ldap-sasl? ( ldap )
+	mhash? ( hash )
+	phar? ( hash )
+	qdbm? ( !gdbm )
+	readline? ( !libedit )
+	recode? ( !imap !mysqli !mysql )
+	session-mm? ( session !threads )
+	mysql? ( hash || ( mysqli pdo ) )
+	mysqli? ( hash )
+"
+PATCHES=(
+	"${FILESDIR}/php-freetype-2.9.1.patch"
+	"${FILESDIR}/php-7.1.25-intl-detect-icu-via-pkg-config.patch"
+	"${FILESDIR}/php-7.1.25-intl-use-icu-namespace.patch"
+)
+
+PHP_MV="$(ver_cut 1)"
+
+php_install_ini() {
+	local phpsapi="${1}"
+
+	# work out where we are installing the ini file
+	php_set_ini_dir "${phpsapi}"
+
+	# Always install the production INI file, bug 611214.
+	local phpinisrc="php.ini-production-${phpsapi}"
+	cp php.ini-production "${phpinisrc}" || die
+
+	# default to /tmp for save_path, bug #282768
+	sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die
+
+	# Set the extension dir
+	sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \
+		-i "${phpinisrc}" || die
+
+	# Set the include path to point to where we want to find PEAR packages
+	sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die
+
+	dodir "${PHP_INI_DIR#${EPREFIX}}"
+	insinto "${PHP_INI_DIR#${EPREFIX}}"
+	newins "${phpinisrc}" php.ini
+
+	elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}"
+	elog
+
+	dodir "${PHP_EXT_INI_DIR#${EPREFIX}}"
+	dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}"
+
+	if use opcache; then
+		elog "Adding opcache to $PHP_EXT_INI_DIR"
+		echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \
+			 "${D}/${PHP_EXT_INI_DIR}"/opcache.ini
+		dosym "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" \
+			  "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini"
+	fi
+
+	# SAPI-specific handling
+	if [[ "${sapi}" == "fpm" ]] ; then
+		einfo "Installing FPM config files php-fpm.conf and www.conf"
+		insinto "${PHP_INI_DIR#${EPREFIX}}"
+		doins sapi/fpm/php-fpm.conf
+		insinto "${PHP_INI_DIR#${EPREFIX}}/fpm.d"
+		doins sapi/fpm/www.conf
+	fi
+
+	dodoc php.ini-{development,production}
+}
+
+php_set_ini_dir() {
+	PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}"
+	PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
+	PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
+}
+
+src_prepare() {
+	default
+
+	# In php-7.x, the FPM pool configuration files have been split off
+	# of the main config. By default the pool config files go in
+	# e.g. /etc/php-fpm.d, which isn't slotted. So here we move the
+	# include directory to a subdirectory "fpm.d" of $PHP_INI_DIR. Later
+	# we'll install the pool configuration file "www.conf" there.
+	php_set_ini_dir fpm
+	sed -i "s~^include=.*$~include=${PHP_INI_DIR}/fpm.d/*.conf~" \
+		sapi/fpm/php-fpm.conf.in \
+		|| die 'failed to move the include directory in php-fpm.conf'
+
+	# Bug 669566 - necessary so that build tools are updated for commands like pecl
+	# Force rebuilding aclocal.m4
+	rm -f aclocal.m4 || die "failed to remove aclocal.m4 in src_prepare"
+	eautoreconf
+}
+
+src_configure() {
+	addpredict /usr/share/snmp/mibs/.index #nowarn
+	addpredict /var/lib/net-snmp/mib_indexes #nowarn
+
+	PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
+
+	# The php-fpm config file wants localstatedir to be ${EPREFIX}/var
+	# and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002.
+	local our_conf=(
+		--prefix="${PHP_DESTDIR}"
+		--mandir="${PHP_DESTDIR}/man"
+		--infodir="${PHP_DESTDIR}/info"
+		--libdir="${PHP_DESTDIR}/lib"
+		--with-libdir="$(get_libdir)"
+		--localstatedir="${EPREFIX}/var"
+		--without-pear
+		$(use_enable threads maintainer-zts)
+	)
+
+	our_conf+=(
+		$(use_enable bcmath bcmath)
+		$(use_with bzip2 bz2 "${EPREFIX}/usr")
+		$(use_enable calendar calendar)
+		$(use_enable coverage gcov)
+		$(use_enable ctype ctype)
+		$(use_with curl curl "${EPREFIX}/usr")
+		$(use_enable xml dom)
+		$(use_with enchant enchant "${EPREFIX}/usr")
+		$(use_enable exif exif)
+		$(use_enable fileinfo fileinfo)
+		$(use_enable filter filter)
+		$(use_enable ftp ftp)
+		$(use_with nls gettext "${EPREFIX}/usr")
+		$(use_with gmp gmp "${EPREFIX}/usr")
+		$(use_enable hash hash)
+		$(use_with mhash mhash "${EPREFIX}/usr")
+		$(use_with iconv iconv \
+			$(use elibc_glibc || use elibc_musl || use elibc_FreeBSD || echo "${EPREFIX}/usr"))
+		$(use_enable intl intl)
+		$(use_enable ipv6 ipv6)
+		$(use_enable json json)
+		$(use_with kerberos kerberos "${EPREFIX}/usr")
+		$(use_enable xml libxml)
+		$(use_with xml libxml-dir "${EPREFIX}/usr")
+		$(use_enable unicode mbstring)
+		$(use_with crypt mcrypt "${EPREFIX}/usr")
+		$(use_with unicode onig "${EPREFIX}/usr")
+		$(use_with ssl openssl "${EPREFIX}/usr")
+		$(use_with ssl openssl-dir "${EPREFIX}/usr")
+		$(use_enable pcntl pcntl)
+		$(use_enable phar phar)
+		$(use_enable pdo pdo)
+		$(use_enable opcache opcache)
+		$(use_with postgres pgsql "${EPREFIX}/usr")
+		$(use_enable posix posix)
+		$(use_with spell pspell "${EPREFIX}/usr")
+		$(use_with recode recode "${EPREFIX}/usr")
+		$(use_enable simplexml simplexml)
+		$(use_enable sharedmem shmop)
+		$(use_with snmp snmp "${EPREFIX}/usr")
+		$(use_enable soap soap)
+		$(use_enable sockets sockets)
+		$(use_with sqlite sqlite3 "${EPREFIX}/usr")
+		$(use_enable sysvipc sysvmsg)
+		$(use_enable sysvipc sysvsem)
+		$(use_enable sysvipc sysvshm)
+		$(use_with tidy tidy "${EPREFIX}/usr")
+		$(use_enable tokenizer tokenizer)
+		$(use_enable wddx wddx)
+		$(use_enable xml xml)
+		$(use_enable xmlreader xmlreader)
+		$(use_enable xmlwriter xmlwriter)
+		$(use_with xmlrpc xmlrpc)
+		$(use_with xslt xsl "${EPREFIX}/usr")
+		$(use_enable zip zip)
+		$(use_with zlib zlib "${EPREFIX}/usr")
+		$(use_enable debug debug)
+	)
+
+	# DBA support
+	if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
+		|| use qdbm ; then
+		our_conf+=( "--enable-dba${shared}" )
+	fi
+
+	# DBA drivers support
+	our_conf+=(
+		$(use_with cdb cdb)
+		$(use_with berkdb db4 "${EPREFIX}/usr")
+		$(use_enable flatfile flatfile)
+		$(use_with gdbm gdbm "${EPREFIX}/usr")
+		$(use_enable inifile inifile)
+		$(use_with qdbm qdbm "${EPREFIX}/usr")
+	)
+
+	# Support for the GD graphics library
+	our_conf+=(
+		$(use_with truetype freetype-dir "${EPREFIX}/usr")
+		$(use_enable cjk gd-jis-conv)
+		$(use_with gd jpeg-dir "${EPREFIX}/usr")
+		$(use_with gd png-dir "${EPREFIX}/usr")
+		$(use_with xpm xpm-dir "${EPREFIX}/usr")
+	)
+	if use webp; then
+		our_conf+=( --with-webp-dir="${EPREFIX}/usr" )
+	fi
+	# enable gd last, so configure can pick up the previous settings
+	our_conf+=( $(use_with gd gd) )
+
+	# IMAP support
+	if use imap ; then
+		our_conf+=(
+			$(use_with imap imap "${EPREFIX}/usr")
+			$(use_with ssl imap-ssl "${EPREFIX}/usr")
+		)
+	fi
+
+	# Interbase/firebird support
+	our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") )
+
+	# LDAP support
+	if use ldap ; then
+		our_conf+=(
+			$(use_with ldap ldap "${EPREFIX}/usr")
+			$(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr")
+		)
+	fi
+
+	# MySQL support
+	local mysqllib="mysqlnd"
+	local mysqlilib="mysqlnd"
+
+	our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
+
+	local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock"
+	if use mysql || use mysqli ; then
+		our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") )
+	fi
+
+	# ODBC support
+	our_conf+=(
+		$(use_with odbc unixODBC "${EPREFIX}/usr")
+		$(use_with iodbc iodbc "${EPREFIX}/usr")
+	)
+
+	# Oracle support
+	our_conf+=( $(use_with oci8-instant-client oci8) )
+
+	# PDO support
+	if use pdo ; then
+		our_conf+=(
+			$(use_with mssql pdo-dblib "${EPREFIX}/usr")
+			$(use_with mysql pdo-mysql "${mysqllib}")
+			$(use_with postgres pdo-pgsql)
+			$(use_with sqlite pdo-sqlite "${EPREFIX}/usr")
+			$(use_with firebird pdo-firebird "${EPREFIX}/usr")
+			$(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr")
+			$(use_with oci8-instant-client pdo-oci)
+		)
+	fi
+
+	# readline/libedit support
+	our_conf+=(
+		$(use_with readline readline "${EPREFIX}/usr")
+		$(use_with libedit libedit "${EPREFIX}/usr")
+	)
+
+	# Session support
+	if use session ; then
+		our_conf+=( $(use_with session-mm mm "${EPREFIX}/usr") )
+	else
+		our_conf+=( $(use_enable session session) )
+	fi
+
+	# Use pic for shared modules such as apache2's mod_php
+	our_conf+=( --with-pic )
+
+	# we use the system copy of pcre
+	# --with-pcre-regex affects ext/pcre
+	# --with-pcre-dir affects ext/filter and ext/zip
+	our_conf+=(
+		--with-pcre-regex="${EPREFIX}/usr"
+		--with-pcre-dir="${EPREFIX}/usr"
+	)
+
+	# Catch CFLAGS problems
+	# Fixes bug #14067.
+	# Changed order to run it in reverse for bug #32022 and #12021.
+	replace-cpu-flags "k6*" "i586"
+
+	# Cache the ./configure test results between SAPIs.
+	our_conf+=( --cache-file="${T}/config.cache" )
+
+	# Support user-passed configuration parameters
+	our_conf+=( ${EXTRA_ECONF:-} )
+
+	# Support the Apache2 extras, they must be set globally for all
+	# SAPIs to work correctly, especially for external PHP extensions
+
+	mkdir -p "${WORKDIR}/sapis-build" || die
+	for one_sapi in $SAPIS ; do
+		use "${one_sapi}" || continue
+		php_set_ini_dir "${one_sapi}"
+
+		# The BUILD_DIR variable is used to determine where to output
+		# the files that autotools creates. This was all originally
+		# based on the autotools-utils eclass.
+		BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}"
+		cp -a "${S}" "${BUILD_DIR}" || die
+		cd "${BUILD_DIR}" || die
+
+		local sapi_conf=(
+			--with-config-file-path="${PHP_INI_DIR}"
+			--with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}"
+		)
+
+		for sapi in $SAPIS ; do
+			case "$sapi" in
+				cli|cgi|embed|fpm|phpdbg)
+					if [[ "${one_sapi}" == "${sapi}" ]] ; then
+						sapi_conf+=( "--enable-${sapi}" )
+						if [[ "fpm" == "${sapi}" ]] ; then
+							sapi_conf+=(
+								$(use_with acl fpm-acl)
+								$(use_with systemd fpm-systemd)
+							)
+						fi
+					else
+						sapi_conf+=( "--disable-${sapi}" )
+					fi
+					;;
+
+				apache2)
+					if [[ "${one_sapi}" == "${sapi}" ]] ; then
+						sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" )
+					else
+						sapi_conf+=( --without-apxs2 )
+					fi
+					;;
+			esac
+		done
+
+		# Construct the $myeconfargs array by concatenating $our_conf
+		# (the common args) and $sapi_conf (the SAPI-specific args).
+		local myeconfargs=( "${our_conf[@]}" )
+		myeconfargs+=( "${sapi_conf[@]}" )
+
+		pushd "${BUILD_DIR}" > /dev/null || die
+		econf "${myeconfargs[@]}"
+		popd > /dev/null || die
+	done
+}
+
+src_compile() {
+	# snmp seems to run during src_compile, too (bug #324739)
+	addpredict /usr/share/snmp/mibs/.index #nowarn
+	addpredict /var/lib/net-snmp/mib_indexes #nowarn
+
+	for sapi in ${SAPIS} ; do
+		if use "${sapi}"; then
+			cd "${WORKDIR}/sapis-build/$sapi" || \
+				die "Failed to change dir to ${WORKDIR}/sapis-build/$1"
+			emake
+		fi
+	done
+}
+
+src_install() {
+	# see bug #324739 for what happens when we don't have that
+	addpredict /usr/share/snmp/mibs/.index #nowarn
+
+	# grab the first SAPI that got built and install common files from there
+	local first_sapi=""
+	for sapi in $SAPIS ; do
+		if use $sapi ; then
+			first_sapi=$sapi
+			break
+		fi
+	done
+
+	# Makefile forgets to create this before trying to write to it...
+	dodir "${PHP_DESTDIR#${EPREFIX}}/bin"
+
+	# Install php environment (without any sapis)
+	cd "${WORKDIR}/sapis-build/$first_sapi" || die
+	emake INSTALL_ROOT="${D}" \
+		install-build install-headers install-programs
+
+	local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)"
+
+	# Create the directory where we'll put version-specific php scripts
+	keepdir "/usr/share/php${PHP_MV}"
+
+	local sapi="", file=""
+	local sapi_list=""
+
+	for sapi in ${SAPIS}; do
+		if use "${sapi}" ; then
+			einfo "Installing SAPI: ${sapi}"
+			cd "${WORKDIR}/sapis-build/${sapi}" || die
+
+			if [[ "${sapi}" == "apache2" ]] ; then
+				# We're specifically not using emake install-sapi as libtool
+				# may cause unnecessary relink failures (see bug #351266)
+				insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/"
+				newins ".libs/libphp${PHP_MV}$(get_libname)" \
+					   "libphp${PHP_MV}$(get_libname)"
+				keepdir "/usr/$(get_libdir)/apache2/modules"
+			else
+				# needed each time, php_install_ini would reset it
+				local dest="${PHP_DESTDIR#${EPREFIX}}"
+				into "${dest}"
+				case "$sapi" in
+					cli)
+						source="sapi/cli/php"
+						;;
+					cgi)
+						source="sapi/cgi/php-cgi"
+						;;
+					fpm)
+						source="sapi/fpm/php-fpm"
+						;;
+					embed)
+						source="libs/libphp${PHP_MV}$(get_libname)"
+						;;
+					phpdbg)
+						source="sapi/phpdbg/phpdbg"
+						;;
+					*)
+						die "unhandled sapi in src_install"
+						;;
+				esac
+
+				if [[ "${source}" == *"$(get_libname)" ]]; then
+					dolib.so "${source}"
+				else
+					dobin "${source}"
+					local name="$(basename ${source})"
+					dosym "${dest}/bin/${name}" "/usr/bin/${name}${SLOT}"
+				fi
+			fi
+
+			php_install_ini "${sapi}"
+
+			# construct correct SAPI string for php-config
+			# thanks to ferringb for the bash voodoo
+			if [[ "${sapi}" == "apache2" ]]; then
+				sapi_list="${sapi_list:+${sapi_list} }apache2handler"
+			else
+				sapi_list="${sapi_list:+${sapi_list} }${sapi}"
+			fi
+		fi
+	done
+
+	# Installing opcache module
+	if use opcache ; then
+		into "${PHP_DESTDIR#${EPREFIX}}"
+		dolib.so "modules/opcache$(get_libname)"
+	fi
+
+	# Install env.d files
+	newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}"
+	sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
+	sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
+
+	# set php-config variable correctly (bug #278439)
+	sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \
+		"${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die
+
+	if use fpm ; then
+		if use systemd; then
+			systemd_newunit "${FILESDIR}/php-fpm_at.service" \
+							"php-fpm@${SLOT}.service"
+		else
+			systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \
+							"php-fpm@${SLOT}.service"
+		fi
+	fi
+}
+
+src_test() {
+	echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
+	PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
+	if [[ ! -x "${PHP_BIN}" ]] ; then
+		ewarn "Test phase requires USE=cli, skipping"
+		return
+	else
+		export TEST_PHP_EXECUTABLE="${PHP_BIN}"
+	fi
+
+	if [[ -x "${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" ]] ; then
+		export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi"
+	fi
+
+	if [[ -x "${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" ]] ; then
+		export TEST_PHPDBG_EXECUTABLE="${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg"
+	fi
+
+	REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n  -d \
+					  "session.save_path=${T}" \
+					  "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \
+					  "session.save_path=${T}"
+
+	for name in ${EXPECTED_TEST_FAILURES}; do
+		mv "${name}.out" "${name}.out.orig" 2>/dev/null || die
+	done
+
+	local failed="$(find -name '*.out')"
+	if [[ ${failed} != "" ]] ; then
+		ewarn "The following test cases failed unexpectedly:"
+		for name in ${failed}; do
+			ewarn "  ${name/.out/}"
+		done
+	else
+		einfo "No unexpected test failures, all fine"
+	fi
+
+	if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
+		local passed=""
+		for name in ${EXPECTED_TEST_FAILURES}; do
+			[[ -f "${name}.diff" ]] && continue
+			passed="${passed} ${name}"
+		done
+		if [[ ${passed} != "" ]] ; then
+			einfo "The following test cases passed unexpectedly:"
+			for name in ${passed}; do
+				ewarn "  ${passed}"
+			done
+		else
+			einfo "None of the known-to-fail tests passed, all fine"
+		fi
+	fi
+}
+
+pkg_postinst() {
+	# Output some general info to the user
+	if use apache2 ; then
+		elog
+		elog "To enable PHP in apache, you will need to add \"-D PHP\" to"
+		elog "your apache2 command. OpenRC users can append that string to"
+		elog "APACHE2_OPTS in /etc/conf.d/apache2."
+		elog
+		elog "The apache module configuration file 70_mod_php.conf is"
+		elog "provided (and maintained) by eselect-php."
+		elog
+	fi
+
+	# Create the symlinks for php
+	for m in ${SAPIS}; do
+		[[ ${m} == 'embed' ]] && continue;
+		if use $m ; then
+			local ci=$(eselect php show $m)
+			if [[ -z $ci ]]; then
+				eselect php set $m php${SLOT} || die
+				einfo "Switched ${m} to use php:${SLOT}"
+				einfo
+			elif [[ $ci != "php${SLOT}" ]] ; then
+				elog "To switch $m to use php:${SLOT}, run"
+				elog "    eselect php set $m php${SLOT}"
+				elog
+			fi
+		fi
+	done
+
+	# Remove dead symlinks for SAPIs that were just disabled. For
+	# example, if the user has the cgi SAPI enabled, then he has an
+	# eselect-php symlink for it. If he later reinstalls PHP with
+	# USE="-cgi", that symlink will break. This call to eselect is
+	# supposed to remove that dead link per bug 572436.
+	eselect php cleanup || die
+
+	if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then
+	   elog "To build extensions for this version of PHP, you will need to"
+	   elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable."
+	   elog
+	fi
+
+	# Warn about the removal of PHP_INI_VERSION if the user has it set.
+	if [[ -n "${PHP_INI_VERSION}" ]]; then
+		ewarn 'The PHP_INI_VERSION variable has been phased out. You may'
+		ewarn 'remove it from your configuration at your convenience. See'
+		ewarn
+		ewarn '  https://bugs.gentoo.org/611214'
+		ewarn
+		ewarn 'for more information.'
+	fi
+
+	elog "For details on how version slotting works, please see"
+	elog "the wiki:"
+	elog
+	elog "  https://wiki.gentoo.org/wiki/PHP"
+	elog
+}
+
+pkg_postrm() {
+	# This serves two purposes. First, if we have just removed the last
+	# installed version of PHP, then this will remove any dead symlinks
+	# belonging to eselect-php. Second, if a user upgrades slots from
+	# (say) 5.6 to 7.0 and depcleans the old slot, then this will update
+	# his existing symlinks to point to the new 7.0 installation. The
+	# latter is bug 432962.
+	#
+	# Note: the eselect-php package may not be installed at this point,
+	# so we can't die() if this command fails.
+	eselect php cleanup
+}


^ permalink raw reply related	[flat|nested] 21+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-lang/php/files/, dev-lang/php/
@ 2018-12-06 23:20 Thomas Deutschmann
  0 siblings, 0 replies; 21+ messages in thread
From: Thomas Deutschmann @ 2018-12-06 23:20 UTC (permalink / raw
  To: gentoo-commits

commit:     84aad4ad45480f8e32471abb446c72f72e5b50fe
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Thu Dec  6 23:19:44 2018 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Thu Dec  6 23:19:59 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=84aad4ad

dev-lang/php: bump to v5.6.39

- EAPI bump to EAPI=7

- Add compatibility with ICU >= 61

Bug: https://bugs.gentoo.org/668000
Package-Manager: Portage-2.3.52, Repoman-2.3.12
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>

 dev-lang/php/Manifest                              |   1 +
 .../php-5.6-intl-detect-icu-via-pkg-config.patch   | 154 ++++
 .../files/php-5.6-intl-icu-memory-corruption.patch |  88 +++
 .../php/files/php-5.6-intl-use-icu-namespace.patch | 365 ++++++++++
 dev-lang/php/php-5.6.39.ebuild                     | 785 +++++++++++++++++++++
 5 files changed, 1393 insertions(+)

diff --git a/dev-lang/php/Manifest b/dev-lang/php/Manifest
index a4165302dd2..70aef5427e6 100644
--- a/dev-lang/php/Manifest
+++ b/dev-lang/php/Manifest
@@ -1,5 +1,6 @@
 DIST php-5.6-openssl-1.1-compatibility.patch 42559 BLAKE2B b7f13866cd8545543143932930f31bcd928fa0b4b36ef63f04798b9ef4699f12b4f4227772ac9e6e5c498aaeacf7b106abcfa48031a12214e123de4b79d3a4cd SHA512 eed695a3dd7ce27e8651b4a4b96ccd0514f256e7d2f0214fac899e9eeea6412aa24f863f1b5d13305bcac50667ccb62709597fb34da1002b005ebf411dd2f5df
 DIST php-5.6.38.tar.xz 12467408 BLAKE2B d9ee47e193d80bce8a9ed6ffd3eb13e67ba6d1f597ece2803cd92fddc6245f46cdfe644d6cda12a6bb409b92c1fe748610cc5eb43dea0bf063fda81188ee8b3d SHA512 66c51a8e954b1496c0bad0a2864a2a1537dd1c1c573b553991d6d5bce85fc7bc340e56a21109bc5e9a03799e703204b980b569c95a5c0a1bddb01c8947e7a682
+DIST php-5.6.39.tar.xz 12467096 BLAKE2B 354b147c0fcc13eeec0ab333bcaa32ad26e2f4eef19a0ee52cf596ff96997eaf32cbb6d980cacf643167ed01b06ee9d27eeb7c00c95c8023d305c967c1ce3539 SHA512 814ea2d74df9c3c7041769803ceb4ba20dbfc18885ff85f91dca0c3ab694e3ebfb6a564427d116b35382fe292583a54d449f2528495032ca9724cfbdea82c226
 DIST php-7.0.32.tar.xz 12030780 BLAKE2B 0c277eac4c931a6e30954cceb7feef8dea1c3ef4aebac91779b7e1a6f90f608faa93d1750a2dc8f354c73304e0f7a9b9ac17bb0d1da4768ddb68925752c11aef SHA512 4a7c9a6b91ad7da69303916202062d639e6f02dcd483e851a44d8c7a2efeb5c9a666097935ab60d700c4445f86a0c68df1515300c57af1cdb76528b54b757608
 DIST php-7.1.22.tar.xz 12227848 BLAKE2B 72fab94b1c7ecfd3479f6d6c9a76a9d8813f7789402664201615d79ab8b5bb26fb1b7273769c4898a36f0336e0ce4d50bf2f17b81ddb54acc9583e39623e3a5b SHA512 0fc0907d303711dbc4ba0a18618e3e73550c73d13988c769f8d50066017b1efe3feb0d22d5539f69271ea4e9532a3d997e22841cb59bdbf96313169e1c03538d
 DIST php-7.1.23.tar.xz 12227528 BLAKE2B d03470b07ae041c4677e100c1b4f7994d3e15d4830eccba3c654c1f3546345c8205cac057011d2d43ab962ebbc01652f6748270daa40aa1e540453923500288c SHA512 d5a451f1a48415175e3117ffa84ef3504275a407698b59c13eeb403958aa27342e04dc4ffea9791b923ac0cc5d6fdacf2e8672f0e19755bae858707c7fc3627f

diff --git a/dev-lang/php/files/php-5.6-intl-detect-icu-via-pkg-config.patch b/dev-lang/php/files/php-5.6-intl-detect-icu-via-pkg-config.patch
new file mode 100644
index 00000000000..dea2949c25e
--- /dev/null
+++ b/dev-lang/php/files/php-5.6-intl-detect-icu-via-pkg-config.patch
@@ -0,0 +1,154 @@
+Based on the following upstream commits:
+
+https://github.com/php/php-src/commit/9a8e7b571896f39f83cb000fdb7c466b6d328d52
+https://github.com/php/php-src/pull/3701
+https://github.com/php/php-src/commit/2bd299f7318492fd7e5cafffa562d76ba60e69d4
+
+--- a/acinclude.m4
++++ b/acinclude.m4
+@@ -2201,49 +2201,16 @@ dnl
+ dnl Common setup macro for ICU
+ dnl
+ AC_DEFUN([PHP_SETUP_ICU],[
+-  PHP_ARG_WITH(icu-dir,,
+-  [  --with-icu-dir=DIR      Specify where ICU libraries and headers can be found], DEFAULT, no)
++  PKG_CHECK_MODULES([ICU], [icu-io >= 50.1])
+ 
+-  if test "$PHP_ICU_DIR" = "no"; then
+-    PHP_ICU_DIR=DEFAULT
+-  fi
+-
+-  if test "$PHP_ICU_DIR" = "DEFAULT"; then
+-    dnl Try to find icu-config
+-    AC_PATH_PROG(ICU_CONFIG, icu-config, no, [$PATH:/usr/local/bin])
+-  else
+-    ICU_CONFIG="$PHP_ICU_DIR/bin/icu-config"
+-  fi
+-
+-  AC_MSG_CHECKING([for location of ICU headers and libraries])
+-
+-  dnl Trust icu-config to know better what the install prefix is..
+-  icu_install_prefix=`$ICU_CONFIG --prefix 2> /dev/null`
+-  if test "$?" != "0" || test -z "$icu_install_prefix"; then
+-    AC_MSG_RESULT([not found])
+-    AC_MSG_ERROR([Unable to detect ICU prefix or $ICU_CONFIG failed. Please verify ICU install prefix and make sure icu-config works.])
+-  else
+-    AC_MSG_RESULT([$icu_install_prefix])
+-
+-    dnl Check ICU version
+-    AC_MSG_CHECKING([for ICU 4.0 or greater])
+-    icu_version_full=`$ICU_CONFIG --version`
+-    ac_IFS=$IFS
+-    IFS="."
+-    set $icu_version_full
+-    IFS=$ac_IFS
+-    icu_version=`expr [$]1 \* 1000 + [$]2`
+-    AC_MSG_RESULT([found $icu_version_full])
++  PHP_EVAL_INCLINE($ICU_CFLAGS)
++  PHP_EVAL_LIBLINE($ICU_LIBS, $1)
+ 
+-    if test "$icu_version" -lt "4000"; then
+-      AC_MSG_ERROR([ICU version 4.0 or later is required])
+-    fi
++  ICU_CFLAGS="$ICU_CFLAGS -DU_NO_DEFAULT_INCLUDE_UTF_HEADERS=1"
++  ICU_CXXFLAGS="$ICU_CXXFLAGS -DUNISTR_FROM_CHAR_EXPLICIT=explicit -DUNISTR_FROM_STRING_EXPLICIT=explicit"
+ 
+-    ICU_VERSION=$icu_version
+-    ICU_INCS=`$ICU_CONFIG --cppflags-searchpath`
+-    ICU_LIBS=`$ICU_CONFIG --ldflags --ldflags-icuio`
+-    PHP_EVAL_INCLINE($ICU_INCS)
+-    PHP_EVAL_LIBLINE($ICU_LIBS, $1)
++  if test "$PKG_CONFIG icu-io --atleast-version=60"; then
++    ICU_CFLAGS="$ICU_CFLAGS -DU_HIDE_OBSOLETE_UTF_OLD_H=1"
+   fi
+ ])
+ 
+--- a/ext/intl/config.m4
++++ b/ext/intl/config.m4
+@@ -9,18 +9,10 @@ if test "$PHP_INTL" != "no"; then
+   PHP_SETUP_ICU(INTL_SHARED_LIBADD)
+   PHP_SUBST(INTL_SHARED_LIBADD)
+   PHP_REQUIRE_CXX()
+-  if test "$icu_version" -ge "4002"; then
+-    icu_spoof_src=" spoofchecker/spoofchecker_class.c \
+-    spoofchecker/spoofchecker.c\
+-    spoofchecker/spoofchecker_create.c\
+-    spoofchecker/spoofchecker_main.c"
+-  else
+-    icu_spoof_src=""
+-  fi
++  INTL_COMMON_FLAGS="$ICU_CFLAGS -Wno-write-strings -D__STDC_LIMIT_MACROS -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"
+   PHP_NEW_EXTENSION(intl, php_intl.c \
+     intl_error.c \
+     intl_convert.c \
+-	intl_convertcpp.cpp \
+     collator/collator.c \
+     collator/collator_class.c \
+     collator/collator_sort.c \
+@@ -32,8 +24,6 @@ if test "$PHP_INTL" != "no"; then
+     collator/collator_is_numeric.c \
+     collator/collator_error.c \
+     common/common_error.c \
+-	common/common_enum.cpp \
+-	common/common_date.cpp \
+     converter/converter.c \
+     formatter/formatter.c \
+     formatter/formatter_main.c \
+@@ -53,17 +43,12 @@ if test "$PHP_INTL" != "no"; then
+     dateformat/dateformat_attr.c \
+     dateformat/dateformat_data.c \
+     dateformat/dateformat_format.c \
+-    dateformat/dateformat_format_object.cpp \
+     dateformat/dateformat_parse.c \
+-    dateformat/dateformat_create.cpp \
+-    dateformat/dateformat_attrcpp.cpp \
+-    dateformat/dateformat_helpers.cpp \
+     msgformat/msgformat.c \
+     msgformat/msgformat_attr.c \
+     msgformat/msgformat_class.c \
+     msgformat/msgformat_data.c  \
+     msgformat/msgformat_format.c \
+-    msgformat/msgformat_helpers.cpp \
+     msgformat/msgformat_parse.c \
+     grapheme/grapheme_string.c \
+     grapheme/grapheme_util.c \
+@@ -73,6 +58,20 @@ if test "$PHP_INTL" != "no"; then
+     transliterator/transliterator.c \
+     transliterator/transliterator_class.c \
+     transliterator/transliterator_methods.c \
++    idn/idn.c \
++    spoofchecker/spoofchecker_class.c \
++    spoofchecker/spoofchecker.c\
++    spoofchecker/spoofchecker_create.c\
++    spoofchecker/spoofchecker_main.c, $ext_shared,,$INTL_COMMON_FLAGS,cxx)
++
++  PHP_INTL_CPP_SOURCES="intl_convertcpp.cpp \
++    common/common_enum.cpp \
++    common/common_date.cpp \
++    dateformat/dateformat_format_object.cpp \
++    dateformat/dateformat_create.cpp \
++    dateformat/dateformat_attrcpp.cpp \
++    dateformat/dateformat_helpers.cpp \
++    msgformat/msgformat_helpers.cpp \
+     timezone/timezone_class.cpp \
+     timezone/timezone_methods.cpp \
+     calendar/calendar_class.cpp \
+@@ -83,9 +82,15 @@ if test "$PHP_INTL" != "no"; then
+     breakiterator/breakiterator_methods.cpp \
+     breakiterator/rulebasedbreakiterator_methods.cpp \
+     breakiterator/codepointiterator_internal.cpp \
+-    breakiterator/codepointiterator_methods.cpp \
+-    idn/idn.c \
+-    $icu_spoof_src, $ext_shared,,$ICU_INCS -Wno-write-strings)
++    breakiterator/codepointiterator_methods.cpp"
++
++  PHP_INTL_CPP_FLAGS="$ICU_CXXFLAGS -Wno-write-strings -D__STDC_LIMIT_MACROS -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"
++  if test "$ext_shared" = "no"; then
++    PHP_ADD_SOURCES(PHP_EXT_DIR(intl), $PHP_INTL_CPP_SOURCES, $PHP_INTL_CPP_FLAGS)
++  else
++    PHP_ADD_SOURCES_X(PHP_EXT_DIR(intl), $PHP_INTL_CPP_SOURCES, $PHP_INTL_CPP_FLAGS, shared_objects_intl, yes)
++  fi
++
+   PHP_ADD_BUILD_DIR($ext_builddir/collator)
+   PHP_ADD_BUILD_DIR($ext_builddir/converter)
+   PHP_ADD_BUILD_DIR($ext_builddir/common)

diff --git a/dev-lang/php/files/php-5.6-intl-icu-memory-corruption.patch b/dev-lang/php/files/php-5.6-intl-icu-memory-corruption.patch
new file mode 100644
index 00000000000..1b18f7fc5c4
--- /dev/null
+++ b/dev-lang/php/files/php-5.6-intl-icu-memory-corruption.patch
@@ -0,0 +1,88 @@
+Based on the following upstream commits:
+
+https://github.com/php/php-src/commit/45a05f38410d4a67c8c83c09906e2cfb42fc6e4c
+https://github.com/php/php-src/commit/534684d1042978f3c21caf9b665a7aca27f3f325
+
+--- a/ext/intl/msgformat/msgformat_helpers.cpp
++++ b/ext/intl/msgformat/msgformat_helpers.cpp
+@@ -27,6 +27,7 @@
+ #include <unicode/timezone.h>
+ #include <unicode/datefmt.h>
+ #include <unicode/calendar.h>
++#include <unicode/strenum.h>
+ 
+ #include <vector>
+ 
+@@ -45,6 +46,7 @@ extern "C" {
+ 
+ #if U_ICU_VERSION_MAJOR_NUM * 10 + U_ICU_VERSION_MINOR_NUM >= 48
+ #define HAS_MESSAGE_PATTERN 1
++#define HAS_MISALLOCATE_MEMORY_BUG 1
+ #endif
+ 
+ U_NAMESPACE_BEGIN
+@@ -345,6 +347,26 @@ static void umsg_set_timezone(MessageFormatter_object *mfo,
+ 		return; /* already done */
+ 	}
+ 
++#ifdef HAS_MISALLOCATE_MEMORY_BUG
++	/* There is a bug in ICU which prevents MessageFormatter::getFormats()
++	   to handle more than 10 formats correctly. The enumerator could be
++	   used to walk through the present formatters using getFormat(), which
++	   however seems to provide just a readonly access. This workaround
++	   prevents crash when there are > 10 formats but doesn't set any error.
++	   As a result, only DateFormatters with > 10 subformats are affected.
++	   This workaround should be ifdef'd out, when the bug has been fixed
++	   in ICU. */
++	icu::StringEnumeration* fnames = mf->getFormatNames(err.code);
++	if (!fnames || U_FAILURE(err.code)) {
++		return;
++	}
++	count = fnames->count(err.code);
++	delete fnames;
++	if (count > 10) {
++		return;
++	}
++#endif
++
+ 	formats = mf->getFormats(count);
+ 	
+ 	if (formats == NULL) {
+--- /dev/null
++++ b/ext/intl/tests/bug74484_MessageFormatter.phpt
+@@ -0,0 +1,35 @@
++--TEST--
++Bug #74484 MessageFormatter::formatMessage memory corruption with 11+ named placeholder
++--SKIPIF--
++<?php
++if (!extension_loaded('intl'))
++	die('skip intl extension not enabled');
++if (version_compare(INTL_ICU_VERSION, '4.8') < 0)
++	die('skip for ICU 4.8+');
++?>
++--FILE--
++<?php
++$text = "{a} {b} {c} {d} {e} {f} {g} {h} {i} {j} {k} {l}";
++
++$vars = array(
++  'a' => 1,
++  'b' => 2,
++  'c' => 3,
++  'd' => 4,
++  'e' => 5,
++  'f' => 6,
++  'g' => 7,
++  'h' => 8,
++  'i' => 9,
++  'j' => 10,
++  'k' => 11,
++  'l' => 12
++);
++
++var_dump(MessageFormatter::formatMessage('en_US', $text, $vars));
++
++?>
++==DONE==
++--EXPECT--
++string(26) "1 2 3 4 5 6 7 8 9 10 11 12"
++==DONE==

diff --git a/dev-lang/php/files/php-5.6-intl-use-icu-namespace.patch b/dev-lang/php/files/php-5.6-intl-use-icu-namespace.patch
new file mode 100644
index 00000000000..715adb303d6
--- /dev/null
+++ b/dev-lang/php/files/php-5.6-intl-use-icu-namespace.patch
@@ -0,0 +1,365 @@
+Based on the following upstream commits:
+
+https://github.com/php/php-src/commit/8d35a423838eb462cd39ee535c5d003073cc5f22
+https://github.com/php/php-src/commit/d8200e48857aeaf09f7127751efc5632ef7660a7
+https://github.com/php/php-src/commit/9a8e7b571896f39f83cb000fdb7c466b6d328d52
+
+--- a/ext/intl/breakiterator/breakiterator_class.cpp
++++ b/ext/intl/breakiterator/breakiterator_class.cpp
+@@ -38,6 +38,7 @@ extern "C" {
+ }
+ 
+ using PHP::CodePointBreakIterator;
++using icu::RuleBasedBreakIterator;
+ 
+ /* {{{ Global variables */
+ zend_class_entry *BreakIterator_ce_ptr;
+--- a/ext/intl/breakiterator/breakiterator_class.h
++++ b/ext/intl/breakiterator/breakiterator_class.h
+@@ -26,6 +26,8 @@
+ 
+ #ifndef USE_BREAKITERATOR_POINTER
+ typedef void BreakIterator;
++#else
++using icu::BreakIterator;
+ #endif
+ 
+ typedef struct {
+--- a/ext/intl/breakiterator/breakiterator_methods.cpp
++++ b/ext/intl/breakiterator/breakiterator_methods.cpp
+@@ -32,6 +32,8 @@ extern "C" {
+ }
+ 
+ using PHP::CodePointBreakIterator;
++using icu::BreakIterator;
++using icu::Locale;
+ 
+ U_CFUNC PHP_METHOD(BreakIterator, __construct)
+ {
+--- a/ext/intl/breakiterator/codepointiterator_internal.cpp
++++ b/ext/intl/breakiterator/codepointiterator_internal.cpp
+@@ -31,6 +31,8 @@ typedef union {
+ 
+ using namespace PHP;
+ 
++using icu::UCharCharacterIterator;
++
+ UOBJECT_DEFINE_RTTI_IMPLEMENTATION(CodePointBreakIterator);
+ 
+ CodePointBreakIterator::CodePointBreakIterator()
+--- a/ext/intl/breakiterator/codepointiterator_internal.h
++++ b/ext/intl/breakiterator/codepointiterator_internal.h
+@@ -18,8 +18,11 @@
+ #define CODEPOINTITERATOR_INTERNAL_H
+ 
+ #include <unicode/brkiter.h>
++#include <unicode/unistr.h>
+ 
+-using U_ICU_NAMESPACE::BreakIterator;
++using icu::BreakIterator;
++using icu::CharacterIterator;
++using icu::UnicodeString;
+ 
+ namespace PHP {
+ 
+--- a/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp
++++ b/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp
+@@ -25,6 +25,9 @@ extern "C" {
+ 
+ #include "../intl_convertcpp.h"
+ 
++using icu::RuleBasedBreakIterator;
++using icu::Locale;
++
+ static inline RuleBasedBreakIterator *fetch_rbbi(BreakIterator_object *bio) {
+ 	return (RuleBasedBreakIterator*)bio->biter;
+ }
+--- a/ext/intl/calendar/calendar_class.cpp
++++ b/ext/intl/calendar/calendar_class.cpp
+@@ -34,6 +34,9 @@ extern "C" {
+ #include <assert.h>
+ }
+ 
++using icu::GregorianCalendar;
++using icu::Locale;
++
+ /* {{{ Global variables */
+ zend_class_entry *Calendar_ce_ptr;
+ zend_class_entry *GregorianCalendar_ce_ptr;
+--- a/ext/intl/calendar/calendar_class.h
++++ b/ext/intl/calendar/calendar_class.h
+@@ -26,6 +26,8 @@
+ 
+ #ifndef USE_CALENDAR_POINTER
+ typedef void Calendar;
++#else
++using icu::Calendar;
+ #endif
+ 
+ typedef struct {
+--- a/ext/intl/calendar/calendar_methods.cpp
++++ b/ext/intl/calendar/calendar_methods.cpp
+@@ -40,6 +40,8 @@ extern "C" {
+ }
+ #include "../common/common_enum.h"
+ 
++using icu::Locale;
++
+ U_CFUNC PHP_METHOD(IntlCalendar, __construct)
+ {
+ 	zend_throw_exception( NULL,
+--- a/ext/intl/calendar/gregoriancalendar_methods.cpp
++++ b/ext/intl/calendar/gregoriancalendar_methods.cpp
+@@ -23,6 +23,8 @@
+ #include <unicode/locid.h>
+ #include <unicode/calendar.h>
+ #include <unicode/gregocal.h>
++#include <unicode/ustring.h>
++
+ extern "C" {
+ #include "../php_intl.h"
+ #define USE_TIMEZONE_POINTER 1
+@@ -32,6 +34,11 @@ extern "C" {
+ #include <ext/date/php_date.h>
+ }
+ 
++using icu::GregorianCalendar;
++using icu::Locale;
++using icu::UnicodeString;
++using icu::StringPiece;
++
+ static inline GregorianCalendar *fetch_greg(Calendar_object *co) {
+ 	return (GregorianCalendar*)co->ucal;
+ }
+--- a/ext/intl/common/common_date.cpp
++++ b/ext/intl/common/common_date.cpp
+@@ -25,6 +25,9 @@ extern "C" {
+ #include <ext/date/php_date.h>
+ }
+ 
++using icu::TimeZone;
++using icu::UnicodeString;
++
+ #ifndef INFINITY
+ #define INFINITY (DBL_MAX+DBL_MAX)
+ #endif
+--- a/ext/intl/common/common_date.h
++++ b/ext/intl/common/common_date.h
+@@ -28,6 +28,8 @@ U_CDECL_END
+ 
+ #include <unicode/timezone.h>
+ 
++using icu::TimeZone;
++
+ U_CFUNC TimeZone *timezone_convert_datetimezone(int type, void *object, int is_datetime, intl_error *outside_error, const char *func TSRMLS_DC);
+ U_CFUNC int intl_datetime_decompose(zval *z, double *millis, TimeZone **tz,
+ 		intl_error *err, const char *func TSRMLS_DC);
+--- a/ext/intl/common/common_enum.h
++++ b/ext/intl/common/common_enum.h
+@@ -69,6 +69,7 @@ U_CFUNC void zoi_with_current_get_current_data(zend_object_iterator *iter, zval
+ U_CFUNC void zoi_with_current_invalidate_current(zend_object_iterator *iter TSRMLS_DC);
+ 
+ #ifdef __cplusplus
++using icu::StringEnumeration;
+ U_CFUNC void IntlIterator_from_StringEnumeration(StringEnumeration *se, zval *object TSRMLS_DC);
+ #endif
+ 
+--- a/ext/intl/converter/converter.c
++++ b/ext/intl/converter/converter.c
+@@ -18,6 +18,8 @@
+ #include "zend_exceptions.h"
+ 
+ #include <unicode/utypes.h>
++#include <unicode/utf8.h>
++#include <unicode/utf16.h>
+ #include <unicode/ucnv.h>
+ #include <unicode/ustring.h>
+ 
+--- a/ext/intl/dateformat/dateformat_format_object.cpp
++++ b/ext/intl/dateformat/dateformat_format_object.cpp
+@@ -33,6 +33,12 @@ extern "C" {
+ #include "../common/common_date.h"
+ }
+ 
++using icu::Locale;
++using icu::DateFormat;
++using icu::GregorianCalendar;
++using icu::StringPiece;
++using icu::SimpleDateFormat;
++
+ static const DateFormat::EStyle valid_styles[] = {
+ 		DateFormat::kNone,
+ 		DateFormat::kFull,
+--- a/ext/intl/dateformat/dateformat_helpers.cpp
++++ b/ext/intl/dateformat/dateformat_helpers.cpp
+@@ -28,6 +28,8 @@ extern "C" {
+ #include "../calendar/calendar_class.h"
+ }
+ 
++using icu::GregorianCalendar;
++
+ int datefmt_process_calendar_arg(zval* calendar_zv,
+ 								 Locale const& locale,
+ 								 const char *func_name,
+--- a/ext/intl/dateformat/dateformat_helpers.h
++++ b/ext/intl/dateformat/dateformat_helpers.h
+@@ -22,11 +22,16 @@
+ #endif
+ 
+ #include <unicode/calendar.h>
++#include <unicode/datefmt.h>
+ 
+ extern "C" {
+ #include "../php_intl.h"
+ }
+ 
++using icu::Locale;
++using icu::Calendar;
++using icu::DateFormat;
++
+ int datefmt_process_calendar_arg(zval* calendar_zv,
+ 								 Locale const& locale,
+ 								 const char *func_name,
+--- a/ext/intl/grapheme/grapheme_string.c
++++ b/ext/intl/grapheme/grapheme_string.c
+@@ -24,6 +24,7 @@
+ #include "grapheme_util.h"
+ 
+ #include <unicode/utypes.h>
++#include <unicode/utf8.h>
+ #include <unicode/ucol.h>
+ #include <unicode/ustring.h>
+ #include <unicode/ubrk.h>
+@@ -860,10 +861,10 @@ PHP_FUNCTION(grapheme_extract)
+ 	pstr = str + start;
+ 
+ 	/* just in case pstr points in the middle of a character, move forward to the start of the next char */
+-	if ( !UTF8_IS_SINGLE(*pstr) && !U8_IS_LEAD(*pstr) ) {
++	if ( !U8_IS_SINGLE(*pstr) && !U8_IS_LEAD(*pstr) ) {
+ 		unsigned char *str_end = str + str_len;
+ 
+-		while ( !UTF8_IS_SINGLE(*pstr) && !U8_IS_LEAD(*pstr) ) {
++		while ( !U8_IS_SINGLE(*pstr) && !U8_IS_LEAD(*pstr) ) {
+ 			pstr++;
+ 			if ( pstr >= str_end ) {
+ 				intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
+--- a/ext/intl/intl_convertcpp.h
++++ b/ext/intl/intl_convertcpp.h
+@@ -25,6 +25,8 @@
+ 
+ #include <unicode/unistr.h>
+ 
++using icu::UnicodeString;
++
+ int intl_stringFromChar(UnicodeString &ret, char *str, int32_t str_len, UErrorCode *status);
+ 
+ int intl_charFromString(const UnicodeString &from, char **res, int *res_len, UErrorCode *status);
+--- a/ext/intl/msgformat/msgformat_helpers.cpp
++++ b/ext/intl/msgformat/msgformat_helpers.cpp
+@@ -76,6 +76,16 @@ MessageFormatAdapter::getMessagePattern(MessageFormat* m) {
+ #endif
+ U_NAMESPACE_END
+ 
++using icu::Formattable;
++using icu::Format;
++using icu::DateFormat;
++using icu::MessageFormat;
++#ifdef HAS_MESSAGE_PATTERN
++using icu::MessagePattern;
++#endif
++using icu::MessageFormatAdapter;
++using icu::FieldPosition;
++
+ U_CFUNC int32_t umsg_format_arg_count(UMessageFormat *fmt)
+ {
+ 	int32_t fmt_count = 0;
+@@ -227,15 +237,16 @@ static HashTable *umsg_parse_format(MessageFormatter_object *mfo,
+ 					UnicodeString typeString = mp.getSubstring(type_part);
+ 					/* This is all based on the rules in the docs for MessageFormat
+ 					 * @see http://icu-project.org/apiref/icu4c/classMessageFormat.html */
+-					if (typeString == "number") {
++#define ASCII_LITERAL(s) UNICODE_STRING(s, sizeof(s)-1)
++					if (typeString == ASCII_LITERAL("number")) {
+ 						MessagePattern::Part style_part = mp.getPart(i + 1); /* Not advancing i */
+ 						if (style_part.getType() == UMSGPAT_PART_TYPE_ARG_STYLE) {
+ 							UnicodeString styleString = mp.getSubstring(style_part);
+-							if (styleString == "integer") {
++							if (styleString == ASCII_LITERAL("integer")) {
+ 								type = Formattable::kInt64;
+-							} else if (styleString == "currency") {
++							} else if (styleString == ASCII_LITERAL("currency")) {
+ 								type = Formattable::kDouble;
+-							} else if (styleString == "percent") {
++							} else if (styleString == ASCII_LITERAL("percent")) {
+ 								type = Formattable::kDouble;
+ 							} else { /* some style invalid/unknown to us */
+ 								type = Formattable::kDouble;
+@@ -243,12 +254,13 @@ static HashTable *umsg_parse_format(MessageFormatter_object *mfo,
+ 						} else { // if missing style, part, make it a double
+ 							type = Formattable::kDouble;
+ 						}
+-					} else if ((typeString == "date") || (typeString == "time")) {
++					} else if ((typeString == ASCII_LITERAL("date")) || (typeString == ASCII_LITERAL("time"))) {
+ 						type = Formattable::kDate;
+-					} else if ((typeString == "spellout") || (typeString == "ordinal")
+-							|| (typeString == "duration")) {
++					} else if ((typeString == ASCII_LITERAL("spellout")) || (typeString == ASCII_LITERAL("ordinal"))
++							|| (typeString == ASCII_LITERAL("duration"))) {
+ 						type = Formattable::kDouble;
+ 					}
++#undef ASCII_LITERAL
+ 				} else {
+ 					/* If there's no UMSGPAT_PART_TYPE_ARG_TYPE right after a
+ 					 * UMSGPAT_ARG_TYPE_SIMPLE argument, then the pattern
+--- a/ext/intl/normalizer/normalizer_normalize.c
++++ b/ext/intl/normalizer/normalizer_normalize.c
+@@ -24,6 +24,7 @@
+ #include "normalizer_class.h"
+ #include "normalizer_normalize.h"
+ #include "intl_convert.h"
++#include <unicode/utf8.h>
+ 
+ /* {{{ proto string Normalizer::normalize( string $input [, string $form = FORM_C] )
+  * Normalize a string. }}} */
+--- a/ext/intl/timezone/timezone_class.cpp
++++ b/ext/intl/timezone/timezone_class.cpp
+@@ -37,6 +37,8 @@ extern "C" {
+ #include <ext/date/php_date.h>
+ }
+ 
++using icu::Calendar;
++
+ /* {{{ Global variables */
+ U_CDECL_BEGIN
+ zend_class_entry *TimeZone_ce_ptr = NULL;
+--- a/ext/intl/timezone/timezone_class.h
++++ b/ext/intl/timezone/timezone_class.h
+@@ -29,6 +29,8 @@
+ 
+ #ifndef USE_TIMEZONE_POINTER
+ typedef void TimeZone;
++#else
++using icu::TimeZone;
+ #endif
+ 
+ typedef struct {
+--- a/ext/intl/timezone/timezone_methods.cpp
++++ b/ext/intl/timezone/timezone_methods.cpp
+@@ -23,6 +23,7 @@
+ #include <unicode/locid.h>
+ #include <unicode/timezone.h>
+ #include <unicode/ustring.h>
++#include <unicode/calendar.h>
+ #include "intl_convertcpp.h"
+ 
+ #include "../common/common_date.h"
+@@ -37,6 +38,9 @@ extern "C" {
+ }
+ #include "common/common_enum.h"
+ 
++using icu::Locale;
++using icu::Calendar;
++
+ U_CFUNC PHP_METHOD(IntlTimeZone, __construct)
+ {
+ 	zend_throw_exception( NULL,

diff --git a/dev-lang/php/php-5.6.39.ebuild b/dev-lang/php/php-5.6.39.ebuild
new file mode 100644
index 00000000000..18d767d9395
--- /dev/null
+++ b/dev-lang/php/php-5.6.39.ebuild
@@ -0,0 +1,785 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="7"
+
+inherit autotools flag-o-matic systemd
+
+DESCRIPTION="The PHP language runtime engine"
+HOMEPAGE="https://secure.php.net/"
+SRC_URI="https://php.net/distributions/${P}.tar.xz
+	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"
+
+LICENSE="PHP-3.01
+	BSD
+	Zend-2.0
+	bcmath? ( LGPL-2.1+ )
+	fpm? ( BSD-2 )
+	gd? ( gd )
+	unicode? ( BSD-2 LGPL-2.1 )"
+
+SLOT="$(ver_cut 1-2)"
+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"
+
+# We can build the following SAPIs in the given order
+SAPIS="embed cli cgi fpm apache2"
+
+# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
+IUSE="${IUSE}
+	${SAPIS/cli/+cli}
+	threads"
+
+IUSE="${IUSE} acl bcmath berkdb bzip2 calendar cdb cjk
+	coverage crypt +ctype curl debug
+	enchant exif +fileinfo +filter firebird
+	flatfile ftp gd gdbm gmp +hash +iconv imap inifile
+	intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl
+	mhash mssql mysql libmysqlclient mysqli nls
+	oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
+	readline recode selinux +session sharedmem
+	+simplexml snmp soap sockets spell sqlite ssl
+	sybase-ct sysvipc systemd tidy +tokenizer truetype unicode vpx wddx
+	+xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib"
+
+# The supported (that is, autodetected) versions of BDB are listed in
+# the ./configure script. Other versions *work*, but we need to stick to
+# the ones that can be detected to avoid a repeat of bug #564824.
+COMMON_DEPEND="
+	>=app-eselect/eselect-php-0.9.1[apache2?,fpm?]
+	>=dev-libs/libpcre-8.32[unicode]
+	fpm? ( acl? ( sys-apps/acl ) )
+	apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=]
+		<www-servers/apache-2.4[threads=] ) )
+	berkdb? ( || (	sys-libs/db:5.3
+					sys-libs/db:5.1
+					sys-libs/db:4.8
+					sys-libs/db:4.7
+					sys-libs/db:4.6
+					sys-libs/db:4.5 ) )
+	bzip2? ( app-arch/bzip2:0= )
+	cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
+	cjk? ( !gd? (
+		virtual/jpeg:0
+		media-libs/libpng:0=
+		sys-libs/zlib:0=
+	) )
+	coverage? ( dev-util/lcov )
+	crypt? ( >=dev-libs/libmcrypt-2.4 )
+	curl? ( >=net-misc/curl-7.10.5 )
+	enchant? ( app-text/enchant )
+	exif? ( !gd? (
+		virtual/jpeg:0
+		media-libs/libpng:0=
+		sys-libs/zlib:0=
+	) )
+	firebird? ( dev-db/firebird )
+	gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib:0= )
+	gdbm? ( >=sys-libs/gdbm-1.8.0:0= )
+	gmp? ( dev-libs/gmp:0= )
+	iconv? ( virtual/libiconv )
+	imap? ( virtual/imap-c-client[kerberos=,ssl=] )
+	intl? ( dev-libs/icu:= )
+	iodbc? ( dev-db/libiodbc )
+	kerberos? ( virtual/krb5 )
+	ldap? ( >=net-nds/openldap-1.2.11 )
+	ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 )
+	libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) )
+	mssql? ( dev-db/freetds[mssql] )
+	libmysqlclient? (
+		mysql? ( virtual/libmysqlclient:= )
+		mysqli? ( virtual/libmysqlclient:= )
+	)
+	nls? ( sys-devel/gettext )
+	oci8-instant-client? ( dev-db/oracle-instantclient-basic )
+	odbc? ( >=dev-db/unixODBC-1.8.13 )
+	postgres? ( dev-db/postgresql:* )
+	qdbm? ( dev-db/qdbm )
+	readline? ( sys-libs/readline:0= )
+	recode? ( app-text/recode )
+	sharedmem? ( dev-libs/mm )
+	simplexml? ( >=dev-libs/libxml2-2.6.8 )
+	snmp? ( >=net-analyzer/net-snmp-5.2 )
+	soap? ( >=dev-libs/libxml2-2.6.8 )
+	spell? ( >=app-text/aspell-0.50 )
+	sqlite? ( >=dev-db/sqlite-3.7.6.3 )
+	ssl? (
+		!libressl? ( dev-libs/openssl:0= )
+		libressl? ( dev-libs/libressl:0= )
+	)
+	sybase-ct? ( dev-db/freetds )
+	tidy? ( app-text/htmltidy )
+	truetype? (
+		=media-libs/freetype-2*
+		>=media-libs/t1lib-5.0.0
+		!gd? (
+			virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib:0= )
+	)
+	unicode? ( dev-libs/oniguruma:= )
+	vpx? ( media-libs/libvpx:0= )
+	wddx? ( >=dev-libs/libxml2-2.6.8 )
+	xml? ( >=dev-libs/libxml2-2.6.8 )
+	xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
+	xmlreader? ( >=dev-libs/libxml2-2.6.8 )
+	xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
+	xpm? (
+		x11-libs/libXpm
+		virtual/jpeg:0
+		media-libs/libpng:0= sys-libs/zlib:0=
+	)
+	xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
+	zip? ( sys-libs/zlib:0= )
+	zlib? ( sys-libs/zlib:0= )
+"
+
+RDEPEND="${COMMON_DEPEND}
+	virtual/mta
+	fpm? (
+		selinux? ( sec-policy/selinux-phpfpm )
+		systemd? ( sys-apps/systemd ) )"
+
+DEPEND="${COMMON_DEPEND}
+	app-arch/xz-utils
+	>=sys-devel/bison-3.0.1
+	sys-devel/flex
+	>=sys-devel/m4-1.4.3
+	>=sys-devel/libtool-1.5.18"
+
+# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
+REQUIRED_USE="
+	|| ( cli cgi fpm apache2 embed )
+	cli? ( ^^ ( readline libedit ) )
+	truetype? ( gd zlib )
+	vpx? ( gd zlib )
+	cjk? ( gd zlib )
+	exif? ( gd zlib )
+	xpm? ( gd zlib )
+	gd? ( zlib )
+	simplexml? ( xml )
+	soap? ( xml )
+	wddx? ( xml )
+	xmlrpc? ( || ( xml iconv ) )
+	xmlreader? ( xml )
+	xslt? ( xml )
+	ldap-sasl? ( ldap )
+	mhash? ( hash )
+	phar? ( hash )
+	recode? ( !imap !mysql !mysqli !libmysqlclient )
+	libmysqlclient? ( || (
+		mysql
+		mysqli
+		pdo
+	) )
+
+	qdbm? ( !gdbm )
+	readline? ( !libedit )
+	sharedmem? ( !threads )
+"
+
+PHP_MV="$(ver_cut 1)"
+
+php_install_ini() {
+	local phpsapi="${1}"
+
+	# work out where we are installing the ini file
+	php_set_ini_dir "${phpsapi}"
+
+	# Always install the production INI file, bug 611214.
+	local phpinisrc="php.ini-production-${phpsapi}"
+	cp php.ini-production "${phpinisrc}" || die
+
+	# default to /tmp for save_path, bug #282768
+	sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die
+
+	# Set the extension dir
+	sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \
+		-i "${phpinisrc}" || die
+
+	# Set the include path to point to where we want to find PEAR packages
+	sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die
+
+	dodir "${PHP_INI_DIR#${EPREFIX}}"
+	insinto "${PHP_INI_DIR#${EPREFIX}}"
+	newins "${phpinisrc}" php.ini
+
+	elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}"
+	elog
+
+	dodir "${PHP_EXT_INI_DIR#${EPREFIX}}"
+	dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}"
+
+	if use opcache; then
+		elog "Adding opcache to $PHP_EXT_INI_DIR"
+		echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \
+			 "${D}/${PHP_EXT_INI_DIR}"/opcache.ini
+		dosym "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" \
+			  "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini"
+	fi
+
+	# SAPI-specific handling
+	if [[ "${sapi}" == "fpm" ]] ; then
+		einfo "Installing FPM config file php-fpm.conf"
+		insinto "${PHP_INI_DIR#${EPREFIX}}"
+		doins sapi/fpm/php-fpm.conf
+	fi
+
+	dodoc php.ini-{development,production}
+}
+
+php_set_ini_dir() {
+	PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}"
+	PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
+	PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
+}
+
+src_prepare() {
+	eapply "${FILESDIR}/php-${SLOT}-no-bison-warnings.patch"
+	eapply "${FILESDIR}/5.6-mbstring-oniguruma-6.8.patch"
+	eapply "${DISTDIR}/php-5.6-openssl-1.1-compatibility.patch"
+	eapply "${FILESDIR}/php-5.6-intl-detect-icu-via-pkg-config.patch"
+	eapply "${FILESDIR}/php-5.6-intl-use-icu-namespace.patch"
+	eapply "${FILESDIR}/php-5.6-intl-icu-memory-corruption.patch"
+	eapply "${FILESDIR}/php-freetype-2.9.1.patch"
+
+	# Change PHP branding
+	# Get the alpha/beta/rc version
+	sed -re	"s|^(PHP_EXTRA_VERSION=\").*(\")|\1-pl${PR/r/}-gentoo\2|g" \
+		-i configure.in || die "Unable to change PHP branding"
+
+	# Patch PHP to show Gentoo as the server platform
+	sed -e 's/PHP_UNAME=`uname -a | xargs`/PHP_UNAME=`uname -s -n -r -v | xargs`/g' \
+		-i configure.in || die "Failed to fix server platform name"
+
+	# Prevent PHP from activating the Apache config,
+	# as we will do that ourselves
+	sed -i \
+		-e "s,-i -a -n php${PHP_MV},-i -n php${PHP_MV},g" \
+		-e "s,-i -A -n php${PHP_MV},-i -n php${PHP_MV},g" \
+		configure sapi/apache2filter/config.m4 sapi/apache2handler/config.m4 \
+		|| die
+
+	# Patch PHP to support heimdal instead of mit-krb5
+	if has_version "app-crypt/heimdal" ; then
+		sed -e 's|gssapi_krb5|gssapi|g' -i acinclude.m4 \
+			|| die "Failed to fix heimdal libname"
+		sed -e 's|PHP_ADD_LIBRARY(k5crypto, 1, $1)||g' -i acinclude.m4 \
+			|| die "Failed to fix heimdal crypt library reference"
+	fi
+
+	eapply_user
+
+	# Force rebuilding aclocal.m4
+	rm -f aclocal.m4 || die "failed to remove aclocal.m4 in src_prepare"
+
+	mv configure.in configure.ac || die
+
+	eautoreconf
+
+	if [[ ${CHOST} == *-darwin* ]] ; then
+		# http://bugs.php.net/bug.php?id=48795, bug #343481
+		sed -i -e '/BUILD_CGI="\\$(CC)/s/CC/CXX/' configure || die
+	fi
+}
+
+src_configure() {
+	addpredict /usr/share/snmp/mibs/.index #nowarn
+	addpredict /var/lib/net-snmp/mib_indexes #nowarn
+
+	PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
+
+	# The php-fpm config file wants localstatedir to be ${EPREFIX}/var
+	# and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002.
+	local our_conf=(
+		--prefix="${PHP_DESTDIR}"
+		--mandir="${PHP_DESTDIR}/man"
+		--infodir="${PHP_DESTDIR}/info"
+		--libdir="${PHP_DESTDIR}/lib"
+		--with-libdir="$(get_libdir)"
+		--localstatedir="${EPREFIX}/var"
+		--without-pear
+		$(use_enable threads maintainer-zts)
+	)
+
+	our_conf+=(
+		$(use_enable bcmath bcmath)
+		$(use_with bzip2 bz2 "${EPREFIX}/usr")
+		$(use_enable calendar calendar)
+		$(use_enable coverage gcov)
+		$(use_enable ctype ctype)
+		$(use_with curl curl "${EPREFIX}/usr")
+		$(use_enable xml dom)
+		$(use_with enchant enchant "${EPREFIX}/usr")
+		$(use_enable exif exif)
+		$(use_enable fileinfo fileinfo)
+		$(use_enable filter filter)
+		$(use_enable ftp ftp)
+		$(use_with nls gettext "${EPREFIX}/usr")
+		$(use_with gmp gmp "${EPREFIX}/usr")
+		$(use_enable hash hash)
+		$(use_with mhash mhash "${EPREFIX}/usr")
+		$(use_with iconv iconv \
+			$(use elibc_glibc || use elibc_musl || use elibc_FreeBSD || echo "${EPREFIX}/usr"))
+		$(use_enable intl intl)
+		$(use_enable ipv6 ipv6)
+		$(use_enable json json)
+		$(use_with kerberos kerberos "${EPREFIX}/usr")
+		$(use_enable xml libxml)
+		$(use_with xml libxml-dir "${EPREFIX}/usr")
+		$(use_enable unicode mbstring)
+		$(use_with crypt mcrypt "${EPREFIX}/usr")
+		$(use_with mssql mssql "${EPREFIX}/usr")
+		$(use_with unicode onig "${EPREFIX}/usr")
+		$(use_with ssl openssl "${EPREFIX}/usr")
+		$(use_with ssl openssl-dir "${EPREFIX}/usr")
+		$(use_enable pcntl pcntl)
+		$(use_enable phar phar)
+		$(use_enable pdo pdo)
+		$(use_enable opcache opcache)
+		$(use_with postgres pgsql "${EPREFIX}/usr")
+		$(use_enable posix posix)
+		$(use_with spell pspell "${EPREFIX}/usr")
+		$(use_with recode recode "${EPREFIX}/usr")
+		$(use_enable simplexml simplexml)
+		$(use_enable sharedmem shmop)
+		$(use_with snmp snmp "${EPREFIX}/usr")
+		$(use_enable soap soap)
+		$(use_enable sockets sockets)
+		$(use_with sqlite sqlite3 "${EPREFIX}/usr")
+		$(use_with sybase-ct sybase-ct "${EPREFIX}/usr")
+		$(use_enable sysvipc sysvmsg)
+		$(use_enable sysvipc sysvsem)
+		$(use_enable sysvipc sysvshm)
+		$(use_with tidy tidy "${EPREFIX}/usr")
+		$(use_enable tokenizer tokenizer)
+		$(use_enable wddx wddx)
+		$(use_enable xml xml)
+		$(use_enable xmlreader xmlreader)
+		$(use_enable xmlwriter xmlwriter)
+		$(use_with xmlrpc xmlrpc)
+		$(use_with xslt xsl "${EPREFIX}/usr")
+		$(use_enable zip zip)
+		$(use_with zlib zlib "${EPREFIX}/usr")
+		$(use_enable debug debug)
+	)
+
+	# DBA support
+	if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
+		|| use qdbm ; then
+		our_conf+=( "--enable-dba${shared}" )
+	fi
+
+	# DBA drivers support
+	our_conf+=(
+		$(use_with cdb cdb)
+		$(use_with berkdb db4 "${EPREFIX}/usr")
+		$(use_enable flatfile flatfile)
+		$(use_with gdbm gdbm "${EPREFIX}/usr")
+		$(use_enable inifile inifile)
+		$(use_with qdbm qdbm "${EPREFIX}/usr")
+	)
+
+	# Support for the GD graphics library
+	our_conf+=(
+		$(use_with truetype freetype-dir "${EPREFIX}/usr")
+		$(use_with truetype t1lib "${EPREFIX}/usr")
+		$(use_enable cjk gd-jis-conv)
+		$(use_with gd jpeg-dir "${EPREFIX}/usr")
+		$(use_with gd png-dir "${EPREFIX}/usr")
+		$(use_with xpm xpm-dir "${EPREFIX}/usr")
+		$(use_with vpx vpx-dir "${EPREFIX}/usr")
+	)
+	# enable gd last, so configure can pick up the previous settings
+	our_conf+=( $(use_with gd gd) )
+
+	# IMAP support
+	if use imap ; then
+		our_conf+=(
+			$(use_with imap imap "${EPREFIX}/usr")
+			$(use_with ssl imap-ssl "${EPREFIX}/usr")
+		)
+	fi
+
+	# Interbase/firebird support
+	our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") )
+
+	# LDAP support
+	if use ldap ; then
+		our_conf+=(
+			$(use_with ldap ldap "${EPREFIX}/usr")
+			$(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr")
+		)
+	fi
+
+	# MySQL support
+	local mysqllib="mysqlnd"
+	local mysqlilib="mysqlnd"
+	use libmysqlclient && mysqllib="${EPREFIX}/usr"
+	use libmysqlclient && mysqlilib="${EPREFIX}/usr/bin/mysql_config"
+
+	our_conf+=( $(use_with mysql mysql "${mysqllib}") )
+	our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
+
+	local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock"
+	if use mysql || use mysqli ; then
+		our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") )
+	fi
+
+	# ODBC support
+	our_conf+=(
+		$(use_with odbc unixODBC "${EPREFIX}/usr")
+		$(use_with iodbc iodbc "${EPREFIX}/usr")
+	)
+
+	# Oracle support
+	our_conf+=( $(use_with oci8-instant-client oci8) )
+
+	# PDO support
+	if use pdo ; then
+		our_conf+=(
+			$(use_with mssql pdo-dblib)
+			$(use_with mysql pdo-mysql "${mysqllib}")
+			$(use_with postgres pdo-pgsql)
+			$(use_with sqlite pdo-sqlite "${EPREFIX}/usr")
+			$(use_with firebird pdo-firebird "${EPREFIX}/usr")
+			$(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr")
+			$(use_with oci8-instant-client pdo-oci)
+		)
+	fi
+
+	# readline/libedit support
+	our_conf+=(
+		$(use_with readline readline "${EPREFIX}/usr")
+		$(use_with libedit libedit "${EPREFIX}/usr")
+	)
+
+	# Session support
+	if use session ; then
+		our_conf+=( $(use_with sharedmem mm "${EPREFIX}/usr") )
+	else
+		our_conf+=( $(use_enable session session) )
+	fi
+
+	# Use pic for shared modules such as apache2's mod_php
+	our_conf+=( --with-pic )
+
+	# we use the system copy of pcre
+	# --with-pcre-regex affects ext/pcre
+	# --with-pcre-dir affects ext/filter and ext/zip
+	our_conf+=(
+		--with-pcre-regex="${EPREFIX}/usr"
+		--with-pcre-dir="${EPREFIX}/usr"
+	)
+
+	# Catch CFLAGS problems
+	# Fixes bug #14067.
+	# Changed order to run it in reverse for bug #32022 and #12021.
+	replace-cpu-flags "k6*" "i586"
+
+	# Cache the ./configure test results between SAPIs.
+	our_conf+=( --cache-file="${T}/config.cache" )
+
+	# Support user-passed configuration parameters
+	our_conf+=( ${EXTRA_ECONF:-} )
+
+	# Support the Apache2 extras, they must be set globally for all
+	# SAPIs to work correctly, especially for external PHP extensions
+
+	mkdir -p "${WORKDIR}/sapis-build" || die
+	for one_sapi in $SAPIS ; do
+		use "${one_sapi}" || continue
+		php_set_ini_dir "${one_sapi}"
+
+		# The BUILD_DIR variable is used to determine where to output
+		# the files that autotools creates. This was all originally
+		# based on the autotools-utils eclass.
+		BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}"
+		cp -a "${S}" "${BUILD_DIR}" || die
+		cd "${BUILD_DIR}" || die
+
+		local sapi_conf=(
+			--with-config-file-path="${PHP_INI_DIR}"
+			--with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}"
+		)
+
+		for sapi in $SAPIS ; do
+			case "$sapi" in
+				cli|cgi|embed|fpm)
+					if [[ "${one_sapi}" == "${sapi}" ]] ; then
+						sapi_conf+=( "--enable-${sapi}" )
+						if [[ "fpm" == "${sapi}" ]] ; then
+							sapi_conf+=(
+								$(use_with acl fpm-acl)
+								$(use_with systemd fpm-systemd)
+							)
+						fi
+					else
+						sapi_conf+=( "--disable-${sapi}" )
+					fi
+					;;
+
+				apache2)
+					if [[ "${one_sapi}" == "${sapi}" ]] ; then
+						sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" )
+					else
+						sapi_conf+=( --without-apxs2 )
+					fi
+					;;
+			esac
+		done
+
+		# Construct the $myeconfargs array by concatenating $our_conf
+		# (the common args) and $sapi_conf (the SAPI-specific args).
+		local myeconfargs=( "${our_conf[@]}" )
+		myeconfargs+=( "${sapi_conf[@]}" )
+
+		pushd "${BUILD_DIR}" > /dev/null || die
+		econf "${myeconfargs[@]}"
+		popd > /dev/null || die
+	done
+}
+
+src_compile() {
+	# snmp seems to run during src_compile, too (bug #324739)
+	addpredict /usr/share/snmp/mibs/.index #nowarn
+	addpredict /var/lib/net-snmp/mib_indexes #nowarn
+
+	for sapi in ${SAPIS} ; do
+		if use "${sapi}"; then
+			cd "${WORKDIR}/sapis-build/$sapi" || \
+				die "Failed to change dir to ${WORKDIR}/sapis-build/$1"
+			emake
+		fi
+	done
+}
+
+src_install() {
+	# see bug #324739 for what happens when we don't have that
+	addpredict /usr/share/snmp/mibs/.index #nowarn
+
+	# grab the first SAPI that got built and install common files from there
+	local first_sapi=""
+	for sapi in $SAPIS ; do
+		if use $sapi ; then
+			first_sapi=$sapi
+			break
+		fi
+	done
+
+	# Makefile forgets to create this before trying to write to it...
+	dodir "${PHP_DESTDIR#${EPREFIX}}/bin"
+
+	# Install php environment (without any sapis)
+	cd "${WORKDIR}/sapis-build/$first_sapi" || die
+	emake INSTALL_ROOT="${D}" \
+		install-build install-headers install-programs
+
+	local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)"
+
+	# Create the directory where we'll put version-specific php scripts
+	keepdir "/usr/share/php${PHP_MV}"
+
+	local sapi="", file=""
+	local sapi_list=""
+
+	for sapi in ${SAPIS}; do
+		if use "${sapi}" ; then
+			einfo "Installing SAPI: ${sapi}"
+			cd "${WORKDIR}/sapis-build/${sapi}" || die
+
+			if [[ "${sapi}" == "apache2" ]] ; then
+				# We're specifically not using emake install-sapi as libtool
+				# may cause unnecessary relink failures (see bug #351266)
+				insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/"
+				newins ".libs/libphp5$(get_libname)" \
+					   "libphp${PHP_MV}$(get_libname)"
+				keepdir "/usr/$(get_libdir)/apache2/modules"
+			else
+				# needed each time, php_install_ini would reset it
+				local dest="${PHP_DESTDIR#${EPREFIX}}"
+				into "${dest}"
+				case "$sapi" in
+					cli)
+						source="sapi/cli/php"
+						;;
+					cgi)
+						source="sapi/cgi/php-cgi"
+						;;
+					fpm)
+						source="sapi/fpm/php-fpm"
+						;;
+					embed)
+						source="libs/libphp${PHP_MV}$(get_libname)"
+						;;
+					*)
+						die "unhandled sapi in src_install"
+						;;
+				esac
+
+				if [[ "${source}" == *"$(get_libname)" ]]; then
+					dolib.so "${source}"
+				else
+					dobin "${source}"
+					local name="$(basename ${source})"
+					dosym "${dest}/bin/${name}" "/usr/bin/${name}${SLOT}"
+				fi
+			fi
+
+			php_install_ini "${sapi}"
+
+			# construct correct SAPI string for php-config
+			# thanks to ferringb for the bash voodoo
+			if [[ "${sapi}" == "apache2" ]]; then
+				sapi_list="${sapi_list:+${sapi_list} }apache2handler"
+			else
+				sapi_list="${sapi_list:+${sapi_list} }${sapi}"
+			fi
+		fi
+	done
+
+	# Installing opcache module
+	if use opcache ; then
+		into "${PHP_DESTDIR#${EPREFIX}}"
+		dolib.so "modules/opcache$(get_libname)"
+	fi
+
+	# Install env.d files
+	newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}"
+	sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
+	sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
+
+	# set php-config variable correctly (bug #278439)
+	sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \
+		"${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die
+
+	if use fpm ; then
+		if use systemd; then
+			systemd_newunit "${FILESDIR}/php-fpm_at.service" \
+							"php-fpm@${SLOT}.service"
+		else
+			systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \
+							"php-fpm@${SLOT}.service"
+		fi
+	fi
+}
+
+src_test() {
+	echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
+	PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
+	if [[ ! -x "${PHP_BIN}" ]] ; then
+		ewarn "Test phase requires USE=cli, skipping"
+		return
+	else
+		export TEST_PHP_EXECUTABLE="${PHP_BIN}"
+	fi
+
+	if [[ -x "${WORKDIR}/sapis/cgi/php-cgi" ]] ; then
+		export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis/cgi/php-cgi"
+	fi
+
+	REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n  -d \
+					  "session.save_path=${T}" \
+					  "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \
+					  "session.save_path=${T}"
+
+	for name in ${EXPECTED_TEST_FAILURES}; do
+		mv "${name}.out" "${name}.out.orig" 2>/dev/null || die
+	done
+
+	local failed="$(find -name '*.out')"
+	if [[ ${failed} != "" ]] ; then
+		ewarn "The following test cases failed unexpectedly:"
+		for name in ${failed}; do
+			ewarn "  ${name/.out/}"
+		done
+	else
+		einfo "No unexpected test failures, all fine"
+	fi
+
+	if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
+		local passed=""
+		for name in ${EXPECTED_TEST_FAILURES}; do
+			[[ -f "${name}.diff" ]] && continue
+			passed="${passed} ${name}"
+		done
+		if [[ ${passed} != "" ]] ; then
+			einfo "The following test cases passed unexpectedly:"
+			for name in ${passed}; do
+				ewarn "  ${passed}"
+			done
+		else
+			einfo "None of the known-to-fail tests passed, all fine"
+		fi
+	fi
+}
+
+pkg_postinst() {
+	# Output some general info to the user
+	if use apache2 ; then
+		elog
+		elog "To enable PHP in apache, you will need to add \"-D PHP\" to"
+		elog "your apache2 command. OpenRC users can append that string to"
+		elog "APACHE2_OPTS in /etc/conf.d/apache2."
+		elog
+		elog "The apache module configuration file 70_mod_php.conf is"
+		elog "provided (and maintained) by eselect-php."
+		elog
+	fi
+
+	# Create the symlinks for php
+	for m in ${SAPIS}; do
+		[[ ${m} == 'embed' ]] && continue;
+		if use $m ; then
+			local ci=$(eselect php show $m)
+			if [[ -z $ci ]]; then
+				eselect php set $m php${SLOT} || die
+				einfo "Switched ${m} to use php:${SLOT}"
+				einfo
+			elif [[ $ci != "php${SLOT}" ]] ; then
+				elog "To switch $m to use php:${SLOT}, run"
+				elog "    eselect php set $m php${SLOT}"
+				elog
+			fi
+		fi
+	done
+
+	# Remove dead symlinks for SAPIs that were just disabled. For
+	# example, if the user has the cgi SAPI enabled, then he has an
+	# eselect-php symlink for it. If he later reinstalls PHP with
+	# USE="-cgi", that symlink will break. This call to eselect is
+	# supposed to remove that dead link per bug 572436.
+	eselect php cleanup || die
+
+	if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then
+	   elog "To build extensions for this version of PHP, you will need to"
+	   elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable."
+	   elog
+	fi
+
+	# Warn about the removal of PHP_INI_VERSION if the user has it set.
+	if [[ -n "${PHP_INI_VERSION}" ]]; then
+		ewarn 'The PHP_INI_VERSION variable has been phased out. You may'
+		ewarn 'remove it from your configuration at your convenience. See'
+		ewarn
+		ewarn '  https://bugs.gentoo.org/611214'
+		ewarn
+		ewarn 'for more information.'
+	fi
+
+	elog "For details on how version slotting works, please see"
+	elog "the wiki:"
+	elog
+	elog "  https://wiki.gentoo.org/wiki/PHP"
+	elog
+}
+
+pkg_postrm() {
+	# This serves two purposes. First, if we have just removed the last
+	# installed version of PHP, then this will remove any dead symlinks
+	# belonging to eselect-php. Second, if a user upgrades slots from
+	# (say) 5.6 to 7.0 and depcleans the old slot, then this will update
+	# his existing symlinks to point to the new 7.0 installation. The
+	# latter is bug 432962.
+	#
+	# Note: the eselect-php package may not be installed at this point,
+	# so we can't die() if this command fails.
+	eselect php cleanup
+}


^ permalink raw reply related	[flat|nested] 21+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-lang/php/files/, dev-lang/php/
@ 2018-05-04 21:03 Brian Evans
  0 siblings, 0 replies; 21+ messages in thread
From: Brian Evans @ 2018-05-04 21:03 UTC (permalink / raw
  To: gentoo-commits

commit:     71ef0a9d7feaa6bc13c22a33267a1bd496d98e8d
Author:     Brian Evans <grknight <AT> gentoo <DOT> org>
AuthorDate: Fri May  4 21:03:32 2018 +0000
Commit:     Brian Evans <grknight <AT> gentoo <DOT> org>
CommitDate: Fri May  4 21:03:32 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=71ef0a9d

dev-lang/php: Fix building with freetype 2.9.1 by using pkgconfig

Closes: https://bugs.gentoo.org/654794
Package-Manager: Portage-2.3.36, Repoman-2.3.9

 dev-lang/php/files/php-freetype-2.9.1.patch | 231 ++++++++++++++++++++++++++++
 dev-lang/php/php-5.6.35-r1.ebuild           |   1 +
 dev-lang/php/php-5.6.36.ebuild              |   1 +
 dev-lang/php/php-7.0.29.ebuild              |   1 +
 dev-lang/php/php-7.0.30.ebuild              |   1 +
 dev-lang/php/php-7.1.16.ebuild              |   1 +
 dev-lang/php/php-7.1.17.ebuild              |   1 +
 dev-lang/php/php-7.2.5.ebuild               |   1 +
 8 files changed, 238 insertions(+)

diff --git a/dev-lang/php/files/php-freetype-2.9.1.patch b/dev-lang/php/files/php-freetype-2.9.1.patch
new file mode 100644
index 00000000000..3ddf8d1154d
--- /dev/null
+++ b/dev-lang/php/files/php-freetype-2.9.1.patch
@@ -0,0 +1,231 @@
+--- a/ext/gd/config.m4	2018-04-24 11:09:54.000000000 -0400
++++ b/ext/gd/config.m4	2018-05-04 15:18:49.867283889 -0400
+@@ -186,21 +186,35 @@
+ AC_DEFUN([PHP_GD_FREETYPE2],[
+   if test "$PHP_FREETYPE_DIR" != "no"; then
+ 
+-    for i in $PHP_FREETYPE_DIR /usr/local /usr; do
+-      if test -f "$i/bin/freetype-config"; then
+-        FREETYPE2_DIR=$i
+-        FREETYPE2_CONFIG="$i/bin/freetype-config"
+-        break
++    AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
++    AC_MSG_CHECKING(for freetype2)
++
++    if test -x "$PKG_CONFIG" && $PKG_CONFIG --exists freetype2 ; then
++
++      FREETYPE2_CFLAGS=`$PKG_CONFIG --cflags freetype2`
++      FREETYPE2_LIBS=`$PKG_CONFIG --libs freetype2`
++      FREETYPE2_VERSION=`$PKG_CONFIG --modversion freetype2`
++
++      AC_MSG_RESULT(from pkgconfig: version $FREETYPE2_VERSION found)
++    else
++
++      for i in $PHP_FREETYPE_DIR /usr/local /usr; do
++        if test -f "$i/bin/freetype-config"; then
++          FREETYPE2_DIR=$i
++          FREETYPE2_CONFIG="$i/bin/freetype-config"
++          break
++        fi
++      done
++
++      if test -z "$FREETYPE2_DIR"; then
++        AC_MSG_ERROR([freetype-config not found.])
+       fi
+-    done
+ 
+-    if test -z "$FREETYPE2_DIR"; then
+-      AC_MSG_ERROR([freetype-config not found.])
++      FREETYPE2_CFLAGS=`$FREETYPE2_CONFIG --cflags`
++      FREETYPE2_LIBS=`$FREETYPE2_CONFIG --libs`
++      AC_MSG_RESULT(found via freetype-config)
+     fi
+ 
+-    FREETYPE2_CFLAGS=`$FREETYPE2_CONFIG --cflags`
+-    FREETYPE2_LIBS=`$FREETYPE2_CONFIG --libs`
+-
+     PHP_EVAL_INCLINE($FREETYPE2_CFLAGS)
+     PHP_EVAL_LIBLINE($FREETYPE2_LIBS, GD_SHARED_LIBADD)
+     AC_DEFINE(HAVE_LIBFREETYPE,1,[ ])
+--- a/configure	2018-04-24 11:10:05.000000000 -0400
++++ b/configure	2018-05-04 15:18:45.626367913 -0400
+@@ -34348,21 +34348,78 @@
+ 
+   if test "$PHP_FREETYPE_DIR" != "no"; then
+ 
+-    for i in $PHP_FREETYPE_DIR /usr/local /usr; do
+-      if test -f "$i/bin/freetype-config"; then
+-        FREETYPE2_DIR=$i
+-        FREETYPE2_CONFIG="$i/bin/freetype-config"
+-        break
++    # Extract the first word of "pkg-config", so it can be a program name with args.
++set dummy pkg-config; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if ${ac_cv_path_PKG_CONFIG+:} false; then :
++  $as_echo_n "(cached) " >&6
++else
++  case $PKG_CONFIG in
++  [\\/]* | ?:[\\/]*)
++  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
++  ;;
++  *)
++  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
++  ;;
++esac
++fi
++PKG_CONFIG=$ac_cv_path_PKG_CONFIG
++if test -n "$PKG_CONFIG"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
++$as_echo "$PKG_CONFIG" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype2" >&5
++$as_echo_n "checking for freetype2... " >&6; }
++
++
++    if test -x "$PKG_CONFIG" && $PKG_CONFIG --exists freetype2 ; then
++
++      FREETYPE2_CFLAGS=`$PKG_CONFIG --cflags freetype2`
++      FREETYPE2_LIBS=`$PKG_CONFIG --libs freetype2`
++      FREETYPE2_VERSION=`$PKG_CONFIG --modversion freetype2`
++
++      { $as_echo "$as_me:${as_lineno-$LINENO}: result: from pkgconfig: version $FREETYPE2_VERSION found" >&5
++$as_echo "from pkgconfig: version $FREETYPE2_VERSION found" >&6; }
++    else
++
++      for i in $PHP_FREETYPE_DIR /usr/local /usr; do
++        if test -f "$i/bin/freetype-config"; then
++          FREETYPE2_DIR=$i
++          FREETYPE2_CONFIG="$i/bin/freetype-config"
++          break
++        fi
++      done
++
++      if test -z "$FREETYPE2_DIR"; then
++        as_fn_error $? "freetype-config not found." "$LINENO" 5
+       fi
+-    done
+ 
+-    if test -z "$FREETYPE2_DIR"; then
+-      as_fn_error $? "freetype-config not found." "$LINENO" 5
++      FREETYPE2_CFLAGS=`$FREETYPE2_CONFIG --cflags`
++      FREETYPE2_LIBS=`$FREETYPE2_CONFIG --libs`
++      { $as_echo "$as_me:${as_lineno-$LINENO}: result: found via freetype-config" >&5
++$as_echo "found via freetype-config" >&6; }
+     fi
+ 
+-    FREETYPE2_CFLAGS=`$FREETYPE2_CONFIG --cflags`
+-    FREETYPE2_LIBS=`$FREETYPE2_CONFIG --libs`
+-
+ 
+   for ac_i in $FREETYPE2_CFLAGS; do
+     case $ac_i in
+@@ -36019,21 +36076,78 @@
+ 
+   if test "$PHP_FREETYPE_DIR" != "no"; then
+ 
+-    for i in $PHP_FREETYPE_DIR /usr/local /usr; do
+-      if test -f "$i/bin/freetype-config"; then
+-        FREETYPE2_DIR=$i
+-        FREETYPE2_CONFIG="$i/bin/freetype-config"
+-        break
++    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype2" >&5
++$as_echo_n "checking for freetype2... " >&6; }
++    # Extract the first word of "pkg-config", so it can be a program name with args.
++set dummy pkg-config; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if ${ac_cv_path_PKG_CONFIG+:} false; then :
++  $as_echo_n "(cached) " >&6
++else
++  case $PKG_CONFIG in
++  [\\/]* | ?:[\\/]*)
++  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
++  ;;
++  *)
++  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
++  ;;
++esac
++fi
++PKG_CONFIG=$ac_cv_path_PKG_CONFIG
++if test -n "$PKG_CONFIG"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
++$as_echo "$PKG_CONFIG" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
++
++    if test -x "$PKG_CONFIG" && $PKG_CONFIG --exists freetype2 ; then
++
++      FREETYPE2_CFLAGS=`$PKG_CONFIG --cflags freetype2`
++      FREETYPE2_LIBS=`$PKG_CONFIG --libs freetype2`
++      FREETYPE2_VERSION=`$PKG_CONFIG --modversion freetype2`
++
++      { $as_echo "$as_me:${as_lineno-$LINENO}: result: from pkgconfig: version $FREETYPE_VERSON found" >&5
++$as_echo "from pkgconfig: version $FREETYPE_VERSON found" >&6; }
++    else
++
++      for i in $PHP_FREETYPE_DIR /usr/local /usr; do
++        if test -f "$i/bin/freetype-config"; then
++          FREETYPE2_DIR=$i
++          FREETYPE2_CONFIG="$i/bin/freetype-config"
++          break
++        fi
++      done
++
++      if test -z "$FREETYPE2_DIR"; then
++        as_fn_error $? "freetype-config not found." "$LINENO" 5
+       fi
+-    done
+ 
+-    if test -z "$FREETYPE2_DIR"; then
+-      as_fn_error $? "freetype-config not found." "$LINENO" 5
++      FREETYPE2_CFLAGS=`$FREETYPE2_CONFIG --cflags`
++      FREETYPE2_LIBS=`$FREETYPE2_CONFIG --libs`
++      { $as_echo "$as_me:${as_lineno-$LINENO}: result: found via freetype-config" >&5
++$as_echo "found via freetype-config" >&6; }
+     fi
+ 
+-    FREETYPE2_CFLAGS=`$FREETYPE2_CONFIG --cflags`
+-    FREETYPE2_LIBS=`$FREETYPE2_CONFIG --libs`
+-
+ 
+   for ac_i in $FREETYPE2_CFLAGS; do
+     case $ac_i in

diff --git a/dev-lang/php/php-5.6.35-r1.ebuild b/dev-lang/php/php-5.6.35-r1.ebuild
index 8f87fde7f25..e5d5dafb0a8 100644
--- a/dev-lang/php/php-5.6.35-r1.ebuild
+++ b/dev-lang/php/php-5.6.35-r1.ebuild
@@ -232,6 +232,7 @@ php_set_ini_dir() {
 
 src_prepare() {
 	eapply "${FILESDIR}/php-${SLOT}-no-bison-warnings.patch"
+	eapply "${FILESDIR}/php-freetype-2.9.1.patch"
 
 	# Change PHP branding
 	# Get the alpha/beta/rc version

diff --git a/dev-lang/php/php-5.6.36.ebuild b/dev-lang/php/php-5.6.36.ebuild
index 97094f855af..fbcbe63b2d1 100644
--- a/dev-lang/php/php-5.6.36.ebuild
+++ b/dev-lang/php/php-5.6.36.ebuild
@@ -233,6 +233,7 @@ php_set_ini_dir() {
 src_prepare() {
 	eapply "${FILESDIR}/php-${SLOT}-no-bison-warnings.patch"
 	eapply "${FILESDIR}/5.6-mbstring-oniguruma-6.8.patch"
+	eapply "${FILESDIR}/php-freetype-2.9.1.patch"
 
 	# Change PHP branding
 	# Get the alpha/beta/rc version

diff --git a/dev-lang/php/php-7.0.29.ebuild b/dev-lang/php/php-7.0.29.ebuild
index f0c6303f1cb..1ad39e6fafc 100644
--- a/dev-lang/php/php-7.0.29.ebuild
+++ b/dev-lang/php/php-7.0.29.ebuild
@@ -168,6 +168,7 @@ PATCHES=(
 	# hopefully upstream will include the same version check fixes in upcoming releases
 	# patch added 20180429
 	"${FILESDIR}/libressl-compatibility.patch"
+	"${FILESDIR}/php-freetype-2.9.1.patch"
 )
 
 PHP_MV="$(get_major_version)"

diff --git a/dev-lang/php/php-7.0.30.ebuild b/dev-lang/php/php-7.0.30.ebuild
index 8de4204d1c0..5a851d1f41e 100644
--- a/dev-lang/php/php-7.0.30.ebuild
+++ b/dev-lang/php/php-7.0.30.ebuild
@@ -168,6 +168,7 @@ PATCHES=(
 	# hopefully upstream will include the same version check fixes in upcoming releases
 	# patch added 20180429
 	"${FILESDIR}/libressl-compatibility.patch"
+	"${FILESDIR}/php-freetype-2.9.1.patch"
 )
 
 PHP_MV="$(get_major_version)"

diff --git a/dev-lang/php/php-7.1.16.ebuild b/dev-lang/php/php-7.1.16.ebuild
index 0075b8f5bd7..7dbfde0cd8b 100644
--- a/dev-lang/php/php-7.1.16.ebuild
+++ b/dev-lang/php/php-7.1.16.ebuild
@@ -150,6 +150,7 @@ PATCHES=(
 	# hopefully upstream will include the same version check fixes in upcoming releases
 	# patch added 20180429
 	"${FILESDIR}/libressl-compatibility.patch"
+	"${FILESDIR}/php-freetype-2.9.1.patch"
 )
 
 PHP_MV="$(get_major_version)"

diff --git a/dev-lang/php/php-7.1.17.ebuild b/dev-lang/php/php-7.1.17.ebuild
index fcd553f3148..39336570acb 100644
--- a/dev-lang/php/php-7.1.17.ebuild
+++ b/dev-lang/php/php-7.1.17.ebuild
@@ -148,6 +148,7 @@ PATCHES=(
 	# hopefully upstream will include the same version check fixes in upcoming releases
 	# patch added 20180429
 	"${FILESDIR}/libressl-compatibility.patch"
+	"${FILESDIR}/php-freetype-2.9.1.patch"
 )
 
 PHP_MV="$(get_major_version)"

diff --git a/dev-lang/php/php-7.2.5.ebuild b/dev-lang/php/php-7.2.5.ebuild
index 558d91754f3..f781eb4d803 100644
--- a/dev-lang/php/php-7.2.5.ebuild
+++ b/dev-lang/php/php-7.2.5.ebuild
@@ -153,6 +153,7 @@ PATCHES=(
 	# hopefully upstream will include the same version check fixes in upcoming releases
 	# patch added 20180429
 	"${FILESDIR}/libressl-compatibility.patch"
+	"${FILESDIR}/php-freetype-2.9.1.patch"
 )
 
 PHP_MV="$(get_major_version)"


^ permalink raw reply related	[flat|nested] 21+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-lang/php/files/, dev-lang/php/
@ 2018-04-30  0:16 Aaron Bauman
  0 siblings, 0 replies; 21+ messages in thread
From: Aaron Bauman @ 2018-04-30  0:16 UTC (permalink / raw
  To: gentoo-commits

commit:     d8af50b8b4257360017447d012a08ca968a7c2a7
Author:     Aaron Bauman <bman <AT> gentoo <DOT> org>
AuthorDate: Mon Apr 30 00:14:35 2018 +0000
Commit:     Aaron Bauman <bman <AT> gentoo <DOT> org>
CommitDate: Mon Apr 30 00:14:48 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d8af50b8

dev-lang/php: add LibreSSL compatibility patch

This patch fixes building with >=dev-libs/libressl-2.7.x.  Patch taken
from upstream bug https://bugs.php.net/bug.php?id=76174.  Hopefully this
will be included in future releases to properly detect LibreSSL
versions due to API differences.

Closes: https://bugs.gentoo.org/651308
Package-Manager: Portage-2.3.31, Repoman-2.3.9

 dev-lang/php/files/libressl-compatibility.patch | 65 +++++++++++++++++++++++++
 dev-lang/php/php-7.0.29.ebuild                  |  7 ++-
 dev-lang/php/php-7.0.30.ebuild                  |  7 ++-
 dev-lang/php/php-7.1.16.ebuild                  |  7 ++-
 dev-lang/php/php-7.1.17.ebuild                  |  5 ++
 dev-lang/php/php-7.2.5.ebuild                   |  5 ++
 6 files changed, 93 insertions(+), 3 deletions(-)

diff --git a/dev-lang/php/files/libressl-compatibility.patch b/dev-lang/php/files/libressl-compatibility.patch
new file mode 100644
index 00000000000..3b9c39dcc59
--- /dev/null
+++ b/dev-lang/php/files/libressl-compatibility.patch
@@ -0,0 +1,65 @@
+--- a/ext/openssl/openssl.c	2018-04-04 14:26:34.583000000 +0000
++++ b/ext/openssl/openssl.c	2018-04-04 14:20:16.907000000 +0000
+@@ -73,7 +73,7 @@
+ #ifdef HAVE_OPENSSL_MD2_H
+ #define OPENSSL_ALGO_MD2	4
+ #endif
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined (LIBRESSL_VERSION_NUMBER)
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || (defined (LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x20700000L)
+ #define OPENSSL_ALGO_DSS1	5
+ #endif
+ #define OPENSSL_ALGO_SHA224 6
+@@ -560,7 +560,7 @@
+ #endif
+ 
+ /* {{{ OpenSSL compatibility functions and macros */
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined (LIBRESSL_VERSION_NUMBER)
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || (defined (LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x20700000L)
+ #define EVP_PKEY_get0_RSA(_pkey) _pkey->pkey.rsa
+ #define EVP_PKEY_get0_DH(_pkey) _pkey->pkey.dh
+ #define EVP_PKEY_get0_DSA(_pkey) _pkey->pkey.dsa
+@@ -677,7 +677,7 @@
+ 	return M_ASN1_STRING_data(asn1);
+ }
+ 
+-#if OPENSSL_VERSION_NUMBER < 0x10002000L || defined (LIBRESSL_VERSION_NUMBER)
++#if OPENSSL_VERSION_NUMBER < 0x10002000L || (defined (LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x20700000L)
+ 
+ static int X509_get_signature_nid(const X509 *x)
+ {
+@@ -1324,7 +1324,7 @@
+ 			mdtype = (EVP_MD *) EVP_md2();
+ 			break;
+ #endif
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined (LIBRESSL_VERSION_NUMBER)
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || (defined (LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x20700000L)
+ 		case OPENSSL_ALGO_DSS1:
+ 			mdtype = (EVP_MD *) EVP_dss1();
+ 			break;
+@@ -1450,7 +1450,7 @@
+ #ifdef HAVE_OPENSSL_MD2_H
+ 	REGISTER_LONG_CONSTANT("OPENSSL_ALGO_MD2", OPENSSL_ALGO_MD2, CONST_CS|CONST_PERSISTENT);
+ #endif
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined (LIBRESSL_VERSION_NUMBER)
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || (defined (LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x20700000L)
+ 	REGISTER_LONG_CONSTANT("OPENSSL_ALGO_DSS1", OPENSSL_ALGO_DSS1, CONST_CS|CONST_PERSISTENT);
+ #endif
+ 	REGISTER_LONG_CONSTANT("OPENSSL_ALGO_SHA224", OPENSSL_ALGO_SHA224, CONST_CS|CONST_PERSISTENT);
+@@ -3620,7 +3620,7 @@
+ 		RETURN_FALSE;
+ 	}
+ 
+-#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
++#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !(defined (LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x20700000L)
+ 	/* Due to changes in OpenSSL 1.1 related to locking when decoding CSR,
+ 	 * the pub key is not changed after assigning. It means if we pass
+ 	 * a private key, it will be returned including the private part.
+@@ -3631,7 +3631,7 @@
+ 	/* Retrieve the public key from the CSR */
+ 	tpubkey = X509_REQ_get_pubkey(csr);
+ 
+-#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
++#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !(defined (LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x20700000L)
+ 	/* We need to free the CSR as it was duplicated */
+ 	X509_REQ_free(csr);
+ #endif

diff --git a/dev-lang/php/php-7.0.29.ebuild b/dev-lang/php/php-7.0.29.ebuild
index ab385d52c39..f0c6303f1cb 100644
--- a/dev-lang/php/php-7.0.29.ebuild
+++ b/dev-lang/php/php-7.0.29.ebuild
@@ -163,7 +163,12 @@ REQUIRED_USE="
 	mysql? ( || ( mysqli pdo ) )
 "
 
-PATCHES=( "${FILESDIR}/mbstring-oniguruma-6.8.patch" )
+PATCHES=(
+	"${FILESDIR}/mbstring-oniguruma-6.8.patch"
+	# hopefully upstream will include the same version check fixes in upcoming releases
+	# patch added 20180429
+	"${FILESDIR}/libressl-compatibility.patch"
+)
 
 PHP_MV="$(get_major_version)"
 

diff --git a/dev-lang/php/php-7.0.30.ebuild b/dev-lang/php/php-7.0.30.ebuild
index ec866bd84ba..8de4204d1c0 100644
--- a/dev-lang/php/php-7.0.30.ebuild
+++ b/dev-lang/php/php-7.0.30.ebuild
@@ -163,7 +163,12 @@ REQUIRED_USE="
 	mysql? ( || ( mysqli pdo ) )
 "
 
-PATCHES=( "${FILESDIR}/mbstring-oniguruma-6.8.patch" )
+PATCHES=(
+	"${FILESDIR}/mbstring-oniguruma-6.8.patch"
+	# hopefully upstream will include the same version check fixes in upcoming releases
+	# patch added 20180429
+	"${FILESDIR}/libressl-compatibility.patch"
+)
 
 PHP_MV="$(get_major_version)"
 

diff --git a/dev-lang/php/php-7.1.16.ebuild b/dev-lang/php/php-7.1.16.ebuild
index 55fab7c4c96..0075b8f5bd7 100644
--- a/dev-lang/php/php-7.1.16.ebuild
+++ b/dev-lang/php/php-7.1.16.ebuild
@@ -145,7 +145,12 @@ REQUIRED_USE="
 	mysql? ( || ( mysqli pdo ) )
 "
 
-PATCHES=( "${FILESDIR}/mbstring-oniguruma-6.8.patch" )
+PATCHES=(
+	"${FILESDIR}/mbstring-oniguruma-6.8.patch"
+	# hopefully upstream will include the same version check fixes in upcoming releases
+	# patch added 20180429
+	"${FILESDIR}/libressl-compatibility.patch"
+)
 
 PHP_MV="$(get_major_version)"
 

diff --git a/dev-lang/php/php-7.1.17.ebuild b/dev-lang/php/php-7.1.17.ebuild
index 34ff2d2648d..fcd553f3148 100644
--- a/dev-lang/php/php-7.1.17.ebuild
+++ b/dev-lang/php/php-7.1.17.ebuild
@@ -144,6 +144,11 @@ REQUIRED_USE="
 	session-mm? ( session !threads )
 	mysql? ( || ( mysqli pdo ) )
 "
+PATCHES=(
+	# hopefully upstream will include the same version check fixes in upcoming releases
+	# patch added 20180429
+	"${FILESDIR}/libressl-compatibility.patch"
+)
 
 PHP_MV="$(get_major_version)"
 

diff --git a/dev-lang/php/php-7.2.5.ebuild b/dev-lang/php/php-7.2.5.ebuild
index 5407f131e1a..558d91754f3 100644
--- a/dev-lang/php/php-7.2.5.ebuild
+++ b/dev-lang/php/php-7.2.5.ebuild
@@ -149,6 +149,11 @@ REQUIRED_USE="
 	mysql? ( || ( mysqli pdo ) )
 	zip-encryption? ( zip )
 "
+PATCHES=(
+	# hopefully upstream will include the same version check fixes in upcoming releases
+	# patch added 20180429
+	"${FILESDIR}/libressl-compatibility.patch"
+)
 
 PHP_MV="$(get_major_version)"
 


^ permalink raw reply related	[flat|nested] 21+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-lang/php/files/, dev-lang/php/
@ 2018-04-27  2:21 Brian Evans
  0 siblings, 0 replies; 21+ messages in thread
From: Brian Evans @ 2018-04-27  2:21 UTC (permalink / raw
  To: gentoo-commits

commit:     86446552c92ba69dbad23b24a1254cf2fb7666f6
Author:     Brian Evans <grknight <AT> gentoo <DOT> org>
AuthorDate: Fri Apr 27 00:48:05 2018 +0000
Commit:     Brian Evans <grknight <AT> gentoo <DOT> org>
CommitDate: Fri Apr 27 02:21:38 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=86446552

dev-lang/php: Version bump for 5.6.36

Package-Manager: Portage-2.3.31, Repoman-2.3.9

 dev-lang/php/Manifest                              |   1 +
 .../php/files/5.6-mbstring-oniguruma-6.8.patch     |  12 +
 dev-lang/php/php-5.6.36.ebuild                     | 776 +++++++++++++++++++++
 3 files changed, 789 insertions(+)

diff --git a/dev-lang/php/Manifest b/dev-lang/php/Manifest
index 2606ae4b12b..ee4e17e0877 100644
--- a/dev-lang/php/Manifest
+++ b/dev-lang/php/Manifest
@@ -1,6 +1,7 @@
 DIST php-5.6.33.tar.xz 12465256 BLAKE2B a33ce429c1565e6304031304168aa63ce82fa6c0968fc5ef09f5955e43c04ebe112db92475a999f39d997e2a3c9724ece60902ef0db84e2599d97d0e42ce57d2 SHA512 c494721594511f79a103ea3c73c5035aa0fcbca626710a0b85d2395693caf6762edefa3347cd0f8567b186f98c0df7f83cd4c698b158f0f72aa62aabbbb4e297
 DIST php-5.6.34.tar.xz 12465748 BLAKE2B 6b12f52a04d6b645d78f3d00617386a72fafffda24850e10f545464c9d0ca55321e91a292c3eb83409d0a303c4e37c2a686f547d86227c280ec78b428e73a92e SHA512 9aa02f943d6949a28ad96df5e75eec3ecab3731824400d0a0a8ccba9dee95b7af6421b38b86f352a45c778019ebfb1e6161a03256e4ef712341a9e0bad596ae7
 DIST php-5.6.35.tar.xz 12466396 BLAKE2B 96757fc064c139f238329c51741538fdbdefd04abad59c37565e1882a5a7df7d3755cf496561336b25748a968fb18dbf9d542a54a672f553f4be5ead292141cc SHA512 dd7d891954aa7f8e83eecb265e1bb01dfd357092dad0cfc5a3f441bea069f7181cd79330653b178d4953ac1ee8570d7f4c21acc8fc67975dd7dc1413eaebf0af
+DIST php-5.6.36.tar.xz 12467560 BLAKE2B 8badaabc668ff3a4b1129f03605a1570729f8196d2e2539fe85bc42a628f2b24ea76c298b194e8466d9218ae98218243430c8d36d73fbd32b042dd6453510361 SHA512 807c68ab85b6685b19707bd18cfd46f3695b2dc67f9f17f85476634e4a80a036cb413ccae05ed5ba529eafe8df57ebf758dd664ed2942ec44f90a6e8b0172e5e
 DIST php-7.0.27.tar.xz 11916824 BLAKE2B 9d2881a611435b3f9607e04d1f271ca497b8543792608f3690f00aa767fe8cc1f442822ae702076d21df0b56005d7b4e8e88b11ec6dd50d0bc198197b48cafda SHA512 1987ad5573fdcbd5c8d92fdbf5ba8dca6e9621d89d30f66a003338467e31f09f9e8ceb5cdcb2ddf24ec7aa5acf0c8e33c3774e586e7682667eb3ed148237d1bb
 DIST php-7.0.28.tar.xz 11917836 BLAKE2B 8110b0486b0556abf2249d7cbdbd245249f32e230d8197e493edfdf8df38d8eac61b79b90983fa8a2918f67a5d80fefd9a213adff4c3eb760b3844e555614650 SHA512 054c765011d2ad5bb1ef2fd2d66df05f374032015869e69112b309a13b79f437de25e9692719110efbd79f33c677add36430dab21ae12231a7730207c9e877aa
 DIST php-7.0.29.tar.xz 12400192 BLAKE2B 0bd1bd9450b87437e539ec5131cb4f7e4dbf76d5fd5212bdf34c4f022dd8f2d357e9a845d83b485d89469e20675c031bcf382a8ca348161dfd082d7a389ffcb2 SHA512 ea5a2fbcfc875dd2621e3f67038c1e00f43b53bc7079ae2127fcefbf116db0f32e34d4435f8211305402a4eccdaa5dfd6b96cf9416e68700f2c1f438d74a0af8

diff --git a/dev-lang/php/files/5.6-mbstring-oniguruma-6.8.patch b/dev-lang/php/files/5.6-mbstring-oniguruma-6.8.patch
new file mode 100644
index 00000000000..642b261950f
--- /dev/null
+++ b/dev-lang/php/files/5.6-mbstring-oniguruma-6.8.patch
@@ -0,0 +1,12 @@
+diff -aurN a/ext/mbstring/php_mbregex.c b/ext/mbstring/php_mbregex.c
+--- a/ext/mbstring/php_mbregex.c	2018-03-28 17:28:58.000000000 -0400
++++ b/ext/mbstring/php_mbregex.c	2018-04-04 12:53:23.268296387 -0400
+@@ -454,7 +454,7 @@
+ 	OnigUChar err_str[ONIG_MAX_ERROR_MESSAGE_LEN];
+ 
+ 	found = zend_hash_find(&MBREX(ht_rc), (char *)pattern, patlen+1, (void **) &rc);
+-	if (found == FAILURE || (*rc)->options != options || (*rc)->enc != enc || (*rc)->syntax != syntax) {
++	if (found == FAILURE || onig_get_options(*rc) != options || onig_get_encoding(*rc) != enc || onig_get_syntax(*rc) != syntax) {
+ 		if ((err_code = onig_new(&retval, (OnigUChar *)pattern, (OnigUChar *)(pattern + patlen), options, enc, syntax, &err_info)) != ONIG_NORMAL) {
+ 			onig_error_code_to_str(err_str, err_code, &err_info);
+ 			php_error_docref(NULL TSRMLS_CC, E_WARNING, "mbregex compile err: %s", err_str);

diff --git a/dev-lang/php/php-5.6.36.ebuild b/dev-lang/php/php-5.6.36.ebuild
new file mode 100644
index 00000000000..97094f855af
--- /dev/null
+++ b/dev-lang/php/php-5.6.36.ebuild
@@ -0,0 +1,776 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools flag-o-matic versionator systemd
+
+DESCRIPTION="The PHP language runtime engine"
+HOMEPAGE="https://secure.php.net/"
+SRC_URI="https://php.net/distributions/${P}.tar.xz"
+
+LICENSE="PHP-3.01
+	BSD
+	Zend-2.0
+	bcmath? ( LGPL-2.1+ )
+	fpm? ( BSD-2 )
+	gd? ( gd )
+	unicode? ( BSD-2 LGPL-2.1 )"
+
+SLOT="$(get_version_component_range 1-2)"
+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"
+
+# We can build the following SAPIs in the given order
+SAPIS="embed cli cgi fpm apache2"
+
+# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
+IUSE="${IUSE}
+	${SAPIS/cli/+cli}
+	threads"
+
+IUSE="${IUSE} acl bcmath berkdb bzip2 calendar cdb cjk
+	coverage crypt +ctype curl debug
+	enchant exif +fileinfo +filter firebird
+	flatfile ftp gd gdbm gmp +hash +iconv imap inifile
+	intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl
+	mhash mssql mysql libmysqlclient mysqli nls
+	oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
+	readline recode selinux +session sharedmem
+	+simplexml snmp soap sockets spell sqlite ssl
+	sybase-ct sysvipc systemd tidy +tokenizer truetype unicode vpx wddx
+	+xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib"
+
+# The supported (that is, autodetected) versions of BDB are listed in
+# the ./configure script. Other versions *work*, but we need to stick to
+# the ones that can be detected to avoid a repeat of bug #564824.
+COMMON_DEPEND="
+	>=app-eselect/eselect-php-0.9.1[apache2?,fpm?]
+	>=dev-libs/libpcre-8.32[unicode]
+	fpm? ( acl? ( sys-apps/acl ) )
+	apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=]
+		<www-servers/apache-2.4[threads=] ) )
+	berkdb? ( || (	sys-libs/db:5.3
+					sys-libs/db:5.1
+					sys-libs/db:4.8
+					sys-libs/db:4.7
+					sys-libs/db:4.6
+					sys-libs/db:4.5 ) )
+	bzip2? ( app-arch/bzip2:0= )
+	cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
+	cjk? ( !gd? (
+		virtual/jpeg:0
+		media-libs/libpng:0=
+		sys-libs/zlib:0=
+	) )
+	coverage? ( dev-util/lcov )
+	crypt? ( >=dev-libs/libmcrypt-2.4 )
+	curl? ( >=net-misc/curl-7.10.5 )
+	enchant? ( app-text/enchant )
+	exif? ( !gd? (
+		virtual/jpeg:0
+		media-libs/libpng:0=
+		sys-libs/zlib:0=
+	) )
+	firebird? ( dev-db/firebird )
+	gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib:0= )
+	gdbm? ( >=sys-libs/gdbm-1.8.0:0= )
+	gmp? ( dev-libs/gmp:0= )
+	iconv? ( virtual/libiconv )
+	imap? ( virtual/imap-c-client[kerberos=,ssl=] )
+	intl? ( dev-libs/icu:= )
+	iodbc? ( dev-db/libiodbc )
+	kerberos? ( virtual/krb5 )
+	ldap? ( >=net-nds/openldap-1.2.11 )
+	ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 )
+	libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) )
+	mssql? ( dev-db/freetds[mssql] )
+	libmysqlclient? (
+		mysql? ( virtual/libmysqlclient:= )
+		mysqli? ( virtual/libmysqlclient:= )
+	)
+	nls? ( sys-devel/gettext )
+	oci8-instant-client? ( dev-db/oracle-instantclient-basic )
+	odbc? ( >=dev-db/unixODBC-1.8.13 )
+	postgres? ( dev-db/postgresql:* )
+	qdbm? ( dev-db/qdbm )
+	readline? ( sys-libs/readline:0= )
+	recode? ( app-text/recode )
+	sharedmem? ( dev-libs/mm )
+	simplexml? ( >=dev-libs/libxml2-2.6.8 )
+	snmp? ( >=net-analyzer/net-snmp-5.2 )
+	soap? ( >=dev-libs/libxml2-2.6.8 )
+	spell? ( >=app-text/aspell-0.50 )
+	sqlite? ( >=dev-db/sqlite-3.7.6.3 )
+	ssl? (
+		!libressl? ( dev-libs/openssl:0= )
+		libressl? ( dev-libs/libressl:0= )
+	)
+	sybase-ct? ( dev-db/freetds )
+	tidy? ( app-text/htmltidy )
+	truetype? (
+		=media-libs/freetype-2*
+		>=media-libs/t1lib-5.0.0
+		!gd? (
+			virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib:0= )
+	)
+	unicode? ( dev-libs/oniguruma:= )
+	vpx? ( media-libs/libvpx:0= )
+	wddx? ( >=dev-libs/libxml2-2.6.8 )
+	xml? ( >=dev-libs/libxml2-2.6.8 )
+	xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
+	xmlreader? ( >=dev-libs/libxml2-2.6.8 )
+	xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
+	xpm? (
+		x11-libs/libXpm
+		virtual/jpeg:0
+		media-libs/libpng:0= sys-libs/zlib:0=
+	)
+	xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
+	zip? ( sys-libs/zlib:0= )
+	zlib? ( sys-libs/zlib:0= )
+"
+
+RDEPEND="${COMMON_DEPEND}
+	virtual/mta
+	fpm? (
+		selinux? ( sec-policy/selinux-phpfpm )
+		systemd? ( sys-apps/systemd ) )"
+
+DEPEND="${COMMON_DEPEND}
+	app-arch/xz-utils
+	>=sys-devel/bison-3.0.1
+	sys-devel/flex
+	>=sys-devel/m4-1.4.3
+	>=sys-devel/libtool-1.5.18"
+
+# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
+REQUIRED_USE="
+	|| ( cli cgi fpm apache2 embed )
+	cli? ( ^^ ( readline libedit ) )
+	truetype? ( gd )
+	vpx? ( gd )
+	cjk? ( gd )
+	exif? ( gd )
+	xpm? ( gd )
+	gd? ( zlib )
+	simplexml? ( xml )
+	soap? ( xml )
+	wddx? ( xml )
+	xmlrpc? ( || ( xml iconv ) )
+	xmlreader? ( xml )
+	xslt? ( xml )
+	ldap-sasl? ( ldap )
+	mhash? ( hash )
+	phar? ( hash )
+	recode? ( !imap !mysql !mysqli !libmysqlclient )
+	libmysqlclient? ( || (
+		mysql
+		mysqli
+		pdo
+	) )
+
+	qdbm? ( !gdbm )
+	readline? ( !libedit )
+	sharedmem? ( !threads )
+"
+
+PHP_MV="$(get_major_version)"
+
+php_install_ini() {
+	local phpsapi="${1}"
+
+	# work out where we are installing the ini file
+	php_set_ini_dir "${phpsapi}"
+
+	# Always install the production INI file, bug 611214.
+	local phpinisrc="php.ini-production-${phpsapi}"
+	cp php.ini-production "${phpinisrc}" || die
+
+	# default to /tmp for save_path, bug #282768
+	sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die
+
+	# Set the extension dir
+	sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \
+		-i "${phpinisrc}" || die
+
+	# Set the include path to point to where we want to find PEAR packages
+	sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die
+
+	dodir "${PHP_INI_DIR#${EPREFIX}}"
+	insinto "${PHP_INI_DIR#${EPREFIX}}"
+	newins "${phpinisrc}" php.ini
+
+	elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}"
+	elog
+
+	dodir "${PHP_EXT_INI_DIR#${EPREFIX}}"
+	dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}"
+
+	if use opcache; then
+		elog "Adding opcache to $PHP_EXT_INI_DIR"
+		echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \
+			 "${D}/${PHP_EXT_INI_DIR}"/opcache.ini
+		dosym "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" \
+			  "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini"
+	fi
+
+	# SAPI-specific handling
+	if [[ "${sapi}" == "fpm" ]] ; then
+		einfo "Installing FPM config file php-fpm.conf"
+		insinto "${PHP_INI_DIR#${EPREFIX}}"
+		doins sapi/fpm/php-fpm.conf
+	fi
+
+	dodoc php.ini-{development,production}
+}
+
+php_set_ini_dir() {
+	PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}"
+	PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
+	PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
+}
+
+src_prepare() {
+	eapply "${FILESDIR}/php-${SLOT}-no-bison-warnings.patch"
+	eapply "${FILESDIR}/5.6-mbstring-oniguruma-6.8.patch"
+
+	# Change PHP branding
+	# Get the alpha/beta/rc version
+	sed -re	"s|^(PHP_EXTRA_VERSION=\").*(\")|\1-pl${PR/r/}-gentoo\2|g" \
+		-i configure.in || die "Unable to change PHP branding"
+
+	# Patch PHP to show Gentoo as the server platform
+	sed -e 's/PHP_UNAME=`uname -a | xargs`/PHP_UNAME=`uname -s -n -r -v | xargs`/g' \
+		-i configure.in || die "Failed to fix server platform name"
+
+	# Prevent PHP from activating the Apache config,
+	# as we will do that ourselves
+	sed -i \
+		-e "s,-i -a -n php${PHP_MV},-i -n php${PHP_MV},g" \
+		-e "s,-i -A -n php${PHP_MV},-i -n php${PHP_MV},g" \
+		configure sapi/apache2filter/config.m4 sapi/apache2handler/config.m4 \
+		|| die
+
+	# Patch PHP to support heimdal instead of mit-krb5
+	if has_version "app-crypt/heimdal" ; then
+		sed -e 's|gssapi_krb5|gssapi|g' -i acinclude.m4 \
+			|| die "Failed to fix heimdal libname"
+		sed -e 's|PHP_ADD_LIBRARY(k5crypto, 1, $1)||g' -i acinclude.m4 \
+			|| die "Failed to fix heimdal crypt library reference"
+	fi
+
+	eapply_user
+
+	# Force rebuilding aclocal.m4
+	rm -f aclocal.m4 || die "failed to remove aclocal.m4 in src_prepare"
+	eautoreconf
+
+	if [[ ${CHOST} == *-darwin* ]] ; then
+		# http://bugs.php.net/bug.php?id=48795, bug #343481
+		sed -i -e '/BUILD_CGI="\\$(CC)/s/CC/CXX/' configure || die
+	fi
+}
+
+src_configure() {
+	addpredict /usr/share/snmp/mibs/.index
+	addpredict /var/lib/net-snmp/mib_indexes
+
+	PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
+
+	# The php-fpm config file wants localstatedir to be ${EPREFIX}/var
+	# and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002.
+	local our_conf=(
+		--prefix="${PHP_DESTDIR}"
+		--mandir="${PHP_DESTDIR}/man"
+		--infodir="${PHP_DESTDIR}/info"
+		--libdir="${PHP_DESTDIR}/lib"
+		--with-libdir="$(get_libdir)"
+		--localstatedir="${EPREFIX}/var"
+		--without-pear
+		$(use_enable threads maintainer-zts)
+	)
+
+	our_conf+=(
+		$(use_enable bcmath bcmath)
+		$(use_with bzip2 bz2 "${EPREFIX}/usr")
+		$(use_enable calendar calendar)
+		$(use_enable coverage gcov)
+		$(use_enable ctype ctype)
+		$(use_with curl curl "${EPREFIX}/usr")
+		$(use_enable xml dom)
+		$(use_with enchant enchant "${EPREFIX}/usr")
+		$(use_enable exif exif)
+		$(use_enable fileinfo fileinfo)
+		$(use_enable filter filter)
+		$(use_enable ftp ftp)
+		$(use_with nls gettext "${EPREFIX}/usr")
+		$(use_with gmp gmp "${EPREFIX}/usr")
+		$(use_enable hash hash)
+		$(use_with mhash mhash "${EPREFIX}/usr")
+		$(use_with iconv iconv \
+			$(use elibc_glibc || use elibc_musl || use elibc_FreeBSD || echo "${EPREFIX}/usr"))
+		$(use_enable intl intl)
+		$(use_enable ipv6 ipv6)
+		$(use_enable json json)
+		$(use_with kerberos kerberos "${EPREFIX}/usr")
+		$(use_enable xml libxml)
+		$(use_with xml libxml-dir "${EPREFIX}/usr")
+		$(use_enable unicode mbstring)
+		$(use_with crypt mcrypt "${EPREFIX}/usr")
+		$(use_with mssql mssql "${EPREFIX}/usr")
+		$(use_with unicode onig "${EPREFIX}/usr")
+		$(use_with ssl openssl "${EPREFIX}/usr")
+		$(use_with ssl openssl-dir "${EPREFIX}/usr")
+		$(use_enable pcntl pcntl)
+		$(use_enable phar phar)
+		$(use_enable pdo pdo)
+		$(use_enable opcache opcache)
+		$(use_with postgres pgsql "${EPREFIX}/usr")
+		$(use_enable posix posix)
+		$(use_with spell pspell "${EPREFIX}/usr")
+		$(use_with recode recode "${EPREFIX}/usr")
+		$(use_enable simplexml simplexml)
+		$(use_enable sharedmem shmop)
+		$(use_with snmp snmp "${EPREFIX}/usr")
+		$(use_enable soap soap)
+		$(use_enable sockets sockets)
+		$(use_with sqlite sqlite3 "${EPREFIX}/usr")
+		$(use_with sybase-ct sybase-ct "${EPREFIX}/usr")
+		$(use_enable sysvipc sysvmsg)
+		$(use_enable sysvipc sysvsem)
+		$(use_enable sysvipc sysvshm)
+		$(use_with tidy tidy "${EPREFIX}/usr")
+		$(use_enable tokenizer tokenizer)
+		$(use_enable wddx wddx)
+		$(use_enable xml xml)
+		$(use_enable xmlreader xmlreader)
+		$(use_enable xmlwriter xmlwriter)
+		$(use_with xmlrpc xmlrpc)
+		$(use_with xslt xsl "${EPREFIX}/usr")
+		$(use_enable zip zip)
+		$(use_with zlib zlib "${EPREFIX}/usr")
+		$(use_enable debug debug)
+	)
+
+	# DBA support
+	if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
+		|| use qdbm ; then
+		our_conf+=( "--enable-dba${shared}" )
+	fi
+
+	# DBA drivers support
+	our_conf+=(
+		$(use_with cdb cdb)
+		$(use_with berkdb db4 "${EPREFIX}/usr")
+		$(use_enable flatfile flatfile)
+		$(use_with gdbm gdbm "${EPREFIX}/usr")
+		$(use_enable inifile inifile)
+		$(use_with qdbm qdbm "${EPREFIX}/usr")
+	)
+
+	# Support for the GD graphics library
+	our_conf+=(
+		$(use_with truetype freetype-dir "${EPREFIX}/usr")
+		$(use_with truetype t1lib "${EPREFIX}/usr")
+		$(use_enable cjk gd-jis-conv)
+		$(use_with gd jpeg-dir "${EPREFIX}/usr")
+		$(use_with gd png-dir "${EPREFIX}/usr")
+		$(use_with xpm xpm-dir "${EPREFIX}/usr")
+		$(use_with vpx vpx-dir "${EPREFIX}/usr")
+	)
+	# enable gd last, so configure can pick up the previous settings
+	our_conf+=( $(use_with gd gd) )
+
+	# IMAP support
+	if use imap ; then
+		our_conf+=(
+			$(use_with imap imap "${EPREFIX}/usr")
+			$(use_with ssl imap-ssl "${EPREFIX}/usr")
+		)
+	fi
+
+	# Interbase/firebird support
+	our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") )
+
+	# LDAP support
+	if use ldap ; then
+		our_conf+=(
+			$(use_with ldap ldap "${EPREFIX}/usr")
+			$(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr")
+		)
+	fi
+
+	# MySQL support
+	local mysqllib="mysqlnd"
+	local mysqlilib="mysqlnd"
+	use libmysqlclient && mysqllib="${EPREFIX}/usr"
+	use libmysqlclient && mysqlilib="${EPREFIX}/usr/bin/mysql_config"
+
+	our_conf+=( $(use_with mysql mysql "${mysqllib}") )
+	our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
+
+	local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock"
+	if use mysql || use mysqli ; then
+		our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") )
+	fi
+
+	# ODBC support
+	our_conf+=(
+		$(use_with odbc unixODBC "${EPREFIX}/usr")
+		$(use_with iodbc iodbc "${EPREFIX}/usr")
+	)
+
+	# Oracle support
+	our_conf+=( $(use_with oci8-instant-client oci8) )
+
+	# PDO support
+	if use pdo ; then
+		our_conf+=(
+			$(use_with mssql pdo-dblib)
+			$(use_with mysql pdo-mysql "${mysqllib}")
+			$(use_with postgres pdo-pgsql)
+			$(use_with sqlite pdo-sqlite "${EPREFIX}/usr")
+			$(use_with firebird pdo-firebird "${EPREFIX}/usr")
+			$(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr")
+			$(use_with oci8-instant-client pdo-oci)
+		)
+	fi
+
+	# readline/libedit support
+	our_conf+=(
+		$(use_with readline readline "${EPREFIX}/usr")
+		$(use_with libedit libedit "${EPREFIX}/usr")
+	)
+
+	# Session support
+	if use session ; then
+		our_conf+=( $(use_with sharedmem mm "${EPREFIX}/usr") )
+	else
+		our_conf+=( $(use_enable session session) )
+	fi
+
+	# Use pic for shared modules such as apache2's mod_php
+	our_conf+=( --with-pic )
+
+	# we use the system copy of pcre
+	# --with-pcre-regex affects ext/pcre
+	# --with-pcre-dir affects ext/filter and ext/zip
+	our_conf+=(
+		--with-pcre-regex="${EPREFIX}/usr"
+		--with-pcre-dir="${EPREFIX}/usr"
+	)
+
+	# Catch CFLAGS problems
+	# Fixes bug #14067.
+	# Changed order to run it in reverse for bug #32022 and #12021.
+	replace-cpu-flags "k6*" "i586"
+
+	# Cache the ./configure test results between SAPIs.
+	our_conf+=( --cache-file="${T}/config.cache" )
+
+	# Support user-passed configuration parameters
+	our_conf+=( ${EXTRA_ECONF:-} )
+
+	# Support the Apache2 extras, they must be set globally for all
+	# SAPIs to work correctly, especially for external PHP extensions
+
+	mkdir -p "${WORKDIR}/sapis-build" || die
+	for one_sapi in $SAPIS ; do
+		use "${one_sapi}" || continue
+		php_set_ini_dir "${one_sapi}"
+
+		# The BUILD_DIR variable is used to determine where to output
+		# the files that autotools creates. This was all originally
+		# based on the autotools-utils eclass.
+		BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}"
+		cp -a "${S}" "${BUILD_DIR}" || die
+		cd "${BUILD_DIR}" || die
+
+		local sapi_conf=(
+			--with-config-file-path="${PHP_INI_DIR}"
+			--with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}"
+		)
+
+		for sapi in $SAPIS ; do
+			case "$sapi" in
+				cli|cgi|embed|fpm)
+					if [[ "${one_sapi}" == "${sapi}" ]] ; then
+						sapi_conf+=( "--enable-${sapi}" )
+						if [[ "fpm" == "${sapi}" ]] ; then
+							sapi_conf+=(
+								$(use_with acl fpm-acl)
+								$(use_with systemd fpm-systemd)
+							)
+						fi
+					else
+						sapi_conf+=( "--disable-${sapi}" )
+					fi
+					;;
+
+				apache2)
+					if [[ "${one_sapi}" == "${sapi}" ]] ; then
+						sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" )
+					else
+						sapi_conf+=( --without-apxs2 )
+					fi
+					;;
+			esac
+		done
+
+		# Construct the $myeconfargs array by concatenating $our_conf
+		# (the common args) and $sapi_conf (the SAPI-specific args).
+		local myeconfargs=( "${our_conf[@]}" )
+		myeconfargs+=( "${sapi_conf[@]}" )
+
+		pushd "${BUILD_DIR}" > /dev/null || die
+		econf "${myeconfargs[@]}"
+		popd > /dev/null || die
+	done
+}
+
+src_compile() {
+	# snmp seems to run during src_compile, too (bug #324739)
+	addpredict /usr/share/snmp/mibs/.index
+	addpredict /var/lib/net-snmp/mib_indexes
+
+	for sapi in ${SAPIS} ; do
+		if use "${sapi}"; then
+			cd "${WORKDIR}/sapis-build/$sapi" || \
+				die "Failed to change dir to ${WORKDIR}/sapis-build/$1"
+			emake
+		fi
+	done
+}
+
+src_install() {
+	# see bug #324739 for what happens when we don't have that
+	addpredict /usr/share/snmp/mibs/.index
+
+	# grab the first SAPI that got built and install common files from there
+	local first_sapi=""
+	for sapi in $SAPIS ; do
+		if use $sapi ; then
+			first_sapi=$sapi
+			break
+		fi
+	done
+
+	# Makefile forgets to create this before trying to write to it...
+	dodir "${PHP_DESTDIR#${EPREFIX}}/bin"
+
+	# Install php environment (without any sapis)
+	cd "${WORKDIR}/sapis-build/$first_sapi" || die
+	emake INSTALL_ROOT="${D}" \
+		install-build install-headers install-programs
+
+	local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)"
+
+	# Create the directory where we'll put version-specific php scripts
+	keepdir "/usr/share/php${PHP_MV}"
+
+	local sapi="", file=""
+	local sapi_list=""
+
+	for sapi in ${SAPIS}; do
+		if use "${sapi}" ; then
+			einfo "Installing SAPI: ${sapi}"
+			cd "${WORKDIR}/sapis-build/${sapi}" || die
+
+			if [[ "${sapi}" == "apache2" ]] ; then
+				# We're specifically not using emake install-sapi as libtool
+				# may cause unnecessary relink failures (see bug #351266)
+				insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/"
+				newins ".libs/libphp5$(get_libname)" \
+					   "libphp${PHP_MV}$(get_libname)"
+				keepdir "/usr/$(get_libdir)/apache2/modules"
+			else
+				# needed each time, php_install_ini would reset it
+				local dest="${PHP_DESTDIR#${EPREFIX}}"
+				into "${dest}"
+				case "$sapi" in
+					cli)
+						source="sapi/cli/php"
+						;;
+					cgi)
+						source="sapi/cgi/php-cgi"
+						;;
+					fpm)
+						source="sapi/fpm/php-fpm"
+						;;
+					embed)
+						source="libs/libphp${PHP_MV}$(get_libname)"
+						;;
+					*)
+						die "unhandled sapi in src_install"
+						;;
+				esac
+
+				if [[ "${source}" == *"$(get_libname)" ]]; then
+					dolib.so "${source}"
+				else
+					dobin "${source}"
+					local name="$(basename ${source})"
+					dosym "${dest}/bin/${name}" "/usr/bin/${name}${SLOT}"
+				fi
+			fi
+
+			php_install_ini "${sapi}"
+
+			# construct correct SAPI string for php-config
+			# thanks to ferringb for the bash voodoo
+			if [[ "${sapi}" == "apache2" ]]; then
+				sapi_list="${sapi_list:+${sapi_list} }apache2handler"
+			else
+				sapi_list="${sapi_list:+${sapi_list} }${sapi}"
+			fi
+		fi
+	done
+
+	# Installing opcache module
+	if use opcache ; then
+		into "${PHP_DESTDIR#${EPREFIX}}"
+		dolib.so "modules/opcache$(get_libname)"
+	fi
+
+	# Install env.d files
+	newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}"
+	sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
+	sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
+
+	# set php-config variable correctly (bug #278439)
+	sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \
+		"${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die
+
+	if use fpm ; then
+		if use systemd; then
+			systemd_newunit "${FILESDIR}/php-fpm_at.service" \
+							"php-fpm@${SLOT}.service"
+		else
+			systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \
+							"php-fpm@${SLOT}.service"
+		fi
+	fi
+}
+
+src_test() {
+	echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
+	PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
+	if [[ ! -x "${PHP_BIN}" ]] ; then
+		ewarn "Test phase requires USE=cli, skipping"
+		return
+	else
+		export TEST_PHP_EXECUTABLE="${PHP_BIN}"
+	fi
+
+	if [[ -x "${WORKDIR}/sapis/cgi/php-cgi" ]] ; then
+		export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis/cgi/php-cgi"
+	fi
+
+	REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n  -d \
+					  "session.save_path=${T}" \
+					  "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \
+					  "session.save_path=${T}"
+
+	for name in ${EXPECTED_TEST_FAILURES}; do
+		mv "${name}.out" "${name}.out.orig" 2>/dev/null || die
+	done
+
+	local failed="$(find -name '*.out')"
+	if [[ ${failed} != "" ]] ; then
+		ewarn "The following test cases failed unexpectedly:"
+		for name in ${failed}; do
+			ewarn "  ${name/.out/}"
+		done
+	else
+		einfo "No unexpected test failures, all fine"
+	fi
+
+	if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
+		local passed=""
+		for name in ${EXPECTED_TEST_FAILURES}; do
+			[[ -f "${name}.diff" ]] && continue
+			passed="${passed} ${name}"
+		done
+		if [[ ${passed} != "" ]] ; then
+			einfo "The following test cases passed unexpectedly:"
+			for name in ${passed}; do
+				ewarn "  ${passed}"
+			done
+		else
+			einfo "None of the known-to-fail tests passed, all fine"
+		fi
+	fi
+}
+
+pkg_postinst() {
+	# Output some general info to the user
+	if use apache2 ; then
+		elog
+		elog "To enable PHP in apache, you will need to add \"-D PHP\" to"
+		elog "your apache2 command. OpenRC users can append that string to"
+		elog "APACHE2_OPTS in /etc/conf.d/apache2."
+		elog
+		elog "The apache module configuration file 70_mod_php.conf is"
+		elog "provided (and maintained) by eselect-php."
+		elog
+	fi
+
+	# Create the symlinks for php
+	for m in ${SAPIS}; do
+		[[ ${m} == 'embed' ]] && continue;
+		if use $m ; then
+			local ci=$(eselect php show $m)
+			if [[ -z $ci ]]; then
+				eselect php set $m php${SLOT} || die
+				einfo "Switched ${m} to use php:${SLOT}"
+				einfo
+			elif [[ $ci != "php${SLOT}" ]] ; then
+				elog "To switch $m to use php:${SLOT}, run"
+				elog "    eselect php set $m php${SLOT}"
+				elog
+			fi
+		fi
+	done
+
+	# Remove dead symlinks for SAPIs that were just disabled. For
+	# example, if the user has the cgi SAPI enabled, then he has an
+	# eselect-php symlink for it. If he later reinstalls PHP with
+	# USE="-cgi", that symlink will break. This call to eselect is
+	# supposed to remove that dead link per bug 572436.
+	eselect php cleanup || die
+
+	if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then
+	   elog "To build extensions for this version of PHP, you will need to"
+	   elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable."
+	   elog
+	fi
+
+	# Warn about the removal of PHP_INI_VERSION if the user has it set.
+	if [[ -n "${PHP_INI_VERSION}" ]]; then
+		ewarn 'The PHP_INI_VERSION variable has been phased out. You may'
+		ewarn 'remove it from your configuration at your convenience. See'
+		ewarn
+		ewarn '  https://bugs.gentoo.org/611214'
+		ewarn
+		ewarn 'for more information.'
+	fi
+
+	elog "For details on how version slotting works, please see"
+	elog "the wiki:"
+	elog
+	elog "  https://wiki.gentoo.org/wiki/PHP"
+	elog
+}
+
+pkg_postrm() {
+	# This serves two purposes. First, if we have just removed the last
+	# installed version of PHP, then this will remove any dead symlinks
+	# belonging to eselect-php. Second, if a user upgrades slots from
+	# (say) 5.6 to 7.0 and depcleans the old slot, then this will update
+	# his existing symlinks to point to the new 7.0 installation. The
+	# latter is bug 432962.
+	#
+	# Note: the eselect-php package may not be installed at this point,
+	# so we can't die() if this command fails.
+	eselect php cleanup
+}


^ permalink raw reply related	[flat|nested] 21+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-lang/php/files/, dev-lang/php/
@ 2016-09-30 15:07 Michael Orlitzky
  0 siblings, 0 replies; 21+ messages in thread
From: Michael Orlitzky @ 2016-09-30 15:07 UTC (permalink / raw
  To: gentoo-commits

commit:     523dcfa9e646dacf81f8e43bb9f1262bff211473
Author:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
AuthorDate: Fri Sep 30 14:22:37 2016 +0000
Commit:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
CommitDate: Fri Sep 30 15:05:12 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=523dcfa9

dev-lang/php: new 5.6 and 7.0 revisions with bison dependencies.

The PHP build system checks for the presence of bison (even if it will
not be needed), and it emits a warning if an appropriate version is
not found. In the 7.0.x series, this is easy to address by simply
adding a newish version of bison to DEPEND.

In the 5.6.x series, however, there is a bug in the bison version
check. A warning is emitted even when a suitable version of bison
(>= 3.0.1) is present on the system. So in that series, we have added
>=sys-devel/bison-3.0.1 to DEPEND, but also added a new patch. The
patch disables the buggy bison version check, eliminating the
warning. There should be no danger in doing so now that a newer bison
is in DEPEND.

Gentoo-Bug: 593278

Package-Manager: portage-2.3.0

 dev-lang/php/files/php-5.6-no-bison-warnings.patch | 42 ++++++++++++
 .../{php-7.0.11.ebuild => php-5.6.26-r1.ebuild}    | 76 ++++++++++++----------
 .../{php-7.0.11.ebuild => php-7.0.11-r1.ebuild}    |  1 +
 3 files changed, 86 insertions(+), 33 deletions(-)

diff --git a/dev-lang/php/files/php-5.6-no-bison-warnings.patch b/dev-lang/php/files/php-5.6-no-bison-warnings.patch
new file mode 100644
index 00000000..1896659
--- /dev/null
+++ b/dev-lang/php/files/php-5.6-no-bison-warnings.patch
@@ -0,0 +1,42 @@
+From d3466a04345b31dfc62d94fe994b40321a6418ec Mon Sep 17 00:00:00 2001
+From: Michael Orlitzky <michael@orlitzky.com>
+Date: Thu, 29 Sep 2016 15:43:06 -0400
+Subject: [PATCH 1/1] Zend/acinclude.m4: don't warn about >=bison-3.0.1
+ versions.
+
+The PHP configure script will emit a warning if it thinks your bison
+version is insufficient:
+
+  WARNING: This bison version is not supported for regeneration of
+  the Zend/PHP parsers (found: 3.0, min: 204, excluded: 3.0).
+
+However, there is an error in the test that causes it to treat all
+3.0.x versions as if they were 3.0. The result is that users get
+warned about a perfectly acceptable version of bison.
+
+This patch is meant only for Gentoo, where we can require a working
+version of bison (something newer than 3.0.1). Having done so, this
+patch removes the check and the WARNING.
+
+Gentoo-Bug: 593278
+PHP-Bug: 69055
+---
+ Zend/acinclude.m4 | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Zend/acinclude.m4 b/Zend/acinclude.m4
+index 7fa8c99..9d6cb1d 100644
+--- a/Zend/acinclude.m4
++++ b/Zend/acinclude.m4
+@@ -9,7 +9,7 @@ AC_DEFUN([LIBZEND_BISON_CHECK],[
+   # non-working versions, e.g. "3.0 3.2";
+   # remove "none" when introducing the first incompatible bison version an 
+   # separate any following additions by spaces
+-  bison_version_exclude="3.0"
++  bison_version_exclude=""
+ 
+   # for standalone build of Zend Engine
+   test -z "$SED" && SED=sed
+-- 
+2.7.3
+

diff --git a/dev-lang/php/php-7.0.11.ebuild b/dev-lang/php/php-5.6.26-r1.ebuild
similarity index 93%
copy from dev-lang/php/php-7.0.11.ebuild
copy to dev-lang/php/php-5.6.26-r1.ebuild
index 71c2ec4..420cbd7 100644
--- a/dev-lang/php/php-7.0.11.ebuild
+++ b/dev-lang/php/php-5.6.26-r1.ebuild
@@ -14,7 +14,7 @@ SLOT="$(get_version_component_range 1-2)"
 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
 
 # We can build the following SAPIs in the given order
-SAPIS="embed cli cgi fpm apache2 phpdbg"
+SAPIS="embed cli cgi fpm apache2"
 
 # SAPIs and SAPI-specific USE flags (cli SAPI is default on):
 IUSE="${IUSE}
@@ -26,11 +26,11 @@ IUSE="${IUSE} bcmath berkdb bzip2 calendar cdb cjk
 	enchant exif frontbase +fileinfo +filter firebird
 	flatfile ftp gd gdbm gmp +hash +iconv imap inifile
 	intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl
-	mhash mssql mysql mysqli nls
+	mhash mssql mysql libmysqlclient mysqli nls
 	oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
 	readline recode selinux +session sharedmem
 	+simplexml snmp soap sockets spell sqlite ssl
-	sysvipc systemd tidy +tokenizer truetype unicode wddx webp
+	sybase-ct sysvipc systemd tidy +tokenizer truetype unicode vpx wddx
 	+xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib"
 
 # The supported (that is, autodetected) versions of BDB are listed in
@@ -75,6 +75,10 @@ COMMON_DEPEND="
 	ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 )
 	libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) )
 	mssql? ( dev-db/freetds[mssql] )
+	libmysqlclient? (
+		mysql? ( virtual/libmysqlclient:= )
+		mysqli? ( virtual/libmysqlclient:= )
+	)
 	nls? ( sys-devel/gettext )
 	oci8-instant-client? ( dev-db/oracle-instantclient-basic )
 	odbc? ( >=dev-db/unixODBC-1.8.13 )
@@ -89,18 +93,20 @@ COMMON_DEPEND="
 	spell? ( >=app-text/aspell-0.50 )
 	sqlite? ( >=dev-db/sqlite-3.7.6.3 )
 	ssl? (
-		!libressl? ( dev-libs/openssl:0 )
+		!libressl? ( dev-libs/openssl:0= )
 		libressl? ( dev-libs/libressl )
 	)
+	sybase-ct? ( dev-db/freetds )
 	tidy? ( app-text/htmltidy )
 	truetype? (
 		=media-libs/freetype-2*
+		>=media-libs/t1lib-5.0.0
 		!gd? (
 			virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib )
 	)
 	unicode? ( dev-libs/oniguruma )
+	vpx? ( media-libs/libvpx )
 	wddx? ( >=dev-libs/libxml2-2.6.8 )
-	webp? ( media-libs/libwebp )
 	xml? ( >=dev-libs/libxml2-2.6.8 )
 	xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
 	xmlreader? ( >=dev-libs/libxml2-2.6.8 )
@@ -123,6 +129,7 @@ RDEPEND="${COMMON_DEPEND}
 
 DEPEND="${COMMON_DEPEND}
 	app-arch/xz-utils
+	>=sys-devel/bison-3.0.1
 	sys-devel/flex
 	>=sys-devel/m4-1.4.3
 	>=sys-devel/libtool-1.5.18"
@@ -131,9 +138,10 @@ DEPEND="${COMMON_DEPEND}
 REQUIRED_USE="
 	cli? ( ^^ ( readline libedit ) )
 	truetype? ( gd )
-	webp? ( gd )
+	vpx? ( gd )
 	cjk? ( gd )
 	exif? ( gd )
+
 	xpm? ( gd )
 	gd? ( zlib )
 	simplexml? ( xml )
@@ -145,12 +153,18 @@ REQUIRED_USE="
 	ldap-sasl? ( ldap )
 	mhash? ( hash )
 	phar? ( hash )
+	libmysqlclient? ( || (
+		mysql
+		mysqli
+		pdo
+	) )
+
 	qdbm? ( !gdbm )
 	readline? ( !libedit )
-	recode? ( !imap !mysqli )
+	recode? ( !imap !mysql !mysqli )
 	sharedmem? ( !threads )
-	mysql? ( || ( mysqli pdo ) )
-	|| ( cli cgi fpm apache2 embed phpdbg )"
+
+	!cli? ( !cgi? ( !fpm? ( !apache2? ( !embed? ( cli ) ) ) ) )"
 
 PHP_MV="$(get_major_version)"
 
@@ -199,11 +213,9 @@ php_install_ini() {
 
 	# SAPI-specific handling
 	if [[ "${sapi}" == "fpm" ]] ; then
-		einfo "Installing FPM config files php-fpm.conf and www.conf"
+		einfo "Installing FPM config file php-fpm.conf"
 		insinto "${PHP_INI_DIR#${EPREFIX}}"
 		doins sapi/fpm/php-fpm.conf
-		insinto "${PHP_INI_DIR#${EPREFIX}}/fpm.d"
-		doins sapi/fpm/www.conf
 	fi
 
 	dodoc php.ini-development
@@ -217,8 +229,7 @@ php_set_ini_dir() {
 }
 
 src_prepare() {
-	# Disable some assembly on x86.
-	eapply "${FILESDIR}/fix-x86-build-bug_571658.patch"
+	eapply "${FILESDIR}/php-${SLOT}-no-bison-warnings.patch"
 
 	# Change PHP branding
 	# Get the alpha/beta/rc version
@@ -229,6 +240,14 @@ src_prepare() {
 	sed -e 's/PHP_UNAME=`uname -a | xargs`/PHP_UNAME=`uname -s -n -r -v | xargs`/g' \
 		-i configure.in || die "Failed to fix server platform name"
 
+	# Prevent PHP from activating the Apache config,
+	# as we will do that ourselves
+	sed -i \
+		-e "s,-i -a -n php${PHP_MV},-i -n php${PHP_MV},g" \
+		-e "s,-i -A -n php${PHP_MV},-i -n php${PHP_MV},g" \
+		configure sapi/apache2filter/config.m4 sapi/apache2handler/config.m4 \
+		|| die
+
 	# Patch PHP to support heimdal instead of mit-krb5
 	if has_version "app-crypt/heimdal" ; then
 		sed -e 's|gssapi_krb5|gssapi|g' -i acinclude.m4 \
@@ -247,16 +266,6 @@ src_prepare() {
 		# http://bugs.php.net/bug.php?id=48795, bug #343481
 		sed -i -e '/BUILD_CGI="\\$(CC)/s/CC/CXX/' configure || die
 	fi
-
-	# In php-7.x, the FPM pool configuration files have been split off
-	# of the main config. By default the pool config files go in
-	# e.g. /etc/php-fpm.d, which isn't slotted. So here we move the
-	# include directory to a subdirectory "fpm.d" of $PHP_INI_DIR. Later
-	# we'll install the pool configuration file "www.conf" there.
-	php_set_ini_dir fpm
-	sed -i "s~^include=.*$~include=${PHP_INI_DIR}/fpm.d/*.conf~" \
-		sapi/fpm/php-fpm.conf.in \
-		|| die 'failed to move the include directory in php-fpm.conf'
 }
 
 src_configure() {
@@ -304,6 +313,7 @@ src_configure() {
 		$(use_with xml libxml-dir "${EPREFIX}/usr")
 		$(use_enable unicode mbstring)
 		$(use_with crypt mcrypt "${EPREFIX}/usr")
+		$(use_with mssql mssql "${EPREFIX}/usr")
 		$(use_with unicode onig "${EPREFIX}/usr")
 		$(use_with ssl openssl "${EPREFIX}/usr")
 		$(use_with ssl openssl-dir "${EPREFIX}/usr")
@@ -321,6 +331,7 @@ src_configure() {
 		$(use_enable soap soap)
 		$(use_enable sockets sockets)
 		$(use_with sqlite sqlite3 "${EPREFIX}/usr")
+		$(use_with sybase-ct sybase-ct "${EPREFIX}/usr")
 		$(use_enable sysvipc sysvmsg)
 		$(use_enable sysvipc sysvsem)
 		$(use_enable sysvipc sysvshm)
@@ -357,14 +368,13 @@ src_configure() {
 	# Support for the GD graphics library
 	our_conf+=(
 		$(use_with truetype freetype-dir "${EPREFIX}/usr")
+		$(use_with truetype t1lib "${EPREFIX}/usr")
 		$(use_enable cjk gd-jis-conv)
 		$(use_with gd jpeg-dir "${EPREFIX}/usr")
 		$(use_with gd png-dir "${EPREFIX}/usr")
 		$(use_with xpm xpm-dir "${EPREFIX}/usr")
+		$(use_with vpx vpx-dir "${EPREFIX}/usr")
 	)
-	if use webp; then
-		our_conf+=( --with-webp-dir="${EPREFIX}/usr" )
-	fi
 	# enable gd last, so configure can pick up the previous settings
 	our_conf+=( $(use_with gd gd) )
 
@@ -390,7 +400,10 @@ src_configure() {
 	# MySQL support
 	local mysqllib="mysqlnd"
 	local mysqlilib="mysqlnd"
+	use libmysqlclient && mysqllib="${EPREFIX}/usr"
+	use libmysqlclient && mysqlilib="${EPREFIX}/usr/bin/mysql_config"
 
+	our_conf+=( $(use_with mysql mysql "${mysqllib}") )
 	our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
 
 	local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock"
@@ -410,7 +423,7 @@ src_configure() {
 	# PDO support
 	if use pdo ; then
 		our_conf+=(
-			$(use_with mssql pdo-dblib "${EPREFIX}/usr")
+			$(use_with mssql pdo-dblib)
 			$(use_with mysql pdo-mysql "${mysqllib}")
 			$(use_with postgres pdo-pgsql)
 			$(use_with sqlite pdo-sqlite "${EPREFIX}/usr")
@@ -474,7 +487,7 @@ src_configure() {
 
 		for sapi in $SAPIS ; do
 			case "$sapi" in
-				cli|cgi|embed|fpm|phpdbg)
+				cli|cgi|embed|fpm)
 					if [[ "${one_sapi}" == "${sapi}" ]] ; then
 						sapi_conf+=( "--enable-${sapi}" )
 					else
@@ -555,7 +568,7 @@ src_install() {
 				# We're specifically not using emake install-sapi as libtool
 				# may cause unnecessary relink failures (see bug #351266)
 				insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/"
-				newins ".libs/libphp${PHP_MV}$(get_libname)" \
+				newins ".libs/libphp5$(get_libname)" \
 					   "libphp${PHP_MV}$(get_libname)"
 				keepdir "/usr/$(get_libdir)/apache2/modules"
 			else
@@ -575,9 +588,6 @@ src_install() {
 					embed)
 						source="libs/libphp${PHP_MV}$(get_libname)"
 						;;
-					phpdbg)
-						source="sapi/phpdbg/phpdbg"
-						;;
 					*)
 						die "unhandled sapi in src_install"
 						;;

diff --git a/dev-lang/php/php-7.0.11.ebuild b/dev-lang/php/php-7.0.11-r1.ebuild
similarity index 99%
rename from dev-lang/php/php-7.0.11.ebuild
rename to dev-lang/php/php-7.0.11-r1.ebuild
index 71c2ec4..7464406 100644
--- a/dev-lang/php/php-7.0.11.ebuild
+++ b/dev-lang/php/php-7.0.11-r1.ebuild
@@ -123,6 +123,7 @@ RDEPEND="${COMMON_DEPEND}
 
 DEPEND="${COMMON_DEPEND}
 	app-arch/xz-utils
+	>=sys-devel/bison-3.0.1
 	sys-devel/flex
 	>=sys-devel/m4-1.4.3
 	>=sys-devel/libtool-1.5.18"


^ permalink raw reply related	[flat|nested] 21+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-lang/php/files/, dev-lang/php/
@ 2015-11-02 23:37 Michael Orlitzky
  0 siblings, 0 replies; 21+ messages in thread
From: Michael Orlitzky @ 2015-11-02 23:37 UTC (permalink / raw
  To: gentoo-commits

commit:     d9454b5d1c5a22855e7c22f30644ba7c8980f923
Author:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
AuthorDate: Mon Nov  2 23:00:20 2015 +0000
Commit:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
CommitDate: Mon Nov  2 23:35:18 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d9454b5d

dev-lang/php: revbump php-5.6.15 to fix a segfault.

The segfault issue was reported in bug #564690 by Zoltán
Halassy. There is an upstream fix that we've added as a patch. The
problem/fix have both been confirmed.

Since this requires a revbump, the sys-libs/db dependency has been
fixed along with it according to bug #521222. It still remains to
address that issue for the php-7.x series.

Gentoo-Bug: 521222
Gentoo-Bug: 564690

Package-Manager: portage-2.2.20.1

 .../php/files/fix-5.6.15-fpm-const-crash.patch     | 59 ++++++++++++++++++++++
 .../{php-5.6.15.ebuild => php-5.6.15-r1.ebuild}    | 23 ++++++++-
 2 files changed, 80 insertions(+), 2 deletions(-)

diff --git a/dev-lang/php/files/fix-5.6.15-fpm-const-crash.patch b/dev-lang/php/files/fix-5.6.15-fpm-const-crash.patch
new file mode 100644
index 0000000..29876a9
--- /dev/null
+++ b/dev-lang/php/files/fix-5.6.15-fpm-const-crash.patch
@@ -0,0 +1,59 @@
+From 37ed0dafe47fb1053aee7822113bacc1f213337a Mon Sep 17 00:00:00 2001
+From: Xinchen Hui <laruence@gmail.com>
+Date: Mon, 2 Nov 2015 10:47:02 +0800
+Subject: [PATCH] Fixed bug #70828 (php-fpm 5.6 with opcache crashes when
+ referencing a non-existent constant)
+
+---
+ NEWS                     |  2 ++
+ Zend/tests/bug70828.phpt | 24 ++++++++++++++++++++++++
+ Zend/zend_compile.c      |  2 +-
+ 3 files changed, 27 insertions(+), 1 deletion(-)
+ create mode 100644 Zend/tests/bug70828.phpt
+
+diff --git a/Zend/tests/bug70828.phpt b/Zend/tests/bug70828.phpt
+new file mode 100644
+index 0000000..dd285b5
+--- /dev/null
++++ b/Zend/tests/bug70828.phpt
+@@ -0,0 +1,24 @@
++--TEST--
++Bug #70828 (php-fpm 5.6 with opcache crashes when referencing a non-existent constant)
++--FILE--
++<?php
++
++namespace test {
++	use const nonexistent;
++
++	class test {
++		static function run(){
++			var_dump(nonexistent);
++			existent;
++		}
++	}
++}
++
++namespace {
++	define("test\\existent", "bug!", 1);
++	test\test::run();
++}
++?>
++--EXPECTF--
++Notice: Use of undefined constant nonexistent - assumed 'nonexistent' in /home/huixinchen/opensource/php-5.6/Zend/tests/bug70828.php on line 8
++string(11) "nonexistent"
+diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
+index 5ff1b04..fca4e2a 100644
+--- a/Zend/zend_compile.c
++++ b/Zend/zend_compile.c
+@@ -5804,7 +5804,7 @@ void zend_do_fetch_constant(znode *result, znode *constant_container, znode *con
+ 				opline->op2.constant = zend_add_const_name_literal(CG(active_op_array), &constant_name->u.constant, 0 TSRMLS_CC);
+ 			} else {
+ 				opline->extended_value = IS_CONSTANT_UNQUALIFIED;
+-				if (CG(current_namespace)) {
++				if (check_namespace && CG(current_namespace)) {
+ 					opline->extended_value |= IS_CONSTANT_IN_NAMESPACE;
+ 					opline->op2.constant = zend_add_const_name_literal(CG(active_op_array), &constant_name->u.constant, 1 TSRMLS_CC);
+ 				} else {
+-- 
+2.1.4
+

diff --git a/dev-lang/php/php-5.6.15.ebuild b/dev-lang/php/php-5.6.15-r1.ebuild
similarity index 96%
rename from dev-lang/php/php-5.6.15.ebuild
rename to dev-lang/php/php-5.6.15-r1.ebuild
index c6cc5ca..c64fd9d 100644
--- a/dev-lang/php/php-5.6.15.ebuild
+++ b/dev-lang/php/php-5.6.15-r1.ebuild
@@ -79,8 +79,23 @@ DEPEND="
 	>=app-eselect/eselect-php-0.7.1-r3[apache2?,fpm?]
 	>=dev-libs/libpcre-8.32[unicode]
 	apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=]
-		<www-servers/apache-2.4[threads=] ) )
-	berkdb? ( =sys-libs/db-4* )
+		<www-servers/apache-2.4[threads=] ) )"
+
+# This wacky berkdb dependency really means "any 4.x or 5.x version of
+# sys-libs/db". The ./configure flag is called --with-db4, but this is a
+# misnomer since db5 also works (bug #521222). We really want to say
+# "any 4.x or 5.x slot", but that's not possible. The safest thing to
+# do is list all 4.x and 5.x slots in order of preference.
+DEPEND="${DEPEND}
+	berkdb? ( || ( sys-libs/db:5.3
+					sys-libs/db:5.1
+					sys-libs/db:4.8
+					sys-libs/db:4.7
+					sys-libs/db:4.6
+					sys-libs/db:4.5
+					sys-libs/db:4.4
+					sys-libs/db:4.3
+					sys-libs/db:4.2 ) )
 	bzip2? ( app-arch/bzip2 )
 	cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
 	cjk? ( !gd? (
@@ -308,6 +323,10 @@ src_prepare() {
 			|| die "Failed to fix heimdal crypt library reference"
 	fi
 
+	# Fix a const crash in php-fpm, bug #564690.
+	# Only applies to php-5.6.15 and should be fixed in 5.6.16.
+	epatch "${FILESDIR}/fix-5.6.15-fpm-const-crash.patch"
+
 	#Add user patches #357637
 	epatch_user
 


^ permalink raw reply related	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2024-07-10 14:50 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-23  0:39 [gentoo-commits] repo/gentoo:master commit in: dev-lang/php/files/, dev-lang/php/ Thomas Deutschmann
  -- strict thread matches above, loose matches on Subject: below --
2024-07-10 14:50 Michael Orlitzky
2024-04-09 13:51 Michael Orlitzky
2024-03-04 17:00 Michael Orlitzky
2024-02-18 23:54 Michael Orlitzky
2023-05-05 13:18 Brian Evans
2023-01-05 21:30 Brian Evans
2022-04-05 19:03 Brian Evans
2021-03-25 15:56 Brian Evans
2021-02-25 19:23 Brian Evans
2020-12-03 20:48 Thomas Deutschmann
2019-02-11 14:21 Brian Evans
2019-02-06 18:26 Thomas Deutschmann
2018-12-07  1:16 Thomas Deutschmann
2018-12-07  0:41 Thomas Deutschmann
2018-12-06 23:20 Thomas Deutschmann
2018-05-04 21:03 Brian Evans
2018-04-30  0:16 Aaron Bauman
2018-04-27  2:21 Brian Evans
2016-09-30 15:07 Michael Orlitzky
2015-11-02 23:37 Michael Orlitzky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox