summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--9.patch22
-rw-r--r--php-pecl-seassnowflake.spec26
2 files changed, 30 insertions, 18 deletions
diff --git a/9.patch b/9.patch
new file mode 100644
index 0000000..c37a501
--- /dev/null
+++ b/9.patch
@@ -0,0 +1,22 @@
+From b164b83c6a25a820df4ada579dbd80c962a85b24 Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@remirepo.net>
+Date: Thu, 15 Sep 2022 09:02:36 +0200
+Subject: [PATCH] declare class properties
+
+---
+ SeasSnowflake.cpp | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/SeasSnowflake.cpp b/SeasSnowflake.cpp
+index 7c5fee0..12c0d99 100644
+--- a/SeasSnowflake.cpp
++++ b/SeasSnowflake.cpp
+@@ -94,6 +94,8 @@ PHP_MINIT_FUNCTION(SeasSnowflake)
+ INIT_CLASS_ENTRY(SeasSnowflake, SEASSNOWFLAKE_RES_NAME, SeasSnowflake_methods);
+ #if PHP_VERSION_ID >= 70000
+ SeasSnowflake_ce = zend_register_internal_class_ex(&SeasSnowflake, NULL);
++ zend_declare_property_null(SeasSnowflake_ce, "worker_id", sizeof("worker_id")-1, ZEND_ACC_PUBLIC);
++ zend_declare_property_null(SeasSnowflake_ce, "datacenter_id", sizeof("datacenter_id")-1, ZEND_ACC_PUBLIC);
+ #else
+ SeasSnowflake_ce = zend_register_internal_class_ex(&SeasSnowflake, NULL, NULL TSRMLS_CC);
+ #endif
diff --git a/php-pecl-seassnowflake.spec b/php-pecl-seassnowflake.spec
index 9218584..e1018eb 100644
--- a/php-pecl-seassnowflake.spec
+++ b/php-pecl-seassnowflake.spec
@@ -1,6 +1,6 @@
# remirepo spec file for php-pecl-seassnowflake
#
-# Copyright (c) 2021 Remi Collet
+# Copyright (c) 2021-2022 Remi Collet
# License: CC-BY-SA
# http://creativecommons.org/licenses/by-sa/4.0/
#
@@ -22,7 +22,7 @@
Summary: PHP Extension for Distributed unique ID generator
Name: %{?scl_prefix}php-pecl-%{rpm_name}
Version: 1.0.0
-Release: 2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+Release: 3%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
License: PHP
URL: https://pecl.php.net/package/%{proj_name}
Source0: https://pecl.php.net/get/%{proj_name}-%{version}.tgz
@@ -30,6 +30,7 @@ Source0: https://pecl.php.net/get/%{proj_name}-%{version}.tgz
Patch0: https://patch-diff.githubusercontent.com/raw/SeasX/SeasSnowflake/pull/3.patch
Patch1: https://patch-diff.githubusercontent.com/raw/SeasX/SeasSnowflake/pull/5.patch
Patch2: https://patch-diff.githubusercontent.com/raw/SeasX/SeasSnowflake/pull/6.patch
+Patch3: https://patch-diff.githubusercontent.com/raw/SeasX/SeasSnowflake/pull/9.patch
BuildRequires: make
BuildRequires: %{?dtsprefix}gcc
@@ -46,22 +47,6 @@ Provides: %{?scl_prefix}php-%{pecl_name}%{?_isa} = %{version}
Provides: %{?scl_prefix}php-pecl(%{proj_name}) = %{version}
Provides: %{?scl_prefix}php-pecl(%{proj_name})%{?_isa} = %{version}
-%if "%{?packager}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel}
-# Other third party repo stuff
-%if "%{php_version}" > "7.3"
-Obsoletes: php73-pecl-%{pecl_name} <= %{version}
-%endif
-%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
SeasSnowflake is a distributed unique ID generator inspired by
@@ -86,6 +71,7 @@ find . -type f -exec chmod -x {} \;
%patch0 -p1
%patch1 -p1
%patch2 -p1
+%patch3 -p1
: Sanity check, really often broken
extver=$(sed -n '/#define PHP_SEASSNOWFLAKE_VERSION /{s/.* "//;s/".*$//;p}' php_SeasSnowflake.h)
@@ -209,6 +195,10 @@ fi
%changelog
+* Thu Sep 15 2022 Remi Collet <remi@remirepo.net> - 1.0.0-3
+- add patch for PHP 8.2 from
+ https://github.com/SeasX/SeasSnowflake/pull/9
+
* Wed Sep 01 2021 Remi Collet <remi@remirepo.net> - 1.0.0-2
- rebuild for 8.1.0RC1