git: 436b1bb08ad0 - main - graphics/openimageio-ociov1: compat library for ICIOv1 support

From: Dima Panov <fluffy_at_FreeBSD.org>
Date: Tue, 01 Feb 2022 17:04:34 UTC
The branch main has been updated by fluffy:

URL: https://cgit.FreeBSD.org/ports/commit/?id=436b1bb08ad0f453c2f8b50bf1e0146e1e50fe0d

commit 436b1bb08ad0f453c2f8b50bf1e0146e1e50fe0d
Author:     Dima Panov <fluffy@FreeBSD.org>
AuthorDate: 2022-02-01 16:21:31 +0000
Commit:     Dima Panov <fluffy@FreeBSD.org>
CommitDate: 2022-02-01 17:04:13 +0000

    graphics/openimageio-ociov1: compat library for ICIOv1 support
    
    New port that provides oiio library that is linked against ociov1
    This allows blender-lts28 to compile while it still has six months official support
    
    PR:             260310
    Sponsored by:   Netzkommune GmbH.
---
 graphics/openimageio-ociov1/Makefile               | 101 +++++++++++++++++++++
 graphics/openimageio-ociov1/distinfo               |   3 +
 .../openimageio-ociov1/files/patch-CMakeLists.txt  |  13 +++
 .../patch-src_cmake_modules_FindOpenColorIO.cmake  |  41 +++++++++
 .../files/patch-src_cmake_modules_FindPtex.cmake   |  10 ++
 .../files/patch-src_include_CMakeLists.txt         |  34 +++++++
 .../files/patch-src_libOpenImageIO_CMakeLists.txt  |  11 +++
 .../files/patch-src_libutil_CMakeLists.txt         |  11 +++
 graphics/openimageio-ociov1/pkg-descr              |  10 ++
 graphics/openimageio-ociov1/pkg-plist              |  73 +++++++++++++++
 graphics/openimageio-ociov1/pkg-plist-pybind       |   1 +
 11 files changed, 308 insertions(+)

diff --git a/graphics/openimageio-ociov1/Makefile b/graphics/openimageio-ociov1/Makefile
new file mode 100644
index 000000000000..0cfbdee4adf5
--- /dev/null
+++ b/graphics/openimageio-ociov1/Makefile
@@ -0,0 +1,101 @@
+PORTNAME=	openimageio
+DISTVERSIONPREFIX=	Release-
+DISTVERSION=	2.2.19.0
+CATEGORIES=	graphics multimedia
+PKGNAMESUFFIX=	-ociov1
+# special port to link oiio libs with ociov1
+# specifically to build blender-lts28 while still officially supported
+
+MAINTAINER=	FreeBSD@Shaneware.biz
+COMMENT=	OpenImageIO graphics library linked to ocio v1
+
+LICENSE=	BSD3CLAUSE
+
+BUILD_DEPENDS=	${LOCALBASE}/include/tsl/robin_map.h:devel/robin-map
+LIB_DEPENDS=	libboost_thread.so:devel/boost-libs \
+		libfmt.so:devel/libfmt \
+		libhdf5.so:science/hdf5 \
+		libheif.so:graphics/libheif \
+		libImath.so:math/Imath \
+		libOpenColorIOv1.so:graphics/opencoloriov1 \
+		libOpenEXR.so:graphics/openexr \
+		libpng.so:graphics/png \
+		libsquish.so:graphics/squish \
+		libtiff.so:graphics/tiff \
+		libwebp.so:graphics/webp
+
+USES=		cmake jpeg compiler:c++14-lang iconv:wchar_t
+USE_GITHUB=	yes
+GH_ACCOUNT=	OpenImageIO
+GH_PROJECT=	oiio
+
+CMAKE_ON=	USE_OCIO
+CMAKE_OFF=	BUILDSTATIC INSTALL_FONTS LINKSTATIC NOTHREADS \
+		STOP_ON_WARNING USE_OPENSSL USE_QT USE_OPENGL \
+		OIIO_BUILD_TESTS OIIO_BUILD_TOOLS USE_PYTHON
+USE_LDCONFIG=	yes
+
+OPTIONS_DEFINE=		DICOM DOCS FFMPEG FREETYPE GIF \
+			OPENCV OPENJPEG PTEX RAW TBB VDB
+OPTIONS_DEFAULT=	DICOM FREETYPE GIF OPENJPEG PTEX
+OPTIONS_SUB=		yes
+
+DOCS_CMAKE_BOOL=	INSTALL_DOCS
+DOCS_CMAKE_ON=		-DCMAKE_INSTALL_DOCDIR:STRING=${DOCSDIR}
+
+DICOM_DESC=		DICOM/MEDICOM support
+DICOM_CMAKE_BOOL=	USE_DICOM
+DICOM_LIB_DEPENDS=	libdcmimage.so:graphics/dcmtk
+
+FFMPEG_DESC=		Use FFmpeg to support extra file types
+FFMPEG_CMAKE_BOOL=	USE_FFMPEG
+FFMPEG_LIB_DEPENDS=	libavutil.so:multimedia/ffmpeg
+
+FREETYPE_CMAKE_BOOL=	USE_FREETYPE
+FREETYPE_LIB_DEPENDS=	libfreetype.so:print/freetype2
+FREETYPE_RUN_DEPENDS=	${LOCALBASE}/share/fonts/Droid/DroidSans.ttf:x11-fonts/droid-fonts-ttf
+
+GIF_CMAKE_BOOL=		USE_GIF
+GIF_LIB_DEPENDS=	libgif.so:graphics/giflib
+
+OPENCV_CMAKE_BOOL=	USE_OPENCV
+OPENCV_LIB_DEPENDS=	libopencv_core.so:graphics/opencv \
+			libopenjpeg.so:graphics/openjpeg15
+
+OPENJPEG_CMAKE_BOOL=	USE_OPENJPEG
+OPENJPEG_LIB_DEPENDS=	libopenjp2.so:graphics/openjpeg
+
+PTEX_DESC=		ptex support
+PTEX_LIB_DEPENDS=	libPtex.so:graphics/ptex
+
+RAW_CMAKE_BOOL=		USE_LIBRAW
+RAW_LIB_DEPENDS=	libraw_r.so:graphics/libraw
+
+TBB_DESC=		Intel tbb support
+TBB_CMAKE_BOOL=		USE_TBB
+TBB_LIB_DEPENDS=	libtbb.so:devel/onetbb
+
+VDB_DESC=		OpenVDB support
+VDB_CMAKE_ARGS=		-DCMAKE_CXX_STANDARD=14
+VDB_CMAKE_BOOL=		USE_OPENVDB
+VDB_LIB_DEPENDS=	libopenvdb.so:misc/openvdb
+
+# DISTVERSION has an extra digit which isn't in the lib name
+# for LIBVERS we want the first three digits
+PLIST_SUB=	SHL3=${PORTVERSION:R} SHL2=${PORTVERSION:R:R}
+DOCSDIR=	${PREFIX}/share/doc/openimageio-${PKGNAMESUFFIX}
+
+post-patch:
+	${REINPLACE_CMD} -e 's|<OpenColorIO/|<OpenColorIOv1/|g' \
+		${WRKSRC}/src/libOpenImageIO/color_ocio.cpp
+
+post-install:
+	${FIND} ${STAGEDIR}${PREFIX}/include/OpenImageIO${PKGNAMESUFFIX} \
+		-name '*.h' -or -name '*.hpp' | \
+		${XARGS} ${REINPLACE_CMD} -e 's|<OpenImageIO/|<OpenImageIO${PKGNAMESUFFIX}/|g'
+	${FIND} ${STAGEDIR}${PREFIX}/include/OpenImageIO${PKGNAMESUFFIX} -name '*.bak' -delete
+	@(cd ${STAGEDIR}${PREFIX}/lib/cmake  && ${MV} OpenImageIO OpenImageIO${PKGNAMESUFFIX})
+	@(cd ${STAGEDIR}${PREFIX}/share/cmake/Modules && \
+		${MV} FindOpenImageIO.cmake FindOpenImageIO${PKGNAMESUFFIX}.cmake)
+
+.include <bsd.port.mk>
diff --git a/graphics/openimageio-ociov1/distinfo b/graphics/openimageio-ociov1/distinfo
new file mode 100644
index 000000000000..49e8cc4fdbe3
--- /dev/null
+++ b/graphics/openimageio-ociov1/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1638775456
+SHA256 (OpenImageIO-oiio-Release-2.2.19.0_GH0.tar.gz) = 8f7b10bfe64c33077a163ab2a034d3085ce8f712413f33ef4020cfd07c2e10dc
+SIZE (OpenImageIO-oiio-Release-2.2.19.0_GH0.tar.gz) = 29252399
diff --git a/graphics/openimageio-ociov1/files/patch-CMakeLists.txt b/graphics/openimageio-ociov1/files/patch-CMakeLists.txt
new file mode 100644
index 000000000000..949c1994bdef
--- /dev/null
+++ b/graphics/openimageio-ociov1/files/patch-CMakeLists.txt
@@ -0,0 +1,13 @@
+--- CMakeLists.txt.orig	2021-10-31 17:08:10 UTC
++++ CMakeLists.txt
+@@ -214,8 +214,8 @@ endif ()
+ 
+ # install pkgconfig file
+ if (NOT MSVC)
+-   configure_file(src/build-scripts/OpenImageIO.pc.in "${CMAKE_BINARY_DIR}/OpenImageIO.pc" @ONLY)
+-   install (FILES "${CMAKE_BINARY_DIR}/OpenImageIO.pc"
++   configure_file(src/build-scripts/OpenImageIO.pc.in "${CMAKE_BINARY_DIR}/OpenImageIO-ociov1.pc" @ONLY)
++   install (FILES "${CMAKE_BINARY_DIR}/OpenImageIO-ociov1.pc"
+             DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
+             COMPONENT developer)
+ endif()
diff --git a/graphics/openimageio-ociov1/files/patch-src_cmake_modules_FindOpenColorIO.cmake b/graphics/openimageio-ociov1/files/patch-src_cmake_modules_FindOpenColorIO.cmake
new file mode 100644
index 000000000000..09ddd3394fdd
--- /dev/null
+++ b/graphics/openimageio-ociov1/files/patch-src_cmake_modules_FindOpenColorIO.cmake
@@ -0,0 +1,41 @@
+--- src/cmake/modules/FindOpenColorIO.cmake.orig	2021-12-08 14:45:20 UTC
++++ src/cmake/modules/FindOpenColorIO.cmake
+@@ -14,21 +14,22 @@ include (FindPackageHandleStandardArgs)
+ include (FindPackageMessage)
+ 
+ find_path (OPENCOLORIO_INCLUDE_DIR
+-    OpenColorIO/OpenColorIO.h
++    OpenColorIOv1/OpenColorIO.h
+     HINTS
+         ${OPENCOLORIO_INCLUDE_PATH}
+         ENV OPENCOLORIO_INCLUDE_PATH
+     PATHS
++        /usr/local/include
+         /sw/include
+         /opt/local/include
+-    DOC "The directory where OpenColorIO/OpenColorIO.h resides")
++    DOC "The directory where OpenColorIOv1/OpenColorIO.h resides")
+ 
+-if (EXISTS "${OPENCOLORIO_INCLUDE_DIR}/OpenColorIO/OpenColorABI.h")
++if (EXISTS "${OPENCOLORIO_INCLUDE_DIR}/OpenColorIOv1/OpenColorABI.h")
+     # Search twice, because this symbol changed between OCIO 1.x and 2.x
+-    file(STRINGS "${OPENCOLORIO_INCLUDE_DIR}/OpenColorIO/OpenColorABI.h" TMP
++    file(STRINGS "${OPENCOLORIO_INCLUDE_DIR}/OpenColorIOv1/OpenColorABI.h" TMP
+          REGEX "^#define OCIO_VERSION_STR[ \t].*$")
+     if (NOT TMP)
+-        file(STRINGS "${OPENCOLORIO_INCLUDE_DIR}/OpenColorIO/OpenColorABI.h" TMP
++        file(STRINGS "${OPENCOLORIO_INCLUDE_DIR}/OpenColorIOv1/OpenColorABI.h" TMP
+              REGEX "^#define OCIO_VERSION[ \t].*$")
+     endif ()
+     string (REGEX MATCHALL "([0-9]+)\\.([0-9]+)\\.[0-9]+" OPENCOLORIO_VERSION ${TMP})
+@@ -38,8 +39,8 @@ endif ()
+ 
+ find_library (OPENCOLORIO_LIBRARY
+     NAMES
+-        OpenColorIO
+-        OpenColorIO_${OPENCOLORIO_VERSION_MAJOR}_${OPENCOLORIO_VERSION_MINOR}
++        OpenColorIOv1
++        OpenColorIO_1_1
+     HINTS
+         ${OPENCOLORIO_LIBRARY_PATH}
+         ENV OPENCOLORIO_LIBRARY_PATH
diff --git a/graphics/openimageio-ociov1/files/patch-src_cmake_modules_FindPtex.cmake b/graphics/openimageio-ociov1/files/patch-src_cmake_modules_FindPtex.cmake
new file mode 100644
index 000000000000..8e3b9ee29028
--- /dev/null
+++ b/graphics/openimageio-ociov1/files/patch-src_cmake_modules_FindPtex.cmake
@@ -0,0 +1,10 @@
+--- src/cmake/modules/FindPtex.cmake.orig	2021-10-31 17:08:10 UTC
++++ src/cmake/modules/FindPtex.cmake
+@@ -70,6 +70,7 @@ else ()
+         PATHS
+             /usr/include
+             /usr/local/include
++            /usr/local/include/ptex
+             DOC "The directory where Ptexture.h resides")
+     find_library( PTEX_LIBRARY
+         NAMES
diff --git a/graphics/openimageio-ociov1/files/patch-src_include_CMakeLists.txt b/graphics/openimageio-ociov1/files/patch-src_include_CMakeLists.txt
new file mode 100644
index 000000000000..9374214cfd0e
--- /dev/null
+++ b/graphics/openimageio-ociov1/files/patch-src_include_CMakeLists.txt
@@ -0,0 +1,34 @@
+--- src/include/CMakeLists.txt.orig	2021-12-07 16:54:34 UTC
++++ src/include/CMakeLists.txt
+@@ -48,12 +48,12 @@ list (APPEND public_headers "${CMAKE_BINARY_DIR}/inclu
+ 
+ 
+ install (FILES ${public_headers}
+-         DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}
++         DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}-ociov1
+          COMPONENT developer)
+ 
+ file (GLOB detail_headers OpenImageIO/detail/*.h)
+ install (FILES ${detail_headers}
+-         DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}/detail
++         DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}-ociov1/detail
+          COMPONENT developer)
+ 
+ set (fmt_headers
+@@ -65,7 +65,7 @@ set (fmt_headers
+ file (COPY ${fmt_headers}
+       DESTINATION ${CMAKE_BINARY_DIR}/include/OpenImageIO/detail/fmt)
+ install (FILES ${fmt_headers}
+-         DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}/detail/fmt
++         DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}-ociov1/detail/fmt
+          COMPONENT developer)
+ 
+ if (NOT USE_EXTERNAL_PUGIXML)
+@@ -76,6 +76,6 @@ if (NOT USE_EXTERNAL_PUGIXML)
+     file (COPY ${pugixml_headers}
+           DESTINATION ${CMAKE_BINARY_DIR}/include/OpenImageIO/detail/pugixml)
+     install (FILES ${pugixml_headers}
+-             DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}/detail/pugixml
++             DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}-ociov1/detail/pugixml
+              COMPONENT developer)
+ endif ()
diff --git a/graphics/openimageio-ociov1/files/patch-src_libOpenImageIO_CMakeLists.txt b/graphics/openimageio-ociov1/files/patch-src_libOpenImageIO_CMakeLists.txt
new file mode 100644
index 000000000000..77fc06d47161
--- /dev/null
+++ b/graphics/openimageio-ociov1/files/patch-src_libOpenImageIO_CMakeLists.txt
@@ -0,0 +1,11 @@
+--- src/libOpenImageIO/CMakeLists.txt.orig	2021-12-07 17:19:26 UTC
++++ src/libOpenImageIO/CMakeLists.txt
+@@ -195,7 +195,7 @@ set_target_properties(OpenImageIO
+                       PROPERTIES
+                          VERSION     ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}
+                          SOVERSION   ${SOVERSION}
+-                         OUTPUT_NAME OpenImageIO${OIIO_LIBNAME_SUFFIX}
++                         OUTPUT_NAME OpenImageIO-ociov1${OIIO_LIBNAME_SUFFIX}
+                          POSITION_INDEPENDENT_CODE ON
+                      )
+ if (VISIBILITY_MAP_COMMAND)
diff --git a/graphics/openimageio-ociov1/files/patch-src_libutil_CMakeLists.txt b/graphics/openimageio-ociov1/files/patch-src_libutil_CMakeLists.txt
new file mode 100644
index 000000000000..ee2187014abb
--- /dev/null
+++ b/graphics/openimageio-ociov1/files/patch-src_libutil_CMakeLists.txt
@@ -0,0 +1,11 @@
+--- src/libutil/CMakeLists.txt.orig	2021-12-07 17:17:50 UTC
++++ src/libutil/CMakeLists.txt
+@@ -43,7 +43,7 @@ set_target_properties(OpenImageIO_Util
+                       PROPERTIES
+                          VERSION     ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}
+                          SOVERSION   ${SOVERSION}
+-                         OUTPUT_NAME OpenImageIO_Util${OIIO_LIBNAME_SUFFIX}
++                         OUTPUT_NAME OpenImageIO_Util-ociov1${OIIO_LIBNAME_SUFFIX}
+                          POSITION_INDEPENDENT_CODE ON
+                      )
+ 
diff --git a/graphics/openimageio-ociov1/pkg-descr b/graphics/openimageio-ociov1/pkg-descr
new file mode 100644
index 000000000000..4fc9bf398df1
--- /dev/null
+++ b/graphics/openimageio-ociov1/pkg-descr
@@ -0,0 +1,10 @@
+OpenImageIO is a library for reading and writing images, and a bunch of
+related classes, utilities, and applications.
+
+There is a particular emphasis on formats and functionality used
+in professional, large-scale animation and visual effects work for film.
+
+OpenImageIO is used extensively in animation and VFX studios all over the
+world, and is also incorporated into several commercial products.
+
+WWW: http://www.openimageio.org/
diff --git a/graphics/openimageio-ociov1/pkg-plist b/graphics/openimageio-ociov1/pkg-plist
new file mode 100644
index 000000000000..4c259d5a9038
--- /dev/null
+++ b/graphics/openimageio-ociov1/pkg-plist
@@ -0,0 +1,73 @@
+include/OpenImageIO-ociov1/argparse.h
+include/OpenImageIO-ociov1/array_view.h
+include/OpenImageIO-ociov1/atomic.h
+include/OpenImageIO-ociov1/attrdelegate.h
+include/OpenImageIO-ociov1/benchmark.h
+include/OpenImageIO-ociov1/color.h
+include/OpenImageIO-ociov1/dassert.h
+include/OpenImageIO-ociov1/deepdata.h
+include/OpenImageIO-ociov1/detail/farmhash.h
+include/OpenImageIO-ociov1/detail/fmt/core.h
+include/OpenImageIO-ociov1/detail/fmt/format-inl.h
+include/OpenImageIO-ociov1/detail/fmt/format.h
+include/OpenImageIO-ociov1/detail/fmt/ostream.h
+include/OpenImageIO-ociov1/detail/fmt/printf.h
+include/OpenImageIO-ociov1/detail/pugixml/pugiconfig.hpp
+include/OpenImageIO-ociov1/detail/pugixml/pugixml.cpp
+include/OpenImageIO-ociov1/detail/pugixml/pugixml.hpp
+include/OpenImageIO-ociov1/errorhandler.h
+include/OpenImageIO-ociov1/export.h
+include/OpenImageIO-ociov1/filesystem.h
+include/OpenImageIO-ociov1/filter.h
+include/OpenImageIO-ociov1/fmath.h
+include/OpenImageIO-ociov1/fstream_mingw.h
+include/OpenImageIO-ociov1/function_view.h
+include/OpenImageIO-ociov1/hash.h
+include/OpenImageIO-ociov1/image_view.h
+include/OpenImageIO-ociov1/imagebuf.h
+include/OpenImageIO-ociov1/imagebufalgo_util.h
+include/OpenImageIO-ociov1/imagebufalgo.h
+include/OpenImageIO-ociov1/imagecache.h
+include/OpenImageIO-ociov1/imageio.h
+include/OpenImageIO-ociov1/Imath.h
+include/OpenImageIO-ociov1/missing_math.h
+include/OpenImageIO-ociov1/oiioversion.h
+include/OpenImageIO-ociov1/optparser.h
+include/OpenImageIO-ociov1/parallel.h
+include/OpenImageIO-ociov1/paramlist.h
+include/OpenImageIO-ociov1/platform.h
+include/OpenImageIO-ociov1/plugin.h
+include/OpenImageIO-ociov1/refcnt.h
+include/OpenImageIO-ociov1/simd.h
+include/OpenImageIO-ociov1/span.h
+include/OpenImageIO-ociov1/strided_ptr.h
+include/OpenImageIO-ociov1/string_view.h
+include/OpenImageIO-ociov1/strutil.h
+include/OpenImageIO-ociov1/sysutil.h
+include/OpenImageIO-ociov1/texture.h
+include/OpenImageIO-ociov1/thread.h
+include/OpenImageIO-ociov1/tiffutils.h
+include/OpenImageIO-ociov1/timer.h
+include/OpenImageIO-ociov1/typedesc.h
+include/OpenImageIO-ociov1/unittest.h
+include/OpenImageIO-ociov1/unordered_map_concurrent.h
+include/OpenImageIO-ociov1/ustring.h
+include/OpenImageIO-ociov1/varyingref.h
+include/OpenImageIO-ociov1/version.h
+lib/libOpenImageIO-ociov1.so
+lib/libOpenImageIO-ociov1.so.%%SHL2%%
+lib/libOpenImageIO-ociov1.so.%%SHL3%%
+lib/libOpenImageIO_Util-ociov1.so
+lib/libOpenImageIO_Util-ociov1.so.%%SHL2%%
+lib/libOpenImageIO_Util-ociov1.so.%%SHL3%%
+libdata/pkgconfig/OpenImageIO-ociov1.pc
+share/cmake/Modules/FindOpenImageIO-ociov1.cmake
+lib/cmake/OpenImageIO-ociov1/OpenImageIOConfig.cmake
+lib/cmake/OpenImageIO-ociov1/OpenImageIOConfigVersion.cmake
+lib/cmake/OpenImageIO-ociov1/OpenImageIOTargets-release.cmake
+lib/cmake/OpenImageIO-ociov1/OpenImageIOTargets.cmake
+%%PORTDOCS%%%%DOCSDIR%%/CHANGES.md
+%%PORTDOCS%%%%DOCSDIR%%/CHANGES-0.x.md
+%%PORTDOCS%%%%DOCSDIR%%/CHANGES-1.x.md
+%%PORTDOCS%%%%DOCSDIR%%/THIRD-PARTY.md
+%%PORTDOCS%%%%DOCSDIR%%/LICENSE.md
diff --git a/graphics/openimageio-ociov1/pkg-plist-pybind b/graphics/openimageio-ociov1/pkg-plist-pybind
new file mode 100644
index 000000000000..598a435380d1
--- /dev/null
+++ b/graphics/openimageio-ociov1/pkg-plist-pybind
@@ -0,0 +1 @@
+%%PYTHON_SITELIBDIR%%/OpenImageIO21.so