summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Orlitzky <mjo@gentoo.org>2023-08-21 16:22:53 -0400
committerMichael Orlitzky <mjo@gentoo.org>2023-08-21 16:44:37 -0400
commit620a28b9417440d1e59ca93178063ba54fd2d55d (patch)
tree35d74e3f8e6a618b21bd4c4fe35926847c95e226 /media-libs/gd
parentapp-i18n/mozc: fix build w/ new abseil (diff)
downloadgentoo-620a28b9417440d1e59ca93178063ba54fd2d55d.tar.gz
gentoo-620a28b9417440d1e59ca93178063ba54fd2d55d.tar.bz2
gentoo-620a28b9417440d1e59ca93178063ba54fd2d55d.zip
media-libs/gd: backport GD_BICUBIC fix, update EAPI 7 -> 8
The GD_BICUBIC interpolation methods were accidentally removed upstream. They have since been added back, but not in a release. We backport the upstream patch for the issue because dev-lang/php exposes and tests these methods. Closes: https://bugs.gentoo.org/912772 Signed-off-by: Michael Orlitzky <mjo@gentoo.org>
Diffstat (limited to 'media-libs/gd')
-rw-r--r--media-libs/gd/files/gd-2.3.3-GD_BICUBIC.patch31
-rw-r--r--media-libs/gd/gd-2.3.3-r4.ebuild96
2 files changed, 127 insertions, 0 deletions
diff --git a/media-libs/gd/files/gd-2.3.3-GD_BICUBIC.patch b/media-libs/gd/files/gd-2.3.3-GD_BICUBIC.patch
new file mode 100644
index 000000000000..e89df284df9c
--- /dev/null
+++ b/media-libs/gd/files/gd-2.3.3-GD_BICUBIC.patch
@@ -0,0 +1,31 @@
+From a5f5698a6832fc1f8179a9257f0b91c9a8ef496b Mon Sep 17 00:00:00 2001
+From: Cyprien Nicolas <cyprien@octopuce.fr>
+Date: Thu, 27 Oct 2022 14:36:33 +0200
+Subject: [PATCH] Fix #847: enable back GD_BICUBIC* interpolation methods
+
+(cherry picked from commit 39abd7238cea2ba8baa4bcac1d6fc01c6cb8afab)
+---
+ src/gd_interpolation.c | 5 +++++
+ tests/gdimagesetinterpolationmethod/.gitignore | 1 +
+ tests/gdimagesetinterpolationmethod/CMakeLists.txt | 1 +
+ tests/gdimagesetinterpolationmethod/Makemodule.am | 3 ++-
+ .../gdimagesetinterpolationmethod/github_bug_00847.c | 12 ++++++++++++
+ 5 files changed, 21 insertions(+), 1 deletion(-)
+ create mode 100644 tests/gdimagesetinterpolationmethod/github_bug_00847.c
+
+diff --git a/src/gd_interpolation.c b/src/gd_interpolation.c
+index 1f625dd22..cf77da7c8 100644
+--- a/src/gd_interpolation.c
++++ b/src/gd_interpolation.c
+@@ -2257,6 +2257,11 @@ BGD_DECLARE(int) gdImageSetInterpolationMethod(gdImagePtr im, gdInterpolationMet
+ case GD_BESSEL:
+ im->interpolation = filter_bessel;
+ break;
++ case GD_BICUBIC_FIXED:
++ case GD_BICUBIC:
++ /* no interpolation as gdImageScale calls a dedicated function */
++ im->interpolation = NULL;
++ break;
+ case GD_BLACKMAN:
+ im->interpolation = filter_blackman;
+ break;
diff --git a/media-libs/gd/gd-2.3.3-r4.ebuild b/media-libs/gd/gd-2.3.3-r4.ebuild
new file mode 100644
index 000000000000..e6ad85f655c5
--- /dev/null
+++ b/media-libs/gd/gd-2.3.3-r4.ebuild
@@ -0,0 +1,96 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools flag-o-matic multilib-minimal
+
+DESCRIPTION="Graphics library for fast image creation"
+HOMEPAGE="https://libgd.org/ https://www.boutell.com/gd/"
+SRC_URI="https://github.com/libgd/libgd/releases/download/${P}/lib${P}.tar.xz"
+S="${WORKDIR}/lib${P}"
+
+LICENSE="gd IJG HPND BSD"
+SLOT="2/3"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x64-solaris"
+IUSE="avif cpu_flags_x86_sse fontconfig +jpeg heif +png static-libs test tiff truetype webp xpm zlib"
+RESTRICT="!test? ( test )"
+
+# fontconfig has prefixed font paths, details see bug #518970
+REQUIRED_USE="
+ prefix? ( fontconfig )
+ test? ( png )
+"
+
+BDEPEND="virtual/pkgconfig"
+RDEPEND="
+ avif? ( media-libs/libavif:=[${MULTILIB_USEDEP}] )
+ fontconfig? ( >=media-libs/fontconfig-2.10.92[${MULTILIB_USEDEP}] )
+ jpeg? ( media-libs/libjpeg-turbo[${MULTILIB_USEDEP}] )
+ heif? ( media-libs/libheif:=[${MULTILIB_USEDEP}] )
+ png? ( >=media-libs/libpng-1.6.10:0=[${MULTILIB_USEDEP}] )
+ tiff? ( media-libs/tiff:=[${MULTILIB_USEDEP}] )
+ truetype? ( >=media-libs/freetype-2.5.0.1[${MULTILIB_USEDEP}] )
+ webp? ( media-libs/libwebp:=[${MULTILIB_USEDEP}] )
+ xpm? (
+ >=x11-libs/libXpm-3.5.10-r1[${MULTILIB_USEDEP}]
+ >=x11-libs/libXt-1.1.4[${MULTILIB_USEDEP}]
+ )
+ zlib? ( >=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}] )
+"
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-2.3.0-disable-flaky-tests.patch"
+ "${FILESDIR}/${P}-GD_BICUBIC.patch"
+)
+
+src_prepare() {
+ default
+ eautoreconf
+}
+
+multilib_src_configure() {
+ # bug 603360, https://github.com/libgd/libgd/blob/fd06f7f83c5e78bf5b7f5397746b4e5ee4366250/docs/README.TESTING#L65
+ if use cpu_flags_x86_sse ; then
+ append-cflags -msse -mfpmath=sse
+ else
+ append-cflags -ffloat-store
+ fi
+
+ # bug 632076, https://github.com/libgd/libgd/issues/278
+ if use arm64 || use ppc64 || use s390 ; then
+ append-cflags -ffp-contract=off
+ fi
+
+ # we aren't actually {en,dis}abling X here ... the configure
+ # script uses it just to add explicit -I/-L paths which we
+ # don't care about on Gentoo systems.
+ local myeconfargs=(
+ --disable-werror
+ --without-x
+ --without-liq
+ $(use_enable static-libs static)
+ $(use_with avif)
+ $(use_with fontconfig)
+ $(use_with png)
+ $(use_with tiff)
+ $(use_with truetype freetype)
+ $(use_with heif)
+ $(use_with jpeg)
+ $(use_with webp)
+ $(use_with xpm)
+ $(use_with zlib)
+ )
+ ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
+}
+
+multilib_src_test() {
+ # See https://github.com/libgd/libgd/issues/763 (although it still passed without it here?)
+ TMPDIR="${T}" default
+}
+
+multilib_src_install_all() {
+ dodoc README.md
+ find "${ED}" -name '*.la' -delete || die
+}