commit: f81a5364f09e3da44d419168e30ff21be6992d64 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> AuthorDate: Tue Dec 25 18:04:47 2018 +0000 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> CommitDate: Tue Dec 25 21:23:20 2018 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f81a5364
kde-apps/libkexiv2: Fix build with >=exiv2-0.27 Instead of adding FindLibExiv2.cmake through the patch we will just bump minimum depend to FRAMEWORKS_MINIMAL=5.53.0. Package-Manager: Portage-2.3.52, Repoman-2.3.12 Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org> .../files/libkexiv2-18.12.0-exiv2-0.27.patch | 253 +++++++++++++++++++++ kde-apps/libkexiv2/libkexiv2-18.12.0.ebuild | 3 + 2 files changed, 256 insertions(+) diff --git a/kde-apps/libkexiv2/files/libkexiv2-18.12.0-exiv2-0.27.patch b/kde-apps/libkexiv2/files/libkexiv2-18.12.0-exiv2-0.27.patch new file mode 100644 index 00000000000..65bb8f4a4aa --- /dev/null +++ b/kde-apps/libkexiv2/files/libkexiv2-18.12.0-exiv2-0.27.patch @@ -0,0 +1,253 @@ +From 27c6834e4e984c34a55fad313c26fe08d9dd35b0 Mon Sep 17 00:00:00 2001 +From: Andreas Sturmlechner <andreas.sturmlech...@gmail.com> +Date: Tue, 25 Dec 2018 16:52:26 +0100 +Subject: [PATCH] Fix building against exiv2-0.27 + +Summary: +Copied FindLibExiv2.cmake from ECM 5.53.0 until we raise min version. +Bumped cmake to 3.7 minimum for VERSION_GREATER_EQUAL. + +Test Plan: Tested build with exiv2-0.26 and 0.27 + +Reviewers: #kde_applications, cgilles + +Subscribers: heikobecker + +Differential Revision: https://phabricator.kde.org/D17799 +--- + CMakeLists.txt | 36 ++++---- + cmake/modules/FindExiv2.cmake | 80 ------------------ + cmake/modules/FindLibExiv2.cmake | 115 ++++++++++++++++++++++++++ + cmake/templates/libkexiv2.pc.cmake.in | 2 +- + config-kexiv2.h.cmake | 4 + + src/CMakeLists.txt | 3 +- + src/kexiv2.cpp | 2 +- + src/kexiv2.h | 1 + + src/kexiv2_p.cpp | 17 +--- + src/kexiv2_p.h | 1 + + src/kexiv2exif.cpp | 4 + + 11 files changed, 147 insertions(+), 118 deletions(-) + delete mode 100644 cmake/modules/FindExiv2.cmake + create mode 100644 cmake/modules/FindLibExiv2.cmake + create mode 100644 config-kexiv2.h.cmake + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index d13ef27..fcda905 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -4,14 +4,14 @@ + # Redistribution and use is allowed according to the terms of the BSD license. + # For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +-set(CMAKE_MIN_VERSION "3.0.0") ++set(CMAKE_MIN_VERSION "3.7.0") + set(ECM_MIN_VERSION "1.1.0") + set(REQUIRED_QT_VERSION "5.2.0") + set(EXIV2_MIN_VERSION "0.24") + + cmake_minimum_required(VERSION ${CMAKE_MIN_VERSION}) + +-project(libkexiv2) ++project(libkexiv2 VERSION "5.0.0") + + message(STATUS "----------------------------------------------------------------------------------") + message(STATUS "Starting CMake configuration for: ${PROJECT_NAME}") +@@ -47,18 +47,12 @@ message(STATUS "Starting CMake configuration for: ${PROJECT_NAME}") + # 2.4.0 => 11.3.0 - Add new method to access on text edit widget from AltLangStrEdit + # 5.0.0 => 15.0.0 (Released with KDE 5.x) + +-# Library API version +-set(KEXIV2_LIB_MAJOR_VERSION "5") +-set(KEXIV2_LIB_MINOR_VERSION "0") +-set(KEXIV2_LIB_PATCH_VERSION "0") +- + # Library ABI version used by linker. + # For details : http://www.gnu.org/software/libtool/manual/libtool.html#Updating-version-info + set(KEXIV2_LIB_SO_CUR_VERSION "15") + set(KEXIV2_LIB_SO_REV_VERSION "0") + set(KEXIV2_LIB_SO_AGE_VERSION "0") + +-set(LIBKEXIV2_LIB_VERSION "${KEXIV2_LIB_MAJOR_VERSION}.${KEXIV2_LIB_MINOR_VERSION}.${KEXIV2_LIB_PATCH_VERSION}") + set(LIBKEXIV2_SO_VERSION "${KEXIV2_LIB_SO_CUR_VERSION}.${KEXIV2_LIB_SO_REV_VERSION}.${KEXIV2_LIB_SO_AGE_VERSION}") + + ############## ECM setup ###################### +@@ -77,6 +71,13 @@ include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE) + include(GenerateExportHeader) + include(FeatureSummary) + ++ecm_setup_version(${libkexiv2_VERSION} ++ VARIABLE_PREFIX KEXIV2 ++ VERSION_HEADER "src/libkexiv2_version.h" ++ PACKAGE_VERSION_FILE "KF5KExiv2ConfigVersion.cmake" ++ SOVERSION ${LIBKEXIV2_SO_VERSION} ++) ++ + ############## Find Packages ################### + + find_package(Qt5 ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE COMPONENTS +@@ -84,20 +85,13 @@ find_package(Qt5 ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE COMPONENTS + Gui + ) + +-find_package(Exiv2 ${EXIV2_MIN_VERSION} REQUIRED) +-set_package_properties("Exiv2" PROPERTIES +- DESCRIPTION "Required to build libkexiv2" +- URL "http://www.exiv2.org" +- TYPE RECOMMENDED +- PURPOSE "Library to manage image metadata" +-) ++find_package(LibExiv2 ${EXIV2_MIN_VERSION} REQUIRED) + +-ecm_setup_version(${LIBKEXIV2_LIB_VERSION} +- VARIABLE_PREFIX KEXIV2 +- VERSION_HEADER "src/libkexiv2_version.h" +- PACKAGE_VERSION_FILE "KF5KExiv2ConfigVersion.cmake" +- SOVERSION ${LIBKEXIV2_SO_VERSION} +-) ++if (LibExiv2_VERSION VERSION_GREATER_EQUAL "0.27") ++ set(HAVE_LIBEXIV2_0_27 TRUE) ++endif() ++ ++configure_file(config-kexiv2.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-kexiv2.h) + + ############## Targets ######################### + +diff --git a/cmake/templates/libkexiv2.pc.cmake.in b/cmake/templates/libkexiv2.pc.cmake.in +index 1df60df..e80e0ec 100644 +--- a/cmake/templates/libkexiv2.pc.cmake.in ++++ b/cmake/templates/libkexiv2.pc.cmake.in +@@ -7,6 +7,6 @@ Name: ${PROJECT_NAME} + Description: A C++ library to manipulate EXIF/IPTC/XMP metadata using Exiv2 library. + URL: https://cgit.kde.org/libkexiv2.git/ + Requires: +-Version: ${KEXIV2_LIB_VERSION_STRING} ++Version: ${libkexiv2_VERSION} + Libs: -L${LIB_INSTALL_DIR} -lkexiv2 + Cflags: -I${INCLUDE_INSTALL_DIR} +diff --git a/config-kexiv2.h.cmake b/config-kexiv2.h.cmake +new file mode 100644 +index 0000000..40992bd +--- /dev/null ++++ b/config-kexiv2.h.cmake +@@ -0,0 +1,4 @@ ++/* config-kexiv2.h. Generated by cmake from config-kexiv2.h.cmake */ ++ ++/* Defined if we have libexiv2 >= 0.27 */ ++#cmakedefine HAVE_LIBEXIV2_0_27 +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 2b2df03..8ac18f5 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -6,7 +6,6 @@ + + kde_enable_exceptions() + +-include_directories(${EXIV2_INCLUDE_DIR}) + include_directories(${CMAKE_CURRENT_BINARY_DIR}/..) + + add_definitions(${EXIV2_DEFINITIONS}) +@@ -55,7 +54,7 @@ target_include_directories(KF5KExiv2 INTERFACE + + target_link_libraries(KF5KExiv2 + PRIVATE +- ${EXIV2_LIBRARIES} ++ LibExiv2::LibExiv2 + PUBLIC + Qt5::Core + Qt5::Gui +diff --git a/src/kexiv2.cpp b/src/kexiv2.cpp +index 04c4aa4..b7bbc1a 100644 +--- a/src/kexiv2.cpp ++++ b/src/kexiv2.cpp +@@ -153,7 +153,7 @@ QString KExiv2::Exiv2Version() + // Since 0.14.0 release, we can extract run-time version of Exiv2. + // else we return make version. + +- return QString::fromLatin1(Exiv2::version()); ++ return QString::fromStdString(Exiv2::versionString()); + } + + QString KExiv2::version() +diff --git a/src/kexiv2.h b/src/kexiv2.h +index bebddb5..02a5c9c 100644 +--- a/src/kexiv2.h ++++ b/src/kexiv2.h +@@ -51,6 +51,7 @@ + + #include "libkexiv2_export.h" + #include "kexiv2data.h" ++#include "../config-kexiv2.h" + + namespace KExiv2Iface + { +diff --git a/src/kexiv2_p.cpp b/src/kexiv2_p.cpp +index cb6b134..2a287ab 100644 +--- a/src/kexiv2_p.cpp ++++ b/src/kexiv2_p.cpp +@@ -124,19 +124,15 @@ bool KExiv2::Private::saveToFile(const QFileInfo& finfo) const + + QStringList rawTiffBasedSupported, rawTiffBasedNotSupported; + +- // Raw files supported by Exiv2 0.21 ++ // Raw files supported by Exiv2 0.23 + rawTiffBasedSupported << QString::fromLatin1("dng") + << QString::fromLatin1("nef") + << QString::fromLatin1("pef") + << QString::fromLatin1("orf") +- << QString::fromLatin1("srw"); ++ << QString::fromLatin1("srw") ++ << QString::fromLatin1("cr2"); + +- if (Exiv2::testVersion(0,23,0)) +- { +- rawTiffBasedSupported << QString::fromLatin1("cr2"); +- } +- +- // Raw files not supported by Exiv2 0.21 ++ // Raw files not supported by Exiv2 0.23 + rawTiffBasedNotSupported << QString::fromLatin1("3fr") + << QString::fromLatin1("arw") + << QString::fromLatin1("dcr") +@@ -149,11 +145,6 @@ bool KExiv2::Private::saveToFile(const QFileInfo& finfo) const + << QString::fromLatin1("srf") + << QString::fromLatin1("rw2"); + +- if (!Exiv2::testVersion(0,23,0)) +- { +- rawTiffBasedNotSupported << QString::fromLatin1("cr2"); +- } +- + QString ext = finfo.suffix().toLower(); + + if (!writeRawFiles && (rawTiffBasedSupported.contains(ext) || rawTiffBasedNotSupported.contains(ext)) ) +diff --git a/src/kexiv2_p.h b/src/kexiv2_p.h +index ddf8f6d..c73fbbf 100644 +--- a/src/kexiv2_p.h ++++ b/src/kexiv2_p.h +@@ -71,6 +71,7 @@ + #include <exiv2/properties.hpp> + #include <exiv2/types.hpp> + #include <exiv2/exif.hpp> ++#include <exiv2/exiv2.hpp> + #include <exiv2/xmpsidecar.hpp> + + // Check if Exiv2 support XMP +diff --git a/src/kexiv2exif.cpp b/src/kexiv2exif.cpp +index 11c8948..3093b70 100644 +--- a/src/kexiv2exif.cpp ++++ b/src/kexiv2exif.cpp +@@ -987,7 +987,11 @@ bool KExiv2::setTiffThumbnail(const QImage& thumbImage, bool setProgramName) con + + if (pos == d->exifMetadata().end() || pos->count() != 1 || pos->toLong() != 0) + { ++#ifdef HAVE_LIBEXIV2_0_27 ++ throw Exiv2::Error(Exiv2::kerErrorMessage, "Exif.Image.NewSubfileType missing or not set as main image"); ++#else + throw Exiv2::Error(1, "Exif.Image.NewSubfileType missing or not set as main image"); ++#endif + } + + // Remove sub-IFD tags +-- +2.20.1 + diff --git a/kde-apps/libkexiv2/libkexiv2-18.12.0.ebuild b/kde-apps/libkexiv2/libkexiv2-18.12.0.ebuild index d1c1eda8fde..286798e5a35 100644 --- a/kde-apps/libkexiv2/libkexiv2-18.12.0.ebuild +++ b/kde-apps/libkexiv2/libkexiv2-18.12.0.ebuild @@ -3,6 +3,7 @@ EAPI=6 +FRAMEWORKS_MINIMAL="5.53.0" KDE_BLOCK_SLOT4="false" inherit kde5 @@ -16,3 +17,5 @@ DEPEND=" >=media-gfx/exiv2-0.25:=[xmp=] " RDEPEND="${DEPEND}" + +PATCHES=( "${FILESDIR}/${P}-exiv2-0.27.patch" )