media-libs/libmng: Adapt jpeg-9a.patch for 2.0.3
authorAndreas Sturmlechner <asturm@gentoo.org>
Thu, 6 Sep 2018 21:03:46 +0000 (23:03 +0200)
committerAndreas Sturmlechner <asturm@gentoo.org>
Thu, 6 Sep 2018 21:05:59 +0000 (23:05 +0200)
Bug: https://bugs.gentoo.org/578744
Package-Manager: Portage-2.3.49, Repoman-2.3.10

media-libs/libmng/files/libmng-2.0.3-jpeg-9a.patch [new file with mode: 0644]
media-libs/libmng/libmng-2.0.3.ebuild

diff --git a/media-libs/libmng/files/libmng-2.0.3-jpeg-9a.patch b/media-libs/libmng/files/libmng-2.0.3-jpeg-9a.patch
new file mode 100644 (file)
index 0000000..9441f00
--- /dev/null
@@ -0,0 +1,40 @@
+http://bugs.gentoo.org/520906
+
+This kludge is unnecessary with jpeg-9a and is in fact breaking the build...
+
+libmng_jpeg.c:108:10: error: 'FALSE' undeclared (first use in this function)
+libmng_jpeg.c:536:48: error: 'TRUE' undeclared (first use in this function)
+libmng_jpeg_c:890:49: error: 'TRUE' undeclared (first use in this function)
+
+...because jmorecfg.h of jpeg-9a has this:
+
+#ifndef HAVE_BOOLEAN
+#if defined FALSE || defined TRUE || defined QGLOBAL_H
+/* Qt3 defines FALSE and TRUE as "const" variables in qglobal.h */
+typedef int boolean;
+#ifndef FALSE                   /* in case these macros already exist */
+#define FALSE   0               /* values of boolean */
+#endif
+#ifndef TRUE
+#define TRUE    1
+#endif
+#else
+typedef enum { FALSE = 0, TRUE = 1 } boolean;
+#endif
+#endif
+
+2018-09-06: Adjusted for libmng-2.0.3
+https://bugs.gentoo.org/578744
+
+--- a/libmng_types.h   2015-04-20 21:17:32.000000000 +0200
++++ b/libmng_types.h   2018-09-06 22:56:57.153190623 +0200
+@@ -201,9 +201,6 @@
+ #endif
+ #define JPEG_INTERNAL_OPTIONS          /* for RGB_PIXELSIZE */
+ /* There has been a change in jpeg-9 : */
+-#if !defined(HAVE_BOOLEAN) && !defined(_WIN32)
+-#define HAVE_BOOLEAN
+-#endif
+ #ifndef _WIN32
+ typedef int boolean;
+ #endif
index 6e68deaa68db7bf97d7f5ec6b9f3e5a7182d4fea..02e62532f37d597bcef6d0727570287a1e858c50 100644 (file)
@@ -20,6 +20,8 @@ RDEPEND="
        lcms? ( >=media-libs/lcms-2.5:2[static-libs?,${MULTILIB_USEDEP}] )"
 DEPEND="${RDEPEND}"
 
+PATCHES=( "${FILESDIR}"/${P}-jpeg-9a.patch )
+
 src_prepare() {
        emake distclean
        default