summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--0001-Fix-Wincompatible-pointer-types.patch42
-rw-r--r--php-pecl-stats.spec55
2 files changed, 65 insertions, 32 deletions
diff --git a/0001-Fix-Wincompatible-pointer-types.patch b/0001-Fix-Wincompatible-pointer-types.patch
new file mode 100644
index 0000000..c5c98a2
--- /dev/null
+++ b/0001-Fix-Wincompatible-pointer-types.patch
@@ -0,0 +1,42 @@
+From 8af410e10a4e20c8ca87b1e8904bcd7c05344ace Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@remirepo.net>
+Date: Mon, 19 Feb 2024 14:56:01 +0100
+Subject: [PATCH] Fix [-Wincompatible-pointer-types]
+
+---
+ php_stats.c | 13 ++++++++-----
+ 1 file changed, 8 insertions(+), 5 deletions(-)
+
+diff --git a/php_stats.c b/php_stats.c
+index 7418dd8..851cb12 100644
+--- a/php_stats.c
++++ b/php_stats.c
+@@ -111,17 +111,20 @@ PHP_MINFO_FUNCTION(stats)
+ *
+ * This is not correct any more, depends on what compare_func is set to.
+ */
++#if PHP_VERSION_ID < 80000
+ static int stats_array_data_compare(const void *a, const void *b)
+ {
+- Bucket *f;
+- Bucket *s;
++ Bucket *f = (Bucket *) a;
++ Bucket *s = (Bucket *) b;
++#else
++static int stats_array_data_compare(Bucket *f, Bucket *s)
++{
++#endif
++
+ int result;
+ zval first;
+ zval second;
+
+- f = (Bucket *) a;
+- s = (Bucket *) b;
+-
+ first = f->val;
+ second = s->val;
+
+--
+2.43.2
+
diff --git a/php-pecl-stats.spec b/php-pecl-stats.spec
index b003dff..1d7806d 100644
--- a/php-pecl-stats.spec
+++ b/php-pecl-stats.spec
@@ -1,6 +1,6 @@
# spec file for php-pecl-stats
#
-# Copyright (c) 2013-2023 Remi Collet
+# Copyright (c) 2013-2024 Remi Collet
# License: CC-BY-SA-4.0
# http://creativecommons.org/licenses/by-sa/4.0/
#
@@ -21,7 +21,7 @@
Summary: Routines for statistical computation
Name: %{?scl_prefix}php-pecl-%{pecl_name}
Version: 2.0.3
-Release: 12%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+Release: 14%{?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
@@ -31,6 +31,8 @@ Source0: https://pecl.php.net/get/%{sources}.tgz
Patch0: %{pecl_name}-php7.patch
# Upstream patch for PHP 8
Patch1: %{pecl_name}-php8.patch
+# https://github.com/php/pecl-math-stats/pull/12
+Patch2: 0001-Fix-Wincompatible-pointer-types.patch
BuildRequires: make
BuildRequires: %{?dtsprefix}gcc
@@ -44,10 +46,6 @@ Provides: %{?scl_prefix}php-%{pecl_name} = %{version}
Provides: %{?scl_prefix}php-%{pecl_name}%{?_isa} = %{version}
Provides: %{?scl_prefix}php-pecl(%{pecl_name}) = %{version}
Provides: %{?scl_prefix}php-pecl(%{pecl_name})%{?_isa} = %{version}
-%if "%{?scl_prefix}" != "%{?sub_prefix}"
-Provides: %{?scl_prefix}php-pecl-%{pecl_name} = %{version}-%{release}
-Provides: %{?scl_prefix}php-pecl-%{pecl_name}%{?_isa} = %{version}-%{release}
-%endif
%description
@@ -61,13 +59,14 @@ 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 -b .upstream
%if "%{php_version}" > "8.0"
%patch -P1 -p1 -b .php8
+%patch -P2 -p1 -b .php8
%else
# don't deprecate function with typo
sed -e 's/PHP_DEP_FALIAS/PHP_FALIAS/' -i php_stats.c
@@ -98,13 +97,15 @@ EOF
cd %{sources}
%{__phpize}
+[ -f Makefile.global ] && GLOBAL=Makefile.global || GLOBAL=build/Makefile.global
+sed -e 's/INSTALL_ROOT/DESTDIR/' -i $GLOBAL
cd ../NTS
%configure \
--with-libdir=%{_lib} \
--with-php-config=%{__phpconfig}
-make %{?_smp_mflags}
+%make_build
%if %{with_zts}
cd ../ZTS
@@ -112,14 +113,14 @@ cd ../ZTS
--with-libdir=%{_lib} \
--with-php-config=%{__ztsphpconfig}
-make %{?_smp_mflags}
+%make_build
%endif
%install
%{?dtsenable}
-make -C NTS install INSTALL_ROOT=%{buildroot}
+%make_install -C NTS
# install config file
install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name}
@@ -128,7 +129,7 @@ install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name}
install -D -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml
%if %{with_zts}
-make -C ZTS install INSTALL_ROOT=%{buildroot}
+%make_install -C ZTS
install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name}
%endif
@@ -140,28 +141,11 @@ 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}
+# 002+ float(3.8459253727671E-16)
+# 002- float(0)
+rm tests/stats_stat_correlation.phpt
: Minimal load test for NTS extension
%{__php} --no-php-ini \
@@ -194,7 +178,7 @@ REPORT_EXIT_STATUS=1 \
%files
-%{?_licensedir:%license %{sources}/LICENSE}
+%license %{sources}/LICENSE
%doc %{pecl_docdir}/%{pecl_name}
%{pecl_xmldir}/%{name}.xml
%config(noreplace) %{php_inidir}/%{ini_name}
@@ -207,6 +191,13 @@ REPORT_EXIT_STATUS=1 \
%changelog
+* Mon Nov 25 2024 Remi Collet <remi@remirepo.net> - 2.0.3-14
+- spec cleanup
+
+* Mon Feb 19 2024 Remi Collet <remi@remirepo.net> - 2.0.3-13
+- fix incompatible-pointer-types using patch from
+ https://github.com/php/pecl-math-stats/pull/12
+
* Mon Sep 4 2023 Remi Collet <remi@remirepo.net> - 2.0.3-12
- build out of sources tree