From 320432d93aeddbed535aad1235301d5a9eb8473d Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 21 Sep 2020 10:37:19 +0200 Subject: add upstream patch for PHP 8 --- 79c9c119a1ba3cb7f0ebd3cffb6011fb09415404.patch | 115 +++++++++++++++++++++++++ php-pecl-inotify.spec | 41 ++++----- 2 files changed, 131 insertions(+), 25 deletions(-) create mode 100644 79c9c119a1ba3cb7f0ebd3cffb6011fb09415404.patch diff --git a/79c9c119a1ba3cb7f0ebd3cffb6011fb09415404.patch b/79c9c119a1ba3cb7f0ebd3cffb6011fb09415404.patch new file mode 100644 index 0000000..ee9e398 --- /dev/null +++ b/79c9c119a1ba3cb7f0ebd3cffb6011fb09415404.patch @@ -0,0 +1,115 @@ +From 79c9c119a1ba3cb7f0ebd3cffb6011fb09415404 Mon Sep 17 00:00:00 2001 +From: Florian Engelhardt +Date: Fri, 8 Nov 2019 14:01:35 +0100 +Subject: [PATCH] Remove all TSRMLS for PHP8 support + +--- + inotify.c | 20 ++++++++++---------- + php_inotify.h | 4 ++-- + 2 files changed, 12 insertions(+), 12 deletions(-) + +diff --git a/inotify.c b/inotify.c +index 94b8fbb..b3a0475 100644 +--- a/inotify.c ++++ b/inotify.c +@@ -149,14 +149,14 @@ PHP_MINFO_FUNCTION(inotify) + } + /* }}} */ + +-static int php_inotify_queue_len(const int fd TSRMLS_DC) /* {{{ */ ++static int php_inotify_queue_len(const int fd) /* {{{ */ + { + int ret; + int queue_len; + + ret = ioctl(fd, FIONREAD, &queue_len); + if (ret < 0) { +- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno)); ++ php_error_docref(NULL, E_WARNING, "%s", strerror(errno)); + return 0; + } + return queue_len; +@@ -199,11 +199,11 @@ PHP_FUNCTION(inotify_add_watch) + long mask, wd; + int fd; + +- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsl", &zstream, &pathname, &pathname_len, &mask) == FAILURE) { ++ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsl", &zstream, &pathname, &pathname_len, &mask) == FAILURE) { + return; + } + +- if (php_check_open_basedir(pathname TSRMLS_CC)) { ++ if (php_check_open_basedir(pathname)) { + RETURN_FALSE; + } + +@@ -237,7 +237,7 @@ PHP_FUNCTION(inotify_rm_watch) + int fd; + long wd; + +- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &zstream, &wd) == FAILURE) { ++ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &zstream, &wd) == FAILURE) { + return; + } + +@@ -265,14 +265,14 @@ PHP_FUNCTION(inotify_queue_len) + int fd; + long queue_len; + +- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zstream) == FAILURE) { ++ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zstream) == FAILURE) { + return; + } + + php_stream_from_zval(stream, zstream); + INOTIFY_FD(stream, fd); + +- queue_len = php_inotify_queue_len(fd TSRMLS_CC); ++ queue_len = php_inotify_queue_len(fd); + + RETURN_LONG(queue_len); + } +@@ -291,14 +291,14 @@ PHP_FUNCTION(inotify_read) + zval event_ary; + int fd; + +- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zstream) == FAILURE) { ++ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zstream) == FAILURE) { + return; + } + + php_stream_from_zval(stream, zstream); + INOTIFY_FD(stream, fd); + +- readbuf_size = (double) php_inotify_queue_len(fd TSRMLS_CC) * 1.6; ++ readbuf_size = (double) php_inotify_queue_len(fd) * 1.6; + if (readbuf_size < 1) { + readbuf_size = sizeof(struct inotify_event) + 32; + } +@@ -315,7 +315,7 @@ PHP_FUNCTION(inotify_read) + continue; + } else if (readden < 0) { + if (errno != EAGAIN) { +- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno)); ++ php_error_docref(NULL, E_WARNING, "%s", strerror(errno)); + } + efree(readbuf); + RETURN_FALSE; +diff --git a/php_inotify.h b/php_inotify.h +index 14bd478..bff8a65 100644 +--- a/php_inotify.h ++++ b/php_inotify.h +@@ -73,11 +73,11 @@ PHP_FUNCTION(inotify_read); + + #define INOTIFY_ERROR_CASE(func, errno) \ + case (errno): \ +- php_error_docref(NULL TSRMLS_CC, E_WARNING, INOTIFY_##func##_##errno); \ ++ php_error_docref(NULL, E_WARNING, INOTIFY_##func##_##errno); \ + break; + #define INOTIFY_DEFAULT_ERROR(errno) \ + default: \ +- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno)); \ ++ php_error_docref(NULL, E_WARNING, "%s", strerror(errno)); \ + break; + + diff --git a/php-pecl-inotify.spec b/php-pecl-inotify.spec index 4a80c69..51b98a6 100644 --- a/php-pecl-inotify.spec +++ b/php-pecl-inotify.spec @@ -1,6 +1,6 @@ # remirepo spec file for php-pecl-inotify # -# Copyright (c) 2013-2017 Remi Collet +# Copyright (c) 2013-2020 Remi Collet # License: CC-BY-SA # http://creativecommons.org/licenses/by-sa/4.0/ # @@ -12,15 +12,19 @@ %global pecl_name inotify %global ini_name 40-%{pecl_name}.ini +# NOTICE: sources on https://github.com/arnaud-lb/php-inotify + Summary: Inotify Name: %{?scl_prefix}php-pecl-%{pecl_name} Version: 2.0.0 -Release: 10%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Release: 11%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} License: PHP Group: Development/Languages URL: https://pecl.php.net/package/%{pecl_name} Source0: https://pecl.php.net/get/%{pecl_name}-%{version}.tgz +Patch0: https://github.com/arnaud-lb/php-inotify/commit/79c9c119a1ba3cb7f0ebd3cffb6011fb09415404.patch + BuildRequires: %{?dtsprefix}gcc BuildRequires: %{?scl_prefix}php-devel > 7 BuildRequires: %{?scl_prefix}php-pear @@ -36,33 +40,16 @@ Provides: %{?scl_prefix}php-pecl(%{pecl_name})%{?_isa} = %{version} Provides: %{?scl_prefix}php-pecl-%{pecl_name} = %{version}-%{release} Provides: %{?scl_prefix}php-pecl-%{pecl_name}%{?_isa} = %{version}-%{release} -%if "%{?vendor}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel} +%if "%{?packager}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel} # Other third party repo stuff -Obsoletes: php53-pecl-%{pecl_name} <= %{version} -Obsoletes: php53u-pecl-%{pecl_name} <= %{version} -Obsoletes: php54-pecl-%{pecl_name} <= %{version} -Obsoletes: php54w-pecl-%{pecl_name} <= %{version} -Obsoletes: php55u-pecl-%{pecl_name} <= %{version} -Obsoletes: php55w-pecl-%{pecl_name} <= %{version} -Obsoletes: php56u-pecl-%{pecl_name} <= %{version} -Obsoletes: php56w-pecl-%{pecl_name} <= %{version} -Obsoletes: php70u-pecl-%{pecl_name} <= %{version} -Obsoletes: php70w-pecl-%{pecl_name} <= %{version} -%if "%{php_version}" > "7.1" -Obsoletes: php71u-pecl-%{pecl_name} <= %{version} -Obsoletes: php71w-pecl-%{pecl_name} <= %{version} -%endif -%if "%{php_version}" > "7.2" -Obsoletes: php72u-pecl-%{pecl_name} <= %{version} -Obsoletes: php72w-pecl-%{pecl_name} <= %{version} -%endif %if "%{php_version}" > "7.3" Obsoletes: php73-pecl-%{pecl_name} <= %{version} -Obsoletes: php73w-pecl-%{pecl_name} <= %{version} %endif %if "%{php_version}" > "7.4" Obsoletes: php74-pecl-%{pecl_name} <= %{version} -Obsoletes: php74w-pecl-%{pecl_name} <= %{version} +%endif +%if "%{php_version}" > "8.0" +Obsoletes: php80-pecl-%{pecl_name} <= %{version} %endif %endif @@ -91,6 +78,7 @@ sed -e '/inotify.php/s/role="php"/role="doc"/' \ -i package.xml cd NTS +%patch0 -p1 # Sanity check, really often broken extver=$(sed -n '/#define PHP_INOTIFY_VERSION/{s/.* "//;s/".*$//;p}' php_inotify.h) @@ -183,7 +171,7 @@ fi cd NTS %{__php} --no-php-ini \ --define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \ - --modules | grep %{pecl_name} + --modules | grep '^%{pecl_name}$' : Upstream test suite for NTS extension TEST_PHP_EXECUTABLE=%{__php} \ @@ -198,7 +186,7 @@ REPORT_EXIT_STATUS=1 \ cd ../ZTS %{__ztsphp} --no-php-ini \ --define extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \ - --modules | grep %{pecl_name} + --modules | grep '^%{pecl_name}$' : Upstream test suite for ZTS extension TEST_PHP_EXECUTABLE=%{__ztsphp} \ @@ -224,6 +212,9 @@ REPORT_EXIT_STATUS=1 \ %changelog +* Mon Sep 21 2020 Remi Collet - 2.0.0-11 +- add upstream patch for PHP 8 + * Tue Sep 03 2019 Remi Collet - 2.0.0-10 - rebuild for 7.4.0RC1 -- cgit