From d822908a13b7ea9e6da33d7324600ae1f2b29fd2 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Fri, 28 Apr 2023 08:24:40 +0200 Subject: update to 0.12.2 fix extension version and build warnings, using patch from https://github.com/kjdev/php-ext-zstd/pull/57 --- PHPINFO | 4 +-- REFLECTION | 6 ++-- php-zstd.spec | 20 ++++++++----- zstd-pr57.patch | 90 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 107 insertions(+), 13 deletions(-) create mode 100644 zstd-pr57.patch diff --git a/PHPINFO b/PHPINFO index 7677966..9a68f60 100644 --- a/PHPINFO +++ b/PHPINFO @@ -2,6 +2,6 @@ zstd Zstd support => enabled -Extension Version => 0.12.1 -Interface Version => 1.5.2 +Extension Version => 0.12.2 +Interface Version => 1.5.5 APCu serializer ABI => 0 diff --git a/REFLECTION b/REFLECTION index 9225e4e..82c8cc7 100644 --- a/REFLECTION +++ b/REFLECTION @@ -1,4 +1,4 @@ -Extension [ extension #106 zstd version 0.12.1 ] { +Extension [ extension #108 zstd version 0.12.2 ] { - Dependencies { Dependency [ apcu (Optional) ] @@ -8,8 +8,8 @@ Extension [ extension #106 zstd version 0.12.1 ] { Constant [ int ZSTD_COMPRESS_LEVEL_MIN ] { 1 } Constant [ int ZSTD_COMPRESS_LEVEL_MAX ] { 22 } Constant [ int ZSTD_COMPRESS_LEVEL_DEFAULT ] { 3 } - Constant [ int LIBZSTD_VERSION_NUMBER ] { 10502 } - Constant [ string LIBZSTD_VERSION_STRING ] { 1.5.2 } + Constant [ int LIBZSTD_VERSION_NUMBER ] { 10505 } + Constant [ string LIBZSTD_VERSION_STRING ] { 1.5.5 } } - Functions { diff --git a/php-zstd.spec b/php-zstd.spec index 4c2f7d1..92519d9 100644 --- a/php-zstd.spec +++ b/php-zstd.spec @@ -10,17 +10,13 @@ # we don't want -z defs linker flag %undefine _strict_symbol_defs_build -%if 0%{?scl:1} -%scl_package php-zstd -%else -%global pkg_name %{name} -%endif +%{?scl:%scl_package php-zstd} %bcond_without tests %bcond_without apcu %bcond_without libzstd -%global zstdver 1.5.1 +%global zstdver 1.5.5 %global pecl_name zstd %global with_zts 0%{!?_without_zts:%{?__ztsphp:1}} @@ -29,7 +25,7 @@ Summary: Zstandard extension Name: %{?scl_prefix}php-%{pecl_name} -Version: 0.12.1 +Version: 0.12.2 Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} %if %{with libzstd} License: MIT @@ -40,6 +36,8 @@ License: MIT AND BSD-3-Clause URL: https://pecl.php.net/package/%{pecl_name} Source0: https://pecl.php.net/get/%{pecl_name}-%{version}%{?prever}.tgz +Patch0: %{pecl_name}-pr57.patch + BuildRequires: %{?dtsprefix}gcc BuildRequires: %{?scl_prefix}php-devel >= 7.0 %if %{with apcu} @@ -87,6 +85,7 @@ mv %{pecl_name}-%{version} NTS %{?_licensedir:sed -e '/LICENSE/s/role="doc"/role="src"/' -i package.xml} cd NTS +%patch -P0 -p1 -b .pr57 cp zstd/LICENSE LICENSE-libzstd @@ -97,7 +96,7 @@ sed -e '\:"zstd/:d' -i ../package.xml %endif # Sanity check, really often broken -extver=$(sed -n '/#define PHP_ZSTD_EXT_VERSION/{s/.* "//;s/".*$//;p}' php_zstd.h) +extver=$(sed -n '/#define PHP_ZSTD_VERSION/{s/.* "//;s/".*$//;p}' php_zstd.h) if test "x${extver}" != "x%{version}%{?gh_date:-dev}"; then : Error: Upstream extension version is ${extver}, expecting %{version}%{?gh_date:-dev}. exit 1 @@ -245,6 +244,11 @@ TEST_PHP_ARGS="-n -d extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so" \ %changelog +* Fri Apr 28 2023 Remi Collet - 0.12.2-1 +- update to 0.12.2 +- fix extension version and build warnings, using patch from + https://github.com/kjdev/php-ext-zstd/pull/57 + * Mon Jan 23 2023 Remi Collet - 0.12.1-1 - update to 0.12.1 diff --git a/zstd-pr57.patch b/zstd-pr57.patch new file mode 100644 index 0000000..92ed1ef --- /dev/null +++ b/zstd-pr57.patch @@ -0,0 +1,90 @@ +From 206c1042ed7f813a717d81217fd325c1d15e91f2 Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Fri, 28 Apr 2023 08:01:46 +0200 +Subject: [PATCH 1/3] fix [-Wunused-variable] + +--- + zstd.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/zstd.c b/zstd.c +index 06e0549..81694a0 100644 +--- a/zstd.c ++++ b/zstd.c +@@ -592,7 +592,6 @@ static size_t php_zstd_comp_write(php_stream *stream, const char *buf, size_t co + #else + static ssize_t php_zstd_comp_write(php_stream *stream, const char *buf, size_t count) + { +- ssize_t ret = 0; + #endif + + STREAM_DATA_FROM_STREAM(); + +From 3a37d5417c08e640629b2558da5829bf3609e960 Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Fri, 28 Apr 2023 08:02:26 +0200 +Subject: [PATCH 2/3] fix [-Wpointer-sign] + +--- + zstd.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/zstd.c b/zstd.c +index 81694a0..6c1310a 100644 +--- a/zstd.c ++++ b/zstd.c +@@ -855,7 +855,7 @@ static int APC_SERIALIZER_NAME(zstd)(APC_SERIALIZER_ARGS) + } + + size = ZSTD_compressBound(ZSTR_LEN(var.s)); +- *buf = (char*) emalloc(size + 1); ++ *buf = emalloc(size + 1); + + *buf_len = ZSTD_compress(*buf, size, ZSTR_VAL(var.s), ZSTR_LEN(var.s), + DEFAULT_COMPRESS_LEVEL); + +From ee6c47a34616c69af7bc0c27a7f4a3b948c461df Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Fri, 28 Apr 2023 08:05:21 +0200 +Subject: [PATCH 3/3] use normalized macro name + +--- + php_zstd.h | 2 +- + zstd.c | 4 ++-- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/php_zstd.h b/php_zstd.h +index 731ae23..8aca8f8 100644 +--- a/php_zstd.h ++++ b/php_zstd.h +@@ -24,7 +24,7 @@ + #ifndef PHP_ZSTD_H + #define PHP_ZSTD_H + +-#define PHP_ZSTD_EXT_VERSION "0.12.1" ++#define PHP_ZSTD_VERSION "0.12.2" + #define PHP_ZSTD_NS "Zstd" + + extern zend_module_entry zstd_module_entry; +diff --git a/zstd.c b/zstd.c +index 6c1310a..924df38 100644 +--- a/zstd.c ++++ b/zstd.c +@@ -955,7 +955,7 @@ ZEND_MINFO_FUNCTION(zstd) + { + php_info_print_table_start(); + php_info_print_table_row(2, "Zstd support", "enabled"); +- php_info_print_table_row(2, "Extension Version", PHP_ZSTD_EXT_VERSION); ++ php_info_print_table_row(2, "Extension Version", PHP_ZSTD_VERSION); + php_info_print_table_row(2, "Interface Version", ZSTD_VERSION_STRING); + #if defined(HAVE_APCU_SUPPORT) + php_info_print_table_row(2, "APCu serializer ABI", APC_SERIALIZER_ABI); +@@ -1023,7 +1023,7 @@ zend_module_entry zstd_module_entry = { + NULL, + NULL, + ZEND_MINFO(zstd), +- PHP_ZSTD_EXT_VERSION, ++ PHP_ZSTD_VERSION, + STANDARD_MODULE_PROPERTIES + }; + -- cgit