diff --git a/ports/openimageio/fix-dependencies.patch b/ports/openimageio/fix-dependencies.patch new file mode 100644 index 00000000000..81b95ff9c6f --- /dev/null +++ b/ports/openimageio/fix-dependencies.patch @@ -0,0 +1,75 @@ +diff --git a/src/cmake/Config.cmake.in b/src/cmake/Config.cmake.in +index 740da06..1a326f7 100644 +--- a/src/cmake/Config.cmake.in ++++ b/src/cmake/Config.cmake.in +@@ -11,6 +11,9 @@ elseif (@OpenEXR_VERSION@ VERSION_GREATER_EQUAL 2.4 AND @FOUND_OPENEXR_WITH_CONF + HINTS @IlmBase_DIR@ @OpenEXR_DIR@) + find_dependency(OpenEXR @OpenEXR_VERSION@ + HINTS @OpenEXR_DIR@) ++ find_dependency(libpng CONFIG) ++ find_dependency(libheif CONFIG) ++ find_dependency(Libsquish) + find_dependency(ZLIB @ZLIB_VERSION@) # Because OpenEXR doesn't do it + find_dependency(Threads) # Because OpenEXR doesn't do it + endif () +diff --git a/src/cmake/externalpackages.cmake b/src/cmake/externalpackages.cmake +index 21e18b5..badee4b 100644 +--- a/src/cmake/externalpackages.cmake ++++ b/src/cmake/externalpackages.cmake +@@ -151,7 +151,7 @@ find_python() + # Dependencies for optional formats and features. If these are not found, + # we will continue building, but the related functionality will be disabled. + +-checked_find_package (PNG) ++checked_find_package (png PREFER_CONFIG) + + checked_find_package (BZip2) # Used by ffmpeg and freetype + if (NOT BZIP2_FOUND) +@@ -185,7 +185,8 @@ checked_find_package (GIF + RECOMMEND_MIN_REASON "for stability and thread safety") + + # For HEIF/HEIC/AVIF formats +-checked_find_package (Libheif VERSION_MIN 1.3 ++checked_find_package (libheif VERSION_MIN 1.3 ++ PREFER_CONFIG + RECOMMEND_MIN 1.7 + RECOMMEND_MIN_REASON "for AVIF support") + if (APPLE AND LIBHEIF_VERSION VERSION_GREATER_EQUAL 1.10 AND LIBHEIF_VERSION VERSION_LESS 1.11) +diff --git a/src/heif.imageio/CMakeLists.txt b/src/heif.imageio/CMakeLists.txt +index fed8001..15e87ae 100644 +--- a/src/heif.imageio/CMakeLists.txt ++++ b/src/heif.imageio/CMakeLists.txt +@@ -2,9 +2,9 @@ + # SPDX-License-Identifier: BSD-3-Clause + # https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md + +-if (Libheif_FOUND) ++if (libheif_FOUND) + add_oiio_plugin (heifinput.cpp heifoutput.cpp +- LINK_LIBRARIES Libheif::Libheif ++ LINK_LIBRARIES heif + DEFINITIONS "-DUSE_HEIF=1") + else () + message (WARNING "heif plugin will not be built") +diff --git a/src/ico.imageio/CMakeLists.txt b/src/ico.imageio/CMakeLists.txt +index 9ba76ac..13db4ac 100644 +--- a/src/ico.imageio/CMakeLists.txt ++++ b/src/ico.imageio/CMakeLists.txt +@@ -2,9 +2,15 @@ + # SPDX-License-Identifier: BSD-3-Clause + # https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md + +-if (TARGET PNG::PNG) ++if (libpng_FOUND) ++ if (TARGET png_static) ++ set(PNG_TARGET png_static) ++ elseif (TARGET png) ++ set(PNG_TARGET png) ++ endif() ++ + add_oiio_plugin (icoinput.cpp icooutput.cpp +- LINK_LIBRARIES PNG::PNG ZLIB::ZLIB) ++ LINK_LIBRARIES ${PNG_TARGET} ZLIB::ZLIB) + else () + message (WARNING "libpng not found, so ICO support will not work") + set (format_plugin_definitions ${format_plugin_definitions} DISABLE_ICO=1 PARENT_SCOPE) diff --git a/ports/openimageio/portfile.cmake b/ports/openimageio/portfile.cmake index 496ec5c437d..cd4ce9c5258 100644 --- a/ports/openimageio/portfile.cmake +++ b/ports/openimageio/portfile.cmake @@ -15,6 +15,7 @@ vcpkg_from_github( fix-config-cmake.patch fix_static_build.patch disable-test.patch + fix-dependencies.patch ) file(REMOVE_RECURSE "${SOURCE_PATH}/ext") @@ -84,7 +85,8 @@ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/doc" "${CURRENT_PACKAGES_DIR}/debug/share") file(COPY "${SOURCE_PATH}/src/cmake/modules/FindOpenImageIO.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/OpenImageIO") -file(COPY "${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/OpenImageIO") +file(COPY "${SOURCE_PATH}/src/cmake/modules/FindLibsquish.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") +file(COPY "${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/openimageio") # Handle copyright file(INSTALL "${SOURCE_PATH}/LICENSE.md" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/ports/openimageio/vcpkg-cmake-wrapper.cmake b/ports/openimageio/vcpkg-cmake-wrapper.cmake index 688c83f3cc9..5976305769a 100644 --- a/ports/openimageio/vcpkg-cmake-wrapper.cmake +++ b/ports/openimageio/vcpkg-cmake-wrapper.cmake @@ -1,5 +1,5 @@ set(OPENIMAGEIO_PREV_MODULE_PATH ${CMAKE_MODULE_PATH}) -list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/../OpenImageIO") _find_package(${ARGS}) diff --git a/ports/openimageio/vcpkg.json b/ports/openimageio/vcpkg.json index 78ab842b927..cb30bf6f82f 100644 --- a/ports/openimageio/vcpkg.json +++ b/ports/openimageio/vcpkg.json @@ -1,6 +1,7 @@ { "name": "openimageio", "version": "2.3.7.2", + "port-version": 1, "description": "A library for reading and writing images, and a bunch of related classes, utilities, and application.", "homepage": "https://github.com/OpenImageIO/oiio", "dependencies": [ @@ -21,6 +22,7 @@ "libheif", "libjpeg-turbo", "libpng", + "libsquish", "openexr", "robin-map", "tiff", diff --git a/versions/baseline.json b/versions/baseline.json index 598acc44776..ac2efba1cbe 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -4714,7 +4714,7 @@ }, "openimageio": { "baseline": "2.3.7.2", - "port-version": 0 + "port-version": 1 }, "openjpeg": { "baseline": "2.3.1", diff --git a/versions/o-/openimageio.json b/versions/o-/openimageio.json index e68d13dda86..1ebf88c90a2 100644 --- a/versions/o-/openimageio.json +++ b/versions/o-/openimageio.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "799ea36f0486224257ecfea149b429d81e74a879", + "version": "2.3.7.2", + "port-version": 1 + }, { "git-tree": "6da138c7530d19649391636a660a06aac51db135", "version": "2.3.7.2",