From ef40fe219101a0b59c1a684972480dd8f744cdaf Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Fri, 2 Oct 2020 07:12:40 +0200 Subject: update to 1.8.0 drop patches merged upstream --- 108.patch | 159 ----------------------------------------------------- 109.patch | 63 --------------------- PHPINFO | 2 +- REFLECTION | 2 +- php-maxminddb.spec | 17 +++--- 5 files changed, 10 insertions(+), 233 deletions(-) delete mode 100644 108.patch delete mode 100644 109.patch diff --git a/108.patch b/108.patch deleted file mode 100644 index bb4af8b..0000000 --- a/108.patch +++ /dev/null @@ -1,159 +0,0 @@ -From c529551dbb98575df6127e72122bc8c2b63d9fdd Mon Sep 17 00:00:00 2001 -From: Remi Collet -Date: Wed, 2 Sep 2020 11:24:30 +0200 -Subject: [PATCH] fix for 8.0.0beta3 - ---- - ext/maxminddb.c | 50 +++++++++++++++++++++++-------------------------- - 1 file changed, 23 insertions(+), 27 deletions(-) - -diff --git a/ext/maxminddb.c b/ext/maxminddb.c -index 4947492..f94d741 100644 ---- a/ext/maxminddb.c -+++ b/ext/maxminddb.c -@@ -45,15 +45,21 @@ typedef size_t strsize_t; - typedef zend_object free_obj_t; - - /* For PHP 8 compatibility */ --#ifndef TSRMLS_C -+#if PHP_VERSION_ID < 80000 -+ -+#define PROP_OBJ(zv) (zv) -+ -+#else -+ -+#define PROP_OBJ(zv) Z_OBJ_P(zv) -+ - #define TSRMLS_C --#endif --#ifndef TSRMLS_CC - #define TSRMLS_CC --#endif --#ifndef TSRMLS_DC - #define TSRMLS_DC -+ -+/* End PHP 8 compatibility */ - #endif -+ - #ifndef ZEND_ACC_CTOR - #define ZEND_ACC_CTOR 0 - #endif -@@ -334,23 +340,13 @@ PHP_METHOD(MaxMind_Db_Reader, metadata) { - return; - } - MMDB_free_entry_data_list(entry_data_list); --#if PHP_VERSION_ID >= 80000 -- zend_call_method_with_1_params(Z_OBJ_P(return_value), -+ zend_call_method_with_1_params(PROP_OBJ(return_value), - metadata_ce, - &metadata_ce->constructor, - ZEND_CONSTRUCTOR_FUNC_NAME, - NULL, - &metadata_array); - zval_ptr_dtor(&metadata_array); --#else -- zend_call_method_with_1_params(return_value, -- metadata_ce, -- &metadata_ce->constructor, -- ZEND_CONSTRUCTOR_FUNC_NAME, -- NULL, -- &metadata_array); -- zval_ptr_dtor(&metadata_array); --#endif - } - - PHP_METHOD(MaxMind_Db_Reader, close) { -@@ -607,7 +603,7 @@ PHP_METHOD(MaxMind_Db_Reader_Metadata, __construct) { - "binary_format_major_version", - sizeof("binary_format_major_version") - 1))) { - zend_update_property(metadata_ce, -- object, -+ PROP_OBJ(object), - "binaryFormatMajorVersion", - sizeof("binaryFormatMajorVersion") - 1, - tmp); -@@ -617,7 +613,7 @@ PHP_METHOD(MaxMind_Db_Reader_Metadata, __construct) { - "binary_format_minor_version", - sizeof("binary_format_minor_version") - 1))) { - zend_update_property(metadata_ce, -- object, -+ PROP_OBJ(object), - "binaryFormatMinorVersion", - sizeof("binaryFormatMinorVersion") - 1, - tmp); -@@ -627,14 +623,14 @@ PHP_METHOD(MaxMind_Db_Reader_Metadata, __construct) { - "build_epoch", - sizeof("build_epoch") - 1))) { - zend_update_property( -- metadata_ce, object, "buildEpoch", sizeof("buildEpoch") - 1, tmp); -+ metadata_ce, PROP_OBJ(object), "buildEpoch", sizeof("buildEpoch") - 1, tmp); - } - - if ((tmp = zend_hash_str_find(HASH_OF(metadata_array), - "database_type", - sizeof("database_type") - 1))) { - zend_update_property(metadata_ce, -- object, -+ PROP_OBJ(object), - "databaseType", - sizeof("databaseType") - 1, - tmp); -@@ -644,27 +640,27 @@ PHP_METHOD(MaxMind_Db_Reader_Metadata, __construct) { - "description", - sizeof("description") - 1))) { - zend_update_property( -- metadata_ce, object, "description", sizeof("description") - 1, tmp); -+ metadata_ce, PROP_OBJ(object), "description", sizeof("description") - 1, tmp); - } - - if ((tmp = zend_hash_str_find(HASH_OF(metadata_array), - "ip_version", - sizeof("ip_version") - 1))) { - zend_update_property( -- metadata_ce, object, "ipVersion", sizeof("ipVersion") - 1, tmp); -+ metadata_ce, PROP_OBJ(object), "ipVersion", sizeof("ipVersion") - 1, tmp); - } - - if ((tmp = zend_hash_str_find( - HASH_OF(metadata_array), "languages", sizeof("languages") - 1))) { - zend_update_property( -- metadata_ce, object, "languages", sizeof("languages") - 1, tmp); -+ metadata_ce, PROP_OBJ(object), "languages", sizeof("languages") - 1, tmp); - } - - if ((tmp = zend_hash_str_find(HASH_OF(metadata_array), - "record_size", - sizeof("record_size") - 1))) { - zend_update_property( -- metadata_ce, object, "recordSize", sizeof("recordSize") - 1, tmp); -+ metadata_ce, PROP_OBJ(object), "recordSize", sizeof("recordSize") - 1, tmp); - if (Z_TYPE_P(tmp) == IS_LONG) { - record_size = Z_LVAL_P(tmp); - } -@@ -672,7 +668,7 @@ PHP_METHOD(MaxMind_Db_Reader_Metadata, __construct) { - - if (record_size != 0) { - zend_update_property_long(metadata_ce, -- object, -+ PROP_OBJ(object), - "nodeByteSize", - sizeof("nodeByteSize") - 1, - record_size / 4); -@@ -682,7 +678,7 @@ PHP_METHOD(MaxMind_Db_Reader_Metadata, __construct) { - "node_count", - sizeof("node_count") - 1))) { - zend_update_property( -- metadata_ce, object, "nodeCount", sizeof("nodeCount") - 1, tmp); -+ metadata_ce, PROP_OBJ(object), "nodeCount", sizeof("nodeCount") - 1, tmp); - if (Z_TYPE_P(tmp) == IS_LONG) { - node_count = Z_LVAL_P(tmp); - } -@@ -690,7 +686,7 @@ PHP_METHOD(MaxMind_Db_Reader_Metadata, __construct) { - - if (record_size != 0) { - zend_update_property_long(metadata_ce, -- object, -+ PROP_OBJ(object), - "searchTreeSize", - sizeof("searchTreeSize") - 1, - record_size * node_count / 4); diff --git a/109.patch b/109.patch deleted file mode 100644 index 3f8f164..0000000 --- a/109.patch +++ /dev/null @@ -1,63 +0,0 @@ -From 4c0a267e17dba6e205079c397a05026c887b6352 Mon Sep 17 00:00:00 2001 -From: Remi Collet -Date: Wed, 30 Sep 2020 09:31:32 +0200 -Subject: [PATCH] relax test for 8.0.0RC1 - ---- - tests/MaxMind/Db/Test/Reader/MetadataTest.php | 2 +- - tests/MaxMind/Db/Test/ReaderTest.php | 8 ++++---- - 2 files changed, 5 insertions(+), 5 deletions(-) - -diff --git a/tests/MaxMind/Db/Test/Reader/MetadataTest.php b/tests/MaxMind/Db/Test/Reader/MetadataTest.php -index af12be9..082283d 100644 ---- a/tests/MaxMind/Db/Test/Reader/MetadataTest.php -+++ b/tests/MaxMind/Db/Test/Reader/MetadataTest.php -@@ -44,7 +44,7 @@ public function testConstructor(): void - public function testTooManyConstructorArgs(): void - { - $this->expectException(ArgumentCountError::class); -- $this->expectExceptionMessage('MaxMind\Db\Reader\Metadata::__construct() expects exactly 1 parameter, 2 given'); -+ $this->expectExceptionMessage('MaxMind\Db\Reader\Metadata::__construct() expects exactly 1'); - new Metadata([], 1); - } - -diff --git a/tests/MaxMind/Db/Test/ReaderTest.php b/tests/MaxMind/Db/Test/ReaderTest.php -index bb90854..cb456c7 100644 ---- a/tests/MaxMind/Db/Test/ReaderTest.php -+++ b/tests/MaxMind/Db/Test/ReaderTest.php -@@ -302,7 +302,7 @@ public function testNonDatabase(): void - public function testTooManyConstructorArgs(): void - { - $this->expectException(ArgumentCountError::class); -- $this->expectExceptionMessage('MaxMind\Db\Reader::__construct() expects exactly 1 parameter, 2 given'); -+ $this->expectExceptionMessage('MaxMind\Db\Reader::__construct() expects exactly 1'); - new Reader('README.md', 1); - } - -@@ -318,7 +318,7 @@ public function testNoConstructorArgs(): void - public function testTooManyGetArgs(): void - { - $this->expectException(ArgumentCountError::class); -- $this->expectExceptionMessage('MaxMind\Db\Reader::get() expects exactly 1 parameter, 2 given'); -+ $this->expectExceptionMessage('MaxMind\Db\Reader::get() expects exactly 1'); - $reader = new Reader( - 'tests/data/test-data/MaxMind-DB-test-decoder.mmdb' - ); -@@ -340,7 +340,7 @@ public function testNoGetArgs(): void - public function testMetadataArgs(): void - { - $this->expectException(ArgumentCountError::class); -- $this->expectExceptionMessage('MaxMind\Db\Reader::metadata() expects exactly 0 parameters, 1 given'); -+ $this->expectExceptionMessage('MaxMind\Db\Reader::metadata() expects exactly 0'); - $reader = new Reader( - 'tests/data/test-data/MaxMind-DB-test-decoder.mmdb' - ); -@@ -360,7 +360,7 @@ public function testClose(): void - public function testCloseArgs(): void - { - $this->expectException(ArgumentCountError::class); -- $this->expectExceptionMessage('MaxMind\Db\Reader::close() expects exactly 0 parameters, 1 given'); -+ $this->expectExceptionMessage('MaxMind\Db\Reader::close() expects exactly 0'); - $reader = new Reader( - 'tests/data/test-data/MaxMind-DB-test-decoder.mmdb' - ); diff --git a/PHPINFO b/PHPINFO index b9af7b9..2e9fb00 100644 --- a/PHPINFO +++ b/PHPINFO @@ -2,5 +2,5 @@ maxminddb MaxMind DB Reader => enabled -maxminddb extension version => 1.7.0 +maxminddb extension version => 1.8.0 libmaxminddb library version => 1.2.0 diff --git a/REFLECTION b/REFLECTION index 678cefa..515092f 100644 --- a/REFLECTION +++ b/REFLECTION @@ -1,4 +1,4 @@ -Extension [ extension #116 maxminddb version 1.7.0 ] { +Extension [ extension #117 maxminddb version 1.8.0 ] { - Classes [3] { Class [ class MaxMind\Db\Reader\InvalidDatabaseException extends Exception implements Throwable ] { diff --git a/php-maxminddb.spec b/php-maxminddb.spec index 906b29b..b9aafe2 100644 --- a/php-maxminddb.spec +++ b/php-maxminddb.spec @@ -17,7 +17,7 @@ %global with_tests 0%{!?_without_tests:1} -%global gh_commit 942553da239f12051275f9c666538b5dd09e2908 +%global gh_commit b566d429ac9aec10594b0935be8ff38302f8d5c8 %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) %global gh_owner maxmind %global gh_project MaxMind-DB-Reader-php @@ -31,9 +31,9 @@ Summary: MaxMind DB Reader extension Name: %{?sub_prefix}php-maxminddb -Version: 1.7.0 -%global rpmrel 3 -Release: %{rpmrel}%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Version: 1.8.0 +%global rpmrel 1 +Release: %{rpmrel}%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo "1".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} License: ASL 2.0 URL: https://github.com/%{gh_owner}/%{gh_project} @@ -41,9 +41,6 @@ URL: https://github.com/%{gh_owner}/%{gh_project} Source0: %{pkg_name}-%{version}-%{gh_short}.tgz Source1: makesrc.sh -Patch0: https://patch-diff.githubusercontent.com/raw/maxmind/MaxMind-DB-Reader-php/pull/108.patch -Patch1: https://patch-diff.githubusercontent.com/raw/maxmind/MaxMind-DB-Reader-php/pull/109.patch - BuildRequires: %{?scl_prefix}php-devel >= 7.2 BuildRequires: %{?scl_prefix}php-pear >= 1.10 BuildRequires: pkgconfig(libmaxminddb) >= 1.0.0 @@ -161,8 +158,6 @@ Autoloader: %{_datadir}/php/MaxMind/Db/Reader/autoload.php %prep %setup -q -n %{gh_project}-%{gh_commit} -%patch0 -p1 -b .pr -%patch1 -p1 -b .pr %if %{with_lib} %{_bindir}/phpab \ @@ -336,6 +331,10 @@ fi # when using pkgup, CHECK Release! %changelog +* Fri Oct 2 2020 Remi Collet - 1.8.0-1 +- update to 1.8.0 +- drop patches merged upstream + * Wed Sep 30 2020 Remi Collet - 1.7.0-3 - rebuild for PHP 8.0.0RC1 - add patch for PHP 8.0.0rc1 from -- cgit