From 1c7ef70a9b5ec02c60e7fedd78da86b035f3096e Mon Sep 17 00:00:00 2001 From: Sunpoet Po-Chuan Hsieh Date: Sun, 8 Dec 2019 16:59:35 +0000 Subject: [PATCH] Fix build with PHP 7.4 and unbreak this port It has merged by upstream. Reference: https://github.com/jbboehr/php-mustache/commit/1b66fdaecb3923922aecbbd0c0393ed4648abe25 --- devel/pecl-mustache/Makefile | 1 - .../files/patch-mustache_data.cpp | 29 +++++++++++++++++++ .../files/patch-mustache_mustache.cpp | 11 +++++++ 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 devel/pecl-mustache/files/patch-mustache_data.cpp create mode 100644 devel/pecl-mustache/files/patch-mustache_mustache.cpp diff --git a/devel/pecl-mustache/Makefile b/devel/pecl-mustache/Makefile index b2bbba18716d..003a0b611cbf 100644 --- a/devel/pecl-mustache/Makefile +++ b/devel/pecl-mustache/Makefile @@ -15,7 +15,6 @@ LICENSE_FILE= ${WRKSRC}/LICENSE.md LIB_DEPENDS= libmustache.so:devel/libmustache USES= compiler:c++11-lang php:pecl -IGNORE_WITH_PHP= 74 USE_CXXSTD= c++11 diff --git a/devel/pecl-mustache/files/patch-mustache_data.cpp b/devel/pecl-mustache/files/patch-mustache_data.cpp new file mode 100644 index 000000000000..a9ec119869f1 --- /dev/null +++ b/devel/pecl-mustache/files/patch-mustache_data.cpp @@ -0,0 +1,29 @@ +--- mustache_data.cpp.orig 2019-05-27 21:52:06 UTC ++++ mustache_data.cpp +@@ -136,7 +136,7 @@ static zend_always_inline void mustache_ + { + HashTable * data_hash = NULL; + long data_count = 0; +- ulong key_nindex = 0; ++ zend_ulong key_nindex = 0; + zend_string * key; + std::string ckey; + zval * data_entry = NULL; +@@ -228,7 +228,7 @@ static zend_always_inline void mustache_ + static zend_always_inline void mustache_data_from_object_properties_zval(mustache::Data * node, zval * current) + { + HashTable * data_hash = NULL; +- ulong key_nindex = 0; ++ zend_ulong key_nindex = 0; + zend_string * key; + std::string ckey; + zval * data_entry = NULL; +@@ -311,7 +311,7 @@ static zend_always_inline void mustache_ + static zend_always_inline void mustache_data_from_object_functions_zval(mustache::Data * node, zval * current) + { + HashTable * data_hash = NULL; +- ulong key_nindex = 0; ++ zend_ulong key_nindex = 0; + zend_string * key; + std::string ckey; + zval * data_entry = NULL; diff --git a/devel/pecl-mustache/files/patch-mustache_mustache.cpp b/devel/pecl-mustache/files/patch-mustache_mustache.cpp new file mode 100644 index 000000000000..531f02190f01 --- /dev/null +++ b/devel/pecl-mustache/files/patch-mustache_mustache.cpp @@ -0,0 +1,11 @@ +--- mustache_mustache.cpp.orig 2019-05-27 21:52:06 UTC ++++ mustache_mustache.cpp +@@ -231,7 +231,7 @@ bool mustache_parse_partials_param(zval + mustache::Node::Partials * partials) + { + HashTable * data_hash = NULL; +- ulong key_nindex = 0; ++ zend_ulong key_nindex = 0; + + // Ignore if not an array + if( array == NULL || Z_TYPE_P(array) != IS_ARRAY ) {