From 56ebaa85fc339d78cef2012c20977a996fdffe14 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Fri, 14 Apr 2017 09:35:24 +0200 Subject: add patch for 7.2 --- msgpack-pr118.patch | 31 +++++++++++++++++++++++++++++++ msgpack.patch | 12 ------------ php-pecl-msgpack.spec | 21 +++++++++++++++++---- 3 files changed, 48 insertions(+), 16 deletions(-) create mode 100644 msgpack-pr118.patch delete mode 100644 msgpack.patch diff --git a/msgpack-pr118.patch b/msgpack-pr118.patch new file mode 100644 index 0000000..b740b51 --- /dev/null +++ b/msgpack-pr118.patch @@ -0,0 +1,31 @@ +From 99f9db8cd68cf458b330047b8d1cc0f15240abf2 Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Fri, 14 Apr 2017 09:23:39 +0200 +Subject: [PATCH] use spl_autoload_register (to avoid deprecation warning with + 7.2) + +--- + tests/019.phpt | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/tests/019.phpt b/tests/019.phpt +index 46cccb3..693f5cf 100644 +--- a/tests/019.phpt ++++ b/tests/019.phpt +@@ -17,7 +17,7 @@ function test($type, $variable, $test) { + echo $test || $unserialized->b == 2 ? 'OK' : 'ERROR', PHP_EOL; + } + +-function __autoload($classname) { ++function test_autoload($classname) { + class Obj { + var $a; + var $b; +@@ -28,6 +28,7 @@ function __autoload($classname) { + } + } + } ++spl_autoload_register('test_autoload'); + + test('autoload', '83c0a34f626aa16101a16202', false); + ?> diff --git a/msgpack.patch b/msgpack.patch deleted file mode 100644 index bd440db..0000000 --- a/msgpack.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- msgpack-0.5.5/msgpack_unpack.h.old 2013-02-19 04:03:35.000000000 +0100 -+++ msgpack-0.5.5/msgpack_unpack.h 2013-02-20 09:55:53.969440978 +0100 -@@ -67,6 +67,9 @@ - int msgpack_unserialize_map_item( - msgpack_unserialize_data *unpack, zval **container, zval *key, zval *val); - -+void msgpack_serialize_var_destroy(msgpack_serialize_data_t *var_hash); -+void msgpack_serialize_var_init(msgpack_serialize_data_t *var_hash); -+ - /* template functions */ - #define msgpack_unpack_struct(name) struct template ## name - #define msgpack_unpack_func(ret, name) ret template ## name diff --git a/php-pecl-msgpack.spec b/php-pecl-msgpack.spec index 5d4bcd1..7f51a0e 100644 --- a/php-pecl-msgpack.spec +++ b/php-pecl-msgpack.spec @@ -36,13 +36,15 @@ Version: 2.0.2 Release: 0.2.%{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 +Patch0: %{pecl_name}-pr118.patch + BuildRequires: %{?scl_prefix}php-devel >= 7 BuildRequires: %{?scl_prefix}php-pear %if %{with_msgpack} @@ -79,6 +81,10 @@ Obsoletes: php70w-pecl-%{pecl_name} <= %{version} Obsoletes: php71u-pecl-%{pecl_name} <= %{version} Obsoletes: php71w-pecl-%{pecl_name} <= %{version} %endif +%if "%{php_version}" > "7.2" +Obsoletes: php72u-pecl-%{pecl_name} <= %{version} +Obsoletes: php72w-pecl-%{pecl_name} <= %{version} +%endif %endif %if 0%{?fedora} < 20 && 0%{?rhel} < 7 @@ -134,14 +140,13 @@ mv %{pecl_name}-%{version} NTS %{?_licensedir:sed -e '/LICENSE/s/role="doc"/role="src"/' -i package.xml} cd NTS +%patch0 -p1 -b .pr118 + %if %{with_msgpack} # use system library rm -rf msgpack %endif -# When this file will be removed, clean the description. -[ -f EXPERIMENTAL ] || exit 1 - # Sanity check, really often broken extver=$(sed -n '/#define PHP_MSGPACK_VERSION/{s/.* "//;s/".*$//;p}' php_msgpack.h) if test "x${extver}" != "x%{version}%{?gh_date:-dev}"; then @@ -169,6 +174,8 @@ EOF %build +%{?dtsenable} + cd NTS %{_bindir}/phpize %configure --with-php-config=%{_bindir}/php-config @@ -183,6 +190,8 @@ make %{?_smp_mflags} %install +%{?dtsenable} + # Install the NTS stuff make -C NTS install INSTALL_ROOT=%{buildroot} install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name} @@ -287,6 +296,10 @@ fi %changelog +* Fri Apr 14 2017 Remi Collet - 2.0.2-2 +- add patch for test suite with PHP 7.2 from + https://github.com/msgpack/msgpack-php/pull/118 + * Wed Dec 7 2016 Remi Collet - 2.0.2-1 - update to 2.0.2 -- cgit