git: 3eb839e43e50 - main - graphics/blender-lts28: update to 2.83.18 release

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

URL: https://cgit.FreeBSD.org/ports/commit/?id=3eb839e43e50913a7a7ef8cb601899d33b6e5b10

commit 3eb839e43e50913a7a7ef8cb601899d33b6e5b10
Author:     Dima Panov <fluffy@FreeBSD.org>
AuthorDate: 2022-02-01 16:47:17 +0000
Commit:     Dima Panov <fluffy@FreeBSD.org>
CommitDate: 2022-02-01 17:04:14 +0000

    graphics/blender-lts28: update to 2.83.18 release
    
    This also includes adjustment to use new ports for opencoloriov1 and openimageio-ociov1
    
    PR:             260311
    Sponsored by:   Netzkommune GmbH.
---
 graphics/blender-lts28/Makefile                    | 37 +++++++++++++++-------
 graphics/blender-lts28/Makefile.options            |  8 ++---
 graphics/blender-lts28/Makefile.versions           |  4 +--
 graphics/blender-lts28/distinfo                    |  6 ++--
 graphics/blender-lts28/files/patch-CMakeLists.txt  |  4 +--
 ...uild__files_cmake_Modules_FindOpenColorIO.cmake | 22 +++++++++++++
 ...uild__files_cmake_Modules_FindOpenImageIO.cmake | 29 +++++++++++++++++
 ...ch-extern_audaspace_bindings_python_PySound.cpp | 11 -------
 8 files changed, 86 insertions(+), 35 deletions(-)

diff --git a/graphics/blender-lts28/Makefile b/graphics/blender-lts28/Makefile
index 135ad4c9ccc2..568c51265dd0 100644
--- a/graphics/blender-lts28/Makefile
+++ b/graphics/blender-lts28/Makefile
@@ -1,6 +1,5 @@
 PORTNAME=	blender
-DISTVERSION=	2.83.15
-PORTREVISION=	10
+DISTVERSION=	2.83.18
 CATEGORIES=	graphics multimedia
 MASTER_SITES=	http://download.blender.org/source/ \
 		http://mirror.cs.umn.edu/blender.org/source/ \
@@ -23,14 +22,15 @@ RUN_DEPENDS=	${PYNUMPY}
 # libraries are used, if either of the most common options in blender
 # are set. We will pull boost in just to be on the safe side.
 
-USES=		cmake compiler:c++14-lang gl cpe gnome jpeg python:3.7 shebangfix \
+USES=		cmake compiler:c++14-lang cpe gl jpeg python:3.7 shebangfix \
 		tar:xz xorg
 USE_XORG=	x11 xext xfixes xmu xrender
 USE_GL=		gl glu glew
 
+INSTALLS_ICONS=	yes
 CMAKE_OFF=	WITH_IMAGE_OPENJPEG WITH_PYTHON_INSTALL \
 		WITH_PYTHON_INSTALL_NUMPY WITH_INSTALL_PORTABLE \
-		WITH_CYCLES_LOGGING
+		WITH_CYCLES_LOGGING WITH_CYCLES_OSL WITH_LLVM
 
 SUB_FILES=	blender
 SHEBANG_FILES=	release/bin/blender-thumbnailer.py \
@@ -45,7 +45,7 @@ CXXFLAGS_i386=	-march=i586
 # prevent conflict with other blender versions
 DATADIR=	${PREFIX}/share/${PORTNAME}${PKGNAMESUFFIX}
 DOCSDIR=	${PREFIX}/share/doc/${PORTNAME}${PKGNAMESUFFIX}
-PLIST_SUB+=	VER=${DISTVERSION:R} SUFFIX=${PKGNAMESUFFIX}
+PLIST_SUB+=	VER=${DISTVERSION:R} SUFFIX=${PKGNAMESUFFIX} CYCLESOSL="@comment "
 OPTIONS_SUB=	yes
 
 .include "${.CURDIR}/Makefile.options"
@@ -53,13 +53,15 @@ OPTIONS_SUB=	yes
 ALEMBIC_CMAKE_BOOL=		WITH_ALEMBIC
 ALEMBIC_LIB_DEPENDS=		libAlembic.so:graphics/alembic
 # note that this needs to be set to match alembics hdf5 option
-ALEMBIC_HDF5_IMPLIES=		ALEMBIC
+ALEMBIC_HDF5_REQUIRES=		ALEMBIC
 ALEMBIC_HDF5_CMAKE_BOOL=	WITH_ALEMBIC_HDF5
 ALEMBIC_HDF5_LIB_DEPENDS=	libhdf5.so:science/hdf5
 AVI_CMAKE_BOOL=			WITH_CODEC_AVI
 BULLET_CMAKE_BOOL=		WITH_BULLET
 CAMERATRACK_CMAKE_BOOL=		WITH_LIBMV
 CAMERATRACK_LIB_DEPENDS=	libunwind.so:devel/libunwind
+CAMERATRACK_ONLY_FOR_ARCHS=	i386 amd64
+CAMERATRACK_ONLY_FOR_ARCHS_REASON=	libunwind only supports x86/amd64
 CINEON_CMAKE_BOOL=		WITH_IMAGE_CINEON
 COLLADA_CMAKE_BOOL=		WITH_OPENCOLLADA
 COLLADA_LIB_DEPENDS=		libOpenCOLLADABaseUtils.so:graphics/opencollada \
@@ -73,6 +75,8 @@ CYCLES_LIB_DEPENDS=		libpugixml.so:textproc/pugixml
 CYCLESEMBR_IMPLIES=		CYCLES
 CYCLESEMBR_CMAKE_BOOL=		WITH_CYCLES_EMBREE
 CYCLESEMBR_LIB_DEPENDS=		libembree3.so:graphics/embree
+CYCLESEMBR_ONLY_FOR_ARCHS=	amd64
+CYCLESEMBR_ONLY_FOR_ARCHS_REASON=	embree only supports amd64
 CYCLESOSL_IMPLIES=		CYCLES
 CYCLESOSL_CMAKE_BOOL=		WITH_CYCLES_OSL WITH_LLVM
 CYCLESOSL_CMAKE_ON=		-DLLVM_STATIC:BOOL=OFF \
@@ -81,10 +85,11 @@ CYCLESOSL_CMAKE_ON=		-DLLVM_STATIC:BOOL=OFF \
 CYCLESOSL_BUILD_DEPENDS=	llvm-config${LLVM_VER}:devel/llvm${LLVM_VER}
 CYCLESOSL_LIB_DEPENDS=		liboslcomp.so:graphics/openshadinglanguage
 CYCLESOSL_RUN_DEPENDS=		llvm-config${LLVM_VER}:devel/llvm${LLVM_VER}
+CYCLESOSL_BROKEN=		OSL not supported with current ocio
 DDS_CMAKE_BOOL=			WITH_IMAGE_DDS
 DRACO_CMAKE_BOOL=		WITH_DRACO
 FFMPEG_CMAKE_BOOL=		WITH_CODEC_FFMPEG
-FFMPEG_LDFLAGS=			-L${PREFIX}/lib -lflite -lflite_cmu_us_kal -lflite_cmulex -lflite_usenglish
+FFMPEG_LDFLAGS=			-L${LOCALBASE}/lib -lflite -lflite_cmu_us_kal -lflite_cmulex -lflite_usenglish
 FFMPEG_LIB_DEPENDS=		libavutil.so:multimedia/ffmpeg \
 				libflite_cmu_us_kal.so:audio/flite
 FFTW3_CMAKE_BOOL=		WITH_FFTW3
@@ -115,7 +120,7 @@ NLS_USES=			gettext iconv:lib,wchar_t
 OPENAL_CMAKE_BOOL=		WITH_OPENAL
 OPENAL_USES=			openal:al,alut
 OPENCOLORIO_CMAKE_BOOL=		WITH_OPENCOLORIO
-OPENCOLORIO_LIB_DEPENDS=	libOpenColorIO.so:graphics/opencolorio \
+OPENCOLORIO_LIB_DEPENDS=	libOpenColorIOv1.so:graphics/opencoloriov1 \
 				libyaml-cpp03.so:devel/yaml-cpp03 \
 				libtinyxml.so:textproc/tinyxml
 OPENEXR_CMAKE_BOOL=		WITH_IMAGE_OPENEXR
@@ -124,9 +129,12 @@ OPENEXR_LIB_DEPENDS=		libImath.so:math/Imath \
 				libOpenEXR.so:graphics/openexr
 OPENIMAGEIO_IMPLIES=		OPENEXR TIFF
 OPENIMAGEIO_CMAKE_BOOL=		WITH_OPENIMAGEIO
-OPENIMAGEIO_LIB_DEPENDS=	libOpenImageIO.so:graphics/openimageio
+OPENIMAGEIO_LIB_DEPENDS=	libOpenImageIO-ociov1.so:graphics/openimageio-ociov1
+#OPENIMAGEIO_LDFLAGS=		-lOpenImageIO_Util-ociov1
 OPENIMAGEDN_CMAKE_BOOL=		WITH_OPENIMAGEDENOISE
 OPENIMAGEDN_LIB_DEPENDS=	libOpenImageDenoise.so:graphics/oidn
+OPENIMAGEDN_ONLY_FOR_ARCHS=	amd64
+OPENIMAGEDN_ONLY_FOR_ARCHS_REASON=	oidn only supports amd64
 # openmp usually works on amd64
 OPENMP_CMAKE_BOOL=		WITH_OPENMP
 OPENSUBDIV_CMAKE_BOOL=		WITH_OPENSUBDIV
@@ -167,8 +175,15 @@ LLVM_VER=	${LLVM_DEFAULT}
 .endif
 
 post-patch-OPENCOLORIO-on:
-	@${REINPLACE_CMD} -e 's|yaml-cpp|&03|' \
-		${PATCH_WRKSRC}/build_files/cmake/Modules/FindOpenColorIO.cmake
+	@${REINPLACE_CMD} -e 's|OpenColorIO/OpenColorIO.h|OpenColorIOv1/OpenColorIO.h|' \
+		${PATCH_WRKSRC}/intern/opencolorio/ocio_impl_glsl.cc \
+		${PATCH_WRKSRC}/intern/opencolorio/ocio_impl.cc \
+		${PATCH_WRKSRC}/intern/cycles/render/colorspace.cpp \
+		${PATCH_WRKSRC}/intern/cycles/render/shader.cpp
+	@${REINPLACE_CMD} -e 's|<OpenImageIO/|<OpenImageIO-ociov1/|' \
+		${PATCH_WRKSRC}/source/blender/imbuf/intern/oiio/openimageio_api.cpp
+	@${FIND} ${PATCH_WRKSRC}/intern/cycles -iname '*.cpp' -or -iname '*.h' | \
+		${XARGS} ${REINPLACE_CMD} -e 's|<OpenImageIO/|<OpenImageIO-ociov1/|'
 
 post-build:
 	@(cd ${WRKSRC}/doc/manpage && \
diff --git a/graphics/blender-lts28/Makefile.options b/graphics/blender-lts28/Makefile.options
index c868ab2a26aa..b488a8ada1a6 100644
--- a/graphics/blender-lts28/Makefile.options
+++ b/graphics/blender-lts28/Makefile.options
@@ -9,7 +9,6 @@ OPTIONS_DEFINE=		\
 	COMPOSITOR 	\
 	CYCLES 		\
 	CYCLESEMBR	\
-	CYCLESOSL 	\
 	DDS 		\
 	DRACO		\
 	FFMPEG 		\
@@ -44,7 +43,8 @@ OPTIONS_DEFINE=		\
 	TIFF		\
 	XINPUT		\
 	XF86VMODE
-
+# OSL needs cutom build with oiio and ocio
+# CYCLESOSL
 OPTIONS_DEFAULT=	\
 	ALEMBIC		\
 	ALEMBIC_HDF5	\
@@ -75,6 +75,7 @@ OPTIONS_DEFAULT=	\
 	OPENEXR		\
 	OPENIMAGEIO	\
 	OPENSUBDIV	\
+	OPENVDB		\
 	RAYOPTIMIZATION	\
 	SDL		\
 	TBB		\
@@ -82,9 +83,6 @@ OPTIONS_DEFAULT=	\
 	XINPUT		\
 	XF86VMODE
 
-# disabled until tbb support
-# OPENVDB
-
 OPTIONS_DEFAULT_amd64=	CAMERATRACK CYCLESEMBR OPENIMAGEDN
 
 ALEMBIC_DESC=		Enable Alembic file support
diff --git a/graphics/blender-lts28/Makefile.versions b/graphics/blender-lts28/Makefile.versions
index 06093b484487..8bfb19615d03 100644
--- a/graphics/blender-lts28/Makefile.versions
+++ b/graphics/blender-lts28/Makefile.versions
@@ -1,6 +1,4 @@
-# $FreeBSD$
-
 # Versions of Blender and its python dependency for use by depending ports, like add-ons
 
-BLENDER_BL_VERSION=	2.83.15
+BLENDER_BL_VERSION=	2.83.18
 BLENDER_PY_VERSION=	3.7
diff --git a/graphics/blender-lts28/distinfo b/graphics/blender-lts28/distinfo
index 6c326a07462e..c597f5edb40e 100644
--- a/graphics/blender-lts28/distinfo
+++ b/graphics/blender-lts28/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1621577075
-SHA256 (blender-2.83.15.tar.xz) = 98362f5c57772cc117a50dc5df2ce68a9fab540534323b099812e5f13fc5c3d9
-SIZE (blender-2.83.15.tar.xz) = 39125740
+TIMESTAMP = 1638698555
+SHA256 (blender-2.83.18.tar.xz) = 3791d0baf68d25920c3eca3b82481b112ad089de8000692e000d5cada503d5c9
+SIZE (blender-2.83.18.tar.xz) = 39128364
diff --git a/graphics/blender-lts28/files/patch-CMakeLists.txt b/graphics/blender-lts28/files/patch-CMakeLists.txt
index f138a4bee9da..2f9b6ba6d850 100644
--- a/graphics/blender-lts28/files/patch-CMakeLists.txt
+++ b/graphics/blender-lts28/files/patch-CMakeLists.txt
@@ -1,4 +1,4 @@
---- CMakeLists.txt.orig	2021-02-23 09:13:59 UTC
+--- CMakeLists.txt.orig	2019-07-31 13:12:04 UTC
 +++ CMakeLists.txt
 @@ -613,11 +613,6 @@ if(NOT WITH_PYTHON)
    set(WITH_DRACO OFF)
@@ -11,7 +11,7 @@
 -
  # enable boost for cycles, audaspace or i18n
  # otherwise if the user disabled
- 
+ if(NOT WITH_BOOST)
 @@ -1552,7 +1547,7 @@ elseif(
    CMAKE_C_COMPILER_ID MATCHES "Intel"
  )
diff --git a/graphics/blender-lts28/files/patch-build__files_cmake_Modules_FindOpenColorIO.cmake b/graphics/blender-lts28/files/patch-build__files_cmake_Modules_FindOpenColorIO.cmake
new file mode 100644
index 000000000000..bbde3f296912
--- /dev/null
+++ b/graphics/blender-lts28/files/patch-build__files_cmake_Modules_FindOpenColorIO.cmake
@@ -0,0 +1,22 @@
+--- build_files/cmake/Modules/FindOpenColorIO.cmake.orig	2021-12-06 15:16:17 UTC
++++ build_files/cmake/Modules/FindOpenColorIO.cmake
+@@ -28,8 +28,8 @@ IF(NOT OPENCOLORIO_ROOT_DIR AND NOT $ENV{OPENCOLORIO_R
+ ENDIF()
+ 
+ SET(_opencolorio_FIND_COMPONENTS
+-  OpenColorIO
+-  yaml-cpp
++  OpenColorIOv1
++  yaml-cpp03
+   tinyxml
+ )
+ 
+@@ -40,7 +40,7 @@ SET(_opencolorio_SEARCH_DIRS
+ 
+ FIND_PATH(OPENCOLORIO_INCLUDE_DIR
+   NAMES
+-    OpenColorIO/OpenColorIO.h
++    OpenColorIOv1/OpenColorIO.h
+   HINTS
+     ${_opencolorio_SEARCH_DIRS}
+   PATH_SUFFIXES
diff --git a/graphics/blender-lts28/files/patch-build__files_cmake_Modules_FindOpenImageIO.cmake b/graphics/blender-lts28/files/patch-build__files_cmake_Modules_FindOpenImageIO.cmake
new file mode 100644
index 000000000000..57b9c0a67663
--- /dev/null
+++ b/graphics/blender-lts28/files/patch-build__files_cmake_Modules_FindOpenImageIO.cmake
@@ -0,0 +1,29 @@
+--- build_files/cmake/Modules/FindOpenImageIO.cmake.orig	2021-12-06 20:51:59 UTC
++++ build_files/cmake/Modules/FindOpenImageIO.cmake
+@@ -36,7 +36,7 @@ SET(_openimageio_SEARCH_DIRS
+ 
+ FIND_PATH(OPENIMAGEIO_INCLUDE_DIR
+   NAMES
+-    OpenImageIO/imageio.h
++    OpenImageIO-ociov1/imageio.h
+   HINTS
+     ${_openimageio_SEARCH_DIRS}
+   PATH_SUFFIXES
+@@ -45,7 +45,7 @@ FIND_PATH(OPENIMAGEIO_INCLUDE_DIR
+ 
+ FIND_LIBRARY(OPENIMAGEIO_LIBRARY
+   NAMES
+-    OpenImageIO
++    OpenImageIO-ociov1
+   HINTS
+     ${_openimageio_SEARCH_DIRS}
+   PATH_SUFFIXES
+@@ -70,7 +70,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenImageIO DEFAULT_
+ IF(OPENIMAGEIO_FOUND)
+   SET(OPENIMAGEIO_LIBRARIES ${OPENIMAGEIO_LIBRARY})
+   SET(OPENIMAGEIO_INCLUDE_DIRS ${OPENIMAGEIO_INCLUDE_DIR})
+-  IF(EXISTS ${OPENIMAGEIO_INCLUDE_DIR}/OpenImageIO/pugixml.hpp)
++  IF(EXISTS ${OPENIMAGEIO_INCLUDE_DIR}/OpenImageIO-ociov1/pugixml.hpp)
+     SET(OPENIMAGEIO_PUGIXML_FOUND TRUE)
+   ELSE()
+     SET(OPENIMAGEIO_PUGIXML_FOUND FALSE)
diff --git a/graphics/blender-lts28/files/tmp-patch-extern_audaspace_bindings_python_PySound.cpp b/graphics/blender-lts28/files/tmp-patch-extern_audaspace_bindings_python_PySound.cpp
deleted file mode 100644
index cd35e1098a1b..000000000000
--- a/graphics/blender-lts28/files/tmp-patch-extern_audaspace_bindings_python_PySound.cpp
+++ /dev/null
@@ -1,11 +0,0 @@
---- extern/audaspace/bindings/python/PySound.cpp.orig	2020-09-02 11:06:51 UTC
-+++ extern/audaspace/bindings/python/PySound.cpp
-@@ -2015,7 +2015,7 @@ AUD_API Sound* checkSound(PyObject* sound)
- 
- bool initializeSound()
- {
--	import_array();
-+	import_array1(false);
- 
- 	return PyType_Ready(&SoundType) >= 0;
- }