summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2016-06-11 07:08:35 +0200
committerRemi Collet <fedora@famillecollet.com>2016-06-11 07:08:35 +0200
commit9e25269ef548a84453d9526d93b3cc6b314dac6b (patch)
tree557f0836d6e954db0a0a1b3ffd4c5ac614528383
parent7de54ff983cf3cea64d5dc38d007179943b7ba1c (diff)
php-pecl-msgpack: add patch for PHP 7.1
-rw-r--r--msgpack-pr87.patch38
-rw-r--r--php-pecl-msgpack-php7.spec24
2 files changed, 51 insertions, 11 deletions
diff --git a/msgpack-pr87.patch b/msgpack-pr87.patch
new file mode 100644
index 0000000..afdac20
--- /dev/null
+++ b/msgpack-pr87.patch
@@ -0,0 +1,38 @@
+From 710f535c7b25ab7d49b649f9411427761525b8d7 Mon Sep 17 00:00:00 2001
+From: Remi Collet <fedora@famillecollet.com>
+Date: Sat, 11 Jun 2016 06:39:22 +0200
+Subject: [PATCH] fix for PHP 7.1
+
+---
+ msgpack_convert.c | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/msgpack_convert.c b/msgpack_convert.c
+index 3b01150..9b6923a 100644
+--- a/msgpack_convert.c
++++ b/msgpack_convert.c
+@@ -289,9 +289,11 @@ int msgpack_convert_object(zval *return_value, zval *tpl, zval *value) /* {{{ */
+ zend_fcall_info_cache fcc;
+
+ fci.size = sizeof(fci);
++#if PHP_VERSION_ID < 70100
+ fci.function_table = EG(function_table);
+- fci.function_name = function_name;
+ fci.symbol_table = NULL;
++#endif
++ fci.function_name = function_name;
+ fci.object = Z_OBJ_P(return_value);
+ fci.retval = &retval;
+ fci.param_count = 0;
+@@ -300,7 +302,11 @@ int msgpack_convert_object(zval *return_value, zval *tpl, zval *value) /* {{{ */
+
+ fcc.initialized = 1;
+ fcc.function_handler = ce->constructor;
++#if PHP_VERSION_ID < 70100
+ fcc.calling_scope = EG(scope);
++#else
++ fcc.calling_scope = zend_get_executed_scope();
++#endif
+ fcc.called_scope = Z_OBJCE_P(return_value);
+ fcc.object = Z_OBJ_P(return_value);
+
diff --git a/php-pecl-msgpack-php7.spec b/php-pecl-msgpack-php7.spec
index f990719..fea863e 100644
--- a/php-pecl-msgpack-php7.spec
+++ b/php-pecl-msgpack-php7.spec
@@ -11,10 +11,9 @@
#
%if 0%{?scl:1}
%global sub_prefix %{scl_prefix}
+%scl_package php-pecl-msgpack
%endif
-%{?scl: %scl_package php-pecl-msgpack}
-
%global gh_commit b29f3fd572b9d2ad8c053efa6279f93862f63657
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
%global gh_owner msgpack
@@ -37,14 +36,15 @@ Version: 2.0.1
Release: 0.1.%{gh_date}git%{gh_short}%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{pecl_name}-%{version}-%{gh_short}.tar.gz
%else
-Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+Release: 2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
Source: http://pecl.php.net/get/%{pecl_name}-%{version}.tgz
%endif
License: BSD
Group: Development/Languages
URL: http://pecl.php.net/package/msgpack
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
+Patch0: %{pecl_name}-pr87.patch
+
BuildRequires: %{?scl_prefix}php-devel >= 7
BuildRequires: %{?scl_prefix}php-pear
%if %{with_msgpack}
@@ -76,6 +76,10 @@ Obsoletes: php56u-pecl-%{pecl_name} <= %{version}
Obsoletes: php56w-pecl-%{pecl_name} <= %{version}
Obsoletes: php70u-pecl-%{pecl_name} <= %{version}
Obsoletes: php70w-pecl-%{pecl_name} <= %{version}
+%if "%{php_version}" > "7.1"
+Obsoletes: php71u-pecl-%{pecl_name} <= %{version}
+Obsoletes: php71w-pecl-%{pecl_name} <= %{version}
+%endif
%endif
%if 0%{?fedora} < 20 && 0%{?rhel} < 7
@@ -126,6 +130,7 @@ mv %{pecl_name}-%{version} NTS
%{?_licensedir:sed -e '/LICENSE/s/role="doc"/role="src"/' -i package.xml} \
cd NTS
+%patch0 -p1 -b .pr87
%if %{with_msgpack}
# use system library
@@ -176,7 +181,6 @@ make %{?_smp_mflags}
%install
-rm -rf %{buildroot}
# Install the NTS stuff
make -C NTS install INSTALL_ROOT=%{buildroot}
install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name}
@@ -257,12 +261,7 @@ fi
%endif
-%clean
-rm -rf %{buildroot}
-
-
%files
-%defattr(-,root,root,-)
%{?_licensedir:%license NTS/LICENSE}
%doc %{pecl_docdir}/%{pecl_name}
%{pecl_xmldir}/%{name}.xml
@@ -277,7 +276,6 @@ rm -rf %{buildroot}
%files devel
-%defattr(-,root,root,-)
%doc %{pecl_testdir}/%{pecl_name}
%{php_incldir}/ext/%{pecl_name}
@@ -287,6 +285,10 @@ rm -rf %{buildroot}
%changelog
+* Sat Jun 11 2016 Remi Collet <remi@fedoraproject.org> - 2.0.1-2
+- add patch for PHP 7.1
+ open https://github.com/msgpack/msgpack-php/pull/87
+
* Tue Mar 1 2016 Remi Collet <remi@fedoraproject.org> - 2.0.1-1
- update to 2.0.1 (php 7, beta)
- use sources from pecl