From 6e1219d080fc0525f55bf8c8ba57d8ab2ce35422 Mon Sep 17 00:00:00 2001 From: jim wang <122244446+jimwang118@users.noreply.github.com> Date: Wed, 20 Nov 2024 02:58:03 +0000 Subject: [PATCH] [openimageio] Update to 3.0.0.3 (#42175) --- ports/openimageio/fix-dependencies.patch | 76 ++++++++++--------- ports/openimageio/fix-dependency-libraw.patch | 14 ---- ports/openimageio/fix-openexr-dll.patch | 13 ---- .../fix-openexr-target-missing.patch | 18 ++--- ports/openimageio/imath-version-guard.patch | 11 +-- ports/openimageio/portfile.cmake | 9 ++- ports/openimageio/vcpkg.json | 4 +- ports/theia/fix-last-openimageio.patch | 44 +++++++++++ ports/theia/portfile.cmake | 7 +- ports/theia/vcpkg.json | 2 +- versions/baseline.json | 6 +- versions/o-/openimageio.json | 5 ++ versions/t-/theia.json | 5 ++ 13 files changed, 126 insertions(+), 88 deletions(-) delete mode 100644 ports/openimageio/fix-dependency-libraw.patch delete mode 100644 ports/openimageio/fix-openexr-dll.patch create mode 100644 ports/theia/fix-last-openimageio.patch diff --git a/ports/openimageio/fix-dependencies.patch b/ports/openimageio/fix-dependencies.patch index 9af314c270..cc0c9a2d17 100644 --- a/ports/openimageio/fix-dependencies.patch +++ b/ports/openimageio/fix-dependencies.patch @@ -1,10 +1,11 @@ -diff -u -r a/src/cmake/Config.cmake.in b/src/cmake/Config.cmake.in +diff --git a/src/cmake/Config.cmake.in b/src/cmake/Config.cmake.in +index ceaea62..2a2a359 100644 --- a/src/cmake/Config.cmake.in +++ b/src/cmake/Config.cmake.in -@@ -6,6 +6,30 @@ - +@@ -6,6 +6,33 @@ + include(CMakeFindDependencyMacro) - + +find_dependency(Boost COMPONENTS @Boost_COMPONENTS@) +if(@USE_GIF@) + find_dependency(GIF) @@ -28,60 +29,61 @@ diff -u -r a/src/cmake/Config.cmake.in b/src/cmake/Config.cmake.in +if(@USE_WEBP@) + find_dependency(WebP CONFIG) +endif() ++if(@USE_LIBRAW@) ++ find_dependency(LibRaw) ++endif() + # add here all the find_dependency() whenever switching to config based dependencies if (NOT @OPENIMAGEIO_CONFIG_DO_NOT_FIND_IMATH@ AND NOT OPENIMAGEIO_CONFIG_DO_NOT_FIND_IMATH) - if (@OpenEXR_VERSION@ VERSION_GREATER_EQUAL 3.0) -diff -u -r a/src/cmake/externalpackages.cmake b/src/cmake/externalpackages.cmake + find_dependency(Imath @Imath_VERSION@ +diff --git a/src/cmake/externalpackages.cmake b/src/cmake/externalpackages.cmake +index f8670a8..816ba08 100644 --- a/src/cmake/externalpackages.cmake +++ b/src/cmake/externalpackages.cmake -@@ -177,10 +177,13 @@ - checked_find_package (Freetype - DEFINITIONS -DUSE_FREETYPE=1 ) +@@ -125,16 +125,18 @@ checked_find_package (Freetype + VERSION_MIN 2.10.0 + DEFINITIONS USE_FREETYPE=1 ) --checked_find_package (OpenColorIO +-checked_find_package (OpenColorIO REQUIRED +- VERSION_MIN 2.2 +- VERSION_MAX 2.9 +- ) ++find_package(OpenColorIO CONFIG REQUIRED) +set(OPENCOLORIO_INCLUDES "") +set(OPENCOLORIO_LIBRARIES OpenColorIO::OpenColorIO) -+checked_find_package (OpenColorIO CONFIG - DEFINITIONS -DUSE_OCIO=1 -DUSE_OPENCOLORIO=1 - # PREFER_CONFIG - ) -+set(OPENCOLORIO_FOUND "${OpenColorIO_FOUND}") - if (OpenColorIO_FOUND) - option (OIIO_DISABLE_BUILTIN_OCIO_CONFIGS - "For deveoper debugging/testing ONLY! Disable OCIO 2.2 builtin configs." OFF) -@@ -191,7 +194,9 @@ - set (OpenColorIO_FOUND 0) ++checked_find_package (OpenColorIO CONFIG) + if (NOT OPENCOLORIO_INCLUDES) + get_target_property(OPENCOLORIO_INCLUDES OpenColorIO::OpenColorIO INTERFACE_INCLUDE_DIRECTORIES) endif () + include_directories(BEFORE ${OPENCOLORIO_INCLUDES}) --checked_find_package (OpenCV 3.0 +-checked_find_package (OpenCV 4.0 +set(OPENCV_INCLUDES "") +set(OPENCV_LIBRARIES opencv_core) +checked_find_package (OpenCV CONFIG - DEFINITIONS -DUSE_OPENCV=1) + DEFINITIONS USE_OPENCV=1) # Intel TBB -@@ -205,12 +210,16 @@ - PREFER_CONFIG) +@@ -146,11 +148,15 @@ checked_find_package (TBB 2017 + # DCMTK is used to read DICOM images + checked_find_package (DCMTK CONFIG VERSION_MIN 3.6.1) --checked_find_package (FFmpeg VERSION_MIN 3.0) +-checked_find_package (FFmpeg VERSION_MIN 4.0) +checked_find_package (FFmpeg) +set(FFmpeg_FOUND "${FFMPEG_FOUND}") +set(FFMPEG_INCLUDES "${FFMPEG_INCLUDE_DIRS}") - checked_find_package (GIF - VERSION_MIN 4 - RECOMMEND_MIN 5.0 - RECOMMEND_MIN_REASON "for stability and thread safety") + + checked_find_package (GIF VERSION_MIN 5.0) # For HEIF/HEIC/AVIF formats +set(LIBHEIF_INCLUDES "") +set(LIBHEIF_LIBRARIES heif) - checked_find_package (Libheif VERSION_MIN 1.3 + checked_find_package (Libheif VERSION_MIN 1.11 RECOMMEND_MIN 1.16 RECOMMEND_MIN_REASON "for orientation support") -@@ -231,9 +240,8 @@ - # set (LIBRAW_FOUND 0) - endif () +@@ -159,9 +165,8 @@ checked_find_package (LibRaw + VERSION_MIN 0.20.0 + PRINT LibRaw_r_LIBRARIES) -checked_find_package (OpenJPEG VERSION_MIN 2.0 - RECOMMEND_MIN 2.2 @@ -91,12 +93,12 @@ diff -u -r a/src/cmake/externalpackages.cmake b/src/cmake/externalpackages.cmake # Note: Recent OpenJPEG versions have exported cmake configs, but we don't # find them reliable at all, so we stick to our FindOpenJPEG.cmake module. -@@ -255,6 +263,8 @@ +@@ -178,6 +183,8 @@ if (NOT Ptex_FOUND OR NOT Ptex_VERSION) checked_find_package (Ptex) endif () +set(WEBP_INCLUDES "") +set(WEBP_LIBRARIES WebP::webp WebP::webpdemux) - checked_find_package (WebP) - # Note: When WebP 1.1 (released late 2019) is our minimum, we can use their - # exported configs and remove our FindWebP.cmake module. + checked_find_package (WebP VERSION_MIN 1.1) + + option (USE_R3DSDK "Enable R3DSDK (RED camera) support" OFF) diff --git a/ports/openimageio/fix-dependency-libraw.patch b/ports/openimageio/fix-dependency-libraw.patch deleted file mode 100644 index 1c006bb978..0000000000 --- a/ports/openimageio/fix-dependency-libraw.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/src/cmake/Config.cmake.in b/src/cmake/Config.cmake.in -index 4aee211..fa71d86 100644 ---- a/src/cmake/Config.cmake.in -+++ b/src/cmake/Config.cmake.in -@@ -25,6 +25,9 @@ endif() - if(@USE_WEBP@) - find_dependency(WebP CONFIG) - endif() -+if(@USE_LIBRAW@) -+ find_dependency(LibRaw) -+endif() - - # add here all the find_dependency() whenever switching to config based dependencies - if (NOT @OPENIMAGEIO_CONFIG_DO_NOT_FIND_IMATH@ AND NOT OPENIMAGEIO_CONFIG_DO_NOT_FIND_IMATH) diff --git a/ports/openimageio/fix-openexr-dll.patch b/ports/openimageio/fix-openexr-dll.patch deleted file mode 100644 index d5b7d8c7d4..0000000000 --- a/ports/openimageio/fix-openexr-dll.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/src/cmake/externalpackages.cmake b/src/cmake/externalpackages.cmake -index 0ca1fe6..1eeb5ab 100644 ---- a/src/cmake/externalpackages.cmake -+++ b/src/cmake/externalpackages.cmake -@@ -105,7 +105,7 @@ checked_find_package (OpenEXR REQUIRED - # building against Imath/OpenEXR 3.x when there is still a system-level - # install version of 2.x. - include_directories(BEFORE ${IMATH_INCLUDES} ${OPENEXR_INCLUDES}) --if (MSVC AND NOT LINKSTATIC) -+if (WIN32 AND BUILD_SHARED_LIBS) - add_definitions (-DOPENEXR_DLL) # Is this needed for new versions? - endif () - if (OpenEXR_VERSION VERSION_GREATER_EQUAL 3.0) diff --git a/ports/openimageio/fix-openexr-target-missing.patch b/ports/openimageio/fix-openexr-target-missing.patch index ef16615df2..b996c7b19a 100644 --- a/ports/openimageio/fix-openexr-target-missing.patch +++ b/ports/openimageio/fix-openexr-target-missing.patch @@ -1,13 +1,13 @@ diff --git a/src/cmake/Config.cmake.in b/src/cmake/Config.cmake.in -index 08401a2..4f2694e 100644 +index 9ee9c9d..6b9e7c2 100644 --- a/src/cmake/Config.cmake.in +++ b/src/cmake/Config.cmake.in -@@ -24,6 +24,8 @@ if (NOT @OPENIMAGEIO_CONFIG_DO_NOT_FIND_IMATH@ AND NOT OPENIMAGEIO_CONFIG_DO_NOT - if (@OpenEXR_VERSION@ VERSION_GREATER_EQUAL 3.0) - find_dependency(Imath @Imath_VERSION@ - HINTS @Imath_DIR@) -+ find_dependency(OpenEXR @OpenEXR_VERSION@ +@@ -31,6 +31,8 @@ endif() + if (NOT @OPENIMAGEIO_CONFIG_DO_NOT_FIND_IMATH@ AND NOT OPENIMAGEIO_CONFIG_DO_NOT_FIND_IMATH) + find_dependency(Imath @Imath_VERSION@ + HINTS @Imath_DIR@) ++ find_dependency(OpenEXR @OpenEXR_VERSION@ + HINTS @OpenEXR_DIR@) - elseif (@OpenEXR_VERSION@ VERSION_GREATER_EQUAL 2.4 AND @FOUND_OPENEXR_WITH_CONFIG@) - find_dependency(IlmBase @OpenEXR_VERSION@ - HINTS @IlmBase_DIR@ @OpenEXR_DIR@) + endif () + + if (NOT @fmt_LOCAL_BUILD@ AND NOT @OIIO_INTERNALIZE_FMT@) diff --git a/ports/openimageio/imath-version-guard.patch b/ports/openimageio/imath-version-guard.patch index 00a1e43e6b..10af02ea41 100644 --- a/ports/openimageio/imath-version-guard.patch +++ b/ports/openimageio/imath-version-guard.patch @@ -1,15 +1,16 @@ -diff -u -r a/src/cmake/externalpackages.cmake b/src/cmake/externalpackages.cmake +diff --git a/src/cmake/externalpackages.cmake b/src/cmake/externalpackages.cmake +index 816ba08..7fe6a14 100644 --- a/src/cmake/externalpackages.cmake +++ b/src/cmake/externalpackages.cmake -@@ -193,6 +193,11 @@ - else () - set (OpenColorIO_FOUND 0) +@@ -133,6 +133,11 @@ if (NOT OPENCOLORIO_INCLUDES) + get_target_property(OPENCOLORIO_INCLUDES OpenColorIO::OpenColorIO INTERFACE_INCLUDE_DIRECTORIES) endif () + include_directories(BEFORE ${OPENCOLORIO_INCLUDES}) +if(USE_OPENCOLORIO AND TARGET Imath::Imath AND OIIO_USING_IMATH STREQUAL "2") + message(FATAL_ERROR + "OpenColorIO and OpenEXR use incompatible versions of Imath. " + "You cannot use openimageio[opencolorio] for this configuration.") +endif() - + set(OPENCV_INCLUDES "") set(OPENCV_LIBRARIES opencv_core) diff --git a/ports/openimageio/portfile.cmake b/ports/openimageio/portfile.cmake index e191800cc7..a9a6184df6 100644 --- a/ports/openimageio/portfile.cmake +++ b/ports/openimageio/portfile.cmake @@ -2,16 +2,14 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO AcademySoftwareFoundation/OpenImageIO REF "v${VERSION}" - SHA512 1e24d7ffc3ad65a1fe1f53ae59006de912c0a8d85827d64671fab95350977e22e2d147cf26ffe362646c768747ec11e6f9aeae04ea66030f82ad597adf3135a5 + SHA512 16d357fc6f75d39b1c9265edb45fe78dd2ea67a094885174a0a2bdd39ad19f8f69c16a7aaacac82a106a295e08e311d0315daafcb5641c24f644a52e66aaf667 HEAD_REF master PATCHES fix-dependencies.patch fix-static-ffmpeg.patch - fix-openexr-dll.patch imath-version-guard.patch fix-openimageio_include_dir.patch fix-openexr-target-missing.patch - fix-dependency-libraw.patch ) file(REMOVE_RECURSE "${SOURCE_PATH}/ext") @@ -70,6 +68,11 @@ vcpkg_cmake_configure( MAYBE_UNUSED_VARIABLES ENABLE_INSTALL_testtex ENABLE_IV + BUILD_MISSING_DEPS + BUILD_MISSING_FMT + BUILD_MISSING_ROBINMAP + INTERNALIZE_FMT + REQUIRED_DEPS ) vcpkg_cmake_install() diff --git a/ports/openimageio/vcpkg.json b/ports/openimageio/vcpkg.json index cd17dccc7a..23ef9cd91c 100644 --- a/ports/openimageio/vcpkg.json +++ b/ports/openimageio/vcpkg.json @@ -1,7 +1,6 @@ { "name": "openimageio", - "version": "2.5.16.0", - "port-version": 1, + "version": "3.0.0.3", "description": "A library for reading and writing images, and a bunch of related classes, utilities, and application.", "homepage": "https://github.com/OpenImageIO/oiio", "license": "BSD-3-Clause", @@ -22,6 +21,7 @@ "fmt", "libjpeg-turbo", "libpng", + "opencolorio", "openexr", "robin-map", { diff --git a/ports/theia/fix-last-openimageio.patch b/ports/theia/fix-last-openimageio.patch new file mode 100644 index 0000000000..21c596fa72 --- /dev/null +++ b/ports/theia/fix-last-openimageio.patch @@ -0,0 +1,44 @@ +diff --git a/src/theia/image/image.cc b/src/theia/image/image.cc +index 6175a1f..18cb59b 100644 +--- a/src/theia/image/image.cc ++++ b/src/theia/image/image.cc +@@ -296,7 +296,7 @@ FloatImage FloatImage::ComputeGradient() const { + + void FloatImage::ApproximateGaussianBlur(const int kernel_size) { + oiio::ImageBuf kernel; +- oiio::ImageBufAlgo::make_kernel(kernel, "gaussian", ++ oiio::ImageBufAlgo::make_kernel("gaussian", + static_cast(kernel_size), + static_cast(kernel_size)); + oiio::ImageBufAlgo::convolve(image_, image_, kernel); +diff --git a/src/theia/sfm/exif_reader.cc b/src/theia/sfm/exif_reader.cc +index c63465a..6b0e702 100644 +--- a/src/theia/sfm/exif_reader.cc ++++ b/src/theia/sfm/exif_reader.cc +@@ -150,7 +150,7 @@ bool ExifReader::ExtractEXIFMetadata( + camera_intrinsics_prior->focal_length.is_set = true; + + // Set GPS latitude. +- const oiio::ImageIOParameter* latitude = ++ const OIIO::ParamValue* latitude = + image_spec.find_attribute("GPS:Latitude"); + if (latitude != nullptr) { + camera_intrinsics_prior->latitude.is_set = true; +@@ -169,7 +169,7 @@ bool ExifReader::ExtractEXIFMetadata( + } + + // Set GPS longitude. +- const oiio::ImageIOParameter* longitude = ++ const OIIO::ParamValue* longitude = + image_spec.find_attribute("GPS:Longitude"); + if (longitude != nullptr) { + camera_intrinsics_prior->longitude.is_set = true; +@@ -189,7 +189,7 @@ bool ExifReader::ExtractEXIFMetadata( + + + // Set GSP altitude. +- const oiio::ImageIOParameter* altitude = ++ const OIIO::ParamValue* altitude = + image_spec.find_attribute("GPS:Altitude"); + if (altitude != nullptr) { + camera_intrinsics_prior->altitude.is_set = true; diff --git a/ports/theia/portfile.cmake b/ports/theia/portfile.cmake index 3e7c8eb72c..a16ee7c460 100644 --- a/ports/theia/portfile.cmake +++ b/ports/theia/portfile.cmake @@ -11,6 +11,7 @@ vcpkg_from_github( fix-external-dependencies2.patch eigen-3.4.patch 266.diff + fix-last-openimageio.patch ) file(REMOVE "${SOURCE_PATH}/cmake/FindSuiteSparse.cmake") @@ -30,6 +31,10 @@ vcpkg_cmake_configure( -DTHEIA_USE_EXTERNAL_FLANN=ON -DCMAKE_POLICY_DEFAULT_CMP0012=NEW -DCMAKE_POLICY_DEFAULT_CMP0057=NEW + MAYBE_UNUSED_VARIABLES + CMAKE_POLICY_DEFAULT_CMP0012 + THEIA_USE_EXTERNAL_CEREAL + THEIA_USE_EXTERNAL_FLANN ) vcpkg_cmake_install() @@ -47,5 +52,5 @@ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include/theia/libraries/akaze/datas file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include/theia/libraries/spectra/doxygen") # Handle copyright -file(INSTALL "${SOURCE_PATH}/license.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/license.txt") file(COPY "${SOURCE_PATH}/data/camera_sensor_database_license.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") diff --git a/ports/theia/vcpkg.json b/ports/theia/vcpkg.json index dba87ad56d..448ffaab3d 100644 --- a/ports/theia/vcpkg.json +++ b/ports/theia/vcpkg.json @@ -1,7 +1,7 @@ { "name": "theia", "version": "0.8", - "port-version": 11, + "port-version": 12, "description": "An open source library for multiview geometry and structure from motion", "homepage": "https://github.com/sweeneychris/TheiaSfM", "license": "BSD-3-Clause", diff --git a/versions/baseline.json b/versions/baseline.json index 6cf9fad4d0..8e0bc51a9f 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -6697,8 +6697,8 @@ "port-version": 4 }, "openimageio": { - "baseline": "2.5.16.0", - "port-version": 1 + "baseline": "3.0.0.3", + "port-version": 0 }, "openjpeg": { "baseline": "2.5.2", @@ -8894,7 +8894,7 @@ }, "theia": { "baseline": "0.8", - "port-version": 11 + "port-version": 12 }, "think-cell-range": { "baseline": "2023.1", diff --git a/versions/o-/openimageio.json b/versions/o-/openimageio.json index 7a908fde5e..aaa072abdd 100644 --- a/versions/o-/openimageio.json +++ b/versions/o-/openimageio.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "92a3a8f30923e5f433c6c4123a8bd6062a2c0646", + "version": "3.0.0.3", + "port-version": 0 + }, { "git-tree": "d9bbe547fec5d39df8a0ac27a2e66b4ba4f2f598", "version": "2.5.16.0", diff --git a/versions/t-/theia.json b/versions/t-/theia.json index 29c39f4648..6da34965a1 100644 --- a/versions/t-/theia.json +++ b/versions/t-/theia.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "fcce9342a3c7301139dd9d9a388657d99fdcc159", + "version": "0.8", + "port-version": 12 + }, { "git-tree": "f05ea8c0e0055843afe42b688e3b55af9218d62a", "version": "0.8",