Commit af946310 authored by Widya Walesa's avatar Widya Walesa
Browse files

Patch to fix building using gd 2.3.3.


Signed-off-by: Widya Walesa's avatarWidya Walesa <walecha99@gmail.com>
parent f914c7a5
--- a/ext/gd/gd.c 2021-08-24 23:33:32.000000000 +0700
+++ b/ext/gd/gd.c 2021-09-19 12:06:28.850375327 +0700
@@ -91,6 +91,11 @@
#define M_PI 3.14159265358979323846
#endif
+/* don't used libgd constants, not used, so going to be removed */
+#define PHP_GD_FLIP_HORIZONTAL 1
+#define PHP_GD_FLIP_VERTICAL 2
+#define PHP_GD_FLIP_BOTH 3
+
#ifdef HAVE_GD_FREETYPE
static void php_imagettftext_common(INTERNAL_FUNCTION_PARAMETERS, int, int);
#endif
@@ -1137,9 +1142,9 @@
/* GD2 image format types */
REGISTER_LONG_CONSTANT("IMG_GD2_RAW", GD2_FMT_RAW, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("IMG_GD2_COMPRESSED", GD2_FMT_COMPRESSED, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("IMG_FLIP_HORIZONTAL", GD_FLIP_HORINZONTAL, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("IMG_FLIP_VERTICAL", GD_FLIP_VERTICAL, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("IMG_FLIP_BOTH", GD_FLIP_BOTH, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("IMG_FLIP_HORIZONTAL", PHP_GD_FLIP_HORIZONTAL, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("IMG_FLIP_VERTICAL", PHP_GD_FLIP_VERTICAL, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("IMG_FLIP_BOTH", PHP_GD_FLIP_BOTH, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("IMG_EFFECT_REPLACE", gdEffectReplace, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("IMG_EFFECT_ALPHABLEND", gdEffectAlphaBlend, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("IMG_EFFECT_NORMAL", gdEffectNormal, CONST_CS | CONST_PERSISTENT);
@@ -4696,20 +4701,20 @@
}
switch (mode) {
- case GD_FLIP_VERTICAL:
+ case PHP_GD_FLIP_VERTICAL:
gdImageFlipVertical(im);
break;
- case GD_FLIP_HORINZONTAL:
+ case PHP_GD_FLIP_HORIZONTAL:
gdImageFlipHorizontal(im);
break;
- case GD_FLIP_BOTH:
+ case PHP_GD_FLIP_BOTH:
gdImageFlipBoth(im);
break;
default:
- php_error_docref(NULL, E_WARNING, "Unknown flip mode");
+ php_error_docref(NULL, E_WARNING, "must be one of IMG_FLIP_VERTICAL, IMG_FLIP_HORIZONTAL, or IMG_FLIP_BOTH");
RETURN_FALSE;
}
......@@ -164,6 +164,9 @@ cat $CWD/php.enchant-2.patch | patch -p1 --verbose || exit 1
export ENCHANT_CFLAGS="-I/usr/include/enchant-2"
export ENCHANT_LIBS="-lenchant-2"
# Build error with gd 2.3.3 because of typo of constant name in libgd 2.3.0.
cat $CWD/php-7.4.23-Dont-rely-on-libgd-unused-constants.patch | patch -p1 --verbose || exit 1
# Install the build folder into /usr/lib$LIBDIRSUFFIX/php/build
# and adapt phpize accordingly:
sed -i "s|build$|php/build|" scripts/Makefile.frag
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment