summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2016-06-10 08:29:50 +0200
committerRemi Collet <fedora@famillecollet.com>2016-06-10 08:29:50 +0200
commitc70d486fb109e0692760c779d8799c754ee47618 (patch)
treecf9a6cbae86f1ce38e910fbc46b15fdaf3a067ce
parente127e9620a5b449b2df9610d65e3a01071fa7cc8 (diff)
php-pecl-stomp: add upstream ppatch for PHP 7.1
-rw-r--r--php-pecl-stomp-php7.spec12
-rw-r--r--stomp-upstream.patch56
2 files changed, 67 insertions, 1 deletions
diff --git a/php-pecl-stomp-php7.spec b/php-pecl-stomp-php7.spec
index 00c0668..7072fab 100644
--- a/php-pecl-stomp-php7.spec
+++ b/php-pecl-stomp-php7.spec
@@ -16,12 +16,14 @@
Summary: Stomp client extension
Name: %{?scl_prefix}php-pecl-%{pecl_name}
Version: 2.0.0
-Release: 1%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}
+Release: 2%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}
License: PHP
Group: Development/Languages
URL: http://pecl.php.net/package/%{pecl_name}
Source0: http://pecl.php.net/get/%{pecl_name}-%{version}.tgz
+Patch0: %{pecl_name}-upstream.patch
+
BuildRequires: %{?scl_prefix}php-devel > 7
BuildRequires: %{?scl_prefix}php-pear
BuildRequires: openssl-devel
@@ -51,6 +53,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
@@ -80,6 +86,7 @@ sed -e 's/role="test"/role="src"/' \
-i package.xml
cd NTS
+%patch0 -p1 -b .upstream
# Sanity check, really often broken
extver=$(sed -n '/#define PHP_STOMP_VERSION/{s/.* "//;s/".*$//;p}' php_stomp.h)
@@ -205,6 +212,9 @@ fi
%changelog
+* Fri Jun 10 2016 Remi Collet <remi@fedoraproject.org> - 2.0.0-2
+- add upstream patch for PHP 7.1
+
* Thu May 26 2016 Remi Collet <remi@fedoraproject.org> - 2.0.0-1
- update to 2.0.0 (php 7, beta)
diff --git a/stomp-upstream.patch b/stomp-upstream.patch
new file mode 100644
index 0000000..d53e166
--- /dev/null
+++ b/stomp-upstream.patch
@@ -0,0 +1,56 @@
+From 2a6ef9570e309b6d2d58f03ed80e305d7b2ea4cb Mon Sep 17 00:00:00 2001
+From: Pierrick Charron <pierrick@webstart.fr>
+Date: Thu, 9 Jun 2016 13:27:54 -0400
+Subject: [PATCH] Remove useless zend_fcall_info.function_table
+
+---
+ php_stomp.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/php_stomp.c b/php_stomp.c
+index 96a08db..869e7ed 100644
+--- a/php_stomp.c
++++ b/php_stomp.c
+@@ -963,8 +963,10 @@ PHP_FUNCTION(stomp_read_frame)
+ }
+
+ fci.size = sizeof(fci);
++#if (PHP_MAJOR_VERSION == 7 && PHP_MINOR_VERSION == 0)
+ fci.function_table = &ce->function_table;
+ fci.symbol_table = NULL;
++#endif
+
+ /* PARAMS */
+ fci.param_count = 3;
+--
+2.1.4
+
+From bd384b27c1ed0b188dd7fd21961d1f31628939cd Mon Sep 17 00:00:00 2001
+From: Pierrick Charron <pierrick@webstart.fr>
+Date: Thu, 9 Jun 2016 13:32:55 -0400
+Subject: [PATCH] get rid of EG(scope). zend_get_executed_scope() should be
+ used instead
+
+---
+ php_stomp.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/php_stomp.c b/php_stomp.c
+index 869e7ed..dcde51f 100644
+--- a/php_stomp.c
++++ b/php_stomp.c
+@@ -982,7 +982,11 @@ PHP_FUNCTION(stomp_read_frame)
+
+ fcc.initialized = 1;
+ fcc.function_handler = ce->constructor;
++#if (PHP_MAJOR_VERSION == 7 && PHP_MINOR_VERSION == 0)
+ fcc.calling_scope = EG(scope);
++#else
++ fcc.calling_scope = zend_get_executed_scope();
++#endif
+ fcc.object = Z_OBJ_P(return_value);
+
+ if (zend_call_function(&fci, &fcc ) == FAILURE) {
+--
+2.1.4
+