Rebased on top of my commits today, and kept in the main package
(because having to add it to 35 ports suggests that it's really
very common and oniguruma is only small).
Index: Makefile.inc
===================================================================
RCS file: /cvs/ports/lang/php/Makefile.inc,v
retrieving revision 1.110
diff -u -p -r1.110 Makefile.inc
--- Makefile.inc 27 May 2018 19:54:17 -0000 1.110
+++ Makefile.inc 27 May 2018 20:04:00 -0000
@@ -76,6 +76,7 @@ CONFIGURE_ARGS+= --enable-opcache
# default included php extensions
CONFIGURE_ARGS+= --with-gettext=${LOCALBASE} \
--with-iconv=${LOCALBASE} \
+ --with-onig=${LOCALBASE} \
--with-openssl \
--with-pcre-regex \
--with-zlib \
@@ -134,10 +135,11 @@ BUILD_DEPENDS+= www/apache-httpd
.endif
.for i in ${SAPI}
-WANTLIB$i += c crypto curses iconv intl lzma m pthread
-WANTLIB$i += readline ssl xml2 z
+WANTLIB$i += c crypto curses iconv intl lzma m onig
+WANTLIB$i += pthread readline ssl xml2 z
LIB_DEPENDS$i += devel/gettext \
- textproc/libxml
+ textproc/libxml \
+ textproc/oniguruma
.endfor
#
Index: 5.6/Makefile
===================================================================
RCS file: /cvs/ports/lang/php/5.6/Makefile,v
retrieving revision 1.69
diff -u -p -r1.69 Makefile
--- 5.6/Makefile 27 May 2018 19:54:17 -0000 1.69
+++ 5.6/Makefile 27 May 2018 20:04:00 -0000
@@ -5,6 +5,7 @@ BROKEN-alpha= pcre_jit_compile.c:65:2: e
PV= 5.6
V= ${PV}.36
REVISION= 3
+REVISION-main= 4
MASTER_SITES0= https://download.suhosin.org/
Index: 5.6/patches/patch-ext_mbstring_php_mbregex_c
===================================================================
RCS file: 5.6/patches/patch-ext_mbstring_php_mbregex_c
diff -N 5.6/patches/patch-ext_mbstring_php_mbregex_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 5.6/patches/patch-ext_mbstring_php_mbregex_c 27 May 2018 20:04:00 -0000
@@ -0,0 +1,25 @@
+$OpenBSD$
+
+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.
+
+Index: ext/mbstring/php_mbregex.c
+--- ext/mbstring/php_mbregex.c.orig
++++ ext/mbstring/php_mbregex.c
+@@ -454,7 +454,7 @@ static php_mb_regex_t *php_mbregex_compile_pattern(con
+ 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);
Index: 5.6/pkg/PLIST-main
===================================================================
RCS file: /cvs/ports/lang/php/5.6/pkg/PLIST-main,v
retrieving revision 1.16
diff -u -p -r1.16 PLIST-main
--- 5.6/pkg/PLIST-main 27 May 2018 19:54:17 -0000 1.16
+++ 5.6/pkg/PLIST-main 27 May 2018 20:04:00 -0000
@@ -214,8 +214,6 @@ share/php-${PV}/include/ext/mbstring/lib
share/php-${PV}/include/ext/mbstring/libmbfl/mbfl/mbfl_memory_device.h
share/php-${PV}/include/ext/mbstring/libmbfl/mbfl/mbfl_string.h
share/php-${PV}/include/ext/mbstring/mbstring.h
-share/php-${PV}/include/ext/mbstring/oniguruma/
-share/php-${PV}/include/ext/mbstring/oniguruma/oniguruma.h
share/php-${PV}/include/ext/mbstring/php_mbregex.h
share/php-${PV}/include/ext/mbstring/php_onig_compat.h
share/php-${PV}/include/ext/mysqli/
Index: 7.0/Makefile
===================================================================
RCS file: /cvs/ports/lang/php/7.0/Makefile,v
retrieving revision 1.53
diff -u -p -r1.53 Makefile
--- 7.0/Makefile 27 May 2018 19:54:17 -0000 1.53
+++ 7.0/Makefile 27 May 2018 20:04:00 -0000
@@ -3,6 +3,7 @@
PV= 7.0
V= ${PV}.30
REVISION= 3
+REVISION-main= 4
BUILD_DEPENDS+= devel/bison
Index: 7.0/patches/patch-ext_mbstring_php_mbregex_c
===================================================================
RCS file: 7.0/patches/patch-ext_mbstring_php_mbregex_c
diff -N 7.0/patches/patch-ext_mbstring_php_mbregex_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 7.0/patches/patch-ext_mbstring_php_mbregex_c 27 May 2018 20:04:00 -0000
@@ -0,0 +1,25 @@
+$OpenBSD$
+
+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.
+
+Index: ext/mbstring/php_mbregex.c
+--- ext/mbstring/php_mbregex.c.orig
++++ ext/mbstring/php_mbregex.c
+@@ -452,7 +452,7 @@ static php_mb_regex_t *php_mbregex_compile_pattern(con
+ 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);
Index: 7.0/pkg/PLIST-main
===================================================================
RCS file: /cvs/ports/lang/php/7.0/pkg/PLIST-main,v
retrieving revision 1.12
diff -u -p -r1.12 PLIST-main
--- 7.0/pkg/PLIST-main 27 May 2018 19:54:17 -0000 1.12
+++ 7.0/pkg/PLIST-main 27 May 2018 20:04:00 -0000
@@ -211,8 +211,6 @@ share/php-${PV}/include/ext/mbstring/lib
share/php-${PV}/include/ext/mbstring/libmbfl/mbfl/mbfl_memory_device.h
share/php-${PV}/include/ext/mbstring/libmbfl/mbfl/mbfl_string.h
share/php-${PV}/include/ext/mbstring/mbstring.h
-share/php-${PV}/include/ext/mbstring/oniguruma/
-share/php-${PV}/include/ext/mbstring/oniguruma/oniguruma.h
share/php-${PV}/include/ext/mbstring/php_mbregex.h
share/php-${PV}/include/ext/mbstring/php_onig_compat.h
share/php-${PV}/include/ext/mysqli/
No comments:
Post a Comment