From 535ae3c93799928c1edd42f3462e78ce7eea3440 Mon Sep 17 00:00:00 2001 From: DPorts Builder Date: Sat, 11 Apr 2015 02:47:37 -0700 Subject: [PATCH] Update graphics/pecl-imlib2 to version 0.1.00_6 --- graphics/pecl-imlib2/Makefile | 12 +- graphics/pecl-imlib2/files/patch-imlib2.c | 146 +++++++++++++++++++-- graphics/pecl-imlib2/files/patch-php_imlib | 22 ++++ 3 files changed, 166 insertions(+), 14 deletions(-) create mode 100644 graphics/pecl-imlib2/files/patch-php_imlib diff --git a/graphics/pecl-imlib2/Makefile b/graphics/pecl-imlib2/Makefile index 2fb3db9ef4a..d23a5094df9 100644 --- a/graphics/pecl-imlib2/Makefile +++ b/graphics/pecl-imlib2/Makefile @@ -3,29 +3,29 @@ PORTNAME= imlib2 PORTVERSION= 0.1.00 -PORTREVISION= 5 +PORTREVISION= 6 CATEGORIES= graphics MASTER_SITES= http://pecl.php.net/get/ PKGNAMEPREFIX= pecl- -EXTRACT_SUFX= .tgz DIST_SUBDIR= PECL MAINTAINER= leeym@FreeBSD.org COMMENT= PECL extension if imlib2 +LICENSE= PHP202 + LIB_DEPENDS= libImlib2.so:${PORTSDIR}/graphics/imlib2 +USES= tar:tgz USE_PHP= yes USE_PHPEXT= yes -DEFAULT_PHP_VER=53 -IGNORE_WITH_PHP=5 # libImlib2 may or may not depend on X, however, # imlib2 extension doesn't need X related functions in libImlib2 -CFLAGS+= -DX_DISPLAY_MISSING +CFLAGS+= -DX_DISPLAY_MISSING -Wno-deprecated post-patch: @${REINPLACE_CMD} -e 's/-ldl//' ${WRKSRC}/config.m4 - @${REINPLACE_CMD} -e '/Xlib.h/d' ${WRKSRC}/php_imlib2.h + @${REINPLACE_CMD} -e 's,/usr/share,${LOCALBASE}/share,' ${WRKSRC}/imlib2.c .include diff --git a/graphics/pecl-imlib2/files/patch-imlib2.c b/graphics/pecl-imlib2/files/patch-imlib2.c index 57706077dec..5983e6fe765 100644 --- a/graphics/pecl-imlib2/files/patch-imlib2.c +++ b/graphics/pecl-imlib2/files/patch-imlib2.c @@ -1,6 +1,14 @@ ---- ./imlib2.c.orig 2004-01-01 18:57:55.000000000 -0500 -+++ ./imlib2.c 2010-04-16 20:02:16.000000000 -0400 -@@ -47,6 +47,10 @@ +--- imlib2.c 2004-01-01 18:57:55.000000000 -0500 ++++ imlib2.c 2015-04-09 12:48:55.000000000 -0400 +@@ -26,6 +26,7 @@ + + #include "php.h" + #include "php_ini.h" ++#include "ext/standard/head.h" + #include "ext/standard/info.h" + #include "php_imlib2.h" + #include +@@ -47,8 +48,12 @@ static int le_imlib2_img; static int le_imlib2_poly; @@ -9,9 +17,41 @@ + ZEND_ARG_PASS_INFO(1) + ZEND_END_ARG_INFO(); - function_entry imlib2_functions[] = { +-function_entry imlib2_functions[] = { ++zend_function_entry imlib2_functions[] = { PHP_FE(imlib2_image_modify_gamma,NULL) -@@ -643,8 +647,8 @@ + PHP_FE(imlib2_image_modify_contrast,NULL) + PHP_FE(imlib2_image_modify_brightness,NULL) +@@ -271,8 +276,8 @@ + *four = Z_LVAL_PP(zfour); + } + +-static int _php_handle_cliprect_array(zval **dbox, char *func_name, +- int *x, int *y, int *w, int *h) ++static int _php_handle_cliprect_array(zval **dbox, const char *func_name, ++ int *x, int *y, int *w, int *h TSRMLS_DC) + { + zval **element, ***box_coords; + int i,arrcount; +@@ -382,7 +387,7 @@ + } + + +-static void _php_imlib2_draw_something(INTERNAL_FUNCTION_PARAMETERS, void (*func)(), char *func_name) ++static void _php_imlib2_draw_something(INTERNAL_FUNCTION_PARAMETERS, void (*func)(), const char *func_name) + { + zval **img, **d1, **d2, **d3, **d4, **dr, **dg, **db, **da, **dbox; + int x,y,w,h,r,g,b,a,cx,cy,cw,ch,argc; +@@ -407,7 +412,7 @@ + + if (argc > 9) + { +- if (!_php_handle_cliprect_array(dbox, func_name, &cx,&cy,&cw,&ch)) ++ if (!_php_handle_cliprect_array(dbox, func_name, &cx,&cy,&cw,&ch TSRMLS_CC)) + RETURN_FALSE; + imlib_context_set_cliprect(cx,cy,cw,ch); + } +@@ -643,8 +648,8 @@ zval **img, **gamma; Imlib_Image im; Imlib_Color_Modifier cm; @@ -21,7 +61,16 @@ if (ZEND_NUM_ARGS() != 2 | zend_get_parameters_ex(2, &img, &gamma) == FAILURE) { WRONG_PARAM_COUNT; -@@ -675,8 +679,8 @@ +@@ -654,7 +659,7 @@ + + ng = Z_DVAL_PP(gamma); + +- if(cm = imlib_create_color_modifier()){ ++ if ((cm = imlib_create_color_modifier())) { + imlib_context_set_color_modifier(cm); + imlib_context_set_image(im); + imlib_modify_color_modifier_gamma(ng); +@@ -675,8 +680,8 @@ zval **img, **contrast; Imlib_Image im; Imlib_Color_Modifier cm; @@ -31,7 +80,16 @@ if (ZEND_NUM_ARGS() != 2 | zend_get_parameters_ex(2, &img, &contrast) == FAILURE) { WRONG_PARAM_COUNT; -@@ -707,8 +711,8 @@ +@@ -686,7 +691,7 @@ + + nc = Z_DVAL_PP(contrast); + +- if(cm = imlib_create_color_modifier()){ ++ if ((cm = imlib_create_color_modifier())) { + imlib_context_set_color_modifier(cm); + imlib_context_set_image(im); + imlib_modify_color_modifier_contrast(nc); +@@ -707,8 +712,8 @@ zval **img, **bv; Imlib_Image im; Imlib_Color_Modifier cm; @@ -41,7 +99,16 @@ if (ZEND_NUM_ARGS() != 2 | zend_get_parameters_ex(2, &img, &bv) == FAILURE) { WRONG_PARAM_COUNT; -@@ -760,9 +764,9 @@ +@@ -718,7 +723,7 @@ + + nbv = Z_DVAL_PP(bv); + +- if(cm = imlib_create_color_modifier()){ ++ if ((cm = imlib_create_color_modifier())) { + imlib_context_set_color_modifier(cm); + imlib_context_set_image(im); + imlib_modify_color_modifier_brightness(nbv); +@@ -760,9 +765,9 @@ { zval **img, **angle; double rot_angle, rads, pi; @@ -52,3 +119,66 @@ if((ZEND_NUM_ARGS() != 2) || zend_get_parameters_ex(2, &img, &angle) == FAILURE) { WRONG_PARAM_COUNT; +@@ -806,7 +811,7 @@ + tmpfile = estrdup("/tmp/phpimlib.XXXXXX"); + + if ((fd = mkstemp(tmpfile)) < 0) { +- php_error(E_WARNING, "%s: unable to open temporary file", get_active_function_name()); ++ php_error(E_WARNING, "%s: unable to open temporary file", get_active_function_name(TSRMLS_C)); + efree(tmpfile); + RETURN_FALSE; + } +@@ -814,7 +819,7 @@ + /* TODO: notify in case of errors? */ + retval = fchmod(fd, S_IRUSR|S_IWUSR); + if (retval != 0) { +- php_error(E_WARNING, "%s: could not change permissions on temporary file", get_active_function_name()); ++ php_error(E_WARNING, "%s: could not change permissions on temporary file", get_active_function_name(TSRMLS_C)); + close(fd); + efree(tmpfile); + RETURN_FALSE; +@@ -851,7 +856,7 @@ + /* fseek or something, then read the file and dump it out. */ + lseek(fd, 0, SEEK_SET); + +- output = php_header(); ++ output = php_header(TSRMLS_C); + if (output) { + char buf[4096]; + +@@ -861,7 +866,7 @@ + ap_bsetflag(php3_rqst->connection->client, B_EBCDIC2ASCII, 0); + #endif + while ((retval = read(fd, buf, sizeof(buf))) > 0) { +- php_write(buf, retval); ++ php_write(buf, retval TSRMLS_CC); + } + } + +@@ -1254,7 +1259,7 @@ + + if (argc > 7) + { +- if (!_php_handle_cliprect_array(dbox, "imlib_image_draw_polygon", &cx, &cy, &cw, &ch)) ++ if (!_php_handle_cliprect_array(dbox, "imlib_image_draw_polygon", &cx, &cy, &cw, &ch TSRMLS_CC)) + RETURN_FALSE; + imlib_context_set_cliprect(cx,cy,cw,ch); + } +@@ -1303,7 +1308,7 @@ + + if (argc > 7) + { +- if (!_php_handle_cliprect_array(fbox, "imlib_image_fill_color_range_rectangle", &cx,&cy,&cw,&ch)) ++ if (!_php_handle_cliprect_array(fbox, "imlib_image_fill_color_range_rectangle", &cx,&cy,&cw,&ch TSRMLS_CC)) + RETURN_FALSE; + imlib_context_set_cliprect(cx,cy,cw,ch); + } +@@ -1350,7 +1355,7 @@ + + if (argc > 6) + { +- if (!_php_handle_cliprect_array(dbox, "imlib_image_fill_polygon", &cx, &cy, &cw, &ch)) ++ if (!_php_handle_cliprect_array(dbox, "imlib_image_fill_polygon", &cx, &cy, &cw, &ch TSRMLS_CC)) + RETURN_FALSE; + imlib_context_set_cliprect(cx,cy,cw,ch); + } diff --git a/graphics/pecl-imlib2/files/patch-php_imlib b/graphics/pecl-imlib2/files/patch-php_imlib new file mode 100644 index 00000000000..705b7632434 --- /dev/null +++ b/graphics/pecl-imlib2/files/patch-php_imlib @@ -0,0 +1,22 @@ +--- php_imlib2.h 2004-01-01 18:01:13.000000000 -0500 ++++ php_imlib2.h 2015-04-09 13:10:05.000000000 -0400 +@@ -2,5 +2,4 @@ + #define PHP_IMLIB2_H + +-#include "X11/Xlib.h" + #include + +@@ -86,5 +85,5 @@ + int font_cache_max_size; + int font_cache_status; +- char *font_path; ++ const char *font_path; + ZEND_END_MODULE_GLOBALS(imlib2) + +@@ -104,5 +103,5 @@ + #ifdef ZTS + #define IMLIB2_G(v) TSRMG(imlib2_globals_id, zend_imlib2_globals *, v) +-#define IMLIB2_LS_FETCH() imlib2_globals *imlib2_globals = ts_resource(gd_imlib_id) ++#define IMLIB2_LS_FETCH() zend_imlib2_globals *imlib2_globals = ts_resource(imlib2_globals_id) + #else + #define IMLIB2_G(v) (imlib2_globals.v) -- 2.41.0