Skip to content

Commit

Permalink
graphics/yafaray: make compatible with OpenEXR/Imath 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mandree committed Apr 12, 2021
1 parent 136cf0c commit 581762c
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 3 deletions.
6 changes: 3 additions & 3 deletions graphics/yafaray/Makefile
Expand Up @@ -3,7 +3,7 @@
PORTNAME= yafaray
DISTVERSIONPREFIX= v
DISTVERSION= 3.5.1
PORTREVISION= 5
PORTREVISION= 6
CATEGORIES= graphics

MAINTAINER= yuri@FreeBSD.org
Expand All @@ -19,8 +19,8 @@ ONLY_FOR_ARCHS_REASON= assembly is only for amd64 and i386, but it breaks on i38

LIB_DEPENDS= libboost_system.so:devel/boost-libs \
libfreetype.so:print/freetype2 \
libHalf.so:graphics/ilmbase \
libIlmImf.so:graphics/openexr \
libImath.so:math/Imath \
libOpenEXR.so:graphics/openexr \
libopencv_photo.so:graphics/opencv \
libopencv_core.so:graphics/opencv \
libpng.so:graphics/png \
Expand Down
56 changes: 56 additions & 0 deletions graphics/yafaray/files/patch-CMakeModules_FindOpenEXR.cmake
@@ -0,0 +1,56 @@
--- CMakeModules/FindOpenEXR.cmake.orig 2020-07-13 08:15:40 UTC
+++ CMakeModules/FindOpenEXR.cmake
@@ -26,10 +26,13 @@ IF(ZLIB_FOUND)
/sw/include
/opt/local/include)

- FIND_LIBRARY(OPENEXR_HALF_LIBRARY
- NAMES Half
- PATHS ${LIBRARY_DIRS})
-
+ FIND_PATH(IMATH_INCLUDE_PATH ImathVec.h
+ PATH_SUFFIXES Imath
+ /usr/include
+ /usr/local/include
+ /sw/include
+ /opt/local/include)
+
FIND_LIBRARY(OPENEXR_IEX_LIBRARY
NAMES Iex
PATHS ${LIBRARY_DIRS})
@@ -39,7 +42,7 @@ IF(ZLIB_FOUND)
PATHS ${LIBRARY_DIRS})

FIND_LIBRARY(OPENEXR_ILMIMF_LIBRARY
- NAMES IlmImf
+ NAMES OpenEXR
PATHS ${LIBRARY_DIRS})

FIND_LIBRARY(OPENEXR_ILMTHREAD_LIBRARY
@@ -50,15 +53,15 @@ ENDIF(ZLIB_FOUND)

#MESSAGE(STATUS ${OPENEXR_IMATH_LIBRARY} ${OPENEXR_ILMIMF_LIBRARY} ${OPENEXR_IEX_LIBRARY} ${OPENEXR_HALF_LIBRARY} ${OPENEXR_ILMTHREAD_LIBRARY} ${ZLIB_LIBRARY})

-IF (OPENEXR_INCLUDE_PATH AND OPENEXR_IMATH_LIBRARY AND OPENEXR_ILMIMF_LIBRARY AND OPENEXR_IEX_LIBRARY AND OPENEXR_HALF_LIBRARY)
+IF (OPENEXR_INCLUDE_PATH AND IMATH_INCLUDE_PATH AND OPENEXR_IMATH_LIBRARY AND OPENEXR_ILMIMF_LIBRARY AND OPENEXR_IEX_LIBRARY)
SET(OPENEXR_FOUND TRUE)
- SET(OPENEXR_INCLUDE_DIRS ${OPENEXR_INCLUDE_PATH} CACHE STRING "The include paths needed to use OpenEXR")
- SET(OPENEXR_LIBRARIES ${OPENEXR_IMATH_LIBRARY} ${OPENEXR_ILMIMF_LIBRARY} ${OPENEXR_IEX_LIBRARY} ${OPENEXR_HALF_LIBRARY} ${ZLIB_LIBRARY} CACHE STRING "The libraries needed to use OpenEXR")
+ SET(OPENEXR_INCLUDE_DIRS ${OPENEXR_INCLUDE_PATH} ${IMATH_INCLUDE_PATH} CACHE STRING "The include paths needed to use OpenEXR")
+ SET(OPENEXR_LIBRARIES ${OPENEXR_IMATH_LIBRARY} ${OPENEXR_ILMIMF_LIBRARY} ${OPENEXR_IEX_LIBRARY} ${ZLIB_LIBRARY} CACHE STRING "The libraries needed to use OpenEXR")

IF(OPENEXR_ILMTHREAD_LIBRARY)
SET(OPENEXR_LIBRARIES ${OPENEXR_LIBRARIES} ${OPENEXR_ILMTHREAD_LIBRARY})
ENDIF(OPENEXR_ILMTHREAD_LIBRARY)
-ENDIF (OPENEXR_INCLUDE_PATH AND OPENEXR_IMATH_LIBRARY AND OPENEXR_ILMIMF_LIBRARY AND OPENEXR_IEX_LIBRARY AND OPENEXR_HALF_LIBRARY)
+ENDIF (OPENEXR_INCLUDE_PATH AND OPENEXR_IMATH_LIBRARY AND OPENEXR_ILMIMF_LIBRARY AND OPENEXR_IEX_LIBRARY)

IF(OPENEXR_FOUND)
IF(NOT OPENEXR_FIND_QUIETLY)
@@ -75,5 +78,4 @@ MARK_AS_ADVANCED(
OPENEXR_LIBRARIES
OPENEXR_ILMIMF_LIBRARY
OPENEXR_IMATH_LIBRARY
- OPENEXR_IEX_LIBRARY
- OPENEXR_HALF_LIBRARY)
+ OPENEXR_IEX_LIBRARY)
11 changes: 11 additions & 0 deletions graphics/yafaray/files/patch-src_image__handlers_exrHandler.cc
@@ -0,0 +1,11 @@
--- src/image_handlers/exrHandler.cc.orig 2020-07-13 08:15:40 UTC
+++ src/image_handlers/exrHandler.cc
@@ -35,6 +35,8 @@
#include <ImfVersion.h>
#include <IexThrowErrnoExc.h>

+typedef uint64_t Int64;
+
using namespace Imf;
using namespace Imath;

0 comments on commit 581762c

Please sign in to comment.