commit:     d18335caa756f5e5c1478d5fe3ba17f011a78c80
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Thu Jun  8 19:22:39 2023 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Thu Jun  8 19:38:07 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d18335ca

media-gfx/hugin: Fix build with >=exiv2-0.28

Closes: https://bugs.gentoo.org/906468
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 .../hugin/files/hugin-2022.0.0-exiv2-0.28.patch    | 99 ++++++++++++++++++++++
 .../files/hugin-2022.0.0-exiv2-0.28.patch.orig     | 76 +++++++++++++++++
 media-gfx/hugin/hugin-2022.0.0.ebuild              |  2 +
 3 files changed, 177 insertions(+)

diff --git a/media-gfx/hugin/files/hugin-2022.0.0-exiv2-0.28.patch 
b/media-gfx/hugin/files/hugin-2022.0.0-exiv2-0.28.patch
new file mode 100644
index 000000000000..dff74132b48f
--- /dev/null
+++ b/media-gfx/hugin/files/hugin-2022.0.0-exiv2-0.28.patch
@@ -0,0 +1,99 @@
+Patch originally taken from ArchLinux, modified to be backwards compatible.
+
+diff -r 79cd11a7a66f src/hugin_base/panodata/Exiv2Helper.cpp
+--- a/src/hugin_base/panodata/Exiv2Helper.cpp  Wed May 24 19:13:20 2023 +0200
++++ b/src/hugin_base/panodata/Exiv2Helper.cpp  Mon Jun 05 00:31:19 2023 +0200
+@@ -40,7 +40,11 @@
+             Exiv2::ExifData::iterator itr = 
exifData.findKey(Exiv2::ExifKey(keyName));
+             if (itr != exifData.end() && itr->count())
+             {
++#if EXIV2_TEST_VERSION(0,28,0)
++                value = itr->toUint32();
++#else
+                 value = itr->toLong();
++#endif
+                 return true;
+             }
+             else
+@@ -165,7 +169,11 @@
+         {
+             if(it!=exifData.end() && it->count())
+             {
++#if EXIV2_TEST_VERSION(0,28,0)
++                return it->toUint32();
++#else
+                 return it->toLong();
++#endif
+             }
+             return 0;
+         };
+@@ -600,4 +608,4 @@
+         };
+ 
+     }; //namespace Exiv2Helper
+-}; //namespace HuginBase
+\ No newline at end of file
++}; //namespace HuginBase
+diff -r 79cd11a7a66f src/hugin_base/panodata/SrcPanoImage.cpp
+--- a/src/hugin_base/panodata/SrcPanoImage.cpp Wed May 24 19:13:20 2023 +0200
++++ b/src/hugin_base/panodata/SrcPanoImage.cpp Mon Jun 05 00:31:19 2023 +0200
+@@ -384,7 +384,11 @@
+                     pos = 
xmpData.findKey(Exiv2::XmpKey("Xmp.GPano.CroppedAreaImageWidthPixels"));
+                     if (pos != xmpData.end())
+                     {
++#if EXIV2_TEST_VERSION(0,28,0)
++                        croppedWidth = pos->toUint32();
++#else
+                         croppedWidth = pos->toLong();
++#endif
+                     }
+                     else
+                     {
+@@ -394,7 +398,11 @@
+                     pos = 
xmpData.findKey(Exiv2::XmpKey("Xmp.GPano.CroppedAreaImageHeightPixels"));
+                     if (pos != xmpData.end())
+                     {
++#if EXIV2_TEST_VERSION(0,28,0)
++                        croppedHeight = pos->toUint32();
++#else
+                         croppedHeight = pos->toLong();
++#endif
+                     }
+                     else
+                     {
+@@ -408,7 +416,11 @@
+                         double hfov = 0;
+                         if (pos != xmpData.end())
+                         {
++#if EXIV2_TEST_VERSION(0,28,0)
++                            hfov = 360 * croppedWidth / 
(double)pos->toUint32();
++#else
+                             hfov = 360 * croppedWidth / (double)pos->toLong();
++#endif
+                         }
+                         else
+                         {
+@@ -419,7 +431,11 @@
+                         pos = 
xmpData.findKey(Exiv2::XmpKey("Xmp.GPano.FullPanoHeightPixels"));
+                         if (pos != xmpData.end())
+                         {
++#if EXIV2_TEST_VERSION(0,28,0)
++                            fullHeight = pos->toUint32();
++#else
+                             fullHeight = pos->toLong();
++#endif
+                         }
+                         else
+                         {
+@@ -430,7 +446,11 @@
+                         pos = 
xmpData.findKey(Exiv2::XmpKey("Xmp.GPano.CroppedAreaTopPixels"));
+                         if (pos != xmpData.end())
+                         {
++#if EXIV2_TEST_VERSION(0,28,0)
++                            cropTop = pos->toUint32();
++#else
+                             cropTop = pos->toLong();
++#endif
+                         }
+                         else
+                         {

diff --git a/media-gfx/hugin/files/hugin-2022.0.0-exiv2-0.28.patch.orig 
b/media-gfx/hugin/files/hugin-2022.0.0-exiv2-0.28.patch.orig
new file mode 100644
index 000000000000..b1653a312cab
--- /dev/null
+++ b/media-gfx/hugin/files/hugin-2022.0.0-exiv2-0.28.patch.orig
@@ -0,0 +1,76 @@
+diff -r 79cd11a7a66f src/hugin_base/panodata/Exiv2Helper.cpp
+--- a/src/hugin_base/panodata/Exiv2Helper.cpp  Wed May 24 19:13:20 2023 +0200
++++ b/src/hugin_base/panodata/Exiv2Helper.cpp  Mon Jun 05 00:31:19 2023 +0200
+@@ -40,7 +40,7 @@
+             Exiv2::ExifData::iterator itr = 
exifData.findKey(Exiv2::ExifKey(keyName));
+             if (itr != exifData.end() && itr->count())
+             {
+-                value = itr->toLong();
++                value = itr->toUint32();
+                 return true;
+             }
+             else
+@@ -165,7 +165,7 @@
+         {
+             if(it!=exifData.end() && it->count())
+             {
+-                return it->toLong();
++                return it->toUint32();
+             }
+             return 0;
+         };
+@@ -600,4 +600,4 @@
+         };
+ 
+     }; //namespace Exiv2Helper
+-}; //namespace HuginBase
+\ No newline at end of file
++}; //namespace HuginBase
+diff -r 79cd11a7a66f src/hugin_base/panodata/SrcPanoImage.cpp
+--- a/src/hugin_base/panodata/SrcPanoImage.cpp Wed May 24 19:13:20 2023 +0200
++++ b/src/hugin_base/panodata/SrcPanoImage.cpp Mon Jun 05 00:31:19 2023 +0200
+@@ -384,7 +384,7 @@
+                     pos = 
xmpData.findKey(Exiv2::XmpKey("Xmp.GPano.CroppedAreaImageWidthPixels"));
+                     if (pos != xmpData.end())
+                     {
+-                        croppedWidth = pos->toLong();
++                        croppedWidth = pos->toUint32();
+                     }
+                     else
+                     {
+@@ -394,7 +394,7 @@
+                     pos = 
xmpData.findKey(Exiv2::XmpKey("Xmp.GPano.CroppedAreaImageHeightPixels"));
+                     if (pos != xmpData.end())
+                     {
+-                        croppedHeight = pos->toLong();
++                        croppedHeight = pos->toUint32();
+                     }
+                     else
+                     {
+@@ -408,7 +408,7 @@
+                         double hfov = 0;
+                         if (pos != xmpData.end())
+                         {
+-                            hfov = 360 * croppedWidth / (double)pos->toLong();
++                            hfov = 360 * croppedWidth / 
(double)pos->toUint32();
+                         }
+                         else
+                         {
+@@ -419,7 +419,7 @@
+                         pos = 
xmpData.findKey(Exiv2::XmpKey("Xmp.GPano.FullPanoHeightPixels"));
+                         if (pos != xmpData.end())
+                         {
+-                            fullHeight = pos->toLong();
++                            fullHeight = pos->toUint32();
+                         }
+                         else
+                         {
+@@ -430,7 +430,7 @@
+                         pos = 
xmpData.findKey(Exiv2::XmpKey("Xmp.GPano.CroppedAreaTopPixels"));
+                         if (pos != xmpData.end())
+                         {
+-                            cropTop = pos->toLong();
++                            cropTop = pos->toUint32();
+                         }
+                         else
+                         {

diff --git a/media-gfx/hugin/hugin-2022.0.0.ebuild 
b/media-gfx/hugin/hugin-2022.0.0.ebuild
index eb099f3d2f2e..3c0dd61f7e87 100644
--- a/media-gfx/hugin/hugin-2022.0.0.ebuild
+++ b/media-gfx/hugin/hugin-2022.0.0.ebuild
@@ -57,6 +57,8 @@ DOCS=( authors.txt README TODO )
 
 S=${WORKDIR}/${PN}-$(ver_cut 1-2).0
 
+PATCHES=( "${FILESDIR}/${P}-exiv2-0.28.patch" ) # bug 906468
+
 pkg_setup() {
        use python && python-single-r1_pkg_setup
        setup-wxwidgets

Reply via email to