Skip to content

Commit

Permalink
media-libs/openimageio: Fix configure with openexr-2.3.0
Browse files Browse the repository at this point in the history
Thanks-to: Alexander Miller <[email protected]>
Closes: https://bugs.gentoo.org/683126
Package-Manager: Portage-2.3.64, Repoman-2.3.12
Signed-off-by: Andreas Sturmlechner <[email protected]>
  • Loading branch information
a17r committed Apr 21, 2019
1 parent 3a64cda commit 3aaca40
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
Use PkgConfig to find OpenEXR. Otherwise, the code fails
when OpenEXR/OpenEXRConfig.h is a multilib wrapper.
Changes taken from openimageio-1.8.17.

--- openimageio-1.7.17/src/cmake/modules/FindOpenEXR.cmake
+++ openimageio-1.7.17/src/cmake/modules/FindOpenEXR.cmake
@@ -27,6 +27,13 @@
set (ILMBASE_PTHREADS ${CMAKE_THREAD_LIBS_INIT})
endif ()

+# Attempt to find OpenEXR with pkgconfig
+find_package(PkgConfig)
+if (PKG_CONFIG_FOUND)
+ pkg_check_modules(_ILMBASE QUIET IlmBase)
+ pkg_check_modules(_OPENEXR QUIET OpenEXR>=2.0.0)
+endif (PKG_CONFIG_FOUND)
+
# List of likely places to find the headers -- note priority override of
# OPENEXR_CUSTOM_INCLUDE_DIR and ${OPENEXR_HOME}/include.
# ILMBASE is needed in case ilmbase an openexr are installed in separate
@@ -35,6 +42,8 @@
${OPENEXR_CUSTOM_INCLUDE_DIR}
${OPENEXR_HOME}/include
${ILMBASE_HOME}/include
+ ${_ILMBASE_INCLUDEDIR}
+ ${_OPENEXR_INCLUDEDIR}
/usr/local/include
/usr/include
/usr/include/${CMAKE_LIBRARY_ARCHITECTURE}
@@ -53,7 +62,11 @@
find_path (OPENEXR_INCLUDE_PATH OpenEXR/OpenEXRConfig.h)

# Try to figure out version number
-if (EXISTS "${OPENEXR_INCLUDE_PATH}/OpenEXR/ImfMultiPartInputFile.h")
+if (DEFINED _OPENEXR_VERSION AND NOT "${_OPENEXR_VERSION}" STREQUAL "")
+ set (OPENEXR_VERSION "${_OPENEXR_VERSION}")
+ string (REGEX REPLACE "([0-9]+)\\.[0-9]+" "\\1" OPENEXR_VERSION_MAJOR "${_OPENEXR_VERSION}")
+ string (REGEX REPLACE "[0-9]+\\.([0-9]+)" "\\1" OPENEXR_VERSION_MINOR "${_OPENEXR_VERSION}")
+elseif (EXISTS "${OPENEXR_INCLUDE_PATH}/OpenEXR/ImfMultiPartInputFile.h")
# Must be at least 2.0
file(STRINGS "${OPENEXR_INCLUDE_PATH}/OpenEXR/OpenEXRConfig.h" TMP REGEX "^#define OPENEXR_VERSION_STRING .*$")
string (REGEX MATCHALL "[0-9]+[.0-9]+" OPENEXR_VERSION ${TMP})
@@ -90,6 +103,8 @@
${GENERIC_LIBRARY_PATHS}
${OPENEXR_INCLUDE_PATH}/../lib
${ILMBASE_INCLUDE_PATH}/../lib
+ ${_ILMBASE_LIBDIR}
+ ${_OPENEXR_LIBDIR}
/usr/local/lib
/usr/local/lib/${CMAKE_LIBRARY_ARCHITECTURE}
/usr/lib
1 change: 1 addition & 0 deletions media-libs/openimageio/openimageio-1.7.17.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ DEPEND="${RDEPEND}
PATCHES=(
"${FILESDIR}/${P}-use-gnuinstalldirs.patch"
"${FILESDIR}/${P}-make-python-and-boost-detection-more-generic.patch"
"${FILESDIR}/${P}-openexr-2.3.0.patch" # bug 683126
)

DOCS=( CHANGES.md CREDITS.md README.md src/doc/${PN}.pdf )
Expand Down

0 comments on commit 3aaca40

Please sign in to comment.