summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2021-08-04 11:55:46 +0200
committerRemi Collet <remi@remirepo.net>2021-08-04 11:55:46 +0200
commitd21b6ebf9818d37bcbe436cfcfd3274795192f89 (patch)
tree25fe7e883de89d1483d052f5e2a41f8973deddee
parent73ff2d88093c1014e008878344379f5496f1ab63 (diff)
add patch for PHP 8.1.0beta2 from
https://github.com/php-kafka/php-simple-kafka-client/pull/54
-rw-r--r--php-pecl-simple-kafka-client.spec10
-rw-r--r--simple_kafka_client-php81.patch59
2 files changed, 68 insertions, 1 deletions
diff --git a/php-pecl-simple-kafka-client.spec b/php-pecl-simple-kafka-client.spec
index ba833fa..fa44e3f 100644
--- a/php-pecl-simple-kafka-client.spec
+++ b/php-pecl-simple-kafka-client.spec
@@ -21,11 +21,13 @@
Summary: Kafka client based on librdkafka
Name: %{?sub_prefix}php-pecl-simple-kafka-client
Version: 0.1.3
-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
URL: https://pecl.php.net/package/%{pecl_name}
Source0: https://pecl.php.net/get/%{pecl_name}-%{version}.tgz
+Patch0: %{pecl_name}-php81.patch
+
BuildRequires: make
BuildRequires: %{?dtsprefix}gcc
BuildRequires: librdkafka1php-devel >= 1.7
@@ -77,6 +79,8 @@ sed -e 's/role="test"/role="src"/' \
-i package.xml
cd NTS
+%patch0 -p1 -b .pr54
+
# Sanity check, really often broken
extver=$(sed -n '/#define PHP_SIMPLE_KAFKA_CLIENT_VERSION/{s/.* "//;s/".*$//;p}' php_simple_kafka_client_int.h)
if test "x${extver}" != "x%{version}"; then
@@ -197,6 +201,10 @@ cd ../ZTS
%changelog
+* Wed Aug 4 2021 Remi Collet <remi@remirepo.net> - 0.1.3-2
+- add patch for PHP 8.1.0beta2 from
+ https://github.com/php-kafka/php-simple-kafka-client/pull/54
+
* Thu Jul 1 2021 Remi Collet <remi@remirepo.net> - 0.1.3-1
- update to 0.1.3
diff --git a/simple_kafka_client-php81.patch b/simple_kafka_client-php81.patch
new file mode 100644
index 0000000..05197d4
--- /dev/null
+++ b/simple_kafka_client-php81.patch
@@ -0,0 +1,59 @@
+From c5c97dc6750057807db318a6e587a62e3c751c97 Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@remirepo.net>
+Date: Wed, 4 Aug 2021 11:41:50 +0200
+Subject: [PATCH] fix proto for 8.1.0beta2
+
+---
+ metadata_collection.c | 8 +++++++-
+ metadata_collection.stub.php | 8 ++++----
+ metadata_collection_arginfo.h | 7 ++++---
+ 3 files changed, 15 insertions(+), 8 deletions(-)
+
+diff --git a/metadata_collection.c b/metadata_collection.c
+index 3af8357..c3b086a 100644
+--- a/metadata_collection.c
++++ b/metadata_collection.c
+@@ -39,9 +39,15 @@
+ #include "php_simple_kafka_client_int.h"
+ #include "ext/spl/spl_iterators.h"
+ #include "Zend/zend_interfaces.h"
+-#include "metadata_collection_arginfo.h"
+ #include "Zend/zend_exceptions.h"
+
++#if PHP_VERSION_ID < 80100
++#define ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(name, return_reference, required_num_args, type, allow_null) \
++ ZEND_BEGIN_ARG_INFO_EX(name, return_reference, required_num_args, allow_null)
++#endif
++
++#include "metadata_collection_arginfo.h"
++
+ typedef struct _object_intern {
+ zval zmetadata;
+ const void *items;
+diff --git a/metadata_collection_arginfo.h b/metadata_collection_arginfo.h
+index ce1df7e..7da4de4 100644
+--- a/metadata_collection_arginfo.h
++++ b/metadata_collection_arginfo.h
+@@ -1,5 +1,5 @@
+ /* This is a generated file, edit the .stub.php file instead.
+- * Stub hash: 925cbd1dcf14595ae437c111d3f99f767a665006 */
++ * Stub hash: c130cfc464b41b677ecde96328b3417797b5176d */
+
+ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_SimpleKafkaClient_Metadata_Collection_count, 0, 0, IS_LONG, 0)
+ ZEND_END_ARG_INFO()
+@@ -7,12 +7,13 @@ ZEND_END_ARG_INFO()
+ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_SimpleKafkaClient_Metadata_Collection_rewind, 0, 0, IS_VOID, 0)
+ ZEND_END_ARG_INFO()
+
+-ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SimpleKafkaClient_Metadata_Collection_current, 0, 0, 0)
++ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SimpleKafkaClient_Metadata_Collection_current, 0, 0, IS_MIXED, 0)
+ ZEND_END_ARG_INFO()
+
+ #define arginfo_class_SimpleKafkaClient_Metadata_Collection_key arginfo_class_SimpleKafkaClient_Metadata_Collection_count
+
+-#define arginfo_class_SimpleKafkaClient_Metadata_Collection_next arginfo_class_SimpleKafkaClient_Metadata_Collection_current
++ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SimpleKafkaClient_Metadata_Collection_next, 0, 0, IS_VOID, 0)
++ZEND_END_ARG_INFO()
+
+ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_SimpleKafkaClient_Metadata_Collection_valid, 0, 0, _IS_BOOL, 0)
+ ZEND_END_ARG_INFO()