From 88727b4d8aa6acfd710b48941a8b940de141dc96 Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Wed, 25 Dec 2019 20:06:42 -0800 Subject: [PATCH] [openimageio] Remove feature ptex due to some link error. Fix dependencies opencv and webp. Merge fix dependency patches. --- ports/openimageio/CONTROL | 4 -- ports/openimageio/fix-dependency.patch | 61 +++++++++++++++++++ ports/openimageio/fix_libraw.patch | 13 ---- ports/openimageio/fix_static_build.patch | 2 +- ports/openimageio/portfile.cmake | 11 ++-- .../openimageio/use-vcpkg-find-openexr.patch | 24 -------- 6 files changed, 68 insertions(+), 47 deletions(-) create mode 100644 ports/openimageio/fix-dependency.patch delete mode 100644 ports/openimageio/fix_libraw.patch delete mode 100644 ports/openimageio/use-vcpkg-find-openexr.patch diff --git a/ports/openimageio/CONTROL b/ports/openimageio/CONTROL index f6da6cd9b4..04e78b8c74 100644 --- a/ports/openimageio/CONTROL +++ b/ports/openimageio/CONTROL @@ -36,10 +36,6 @@ Feature: openjpeg Build-Depends: openjpeg Description: Enable openjpeg support for openimageio -Feature: ptex -Build-Depends: ptex -Description: Enable ptex support for openimageio - Feature: webp Build-Depends: libwebp Description: Enable libwebp support for openimageio \ No newline at end of file diff --git a/ports/openimageio/fix-dependency.patch b/ports/openimageio/fix-dependency.patch new file mode 100644 index 0000000000..a0bac908b7 --- /dev/null +++ b/ports/openimageio/fix-dependency.patch @@ -0,0 +1,61 @@ +diff --git a/src/cmake/externalpackages.cmake b/src/cmake/externalpackages.cmake +index 2f4f7ce..4c49082 100644 +--- a/src/cmake/externalpackages.cmake ++++ b/src/cmake/externalpackages.cmake +@@ -169,10 +169,17 @@ checked_find_package (PNG REQUIRED) + checked_find_package (TIFF 3.0 REQUIRED) + + # IlmBase & OpenEXR ++find_package (Threads) ++if (CMAKE_USE_PTHREADS_INIT) ++ set (ILMBASE_PTHREADS ${CMAKE_THREAD_LIBS_INIT}) ++endif () + checked_find_package (OpenEXR 2.0 REQUIRED) + # We use Imath so commonly, may as well include it everywhere. +-include_directories ("${OPENEXR_INCLUDES}" "${ILMBASE_INCLUDES}" +- "${ILMBASE_INCLUDES}/OpenEXR") ++set(ILMBASE_LIBRARIES ${OPENEXR_IMATH_LIBRARY} ${OPENEXR_IEX_LIBRARY} ${OPENEXR_HALF_LIBRARY} ${OPENEXR_ILMTHREAD_LIBRARY} ${ILMBASE_PTHREADS} CACHE STRING "The libraries needed to use IlmBase") ++set(OPENEXR_LIBRARIES ${OPENEXR_ILMIMF_LIBRARY} ${ILMBASE_LIBRARIES} CACHE STRING "The libraries needed to use OpenEXR") ++set(ILMBASE_INCLUDE_DIR ${OPENEXR_INCLUDE_DIR}) ++set(ILMBASE_FOUND TRUE) ++include_directories ("${OPENEXR_INCLUDE_DIR}") + if (CMAKE_COMPILER_IS_CLANG AND OPENEXR_VERSION VERSION_LESS 2.3) + # clang C++ >= 11 doesn't like 'register' keyword in old exr headers + add_compile_options (-Wno-deprecated-register) +@@ -217,7 +224,7 @@ checked_find_package (HDF5 + ISDEPOF Field3D) + checked_find_package (OpenColorIO + DEFINITIONS -DUSE_OCIO=1 -DUSE_OPENCOLORIO=1) +-checked_find_package (OpenCV ++checked_find_package (OpenCV CONFIG + DEFINITIONS -DUSE_OPENCV=1) + + # Intel TBB +@@ -237,8 +244,12 @@ checked_find_package (OpenJpeg) + checked_find_package (OpenVDB 5.0 + DEPS TBB + DEFINITIONS -DUSE_OPENVDB=1) +-checked_find_package (PTex) +-checked_find_package (Webp) ++checked_find_package (ptex CONFIG) ++set(PTEX_FOUND ${ptex_FOUND}) ++set(PTEX_LIBRARIES Ptex::Ptex) ++checked_find_package (Webp CONFIG) ++set(WEBP_FOUND ${Webp_FOUND}) ++set(WEBP_LIBRARY WebP::webp WebP::webpdemux WebP::webpdecoder) + + option (USE_R3DSDK "Enable R3DSDK (RED camera) support" OFF) + checked_find_package (R3DSDK) # RED camera +diff --git a/src/raw.imageio/CMakeLists.txt b/src/raw.imageio/CMakeLists.txt +index 81a0ff5..23326a0 100644 +--- a/src/raw.imageio/CMakeLists.txt ++++ b/src/raw.imageio/CMakeLists.txt +@@ -5,7 +5,7 @@ + if (LIBRAW_FOUND) + add_oiio_plugin (rawinput.cpp + INCLUDE_DIRS ${LibRaw_INCLUDE_DIR} +- LINK_LIBRARIES ${LibRaw_r_LIBRARIES} ++ LINK_LIBRARIES ${LibRaw_LIBRARIES} + DEFINITIONS "-DUSE_LIBRAW=1") + else () + message (WARNING "Raw plugin will not be built") diff --git a/ports/openimageio/fix_libraw.patch b/ports/openimageio/fix_libraw.patch deleted file mode 100644 index 32e974fcba..0000000000 --- a/ports/openimageio/fix_libraw.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/src/raw.imageio/CMakeLists.txt b/src/raw.imageio/CMakeLists.txt -index 81a0ff5..23326a0 100644 ---- a/src/raw.imageio/CMakeLists.txt -+++ b/src/raw.imageio/CMakeLists.txt -@@ -5,7 +5,7 @@ - if (LIBRAW_FOUND) - add_oiio_plugin (rawinput.cpp - INCLUDE_DIRS ${LibRaw_INCLUDE_DIR} -- LINK_LIBRARIES ${LibRaw_r_LIBRARIES} -+ LINK_LIBRARIES ${LibRaw_LIBRARIES} - DEFINITIONS "-DUSE_LIBRAW=1") - else () - message (WARNING "Raw plugin will not be built") diff --git a/ports/openimageio/fix_static_build.patch b/ports/openimageio/fix_static_build.patch index 14b912b9ab..825026dc8b 100644 --- a/ports/openimageio/fix_static_build.patch +++ b/ports/openimageio/fix_static_build.patch @@ -7,7 +7,7 @@ index 4f4f31c..a18895e 100644 option (BUILD_SHARED_LIBS "Build shared libraries (set to OFF to build static libs)" ON) if (NOT BUILD_SHARED_LIBS) - add_definitions (-D${PROJECT_NAME}_STATIC_DEFINE=1) -+ add_definitions (-D${PROJECT_NAME}_STATIC_DEFINE=1 -DOIIO_STATIC_DEFINE=1) ++ add_definitions (-DOIIO_STATIC_DEFINE=1) endif () diff --git a/ports/openimageio/portfile.cmake b/ports/openimageio/portfile.cmake index 08ed70b363..9aef62de42 100644 --- a/ports/openimageio/portfile.cmake +++ b/ports/openimageio/portfile.cmake @@ -5,15 +5,16 @@ vcpkg_from_github( SHA512 1d076cb035b1b2cb603343465ed810ca47223211870d58f48c177d40d71a9cf82e53548b0c70127daf5dbd06f1b24772919e49e55110d914a542bcb62b99f6e8 HEAD_REF master PATCHES - fix_libraw.patch - use-vcpkg-find-openexr.patch + fix-dependency.patch fix_static_build.patch ) file(REMOVE_RECURSE "${SOURCE_PATH}/ext") -file(REMOVE "${SOURCE_PATH}/src/cmake/modules/FindLibRaw.cmake") -file(REMOVE "${SOURCE_PATH}/src/cmake/modules/FindOpenEXR.cmake") +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/FindWebp.cmake") file(MAKE_DIRECTORY "${SOURCE_PATH}/ext/robin-map/tsl") @@ -32,7 +33,6 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS gif USE_GIF opencv USE_OPENCV openjpeg USE_OPENJPEG - ptex USE_PTEX webp USE_WEBP ) @@ -47,6 +47,7 @@ vcpkg_configure_cmake( -DUSE_NUKE=OFF -DUSE_PYTHON=OFF -DUSE_QT=OFF + -DUSE_PTEX=OFF -DLINKSTATIC=${LINKSTATIC} -DBUILD_MISSING_PYBIND11=OFF -DBUILD_MISSING_DEPS=OFF diff --git a/ports/openimageio/use-vcpkg-find-openexr.patch b/ports/openimageio/use-vcpkg-find-openexr.patch deleted file mode 100644 index 507e7db845..0000000000 --- a/ports/openimageio/use-vcpkg-find-openexr.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff --git a/src/cmake/externalpackages.cmake b/src/cmake/externalpackages.cmake -index 2f4f7ce..eb40d91 100644 ---- a/src/cmake/externalpackages.cmake -+++ b/src/cmake/externalpackages.cmake -@@ -169,10 +169,17 @@ checked_find_package (PNG REQUIRED) - checked_find_package (TIFF 3.0 REQUIRED) - - # IlmBase & OpenEXR -+find_package (Threads) -+if (CMAKE_USE_PTHREADS_INIT) -+ set (ILMBASE_PTHREADS ${CMAKE_THREAD_LIBS_INIT}) -+endif () - checked_find_package (OpenEXR 2.0 REQUIRED) - # We use Imath so commonly, may as well include it everywhere. --include_directories ("${OPENEXR_INCLUDES}" "${ILMBASE_INCLUDES}" -- "${ILMBASE_INCLUDES}/OpenEXR") -+set(ILMBASE_LIBRARIES ${OPENEXR_IMATH_LIBRARY} ${OPENEXR_IEX_LIBRARY} ${OPENEXR_HALF_LIBRARY} ${OPENEXR_ILMTHREAD_LIBRARY} ${ILMBASE_PTHREADS} CACHE STRING "The libraries needed to use IlmBase") -+set(OPENEXR_LIBRARIES ${OPENEXR_ILMIMF_LIBRARY} ${ILMBASE_LIBRARIES} CACHE STRING "The libraries needed to use OpenEXR") -+set(ILMBASE_INCLUDE_DIR ${OPENEXR_INCLUDE_DIR}) -+set(ILMBASE_FOUND TRUE) -+include_directories ("${OPENEXR_INCLUDE_DIR}") - if (CMAKE_COMPILER_IS_CLANG AND OPENEXR_VERSION VERSION_LESS 2.3) - # clang C++ >= 11 doesn't like 'register' keyword in old exr headers - add_compile_options (-Wno-deprecated-register)