forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dev-php/pecl-geoip: Revbump for PHP 8 support
Signed-off-by: Brian Evans <[email protected]>
- Loading branch information
Brian Evans
committed
Dec 10, 2020
1 parent
8c4872c
commit d6f189d
Showing
2 changed files
with
118 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
--- a/geoip.c 2020/10/30 12:04:28 351081 | ||
+++ b/geoip.c 2020/10/30 12:51:07 351082 | ||
@@ -34,41 +34,72 @@ | ||
#include "ext/standard/info.h" | ||
#include "php_geoip.h" | ||
|
||
- | ||
+/* For PHP 8 */ | ||
+#ifndef TSRMLS_CC | ||
+#define TSRMLS_CC | ||
+#endif | ||
|
||
ZEND_DECLARE_MODULE_GLOBALS(geoip) | ||
|
||
+ZEND_BEGIN_ARG_INFO_EX(arginfo_geoip_void, 0, 0, 0) | ||
+ZEND_END_ARG_INFO() | ||
+ | ||
+ZEND_BEGIN_ARG_INFO_EX(arginfo_geoip_database_opt, 0, 0, 0) | ||
+ ZEND_ARG_INFO(0, database) | ||
+ZEND_END_ARG_INFO() | ||
+ | ||
+ZEND_BEGIN_ARG_INFO_EX(arginfo_geoip_database, 0, 0, 1) | ||
+ ZEND_ARG_INFO(0, database) | ||
+ZEND_END_ARG_INFO() | ||
+ | ||
+ZEND_BEGIN_ARG_INFO_EX(arginfo_geoip_host, 0, 0, 1) | ||
+ ZEND_ARG_INFO(0, host) | ||
+ZEND_END_ARG_INFO() | ||
+ | ||
+ZEND_BEGIN_ARG_INFO_EX(arginfo_geoip_region, 0, 0, 2) | ||
+ ZEND_ARG_INFO(0, country_code) | ||
+ ZEND_ARG_INFO(0, region_code) | ||
+ZEND_END_ARG_INFO() | ||
+ | ||
+ZEND_BEGIN_ARG_INFO_EX(arginfo_geoip_directory, 0, 0, 1) | ||
+ ZEND_ARG_INFO(0, directory) | ||
+ZEND_END_ARG_INFO() | ||
+ | ||
static int le_geoip; | ||
|
||
/* {{{ */ | ||
zend_function_entry geoip_functions[] = { | ||
- PHP_FE(geoip_database_info, NULL) | ||
+ PHP_FE(geoip_database_info, arginfo_geoip_database_opt) | ||
#define GEOIPDEF(php_func, c_func, db_type) \ | ||
- PHP_FE(php_func, NULL) | ||
+ PHP_FE(php_func, arginfo_geoip_host) | ||
#include "geoip.def" | ||
#undef GEOIPDEF | ||
- PHP_FE(geoip_continent_code_by_name, NULL) | ||
- PHP_FE(geoip_org_by_name, NULL) | ||
- PHP_FE(geoip_record_by_name, NULL) | ||
- PHP_FE(geoip_id_by_name, NULL) | ||
- PHP_FE(geoip_region_by_name, NULL) | ||
- PHP_FE(geoip_isp_by_name, NULL) | ||
- PHP_FE(geoip_db_avail, NULL) | ||
- PHP_FE(geoip_db_get_all_info, NULL) | ||
- PHP_FE(geoip_db_filename, NULL) | ||
+ PHP_FE(geoip_continent_code_by_name, arginfo_geoip_host) | ||
+ PHP_FE(geoip_org_by_name, arginfo_geoip_host) | ||
+ PHP_FE(geoip_record_by_name, arginfo_geoip_host) | ||
+ PHP_FE(geoip_id_by_name, arginfo_geoip_host) | ||
+ PHP_FE(geoip_region_by_name, arginfo_geoip_host) | ||
+ PHP_FE(geoip_isp_by_name, arginfo_geoip_host) | ||
+ PHP_FE(geoip_db_avail, arginfo_geoip_database) | ||
+ PHP_FE(geoip_db_get_all_info, arginfo_geoip_void) | ||
+ PHP_FE(geoip_db_filename, arginfo_geoip_database) | ||
#if LIBGEOIP_VERSION >= 1004001 | ||
- PHP_FE(geoip_region_name_by_code, NULL) | ||
- PHP_FE(geoip_time_zone_by_country_and_region, NULL) | ||
+ PHP_FE(geoip_region_name_by_code, arginfo_geoip_region) | ||
+ PHP_FE(geoip_time_zone_by_country_and_region, arginfo_geoip_region) | ||
#endif | ||
#ifdef HAVE_CUSTOM_DIRECTORY | ||
- PHP_FE(geoip_setup_custom_directory, NULL) | ||
+ PHP_FE(geoip_setup_custom_directory, arginfo_geoip_directory) | ||
#endif | ||
- PHP_FE(geoip_asnum_by_name, NULL) | ||
- PHP_FE(geoip_domain_by_name, NULL) | ||
+ PHP_FE(geoip_asnum_by_name, arginfo_geoip_host) | ||
+ PHP_FE(geoip_domain_by_name, arginfo_geoip_host) | ||
#if LIBGEOIP_VERSION >= 1004008 | ||
- PHP_FE(geoip_netspeedcell_by_name, NULL) | ||
+ PHP_FE(geoip_netspeedcell_by_name, arginfo_geoip_host) | ||
#endif | ||
+#ifdef PHP_FE_END | ||
+ PHP_FE_END | ||
+#else | ||
{NULL, NULL, NULL} | ||
+#endif | ||
}; | ||
/* }}} */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Copyright 1999-2019 Gentoo Authors | ||
# Distributed under the terms of the GNU General Public License v2 | ||
|
||
EAPI=6 | ||
|
||
PHP_EXT_NAME="geoip" | ||
DOCS="README ChangeLog" | ||
USE_PHP="php7-2 php7-3 php7-4 php8-0" | ||
|
||
inherit php-ext-pecl-r3 | ||
|
||
KEYWORDS="~amd64 ~x86" | ||
|
||
DESCRIPTION="PHP extension to map IP address to geographic places" | ||
LICENSE="PHP-3" | ||
SLOT="0" | ||
IUSE="" | ||
|
||
DEPEND="dev-libs/geoip" | ||
RDEPEND="${DEPEND}" | ||
|
||
PATCHES=( | ||
"${FILESDIR}/fix-failing-tests-1.1.1.patch" | ||
"${FILESDIR}/php8-support-1.1.1.patch" | ||
) |