summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--0001-use-zend_ce_exception-instead-of-zend_exception_get_.patch29
-rw-r--r--4.patch37
-rw-r--r--php-pecl-crypto.spec27
3 files changed, 85 insertions, 8 deletions
diff --git a/0001-use-zend_ce_exception-instead-of-zend_exception_get_.patch b/0001-use-zend_ce_exception-instead-of-zend_exception_get_.patch
new file mode 100644
index 0000000..dc8c9b7
--- /dev/null
+++ b/0001-use-zend_ce_exception-instead-of-zend_exception_get_.patch
@@ -0,0 +1,29 @@
+From 5eec12d0995c683c1910487602db0bf4db022074 Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@remirepo.net>
+Date: Thu, 17 Jul 2025 10:59:20 +0200
+Subject: [PATCH] use zend_ce_exception instead of zend_exception_get_default()
+ for 8.5
+
+---
+ crypto.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/crypto.c b/crypto.c
+index d841831..fd8df42 100644
+--- a/crypto.c
++++ b/crypto.c
+@@ -76,7 +76,11 @@ PHP_MINIT_FUNCTION(crypto)
+ zend_class_entry ce;
+
+ /* Register base exception */
++#if PHP_VERSION_ID < 70000
+ PHP_CRYPTO_EXCEPTION_REGISTER_CE(ce, Crypto, zend_exception_get_default(TSRMLS_C));
++#else
++ PHP_CRYPTO_EXCEPTION_REGISTER_CE(ce, Crypto, zend_ce_exception);
++#endif
+
+ /* Init OpenSSL algorithms */
+ OpenSSL_add_all_algorithms();
+--
+2.50.1
+
diff --git a/4.patch b/4.patch
new file mode 100644
index 0000000..0c9f1f9
--- /dev/null
+++ b/4.patch
@@ -0,0 +1,37 @@
+From e9ad43262a6b036bf2f81013f23783eec619a537 Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@remirepo.net>
+Date: Wed, 30 Jul 2025 14:02:25 +0200
+Subject: [PATCH] use Zend/zend_smart_string.h
+
+---
+ phpc.h | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/phpc.h b/phpc.h
+index 93d5cca..075bbad 100644
+--- a/phpc.h
++++ b/phpc.h
+@@ -266,7 +266,11 @@ typedef int phpc_str_size_t;
+
+ /* Smart string */
+ #if defined(PHPC_SMART_STR_INCLUDE) || defined(PHPC_SMART_CSTR_INCLUDE)
++#if PHP_VERSION_ID < 70200
+ #include "ext/standard/php_smart_str.h"
++#else
++#include "Zend/zend_smart_str.h"
++#endif
+
+ #ifdef PHPC_SMART_CSTR_INCLUDE
+ /* smart_str for C string has been renamed in PHP 7 so we have to wrap it */
+@@ -929,7 +933,11 @@ typedef size_t phpc_str_size_t;
+ #endif /* PHPC_SMART_STR_INCLUDE */
+
+ #ifdef PHPC_SMART_CSTR_INCLUDE
++#if PHP_VERSION_ID < 70200
+ #include "ext/standard/php_smart_string.h"
++#else
++#include "Zend/zend_smart_string.h"
++#endif
+ /* smart_str for C string has been renamed in PHP 7 so we have to wrap it */
+ #define phpc_smart_cstr smart_string
+ #define phpc_smart_cstr_alloc smart_string_alloc
diff --git a/php-pecl-crypto.spec b/php-pecl-crypto.spec
index d775069..cf79f9d 100644
--- a/php-pecl-crypto.spec
+++ b/php-pecl-crypto.spec
@@ -1,8 +1,8 @@
# remirepo spec file for php-pecl-crypto
#
-# Copyright (c) 2013-2024 Remi Collet
-# License: CC-BY-SA-4.0
-# http://creativecommons.org/licenses/by-sa/4.0/
+# SPDX-FileCopyrightText: Copyright 2013-2025 Remi Collet
+# SPDX-License-Identifier: CECILL-2.1
+# http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
#
# Please, preserve the changelog entries
#
@@ -12,24 +12,22 @@
%bcond_without tests
%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
%global pecl_name crypto
-%if "%{php_version}" < "5.6"
-%global ini_name %{pecl_name}.ini
-%else
%global ini_name 40-%{pecl_name}.ini
-%endif
%global sources %{pecl_name}-%{version}
%global _configure ../%{sources}/configure
Summary: Wrapper for OpenSSL Crypto Library
Name: %{?scl_prefix}php-pecl-%{pecl_name}
Version: 0.3.2
-Release: 4%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+Release: 6%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
License: PHP-3.01
URL: https://pecl.php.net/package/%{pecl_name}
Source0: https://pecl.php.net/get/%{sources}.tgz
Patch0: 0001-Fix-Wincompatible-pointer-types.patch
Patch1: 0001-fix-for-PHP-8.4.patch
+Patch2: 0001-use-zend_ce_exception-instead-of-zend_exception_get_.patch
+Patch3: 4.patch
BuildRequires: make
BuildRequires: %{?dtsprefix}gcc
@@ -64,6 +62,10 @@ sed -e 's/role="test"/role="src"/' \
cd %{sources}
%patch -P0 -p1
%patch -P1 -p1
+%patch -P2 -p1
+cd phpc
+%patch -P3 -p1
+cd ..
# Sanity check, really often broken
extver=$(sed -n '/#define PHP_CRYPTO_VERSION/{s/.* "//;s/".*$//;p}' php_crypto.h)
@@ -180,6 +182,15 @@ REPORT_EXIT_STATUS=1 \
%changelog
+* Wed Jul 30 2025 Remi Collet <remi@remirepo.net> - 0.3.2-6
+- fix build with PHP 8.5.0alpha3 using patch from
+ https://github.com/bukka/phpc/pull/4
+
+* Thu Jul 17 2025 Remi Collet <remi@remirepo.net> - 0.3.2-5
+- fix build with PHP 8.5.0alpha2 using patch from
+ https://github.com/bukka/php-crypto/pull/42
+- re-license spec file to CECILL-2.1
+
* Wed Sep 25 2024 Remi Collet <remi@remirepo.net> - 0.3.2-4
- fix build with PHP 8.4 using patch from
https://github.com/bukka/php-crypto/pull/42