summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mongodb-php81.patch32
-rw-r--r--php-pecl-mongodb.spec10
2 files changed, 41 insertions, 1 deletions
diff --git a/mongodb-php81.patch b/mongodb-php81.patch
new file mode 100644
index 0000000..d30767a
--- /dev/null
+++ b/mongodb-php81.patch
@@ -0,0 +1,32 @@
+From 6b4109bb3657d6611f116e06a91699952b8a2fc5 Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@remirepo.net>
+Date: Fri, 23 Jul 2021 12:21:44 +0200
+Subject: [PATCH] Fix API change in 8.1.0beta1
+
+---
+ php_phongo.h | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/php_phongo.h b/php_phongo.h
+index bf6bf094..7b0c1a3b 100644
+--- a/php_phongo.h
++++ b/php_phongo.h
+@@ -169,11 +169,18 @@ bool php_phongo_manager_unregister(php_phongo_manager_t* manager);
+ ce->ce_flags |= ZEND_ACC_FINAL; \
+ } while (0);
+
++#if PHP_VERSION_ID < 80100
+ #define PHONGO_CE_DISABLE_SERIALIZATION(ce) \
+ do { \
+ ce->serialize = zend_class_serialize_deny; \
+ ce->unserialize = zend_class_unserialize_deny; \
+ } while (0);
++#else
++#define PHONGO_CE_DISABLE_SERIALIZATION(ce) \
++ do { \
++ ce->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE; \
++ } while (0);
++#endif
+
+ #define PHONGO_GET_PROPERTY_HASH_INIT_PROPS(is_debug, intern, props, size) \
+ do { \
diff --git a/php-pecl-mongodb.spec b/php-pecl-mongodb.spec
index 43ab88a..efd00f8 100644
--- a/php-pecl-mongodb.spec
+++ b/php-pecl-mongodb.spec
@@ -49,11 +49,13 @@ Name: %{?sub_prefix}php-pecl-%{pecl_name}
#global upstream_prever alpha1
#global upstream_lower ~alpha1
Version: %{upstream_version}%{?upstream_lower}
-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;')}}
License: ASL 2.0
URL: https://pecl.php.net/package/%{pecl_name}
Source0: https://pecl.php.net/get/%{pecl_name}-%{upstream_version}%{?upstream_prever}.tgz
+Patch0: %{pecl_name}-php81.patch
+
BuildRequires: make
BuildRequires: %{?dtsprefix}gcc
BuildRequires: %{?scl_prefix}php-devel >= 7.1
@@ -146,6 +148,8 @@ sed -e 's/role="test"/role="src"/' \
-i package.xml
cd NTS
+%patch0 -p1 -b .php81
+
%if 0%{?rhel} == 8
# temporary: lower minimal required version
sed -e 's/1.16.2/1.16.1/;s/1.0.3/1.0.1/' -i config.m4
@@ -338,6 +342,10 @@ exit $ret
%changelog
+* Fri Jul 23 2021 Remi Collet <remi@remirepo.net> - 1.10.0-2
+- add patch for PHP 8.1.0beta1 from
+ https://github.com/mongodb/mongo-php-driver/pull/1240
+
* Wed Jul 14 2021 Remi Collet <remi@remirepo.net> - 1.10.0-1
- update to 1.10.0
- with libbson and libmongoc 1.18.0