summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2022-10-03 16:03:46 +0200
committerRemi Collet <remi@php.net>2022-10-03 16:03:46 +0200
commitae81b61a5c8628a09b237e32c762f552a527cec8 (patch)
tree17f0966b4e3e864696d97f256952c892ed07b257
parent68dbdd381576ccfe750405cb79bfaca74d0c96e1 (diff)
add patch for PHP 8.2 from
https://github.com/laruence/yar/pull/177
-rw-r--r--php-pecl-yar.spec32
-rw-r--r--yar-php82.patch68
2 files changed, 79 insertions, 21 deletions
diff --git a/php-pecl-yar.spec b/php-pecl-yar.spec
index d3e4b8a..07a8b8d 100644
--- a/php-pecl-yar.spec
+++ b/php-pecl-yar.spec
@@ -7,7 +7,6 @@
# Please, preserve the changelog entries
#
%if 0%{?scl:1}
-%global sub_prefix %{scl_prefix}
%scl_package php-pecl-yar
%endif
@@ -24,25 +23,27 @@
%global ini_name 50-%{pecl_name}.ini
Summary: Light, concurrent RPC framework
-Name: %{?sub_prefix}php-pecl-%{pecl_name}
+Name: %{?scl_prefix}php-pecl-%{pecl_name}
Version: 2.3.2
%if 0%{?gh_date:1}
Release: 0.14.%{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;')}}
Source0: https://pecl.php.net/get/%{pecl_name}-%{version}.tgz
%endif
License: PHP
URL: https://pecl.php.net/package/%{pecl_name}
+Patch0: %{pecl_name}-php82.patch
+
BuildRequires: %{?dtsprefix}gcc
BuildRequires: make
BuildRequires: curl-devel
BuildRequires: %{?scl_prefix}php-devel >= 7.0
BuildRequires: %{?scl_prefix}php-pear
BuildRequires: %{?scl_prefix}php-json
-BuildRequires: %{?sub_prefix}php-pecl-msgpack-devel
+BuildRequires: %{?scl_prefix}php-pecl-msgpack-devel
Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api}
Requires: %{?scl_prefix}php(api) = %{php_core_api}
@@ -55,23 +56,6 @@ 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 "%{?packager}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel}
-# Other third party repo stuff
-%if "%{php_version}" > "7.4"
-Obsoletes: php74-pecl-%{pecl_name} <= %{version}
-%endif
-%if "%{php_version}" > "8.0"
-Obsoletes: php80-pecl-%{pecl_name} <= %{version}
-%endif
-%if "%{php_version}" > "8.1"
-Obsoletes: php81-pecl-%{pecl_name} <= %{version}
-%endif
-%endif
%description
@@ -96,6 +80,8 @@ sed -e 's/role="test"/role="src"/' \
-i package.xml
cd NTS
+%patch0 -p1 -b .pr177
+
# Sanity check, really often broken
extver=$(sed -n '/#define PHP_YAR_VERSION/{s/.* "//;s/".*$//;p}' php_yar.h)
if test "x${extver}" != "x%{version}%{?prever:-%{prever}}%{?gh_date:-dev}"; then
@@ -253,6 +239,10 @@ export YAR_API_PORT=$(%{__php} -r 'echo 8960 + PHP_MAJOR_VERSION*100 + PHP_MINOR
%changelog
+* Mon Oct 3 2022 Remi Collet <remi@remirepo.net> - 2.3.2-2
+- add patch for PHP 8.2 from
+ https://github.com/laruence/yar/pull/177
+
* Wed May 18 2022 Remi Collet <remi@remirepo.net> - 2.3.2-1
- update to 2.3.2
diff --git a/yar-php82.patch b/yar-php82.patch
new file mode 100644
index 0000000..514acff
--- /dev/null
+++ b/yar-php82.patch
@@ -0,0 +1,68 @@
+From 15ece2444d614bac545b5d1cd7ea86a2881a9ddd Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@remirepo.net>
+Date: Mon, 19 Sep 2022 13:12:47 +0200
+Subject: [PATCH 1/2] fix random seed check for PHP 8
+
+---
+ yar_request.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/yar_request.c b/yar_request.c
+index be6a41b..59f527e 100644
+--- a/yar_request.c
++++ b/yar_request.c
+@@ -34,7 +34,11 @@
+ yar_request_t *php_yar_request_instance(zend_string *method, zend_array *parameters, void **options) /* {{{ */ {
+ yar_request_t *request = emalloc(sizeof(yar_request_t));
+
++#if PHP_VERSION_ID < 80200
+ if (!BG(mt_rand_is_seeded)) {
++#else
++ if (!RANDOM_G(mt19937_seeded)) {
++#endif
+ php_mt_srand(GENERATE_SEED());
+ }
+
+
+From 865d2e0615fcfb969db87f254792ec3844600280 Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@remirepo.net>
+Date: Mon, 19 Sep 2022 13:13:01 +0200
+Subject: [PATCH 2/2] fix tests for PHP 8.2
+
+---
+ tests/yar.inc | 20 +++++++++++---------
+ 1 file changed, 11 insertions(+), 9 deletions(-)
+
+diff --git a/tests/yar.inc b/tests/yar.inc
+index d5c3693..d096f88 100644
+--- a/tests/yar.inc
++++ b/tests/yar.inc
+@@ -105,17 +105,19 @@ PHP;
+
+ function yar_server_cleanup() {
+ $dir = dirname(__FILE__) . DIRECTORY_SEPARATOR . "htdocs";
+- $dp = opendir($dir);
+- while (($f = readdir($dp))) {
+- if (in_array($f, array('.', '..'))) {
+- continue;
+- }
+- $path = $dir . DIRECTORY_SEPARATOR . $f;
+- if (is_file($path)) {
+- unlink($path);
++ if (is_dir($dir)) {
++ $dp = opendir($dir);
++ while (($f = readdir($dp))) {
++ if (in_array($f, array('.', '..'))) {
++ continue;
++ }
++ $path = $dir . DIRECTORY_SEPARATOR . $f;
++ if (is_file($path)) {
++ unlink($path);
++ }
+ }
++ rmdir($dir);
+ }
+- rmdir($dir);
+ }
+
+ /* For TCP */