Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Apr 2021 00:34:29 GMT
From:      Matthias Andree <mandree@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 8043c45b3a37 - main - graphics/ampasCTL: make compatible with OpenEXR/Imath 3.0
Message-ID:  <202104120034.13C0YTcF092420@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by mandree:

URL: https://cgit.FreeBSD.org/ports/commit/?id=8043c45b3a37ec6385e18eb76cdae471bc066c25

commit 8043c45b3a37ec6385e18eb76cdae471bc066c25
Author:     Matthias Andree <mandree@FreeBSD.org>
AuthorDate: 2021-04-11 04:36:11 +0000
Commit:     Matthias Andree <mandree@FreeBSD.org>
CommitDate: 2021-04-12 00:33:43 +0000

    graphics/ampasCTL: make compatible with OpenEXR/Imath 3.0
---
 graphics/ampasCTL/Makefile                         |  9 ++++--
 .../files/patch-cmake_modules_FindIlmBase.cmake    | 24 +++++++++++++-
 .../files/patch-cmake_modules_FindOpenEXR.cmake    | 20 +++++++++++-
 graphics/ampasCTL/files/patch-configure.cmake      | 37 ++++++++++++++++++++++
 .../ampasCTL/files/patch-ctlrender_exr__file.cc    | 11 +++++++
 .../files/patch-lib_IlmCtlMath_CtlPointTree.h      | 20 ++++++++++++
 .../files/patch-lib_IlmCtlSimd_CMakeLists.txt      | 11 +++++++
 .../ampasCTL/files/patch-lib_IlmCtl_CMakeLists.txt | 11 +++++++
 .../files/patch-lib_IlmImfCtl_CMakeLists.txt       | 11 +++++++
 9 files changed, 149 insertions(+), 5 deletions(-)

diff --git a/graphics/ampasCTL/Makefile b/graphics/ampasCTL/Makefile
index 0acc045d63c2..851f9beeb8a3 100644
--- a/graphics/ampasCTL/Makefile
+++ b/graphics/ampasCTL/Makefile
@@ -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=	*
diff --git a/graphics/ampasCTL/files/patch-cmake_modules_FindIlmBase.cmake b/graphics/ampasCTL/files/patch-cmake_modules_FindIlmBase.cmake
index 9b2ef51b68fd..7e20cd673e9b 100644
--- a/graphics/ampasCTL/files/patch-cmake_modules_FindIlmBase.cmake
+++ b/graphics/ampasCTL/files/patch-cmake_modules_FindIlmBase.cmake
@@ -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
diff --git a/graphics/ampasCTL/files/patch-cmake_modules_FindOpenEXR.cmake b/graphics/ampasCTL/files/patch-cmake_modules_FindOpenEXR.cmake
index 40fecb14cd43..a4ab248601d0 100644
--- a/graphics/ampasCTL/files/patch-cmake_modules_FindOpenEXR.cmake
+++ b/graphics/ampasCTL/files/patch-cmake_modules_FindOpenEXR.cmake
@@ -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)
diff --git a/graphics/ampasCTL/files/patch-configure.cmake b/graphics/ampasCTL/files/patch-configure.cmake
new file mode 100644
index 000000000000..25422d6e956d
--- /dev/null
+++ b/graphics/ampasCTL/files/patch-configure.cmake
@@ -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 )
diff --git a/graphics/ampasCTL/files/patch-ctlrender_exr__file.cc b/graphics/ampasCTL/files/patch-ctlrender_exr__file.cc
new file mode 100644
index 000000000000..cac292b926ef
--- /dev/null
+++ b/graphics/ampasCTL/files/patch-ctlrender_exr__file.cc
@@ -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;
diff --git a/graphics/ampasCTL/files/patch-lib_IlmCtlMath_CtlPointTree.h b/graphics/ampasCTL/files/patch-lib_IlmCtlMath_CtlPointTree.h
new file mode 100644
index 000000000000..49ea62c731c8
--- /dev/null
+++ b/graphics/ampasCTL/files/patch-lib_IlmCtlMath_CtlPointTree.h
@@ -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,
diff --git a/graphics/ampasCTL/files/patch-lib_IlmCtlSimd_CMakeLists.txt b/graphics/ampasCTL/files/patch-lib_IlmCtlSimd_CMakeLists.txt
new file mode 100644
index 000000000000..769c62b05162
--- /dev/null
+++ b/graphics/ampasCTL/files/patch-lib_IlmCtlSimd_CMakeLists.txt
@@ -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"
diff --git a/graphics/ampasCTL/files/patch-lib_IlmCtl_CMakeLists.txt b/graphics/ampasCTL/files/patch-lib_IlmCtl_CMakeLists.txt
new file mode 100644
index 000000000000..6ff43019d1d4
--- /dev/null
+++ b/graphics/ampasCTL/files/patch-lib_IlmCtl_CMakeLists.txt
@@ -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}
diff --git a/graphics/ampasCTL/files/patch-lib_IlmImfCtl_CMakeLists.txt b/graphics/ampasCTL/files/patch-lib_IlmImfCtl_CMakeLists.txt
new file mode 100644
index 000000000000..2519b4733b8a
--- /dev/null
+++ b/graphics/ampasCTL/files/patch-lib_IlmImfCtl_CMakeLists.txt
@@ -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 )
+ 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202104120034.13C0YTcF092420>