summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2019-07-24 08:06:05 +0200
committerRemi Collet <remi@remirepo.net>2019-07-24 08:06:05 +0200
commite79fcd4985dd0c89a3686f3073de183a007d959c (patch)
tree0e7dc8ccecdf9258b3c4ce71df22dff29b8689a6
parent827fd863a9c84df2d893d140c380a34c8f92dc1f (diff)
add patch for 7.4.0beta1 from https://github.com/kjdev/php-ext-brotli/pull/23
-rw-r--r--23.patch68
-rw-r--r--php-brotli.spec9
2 files changed, 76 insertions, 1 deletions
diff --git a/23.patch b/23.patch
new file mode 100644
index 0000000..52af90b
--- /dev/null
+++ b/23.patch
@@ -0,0 +1,68 @@
+From ebd41e895b08445275bef0befeadb2eeba156835 Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@remirepo.net>
+Date: Wed, 24 Jul 2019 07:58:34 +0200
+Subject: [PATCH] fix for stream change in 7.4.0beta1
+
+---
+ brotli.c | 23 +++++++++++++++++++++--
+ 1 file changed, 21 insertions(+), 2 deletions(-)
+
+diff --git a/brotli.c b/brotli.c
+index 891f706..87f8d2f 100644
+--- a/brotli.c
++++ b/brotli.c
+@@ -470,11 +470,19 @@ static int php_brotli_decompress_close(php_stream *stream,
+ return EOF;
+ }
+
++#if PHP_VERSION_ID < 70400
+ static size_t php_brotli_decompress_read(php_stream *stream,
+ char *buf,
+ size_t count TSRMLS_DC)
+ {
+ size_t ret = 0;
++#else
++static ssize_t php_brotli_decompress_read(php_stream *stream,
++ char *buf,
++ size_t count TSRMLS_DC)
++{
++ ssize_t ret = 0;
++#endif
+ STREAM_DATA_FROM_STREAM();
+
+ /* input */
+@@ -485,7 +493,11 @@ static size_t php_brotli_decompress_read(php_stream *stream,
+ if (input) {
+ efree(input);
+ }
++#if PHP_VERSION_ID < 70400
+ return 0;
++#else
++ return -1;
++#endif
+ }
+ self->available_in = php_stream_read(self->stream, input,
+ brotli_buffer_size );
+@@ -592,13 +604,20 @@ static int php_brotli_compress_close(php_stream *stream,
+ return EOF;
+ }
+
++#if PHP_VERSION_ID < 70400
+ static size_t php_brotli_compress_write(php_stream *stream,
+ const char *buf,
+ size_t count TSRMLS_DC)
+ {
+- STREAM_DATA_FROM_STREAM();
+-
+ size_t ret = 0;
++#else
++static ssize_t php_brotli_compress_write(php_stream *stream,
++ const char *buf,
++ size_t count TSRMLS_DC)
++{
++ ssize_t ret = 0;
++#endif
++ STREAM_DATA_FROM_STREAM();
+
+ size_t available_in = count;
+ const uint8_t *next_in = (uint8_t *)buf;
diff --git a/php-brotli.spec b/php-brotli.spec
index 7b4a3eb..eac95bf 100644
--- a/php-brotli.spec
+++ b/php-brotli.spec
@@ -38,7 +38,7 @@ Version: 0.7.0
%if 0%{?gh_date:1}
Release: 2%{gh_date}git%{gh_short}%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
%else
-Release: 2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+Release: 3%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
%endif
License: MIT
URL: https://github.com/%{gh_owner}/%{gh_project}
@@ -46,6 +46,8 @@ Source0: %{pkg_name}-%{version}-%{gh_short}.tgz
# retrieve a recursive git snapshot with submodule
Source1: makesrc.sh
+Patch0: https://patch-diff.githubusercontent.com/raw/kjdev/php-ext-brotli/pull/23.patch
+
BuildRequires: %{?dtsprefix}gcc
BuildRequires: %{?scl_prefix}php-devel
%if %{?with_libbrotli}
@@ -95,6 +97,7 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO
mv %{gh_project}-%{gh_commit} NTS
cd NTS
+%patch0 -p1
# replace symlink
rm LICENSE
@@ -225,6 +228,10 @@ REPORT_EXIT_STATUS=1 \
%changelog
+* Wed Jul 24 2019 Remi Collet <remi@remirepo.net> - 0.7.0-3
+- add patch for 7.4.0beta1 from
+ https://github.com/kjdev/php-ext-brotli/pull/23
+
* Tue Jul 23 2019 Remi Collet <remi@remirepo.net> - 0.7.0-2
- rebuild for 7.4.0beta1