diff options
| author | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
|---|---|---|
| committer | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
| commit | 54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch) | |
| tree | d915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/exiv2 | |
Diffstat (limited to 'vcpkg/ports/exiv2')
| -rw-r--r-- | vcpkg/ports/exiv2/dependencies.diff | 80 | ||||
| -rw-r--r-- | vcpkg/ports/exiv2/portfile.cmake | 71 | ||||
| -rw-r--r-- | vcpkg/ports/exiv2/vcpkg.json | 63 |
3 files changed, 214 insertions, 0 deletions
diff --git a/vcpkg/ports/exiv2/dependencies.diff b/vcpkg/ports/exiv2/dependencies.diff new file mode 100644 index 0000000..de9e593 --- /dev/null +++ b/vcpkg/ports/exiv2/dependencies.diff @@ -0,0 +1,80 @@ +diff --git a/cmake/exiv2Config.cmake.in b/cmake/exiv2Config.cmake.in +index 09b46df..85badd2 100644 +--- a/cmake/exiv2Config.cmake.in ++++ b/cmake/exiv2Config.cmake.in +@@ -9,7 +9,7 @@ if(NOT @BUILD_SHARED_LIBS@) # if(NOT BUILD_SHARED_LIBS) + endif() + + if(@EXIV2_ENABLE_BMFF@ AND @EXIV2_ENABLE_BROTLI@) # if(EXIV2_ENABLE_BMFF AND EXIV2_ENABLE_BROTLI) +- find_package(Brotli QUIET) ++ find_dependency(Brotli NAMES unofficial-brotli) + if (NOT Brotli_FOUND) + message(FATAL_ERROR + "Static builds of exiv2 require Brotli. " +@@ -25,7 +25,7 @@ if(NOT @BUILD_SHARED_LIBS@) # if(NOT BUILD_SHARED_LIBS) + endif() + + if(@EXIV2_ENABLE_XMP@) # if(EXIV2_ENABLE_XMP) +- find_dependency(EXPAT REQUIRED) ++ find_dependency(EXPAT NAMES expat) + elseif(@EXIV2_ENABLE_EXTERNAL_XMP@) # elseif(EXIV2_ENABLE_EXTERNAL_XMP) + find_dependency(XmpSdk REQUIRED) + endif() +@@ -39,7 +39,7 @@ if(NOT @BUILD_SHARED_LIBS@) # if(NOT BUILD_SHARED_LIBS) + endif() + + if(@EXIV2_ENABLE_INIH@) # if(EXIV2_ENABLE_INIH) +- find_package(inih QUIET) ++ find_dependency(inih NAMES unofficial-inih) + if (NOT inih_FOUND) + message(FATAL_ERROR + "Static builds of exiv2 require inih. " +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} ) +diff --git a/xmpsdk/CMakeLists.txt b/xmpsdk/CMakeLists.txt +index 87c59c0..613c49b 100644 +--- a/xmpsdk/CMakeLists.txt ++++ b/xmpsdk/CMakeLists.txt +@@ -32,6 +32,8 @@ target_include_directories(exiv2-xmp SYSTEM + ${EXPAT_INCLUDE_DIRS} + ) + ++target_link_libraries(exiv2-xmp PRIVATE expat::expat) ++ + # Prevent a denial-service-attack related to XML entity expansion + # ("billion laughs attack"). + # See https://bugzilla.redhat.com/show_bug.cgi?id=888769 diff --git a/vcpkg/ports/exiv2/portfile.cmake b/vcpkg/ports/exiv2/portfile.cmake new file mode 100644 index 0000000..0089523 --- /dev/null +++ b/vcpkg/ports/exiv2/portfile.cmake @@ -0,0 +1,71 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO Exiv2/exiv2 + REF "v${VERSION}" + SHA512 b53f4989abcd5d346f2a9c726a06707c47e1990ecb2e5e193c963e01d452fefe4dddd14e25eb08ef35e2f8288b8ec4bdee60725aa7dcd6b1c0348ed56c803fc0 + HEAD_REF master + PATCHES + dependencies.diff +) + +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + bmff EXIV2_ENABLE_BMFF + nls EXIV2_ENABLE_NLS + png EXIV2_ENABLE_PNG + xmp EXIV2_ENABLE_XMP +) +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) + +vcpkg_add_to_path(PREPEND "${CURRENT_HOST_INSTALLED_DIR}/tools/gettext/bin") + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + ${FEATURE_OPTIONS} + -DEXIV2_BUILD_EXIV2_COMMAND=OFF + -DEXIV2_BUILD_UNIT_TESTS=OFF + -DEXIV2_BUILD_SAMPLES=OFF + -DEXIV2_BUILD_DOC=OFF + -DEXIV2_ENABLE_EXTERNAL_XMP=OFF + -DEXIV2_ENABLE_LENSDATA=ON + -DEXIV2_ENABLE_DYNAMIC_RUNTIME=${EXIV2_CRT_DYNAMIC} + -DEXIV2_ENABLE_WEBREADY=OFF + -DEXIV2_ENABLE_CURL=OFF + -DEXIV2_ENABLE_VIDEO=OFF + -DEXIV2_TEAM_EXTRA_WARNINGS=OFF + -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_copy_pdbs() +vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/exiv2) + +if(VCPKG_TARGET_IS_OSX AND "nls" IN_LIST FEATURES) + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/exiv2.pc" " -lintl" " -lintl -framework CoreFoundation") + if(NOT VCPKG_BUILD_TYPE) + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/exiv2.pc" " -lintl" " -lintl -framework CoreFoundation") + endif() +endif() +if(VCPKG_TARGET_IS_WINDOWS) + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/exiv2.pc" "Libs.private: " "Libs.private: -lpsapi ") + if(NOT VCPKG_BUILD_TYPE) + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/exiv2.pc" "Libs.private: " "Libs.private: -lpsapi ") + endif() +endif() +vcpkg_fixup_pkgconfig() + +file(REMOVE_RECURSE + "${CURRENT_PACKAGES_DIR}/debug/include" + "${CURRENT_PACKAGES_DIR}/debug/share" + "${CURRENT_PACKAGES_DIR}/share/man" +) + +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING") diff --git a/vcpkg/ports/exiv2/vcpkg.json b/vcpkg/ports/exiv2/vcpkg.json new file mode 100644 index 0000000..ba1695f --- /dev/null +++ b/vcpkg/ports/exiv2/vcpkg.json @@ -0,0 +1,63 @@ +{ + "name": "exiv2", + "version": "0.28.7", + "port-version": 1, + "description": "Image metadata library and tools", + "homepage": "https://exiv2.org", + "license": "GPL-2.0-or-later", + "supports": "!xbox", + "dependencies": [ + { + "name": "inih", + "default-features": false, + "features": [ + "cpp" + ] + }, + { + "name": "libiconv", + "platform": "!windows" + }, + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ], + "features": { + "bmff": { + "description": "Support for BMFF files (e.g., CR3, HEIF, HEIC, AVIF, and JPEG XL)", + "dependencies": [ + "brotli" + ] + }, + "nls": { + "description": "Build native language support", + "dependencies": [ + { + "name": "gettext", + "host": true, + "features": [ + "tools" + ] + }, + "gettext-libintl" + ] + }, + "png": { + "description": "Build with png support", + "dependencies": [ + "zlib" + ] + }, + "xmp": { + "description": "Build with XMP metadata support", + "dependencies": [ + "expat" + ] + } + } +} |