From 33d0a3eea172b82fe0d4f34ad76d293e5f76ddb2 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Thu, 27 Jun 2019 09:23:36 +0200 Subject: build with upstream patch for https://github.com/phalcon/cphalcon/issues/14160 --- 1251b877c4e3962c8d4d89d5a210fb380f8177ca.patch | 40 ++++++++++++++++++++++++++ zephir.spec | 8 +++++- 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 1251b877c4e3962c8d4d89d5a210fb380f8177ca.patch diff --git a/1251b877c4e3962c8d4d89d5a210fb380f8177ca.patch b/1251b877c4e3962c8d4d89d5a210fb380f8177ca.patch new file mode 100644 index 0000000..142758d --- /dev/null +++ b/1251b877c4e3962c8d4d89d5a210fb380f8177ca.patch @@ -0,0 +1,40 @@ +From 873bc5031c511abbcbaa17117b86d0109f0fef91 Mon Sep 17 00:00:00 2001 +From: Joe Watkins +Date: Thu, 6 Jun 2019 18:43:30 +0200 +Subject: [PATCH] really fix incorrect usage of zend_declare_class_constant_ex, + for PHP >=7.2 + +--- + kernels/ZendEngine3/main.c | 19 ++++++++++++++++++- + 1 file changed, 18 insertions(+), 1 deletion(-) + +diff --git a/kernels/ZendEngine3/main.c b/kernels/ZendEngine3/main.c +index c940e0e26..c8d45ce0b 100644 +--- a/kernels/ZendEngine3/main.c ++++ b/kernels/ZendEngine3/main.c +@@ -387,7 +387,24 @@ zend_class_entry* zephir_get_internal_ce(const char *class_name, unsigned int cl + /* Declare constants */ + int zephir_declare_class_constant(zend_class_entry *ce, const char *name, size_t name_length, zval *value) + { +-#if PHP_VERSION_ID >= 70100 ++#if PHP_VERSION_ID >= 70200 ++ int ret; ++ zend_string *key; ++ ++ if (ce->type == ZEND_INTERNAL_CLASS) { ++ key = zend_string_init_interned(name, name_length, 1); ++ } else { ++ key = zend_string_init(name, name_length, 0); ++ } ++ ++ zend_declare_class_constant_ex(ce, key, value, ZEND_ACC_PUBLIC, NULL); ++ ++ if (ce->type != ZEND_INTERNAL_CLASS) { ++ zend_string_release(key); ++ } ++ ++ return ret; ++#elif PHP_VERSION_ID >= 70100 + int ret; + + zend_string *key = zend_string_init(name, name_length, ce->type & ZEND_INTERNAL_CLASS); diff --git a/zephir.spec b/zephir.spec index cbea09d..0736c9d 100644 --- a/zephir.spec +++ b/zephir.spec @@ -31,7 +31,7 @@ Name: %{?scl_prefix}%{gh_project} Version: 0.10.15 -Release: 1%{?gh_date:.%{gh_date}.%{gh_short}}%{?dist} +Release: 2%{?gh_date:.%{gh_date}.%{gh_short}}%{?dist} Summary: Zephir language for creation of extensions for PHP. License: MIT @@ -40,6 +40,7 @@ Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit # Adapt path used in RPM Patch0: %{gh_project}-rpm.patch +Patch1: https://github.com/phalcon/zephir/commit/1251b877c4e3962c8d4d89d5a210fb380f8177ca.patch BuildArch: noarch BuildRequires: %{?scl_prefix}php-devel > 5.5 @@ -112,6 +113,7 @@ Compiler design goals: %patch0 -p0 -b .rpm sed -e 's:@DATADIR@:%{_datadir}:;s:@BINDIR@:%{_bindir}:' \ -i bin/%{gh_project} +%patch1 -p1 -b .up find . -name \*.php -exec chmod -x {} \; @@ -160,6 +162,10 @@ sh ./bin/%{gh_project}.test version | grep %{version} %changelog +* Thu Jun 27 2019 Remi Collet - 0.10.15-2 +- build with upstream patch for + https://github.com/phalcon/cphalcon/issues/14160 + * Mon Feb 25 2019 Remi Collet - 0.10.15-1 - update to 0.10.15 -- cgit