media-gfx/geeqie: Fix build with exiv2-0.27
authorAndreas Sturmlechner <asturm@gentoo.org>
Wed, 9 Jan 2019 21:22:04 +0000 (22:22 +0100)
committerAndreas Sturmlechner <asturm@gentoo.org>
Thu, 10 Jan 2019 21:54:09 +0000 (22:54 +0100)
Patch is already upstream, see also:
https://github.com/BestImageViewer/geeqie/issues/654

Closes: https://bugs.gentoo.org/674044
Package-Manager: Portage-2.3.54, Repoman-2.3.12
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
media-gfx/geeqie/files/geeqie-1.4-exiv2-0.27.patch [new file with mode: 0644]
media-gfx/geeqie/geeqie-1.4-r1.ebuild

diff --git a/media-gfx/geeqie/files/geeqie-1.4-exiv2-0.27.patch b/media-gfx/geeqie/files/geeqie-1.4-exiv2-0.27.patch
new file mode 100644 (file)
index 0000000..b9a3bde
--- /dev/null
@@ -0,0 +1,80 @@
+From 13859e2ec3a1afc74f109cfffdf0de39030cde86 Mon Sep 17 00:00:00 2001
+From: Rasmus Thomsen <rasmus.thomsen@protonmail.com>
+Date: Wed, 2 Jan 2019 01:04:45 +0100
+Subject: [PATCH] fix build against exiv2-0.27.x
+
+fixes #654
+---
+ src/exiv2.cc | 16 +++++++++++++---
+ 1 file changed, 13 insertions(+), 3 deletions(-)
+
+diff --git a/src/exiv2.cc b/src/exiv2.cc
+index b3c80657..f40b725e 100644
+--- a/src/exiv2.cc
++++ b/src/exiv2.cc
+@@ -22,17 +22,27 @@
+ #ifdef HAVE_EXIV2
++// Don't include the <exiv2/version.hpp> file directly
++// Early Exiv2 versions didn't have version.hpp and the macros.
++#include <exiv2/exiv2.hpp>
+ #include <exiv2/image.hpp>
+ #include <exiv2/exif.hpp>
+ #include <iostream>
+ #include <string>
+ // EXIV2_TEST_VERSION is defined in Exiv2 0.15 and newer.
++#ifdef EXIV2_VERSION
+ #ifndef EXIV2_TEST_VERSION
+-# define EXIV2_TEST_VERSION(major,minor,patch) \
++#define EXIV2_TEST_VERSION(major,minor,patch) \
+       ( EXIV2_VERSION >= EXIV2_MAKE_VERSION(major,minor,patch) )
+ #endif
++#else
++#define EXIV2_TEST_VERSION(major,minor,patch) (false)
++#endif
++#if EXIV2_TEST_VERSION(0,27,0)
++#define HAVE_EXIV2_ERROR_CODE
++#endif
+ #include <sys/types.h>
+ #include <sys/stat.h>
+@@ -40,6 +50,10 @@
+ #include <fcntl.h>
+ #include <sys/mman.h>
++#if EXIV2_TEST_VERSION(0,27,0)
++#define EXV_PACKAGE "exiv2"
++#endif
++
+ #if !EXIV2_TEST_VERSION(0,17,90)
+ #include <exiv2/tiffparser.hpp>
+ #include <exiv2/tiffcomposite.hpp>
+@@ -374,7 +388,11 @@
+ #endif
+                       Exiv2::Image *image = imageData_->image();
+-                      if (!image) Exiv2::Error(21);
++#ifdef HAVE_EXIV2_ERROR_CODE
++                      if (!image) throw Exiv2::Error(Exiv2::ErrorCode::kerInputDataReadFailed);
++#else
++                      if (!image) throw Exiv2::Error(21);
++#endif
+                       image->setExifData(exifData_);
+                       image->setIptcData(iptcData_);
+ #if EXIV2_TEST_VERSION(0,16,0)
+@@ -394,8 +412,12 @@
+                       sidecar->setXmpData(xmpData_);
+                       sidecar->writeMetadata();
+ #else
++#ifdef HAVE_EXIV2_ERROR_CODE
++                      throw Exiv2::Error(Exiv2::ErrorCode::kerNotAnImage, "xmp");
++#else
+                       throw Exiv2::Error(3, "xmp");
+ #endif
++#endif
+                       }
+       }
index 3080dded12b056efe060c2358bc98b6daa927055..a503145669bbd6590b96f79ec7a3b5ebaa68e776 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Authors
+# Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=6
@@ -35,6 +35,8 @@ DEPEND="${RDEPEND}
 REQUIRED_USE="gpu-accel? ( gtk3 )
        map? ( gpu-accel )"
 
+PATCHES=( "${FILESDIR}/${P}-exiv2-0.27.patch" ) # bug 674044
+
 src_prepare() {
        default