diff options
Diffstat (limited to 'graphics/php73-gd')
-rw-r--r-- | graphics/php73-gd/Makefile | 13 | ||||
-rw-r--r-- | graphics/php73-gd/files/patch-config.m4 | 28 | ||||
-rw-r--r-- | graphics/php73-gd/files/patch-gd.c | 83 |
3 files changed, 124 insertions, 0 deletions
diff --git a/graphics/php73-gd/Makefile b/graphics/php73-gd/Makefile new file mode 100644 index 000000000000..d9fd4a74d2e5 --- /dev/null +++ b/graphics/php73-gd/Makefile @@ -0,0 +1,13 @@ +# $FreeBSD$ + +CATEGORIES= graphics + +MASTERDIR= ${.CURDIR}/../../lang/php73 + +PKGNAMESUFFIX= -gd + +TEST_TARGET= test + +.include "${MASTERDIR}/Makefile" + +LIB_DEPENDS+= libgd.so:graphics/gd diff --git a/graphics/php73-gd/files/patch-config.m4 b/graphics/php73-gd/files/patch-config.m4 new file mode 100644 index 000000000000..0d1cbd47e4a9 --- /dev/null +++ b/graphics/php73-gd/files/patch-config.m4 @@ -0,0 +1,28 @@ +--- config.m4.orig 2018-09-25 09:07:58 UTC ++++ config.m4 +@@ -285,6 +285,7 @@ dnl enable the support in bundled GD lib + + if test -n "$GD_XPM_DIR"; then + AC_DEFINE(HAVE_GD_XPM, 1, [ ]) ++ AC_DEFINE(HAVE_XPM, 1, [ ]) + GDLIB_CFLAGS="$GDLIB_CFLAGS -DHAVE_XPM" + fi + +@@ -347,7 +348,7 @@ if test "$PHP_GD" != "no"; then + + if test "$GD_MODULE_TYPE" = "builtin"; then + PHP_ADD_BUILD_DIR($ext_builddir/libgd) +- GDLIB_CFLAGS="-I$ext_srcdir/libgd $GDLIB_CFLAGS" ++ GDLIB_CFLAGS="-I../.. -I$ext_srcdir/libgd $GDLIB_CFLAGS" + GD_HEADER_DIRS="ext/gd/ ext/gd/libgd/" + + PHP_TEST_BUILD(foobar, [], [ +@@ -355,7 +356,7 @@ if test "$PHP_GD" != "no"; then + ], [ $GD_SHARED_LIBADD ], [char foobar () {}]) + else + GD_HEADER_DIRS="ext/gd/" +- GDLIB_CFLAGS="-I$GD_INCLUDE $GDLIB_CFLAGS" ++ GDLIB_CFLAGS="-I../.. -I$ext_srcdir/libgd $GDLIB_CFLAGS" + PHP_ADD_INCLUDE($GD_INCLUDE) + PHP_CHECK_LIBRARY(gd, gdImageCreate, [], [ + AC_MSG_ERROR([GD build test failed. Please check the config.log for details.]) diff --git a/graphics/php73-gd/files/patch-gd.c b/graphics/php73-gd/files/patch-gd.c new file mode 100644 index 000000000000..0c9302041d2a --- /dev/null +++ b/graphics/php73-gd/files/patch-gd.c @@ -0,0 +1,83 @@ +--- gd.c.orig 2018-09-25 09:07:58 UTC ++++ gd.c +@@ -51,7 +51,7 @@ + # include <Wingdi.h> + #endif + +-#ifdef HAVE_GD_XPM ++#if defined(HAVE_XPM) && defined(HAVE_GD_XPM) + # include <X11/xpm.h> + #endif + +@@ -75,7 +75,7 @@ static int le_gd, le_gd_font; + # endif + #endif + +-#if defined(HAVE_GD_XPM) && defined(HAVE_GD_BUNDLED) ++#if defined(HAVE_XPM) && defined(HAVE_GD_XPM) && defined(HAVE_GD_BUNDLED) + # include "X11/xpm.h" + #endif + +@@ -322,7 +322,7 @@ ZEND_BEGIN_ARG_INFO(arginfo_imagecreatef + ZEND_ARG_INFO(0, filename) + ZEND_END_ARG_INFO() + +-#if defined(HAVE_GD_XPM) ++#if defined(HAVE_XPM) && defined(HAVE_GD_XPM) + ZEND_BEGIN_ARG_INFO(arginfo_imagecreatefromxpm, 0) + ZEND_ARG_INFO(0, filename) + ZEND_END_ARG_INFO() +@@ -931,7 +931,7 @@ static const zend_function_entry gd_func + #endif + PHP_FE(imagecreatefromwbmp, arginfo_imagecreatefromwbmp) + PHP_FE(imagecreatefromxbm, arginfo_imagecreatefromxbm) +-#if defined(HAVE_GD_XPM) ++#if defined(HAVE_XPM) && defined(HAVE_GD_XPM) + PHP_FE(imagecreatefromxpm, arginfo_imagecreatefromxpm) + #endif + PHP_FE(imagecreatefromgd, arginfo_imagecreatefromgd) +@@ -1296,7 +1296,7 @@ PHP_MINFO_FUNCTION(gd) + php_info_print_table_row(2, "libPNG Version", gdPngGetVersionString()); + #endif + php_info_print_table_row(2, "WBMP Support", "enabled"); +-#if defined(HAVE_GD_XPM) ++#if defined(HAVE_XPM) && defined(HAVE_GD_XPM) + php_info_print_table_row(2, "XPM Support", "enabled"); + { + char tmp[12]; +@@ -1351,7 +1351,7 @@ PHP_FUNCTION(gd_info) + add_assoc_bool(return_value, "PNG Support", 0); + #endif + add_assoc_bool(return_value, "WBMP Support", 1); +-#if defined(HAVE_GD_XPM) ++#if defined(HAVE_XPM) && defined(HAVE_GD_XPM) + add_assoc_bool(return_value, "XPM Support", 1); + #else + add_assoc_bool(return_value, "XPM Support", 0); +@@ -2178,7 +2178,7 @@ PHP_FUNCTION(imagetypes) + ret |= PHP_IMG_PNG; + #endif + ret |= PHP_IMG_WBMP; +-#if defined(HAVE_GD_XPM) ++#if defined(HAVE_XPM) && defined(HAVE_GD_XPM) + ret |= PHP_IMG_XPM; + #endif + #ifdef HAVE_GD_WEBP +@@ -2446,7 +2446,7 @@ static void _php_image_create_from(INTER + case PHP_GDIMG_TYPE_GD2PART: + im = (*func_p)(fp, srcx, srcy, width, height); + break; +-#if defined(HAVE_GD_XPM) ++#if defined(HAVE_XPM) && defined(HAVE_GD_XPM) + case PHP_GDIMG_TYPE_XPM: + im = gdImageCreateFromXpm(file); + break; +@@ -2528,7 +2528,7 @@ PHP_FUNCTION(imagecreatefromxbm) + } + /* }}} */ + +-#if defined(HAVE_GD_XPM) ++#if defined(HAVE_XPM) && defined(HAVE_GD_XPM) + /* {{{ proto resource imagecreatefromxpm(string filename) + Create a new image from XPM file or URL */ + PHP_FUNCTION(imagecreatefromxpm) |