diff options
author | Remi Collet <remi@remirepo.net> | 2022-10-03 15:56:17 +0200 |
---|---|---|
committer | Remi Collet <remi@php.net> | 2022-10-03 15:56:17 +0200 |
commit | a1bc6dc0d174d96b0cd6533c103d96b58fea5e4c (patch) | |
tree | 9ef94efa2be575e7ddf6d1b8b6d9de09ae366696 | |
parent | e2bc60cfaec011400c9c82e815317e75ec199a37 (diff) |
add upstream patch for 8.2 and from
https://github.com/m6w6/ext-pq/pull/44
-rw-r--r-- | php-pecl-pq.spec | 27 | ||||
-rw-r--r-- | pq-upstream.patch | 49 |
2 files changed, 64 insertions, 12 deletions
diff --git a/php-pecl-pq.spec b/php-pecl-pq.spec index 1af7b8f..a4ff3cb 100644 --- a/php-pecl-pq.spec +++ b/php-pecl-pq.spec @@ -1,13 +1,12 @@ # remirepo spec file for php-pecl-pq # -# Copyright (c) 2014-2021 Remi Collet +# Copyright (c) 2014-2022 Remi Collet # License: CC-BY-SA # http://creativecommons.org/licenses/by-sa/4.0/ # # Please, preserve the changelog entries # %if 0%{?scl:1} -%global sub_prefix %{scl_prefix} %scl_package php-pecl-pq %endif @@ -26,18 +25,20 @@ %global ini_name 50-%{pecl_name}.ini Summary: PostgreSQL client library (libpq) binding -Name: %{?sub_prefix}php-pecl-%{pecl_name} +Name: %{?scl_prefix}php-pecl-%{pecl_name} Version: 2.2.0 %if 0%{?gh_date:1} Release: 0.12.%{gh_date}git%{gh_short}%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{pecl_name}-%{version}-%{gh_short}.tar.gz %else -Release: 7%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Release: 8%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} Source0: https://pecl.php.net/get/%{pecl_name}-%{version}%{?prever}.tgz %endif License: BSD URL: https://pecl.php.net/package/%{pecl_name} +Patch0: %{pecl_name}-upstream.patch + %if 0%{?fedora} >= 29 && 0%{?rhel} >= 8 BuildRequires: libpq-devel > 9 %else @@ -45,10 +46,10 @@ BuildRequires: postgresql-devel > 9 %endif BuildRequires: make BuildRequires: %{?dtsprefix}gcc -BuildRequires: %{?scl_prefix}php-devel > 7 +BuildRequires: %{?scl_prefix}php-devel >= 7.0 BuildRequires: %{?scl_prefix}php-pear BuildRequires: %{?scl_prefix}php-json -BuildRequires: %{?sub_prefix}php-pecl-raphf-devel >= 1.1.0 +BuildRequires: %{?scl_prefix}php-pecl-raphf-devel >= 1.1.0 %if %{with tests} BuildRequires: postgresql-server BuildRequires: postgresql-contrib @@ -57,17 +58,13 @@ BuildRequires: postgresql-contrib Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api} Requires: %{?scl_prefix}php(api) = %{php_core_api} Requires: %{?scl_prefix}php-json%{?_isa} -Requires: %{?sub_prefix}php-raphf%{?_isa} >= 1.1.0 +Requires: %{?scl_prefix}php-raphf%{?_isa} >= 1.1.0 %{?_sclreq:Requires: %{?scl_prefix}runtime%{?_sclreq}%{?_isa}} Provides: %{?scl_prefix}php-%{pecl_name} = %{version} 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 "%{?scl_prefix}" != "%{?sub_prefix}" -Provides: %{?scl_prefix}php-pecl-%{pecl_name} = %{version}-%{release} -Provides: %{?scl_prefix}php-pecl-%{pecl_name}%{?_isa} = %{version}-%{release} -%endif %if "%{?packager}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel} # Other third party repo stuff @@ -118,6 +115,8 @@ sed -e '/role="test"/d' \ -i package.xml cd NTS +%patch0 -p1 + # Sanity check, really often broken extver=$(sed -n '/#define PHP_PQ_VERSION/{s/.* "//;s/".*$//;p}' php_pq.h) if test "x${extver}" != "x%{version}%{?prever}"; then @@ -289,7 +288,11 @@ exit $RET %changelog -* Wed Sep 01 2021 Remi Collet <remi@remirepo.net> - 2.2.0-7 +* Thu Sep 8 2022 Remi Collet <remi@remirepo.net> - 2.2.0-8 +- add upstream patch for 8.2 and from + https://github.com/m6w6/ext-pq/pull/44 + +* Wed Sep 1 2021 Remi Collet <remi@remirepo.net> - 2.2.0-7 - rebuild for 8.1.0RC1 * Tue Aug 31 2021 Remi Collet <remi@remirepo.net> - 2.2.0-1 diff --git a/pq-upstream.patch b/pq-upstream.patch new file mode 100644 index 0000000..f4fbb3d --- /dev/null +++ b/pq-upstream.patch @@ -0,0 +1,49 @@ +From 64cc2702825f663e8da413dab235d18145f073b7 Mon Sep 17 00:00:00 2001 +From: Michael Wallner <mike@php.net> +Date: Wed, 10 Nov 2021 10:12:57 +0100 +Subject: [PATCH] PHP-8.2 compat with __toString + +--- + src/php_pq_misc.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/php_pq_misc.c b/src/php_pq_misc.c +index 70f32da..9acef34 100644 +--- a/src/php_pq_misc.c ++++ b/src/php_pq_misc.c +@@ -138,7 +138,11 @@ ZEND_END_ARG_INFO() + #define ai_pqdt_jsonserialize ai_pqdt_to_string + #endif + ++#if PHP_VERSION_ID >= 80200 ++ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(ai_pqdt_to_string, 0, 0, IS_STRING, 0) ++#else + ZEND_BEGIN_ARG_INFO_EX(ai_pqdt_to_string, 0, 0, 0) ++#endif + ZEND_END_ARG_INFO(); + static PHP_METHOD(pqdt, __toString) + { + +From e518cb365f1e28dd4779ce37888a89ac54278c65 Mon Sep 17 00:00:00 2001 +From: Remi Collet <remi@remirepo.net> +Date: Thu, 8 Sep 2022 17:24:42 +0200 +Subject: [PATCH] allow dynamic properties in Pq\Connection + +--- + src/php_pqconn.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/src/php_pqconn.c b/src/php_pqconn.c +index 6278323..0b39d25 100644 +--- a/src/php_pqconn.c ++++ b/src/php_pqconn.c +@@ -2001,6 +2001,9 @@ PHP_MINIT_FUNCTION(pqconn) + INIT_NS_CLASS_ENTRY(ce, "pq", "Connection", php_pqconn_methods); + php_pqconn_class_entry = zend_register_internal_class_ex(&ce, NULL); + php_pqconn_class_entry->create_object = php_pqconn_create_object; ++#if PHP_VERSION_ID >= 80200 ++ php_pqconn_class_entry->ce_flags |= ZEND_ACC_ALLOW_DYNAMIC_PROPERTIES; ++#endif + + memcpy(&php_pqconn_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); + php_pqconn_object_handlers.offset = XtOffsetOf(php_pqconn_object_t, zo); |