From f374170468aa4d17a6f6c1b3361ac9348d8b090c Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 27 Jun 2018 14:10:50 +0200 Subject: add patch for PHP 7.3 from https://github.com/indexdata/phpyaz/pull/7 --- 7.patch | 36 ++++++++++++++++++++++++++++++++++++ PHPINFO | 7 +++++++ php-pecl-yaz.spec | 26 +++++++++++++------------- 3 files changed, 56 insertions(+), 13 deletions(-) create mode 100644 7.patch create mode 100644 PHPINFO diff --git a/7.patch b/7.patch new file mode 100644 index 0000000..630260e --- /dev/null +++ b/7.patch @@ -0,0 +1,36 @@ +From 010fef7b3941cdd24ceaaac78f3db9732539e0d3 Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Wed, 27 Jun 2018 13:57:51 +0200 +Subject: [PATCH] fix for PHP 7.3 API changes, and array_init always succeeds + +--- + php_yaz.c | 9 ++++----- + 1 file changed, 4 insertions(+), 5 deletions(-) + +diff --git a/php_yaz.c b/php_yaz.c +index 5a4ba0b..e0d5f6d 100644 +--- a/php_yaz.c ++++ b/php_yaz.c +@@ -832,8 +832,8 @@ PHP_FUNCTION(yaz_hits) + } else { + WRONG_PARAM_COUNT; + } +- if (searchresult && array_init(searchresult) == FAILURE) { +- RETURN_FALSE; ++ if (searchresult) { ++ array_init(searchresult); + } + get_assoc(INTERNAL_FUNCTION_PARAM_PASSTHRU, id, &p); + +@@ -1923,9 +1923,8 @@ PHP_FUNCTION(yaz_scan_result) + } + + array_init(return_value); +- +- if (pval_opt && array_init(pval_opt) == FAILURE) { +- RETURN_FALSE; ++ if (pval_opt) { ++ array_init(pval_opt); + } + + get_assoc(INTERNAL_FUNCTION_PARAM_PASSTHRU, pval_id, &p); diff --git a/PHPINFO b/PHPINFO new file mode 100644 index 0000000..b7ab24b --- /dev/null +++ b/PHPINFO @@ -0,0 +1,7 @@ + +yaz + +YAZ Support => enabled +PHP/YAZ Version => 1.2.2 +YAZ Version => 5.14.11 +Compiled with YAZ version => 5.14.11 diff --git a/php-pecl-yaz.spec b/php-pecl-yaz.spec index 5f46462..9c02f10 100644 --- a/php-pecl-yaz.spec +++ b/php-pecl-yaz.spec @@ -1,6 +1,6 @@ # remirepo spec file for php-pecl-yaz # -# Copyright (c) 2014-2017 Remi Collet +# Copyright (c) 2014-2018 Remi Collet # License: CC-BY-SA # http://creativecommons.org/licenses/by-sa/4.0/ # @@ -24,13 +24,16 @@ Summary: Z39.50/SRU client Name: %{?sub_prefix}php-pecl-%{pecl_name} Version: 1.2.2 -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: BSD Group: Development/Languages URL: http://pecl.php.net/package/%{pecl_name} Source0: http://pecl.php.net/get/%{pecl_name}-%{version}.tgz -BuildRequires: %{?scl_prefix}php-devel > 5.3 +Patch0: https://patch-diff.githubusercontent.com/raw/indexdata/phpyaz/pull/7.patch + +BuildRequires: %{?dtsprefix}gcc +BuildRequires: %{?scl_prefix}php-devel BuildRequires: %{?scl_prefix}php-pear BuildRequires: libyaz-devel >= 3.0.2 %if 0%{?rhel} == 6 @@ -38,7 +41,6 @@ BuildRequires: libyaz-devel >= 3.0.2 BuildRequires: tcp_wrappers-devel %endif - Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api} Requires: %{?scl_prefix}php(api) = %{php_core_api} %{?_sclreq:Requires: %{?scl_prefix}runtime%{?_sclreq}%{?_isa}} @@ -54,14 +56,6 @@ Provides: %{?scl_prefix}php-pecl-%{pecl_name}%{?_isa} = %{version}-%{rele %if "%{?vendor}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel} # Other third party repo stuff -Obsoletes: php53-pecl-%{pecl_name} <= %{version} -Obsoletes: php53u-pecl-%{pecl_name} <= %{version} -Obsoletes: php54-pecl-%{pecl_name} <= %{version} -Obsoletes: php54w-pecl-%{pecl_name} <= %{version} -%if "%{php_version}" > "5.5" -Obsoletes: php55u-pecl-%{pecl_name} <= %{version} -Obsoletes: php55w-pecl-%{pecl_name} <= %{version} -%endif %if "%{php_version}" > "5.6" Obsoletes: php56u-pecl-%{pecl_name} <= %{version} Obsoletes: php56w-pecl-%{pecl_name} <= %{version} @@ -110,6 +104,8 @@ sed -e 's/role="test"/role="src"/' \ -i package.xml cd NTS +%patch0 -p1 -b .pr7 + # Sanity check, really often broken extver=$(sed -n '/#define PHP_YAZ_VERSION/{s/.* "//;s/".*$//;p}' php_yaz.h) if test "x${extver}" != "x%{version}"; then @@ -177,7 +173,7 @@ do install -Dpm 644 NTS/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i done -%if 0%{?fedora} < 24 +%if 0%{?fedora} < 24 && 0%{?rhel} < 8 # when pear installed alone, after us %triggerin -- %{?scl_prefix}php-pear if [ -x %{__pecl} ] ; then @@ -246,6 +242,10 @@ REPORT_EXIT_STATUS=1 \ %changelog +* Wed Jun 27 2018 Remi Collet - 1.2.2-2 +- add patch for PHP 7.3 from + https://github.com/indexdata/phpyaz/pull/7 + * Tue Sep 12 2017 Remi Collet - 1.2.2-1 - Update to 1.2.2 -- cgit