Gentoo Archives: gentoo-commits

From: Michael Orlitzky <mjo@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-php/pecl-geoip/, dev-php/pecl-geoip/files/
Date: Sat, 29 Oct 2016 23:25:21
Message-Id: 1477783318.e4f3b3b12d833946c65c1184702d5985bc46c299.mjo@gentoo
1 commit: e4f3b3b12d833946c65c1184702d5985bc46c299
2 Author: Michael Orlitzky <mjo <AT> gentoo <DOT> org>
3 AuthorDate: Sat Oct 29 23:21:06 2016 +0000
4 Commit: Michael Orlitzky <mjo <AT> gentoo <DOT> org>
5 CommitDate: Sat Oct 29 23:21:58 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e4f3b3b1
7
8 dev-php/pecl-geoip: new version 1.1.1 to replace 1.1.0-r1.
9
10 This new version adds proper upstream php-7.x support. As a result, we
11 can drop the two patches that we carried in the files/ directory.
12
13 Gentoo-Bug: 598294
14
15 Package-Manager: portage-2.3.0
16
17 dev-php/pecl-geoip/Manifest | 1 +
18 dev-php/pecl-geoip/files/1.1.0-php7-support.patch | 446 ---------------------
19 dev-php/pecl-geoip/files/1.1.0-public-init.patch | 21 -
20 ...oip-1.1.0-r1.ebuild => pecl-geoip-1.1.1.ebuild} | 13 +-
21 4 files changed, 4 insertions(+), 477 deletions(-)
22
23 diff --git a/dev-php/pecl-geoip/Manifest b/dev-php/pecl-geoip/Manifest
24 index 107df01..4a257a6 100644
25 --- a/dev-php/pecl-geoip/Manifest
26 +++ b/dev-php/pecl-geoip/Manifest
27 @@ -1 +1,2 @@
28 DIST geoip-1.1.0.tgz 12714 SHA256 82c6deb7264d2ff7c4d6c45a7d27cff7ab097be965795e317e04a9c5b7be98b9 SHA512 8a0fc698a234d3b2c01f2a0c05c28025d98a5d3dce509ba19ee462abae0fd0f5631d96d3e8bba4fce6c23b278ec3875da5e8535971c7d880e2e307a097dc30a1 WHIRLPOOL f8ccf90958bdc0eee41f24b6ad04907884fed2efe2bca483fa816aceb46d15311325175b07f27d85085afdb5651fd071fd20b046ba42e30da26eea56a14912d6
29 +DIST geoip-1.1.1.tgz 13004 SHA256 b2d05c03019d46135c249b5a7fa0dbd43ca5ee98aea8ed807bc7aa90ac8c0f06 SHA512 395715297726aa8e7ed71297d403bea9cb08417a03adfca29dc6ea68bbc738c176f71ea621f9026109e07cd5a2adc647e2af8e140e18a6af1c8f0fe4ed1a9c6b WHIRLPOOL 2792b1c03efa7963b1d113133e21979ebe95ca0fc179192101cd515c77914c6c040bef744a81cbb7f36583c30dfa7b45123c2fca9c214314d9ab88429496bb24
30
31 diff --git a/dev-php/pecl-geoip/files/1.1.0-php7-support.patch b/dev-php/pecl-geoip/files/1.1.0-php7-support.patch
32 deleted file mode 100644
33 index bd50326..00000000
34 --- a/dev-php/pecl-geoip/files/1.1.0-php7-support.patch
35 +++ /dev/null
36 @@ -1,446 +0,0 @@
37 ---- a/geoip.c 2015/02/15 15:08:09 335947
38 -+++ b/geoip.c 2015/02/15 17:56:49 335948
39 -@@ -129,11 +129,19 @@
40 - {
41 - if (stage == PHP_INI_STAGE_RUNTIME || stage == PHP_INI_STAGE_HTACCESS) {
42 - GEOIP_G(set_runtime_custom_directory) = 1;
43 -+#if PHP_MAJOR_VERSION >= 7
44 -+ geoip_change_custom_directory(new_value->val);
45 -+#else
46 - geoip_change_custom_directory(new_value);
47 -+#endif
48 - return SUCCESS;
49 - }
50 -
51 -+#if PHP_MAJOR_VERSION >= 7
52 -+ return OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
53 -+#else
54 - return OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
55 -+#endif
56 - }
57 - /* }}} */
58 - #endif
59 -@@ -251,7 +259,7 @@
60 - /* {{{ proto boolean geoip_db_avail( [ int database ] ) */
61 - PHP_FUNCTION(geoip_db_avail)
62 - {
63 -- long edition;
64 -+ zend_long edition;
65 -
66 - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &edition) == FAILURE) {
67 - return;
68 -@@ -270,7 +278,7 @@
69 - /* {{{ proto string geoip_db_filename( [ int database ] ) */
70 - PHP_FUNCTION(geoip_db_filename)
71 - {
72 -- long edition;
73 -+ zend_long edition;
74 -
75 - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &edition) == FAILURE) {
76 - return;
77 -@@ -283,7 +291,11 @@
78 - }
79 -
80 - if (NULL != GeoIPDBFileName[edition])
81 -+#if PHP_MAJOR_VERSION >= 7
82 -+ RETURN_STRING(GeoIPDBFileName[edition]);
83 -+#else
84 - RETURN_STRING(GeoIPDBFileName[edition], 1);
85 -+#endif
86 - }
87 - /* }}} */
88 -
89 -@@ -298,16 +310,31 @@
90 - {
91 - if (NULL != GeoIPDBDescription[i])
92 - {
93 -+#if PHP_MAJOR_VERSION >= 7
94 -+ zval real_row;
95 -+ zval *row = &real_row;
96 -+
97 -+ array_init(row);
98 -+#else
99 - zval *row;
100 - ALLOC_INIT_ZVAL(row);
101 - array_init(row);
102 -+#endif
103 -
104 - add_assoc_bool(row, "available", GeoIP_db_avail(i));
105 - if (GeoIPDBDescription[i]) {
106 -+#if PHP_MAJOR_VERSION >= 7
107 -+ add_assoc_string(row, "description", (char *)GeoIPDBDescription[i]);
108 -+#else
109 - add_assoc_string(row, "description", (char *)GeoIPDBDescription[i], 1);
110 -+#endif
111 - }
112 - if (GeoIPDBFileName[i]) {
113 -+#if PHP_MAJOR_VERSION >= 7
114 -+ add_assoc_string(row, "filename", GeoIPDBFileName[i]);
115 -+#else
116 - add_assoc_string(row, "filename", GeoIPDBFileName[i], 1);
117 -+#endif
118 - }
119 -
120 - add_index_zval(return_value, i, row);
121 -@@ -322,7 +349,7 @@
122 - {
123 - GeoIP * gi;
124 - char * db_info;
125 -- long edition = GEOIP_COUNTRY_EDITION;
126 -+ zend_long edition = GEOIP_COUNTRY_EDITION;
127 -
128 - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &edition) == FAILURE) {
129 - return;
130 -@@ -347,12 +374,45 @@
131 - db_info = GeoIP_database_info(gi);
132 - GeoIP_delete(gi);
133 -
134 -+#if PHP_MAJOR_VERSION >= 7
135 -+ RETVAL_STRING(db_info);
136 -+#else
137 - RETVAL_STRING(db_info, 1);
138 -+#endif
139 - free(db_info);
140 - }
141 - /* }}} */
142 -
143 - /* {{{ */
144 -+#if PHP_MAJOR_VERSION >= 7
145 -+#define GEOIPDEF(php_func, c_func, db_type) \
146 -+ PHP_FUNCTION(php_func) \
147 -+ { \
148 -+ GeoIP * gi; \
149 -+ char * hostname = NULL; \
150 -+ const char * return_code; \
151 -+ size_t arglen; \
152 -+ \
153 -+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &hostname, &arglen) == FAILURE) { \
154 -+ return; \
155 -+ } \
156 -+ \
157 -+ if (GeoIP_db_avail(db_type)) { \
158 -+ gi = GeoIP_open_type(db_type, GEOIP_STANDARD); \
159 -+ } else { \
160 -+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Required database not available at %s.", GeoIPDBFileName[db_type]); \
161 -+ return; \
162 -+ } \
163 -+ \
164 -+ return_code = c_func(gi, hostname); \
165 -+ GeoIP_delete(gi); \
166 -+ if (return_code == NULL) { \
167 -+ RETURN_FALSE; \
168 -+ } \
169 -+ RETURN_STRING((char*)return_code); \
170 -+ \
171 -+ }
172 -+#else
173 - #define GEOIPDEF(php_func, c_func, db_type) \
174 - PHP_FUNCTION(php_func) \
175 - { \
176 -@@ -380,6 +440,7 @@
177 - RETURN_STRING((char*)return_code, 1); \
178 - \
179 - }
180 -+#endif
181 - #include "geoip.def"
182 - #undef GEOIPDEF
183 - /* }}} */
184 -@@ -391,7 +452,11 @@
185 - GeoIP * gi;
186 - char * hostname = NULL;
187 - int id;
188 -+#if PHP_MAJOR_VERSION >= 7
189 -+ size_t arglen;
190 -+#else
191 - int arglen;
192 -+#endif
193 -
194 - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &hostname, &arglen) == FAILURE) {
195 - return;
196 -@@ -409,7 +474,11 @@
197 - if (id == 0) {
198 - RETURN_FALSE;
199 - }
200 -+#if PHP_MAJOR_VERSION >= 7
201 -+ RETURN_STRING((char *)GeoIP_country_continent[id]);
202 -+#else
203 - RETURN_STRING((char *)GeoIP_country_continent[id], 1);
204 -+#endif
205 - }
206 - /* }}} */
207 -
208 -@@ -420,7 +489,11 @@
209 - GeoIP * gi;
210 - char * hostname = NULL;
211 - char * org;
212 -+#if PHP_MAJOR_VERSION >= 7
213 -+ size_t arglen;
214 -+#else
215 - int arglen;
216 -+#endif
217 -
218 - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &hostname, &arglen) == FAILURE) {
219 - return;
220 -@@ -438,7 +511,11 @@
221 - if (org == NULL) {
222 - RETURN_FALSE;
223 - }
224 -+#if PHP_MAJOR_VERSION >= 7
225 -+ RETVAL_STRING(org);
226 -+#else
227 - RETVAL_STRING(org, 1);
228 -+#endif
229 - free(org);
230 - }
231 - /* }}} */
232 -@@ -450,7 +527,11 @@
233 - GeoIP * gi;
234 - char * hostname = NULL;
235 - char * org;
236 -+#if PHP_MAJOR_VERSION >= 7
237 -+ size_t arglen;
238 -+#else
239 - int arglen;
240 -+#endif
241 -
242 - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &hostname, &arglen) == FAILURE) {
243 - return;
244 -@@ -468,7 +549,11 @@
245 - if (org == NULL) {
246 - RETURN_FALSE;
247 - }
248 -+#if PHP_MAJOR_VERSION >= 7
249 -+ RETVAL_STRING(org);
250 -+#else
251 - RETVAL_STRING(org, 1);
252 -+#endif
253 - free(org);
254 - }
255 - /* }}} */
256 -@@ -480,7 +565,11 @@
257 - GeoIP * gi;
258 - char * hostname = NULL;
259 - char * org;
260 -+#if PHP_MAJOR_VERSION >= 7
261 -+ size_t arglen;
262 -+#else
263 - int arglen;
264 -+#endif
265 -
266 - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &hostname, &arglen) == FAILURE) {
267 - return;
268 -@@ -498,7 +587,11 @@
269 - if (org == NULL) {
270 - RETURN_FALSE;
271 - }
272 -+#if PHP_MAJOR_VERSION >= 7
273 -+ RETVAL_STRING(org);
274 -+#else
275 - RETVAL_STRING(org, 1);
276 -+#endif
277 - free(org);
278 - }
279 - /* }}} */
280 -@@ -511,7 +604,11 @@
281 - GeoIP * gi;
282 - char * hostname = NULL;
283 - char * org;
284 -+#if PHP_MAJOR_VERSION >= 7
285 -+ size_t arglen;
286 -+#else
287 - int arglen;
288 -+#endif
289 -
290 - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &hostname, &arglen) == FAILURE) {
291 - return;
292 -@@ -529,7 +626,11 @@
293 - if (org == NULL) {
294 - RETURN_FALSE;
295 - }
296 -+#if PHP_MAJOR_VERSION >= 7
297 -+ RETVAL_STRING(org);
298 -+#else
299 - RETVAL_STRING(org, 1);
300 -+#endif
301 - free(org);
302 - }
303 - /* }}} */
304 -@@ -541,7 +642,11 @@
305 - {
306 - GeoIP * gi;
307 - char * hostname = NULL;
308 -+#if PHP_MAJOR_VERSION >= 7
309 -+ size_t arglen;
310 -+#else
311 - int arglen;
312 -+#endif
313 - GeoIPRecord * gir;
314 -
315 - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &hostname, &arglen) == FAILURE) {
316 -@@ -567,15 +672,27 @@
317 - }
318 -
319 - array_init(return_value);
320 --#if LIBGEOIP_VERSION >= 1004003
321 -+#if PHP_MAJOR_VERSION >= 7
322 -+# if LIBGEOIP_VERSION >= 1004003
323 -+ add_assoc_string(return_value, "continent_code", (gir->continent_code == NULL) ? "" : gir->continent_code);
324 -+# endif
325 -+ add_assoc_string(return_value, "country_code", (gir->country_code == NULL) ? "" : gir->country_code);
326 -+ add_assoc_string(return_value, "country_code3", (gir->country_code3 == NULL) ? "" : gir->country_code3);
327 -+ add_assoc_string(return_value, "country_name", (gir->country_name == NULL) ? "" : gir->country_name);
328 -+ add_assoc_string(return_value, "region", (gir->region == NULL) ? "" : gir->region);
329 -+ add_assoc_string(return_value, "city", (gir->city == NULL) ? "" : gir->city);
330 -+ add_assoc_string(return_value, "postal_code", (gir->postal_code == NULL) ? "" : gir->postal_code);
331 -+#else
332 -+# if LIBGEOIP_VERSION >= 1004003
333 - add_assoc_string(return_value, "continent_code", (gir->continent_code == NULL) ? "" : gir->continent_code, 1);
334 --#endif
335 -+# endif
336 - add_assoc_string(return_value, "country_code", (gir->country_code == NULL) ? "" : gir->country_code, 1);
337 - add_assoc_string(return_value, "country_code3", (gir->country_code3 == NULL) ? "" : gir->country_code3, 1);
338 - add_assoc_string(return_value, "country_name", (gir->country_name == NULL) ? "" : gir->country_name, 1);
339 - add_assoc_string(return_value, "region", (gir->region == NULL) ? "" : gir->region, 1);
340 - add_assoc_string(return_value, "city", (gir->city == NULL) ? "" : gir->city, 1);
341 - add_assoc_string(return_value, "postal_code", (gir->postal_code == NULL) ? "" : gir->postal_code, 1);
342 -+#endif
343 - add_assoc_double(return_value, "latitude", gir->latitude);
344 - add_assoc_double(return_value, "longitude", gir->longitude);
345 - #if LIBGEOIP_VERSION >= 1004005
346 -@@ -595,7 +712,11 @@
347 - {
348 - GeoIP * gi;
349 - char * hostname = NULL;
350 -+#if PHP_MAJOR_VERSION >= 7
351 -+ size_t arglen;
352 -+#else
353 - int arglen;
354 -+#endif
355 - int netspeed;
356 -
357 - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &hostname, &arglen) == FAILURE) {
358 -@@ -621,7 +742,11 @@
359 - {
360 - GeoIP * gi;
361 - char * hostname = NULL;
362 -+#if PHP_MAJOR_VERSION >= 7
363 -+ size_t arglen;
364 -+#else
365 - int arglen;
366 -+#endif
367 - GeoIPRegion * region;
368 -
369 - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &hostname, &arglen) == FAILURE) {
370 -@@ -647,9 +772,14 @@
371 - }
372 -
373 - array_init(return_value);
374 -+#if PHP_MAJOR_VERSION >= 7
375 -+ add_assoc_string(return_value, "country_code", region->country_code);
376 -+ add_assoc_string(return_value, "region", region->region);
377 -+#else
378 - add_assoc_string(return_value, "country_code", region->country_code, 1);
379 - add_assoc_string(return_value, "region", region->region, 1);
380 --
381 -+#endif
382 -+
383 - GeoIPRegion_delete(region);
384 - }
385 - /* }}} */
386 -@@ -661,7 +791,11 @@
387 - GeoIP * gi;
388 - char * hostname = NULL;
389 - char * isp;
390 -+#if PHP_MAJOR_VERSION >= 7
391 -+ size_t arglen;
392 -+#else
393 - int arglen;
394 -+#endif
395 -
396 - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &hostname, &arglen) == FAILURE) {
397 - return;
398 -@@ -679,7 +813,11 @@
399 - if (isp == NULL) {
400 - RETURN_FALSE;
401 - }
402 -+#if PHP_MAJOR_VERSION >= 7
403 -+ RETVAL_STRING(isp);
404 -+#else
405 - RETVAL_STRING(isp, 1);
406 -+#endif
407 - free(isp);
408 - }
409 -
410 -@@ -691,7 +829,11 @@
411 - char * country_code = NULL;
412 - char * region_code = NULL;
413 - const char * region_name;
414 -+#if PHP_MAJOR_VERSION >= 7
415 -+ size_t countrylen, regionlen;
416 -+#else
417 - int countrylen, regionlen;
418 -+#endif
419 -
420 - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &country_code, &countrylen, &region_code, &regionlen) == FAILURE) {
421 - return;
422 -@@ -706,7 +848,11 @@
423 - if (region_name == NULL) {
424 - RETURN_FALSE;
425 - }
426 -+#if PHP_MAJOR_VERSION >= 7
427 -+ RETURN_STRING((char*)region_name);
428 -+#else
429 - RETURN_STRING((char*)region_name, 1);
430 -+#endif
431 - }
432 - /* }}} */
433 - #endif
434 -@@ -719,7 +865,11 @@
435 - char * country = NULL;
436 - char * region = NULL;
437 - const char * timezone;
438 -+#if PHP_MAJOR_VERSION >= 7
439 -+ size_t countrylen, arg2len;
440 -+#else
441 - int countrylen, arg2len;
442 -+#endif
443 -
444 - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &country, &countrylen, &region, &arg2len) == FAILURE) {
445 - return;
446 -@@ -734,7 +884,11 @@
447 - if (timezone == NULL) {
448 - RETURN_FALSE;
449 - }
450 -+#if PHP_MAJOR_VERSION >= 7
451 -+ RETURN_STRING((char*)timezone);
452 -+#else
453 - RETURN_STRING((char*)timezone, 1);
454 -+#endif
455 - }
456 - /* }}} */
457 - #endif
458 -@@ -745,7 +899,11 @@
459 - PHP_FUNCTION(geoip_setup_custom_directory)
460 - {
461 - char * dir = NULL;
462 -+#if PHP_MAJOR_VERSION >= 7
463 -+ size_t dirlen;
464 -+#else
465 - int dirlen;
466 -+#endif
467 -
468 - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &dir, &dirlen) == FAILURE) {
469 - return;
470 ---- a/php_geoip.h 2015/02/15 15:08:09 335947
471 -+++ b/php_geoip.h 2015/02/15 17:56:49 335948
472 -@@ -26,6 +26,10 @@
473 -
474 - #define PHP_GEOIP_VERSION "1.1.1-dev"
475 -
476 -+#if PHP_MAJOR_VERSION < 7
477 -+typedef long zend_long;
478 -+#endif
479 -+
480 - #ifdef PHP_WIN32
481 - #define PHP_GEOIP_API __declspec(dllexport)
482 - #else
483
484 diff --git a/dev-php/pecl-geoip/files/1.1.0-public-init.patch b/dev-php/pecl-geoip/files/1.1.0-public-init.patch
485 deleted file mode 100644
486 index 36c5fa6..00000000
487 --- a/dev-php/pecl-geoip/files/1.1.0-public-init.patch
488 +++ /dev/null
489 @@ -1,21 +0,0 @@
490 ---- a/geoip.c 2014/05/06 12:11:37 333484
491 -+++ b/geoip.c 2014/05/06 12:52:25 333485
492 -@@ -117,7 +117,7 @@
493 - #endif
494 -
495 - GeoIP_setup_custom_directory(value);
496 -- _GeoIP_setup_dbfilename();
497 -+ GeoIP_db_avail(GEOIP_COUNTRY_EDITION);
498 - }
499 - /* }}} */
500 - #endif
501 -@@ -168,7 +168,8 @@
502 - #ifdef HAVE_CUSTOM_DIRECTORY
503 - GeoIP_setup_custom_directory(GEOIP_G(custom_directory));
504 - #endif
505 -- _GeoIP_setup_dbfilename();
506 -+ /* This will initialize file structure */
507 -+ GeoIP_db_avail(GEOIP_COUNTRY_EDITION);
508 -
509 - /* For database type constants */
510 - REGISTER_LONG_CONSTANT("GEOIP_COUNTRY_EDITION", GEOIP_COUNTRY_EDITION, CONST_CS | CONST_PERSISTENT);
511
512 diff --git a/dev-php/pecl-geoip/pecl-geoip-1.1.0-r1.ebuild b/dev-php/pecl-geoip/pecl-geoip-1.1.1.ebuild
513 similarity index 61%
514 rename from dev-php/pecl-geoip/pecl-geoip-1.1.0-r1.ebuild
515 rename to dev-php/pecl-geoip/pecl-geoip-1.1.1.ebuild
516 index 8dcfd62..025d6aa 100644
517 --- a/dev-php/pecl-geoip/pecl-geoip-1.1.0-r1.ebuild
518 +++ b/dev-php/pecl-geoip/pecl-geoip-1.1.1.ebuild
519 @@ -2,14 +2,11 @@
520 # Distributed under the terms of the GNU General Public License v2
521 # $Id$
522
523 -EAPI="6"
524 +EAPI=6
525
526 PHP_EXT_NAME="geoip"
527 -PHP_EXT_INI="yes"
528 -PHP_EXT_ZENDEXT="no"
529 DOCS="README ChangeLog"
530 -
531 -USE_PHP="php7-0 php5-6 php5-5"
532 +USE_PHP="php5-5 php5-6 php7-0"
533
534 inherit php-ext-pecl-r3
535
536 @@ -20,9 +17,5 @@ LICENSE="PHP-3"
537 SLOT="0"
538 IUSE=""
539
540 -DEPEND=">=dev-libs/geoip-1.4.0"
541 +DEPEND="dev-libs/geoip"
542 RDEPEND="${DEPEND}"
543 -
544 -PATCHES=(
545 - "${FILESDIR}/${PV}-public-init.patch"
546 - "${FILESDIR}/${PV}-php7-support.patch" )