pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/lang/php5-perl * pass strict PERL location to configure



details:   https://anonhg.NetBSD.org/pkgsrc/rev/36ac6a4831c8
branches:  trunk
changeset: 603748:36ac6a4831c8
user:      obache <obache%pkgsrc.org@localhost>
date:      Sat May 12 11:40:06 2012 +0000

description:
* pass strict PERL location to configure
* restore version scheme for php-5.2, missing treatment at introduced
  PECL_LEGACY_VERSION_SCHEME.
* add an patch to fix build on php>=5.3.

diffstat:

 lang/php5-perl/Makefile                  |    9 +-
 lang/php5-perl/distinfo                  |    3 +-
 lang/php5-perl/patches/patch-php__perl.c |  157 +++++++++++++++++++++++++++++++
 3 files changed, 165 insertions(+), 4 deletions(-)

diffs (196 lines):

diff -r d6145dcf8900 -r 36ac6a4831c8 lang/php5-perl/Makefile
--- a/lang/php5-perl/Makefile   Sat May 12 11:32:39 2012 +0000
+++ b/lang/php5-perl/Makefile   Sat May 12 11:40:06 2012 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.7 2011/10/17 11:50:05 obache Exp $
+# $NetBSD: Makefile,v 1.8 2012/05/12 11:40:06 obache Exp $
 
 MODNAME=               perl
 PKGMODNAME=            perl
@@ -9,9 +9,12 @@
 
 PKG_DESTDIR_SUPPORT=   user-destdir
 
-CONFIGURE_ARGS+=       --with-perl=${PREFIX}
+CONFIGURE_ARGS+=       --with-perl=${PERLDIR}
 
-PHP_VERSIONS_ACCEPTED= 52
+.include "../../lang/php/phpversion.mk"
+.if ${PKG_PHP_VERSION} == "5" || ${PKG_PHP_VERSION} == "52"
+PECL_LEGACY_VERSION_SCHEME=    yes
+.endif
 
 .include "../../lang/perl5/buildlink3.mk"
 .include "../../lang/php/ext.mk"
diff -r d6145dcf8900 -r 36ac6a4831c8 lang/php5-perl/distinfo
--- a/lang/php5-perl/distinfo   Sat May 12 11:32:39 2012 +0000
+++ b/lang/php5-perl/distinfo   Sat May 12 11:40:06 2012 +0000
@@ -1,5 +1,6 @@
-$NetBSD: distinfo,v 1.1.1.1 2009/07/03 07:40:05 manu Exp $
+$NetBSD: distinfo,v 1.2 2012/05/12 11:40:06 obache Exp $
 
 SHA1 (php-perl/perl-1.0.0.tgz) = 5886c5c6f03d723e213092fce122efc3482bb0f1
 RMD160 (php-perl/perl-1.0.0.tgz) = 3bce7679c7575c3de554be521514f4c74cc6fac4
 Size (php-perl/perl-1.0.0.tgz) = 24358 bytes
+SHA1 (patch-php__perl.c) = 43b94b84526cf8d9e0fc7cba251aa38d15eee69f
diff -r d6145dcf8900 -r 36ac6a4831c8 lang/php5-perl/patches/patch-php__perl.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/php5-perl/patches/patch-php__perl.c  Sat May 12 11:40:06 2012 +0000
@@ -0,0 +1,157 @@
+$NetBSD: patch-php__perl.c,v 1.1 2012/05/12 11:40:06 obache Exp $
+
+* fixes build with PHP>=5.3
+
+--- php_perl.c.orig    2004-12-17 10:49:46.000000000 +0000
++++ php_perl.c
+@@ -55,6 +55,19 @@
+ #include "SAPI.h"
+ #include "php_perl.h"
+ 
++#ifndef Z_ISREF_P
++#define Z_ISREF_P(z)          (z)->is_ref
++#endif
++#ifndef Z_SET_ISREF_P
++#define Z_SET_ISREF_P(z)      (z)->is_ref = 1
++#endif
++#ifndef Z_ADDREF_P
++#define Z_ADDREF_P(z)         (z)->refcount++
++#endif
++#ifndef Z_SET_REFCOUNT_P
++#define Z_SET_REFCOUNT_P(pz,rc)       (pz)->refcount = (rc)
++#endif
++
+ ZEND_BEGIN_MODULE_GLOBALS(perl)
+   PerlInterpreter *perl;
+   HashTable       perl_objects; /* this hash is used to make one to one
+@@ -340,14 +353,14 @@ static SV* php_perl_zval_to_sv_ref(PerlI
+ {
+   SV* sv;
+ 
+-  if ((zv->is_ref || Z_TYPE_P(zv) == IS_OBJECT || Z_TYPE_P(zv) == IS_ARRAY) &&
++  if ((Z_ISREF_P(zv) || Z_TYPE_P(zv) == IS_OBJECT || Z_TYPE_P(zv) == IS_ARRAY) &&
+       zend_hash_find(var_hash, (char*)zv, sizeof(zv), (void**)&sv) == SUCCESS) {
+     sv = *(SV**)sv;
+     SvREFCNT_inc(sv);
+     return sv;
+   }
+   sv = php_perl_zval_to_sv_noref(my_perl, zv, var_hash TSRMLS_CC);
+-  if (zv->is_ref || Z_TYPE_P(zv) == IS_OBJECT || Z_TYPE_P(zv) == IS_ARRAY) {
++  if (Z_ISREF_P(zv) || Z_TYPE_P(zv) == IS_OBJECT || Z_TYPE_P(zv) == IS_ARRAY) {
+     zend_hash_add(var_hash, (char*)zv, sizeof(zv), &sv, sizeof(SV*), NULL);
+   }
+   return sv;
+@@ -390,7 +403,7 @@ static SV* php_perl_zval_to_sv_noref(Per
+         SV* sv = (SV*)newRV((SV*)hv);
+         zval** zv_ptr;
+ 
+-        if (zv->is_ref || Z_TYPE_P(zv) == IS_ARRAY) {
++        if (Z_ISREF_P(zv) || Z_TYPE_P(zv) == IS_ARRAY) {
+           zend_hash_add(var_hash, (char*)zv, sizeof(zv), &sv, sizeof(SV*), NULL);
+         }
+ 
+@@ -420,7 +433,7 @@ static SV* php_perl_zval_to_sv_noref(Per
+         SV* sv = (SV*)newRV((SV*)av);
+         zval** zv_ptr;
+ 
+-        if (zv->is_ref || Z_TYPE_P(zv) == IS_ARRAY) {
++        if (Z_ISREF_P(zv) || Z_TYPE_P(zv) == IS_ARRAY) {
+           zend_hash_add(var_hash, (char*)zv, sizeof(zv), &sv, sizeof(SV*), NULL);
+         }
+ 
+@@ -480,9 +493,9 @@ static zval* php_perl_sv_to_zval_ref(Per
+       FREE_ZVAL(zv);
+     }
+     if (Z_TYPE_PP(z) != IS_OBJECT) {
+-      (*z)->is_ref = 1;
++      Z_SET_ISREF_P(*z);
+     }
+-    (*z)->refcount++;
++    Z_ADDREF_P(*z);
+     return *z;
+   }
+ 
+@@ -750,7 +763,7 @@ static zval* php_perl_get(zval *object T
+   }
+   retval = php_perl_sv_to_zval(my_perl, obj->sv, NULL TSRMLS_CC);
+   /* ensure we're creating a temporary variable */
+-  if (retval) {retval->refcount = 0;}
++  if (retval) {Z_SET_REFCOUNT_P(retval, 0);}
+   return retval;
+ }
+ 
+@@ -824,8 +837,8 @@ static zval* php_perl_read_dimension(zva
+         obj->context = PERL_SCALAR;
+ 
+         ALLOC_INIT_ZVAL(retval);
+-        retval->refcount = 0;
+-        retval->is_ref = 1;
++        Z_SET_REFCOUNT_P(retval, 0);
++        Z_SET_ISREF_P(retval);
+         retval->type = IS_OBJECT;
+         Z_OBJ_HT_P(retval) = &php_perl_proxy_handlers;
+         Z_OBJ_HANDLE_P(retval) = zend_objects_store_put(obj, php_perl_destructor, NULL, NULL TSRMLS_CC);        
+@@ -833,7 +846,7 @@ static zval* php_perl_read_dimension(zva
+         ALLOC_INIT_ZVAL(retval);
+         retval = php_perl_sv_to_zval(my_perl, *prop_val, retval TSRMLS_CC);
+         /* ensure we're creating a temporary variable */
+-        if (retval) {retval->refcount = 0;}
++        if (retval) {Z_SET_REFCOUNT_P(retval, 0);}
+       }
+     }
+   } else if (SvTYPE(sv) == SVt_PVHV) {
+@@ -973,7 +986,7 @@ static zval* php_perl_read_property(zval
+       new_obj->properties = NULL;
+ 
+       ALLOC_INIT_ZVAL(new_object);
+-      new_object->refcount = 0;
++      Z_SET_REFCOUNT_P(new_object, 0);
+       new_object->type = IS_OBJECT;
+       new_object->value.obj.handlers = &php_perl_object_handlers;
+       new_object->value.obj.handle =
+@@ -990,7 +1003,7 @@ static zval* php_perl_read_property(zval
+       new_obj->properties = NULL;
+ 
+       ALLOC_INIT_ZVAL(new_object);
+-      new_object->refcount = 0;
++      Z_SET_REFCOUNT_P(new_object, 0);
+       new_object->type = IS_OBJECT;
+       new_object->value.obj.handlers = &php_perl_object_handlers;
+       new_object->value.obj.handle =
+@@ -1007,7 +1020,7 @@ static zval* php_perl_read_property(zval
+       new_obj->properties = NULL;
+ 
+       ALLOC_INIT_ZVAL(new_object);
+-      new_object->refcount = 0;
++      Z_SET_REFCOUNT_P(new_object, 0);
+       new_object->type = IS_OBJECT;
+       new_object->value.obj.handlers = &php_perl_object_handlers;
+       new_object->value.obj.handle =
+@@ -1085,15 +1098,15 @@ static zval* php_perl_read_property(zval
+       obj->context = PERL_SCALAR;
+ 
+       ALLOC_INIT_ZVAL(retval);
+-      retval->refcount = 0;
+-      retval->is_ref = 1;
++      Z_SET_REFCOUNT_P(retval, 0);
++      Z_SET_ISREF_P(retval);
+       retval->type = IS_OBJECT;
+       Z_OBJ_HT_P(retval) = &php_perl_proxy_handlers;
+       Z_OBJ_HANDLE_P(retval) = zend_objects_store_put(obj, php_perl_destructor, NULL, NULL TSRMLS_CC);        
+     } else {
+       retval = php_perl_sv_to_zval(my_perl, sv, retval TSRMLS_CC);
+       /* ensure we're creating a temporary variable */
+-      if (retval) {retval->refcount = 0;}
++      if (retval) {Z_SET_REFCOUNT_P(retval, 0);}
+     }
+   }
+ 
+@@ -1755,7 +1768,7 @@ static void php_perl_iterator_rewind(zen
+ zend_object_iterator *php_perl_get_iterator(zend_class_entry *ce, zval *object TSRMLS_DC)
+ {
+   zend_object_iterator *iterator = emalloc(sizeof(zend_object_iterator));
+-  object->refcount++;
++  Z_ADDREF_P(object);
+   iterator->data = (void*)object;
+   iterator->funcs = &php_perl_iterator_funcs;
+ 



Home | Main Index | Thread Index | Old Index