summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2022-09-09 15:40:21 +0200
committerRemi Collet <remi@php.net>2022-09-09 15:40:21 +0200
commit97e518d714b116460e0aa9b878a982aa96da8a44 (patch)
treef2dc1ebf42d654a18bbe952522a3796ecf6e832c
parentfb4c17732956a11ffcf000e394b669c7d109a751 (diff)
add fix from PHP 8.2 from
https://github.com/php/pecl-search_engine-solr/pull/39
-rw-r--r--php-pecl-solr2.spec28
-rw-r--r--solr-php82.patch48
2 files changed, 60 insertions, 16 deletions
diff --git a/php-pecl-solr2.spec b/php-pecl-solr2.spec
index 649aabc..3b094e1 100644
--- a/php-pecl-solr2.spec
+++ b/php-pecl-solr2.spec
@@ -12,7 +12,6 @@
#
%if 0%{?scl:1}
%scl_package php-pecl-solr2
-%global sub_prefix %{scl_prefix}
%endif
%global pecl_name solr
@@ -28,9 +27,9 @@
Summary: Object oriented API to Apache Solr
Summary(fr): API orientée objet pour Apache Solr
-Name: %{?sub_prefix}php-pecl-solr2
+Name: %{?scl_prefix}php-pecl-solr2
Version: 2.5.1
-Release: 4%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+Release: 5%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
License: PHP
Group: Development/Languages
URL: https://pecl.php.net/package/solr
@@ -40,6 +39,8 @@ Source0: https://pecl.php.net/get/%{pecl_name}-%{version}%{?prever}.tgz
# compat with 8.1 from upstream
# compat with older from https://github.com/php/pecl-search_engine-solr/pull/32
Patch0: %{pecl_name}-build.patch
+# for PHP 8.2 from https://github.com/php/pecl-search_engine-solr/pull/39
+Patch1: %{pecl_name}-php82.patch
BuildRequires: make
BuildRequires: %{?dtsprefix}gcc
@@ -63,19 +64,9 @@ Provides: %{?scl_prefix}php-pecl(%{pecl_name}) = %{version}
Provides: %{?scl_prefix}php-pecl(%{pecl_name})%{?_isa} = %{version}
Provides: %{?scl_prefix}php-pecl-%{pecl_name} = %{version}-%{release}
Provides: %{?scl_prefix}php-pecl-%{pecl_name}%{?_isa} = %{version}-%{release}
-%if "%{?scl_prefix}" != "%{?sub_prefix}"
-Provides: %{?scl_prefix}php-pecl-%{pecl_name}2 = %{version}-%{release}
-Provides: %{?scl_prefix}php-pecl-%{pecl_name}2%{?_isa} = %{version}-%{release}
-%endif
-Obsoletes: %{?sub_prefix}php-pecl-%{pecl_name} < 2
-Provides: %{?sub_prefix}php-pecl-%{pecl_name} = %{version}-%{release}
-Provides: %{?sub_prefix}php-pecl-%{pecl_name}%{?_isa} = %{version}-%{release}
-
-%if "%{?packager}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel}
-%if "%{php_version}" > "7.4"
-Obsoletes: php74-pecl-%{pecl_name} <= %{version}
-%endif
-%endif
+Obsoletes: %{?scl_prefix}php-pecl-%{pecl_name} < 2
+Provides: %{?scl_prefix}php-pecl-%{pecl_name} = %{version}-%{release}
+Provides: %{?scl_prefix}php-pecl-%{pecl_name}%{?_isa} = %{version}-%{release}
%description
@@ -113,6 +104,7 @@ mv %{pecl_name}-%{version}%{?prever} NTS
cd NTS
%patch0 -p1 -b .up
+%patch1 -p1 -b .pr
: Check version
DIR=src/php7
@@ -256,6 +248,10 @@ TEST_PHP_EXECUTABLE=%{__ztsphp} \
%changelog
+* Fri Sep 9 2022 Remi Collet <remi@remirepo.net> - 2.5.1-5
+- add fix from PHP 8.2 from
+ https://github.com/php/pecl-search_engine-solr/pull/39
+
* Thu Mar 17 2022 Remi Collet <remi@remirepo.net> - 2.5.1-4
- add upstream to fix deprecation on return type
- fix compatiblity with older PHP verison from
diff --git a/solr-php82.patch b/solr-php82.patch
new file mode 100644
index 0000000..60e2871
--- /dev/null
+++ b/solr-php82.patch
@@ -0,0 +1,48 @@
+diff --git a/src/php7/php_solr.c b/src/php7/php_solr.c
+index 2110296..eb9dd22 100644
+--- a/src/php7/php_solr.c
++++ b/src/php7/php_solr.c
+@@ -542,6 +542,13 @@ ZEND_ARG_INFO(SOLR_ARG_PASS_BY_REF_FALSE, mime_type)
+ ZEND_ARG_OBJ_INFO(SOLR_ARG_PASS_BY_REF_TRUE, params, SolrModifiableParams, SOLR_ARG_ALLOW_NULL_FALSE)
+ ZEND_END_ARG_INFO()
+
++#if PHP_VERSION_ID >= 80200
++ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(Solr_toString_args, 0, 0, IS_STRING, 0)
++#else
++ZEND_BEGIN_ARG_INFO_EX(Solr_toString_args, 0, 0, 0)
++#endif
++ZEND_END_ARG_INFO();
++
+
+ /* }}} */
+
+@@ -607,7 +614,7 @@ static zend_function_entry solr_collapse_function_methods[] = {
+
+ PHP_ME(SolrCollapseFunction, setNullPolicy, SolrCollapseFunction_set_null_policy_args, ZEND_ACC_PUBLIC)
+ PHP_ME(SolrCollapseFunction, getNullPolicy, Solr_no_args, ZEND_ACC_PUBLIC)
+- PHP_ME(SolrCollapseFunction, __toString, Solr_no_args, ZEND_ACC_PUBLIC)
++ PHP_ME(SolrCollapseFunction, __toString, Solr_toString_args, ZEND_ACC_PUBLIC)
+ PHP_ME(SolrCollapseFunction, __sleep, Solr_no_args, ZEND_ACC_PUBLIC)
+ PHP_ME(SolrCollapseFunction, __wakeup, Solr_no_args, ZEND_ACC_PUBLIC)
+
+@@ -772,7 +779,7 @@ static zend_function_entry solr_illegal_argument_exception_methods[] = {
+ static zend_function_entry solr_params_methods[] = {
+ PHP_ME(SolrParams, setParam, SolrParams_setParam_args, ZEND_ACC_PUBLIC)
+ PHP_ME(SolrParams, addParam, SolrParams_addParam_args, ZEND_ACC_PUBLIC)
+- PHP_ME(SolrParams, __toString, Solr_no_args, ZEND_ACC_PUBLIC)
++ PHP_ME(SolrParams, __toString, Solr_toString_args, ZEND_ACC_PUBLIC)
+ PHP_ME(SolrParams, toString, SolrParams_toString_args, ZEND_ACC_PUBLIC)
+ PHP_ME(SolrParams, getParams, Solr_no_args, ZEND_ACC_PUBLIC)
+ PHP_ME(SolrParams, getParam, SolrParams_getParam_args, ZEND_ACC_PUBLIC)
+diff --git a/tests/test.config.inc b/tests/test.config.inc
+index 1d61156..1475d76 100644
+--- a/tests/test.config.inc
++++ b/tests/test.config.inc
+@@ -1,6 +1,6 @@
+ <?php
+
+-define('SOLR_SERVER_CONFIGURED', true);
++define('SOLR_SERVER_CONFIGURED', false);
+
+ define('ROOT_DIRECTORY', dirname(__FILE__));
+