1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-29 05:38:00 +00:00

graphics/ampasCTL: make compatible with OpenEXR/Imath 3.0

This commit is contained in:
Matthias Andree 2021-04-11 06:36:11 +02:00
parent ebc45c65d8
commit 8043c45b3a
9 changed files with 149 additions and 5 deletions

View File

@ -2,7 +2,7 @@
PORTNAME= ampasCTL
PORTVERSION= 1.5.2
PORTREVISION= 11
PORTREVISION= 12
CATEGORIES= graphics devel
MAINTAINER= ports@FreeBSD.org
@ -13,8 +13,8 @@ LICENSE_NAME= AMPAS
LICENSE_FILE= ${WRKSRC}/LICENSE
LICENSE_PERMS= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
LIB_DEPENDS= libImath.so:graphics/ilmbase \
libIlmImf.so:graphics/openexr \
LIB_DEPENDS= libImath.so:math/Imath \
libOpenEXR.so:graphics/openexr \
libtiff.so:graphics/tiff \
libAcesContainer.so:graphics/ampasACES-container
@ -26,6 +26,9 @@ GH_ACCOUNT= ampas
GH_PROJECT= CTL
GH_TAGNAME= 57b48a2
CFLAGS+= -I${LOCALBASE}/include/OpenEXR -I${LOCALBASE}/include/Imath
LDFLAGS+= -L${LOCALBASE}/lib
OPTIONS_DEFINE= DOCS
PORTDOCS= *

View File

@ -1,6 +1,15 @@
--- cmake/modules/FindIlmBase.cmake.orig 2014-06-03 01:11:24 UTC
+++ cmake/modules/FindIlmBase.cmake
@@ -19,7 +19,10 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin"
@@ -4,7 +4,7 @@
find_package(PkgConfig QUIET)
if(PKG_CONFIG_FOUND)
- pkg_check_modules(PC_ILMBASE QUIET IlmBase)
+ pkg_check_modules(PC_ILMBASE QUIET Imath)
endif()
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
@@ -19,7 +19,10 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
endif()
if(PC_ILMBASE_FOUND)
@ -12,3 +21,16 @@
set(IlmBase_LIBRARY_DIRS ${PC_ILMBASE_LIBRARY_DIRS})
set(IlmBase_LDFLAGS ${PC_ILMBASE_LDFLAGS_OTHER})
if("${_IlmBase_HINT_INCLUDE}" STREQUAL "")
@@ -49,11 +52,7 @@ if(IlmBase_INCLUDE_DIR AND EXISTS "${IlmBase_INCLUDE_D
endif()
endif()
-if("${IlmBase_VERSION}" VERSION_LESS "2.0.0")
- set(IlmBase_ALL_LIBRARIES Imath Half Iex IlmThread)
-else()
- set(IlmBase_ALL_LIBRARIES Imath Half Iex IexMath IlmThread)
-endif()
+set(IlmBase_ALL_LIBRARIES Imath Iex IlmThread)
foreach(ILMBASE_LIB ${IlmBase_ALL_LIBRARIES})
string(TOUPPER ${ILMBASE_LIB} _upper_ilmbase_lib)
find_library(IlmBase_${_upper_ilmbase_lib}_LIBRARY

View File

@ -1,6 +1,6 @@
--- cmake/modules/FindOpenEXR.cmake.orig 2014-06-03 01:11:24 UTC
+++ cmake/modules/FindOpenEXR.cmake
@@ -19,7 +19,10 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin"
@@ -19,7 +19,10 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
endif()
if(PC_OPENEXR_FOUND)
@ -12,3 +12,21 @@
set(OpenEXR_LIBRARY_DIRS ${PC_OPENEXR_LIBRARY_DIRS})
set(OpenEXR_LDFLAGS ${PC_OPENEXR_LDFLAGS_OTHER})
if("${_OpenEXR_HINT_INCLUDE}" STREQUAL "")
@@ -52,14 +55,14 @@ if(OpenEXR_INCLUDE_DIR AND EXISTS "${OpenEXR_INCLUDE_D
endif()
endif()
-find_library(OpenEXR_LIBRARY NAMES IlmImf libIlmImf HINTS ${_OpenEXR_HINT_LIB})
+find_library(OpenEXR_LIBRARY NAMES OpenEXR libOpenEXR HINTS ${_OpenEXR_HINT_LIB})
-find_package(IlmBase QUIET)
+find_package(Imath QUIET)
unset(_OpenEXR_HINT_INCLUDE)
unset(_OpenEXR_HINT_LIB)
-set(OpenEXR_LIBRARIES ${OpenEXR_LIBRARY} ${IlmBase_LIBRARIES} )
+set(OpenEXR_LIBRARIES ${OpenEXR_LIBRARY} ${Imath_LIBRARIES} )
set(OpenEXR_INCLUDE_DIRS ${OpenEXR_INCLUDE_DIR} )
if(NOT PC_OPENEXR_FOUND)

View File

@ -0,0 +1,37 @@
--- configure.cmake.orig 2014-06-03 01:11:24 UTC
+++ configure.cmake
@@ -4,22 +4,22 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_IN
find_package( PkgConfig QUIET )
-find_package( IlmBase QUIET )
-if(IlmBase_FOUND)
- message( STATUS "found IlmBase, version ${IlmBase_VERSION}" )
+find_package( Imath QUIET )
+if(Imath_FOUND)
+ message( STATUS "found Imath, version ${Imath_VERSION}" )
###
- ### Everyone (well, except for DPX) uses IlmBase, so
+ ### Everyone (well, except for DPX) uses Imath (formerly IlmBase), so
### make that a global setting
###
- include_directories( ${IlmBase_INCLUDE_DIRS} )
- link_directories( ${IlmBase_LIBRARY_DIRS} )
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${IlmBase_CFLAGS}" )
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${IlmBase_CFLAGS}" )
- set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${IlmBase_LDFLAGS}" )
- set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${IlmBase_LDFLAGS}" )
- set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${IlmBase_LDFLAGS}" )
+ include_directories( ${Imath_INCLUDE_DIRS} )
+ link_directories( ${Imath_LIBRARY_DIRS} )
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${Imath_CFLAGS}" )
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Imath_CFLAGS}" )
+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${Imath_LDFLAGS}" )
+ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${Imath_LDFLAGS}" )
+ set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${Imath_LDFLAGS}" )
else()
- message( SEND_ERROR "IlmBase not found, please set the include and library paths manually" )
+ message( SEND_ERROR "Imath not found, please set the include and library paths manually" )
endif()
find_package( TIFF QUIET )

View File

@ -0,0 +1,11 @@
--- ctlrender/exr_file.cc.orig 2014-06-03 01:11:24 UTC
+++ ctlrender/exr_file.cc
@@ -63,6 +63,8 @@
#include <ImfChannelList.h>
#include <Iex.h>
+#include <fstream>
+
bool exr_read(const char *name, float scale, ctl::dpx::fb<float> *pixels,
format_t *format) {
std::ifstream ins;

View File

@ -0,0 +1,20 @@
--- lib/IlmCtlMath/CtlPointTree.h.orig 2014-06-03 01:11:24 UTC
+++ lib/IlmCtlMath/CtlPointTree.h
@@ -71,6 +71,8 @@
#include <vector>
#include <algorithm>
+#include <limits>
+
namespace Ctl {
class PointTree
@@ -181,7 +183,7 @@ class PointTree
double bl = (_points[b] - _center).length2();
volatile double delta = fabs (al - bl);
- const double eps = 2.0 * Imath::limits<double>::epsilon();
+ const double eps = 2.0 * std::numeric_limits<double>::epsilon();
//
// Impose strict weak ordering... if the lengths are the same,

View File

@ -0,0 +1,11 @@
--- lib/IlmCtlSimd/CMakeLists.txt.orig 2021-04-11 04:27:17 UTC
+++ lib/IlmCtlSimd/CMakeLists.txt
@@ -1,7 +1,7 @@
include_directories( "${CMAKE_CURRENT_SOURCE_DIR}" "${PROJECT_SOURCE_DIR}/lib/IlmCtl" "${PROJECT_SOURCE_DIR}/lib/IlmCtlMath" )
add_executable( halfExpLogTable halfExpLogTable.cpp )
-target_link_libraries( halfExpLogTable Half )
+target_link_libraries( halfExpLogTable Imath )
add_custom_command( OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/halfExpLogTable.h"
COMMAND halfExpLogTable "${CMAKE_CURRENT_BINARY_DIR}/halfExpLogTable.h" "${CMAKE_CURRENT_BINARY_DIR}/halfExpLog.h"

View File

@ -0,0 +1,11 @@
--- lib/IlmCtl/CMakeLists.txt.orig 2021-04-11 04:25:00 UTC
+++ lib/IlmCtl/CMakeLists.txt
@@ -22,7 +22,7 @@ add_library( IlmCtl ${DO_SHARED}
)
target_link_libraries( IlmCtl ${IlmBase_LDFLAGS_OTHER} )
-target_link_libraries( IlmCtl Iex IlmThread Half )
+target_link_libraries( IlmCtl Iex IlmThread Imath)
set_target_properties( IlmCtl PROPERTIES
VERSION ${CTL_VERSION}

View File

@ -0,0 +1,11 @@
--- lib/IlmImfCtl/CMakeLists.txt.orig 2021-04-11 04:27:51 UTC
+++ lib/IlmImfCtl/CMakeLists.txt
@@ -7,7 +7,7 @@ add_library( IlmImfCtl ${DO_SHARED}
ImfCtlCopyFunctionArg.cpp
)
-target_link_libraries( IlmImfCtl IlmCtl IlmImf Iex IlmThread Half )
+target_link_libraries( IlmImfCtl IlmCtl OpenEXR Iex IlmThread Imath )
install( FILES ImfCtlApplyTransforms.h DESTINATION include/OpenEXR )