From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id BBCB8158089 for ; Sun, 3 Sep 2023 12:19:45 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id ED90B2BC017; Sun, 3 Sep 2023 12:19:44 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id CE15E2BC017 for ; Sun, 3 Sep 2023 12:19:44 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 791D0335D00 for ; Sun, 3 Sep 2023 12:19:43 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id BD3BB110D for ; Sun, 3 Sep 2023 12:19:41 +0000 (UTC) From: "Andreas Sturmlechner" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Andreas Sturmlechner" Message-ID: <1693743487.7707a66f2b6329bed44fb75c9478cebac0888ce5.asturm@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: media-gfx/nomacs/files/, media-gfx/nomacs/ X-VCS-Repository: repo/gentoo X-VCS-Files: media-gfx/nomacs/files/nomacs-3.16.224-exiv2-0.28.patch media-gfx/nomacs/nomacs-3.16.224-r6.ebuild X-VCS-Directories: media-gfx/nomacs/ media-gfx/nomacs/files/ X-VCS-Committer: asturm X-VCS-Committer-Name: Andreas Sturmlechner X-VCS-Revision: 7707a66f2b6329bed44fb75c9478cebac0888ce5 X-VCS-Branch: master Date: Sun, 3 Sep 2023 12:19:41 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: fc30eadd-4c86-4958-8057-fa1e87c07ba5 X-Archives-Hash: e5dea1e670bc122f9bc9e3ef13f171e6 commit: 7707a66f2b6329bed44fb75c9478cebac0888ce5 Author: Andreas Sturmlechner gentoo org> AuthorDate: Sun Sep 3 11:45:47 2023 +0000 Commit: Andreas Sturmlechner gentoo org> CommitDate: Sun Sep 3 12:18:07 2023 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7707a66f media-gfx/nomacs: Fix build with >=exiv2-0.28 Closes: https://bugs.gentoo.org/906488 Signed-off-by: Andreas Sturmlechner gentoo.org> .../nomacs/files/nomacs-3.16.224-exiv2-0.28.patch | 241 +++++++++++++++++++++ media-gfx/nomacs/nomacs-3.16.224-r6.ebuild | 5 +- 2 files changed, 245 insertions(+), 1 deletion(-) diff --git a/media-gfx/nomacs/files/nomacs-3.16.224-exiv2-0.28.patch b/media-gfx/nomacs/files/nomacs-3.16.224-exiv2-0.28.patch new file mode 100644 index 000000000000..280d7ec59e8b --- /dev/null +++ b/media-gfx/nomacs/files/nomacs-3.16.224-exiv2-0.28.patch @@ -0,0 +1,241 @@ +From 6785f15d9ed05ebc66ee200b3c94451c6c633646 Mon Sep 17 00:00:00 2001 +From: Andreas Sturmlechner +Date: Sun, 3 Sep 2023 13:30:43 +0200 +Subject: [PATCH] Fix 3.16.224 build with exiv2-0.28 + +Signed-off-by: Andreas Sturmlechner +--- + ImageLounge/src/DkCore/DkMetaData.cpp | 59 ++++++++++++++++++--------- + ImageLounge/src/DkCore/DkMetaData.h | 4 +- + 2 files changed, 41 insertions(+), 22 deletions(-) + +diff --git a/ImageLounge/src/DkCore/DkMetaData.cpp b/ImageLounge/src/DkCore/DkMetaData.cpp +index bf1d111e..5eaeebf4 100644 +--- a/ImageLounge/src/DkCore/DkMetaData.cpp ++++ b/ImageLounge/src/DkCore/DkMetaData.cpp +@@ -73,8 +73,12 @@ void DkMetaDataT::readMetaData(const QString& filePath, QSharedPointerconstData(), ba->size()); ++#else + Exiv2::BasicIo::AutoPtr exifBuffer(new Exiv2::MemIo((const byte*)ba->constData(), ba->size())); + mExifImg = Exiv2::ImageFactory::open(exifBuffer); ++#endif + } + } + catch (...) { +@@ -155,14 +159,18 @@ bool DkMetaDataT::saveMetaData(QSharedPointer& ba, bool force) { + Exiv2::ExifData &exifData = mExifImg->exifData(); + Exiv2::XmpData &xmpData = mExifImg->xmpData(); + Exiv2::IptcData &iptcData = mExifImg->iptcData(); +- +- Exiv2::Image::AutoPtr exifImgN; ++ std::unique_ptr exifImgN; ++#if !EXIV2_TEST_VERSION(0, 28, 0) + Exiv2::MemIo::AutoPtr exifMem; ++#endif + + try { +- ++#if EXIV2_TEST_VERSION(0, 28, 0) ++ exifImgN = Exiv2::ImageFactory::open((byte *)ba->data(), ba->size()); ++#else + exifMem = Exiv2::MemIo::AutoPtr(new Exiv2::MemIo((byte*)ba->data(), ba->size())); + exifImgN = Exiv2::ImageFactory::open(exifMem); ++#endif + } + catch (...) { + +@@ -186,8 +194,13 @@ bool DkMetaDataT::saveMetaData(QSharedPointer& ba, bool force) { + + // now get the data again + Exiv2::DataBuf exifBuf = exifImgN->io().read((long)exifImgN->io().size()); ++#if EXIV2_TEST_VERSION(0, 28, 0) ++ if (!exifBuf.empty()) { ++ QSharedPointer tmp = QSharedPointer(new QByteArray((const char *)exifBuf.c_data(), exifBuf.size())); ++#else + if (exifBuf.pData_) { + QSharedPointer tmp = QSharedPointer(new QByteArray((const char*)exifBuf.pData_, exifBuf.size_)); ++#endif + + if (tmp->size() > qRound(ba->size()*0.5f)) + ba = tmp; +@@ -197,7 +210,7 @@ bool DkMetaDataT::saveMetaData(QSharedPointer& ba, bool force) { + else + return false; + +- mExifImg = exifImgN; ++ mExifImg.swap(exifImgN); + mExifState = loaded; + + return true; +@@ -250,7 +263,7 @@ int DkMetaDataT::getOrientationDegree() const { + + if (pos != exifData.end() && pos->count() != 0) { + +- Exiv2::Value::AutoPtr v = pos->getValue(); ++ std::unique_ptr v = pos->getValue(); + orientation = (int)pos->toFloat(); + + switch (orientation) { +@@ -315,7 +328,7 @@ int DkMetaDataT::getRating() const { + Exiv2::ExifData::iterator pos = exifData.findKey(key); + + if (pos != exifData.end() && pos->count() != 0) { +- Exiv2::Value::AutoPtr v = pos->getValue(); ++ std::unique_ptr v = pos->getValue(); + exifRating = v->toFloat(); + } + } +@@ -327,7 +340,7 @@ int DkMetaDataT::getRating() const { + + //xmp Rating tag + if (pos != xmpData.end() && pos->count() != 0) { +- Exiv2::Value::AutoPtr v = pos->getValue(); ++ std::unique_ptr v = pos->getValue(); + xmpRating = v->toFloat(); + } + +@@ -336,7 +349,7 @@ int DkMetaDataT::getRating() const { + key = Exiv2::XmpKey("Xmp.MicrosoftPhoto.Rating"); + pos = xmpData.findKey(key); + if (pos != xmpData.end() && pos->count() != 0) { +- Exiv2::Value::AutoPtr v = pos->getValue(); ++ std::unique_ptr v = pos->getValue(); + xmpRating = v->toFloat(); + } + } +@@ -399,7 +412,7 @@ QString DkMetaDataT::getNativeExifValue(const QString& key) const { + if (pos->count () < 2000) { // diem: this is about performance - adobe obviously embeds whole images into tiff exiv data + + //qDebug() << "pos count: " << pos->count(); +- //Exiv2::Value::AutoPtr v = pos->getValue(); ++ //std::unique_ptr v = pos->getValue(); + info = exiv2ToQString(pos->toString()); + + } +@@ -436,7 +449,7 @@ QString DkMetaDataT::getXmpValue(const QString& key) const { + } + + if (pos != xmpData.end() && pos->count() != 0) { +- Exiv2::Value::AutoPtr v = pos->getValue(); ++ std::unique_ptr v = pos->getValue(); + info = exiv2ToQString(pos->toString()); + } + } +@@ -478,7 +491,7 @@ QString DkMetaDataT::getExifValue(const QString& key) const { + } + + if (pos != exifData.end() && pos->count() != 0) { +- //Exiv2::Value::AutoPtr v = pos->getValue(); ++ //std::unique_ptr v = pos->getValue(); + info = exiv2ToQString(pos->toString()); + } + } +@@ -508,7 +521,7 @@ QString DkMetaDataT::getIptcValue(const QString& key) const { + } + + if (pos != iptcData.end() && pos->count() != 0) { +- Exiv2::Value::AutoPtr v = pos->getValue(); ++ std::unique_ptr v = pos->getValue(); + info = exiv2ToQString(pos->toString()); + } + } +@@ -653,8 +666,11 @@ QImage DkMetaDataT::getThumbnail() const { + try { + Exiv2::ExifThumb thumb(exifData); + Exiv2::DataBuf buffer = thumb.copy(); +- ++#if EXIV2_TEST_VERSION(0, 28, 0) ++ QByteArray ba = QByteArray((char *)buffer.c_data(), buffer.size()); ++#else + QByteArray ba = QByteArray((char*)buffer.pData_, buffer.size_); ++#endif + qThumb.loadFromData(ba); + } + catch (...) { +@@ -931,9 +947,12 @@ void DkMetaDataT::setThumbnail(QImage thumb) { + + try { + // whipe all exif data of the thumbnail ++#if EXIV2_TEST_VERSION(0, 28, 0) ++ Exiv2::Image::UniquePtr exifImgThumb = Exiv2::ImageFactory::open((const byte *)ba.constData(), ba.size()); ++#else + Exiv2::MemIo::AutoPtr exifBufferThumb(new Exiv2::MemIo((const byte*)ba.constData(), ba.size())); + Exiv2::Image::AutoPtr exifImgThumb = Exiv2::ImageFactory::open(exifBufferThumb); +- ++#endif + if (exifImgThumb.get() != 0 && exifImgThumb->good()) + exifImgThumb->clearExifData(); + } +@@ -1045,11 +1064,11 @@ void DkMetaDataT::setOrientation(int o) { + pos = exifData.findKey(key); + } + +- Exiv2::Value::AutoPtr v = pos->getValue(); ++ std::unique_ptr v = pos->getValue(); + Exiv2::UShortValue* prv = dynamic_cast(v.release()); + if (!prv) return; + +- Exiv2::UShortValue::AutoPtr rv = Exiv2::UShortValue::AutoPtr(prv); ++ std::unique_ptr rv = std::unique_ptr(prv); + if (rv->value_.empty()) return; + + orientation = (int) rv->value_[0]; +@@ -1110,7 +1129,7 @@ void DkMetaDataT::setRating(int r) { + exifData["Exif.Image.Rating"] = uint16_t(r); + exifData["Exif.Image.RatingPercent"] = uint16_t(r); + +- Exiv2::Value::AutoPtr v = Exiv2::Value::create(Exiv2::xmpText); ++ std::unique_ptr v = Exiv2::Value::create(Exiv2::xmpText); + v->read(sRating); + xmpData.add(Exiv2::XmpKey("Xmp.xmp.Rating"), v.get()); + v->read(sRatingPercent); +@@ -1354,9 +1373,9 @@ DkRotatingRect DkMetaDataT::getXMPRect(const QSize& size) const { + return DkRotatingRect(rr); + } + +-Exiv2::Image::AutoPtr DkMetaDataT::loadSidecar(const QString& filePath) const { ++std::unique_ptr DkMetaDataT::loadSidecar(const QString& filePath) const { + +- Exiv2::Image::AutoPtr xmpImg; ++ std::unique_ptr xmpImg; + + //TODO: check if the file type supports xmp + +@@ -1409,7 +1428,7 @@ bool DkMetaDataT::setXMPValue(Exiv2::XmpData& xmpData, QString xmpKey, QString x + setXMPValueSuccessful = true; + } + else { +- Exiv2::Value::AutoPtr v = Exiv2::Value::create(Exiv2::xmpText); ++ std::unique_ptr v = Exiv2::Value::create(Exiv2::xmpText); + if (!v->read(xmpValue.toStdString())) { + if (!xmpData.add(Exiv2::XmpKey(key), v.get())) + setXMPValueSuccessful = true; +diff --git a/ImageLounge/src/DkCore/DkMetaData.h b/ImageLounge/src/DkCore/DkMetaData.h +index c1f73c93..183a906a 100644 +--- a/ImageLounge/src/DkCore/DkMetaData.h ++++ b/ImageLounge/src/DkCore/DkMetaData.h +@@ -148,7 +148,7 @@ public: + + protected: + +- Exiv2::Image::AutoPtr loadSidecar(const QString& filePath) const; ++ std::unique_ptr loadSidecar(const QString& filePath) const; + + enum { + not_loaded, +@@ -157,7 +157,7 @@ protected: + dirty, + }; + +- Exiv2::Image::AutoPtr mExifImg; ++ std::unique_ptr mExifImg; + QString mFilePath; + QStringList mQtKeys; + QStringList mQtValues; +-- +2.42.0 + diff --git a/media-gfx/nomacs/nomacs-3.16.224-r6.ebuild b/media-gfx/nomacs/nomacs-3.16.224-r6.ebuild index d7020dcb57d8..ddfa980d7e71 100644 --- a/media-gfx/nomacs/nomacs-3.16.224-r6.ebuild +++ b/media-gfx/nomacs/nomacs-3.16.224-r6.ebuild @@ -48,7 +48,10 @@ BDEPEND=" DOCS=( src/changelog.txt ) -PATCHES=( "${FILESDIR}"/${P}-libdir.patch ) +PATCHES=( + "${FILESDIR}"/${P}-libdir.patch + "${FILESDIR}"/${P}-exiv2-0.28.patch # bug 906488 +) src_prepare() { if use plugins ; then