summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Levine <plevine457@gmail.com>2018-03-24 23:38:40 -0400
committerJames Le Cuirot <chewi@gentoo.org>2018-03-25 21:14:38 +0100
commit1d002912bd07e18c25b0142774a7ab8b97f7489c (patch)
treee6bfa5f30d1fcf8a5ff0ef3687aaa9c1cdaa04e0 /media-libs/freeimage
parentx11-misc/xwallpaper: new package, modern wallpaper tool (diff)
downloadgentoo-1d002912bd07e18c25b0142774a7ab8b97f7489c.tar.gz
gentoo-1d002912bd07e18c25b0142774a7ab8b97f7489c.tar.bz2
gentoo-1d002912bd07e18c25b0142774a7ab8b97f7489c.zip
media-libs/freeimage: Fix building against =media-libs/jpeg-9*
Bug: https://bugs.gentoo.org/647422 Package-Manager: Portage-2.3.16, Repoman-2.3.6 Closes: https://github.com/gentoo/gentoo/pull/7603
Diffstat (limited to 'media-libs/freeimage')
-rw-r--r--media-libs/freeimage/files/freeimage-3.15.4-libjpeg9.patch45
-rw-r--r--media-libs/freeimage/freeimage-3.15.4-r1.ebuild3
2 files changed, 47 insertions, 1 deletions
diff --git a/media-libs/freeimage/files/freeimage-3.15.4-libjpeg9.patch b/media-libs/freeimage/files/freeimage-3.15.4-libjpeg9.patch
new file mode 100644
index 00000000000..24eb9e010fc
--- /dev/null
+++ b/media-libs/freeimage/files/freeimage-3.15.4-libjpeg9.patch
@@ -0,0 +1,45 @@
+Bug: https://bugs.gentoo.org/647422
+Upstream Patch: https://sourceforge.net/p/freeimage/patches/130/
+
+diff -Naur a/Source/FreeImage/PluginJPEG.cpp b/Source/FreeImage/PluginJPEG.cpp
+--- a/Source/FreeImage/PluginJPEG.cpp 2018-03-24 23:24:11.062695375 -0400
++++ b/Source/FreeImage/PluginJPEG.cpp 2018-03-24 23:25:39.451124161 -0400
+@@ -1586,14 +1586,14 @@
+
+ // thumbnail support (JFIF 1.02 extension markers)
+ if(FreeImage_GetThumbnail(dib) != NULL) {
+- cinfo.write_JFIF_header = 1; //<### force it, though when color is CMYK it will be incorrect
++ cinfo.write_JFIF_header = static_cast<boolean>(1); //<### force it, though when color is CMYK it will be incorrect
+ cinfo.JFIF_minor_version = 2;
+ }
+
+ // baseline JPEG support
+ if ((flags & JPEG_BASELINE) == JPEG_BASELINE) {
+- cinfo.write_JFIF_header = 0; // No marker for non-JFIF colorspaces
+- cinfo.write_Adobe_marker = 0; // write no Adobe marker by default
++ cinfo.write_JFIF_header = static_cast<boolean>(0); // No marker for non-JFIF colorspaces
++ cinfo.write_Adobe_marker = static_cast<boolean>(0); // write no Adobe marker by default
+ }
+
+ // set subsampling options if required
+diff -Naur a/Source/FreeImage.h b/Source/FreeImage.h
+--- a/Source/FreeImage.h 2018-03-24 23:24:11.066695395 -0400
++++ b/Source/FreeImage.h 2018-03-24 23:26:35.945391182 -0400
+@@ -117,12 +117,17 @@
+ #ifndef _WINDOWS_
+ #define _WINDOWS_
+
++#if JPEG_LIB_VERSION < 90
++
+ #ifndef FALSE
+ #define FALSE 0
+ #endif
+ #ifndef TRUE
+ #define TRUE 1
+ #endif
++
++#endif
++
+ #ifndef NULL
+ #define NULL 0
+ #endif
diff --git a/media-libs/freeimage/freeimage-3.15.4-r1.ebuild b/media-libs/freeimage/freeimage-3.15.4-r1.ebuild
index 666fba9ba67..d40deb29685 100644
--- a/media-libs/freeimage/freeimage-3.15.4-r1.ebuild
+++ b/media-libs/freeimage/freeimage-3.15.4-r1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=6
@@ -45,6 +45,7 @@ PATCHES=(
"${FILESDIR}"/${PN}-3.15.4-CVE-2016-5684-1.patch
"${FILESDIR}"/${PN}-3.15.4-CVE-2016-5684-2.patch
"${FILESDIR}"/${PN}-3.15.4-CVE-2015-0852.patch
+ "${FILESDIR}"/${PN}-3.15.4-libjpeg9.patch
)
src_prepare() {