[93167] trunk/dports/php

ryandesign at macports.org ryandesign at macports.org
Wed May 16 16:55:22 PDT 2012


Revision: 93167
          https://trac.macports.org/changeset/93167
Author:   ryandesign at macports.org
Date:     2012-05-16 16:55:21 -0700 (Wed, 16 May 2012)
Log Message:
-----------
php-xhprof: unified port; add upstream patch to fix build with php 5.4

Modified Paths:
--------------
    trunk/dports/php/php-xhprof/Portfile

Added Paths:
-----------
    trunk/dports/php/php-xhprof/
    trunk/dports/php/php-xhprof/files/patch-extension-xhprof.c.diff

Modified: trunk/dports/php/php-xhprof/Portfile
===================================================================
--- trunk/dports/php/php5-xhprof/Portfile	2012-05-16 23:35:44 UTC (rev 93166)
+++ trunk/dports/php/php-xhprof/Portfile	2012-05-16 23:55:21 UTC (rev 93167)
@@ -2,10 +2,10 @@
 # $Id$
 
 PortSystem              1.0
-PortGroup               php5extension 1.0
+PortGroup               php 1.0
 
-php5extension.setup     xhprof 0.9.2 pecl
-revision                3
+php.setup               xhprof 0.9.2 pecl
+php.branches            5.3 5.4
 categories-append       devel
 platforms               darwin
 maintainers             nomaintainer
@@ -19,24 +19,29 @@
                         sha1    cef6bfb3374e05c7b7445249a304e066d4fd8574 \
                         rmd160  93ba97e303c038d1be54c55ecd67c68367e0356a
 
-php5extension.build_dirs    ${worksrcpath}/extension
-
-use_parallel_build      yes
-
-post-destroot {
-    # Install php files not installed by the Makefile
-    xinstall -d ${destroot}${prefix}/www/${name}
-    copy ${worksrcpath}/examples ${destroot}${prefix}/www/${name}/examples
-    copy ${worksrcpath}/xhprof_lib ${destroot}${prefix}/www/${name}/xhprof_lib
-    copy ${worksrcpath}/xhprof_html ${destroot}${prefix}/www/${name}/xhprof_html
-}
-
-variant graphviz description {Build with graphviz, support for callgraphs} {
-    depends_run-append      path:bin/dot:graphviz
-    patchfiles-append       patch-callgraph_utils.php.diff
+if {${name} != ${subport}} {
+    patchfiles          patch-callgraph_utils.php.diff \
+                        patch-extension-xhprof.c.diff
+    
     post-patch {
         reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/xhprof_lib/utils/callgraph_utils.php
     }
+    
+    php.build_dirs      ${worksrcpath}/extension
+    
+    use_parallel_build  yes
+    
+    post-destroot {
+        # Install php files not installed by the Makefile
+        xinstall -d ${destroot}${prefix}/www/${subport}
+        copy ${worksrcpath}/examples ${destroot}${prefix}/www/${subport}/examples
+        copy ${worksrcpath}/xhprof_lib ${destroot}${prefix}/www/${subport}/xhprof_lib
+        copy ${worksrcpath}/xhprof_html ${destroot}${prefix}/www/${subport}/xhprof_html
+    }
+    
+    variant graphviz description {Build with graphviz, support for callgraphs} {
+        depends_run-append      path:bin/dot:graphviz
+    }
 }
 
-livecheck.regex         {>(\d+(?:\.\d+)*(?:p\d+)?)</a></th>}
+php.pecl_livecheck_stable no

Added: trunk/dports/php/php-xhprof/files/patch-extension-xhprof.c.diff
===================================================================
--- trunk/dports/php/php-xhprof/files/patch-extension-xhprof.c.diff	                        (rev 0)
+++ trunk/dports/php/php-xhprof/files/patch-extension-xhprof.c.diff	2012-05-16 23:55:21 UTC (rev 93167)
@@ -0,0 +1,57 @@
+https://bugs.php.net/61674
+--- extension/xhprof.c.orig	2009-06-01 12:52:32.000000000 -0500
++++ extension/xhprof.c	2012-05-16 18:50:06.000000000 -0500
+@@ -28,6 +28,7 @@
+ #include "php_ini.h"
+ #include "ext/standard/info.h"
+ #include "php_xhprof.h"
++#include "Zend/zend_extensions.h"
+ #include <sys/time.h>
+ #include <sys/resource.h>
+ #include <stdlib.h>
+@@ -883,7 +884,7 @@
+ static char *hp_get_function_name(zend_op_array *ops TSRMLS_DC) {
+   zend_execute_data *data;
+   char              *func = NULL;
+-  char              *cls = NULL;
++  const char        *cls = NULL;
+   char              *ret = NULL;
+   int                len;
+   zend_function      *curr_func;
+@@ -927,7 +928,12 @@
+       /* we are dealing with a special directive/function like
+        * include, eval, etc.
+        */
++#if ZEND_EXTENSION_API_NO >= 220100525
++      curr_op = data->opline->extended_value;
++#else
+       curr_op = data->opline->op2.u.constant.value.lval;
++#endif
++
+       switch (curr_op) {
+         case ZEND_EVAL:
+           func = "eval";
+@@ -1645,13 +1651,22 @@
+   if (!_zend_execute_internal) {
+     /* no old override to begin with. so invoke the builtin's implementation  */
+     zend_op *opline = EX(opline);
++#if ZEND_EXTENSION_API_NO >= 220100525
++    temp_variable *retvar = &EX_T(opline->result.var);
++    ((zend_internal_function *) EX(function_state).function)->handler(
++                       opline->extended_value,
++                       retvar->var.ptr,
++                       (EX(function_state).function->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ?
++                       &retvar->var.ptr:NULL,
++                       EX(object), ret TSRMLS_CC);
++#else
+     ((zend_internal_function *) EX(function_state).function)->handler(
+                        opline->extended_value,
+                        EX_T(opline->result.u.var).var.ptr,
+                        EX(function_state).function->common.return_reference ?
+                        &EX_T(opline->result.u.var).var.ptr:NULL,
+                        EX(object), ret TSRMLS_CC);
+-
++#endif
+   } else {
+     /* call the old override */
+     _zend_execute_internal(execute_data, ret TSRMLS_CC);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120516/a9869a9f/attachment.html>


More information about the macports-changes mailing list