summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--0001-use-zend_ce_exception-instead-of-zend_exception_get_.patch26
-rw-r--r--php-pecl-luasandbox.spec44
2 files changed, 40 insertions, 30 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..dcbe573
--- /dev/null
+++ b/0001-use-zend_ce_exception-instead-of-zend_exception_get_.patch
@@ -0,0 +1,26 @@
+From 5e800d53c8430aff7bc0e0422e7c86eea370570f Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@remirepo.net>
+Date: Thu, 17 Jul 2025 15:07:36 +0200
+Subject: [PATCH] use zend_ce_exception instead of zend_exception_get_default()
+ for 8.5
+
+---
+ luasandbox.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/luasandbox.c b/luasandbox.c
+index d4f71e7..4d65a26 100644
+--- a/luasandbox.c
++++ b/luasandbox.c
+@@ -247,7 +247,7 @@ PHP_MINIT_FUNCTION(luasandbox)
+ "PERCENT", sizeof("PERCENT")-1, LUASANDBOX_PERCENT);
+
+ INIT_CLASS_ENTRY(ce, "LuaSandboxError", luasandbox_empty_methods);
+- luasandboxerror_ce = compat_zend_register_internal_class_ex(&ce, zend_exception_get_default());
++ luasandboxerror_ce = compat_zend_register_internal_class_ex(&ce, zend_ce_exception);
+ zend_declare_class_constant_long(luasandboxerror_ce,
+ "RUN", sizeof("RUN")-1, LUA_ERRRUN);
+ zend_declare_class_constant_long(luasandboxerror_ce,
+--
+2.50.1
+
diff --git a/php-pecl-luasandbox.spec b/php-pecl-luasandbox.spec
index 521b3c2..13b096b 100644
--- a/php-pecl-luasandbox.spec
+++ b/php-pecl-luasandbox.spec
@@ -1,8 +1,8 @@
# remirepo spec file for php-pecl-luasandbox
#
-# Copyright (c) 2015-2023 Remi Collet
-# License: CC-BY-SA-4.0
-# http://creativecommons.org/licenses/by-sa/4.0/
+# SPDX-FileCopyrightText: Copyright 2015-2025 Remi Collet
+# SPDX-License-Identifier: CECILL-2.1
+# http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
#
# Please, preserve the changelog entries
#
@@ -21,21 +21,19 @@
Summary: Lua interpreter with limits and safe environment
Name: %{?scl_prefix}php-pecl-%{pecl_name}
Version: 4.1.2
-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: MIT
URL: https://pecl.php.net/package/%{proj_name}
Source0: https://pecl.php.net/get/%{sources}.tgz
+Patch0: 0001-use-zend_ce_exception-instead-of-zend_exception_get_.patch
+
BuildRequires: make
BuildRequires: %{?dtsprefix}gcc
BuildRequires: %{?scl_prefix}php-devel >= 7.2
BuildRequires: %{?scl_prefix}php-pear
# version 5.1 required
-%if 0%{?fedora} >=20 || 0%{?rhel} >= 8
BuildRequires: compat-lua-devel
-%else
-BuildRequires: lua-devel
-%endif
Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api}
Requires: %{?scl_prefix}php(api) = %{php_core_api}
@@ -60,10 +58,12 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO
# Don't install tests
sed -e 's/role="test"/role="src"/' \
- %{?_licensedir:-e '/COPYING/s/role="doc"/role="src"/' } \
+ -e '/COPYING/s/role="doc"/role="src"/' \
-i package.xml
cd %{sources}
+%patch -P0 -p1
+
: Sanity check, really often broken
extver=$(sed -n '/#define LUASANDBOX_VERSION /{s/.* "//;s/".*$//;p}' luasandbox_version.h)
if test "x${extver}" != "x%{version}"; then
@@ -167,29 +167,9 @@ REPORT_EXIT_STATUS=1 \
%endif
-%if 0%{?fedora} < 24 && 0%{?rhel} < 8
-# when pear installed alone, after us
-%triggerin -- %{?scl_prefix}php-pear
-if [ -x %{__pecl} ] ; then
- %{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || :
-fi
-
-# posttrans as pear can be installed after us
-%posttrans
-if [ -x %{__pecl} ] ; then
- %{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || :
-fi
-
-%postun
-if [ $1 -eq 0 -a -x %{__pecl} ] ; then
- %{pecl_uninstall} %{proj_name} >/dev/null || :
-fi
-%endif
-
-
%files
%doc %{pecl_docdir}/%{pecl_name}
-%{?_licensedir:%license %{sources}/COPYING}
+%license %{sources}/COPYING
%{pecl_xmldir}/%{name}.xml
%config(noreplace) %{php_inidir}/%{ini_name}
@@ -202,6 +182,10 @@ fi
%changelog
+* Thu Jul 17 2025 Remi Collet <remi@remirepo.net> - 4.1.2-2
+- add fix for PHP 8.5.0alpha2, patch sent to author
+- re-license spec file to CECILL-2.1
+
* Wed Dec 13 2023 Remi Collet <remi@remirepo.net> - 4.1.2-1
- update to 4.1.2