From 2bd1461ad0f61a96794239fa96a4b74ef307a8a2 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Sat, 11 Jun 2016 07:09:30 +0200 Subject: php-pecl-yar: add patch for PHP 7.1 --- php-pecl-yar-php7.spec | 25 ++++++++++++++++++------- yar-php71.patch | 25 +++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 7 deletions(-) create mode 100644 yar-php71.patch diff --git a/php-pecl-yar-php7.spec b/php-pecl-yar-php7.spec index 4e09e28..86f5bb8 100644 --- a/php-pecl-yar-php7.spec +++ b/php-pecl-yar-php7.spec @@ -8,10 +8,9 @@ # %if 0%{?scl:1} %global sub_prefix %{scl_prefix} +%scl_package php-pecl-yar %endif -%{?scl: %scl_package php-pecl-yar} - %global gh_commit 0e04a6a92347f7e95c9ddf8bbbad36b6286ed87f %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) %global gh_owner laruence @@ -34,13 +33,16 @@ Version: 2.0.0 %if 0%{?gh_date:1} Release: 0.10.%{gh_date}git%{gh_short}%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} %else -Release: 2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Release: 3%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} %endif License: PHP Group: Development/Languages URL: http://pecl.php.net/package/%{pecl_name} Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{pecl_name}-%{version}-%{gh_short}.tar.gz +# https://github.com/laruence/yar/pull/83 +Patch0: %{pecl_name}-php71.patch + BuildRequires: curl-devel BuildRequires: %{?scl_prefix}php-devel > 7 BuildRequires: %{?scl_prefix}php-pear @@ -64,8 +66,10 @@ Provides: %{?scl_prefix}php-%{pecl_name} = %{version} Provides: %{?scl_prefix}php-%{pecl_name}%{?_isa} = %{version} Provides: %{?scl_prefix}php-pecl(%{pecl_name}) = %{version} Provides: %{?scl_prefix}php-pecl(%{pecl_name})%{?_isa} = %{version} +%if "%{?scl_prefix}" != "%{?sub_prefix}" Provides: %{?scl_prefix}php-pecl-%{pecl_name} = %{version}-%{release} Provides: %{?scl_prefix}php-pecl-%{pecl_name}%{?_isa} = %{version}-%{release} +%endif %if "%{?vendor}" == "Remi Collet" && 0%{!?scl:1} # Other third party repo stuff @@ -79,6 +83,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 @@ -106,6 +114,7 @@ sed -e 's/role="test"/role="src"/' \ -i package2.xml cd NTS +%patch0 -p1 -b .php71 # Sanity check, really often broken extver=$(sed -n '/#define PHP_YAR_VERSION/{s/.* "//;s/".*$//;p}' php_yar.h) @@ -160,8 +169,7 @@ make %{?_smp_mflags} %install -make -C NTS \ - install INSTALL_ROOT=%{buildroot} +make -C NTS install INSTALL_ROOT=%{buildroot} # install config file install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name} @@ -170,8 +178,7 @@ install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name} install -D -m 644 package2.xml %{buildroot}%{pecl_xmldir}/%{name}.xml %if %{with_zts} -make -C ZTS \ - install INSTALL_ROOT=%{buildroot} +make -C ZTS install INSTALL_ROOT=%{buildroot} install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name} %endif @@ -262,6 +269,10 @@ export YAR_API_PORT=8964 %changelog +* Sat Jun 11 2016 Remi Collet - 2.0.0-3 +- add patch for PHP 7.1 + open https://github.com/laruence/yar/pull/83 + * Sun Mar 6 2016 Remi Collet - 2.0.0-2 - adapt for F24 diff --git a/yar-php71.patch b/yar-php71.patch new file mode 100644 index 0000000..af4ccd7 --- /dev/null +++ b/yar-php71.patch @@ -0,0 +1,25 @@ +From 603689fe268d9178c4180b46f676b7d5abef696e Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Sat, 11 Jun 2016 07:05:55 +0200 +Subject: [PATCH] fix for PHP 7.1 + +--- + yar_server.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/yar_server.c b/yar_server.c +index d46bd72..fac921b 100644 +--- a/yar_server.c ++++ b/yar_server.c +@@ -219,7 +219,11 @@ static char * php_yar_get_function_declaration(zend_function *fptr) /* {{{ */ { + zval zv, zv_copy; + int use_copy; + ZVAL_DUP(&zv, RT_CONSTANT(&fptr->op_array, precv->op2)); ++#if PHP_VERSION_ID < 70100 + zval_update_constant_ex(&zv, 1, fptr->common.scope); ++#else ++ zval_update_constant_ex(&zv, fptr->common.scope); ++#endif + if (Z_TYPE(zv) == IS_TRUE) { + memcpy(offset, "true", 4); + offset += 4; -- cgit