ports/146555: [patch] port graphics/pear-Image_Graph fix php53 issues

olli hauer ohauer at gmx.de
Thu May 13 22:10:09 UTC 2010


>Number:         146555
>Category:       ports
>Synopsis:       [patch] port graphics/pear-Image_Graph fix php53 issues
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Thu May 13 22:10:08 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     olli hauer <ohauer at gmx.de>
>Release:        
>Organization:
>Environment:
FreeBSD 7.3 (i386)
PHP 5.3.2


>Description:
pear-Image_Graph is broken with php 5.3 see http://pear.php.net/bugs/bug.php?id=16529


>How-To-Repeat:
Install php 5.3.x and pear-Image_Graph and apache

Enable web access to the following folder
 ${PREFIX}/share/doc/pear/Image_Graph/examples/

now open the index.html inside ${PREFIX}/share/doc/pear/Image_Graph/examples/
and watch the browser output and the httpd logs


>Fix:
The following patch makes pear-Image_Graph working again with php 5.3.

Additional only *.php files are processed by REINPLACE_CMD, no longer
all files (even graphics where changed with an additional newline)

I tested the patch with php 5.3 and 5.2 so I think it is save to
use '.if ${PHP_VER} != 4' as condition, but I suggest a further test.


--- patch_pear-Image_Graph.txt begins here ---
--- Makefile	2010/05/10 18:50:44	1.1
+++ Makefile	2010/05/13 20:07:18
@@ -17,6 +17,8 @@
 RUN_DEPENDS=	${PEARDIR}/Log.php:${PORTSDIR}/sysutils/pear-Log \
 		${PEARDIR}/Image/Canvas.php:${PORTSDIR}/graphics/pear-Image_Canvas
 
+USE_PHP=	yes
+
 CATEGORY=	Image
 FILES=		Graph.php Graph/Axis.php Graph/Common.php Graph/Config.php \
 		Graph/Constants.php Graph/DataPreprocessor.php \
@@ -163,12 +165,24 @@
 
 LATEST_LINK=	pear-Image_Graph
 
+.include <bsd.port.pre.mk>
 post-patch:
+# don't modify images
 .for file in ${FILES}
-	@${REINPLACE_CMD} -e "s|@package_version@|${DISTVERSION}|" ${WRKSRC}/${file}
+	@if ${ECHO_CMD} ${file} | ${GREP} -q -e "php$$" ; then \
+		${REINPLACE_CMD} -e "s|@package_version@|${DISTVERSION}|" ${WRKSRC}/${file}; \
+	fi
 .endfor
 
-.include <bsd.port.pre.mk>
+# fix for php5.3, see http://pear.php.net/bugs/bug.php?id=16529
+.if ${PHP_VER} != 4
+.for file in ${FILES}
+	@if ${ECHO_CMD} ${file} | ${GREP} -q -e "php$$" ; then \
+		${REINPLACE_CMD} -e 's|parent::Image[^(]*|parent::__construct|' ${WRKSRC}/${file}; \
+	fi
+.endfor
+.endif
+
 .include "${PORTSDIR}/devel/pear/bsd.pear.mk"
 
 .include <bsd.port.post.mk>
--- patch_pear-Image_Graph.txt ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list