From 183e41aa33eeca3a37964e41bf3fd8044067d675 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?MACHIZAUD=20Andr=C3=A9a?= Date: Wed, 12 Feb 2020 08:36:08 +0100 Subject: [PATCH 1/2] [openimageio] Bump to 2.1.11.2 --- ports/openimageio/CONTROL | 4 ++-- ports/openimageio/fix-config-cmake.patch | 12 ------------ ports/openimageio/fix-dependency.patch | 4 ++-- ports/openimageio/fix_static_build.patch | 13 ------------- ports/openimageio/portfile.cmake | 6 ++---- 5 files changed, 6 insertions(+), 33 deletions(-) delete mode 100644 ports/openimageio/fix-config-cmake.patch delete mode 100644 ports/openimageio/fix_static_build.patch diff --git a/ports/openimageio/CONTROL b/ports/openimageio/CONTROL index 728f22a6ba5fe1..950537d84114d6 100644 --- a/ports/openimageio/CONTROL +++ b/ports/openimageio/CONTROL @@ -1,5 +1,5 @@ Source: openimageio -Version: 2.1.9.0 +Version: 2.1.11.2 Homepage: https://github.com/OpenImageIO/oiio Description: A library for reading and writing images, and a bunch of related classes, utilities, and application Build-Depends: libjpeg-turbo, tiff, libpng, openexr, boost-thread, boost-smart-ptr, boost-foreach, boost-regex, boost-type-traits, boost-static-assert, boost-unordered, boost-config, boost-algorithm, boost-filesystem, boost-system, boost-thread, boost-asio, boost-random, robin-map, boost-stacktrace @@ -45,4 +45,4 @@ Build-Depends: pybind11 Description: Enable Python bindings support for openimageio Feature: tools -Description: Build openimageio tools \ No newline at end of file +Description: Build openimageio tools diff --git a/ports/openimageio/fix-config-cmake.patch b/ports/openimageio/fix-config-cmake.patch deleted file mode 100644 index f61afccbd8ba6b..00000000000000 --- a/ports/openimageio/fix-config-cmake.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/src/cmake/Config.cmake.in b/src/cmake/Config.cmake.in -index c6e1a13..3d784f3 100644 ---- a/src/cmake/Config.cmake.in -+++ b/src/cmake/Config.cmake.in -@@ -6,5 +6,5 @@ include(CMakeFindDependencyMacro) - # e.g. if switching to Boost::Boost instead of using ${Boost_LIBRARY_DIRS} the add: - # find_dependency(Boost @Boost_VERSION@) - --include("${CMAKE_CURRENT_LIST_DIR}/@targets_export_name@.cmake") -+include("${CMAKE_CURRENT_LIST_DIR}/OpenImageIOTargets.cmake") - check_required_components("@PROJECT_NAME@") -\ No newline at end of file diff --git a/ports/openimageio/fix-dependency.patch b/ports/openimageio/fix-dependency.patch index 3dc3a16d01d625..5bf6dd93f43aa3 100644 --- a/ports/openimageio/fix-dependency.patch +++ b/ports/openimageio/fix-dependency.patch @@ -1,5 +1,5 @@ diff --git a/src/cmake/externalpackages.cmake b/src/cmake/externalpackages.cmake -index 2f4f7ce..16035df 100644 +index fc30448..b63be5c 100644 --- a/src/cmake/externalpackages.cmake +++ b/src/cmake/externalpackages.cmake @@ -169,10 +169,17 @@ checked_find_package (PNG REQUIRED) @@ -63,7 +63,7 @@ index 2f4f7ce..16035df 100644 list (APPEND qt5_modules OpenGL) endif () option (USE_QT "Use Qt if found" ON) -+if (USE_QT) ++if(USE_QT) checked_find_package (Qt5 COMPONENTS ${qt5_modules}) +endif() if (USE_QT AND NOT Qt5_FOUND AND APPLE) diff --git a/ports/openimageio/fix_static_build.patch b/ports/openimageio/fix_static_build.patch deleted file mode 100644 index 825026dc8bf604..00000000000000 --- a/ports/openimageio/fix_static_build.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/src/cmake/compiler.cmake b/src/cmake/compiler.cmake -index 4f4f31c..a18895e 100644 ---- a/src/cmake/compiler.cmake -+++ b/src/cmake/compiler.cmake -@@ -451,7 +451,7 @@ set (EXTRA_DSO_LINK_ARGS "" CACHE STRING "Extra command line definitions when bu - # - 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 (-DOIIO_STATIC_DEFINE=1) - endif () - - diff --git a/ports/openimageio/portfile.cmake b/ports/openimageio/portfile.cmake index 7e6a6aae30fd61..3cd85907623016 100644 --- a/ports/openimageio/portfile.cmake +++ b/ports/openimageio/portfile.cmake @@ -1,14 +1,12 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO OpenImageIO/oiio - REF fdd982a9922ff508b8b22e5d024356b582572f46 #2.1.9.0 - SHA512 1d076cb035b1b2cb603343465ed810ca47223211870d58f48c177d40d71a9cf82e53548b0c70127daf5dbd06f1b24772919e49e55110d914a542bcb62b99f6e8 + REF Release-2.1.11.2 + SHA512 11ea3da1c19f1c4b9a101390fdf7411b6d7cf800e525766d3e37a36ee38489890f5a1417c171c139992a60cd01ee0b161065a3a14c75a0eb701685b11763aa46 HEAD_REF master PATCHES fix-dependency.patch - fix_static_build.patch fix-tools-path.patch - fix-config-cmake.patch ) file(REMOVE_RECURSE "${SOURCE_PATH}/ext") From e8b26159057bcb51604f3ca776c9c1a18736ebe5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?MACHIZAUD=20Andr=C3=A9a?= Date: Sat, 7 Mar 2020 16:45:54 +0100 Subject: [PATCH 2/2] [openimageio-python] On Linux, force usage of shared library python --- ports/openimageio/portfile.cmake | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/ports/openimageio/portfile.cmake b/ports/openimageio/portfile.cmake index 3cd85907623016..c9d965e5066c3f 100644 --- a/ports/openimageio/portfile.cmake +++ b/ports/openimageio/portfile.cmake @@ -39,9 +39,34 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS tools OIIO_BUILD_TOOLS ) -vcpkg_find_acquire_program(PYTHON3) -get_filename_component(PYTHON3_DIR "${PYTHON3}" DIRECTORY) -vcpkg_add_to_path("${PYTHON3_DIR}") +if(VCPKG_TARGET_IS_LINUX) + # Because pybind11 dependency relies on system python, it will match python 2.7 by default + # At least make sure it is present + vcpkg_find_acquire_program(PYTHON2) + get_filename_component(PYTHON2_DIR "${PYTHON2}" DIRECTORY) + vcpkg_add_to_path("${PYTHON2_DIR}") + + find_library(LIBPYTHON2.7 + NAMES + libpython2.7.so + PATHS + "/usr/lib" + PATH_SUFFIXES + "x86_64-linux-gnu" + ) + message(STATUS "Building on Linux, Python shared library located at ${LIBPYTHON2.7}") + if(NOT LIBPYTHON2.7) + message(FATAL_ERROR + "Python shared library required on Linux systems, build or install it with your package manager" + "\ne.g. apt-get install libpython2.7" + ) + endif() + set(OPTIONS_PYTHON_LIBRARY "-DPYTHON_LIBRARY:FILEPATH=${LIBPYTHON2.7}") +else() + vcpkg_find_acquire_program(PYTHON3) + get_filename_component(PYTHON3_DIR "${PYTHON3}" DIRECTORY) + vcpkg_add_to_path("${PYTHON3_DIR}") +endif() vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} @@ -57,6 +82,7 @@ vcpkg_configure_cmake( -DBUILD_MISSING_PYBIND11=OFF -DBUILD_MISSING_DEPS=OFF -DVERBOSE=ON + ${OPTIONS_PYTHON_LIBRARY} ) vcpkg_install_cmake()