summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2025-01-14 12:35:42 +0100
committerRemi Collet <remi@php.net>2025-01-14 12:35:42 +0100
commit4245463dd4e63e0ff2d06c30834ebf24c8e58127 (patch)
treeeb8e3bec1303f9edb3de55e6987ba805a7488e12
parent441b62a406a2dc79909945fd4cdca58738b9cfb9 (diff)
fix build with PHP 8.0 using patch from
https://github.com/SolidWorx/aspect/pull/2
-rw-r--r--2.patch35
-rw-r--r--php-solidworx-aspect.spec12
2 files changed, 44 insertions, 3 deletions
diff --git a/2.patch b/2.patch
new file mode 100644
index 0000000..f21bd76
--- /dev/null
+++ b/2.patch
@@ -0,0 +1,35 @@
+From 15ec253f8eab6c2fb3bd7c0b75c990acf478995c Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@remirepo.net>
+Date: Tue, 14 Jan 2025 12:31:49 +0100
+Subject: [PATCH] Fix #1 PHP 8.0 build
+
+---
+ aspect.c | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/aspect.c b/aspect.c
+index e301cf1..9e8e3e7 100644
+--- a/aspect.c
++++ b/aspect.c
+@@ -28,7 +28,7 @@ ZEND_DECLARE_MODULE_GLOBALS(aspect)
+
+ static void (*original_zend_execute_ex)(zend_execute_data *execute_data);
+
+-ZEND_API static void aspect_execute_ex(zend_execute_data *execute_data);
++static void aspect_execute_ex(zend_execute_data *execute_data);
+
+ static void handle_memoize_functions(zend_execute_data *execute_data);
+
+@@ -111,7 +111,11 @@ static void aspect_execute_ex(zend_execute_data *execute_data) {
+ zend_type return_type = ret_info->type;
+ uint32_t type_mask = return_type.type_mask;
+
+- if (type_mask & ((uint32_t)1 << IS_VOID) || type_mask & ((uint32_t)1 << IS_NEVER)) {
++ if (type_mask & ((uint32_t)1 << IS_VOID)
++#if PHP_VERSION_ID >= 80100
++ || type_mask & ((uint32_t)1 << IS_NEVER)
++#endif
++ ) {
+ // cannot memoize functions with void or never return types
+ // @TODO: Should this be an error/exception?
+ original_zend_execute_ex(execute_data);
diff --git a/php-solidworx-aspect.spec b/php-solidworx-aspect.spec
index 474ac57..9738ebc 100644
--- a/php-solidworx-aspect.spec
+++ b/php-solidworx-aspect.spec
@@ -30,15 +30,16 @@
Summary: PHP Aspect Extension
Name: %{?scl_prefix}php-%{pie_vend}-%{pie_proj}
Version: %{upstream_version}%{?upstream_prever:~%{upstream_prever}}
-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: MIT
URL: %{forgeurl}
Source0: %{forgesource}
+Patch0: https://patch-diff.githubusercontent.com/raw/SolidWorx/aspect/pull/2.patch
+
BuildRequires: make
BuildRequires: gcc
-# See https://github.com/SolidWorx/aspect/issues/1
-BuildRequires: %{?scl_prefix}php-devel >= 8.1
+BuildRequires: %{?scl_prefix}php-devel >= 8.0
Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api}
Requires: %{?scl_prefix}php(api) = %{php_core_api}
@@ -60,6 +61,7 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO
%prep
%forgesetup
+%patch -P0 -p1
: Sanity check, really often broken
extver=$(sed -n '/# define PHP_ASPECT_VERSION/{s/.* "//;s/".*$//;p}' php_aspect.h)
@@ -116,6 +118,10 @@ TEST_PHP_ARGS="-n -d extension=%{buildroot}/%{php_extdir}/%{ext_name}.so" \
%changelog
+* Tue Jan 14 2025 Remi Collet <remi@remirepo.net> - 0.1.0-2
+- fix build with PHP 8.0 using patch from
+ https://github.com/SolidWorx/aspect/pull/2
+
* Fri Jan 10 2025 Remi Collet <remi@remirepo.net> - 0.1.0-1
- initial package
- open https://github.com/SolidWorx/aspect/issues/1 PHP 8.0 build is broken