From 9e5072893e7c11738085a5d21aec566637f1512d Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 22 Sep 2020 15:05:35 +0200 Subject: add patch for PHP 8 from https://github.com/beberlei/env/pull/10 --- .gitignore | 2 ++ env-pr10.patch | 25 +++++++++++++++++++++++++ php-pecl-env.spec | 19 +++++++++++-------- 3 files changed, 38 insertions(+), 8 deletions(-) create mode 100644 env-pr10.patch diff --git a/.gitignore b/.gitignore index 1ab5c4f..01f0400 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ +clog package-*.xml *.tgz +*.tar.bz2 *.tar.gz *.tar.xz *.tar.xz.asc diff --git a/env-pr10.patch b/env-pr10.patch new file mode 100644 index 0000000..b4a754c --- /dev/null +++ b/env-pr10.patch @@ -0,0 +1,25 @@ +From cf3d85f354489a39c96823332c797af45a4e781f Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Tue, 22 Sep 2020 15:01:31 +0200 +Subject: [PATCH] trivial fix for PHP 8 + +--- + env.h | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/env.h b/env.h +index 85059ef..b0a67be 100644 +--- a/env.h ++++ b/env.h +@@ -1,5 +1,11 @@ + #ifndef ENV_H + #define ENV_H ++ ++#ifndef TSRMLS_CC ++#define TSRMLS_CC ++#define TSRMLS_DC ++#endif ++ + void php_env_module_init(HashTable *vars TSRMLS_DC); + void php_env_request_init(HashTable *vars TSRMLS_DC); + #endif diff --git a/php-pecl-env.spec b/php-pecl-env.spec index 4596693..4d3184b 100644 --- a/php-pecl-env.spec +++ b/php-pecl-env.spec @@ -22,7 +22,7 @@ Summary: Load environment variables Name: %{?sub_prefix}php-pecl-%{pecl_name} Version: 0.2.1 -Release: 9%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Release: 10%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} License: MIT URL: https://pecl.php.net/package/%{pecl_name} @@ -30,6 +30,7 @@ Source: https://pecl.php.net/get/%{pecl_name}-%{version}.tgz Patch0: %{pecl_name}-pr4.patch Patch1: %{pecl_name}-pr8.patch +Patch2: %{pecl_name}-pr10.patch BuildRequires: %{?dtsprefix}gcc # ignore min PHP version 5.5 (as work with 5.4) @@ -45,19 +46,16 @@ 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 "%{?vendor}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel} +%if "%{?packager}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel} # Other third party repo stuff -%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 @@ -89,6 +87,7 @@ sed -e 's/role="test"/role="src"/' \ cd NTS %patch0 -p1 -b .pr4 %patch1 -p1 -b .pr8 +%patch2 -p1 -b .pr10 # Check upstream version (often broken) extver=$(sed -n '/#define PHP_ENV_VERSION/{s/.* "//;s/".*$//;p}' php_env.h) @@ -220,6 +219,10 @@ fi %changelog +* Tue Sep 22 2020 Remi Collet - 0.2.1-10 +- add patch for PHP 8 + from https://github.com/beberlei/env/pull/10 + * Wed Feb 19 2020 Remi Collet - 0.2.1-9 - add patch for GCC 10 from https://github.com/beberlei/env/pull/8 -- cgit