From e86f4e7d3acf46c25c5cc24b969976f125b325a7 Mon Sep 17 00:00:00 2001 From: Funda Wang Date: Sun, 13 Nov 2022 18:36:35 +0800 Subject: [PATCH] fix build with php --- gd.spec | 6 +++++- libgd-flip.patch | 50 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 libgd-flip.patch diff --git a/gd.spec b/gd.spec index 97c46ee..e9a9838 100644 --- a/gd.spec +++ b/gd.spec @@ -1,6 +1,6 @@ Name: gd Version: 2.3.3 -Release: 1 +Release: 2 Summary: A graphics library for quick creation of PNG or JPEG images License: MIT URL: http://libgd.github.io/ @@ -8,6 +8,7 @@ Source0: https://github.com/libgd/libgd/releases/download/gd-%{version}/l # Missing, temporary workaround, fixed upstream for next version Source1: https://raw.githubusercontent.com/libgd/libgd/gd-%{version}/config/getlib.sh +Patch0: libgd-flip.patch BuildRequires: freetype-devel fontconfig-devel gettext-devel libjpeg-devel libpng-devel libtiff-devel libwebp-devel BuildRequires: libX11-devel libXpm-devel zlib-devel pkgconfig libtool perl-interpreter perl-generators liberation-sans-fonts @@ -107,6 +108,9 @@ grep %{version} $RPM_BUILD_ROOT%{_libdir}/pkgconfig/gdlib.pc %exclude %{_libdir}/libgd.a %changelog +* Sun Nov 13 2022 Funda Wang - 2.3.3-2 +- Add patch from fedora to fix build with PHP + * Sat Oct 29 2022 zhouwenpei - 2.3.3-1 - update to 2.3.3 diff --git a/libgd-flip.patch b/libgd-flip.patch new file mode 100644 index 0000000..4fa964f --- /dev/null +++ b/libgd-flip.patch @@ -0,0 +1,50 @@ +From f4bc1f5c26925548662946ed7cfa473c190a104a Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Mon, 13 Sep 2021 14:57:52 +0200 +Subject: [PATCH 1/2] Revert "Fix #318, these macros are not used as planed, we + have separate functions for each" + +This reverts commit bdc281eadb1d58d5c0c7bbc1125ee4674256df08. +--- + src/gd.h | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/src/gd.h b/src/gd.h +index 30560395..1ad9e637 100644 +--- a/src/gd.h ++++ b/src/gd.h +@@ -1604,6 +1604,11 @@ BGD_DECLARE(void) gdImageFlipHorizontal(gdImagePtr im); + BGD_DECLARE(void) gdImageFlipVertical(gdImagePtr im); + BGD_DECLARE(void) gdImageFlipBoth(gdImagePtr im); + ++#define GD_FLIP_HORINZONTAL 1 /* typo, kept for BC */ ++#define GD_FLIP_HORIZONTAL 1 ++#define GD_FLIP_VERTICAL 2 ++#define GD_FLIP_BOTH 3 ++ + /** + * Group: Crop + * + +From e47c619d792455aad23708d2ec2947455394427e Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Mon, 13 Sep 2021 14:59:47 +0200 +Subject: [PATCH 2/2] add comment to not remove these macros + +--- + src/gd.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/gd.h b/src/gd.h +index 1ad9e637..71f5a89c 100644 +--- a/src/gd.h ++++ b/src/gd.h +@@ -1604,6 +1604,8 @@ BGD_DECLARE(void) gdImageFlipHorizontal(gdImagePtr im); + BGD_DECLARE(void) gdImageFlipVertical(gdImagePtr im); + BGD_DECLARE(void) gdImageFlipBoth(gdImagePtr im); + ++/* Macros still used in gd extension up to PHP 8.0 ++ so please keep these unused macros for now */ + #define GD_FLIP_HORINZONTAL 1 /* typo, kept for BC */ + #define GD_FLIP_HORIZONTAL 1 + #define GD_FLIP_VERTICAL 2