changeset 6072:9cfc0cda57e9

exiv2: update to v0.27.5 * src/exiv2.mk: update for new version, use cmake * src/exiv2-r2796.patch, src/exiv2-issue847.patch: removed * dist-files.mk: removed ref to removed files
author John Donoghue <john.donoghue@ieee.org>
date Thu, 03 Feb 2022 12:28:36 -0500
parents c319371801a1
children d067e6d2239e
files dist-files.mk src/exiv2-issue847.patch src/exiv2-r2796.patch src/exiv2.mk
diffstat 4 files changed, 19 insertions(+), 375 deletions(-) [+]
line wrap: on
line diff
--- a/dist-files.mk	Sat Jan 29 10:31:18 2022 -0500
+++ b/dist-files.mk	Thu Feb 03 12:28:36 2022 -0500
@@ -84,8 +84,6 @@
   dri2proto.mk \
   eigen.mk \
   epstool.mk \
-  exiv2-issue847.patch \
-  exiv2-r2796.patch \
   exiv2.mk \
   expat.mk \
   faad2-1-fixes.patch \
--- a/src/exiv2-issue847.patch	Sat Jan 29 10:31:18 2022 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,268 +0,0 @@
-This file is part of MXE.
-See index.html for further information.
-
-These patches have been taken from:
-http://dev.exiv2.org/issues/847
-
-From ffb5b66c5b1aeb77c1f95ef69a573030c6370e0c Mon Sep 17 00:00:00 2001
-From: vog <vog@b7c8b350-86e7-0310-a4b4-de8f6a8f16a3>
-Date: Fri, 14 Sep 2012 16:06:23 +0000
-Subject: [PATCH 1/4] Issue #847: Add recognition of explicit and implicit
- BeginPageSetup
-
-git-svn-id: svn://dev.exiv2.org/svn/trunk@2869 b7c8b350-86e7-0310-a4b4-de8f6a8f16a3
----
- src/epsimage.cpp |   28 ++++++++++++++++++++++------
- 1 file changed, 22 insertions(+), 6 deletions(-)
-
-diff --git a/src/epsimage.cpp b/src/epsimage.cpp
-index c937942..51e5bb4 100644
---- a/src/epsimage.cpp
-+++ b/src/epsimage.cpp
-@@ -386,6 +386,7 @@ namespace {
-         size_t posBeginPhotoshop = posEndEps;
-         size_t posEndPhotoshop = posEndEps;
-         size_t posPage = posEndEps;
-+        size_t posBeginPageSetup = posEndEps;
-         size_t posEndPageSetup = posEndEps;
-         size_t posPageTrailer = posEndEps;
-         size_t posEof = posEndEps;
-@@ -397,7 +398,6 @@ namespace {
-         bool implicitPage = false;
-         bool implicitPageTrailer = false;
-         bool inDefaultsPreviewPrologSetup = false;
--        bool inPageSetup = false;
-         bool inRemovableEmbedding = false;
-         std::string removableEmbeddingEndLine;
-         unsigned int removableEmbeddingsWithUnmarkedTrailer = 0;
-@@ -465,7 +465,7 @@ namespace {
-                 #endif
-                 throw Error(write ? 21 : 14);
-             } else if (line == "%%BeginPageSetup") {
--                inPageSetup = true;
-+                posBeginPageSetup = startPos;
-             } else if (!inRemovableEmbedding && line == "%Exiv2BeginXMP: Before %%EndPageSetup") {
-                 inRemovableEmbedding = true;
-                 removableEmbeddings.push_back(std::make_pair(startPos, startPos));
-@@ -510,18 +510,34 @@ namespace {
-             if (posPage == posEndEps && posEndComments != posEndEps && !inDefaultsPreviewPrologSetup && !inRemovableEmbedding && !onlyWhitespaces(line)) {
-                 posPage = startPos;
-                 implicitPage = true;
-+                posBeginPageSetup = startPos;
-                 posEndPageSetup = startPos;
-                 #ifdef DEBUG
--                EXV_DEBUG << "readWriteEpsMetadata: Found implicit Page and EndPageSetup at position: " << startPos << "\n";
-+                EXV_DEBUG << "readWriteEpsMetadata: Found implicit Page, BeginPageSetup and EndPageSetup at position: " << startPos << "\n";
-                 #endif
-             }
--            if (posEndPageSetup == posEndEps && posPage != posEndEps && !inPageSetup && !inRemovableEmbedding && line.size() >= 1 && line[0] != '%') {
-+            if (posBeginPageSetup == posEndEps && posPage != posEndEps && !inRemovableEmbedding && line.size() >= 1 && line[0] != '%') {
-+                posBeginPageSetup = startPos;
-                 posEndPageSetup = startPos;
-                 #ifdef DEBUG
--                EXV_DEBUG << "readWriteEpsMetadata: Found implicit EndPageSetup at position: " << startPos << "\n";
-+                EXV_DEBUG << "readWriteEpsMetadata: Found implicit BeginPageSetup and EndPageSetup at position: " << startPos << "\n";
-                 #endif
-             }
-             if (line.size() >= 1 && line[0] != '%') continue; // performance optimization
-+            if (line == "%%EOF" || line == "%%Trailer" || line == "%%PageTrailer") {
-+                if (posBeginPageSetup == posEndEps) {
-+                    posBeginPageSetup = startPos;
-+                    #ifdef DEBUG
-+                    EXV_DEBUG << "readWriteEpsMetadata: Found implicit BeginPageSetup at position: " << startPos << "\n";
-+                    #endif
-+                }
-+                if (posEndPageSetup == posEndEps) {
-+                    posEndPageSetup = startPos;
-+                    #ifdef DEBUG
-+                    EXV_DEBUG << "readWriteEpsMetadata: Found implicit EndPageSetup at position: " << startPos << "\n";
-+                    #endif
-+                }
-+            }
-             if (line == "%%EOF" || line == "%%Trailer") {
-                 if (posPageTrailer == posEndEps) {
-                     posPageTrailer = startPos;
-@@ -561,7 +577,6 @@ namespace {
-             } else if (line == "%%EndSetup") {
-                 inDefaultsPreviewPrologSetup = false;
-             } else if (posEndPageSetup == posEndEps && line == "%%EndPageSetup") {
--                inPageSetup = false;
-                 posEndPageSetup = startPos;
-             } else if (posPageTrailer == posEndEps && line == "%%PageTrailer") {
-                 posPageTrailer = startPos;
-@@ -815,6 +830,7 @@ namespace {
-             positions.push_back(posExiv2Website);
-             positions.push_back(posEndComments);
-             positions.push_back(posPage);
-+            positions.push_back(posBeginPageSetup);
-             positions.push_back(posEndPageSetup);
-             positions.push_back(posPageTrailer);
-             positions.push_back(posEof);
--- 
-1.7.10.4
-
-From f8c9c6114bf7631bb0dba67582c2666b05b2ff9f Mon Sep 17 00:00:00 2001
-From: vog <vog@b7c8b350-86e7-0310-a4b4-de8f6a8f16a3>
-Date: Fri, 14 Sep 2012 16:06:26 +0000
-Subject: [PATCH 2/4] Issue #847: Always insert BeginPageSetup/EndPageSetup
- when missing
-
-git-svn-id: svn://dev.exiv2.org/svn/trunk@2870 b7c8b350-86e7-0310-a4b4-de8f6a8f16a3
----
- src/epsimage.cpp |   21 ++++++++++++++-------
- 1 file changed, 14 insertions(+), 7 deletions(-)
-
-diff --git a/src/epsimage.cpp b/src/epsimage.cpp
-index 51e5bb4..9276eb5 100644
---- a/src/epsimage.cpp
-+++ b/src/epsimage.cpp
-@@ -935,6 +935,11 @@ namespace {
-                         writeTemp(*tempIo, "%%EndPageComments" + lineEnding);
-                     }
-                 }
-+                if (pos == posBeginPageSetup) {
-+                    if (line != "%%BeginPageSetup") {
-+                        writeTemp(*tempIo, "%%BeginPageSetup" + lineEnding);
-+                    }
-+                }
-                 if (useFlexibleEmbedding) {
-                     // insert XMP metadata into existing flexible embedding
-                     if (pos == xmpPos) {
-@@ -947,7 +952,8 @@ namespace {
-                         EXV_DEBUG << "readWriteEpsMetadata: Skipping to " << skipPos << " at " << __FILE__ << ":" << __LINE__ << "\n";
-                         #endif
-                     }
--                } else {
-+                }
-+                if (!useFlexibleEmbedding) {
-                     // remove preceding embedding(s)
-                     for (std::vector<std::pair<size_t, size_t> >::const_iterator e = removableEmbeddings.begin(); e != removableEmbeddings.end(); e++) {
-                         if (pos == e->first) {
-@@ -960,9 +966,6 @@ namespace {
-                     }
-                     // insert XMP metadata with new flexible embedding, if necessary
-                     if (pos == posEndPageSetup && !deleteXmp) {
--                        if (line != "%%EndPageSetup") {
--                            writeTemp(*tempIo, "%%BeginPageSetup" + lineEnding);
--                        }
-                         writeTemp(*tempIo, "%Exiv2BeginXMP: Before %%EndPageSetup" + lineEnding);
-                         if (corelDraw) {
-                             writeTemp(*tempIo, "%Exiv2Notice: The following line is needed by CorelDRAW." + lineEnding);
-@@ -1004,10 +1007,14 @@ namespace {
-                             writeTemp(*tempIo, "@sv" + lineEnding);
-                         }
-                         writeTemp(*tempIo, "%Exiv2EndXMP" + lineEnding);
--                        if (line != "%%EndPageSetup") {
--                            writeTemp(*tempIo, "%%EndPageSetup" + lineEnding);
--                        }
-                     }
-+                }
-+                if (pos == posEndPageSetup) {
-+                    if (line != "%%EndPageSetup") {
-+                        writeTemp(*tempIo, "%%EndPageSetup" + lineEnding);
-+                    }
-+                }
-+                if (!useFlexibleEmbedding) {
-                     if (pos == posPageTrailer && !deleteXmp) {
-                         if (!implicitPageTrailer) {
-                             skipPos = posLineEnd;
--- 
-1.7.10.4
-
-From b22ff432f0205d77d1b9e0ad2cd314ab6cdf20b0 Mon Sep 17 00:00:00 2001
-From: vog <vog@b7c8b350-86e7-0310-a4b4-de8f6a8f16a3>
-Date: Fri, 14 Sep 2012 16:06:29 +0000
-Subject: [PATCH 3/4] Issue #847: Split recognition of implicit Page,
- BeginPageSetup and EndPageSetup
-
-git-svn-id: svn://dev.exiv2.org/svn/trunk@2871 b7c8b350-86e7-0310-a4b4-de8f6a8f16a3
----
- src/epsimage.cpp |   17 ++++++++++++-----
- 1 file changed, 12 insertions(+), 5 deletions(-)
-
-diff --git a/src/epsimage.cpp b/src/epsimage.cpp
-index 9276eb5..57051a1 100644
---- a/src/epsimage.cpp
-+++ b/src/epsimage.cpp
-@@ -396,6 +396,7 @@ namespace {
-         bool illustrator8 = false;
-         bool corelDraw = false;
-         bool implicitPage = false;
-+        bool implicitPageSetup = false;
-         bool implicitPageTrailer = false;
-         bool inDefaultsPreviewPrologSetup = false;
-         bool inRemovableEmbedding = false;
-@@ -510,29 +511,35 @@ namespace {
-             if (posPage == posEndEps && posEndComments != posEndEps && !inDefaultsPreviewPrologSetup && !inRemovableEmbedding && !onlyWhitespaces(line)) {
-                 posPage = startPos;
-                 implicitPage = true;
--                posBeginPageSetup = startPos;
--                posEndPageSetup = startPos;
-                 #ifdef DEBUG
--                EXV_DEBUG << "readWriteEpsMetadata: Found implicit Page, BeginPageSetup and EndPageSetup at position: " << startPos << "\n";
-+                EXV_DEBUG << "readWriteEpsMetadata: Found implicit Page at position: " << startPos << "\n";
-                 #endif
-             }
--            if (posBeginPageSetup == posEndEps && posPage != posEndEps && !inRemovableEmbedding && line.size() >= 1 && line[0] != '%') {
-+            if (posBeginPageSetup == posEndEps && (implicitPage || (posPage != posEndEps && !inRemovableEmbedding && line.size() >= 1 && line[0] != '%'))) {
-                 posBeginPageSetup = startPos;
-+                implicitPageSetup = true;
-+                #ifdef DEBUG
-+                EXV_DEBUG << "readWriteEpsMetadata: Found implicit BeginPageSetup at position: " << startPos << "\n";
-+                #endif
-+            }
-+            if (posEndPageSetup == posEndEps && implicitPageSetup) {
-                 posEndPageSetup = startPos;
-                 #ifdef DEBUG
--                EXV_DEBUG << "readWriteEpsMetadata: Found implicit BeginPageSetup and EndPageSetup at position: " << startPos << "\n";
-+                EXV_DEBUG << "readWriteEpsMetadata: Found implicit EndPageSetup at position: " << startPos << "\n";
-                 #endif
-             }
-             if (line.size() >= 1 && line[0] != '%') continue; // performance optimization
-             if (line == "%%EOF" || line == "%%Trailer" || line == "%%PageTrailer") {
-                 if (posBeginPageSetup == posEndEps) {
-                     posBeginPageSetup = startPos;
-+                    implicitPageSetup = true;
-                     #ifdef DEBUG
-                     EXV_DEBUG << "readWriteEpsMetadata: Found implicit BeginPageSetup at position: " << startPos << "\n";
-                     #endif
-                 }
-                 if (posEndPageSetup == posEndEps) {
-                     posEndPageSetup = startPos;
-+                    implicitPageSetup = true;
-                     #ifdef DEBUG
-                     EXV_DEBUG << "readWriteEpsMetadata: Found implicit EndPageSetup at position: " << startPos << "\n";
-                     #endif
--- 
-1.7.10.4
-
-From 41fb1a2ff54a9377763e4a66544c2234f9b055c8 Mon Sep 17 00:00:00 2001
-From: vog <vog@b7c8b350-86e7-0310-a4b4-de8f6a8f16a3>
-Date: Fri, 14 Sep 2012 17:01:36 +0000
-Subject: [PATCH 4/4] Issue #847: Ensure that Photoshop will always recognize
- modified Photoshop EPS files
-
-For a full description of this issue, see:
-http://dev.exiv2.org/issues/847
-
-git-svn-id: svn://dev.exiv2.org/svn/trunk@2873 b7c8b350-86e7-0310-a4b4-de8f6a8f16a3
----
- src/epsimage.cpp |    2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/epsimage.cpp b/src/epsimage.cpp
-index 57051a1..4a0ca3a 100644
---- a/src/epsimage.cpp
-+++ b/src/epsimage.cpp
-@@ -522,7 +522,7 @@ namespace {
-                 EXV_DEBUG << "readWriteEpsMetadata: Found implicit BeginPageSetup at position: " << startPos << "\n";
-                 #endif
-             }
--            if (posEndPageSetup == posEndEps && implicitPageSetup) {
-+            if (posEndPageSetup == posEndEps && implicitPageSetup && !inRemovableEmbedding && line.size() >= 1 && line[0] != '%') {
-                 posEndPageSetup = startPos;
-                 #ifdef DEBUG
-                 EXV_DEBUG << "readWriteEpsMetadata: Found implicit EndPageSetup at position: " << startPos << "\n";
--- 
-1.7.10.4
-
--- a/src/exiv2-r2796.patch	Sat Jan 29 10:31:18 2022 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,87 +0,0 @@
-This file is part of MXE.
-See index.html for further information.
-
-This patch has been taken from:
-http://dev.exiv2.org/projects/exiv2/repository/revisions/2796
-
-Index: trunk/src/basicio.cpp
-===================================================================
---- trunk/src/basicio.cpp	(revision 2795)
-+++ trunk/src/basicio.cpp	(revision 2796)
-@@ -61,6 +61,11 @@
- # include <unistd.h>                    // for getpid, stat
- #endif
- 
-+// Platform specific headers for handling extended attributes (xattr)
-+#if defined(__APPLE__)
-+# include <sys/xattr.h>
-+#endif
-+
- #if defined WIN32 && !defined __CYGWIN__
- // Windows doesn't provide mode_t, nlink_t
- typedef unsigned short mode_t;
-@@ -131,6 +136,8 @@
-         int switchMode(OpMode opMode);
-         //! stat wrapper for internal use
-         int stat(StructStat& buf) const;
-+        //! copy extended attributes (xattr) from another file
-+        void copyXattrFrom(const FileIo& src);
- #if defined WIN32 && !defined __CYGWIN__
-         // Windows function to determine the number of hardlinks (on NTFS)
-         DWORD winNumberOfLinks() const;
-@@ -252,6 +259,47 @@
-         return ret;
-     } // FileIo::Impl::stat
- 
-+    void FileIo::Impl::copyXattrFrom(const FileIo& src)
-+    {
-+#if defined(__APPLE__)
-+# if defined(EXV_UNICODE_PATH)
-+#  error No xattr API for MacOS X with unicode support
-+# endif
-+        const ssize_t namebufSize = ::listxattr(src.p_->path_.c_str(), 0, 0, 0);
-+        if (namebufSize < 0) {
-+            throw Error(2, src.p_->path_, strError(), "listxattr");
-+        }
-+        if (namebufSize == 0) {
-+            // No extended attributes in source file
-+            return;
-+        }
-+        char namebuf[namebufSize];
-+        if (::listxattr(src.p_->path_.c_str(), namebuf, sizeof(namebuf), 0) != namebufSize) {
-+            throw Error(2, src.p_->path_, strError(), "listxattr");
-+        }
-+        for (ssize_t namebufPos = 0; namebufPos < namebufSize;) {
-+            const char *name = namebuf + namebufPos;
-+            namebufPos += strlen(name) + 1;
-+            const ssize_t valueSize = ::getxattr(src.p_->path_.c_str(), name, 0, 0, 0, 0);
-+            if (valueSize < 0) {
-+                throw Error(2, src.p_->path_, strError(), "getxattr");
-+            }
-+            char value[valueSize];
-+            if (::getxattr(src.p_->path_.c_str(), name, value, sizeof(value), 0, 0) != valueSize) {
-+                throw Error(2, src.p_->path_, strError(), "getxattr");
-+            }
-+#ifdef DEBUG
-+            EXV_DEBUG << "Copying xattr \"" << name << "\" with value size " << valueSize << "\n";
-+#endif
-+            if (::setxattr(path_.c_str(), name, value, valueSize, 0, 0) != 0) {
-+                throw Error(2, path_, strError(), "setxattr");
-+            }
-+        }
-+#else
-+        // No xattr support for this platform.
-+#endif
-+    } // FileIo::Impl::copyXattrFrom
-+
- #if defined WIN32 && !defined __CYGWIN__
-     DWORD FileIo::Impl::winNumberOfLinks() const
-     {
-@@ -521,6 +569,7 @@
-                     throw Error(10, path(), "w+b", strError());
-                 }
-             }
-+            fileIo->p_->copyXattrFrom(*this);
-             basicIo = fileIo;
-         }
-         else {
--- a/src/exiv2.mk	Sat Jan 29 10:31:18 2022 -0500
+++ b/src/exiv2.mk	Thu Feb 03 12:28:36 2022 -0500
@@ -3,28 +3,29 @@
 
 PKG             := exiv2
 $(PKG)_IGNORE   :=
-$(PKG)_VERSION  := 0.23
-$(PKG)_CHECKSUM := 5f342bf642477526f41add11d6ee7787cdcd639f
-$(PKG)_SUBDIR   := exiv2-$($(PKG)_VERSION)
-$(PKG)_FILE     := exiv2-$($(PKG)_VERSION).tar.gz
-$(PKG)_URL      := http://www.exiv2.org/$($(PKG)_FILE)
-$(PKG)_DEPS     := libiconv zlib expat
+$(PKG)_VERSION  := 0.27.5
+$(PKG)_CHECKSUM := 775f9c5ddeb92b682da8b7737f9811009595dc6a
+$(PKG)_SUBDIR   := exiv2-$($(PKG)_VERSION)-Source
+$(PKG)_FILE     := exiv2-$($(PKG)_VERSION)-Source.tar.gz
+$(PKG)_URL      := https://github.com/Exiv2/exiv2/releases/download/v$($(PKG)_VERSION)/$($(PKG)_FILE)
+$(PKG)_DEPS     := gettext libiconv zlib expat
 
 define $(PKG)_UPDATE
-    $(WGET) -q -O- 'http://www.exiv2.org/archive.html' | \
-    grep 'href="/releases/exiv2-' | \
-    $(SED) -n 's,.*exiv2-\([0-9][^>]*\)\.tar.*,\1,p' | \
+    $(WGET) -q -O- 'https://www.exiv2.org/download.html' | \
+    $(SED) -n 's,.*exiv2-\([0-9][^>]*\)-Source\.tar.*,\1,p' | \
     head -1
 endef
 
 define $(PKG)_BUILD
-    cd '$(1)' && ./configure \
-        $(HOST_AND_BUILD_CONFIGURE_OPTIONS) \
-        $(ENABLE_SHARED_OR_STATIC) \
-        --prefix='$(HOST_PREFIX)' \
-        --disable-visibility \
-        --disable-nls \
-        --with-expat
-    $(MAKE) -C '$(1)/xmpsdk/src' -j '$(JOBS)'
-    $(MAKE) -C '$(1)/src'        -j '$(JOBS)' install-lib
+    cd '$(1)' && cmake \
+        $($(PKG)_CMAKE_FLAGS) \
+        -DBUILD_TESTING=no \
+        -DEXIV2_BUILD_SAMPLES=OFF \
+        $(CMAKE_CCACHE_FLAGS) \
+        $(CMAKE_BUILD_SHARED_OR_STATIC) \
+        -DCMAKE_TOOLCHAIN_FILE='$(CMAKE_TOOLCHAIN_FILE)' \
+        .
+
+    $(MAKE) -C '$(1)' -j '$(JOBS)' VERBOSE=1
+    $(MAKE) -C '$(1)' -j '1' VERBOSE=1 DESTDIR='$(3)' install
 endef