dev-lang/php: Fix compilation with dev-libs/oniguruma-6.8.1
authorBrian Evans <grknight@gentoo.org>
Wed, 4 Apr 2018 13:20:44 +0000 (09:20 -0400)
committerBrian Evans <grknight@gentoo.org>
Wed, 4 Apr 2018 13:21:39 +0000 (09:21 -0400)
Include upstream patch for all 7.0 versions
Limit version in 5.6.35-r1 as the patch is not the same there

Closes: https://bugs.gentoo.org/652352
Package-Manager: Portage-2.3.28, Repoman-2.3.9

dev-lang/php/files/mbstring-oniguruma-6.8.patch [new file with mode: 0644]
dev-lang/php/php-5.6.35-r1.ebuild [moved from dev-lang/php/php-5.6.35.ebuild with 99% similarity]
dev-lang/php/php-7.0.27.ebuild
dev-lang/php/php-7.0.28.ebuild
dev-lang/php/php-7.0.29.ebuild
dev-lang/php/php-7.1.13.ebuild
dev-lang/php/php-7.1.14.ebuild
dev-lang/php/php-7.1.15.ebuild
dev-lang/php/php-7.1.16.ebuild
dev-lang/php/php-7.2.4.ebuild

diff --git a/dev-lang/php/files/mbstring-oniguruma-6.8.patch b/dev-lang/php/files/mbstring-oniguruma-6.8.patch
new file mode 100644 (file)
index 0000000..c238f88
--- /dev/null
@@ -0,0 +1,30 @@
+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
+
similarity index 99%
rename from dev-lang/php/php-5.6.35.ebuild
rename to dev-lang/php/php-5.6.35-r1.ebuild
index 0cbd2484dc0886694ae3c87a218315cfb7a0eb87..ebf59c207d5b81a501779b8a9e40cef3b19b10bc 100644 (file)
@@ -113,7 +113,7 @@ COMMON_DEPEND="
                !gd? (
                        virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib:0= )
        )
-       unicode? ( dev-libs/oniguruma:= )
+       unicode? ( <dev-libs/oniguruma-6.8.0:= )
        vpx? ( media-libs/libvpx:0= )
        wddx? ( >=dev-libs/libxml2-2.6.8 )
        xml? ( >=dev-libs/libxml2-2.6.8 )
index 07116183964a2f61ae1bbedef116b5f0d06974c0..88d8e93bc686a1f7ad2ba41168535b9347e24f43 100644 (file)
@@ -163,6 +163,8 @@ REQUIRED_USE="
        mysql? ( || ( mysqli pdo ) )
 "
 
+PATCHES=( "${FILESDIR}/mbstring-oniguruma-6.8.patch" )
+
 PHP_MV="$(get_major_version)"
 
 php_install_ini() {
index 889e707ffc3217457e4af131d6679669cfdd8854..7964fdcd189cd5dc094a268dd17c96b9fbe91115 100644 (file)
@@ -163,6 +163,8 @@ REQUIRED_USE="
        mysql? ( || ( mysqli pdo ) )
 "
 
+PATCHES=( "${FILESDIR}/mbstring-oniguruma-6.8.patch" )
+
 PHP_MV="$(get_major_version)"
 
 php_install_ini() {
index 45b3218e4f643bf3848eca621112846a3580fa9f..ec866bd84bad9e1773f29538ca42eecac09382bf 100644 (file)
@@ -163,6 +163,8 @@ REQUIRED_USE="
        mysql? ( || ( mysqli pdo ) )
 "
 
+PATCHES=( "${FILESDIR}/mbstring-oniguruma-6.8.patch" )
+
 PHP_MV="$(get_major_version)"
 
 php_install_ini() {
index 4fc386497f87bc6cf36d3a25dba1a0c841b96a63..65425f9dc6a3cba2998fc482a788d7d851ce50c9 100644 (file)
@@ -145,6 +145,8 @@ REQUIRED_USE="
        mysql? ( || ( mysqli pdo ) )
 "
 
+PATCHES=( "${FILESDIR}/mbstring-oniguruma-6.8.patch" )
+
 PHP_MV="$(get_major_version)"
 
 php_install_ini() {
index 682890dc86d0c7c79be3c5fbd3cf71aefa94f81b..ee42a9c8acb751b8e4d8e3703221985543b20bb4 100644 (file)
@@ -145,6 +145,8 @@ REQUIRED_USE="
        mysql? ( || ( mysqli pdo ) )
 "
 
+PATCHES=( "${FILESDIR}/mbstring-oniguruma-6.8.patch" )
+
 PHP_MV="$(get_major_version)"
 
 php_install_ini() {
index d3c61673621fe3413127b2a651e53facec7d4bd3..7624b2d8a8a76317a5d064929744b6efaf71b7dc 100644 (file)
@@ -145,6 +145,8 @@ REQUIRED_USE="
        mysql? ( || ( mysqli pdo ) )
 "
 
+PATCHES=( "${FILESDIR}/mbstring-oniguruma-6.8.patch" )
+
 PHP_MV="$(get_major_version)"
 
 php_install_ini() {
index 34ff2d2648dcdf9d2b09e4a729f52696de1862d9..26afb4343b5ce9bcf85825076ea9dc69fb0a3a74 100644 (file)
@@ -145,6 +145,8 @@ REQUIRED_USE="
        mysql? ( || ( mysqli pdo ) )
 "
 
+PATCHES=( "${FILESDIR}/mbstring-oniguruma-6.8.patch" )
+
 PHP_MV="$(get_major_version)"
 
 php_install_ini() {
index 5407f131e1a1400589f0dfba1a7903284d3f267d..9db1463e3a1a75a782167267b017a06ac00c41fb 100644 (file)
@@ -150,6 +150,8 @@ REQUIRED_USE="
        zip-encryption? ( zip )
 "
 
+PATCHES=( "${FILESDIR}/mbstring-oniguruma-6.8.patch" )
+
 PHP_MV="$(get_major_version)"
 
 php_install_ini() {