summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pcov-php84.patch25
-rw-r--r--php-pecl-pcov.spec38
2 files changed, 38 insertions, 25 deletions
diff --git a/pcov-php84.patch b/pcov-php84.patch
new file mode 100644
index 0000000..238c7bf
--- /dev/null
+++ b/pcov-php84.patch
@@ -0,0 +1,25 @@
+From 7d764c7c2555e8287351961d72be3ebec4d8743f Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@remirepo.net>
+Date: Fri, 12 Jul 2024 10:18:53 +0200
+Subject: [PATCH] Fix php_pcre_match_impl with 8.4
+
+---
+ pcov.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/pcov.c b/pcov.c
+index f04ba9c..4f7d158 100644
+--- a/pcov.c
++++ b/pcov.c
+@@ -137,7 +137,11 @@ static zend_always_inline zend_bool php_pcov_wants(zend_string *filename) { /* {
+ ZSTR_VAL(filename), ZSTR_LEN(filename),
+ #endif
+ &match, NULL,
++#if PHP_VERSION_ID >= 80400
++ false, 0, 0);
++#else
+ 0, 0, 0, 0);
++#endif
+
+ if (zend_is_true(&match)) {
+ zend_hash_add_empty_element(
diff --git a/php-pecl-pcov.spec b/php-pecl-pcov.spec
index 3e6d84e..111cd01 100644
--- a/php-pecl-pcov.spec
+++ b/php-pecl-pcov.spec
@@ -1,6 +1,6 @@
# remirepo spec file for php-pecl-pcov
#
-# Copyright (c) 2019-2023 Remi Collet
+# Copyright (c) 2019-2024 Remi Collet
# License: CC-BY-SA-4.0
# http://creativecommons.org/licenses/by-sa/4.0/
#
@@ -17,10 +17,12 @@
Summary: Code coverage driver
Name: %{?scl_prefix}php-pecl-%{pecl_name}
Version: 1.0.11
-Release: 3%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+Release: 4%{?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/%{pecl_name}-%{version}.tgz
+Source0: https://pecl.php.net/get/%{sources}.tgz
+
+Patch0: %{pecl_name}-php84.patch
BuildRequires: make
BuildRequires: %{?dtsprefix}gcc
@@ -47,10 +49,12 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO
# Don't install/register tests
sed -e 's/role="test"/role="src"/' \
- %{?_licensedir:-e '/LICENSE/s/role="doc"/role="src"/' } \
+ -e '/LICENSE/s/role="doc"/role="src"/' \
-i package.xml
cd %{sources}
+%patch -P0 -p1
+
# Sanity check, really often broken
extver=$(sed -n '/#define PHP_PCOV_VERSION/{s/.* "//;s/".*$//;p}' php_pcov.h)
if test "x${extver}" != "x%{version}%{?prever:-%{prever}}"; then
@@ -132,26 +136,6 @@ do install -Dpm 644 $i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i
done
-%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} %{pecl_name} >/dev/null || :
-fi
-%endif
-
-
%check
cd %{sources}
@@ -180,7 +164,7 @@ REPORT_EXIT_STATUS=1 \
%files
-%{?_licensedir:%license %{sources}/LICENSE}
+%license %{sources}/LICENSE
%doc %{pecl_docdir}/%{pecl_name}
%{pecl_xmldir}/%{name}.xml
@@ -194,6 +178,10 @@ REPORT_EXIT_STATUS=1 \
%changelog
+* Fri Jul 12 2024 Remi Collet <remi@remirepo.net> - 1.0.11-4
+- add patch for PHP 8.4 from
+ https://github.com/krakjoe/pcov/pull/111
+
* Wed Aug 30 2023 Remi Collet <remi@remirepo.net> - 1.0.11-3
- rebuild for PHP 8.3.0RC1