From c0586611f69be630bb0d0ef12c4569c01d6d1d15 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 24 Apr 2024 08:50:53 +0200 Subject: update to 0.5.0 fix build with old GCC (EL-7) using patch from https://github.com/beberlei/hdrhistogram-php/pull/38 --- hdr_histogram-build.patch | 45 +++++++++++++++++++++++++++++++++++++++++++++ php-pecl-hdr-histogram.spec | 11 ++++++++++- 2 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 hdr_histogram-build.patch diff --git a/hdr_histogram-build.patch b/hdr_histogram-build.patch new file mode 100644 index 0000000..0f043ee --- /dev/null +++ b/hdr_histogram-build.patch @@ -0,0 +1,45 @@ +From 5b5990ab8093aa408f91de456b3ce7284dc35d63 Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Wed, 24 Apr 2024 08:46:46 +0200 +Subject: [PATCH 1/2] fix decl requiring c99 + +--- + hdrhistogram.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/hdrhistogram.c b/hdrhistogram.c +index c24d1eb..baf9281 100644 +--- a/hdrhistogram.c ++++ b/hdrhistogram.c +@@ -673,7 +673,8 @@ PHP_FUNCTION(hdr_export) + + int64_t found = 0; + zend_long skipped = 0; +- for (int32_t i = 0; i < hdr->counts_len; i++) { ++ int32_t i; ++ for (i = 0; i < hdr->counts_len; i++) { + if (found >= hdr->total_count) { + break; + } + +From 3f378645578cae0a48bb98a01153353adc104d85 Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Wed, 24 Apr 2024 08:47:29 +0200 +Subject: [PATCH 2/2] fix warning [-Wunused-but-set-variable] + +--- + hdrhistogram.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/hdrhistogram.c b/hdrhistogram.c +index baf9281..842ad26 100644 +--- a/hdrhistogram.c ++++ b/hdrhistogram.c +@@ -775,6 +775,7 @@ PHP_FUNCTION(hdr_import) + zend_ulong num_key; + int bucket = 0; + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(value), num_key, key, item) { ++ (void)num_key; + if (!key && bucket < hdr->counts_len) { + convert_to_long_ex(item); + if (Z_LVAL_P(item) > 0) { diff --git a/php-pecl-hdr-histogram.spec b/php-pecl-hdr-histogram.spec index 3e8b3d5..d2f59bc 100644 --- a/php-pecl-hdr-histogram.spec +++ b/php-pecl-hdr-histogram.spec @@ -21,13 +21,15 @@ Summary: PHP extension wrapper for the C hdrhistogram API Name: %{?scl_prefix}php-pecl-hdr-histogram Version: 0.5.0 -Release: 0%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} License: BSD-2-Clause Group: Development/Languages URL: https://pecl.php.net/package/%{proj_name} Source: https://pecl.php.net/get/%{sources}.tgz +Patch0: %{proj_name}-build.patch + BuildRequires: make BuildRequires: %{?dtsprefix}gcc BuildRequires: %{?scl_prefix}php-devel >= 7.0 @@ -67,6 +69,8 @@ sed -e 's/role="test"/role="src"/' \ -i package.xml cd %{sources} +%patch -P0 -p1 + # Check upstream version (often broken) extver=$(sed -n '/#define PHP_HDR_HISTOGRAM_VERSION/{s/.* "//;s/".*$//;p}' php_hdrhistogram.h) if test "x${extver}" != "x%{version}"; then @@ -196,6 +200,11 @@ fi %changelog +* Wed Apr 24 2024 Remi Collet - 0.5.0-1 +- update to 0.5.0 +- fix build with old GCC (EL-7) using patch from + https://github.com/beberlei/hdrhistogram-php/pull/38 + * Tue Apr 23 2024 Remi Collet - 0.5.0-0 - test build for upcoming 0.5.0 - drop patches merged upstream -- cgit