From 03e6d9745a6c17f6b158d4df01523cbe53ad0973 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 27 Nov 2023 14:22:00 +0100 Subject: add build patch for 8.3 --- couchbase-php83.patch | 72 ++++++++++++++++++++++++++++++++++++++++++++++++ php-pecl-couchbase3.spec | 18 +++++++----- 2 files changed, 83 insertions(+), 7 deletions(-) create mode 100644 couchbase-php83.patch diff --git a/couchbase-php83.patch b/couchbase-php83.patch new file mode 100644 index 0000000..5fe47c4 --- /dev/null +++ b/couchbase-php83.patch @@ -0,0 +1,72 @@ +diff -up ./src/couchbase/bucket/view.c.old ./src/couchbase/bucket/view.c +--- ./src/couchbase/bucket/view.c.old 2023-11-27 14:01:10.682139168 +0100 ++++ ./src/couchbase/bucket/view.c 2023-11-27 13:52:36.053067179 +0100 +@@ -601,7 +601,11 @@ PHP_METHOD(Bucket, viewQuery) + } + prop = pcbc_read_property(pcbc_view_options_ce, options, ("query"), 0, &ret); + if (Z_TYPE_P(prop) == IS_ARRAY) { ++#if PHP_VERSION_ID < 80300 + php_url_encode_hash_ex(HASH_OF(prop), &query_str, NULL, 0, NULL, 0, NULL, 0, NULL, NULL, PHP_QUERY_RFC1738); ++#else ++ php_url_encode_hash_ex(HASH_OF(prop), &query_str, NULL, 0, NULL, NULL, NULL, PHP_QUERY_RFC1738); ++#endif + if (!PCBC_SMARTSTR_EMPTY(query_str)) { + lcb_cmdview_option_string(cmd, ZSTR_VAL(query_str.s), ZSTR_LEN(query_str.s)); + } +diff -up ./src/couchbase/managers/analytics_index_manager.c.old ./src/couchbase/managers/analytics_index_manager.c +--- ./src/couchbase/managers/analytics_index_manager.c.old 2023-11-27 14:03:11.653623417 +0100 ++++ ./src/couchbase/managers/analytics_index_manager.c 2023-11-27 13:54:52.379117682 +0100 +@@ -1179,7 +1179,11 @@ PHP_METHOD(AnalyticsIndexManager, dropLi + add_assoc_str(&payload, "dataverse", dataverse_name); + add_assoc_str(&payload, "name", link_name); + ++#if PHP_VERSION_ID < 80300 + php_url_encode_hash_ex(HASH_OF(&payload), &body, NULL, 0, NULL, 0, NULL, 0, NULL, NULL, PHP_QUERY_RFC1738); ++#else ++ php_url_encode_hash_ex(HASH_OF(&payload), &body, NULL, 0, NULL, NULL, NULL, PHP_QUERY_RFC1738); ++#endif + zval_ptr_dtor(&payload); + smart_str_0(&body); + +@@ -1369,7 +1373,11 @@ PHP_METHOD(AnalyticsIndexManager, getLin + } + + smart_str buf = {0}; ++#if PHP_VERSION_ID < 80300 + php_url_encode_hash_ex(HASH_OF(&payload), &buf, NULL, 0, NULL, 0, NULL, 0, NULL, NULL, PHP_QUERY_RFC1738); ++#else ++ php_url_encode_hash_ex(HASH_OF(&payload), &buf, NULL, 0, NULL, NULL, NULL, PHP_QUERY_RFC1738); ++#endif + zval_ptr_dtor(&payload); + smart_str_0(&buf); + +diff -up ./src/couchbase/managers/bucket_manager.c.old ./src/couchbase/managers/bucket_manager.c +--- ./src/couchbase/managers/bucket_manager.c.old 2023-11-27 14:03:03.765331092 +0100 ++++ ./src/couchbase/managers/bucket_manager.c 2023-11-27 13:53:41.920507385 +0100 +@@ -240,7 +240,11 @@ PHP_METHOD(BucketManager, createBucket) + prop = pcbc_read_property(pcbc_bucket_settings_ce, settings, ("replica_indexes"), 0, &ret); + add_assoc_bool(&payload, "replicaIndex", Z_TYPE_P(prop) == IS_TRUE); + ++#if PHP_VERSION_ID < 80300 + php_url_encode_hash_ex(HASH_OF(&payload), &buf, NULL, 0, NULL, 0, NULL, 0, NULL, NULL, PHP_QUERY_RFC1738); ++#else ++ php_url_encode_hash_ex(HASH_OF(&payload), &buf, NULL, 0, NULL, NULL, NULL, PHP_QUERY_RFC1738); ++#endif + zval_ptr_dtor(&payload); + if (rv == FAILURE) { + smart_str_free(&buf); +diff -up ./src/couchbase/managers/user_manager.c.old ./src/couchbase/managers/user_manager.c +--- ./src/couchbase/managers/user_manager.c.old 2023-11-27 14:03:18.789887875 +0100 ++++ ./src/couchbase/managers/user_manager.c 2023-11-27 13:55:26.962398896 +0100 +@@ -342,7 +342,11 @@ PHP_METHOD(UserManager, upsertUser) + add_assoc_stringl(&payload, "roles", ZSTR_VAL(buf.s), ZSTR_LEN(buf.s)); + smart_str_free(&buf); + } ++#if PHP_VERSION_ID < 80300 + php_url_encode_hash_ex(HASH_OF(&payload), &buf, NULL, 0, NULL, 0, NULL, 0, NULL, NULL, PHP_QUERY_RFC1738); ++#else ++ php_url_encode_hash_ex(HASH_OF(&payload), &buf, NULL, 0, NULL, NULL, NULL, PHP_QUERY_RFC1738); ++#endif + zval_dtor(&payload); + if (rv == FAILURE) { + smart_str_free(&buf); diff --git a/php-pecl-couchbase3.spec b/php-pecl-couchbase3.spec index e62bb43..2971f65 100644 --- a/php-pecl-couchbase3.spec +++ b/php-pecl-couchbase3.spec @@ -1,7 +1,7 @@ # remirepo spec file for php-pecl-couchbase3 # -# Copyright (c) 2013-2021 Remi Collet -# License: CC-BY-SA +# Copyright (c) 2013-2023 Remi Collet +# License: CC-BY-SA-4.0 # http://creativecommons.org/licenses/by-sa/4.0/ # # Please, preserve the changelog entries @@ -25,12 +25,13 @@ Summary: Couchbase Server PHP extension Name: %{?scl_prefix}php-pecl-couchbase3 Version: 3.2.2 -Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} -License: PHP +Release: 2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +License: PHP-3.01 URL: https://pecl.php.net/package/couchbase Source0: https://pecl.php.net/get/%{pecl_name}-%{version}%{?prever}.tgz Patch0: https://patch-diff.githubusercontent.com/raw/couchbase/php-couchbase/pull/32.patch +Patch1: %{pecl_name}-php83.patch BuildRequires: make BuildRequires: %{?dtsprefix}gcc @@ -40,7 +41,7 @@ BuildRequires: %{?scl_prefix}php-pear BuildRequires: %{?scl_prefix}php-json BuildRequires: %{?scl_prefix}php-tokenizer # ensure we use the latest version (upstream requires 3.2.2) -BuildRequires: pkgconfig(libcouchbase) >= 3.2.4 +BuildRequires: pkgconfig(libcouchbase) >= 3.2.2 BuildRequires: fastlz-devel BuildRequires: zlib-devel @@ -48,7 +49,6 @@ Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api} Requires: %{?scl_prefix}php(api) = %{php_core_api} Requires: %{?scl_prefix}php-json%{?_isa} Requires: %{?scl_prefix}php-tokenizer%{?_isa} -%{?_sclreq:Requires: %{?scl_prefix}runtime%{?_sclreq}%{?_isa}} Provides: %{?scl_prefix}php-%{pecl_name} = %{version} Provides: %{?scl_prefix}php-%{pecl_name}%{?_isa} = %{version} @@ -104,7 +104,8 @@ mv %{pecl_name}-%{version}%{?prever} NTS %{?_licensedir:sed -e '/LICENSE/s/role="doc"/role="src"/' -i package.xml} cd NTS -%patch0 -p1 -b .pr32 +%patch -P0 -p1 -b .pr32 +%patch -P1 -p1 -b .php83 # Drop bundled library sed -e '/fastlz/d' -i ../package.xml @@ -239,6 +240,9 @@ fi %changelog +* Mon Nov 27 2023 Remi Collet - 3.2.2-2 +- add build patch for 8.3 + * Thu Dec 9 2021 Remi Collet - 3.2.2-1 - update to 3.2.2 - raise dependency on libcouchbase 3.2.4 -- cgit