From 8d29b2de925398c18a8f4372026956fd94fe92f0 Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Wed, 1 Sep 2021 23:54:13 -0700 Subject: [PATCH 01/11] [openimageio] Fix find and use dependencies --- ports/openimageio/fix-dependencies.patch | 75 +++++++++++++++++++++ ports/openimageio/portfile.cmake | 2 + ports/openimageio/vcpkg-cmake-wrapper.cmake | 2 +- ports/openimageio/vcpkg.json | 3 +- 4 files changed, 80 insertions(+), 2 deletions(-) create mode 100644 ports/openimageio/fix-dependencies.patch diff --git a/ports/openimageio/fix-dependencies.patch b/ports/openimageio/fix-dependencies.patch new file mode 100644 index 00000000000000..0d6c5ca39b0611 --- /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..182abb7 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 (TARGET png_static) ++ set(PNG_TARGET png_static) ++elseif (TARGET png) ++ set(PNG_TARGET png) ++endif() ++ ++if (libpng_FOUND) + 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 86c2899d8fd779..ee41dcf330ef51 100644 --- a/ports/openimageio/portfile.cmake +++ b/ports/openimageio/portfile.cmake @@ -14,6 +14,7 @@ vcpkg_from_github( PATCHES fix-config-cmake.patch fix_static_build.patch + fix-dependencies.patch ) file(REMOVE_RECURSE "${SOURCE_PATH}/ext") @@ -83,6 +84,7 @@ 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 "${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 diff --git a/ports/openimageio/vcpkg-cmake-wrapper.cmake b/ports/openimageio/vcpkg-cmake-wrapper.cmake index 688c83f3cc99d8..5976305769ad2c 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 c89d105d69b09e..59fe3727874324 100644 --- a/ports/openimageio/vcpkg.json +++ b/ports/openimageio/vcpkg.json @@ -1,7 +1,7 @@ { "name": "openimageio", "version": "2.2.17.0", - "port-version": 1, + "port-version": 2, "description": "A library for reading and writing images, and a bunch of related classes, utilities, and application.", "homepage": "https://github.com/OpenImageIO/oiio", "dependencies": [ @@ -22,6 +22,7 @@ "libheif", "libjpeg-turbo", "libpng", + "libsquish", "openexr", "robin-map", "tiff", From 225f82d61e96fc15db22419c865ecadec540167b Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Wed, 1 Sep 2021 23:54:57 -0700 Subject: [PATCH 02/11] version --- versions/baseline.json | 2 +- versions/o-/openimageio.json | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/versions/baseline.json b/versions/baseline.json index 2233413efcacc4..9d566eccef9e96 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -4690,7 +4690,7 @@ }, "openimageio": { "baseline": "2.2.17.0", - "port-version": 1 + "port-version": 2 }, "openjpeg": { "baseline": "2.3.1", diff --git a/versions/o-/openimageio.json b/versions/o-/openimageio.json index 97fa6210a7a997..5a8a4693ed41d8 100644 --- a/versions/o-/openimageio.json +++ b/versions/o-/openimageio.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "3cbcdb2f8d38815bd9c628f4f428679e1ed3b6b5", + "version": "2.2.17.0", + "port-version": 2 + }, { "git-tree": "1567eaa1f67e0996635f0d4213b55e9b97882acf", "version": "2.2.17.0", From cad3cc58ffec6a7cebbbe99c81c9c9d5f7f362b1 Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Wed, 1 Sep 2021 23:56:34 -0700 Subject: [PATCH 03/11] Restore FindOpenEXR.cmake --- ports/openimageio/portfile.cmake | 1 - 1 file changed, 1 deletion(-) diff --git a/ports/openimageio/portfile.cmake b/ports/openimageio/portfile.cmake index ee41dcf330ef51..04799fac33a2fe 100644 --- a/ports/openimageio/portfile.cmake +++ b/ports/openimageio/portfile.cmake @@ -20,7 +20,6 @@ vcpkg_from_github( file(REMOVE_RECURSE "${SOURCE_PATH}/ext") file(REMOVE "${SOURCE_PATH}/src/cmake/modules/FindLibRaw.cmake" - "${SOURCE_PATH}/src/cmake/modules/FindOpenEXR.cmake" "${SOURCE_PATH}/src/cmake/modules/FindOpenCV.cmake" "${SOURCE_PATH}/src/cmake/modules/FindFFmpeg.cmake") From 41ca3bb7b5be78137669d76052f4ccca99fea81a Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Wed, 1 Sep 2021 23:56:54 -0700 Subject: [PATCH 04/11] version --- versions/o-/openimageio.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/o-/openimageio.json b/versions/o-/openimageio.json index 5a8a4693ed41d8..178bb2ac422579 100644 --- a/versions/o-/openimageio.json +++ b/versions/o-/openimageio.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "3cbcdb2f8d38815bd9c628f4f428679e1ed3b6b5", + "git-tree": "9f421bd53327f1d197a1175e98a343300d604733", "version": "2.2.17.0", "port-version": 2 }, From f36bf6b760a7e2e72b9b8efcfe8b0561f3ed2e7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jack=C2=B7Boos=C2=B7Yu?= <47264268+JackBoosY@users.noreply.github.com> Date: Thu, 2 Sep 2021 17:15:01 +0800 Subject: [PATCH 05/11] Update ports/openimageio/portfile.cmake --- ports/openimageio/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/openimageio/portfile.cmake b/ports/openimageio/portfile.cmake index 04799fac33a2fe..99becd861abc40 100644 --- a/ports/openimageio/portfile.cmake +++ b/ports/openimageio/portfile.cmake @@ -84,7 +84,7 @@ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/doc" file(COPY "${SOURCE_PATH}/src/cmake/modules/FindOpenImageIO.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") +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) From 76a26c215945db0fae98d447464beb4b329d1c07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jack=C2=B7Boos=C2=B7Yu?= <47264268+JackBoosY@users.noreply.github.com> Date: Fri, 3 Sep 2021 13:40:26 +0800 Subject: [PATCH 06/11] Update versions/o-/openimageio.json --- versions/o-/openimageio.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/o-/openimageio.json b/versions/o-/openimageio.json index 178bb2ac422579..8aed7c039c534c 100644 --- a/versions/o-/openimageio.json +++ b/versions/o-/openimageio.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "9f421bd53327f1d197a1175e98a343300d604733", + "git-tree": "5e2d1ed44e9b26fc1283eb9a3ca14c2564d095e3", "version": "2.2.17.0", "port-version": 2 }, From b69ed3653bce6e636a2ab4f058168baeed035900 Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Tue, 7 Sep 2021 02:28:54 -0700 Subject: [PATCH 07/11] Re-make patch --- ports/openimageio/fix-dependencies.patch | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ports/openimageio/fix-dependencies.patch b/ports/openimageio/fix-dependencies.patch index 0d6c5ca39b0611..81b95ff9c6f49f 100644 --- a/ports/openimageio/fix-dependencies.patch +++ b/ports/openimageio/fix-dependencies.patch @@ -52,7 +52,7 @@ index fed8001..15e87ae 100644 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..182abb7 100644 +index 9ba76ac..13db4ac 100644 --- a/src/ico.imageio/CMakeLists.txt +++ b/src/ico.imageio/CMakeLists.txt @@ -2,9 +2,15 @@ @@ -60,13 +60,13 @@ index 9ba76ac..182abb7 100644 # https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md -if (TARGET PNG::PNG) -+if (TARGET png_static) -+ set(PNG_TARGET png_static) -+elseif (TARGET png) -+ set(PNG_TARGET png) -+endif() -+ +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) From 96197dd78b999a41f375351d862505bdef7efa9e Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Tue, 7 Sep 2021 02:29:20 -0700 Subject: [PATCH 08/11] version --- versions/o-/openimageio.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/o-/openimageio.json b/versions/o-/openimageio.json index 178bb2ac422579..bcda4d6d8e2cfc 100644 --- a/versions/o-/openimageio.json +++ b/versions/o-/openimageio.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "9f421bd53327f1d197a1175e98a343300d604733", + "git-tree": "be0e222ad1e0394f30553dfb112a04d7e6a5e1aa", "version": "2.2.17.0", "port-version": 2 }, From 79a18e3c9ff3a586e3242905f305814b2d7fb9b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jack=C2=B7Boos=C2=B7Yu?= <47264268+JackBoosY@users.noreply.github.com> Date: Tue, 7 Sep 2021 17:33:15 +0800 Subject: [PATCH 09/11] Update versions/o-/openimageio.json --- versions/o-/openimageio.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/o-/openimageio.json b/versions/o-/openimageio.json index bcda4d6d8e2cfc..5d3c20201cd7f3 100644 --- a/versions/o-/openimageio.json +++ b/versions/o-/openimageio.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "be0e222ad1e0394f30553dfb112a04d7e6a5e1aa", + "git-tree": "c627b98b5edc66758b3ea5a128292fd2f2a41393", "version": "2.2.17.0", "port-version": 2 }, From d0c54bc916da96c6e2ace9de29a41040a76716d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jack=C2=B7Boos=C2=B7Yu?= <47264268+JackBoosY@users.noreply.github.com> Date: Wed, 8 Sep 2021 10:44:07 +0800 Subject: [PATCH 10/11] Update ports/openimageio/portfile.cmake --- ports/openimageio/portfile.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/openimageio/portfile.cmake b/ports/openimageio/portfile.cmake index 99becd861abc40..ca9c2838481509 100644 --- a/ports/openimageio/portfile.cmake +++ b/ports/openimageio/portfile.cmake @@ -83,8 +83,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 "${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") +file(COPY "${SOURCE_PATH}/src/cmake/modules/FindLibsquish.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/OpenImageIO") +file(COPY "${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") # Handle copyright file(INSTALL "${SOURCE_PATH}/LICENSE.md" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) From a02f4dbbb1bcf8f59a6788ed8f735fb0e1885095 Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Tue, 7 Sep 2021 23:05:24 -0700 Subject: [PATCH 11/11] version --- versions/baseline.json | 7 +------ versions/o-/openimageio.json | 5 +++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/versions/baseline.json b/versions/baseline.json index f500011b371434..7af53be1be9633 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -4713,13 +4713,8 @@ "port-version": 1 }, "openimageio": { -<<<<<<< HEAD - "baseline": "2.2.17.0", - "port-version": 2 -======= "baseline": "2.3.7.2", - "port-version": 0 ->>>>>>> 615547c1d5b363d3586d2012c4cd7d075a0516b8 + "port-version": 1 }, "openjpeg": { "baseline": "2.3.1", diff --git a/versions/o-/openimageio.json b/versions/o-/openimageio.json index e68d13dda864e6..1ebf88c90a2816 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",