[exiv2] Update to 0.28.3, fixes, cleanup (#40476)

This commit is contained in:
Kai Pastor 2024-08-21 08:30:00 +02:00 committed by GitHub
parent 89f0d7dcb8
commit 46e2bec50a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
13 changed files with 75 additions and 209 deletions

View File

@ -0,0 +1,57 @@
diff --git a/cmake/exiv2Config.cmake.in b/cmake/exiv2Config.cmake.in
index c9e2eba..ca170e1 100644
--- a/cmake/exiv2Config.cmake.in
+++ b/cmake/exiv2Config.cmake.in
@@ -8,7 +8,15 @@ if(@EXIV2_ENABLE_PNG@) # if(EXIV2_ENABLE_PNG)
endif()
if(@EXIV2_ENABLE_XMP@) # if(EXIV2_ENABLE_XMP)
- find_dependency(EXPAT REQUIRED)
+ find_dependency(expat)
+endif()
+
+if(@EXIV2_ENABLE_BMFF@ AND @EXIV2_ENABLE_BROTLI@)
+ find_dependency(unofficial-brotli)
+endif()
+
+if(@EXIV2_ENABLE_INIH@)
+ find_dependency(unofficial-inih)
endif()
include("${CMAKE_CURRENT_LIST_DIR}/exiv2Export.cmake")
diff --git a/cmake/findDependencies.cmake b/cmake/findDependencies.cmake
index b0897c3..e559666 100644
--- a/cmake/findDependencies.cmake
+++ b/cmake/findDependencies.cmake
@@ -49,7 +49,8 @@ if( EXIV2_ENABLE_PNG )
endif( )
if( EXIV2_ENABLE_BMFF AND EXIV2_ENABLE_BROTLI )
- find_package( Brotli REQUIRED )
+ find_package(BROTLI NAMES unofficial-brotli REQUIRED)
+ set(Brotli_LIBRARIES unofficial::brotli::brotlidec)
endif( )
if( EXIV2_ENABLE_WEBREADY )
@@ -62,7 +63,9 @@ if (EXIV2_ENABLE_XMP AND EXIV2_ENABLE_EXTERNAL_XMP)
message(FATAL_ERROR "EXIV2_ENABLE_XMP AND EXIV2_ENABLE_EXTERNAL_XMP are mutually exclusive. You can only choose one of them")
else()
if (EXIV2_ENABLE_XMP)
- find_package(EXPAT REQUIRED)
+ find_package(EXPAT NAMES expat REQUIRED)
+ add_library(EXPAT::EXPAT ALIAS expat::expat)
+ set(EXPAT_LIBRARIES expat::expat)
elseif (EXIV2_ENABLE_EXTERNAL_XMP)
find_package(XmpSdk REQUIRED)
endif ()
@@ -79,7 +82,9 @@ if( ICONV_FOUND )
endif()
if( EXIV2_ENABLE_INIH )
- find_package(inih)
+ find_package(unofficial-inih CONFIG REQUIRED)
+ add_library(inih::libinih ALIAS unofficial::inih::libinih)
+ add_library(inih::inireader ALIAS unofficial::inih::inireader)
message ( "-- inih_INCLUDE_DIRS : " ${inih_INCLUDE_DIRS} )
message ( "-- inih_LIBRARIES : " ${inih_LIBRARIES} )
message ( "-- inih_inireader_INCLUDE_DIRS : " ${inih_inireader_INCLUDE_DIRS} )

View File

@ -1,17 +0,0 @@
diff --git a/cmake/findDependencies.cmake b/cmake/findDependencies.cmake
index 67a6cfd..d5006ff 100644
--- a/cmake/findDependencies.cmake
+++ b/cmake/findDependencies.cmake
@@ -30,10 +30,12 @@ endif()
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/")
+if(EXIV2_BUILD_UNIT_TESTS)
find_package (Python3 COMPONENTS Interpreter)
if (NOT Python3_Interpreter_FOUND)
message(WARNING "Python3 was not found. Python tests under the 'tests' folder will not be executed")
endif()
+endif()
find_package(Filesystem COMPONENTS Experimental Final REQUIRED)

View File

@ -1,27 +0,0 @@
diff --git a/cmake/findDependencies.cmake b/cmake/findDependencies.cmake
index bec2128a5..664522c2a 100644
--- a/cmake/findDependencies.cmake
+++ b/cmake/findDependencies.cmake
@@ -47,7 +47,7 @@ if( EXIV2_ENABLE_PNG )
endif( )
if( EXIV2_ENABLE_BMFF AND EXIV2_ENABLE_BROTLI )
- find_package( Brotli REQUIRED )
+ find_package( BROTLI NAMES unofficial-brotli CONFIG REQUIRED )
endif( )
if( EXIV2_ENABLE_WEBREADY )
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 15bab8c8a..3db5bdd08 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -240,8 +240,7 @@ if( EXIV2_ENABLE_PNG )
endif()
if( EXIV2_ENABLE_BMFF AND BROTLI_FOUND )
- target_link_libraries( exiv2lib PRIVATE ${Brotli_LIBRARIES})
- target_include_directories(exiv2lib PRIVATE ${Brotli_INCLUDE_DIRS})
+ target_link_libraries( exiv2lib PRIVATE unofficial::brotli::brotlidec)
list(APPEND requires_private_list "libbrotlidec")
endif()

View File

@ -1,25 +0,0 @@
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 85dd6cd..4967d8a 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -178,7 +178,7 @@ target_include_directories(exiv2lib SYSTEM PRIVATE
if (EXIV2_ENABLE_XMP OR EXIV2_ENABLE_EXTERNAL_XMP)
target_include_directories(exiv2lib PRIVATE ${EXPAT_INCLUDE_DIR})
- target_link_libraries(exiv2lib PRIVATE EXPAT::EXPAT)
+ target_link_libraries(exiv2lib PRIVATE expat::expat)
list(APPEND requires_private_list "expat")
endif()
diff --git a/xmpsdk/CMakeLists.txt b/xmpsdk/CMakeLists.txt
index 87c59c0..d2f23e6 100644
--- a/xmpsdk/CMakeLists.txt
+++ b/xmpsdk/CMakeLists.txt
@@ -31,6 +31,7 @@ target_include_directories(exiv2-xmp SYSTEM
${PROJECT_SOURCE_DIR}/xmpsdk/include
${EXPAT_INCLUDE_DIRS}
)
+target_link_libraries(exiv2-xmp PRIVATE expat::expat)
# Prevent a denial-service-attack related to XML entity expansion
# ("billion laughs attack").

View File

@ -1,16 +0,0 @@
diff --git a/cmake/findDependencies.cmake b/cmake/findDependencies.cmake
index ec3a43f..d8637cc 100644
--- a/cmake/findDependencies.cmake
+++ b/cmake/findDependencies.cmake
@@ -42,7 +42,10 @@ if (EXIV2_ENABLE_XMP AND EXIV2_ENABLE_EXTERNAL_XMP)
message(FATAL_ERROR "EXIV2_ENABLE_XMP AND EXIV2_ENABLE_EXTERNAL_XMP are mutually exclusive. You can only choose one of them")
else()
if (EXIV2_ENABLE_XMP)
- find_package(EXPAT REQUIRED)
+ find_package(EXPAT NAMES expat CONFIG REQUIRED)
+ set(EXPAT_INCLUDE_DIR "")
+ set(EXPAT_LIBRARY expat::expat)
+ set(EXPAT_LIBRARIES expat::expat)
elseif (EXIV2_ENABLE_EXTERNAL_XMP)
find_package(XmpSdk REQUIRED)
endif ()

View File

@ -1,32 +0,0 @@
diff --git a/cmake/findDependencies.cmake b/cmake/findDependencies.cmake
index 1075c3031..bec2128a5 100644
--- a/cmake/findDependencies.cmake
+++ b/cmake/findDependencies.cmake
@@ -77,7 +77,7 @@ if( ICONV_FOUND )
endif()
if( EXIV2_ENABLE_INIH )
- find_package(inih)
+ find_package(unofficial-inih CONFIG REQUIRED)
message ( "-- inih_INCLUDE_DIRS : " ${inih_INCLUDE_DIRS} )
message ( "-- inih_LIBRARIES : " ${inih_LIBRARIES} )
message ( "-- inih_inireader_INCLUDE_DIRS : " ${inih_inireader_INCLUDE_DIRS} )
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index dba7af99c..15bab8c8a 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -263,10 +263,10 @@ if( Iconv_FOUND AND Iconv_LIBRARIES )
endif()
if( EXIV2_ENABLE_INIH )
- target_link_libraries( exiv2lib_int PRIVATE inih::libinih )
- target_link_libraries( exiv2lib_int PRIVATE inih::inireader )
- target_link_libraries( exiv2lib PRIVATE inih::libinih )
- target_link_libraries( exiv2lib PRIVATE inih::inireader )
+ target_link_libraries( exiv2lib_int PRIVATE unofficial::inih::libinih )
+ target_link_libraries( exiv2lib_int PRIVATE unofficial::inih::inireader )
+ target_link_libraries( exiv2lib PRIVATE unofficial::inih::libinih )
+ target_link_libraries( exiv2lib PRIVATE unofficial::inih::inireader )
list(APPEND requires_private_list "INIReader")
endif()

View File

@ -1,31 +0,0 @@
diff --git a/src/futils.cpp b/src/futils.cpp
index 3e30c9996..c746838d5 100644
--- a/src/futils.cpp
+++ b/src/futils.cpp
@@ -38,6 +38,10 @@ namespace fs = std::experimental::filesystem;
#include <unistd.h> // for stat()
#endif
+#if __has_include(<mach-o/dyld.h>)
+#include <mach-o/dyld.h> // for _NSGetExecutablePath()
+#endif
+
#if defined(__FreeBSD__)
// clang-format off
#include <sys/mount.h>
@@ -360,9 +364,12 @@ std::string getProcessPath() {
TCHAR pathbuf[MAX_PATH];
GetModuleFileName(nullptr, pathbuf, MAX_PATH);
auto path = fs::path(pathbuf);
-#elif __has_include(<libproc.h>)
- char pathbuf[PROC_PIDPATHINFO_MAXSIZE];
- proc_pidpath(getpid(), pathbuf, sizeof(pathbuf));
+#elif defined(__APPLE__)
+ char pathbuf[2048];
+ uint32_t size = sizeof(pathbuf);
+ const int get_exec_path_failure = _NSGetExecutablePath(pathbuf, &size);
+ if (get_exec_path_failure)
+ return "unknown"; // pathbuf not big enough
auto path = fs::path(pathbuf);
#elif defined(__sun__)
auto path = fs::read_symlink(Internal::stringFormat("/proc/%d/path/a.out", getpid()));

View File

@ -2,14 +2,10 @@ vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO Exiv2/exiv2
REF "v${VERSION}"
SHA512 7b872a3c0cbe343014b1ca4618cecaf6ee8d78dec7ef83accfce95cb8eadc6b52116977a41e1f1be5c6149a47bdd9457fadc08d73708aa2a6ab69795fd3de23b
SHA512 c8338a118feefa104d73932890c732247c884ab9ce1d170c43a22ab5884517a0e2a7fd1febde7705b8290fbbbc29e64738610404816e4db2b56a70fc444ca049
HEAD_REF master
PATCHES
fix-find_expat.patch
fix-inih.patch
fix-brotli.patch
fix-expat.patch
dont-find-python.patch
dependencies.diff
)
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
@ -19,6 +15,9 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
nls EXIV2_ENABLE_NLS
bmff EXIV2_ENABLE_BMFF
)
if(VCPKG_TARGET_IS_UWP)
list(APPEND FEATURE_OPTIONS -DEXIV2_ENABLE_FILESYSTEM_ACCESS=OFF)
endif()
string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "dynamic" EXIV2_CRT_DYNAMIC)
@ -42,28 +41,18 @@ vcpkg_cmake_configure(
-DEXIV2_TEAM_WARNINGS_AS_ERRORS=OFF
-DEXIV2_TEAM_PACKAGING=OFF
-DEXIV2_TEAM_USE_SANITIZERS=OFF
-DCMAKE_DISABLE_FIND_PACKAGE_Python3=ON
)
vcpkg_cmake_install()
vcpkg_cmake_config_fixup(CONFIG_PATH share/cmake/exiv2)
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/exiv2)
vcpkg_fixup_pkgconfig()
configure_file(
${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake
${CURRENT_PACKAGES_DIR}/share/${PORT}
@ONLY
)
vcpkg_copy_pdbs()
file(REMOVE_RECURSE
"${CURRENT_PACKAGES_DIR}/debug/include"
"${CURRENT_PACKAGES_DIR}/debug/lib/exiv2"
"${CURRENT_PACKAGES_DIR}/debug/share"
"${CURRENT_PACKAGES_DIR}/lib/exiv2"
"${CURRENT_PACKAGES_DIR}/share/man"
)
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")
configure_file("${CMAKE_CURRENT_LIST_DIR}/usage" "${CURRENT_PACKAGES_DIR}/share/${PORT}/usage" COPYONLY)

View File

@ -1,4 +0,0 @@
exiv2 provides CMake targets:
find_package(exiv2 CONFIG REQUIRED)
target_link_libraries(main PRIVATE Exiv2::exiv2lib)

View File

@ -1,31 +0,0 @@
_find_package(${ARGS})
if("@VCPKG_LIBRARY_LINKAGE@" STREQUAL "static")
if(NOT "@VCPKG_TARGET_IS_WINDOWS@")
find_package(Iconv REQUIRED)
endif()
if("@EXIV2_ENABLE_NLS@")
find_package(Intl REQUIRED)
endif()
if("@EXIV2_ENABLE_BMFF@")
find_package(unofficial-brotli CONFIG REQUIRED)
endif()
if("@EXIV2_ENABLE_XMP@")
find_package(expat CONFIG REQUIRED)
endif()
if("@EXIV2_ENABLE_PNG@")
find_package( ZLIB REQUIRED )
endif()
find_package(unofficial-inih CONFIG REQUIRED)
if(TARGET exiv2lib)
if(NOT "@VCPKG_TARGET_IS_WINDOWS@")
set_property(TARGET exiv2lib APPEND PROPERTY INTERFACE_LINK_LIBRARIES Iconv::Iconv)
endif()
if("@EXIV2_ENABLE_NLS@")
set_property(TARGET exiv2lib APPEND PROPERTY INTERFACE_LINK_LIBRARIES
"\$<\$<NOT:\$<CONFIG:DEBUG>>:${Intl_LIBRARY_RELEASE}>"
"\$<\$<CONFIG:DEBUG>:${Intl_LIBRARY_DEBUG}>"
)
endif()
endif()
endif()

View File

@ -1,11 +1,10 @@
{
"name": "exiv2",
"version": "0.28.1",
"port-version": 1,
"version": "0.28.3",
"description": "Image metadata library and tools",
"homepage": "https://exiv2.org",
"license": "GPL-2.0-or-later",
"supports": "!uwp & !xbox",
"supports": "!xbox",
"dependencies": [
"inih",
{
@ -31,20 +30,19 @@
"nls": {
"description": "Build native language support",
"dependencies": [
"gettext",
{
"name": "gettext",
"host": true,
"features": [
"tools"
]
}
},
"gettext-libintl"
]
},
"png": {
"description": "Build with png support",
"dependencies": [
"libpng",
"zlib"
]
},

View File

@ -2581,8 +2581,8 @@
"port-version": 8
},
"exiv2": {
"baseline": "0.28.1",
"port-version": 1
"baseline": "0.28.3",
"port-version": 0
},
"expat": {
"baseline": "2.6.2",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "de2ac0ef00a055d813578d9bc93e25f05decf5df",
"version": "0.28.3",
"port-version": 0
},
{
"git-tree": "c718e83fc18023db2be57de6fb8873555aabdccb",
"version": "0.28.1",