From 9498fa9629c064c673f56fbf3a71717a0ac346e7 Mon Sep 17 00:00:00 2001 From: Christoph Willing Date: Wed, 6 Jul 2022 15:34:46 +1000 Subject: graphics/Blender: Patch for openexr-3.x Signed-off-by: Christoph Willing Signed-off-by: Willy Sudiarto Raharjo --- graphics/Blender/Blender.SlackBuild | 4 +- graphics/Blender/blender-3.0.1-openexr.patch | 190 +++++++++++++++++++++++++++ 2 files changed, 193 insertions(+), 1 deletion(-) create mode 100644 graphics/Blender/blender-3.0.1-openexr.patch (limited to 'graphics') diff --git a/graphics/Blender/Blender.SlackBuild b/graphics/Blender/Blender.SlackBuild index 6436396a75..6b15f2804f 100644 --- a/graphics/Blender/Blender.SlackBuild +++ b/graphics/Blender/Blender.SlackBuild @@ -31,7 +31,7 @@ cd $(dirname $0) ; CWD=$(pwd) PRGNAM=Blender VERSION=${VERSION:-3.0.1} -BUILD=${BUILD:-2} +BUILD=${BUILD:-3} TAG=${TAG:-_SBo} PKGTYPE=${PKGTYPE:-tgz} @@ -102,6 +102,8 @@ find -L . \ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+ +if pkg-config --atleast-version=3 OpenEXR ; then patch -p1 < $CWD/blender-3.0.1-openexr.patch ; fi + # 20220322 bkw: 32-bit needs this [ -z "$LIBDIRSUFFIX" ] && patch -p1 < $CWD/overloaded_min.diff diff --git a/graphics/Blender/blender-3.0.1-openexr.patch b/graphics/Blender/blender-3.0.1-openexr.patch new file mode 100644 index 0000000000..435498cd8a --- /dev/null +++ b/graphics/Blender/blender-3.0.1-openexr.patch @@ -0,0 +1,190 @@ +https://src.fedoraproject.org/rpms/blender/blob/rawhide/f/blender-openexr.patch + +--- a/source/blender/imbuf/intern/openexr/openexr_api.cpp ++++ b/source/blender/imbuf/intern/openexr/openexr_api.cpp +@@ -32,30 +32,31 @@ + #include + #include + +-#include ++#include + #include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include + + /* multiview/multipart */ +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include + + #include "DNA_scene_types.h" /* For OpenEXR compression constants */ + +@@ -131,12 +132,12 @@ class IMemStream : public Imf::IStream { + return false; + } + +- Int64 tellg() override ++ uint64_t tellg() override + { + return _exrpos; + } + +- void seekg(Int64 pos) override ++ void seekg(uint64_t pos) override + { + _exrpos = pos; + } +@@ -146,8 +147,8 @@ class IMemStream : public Imf::IStream { + } + + private: +- Int64 _exrpos; +- Int64 _exrsize; ++ uint64_t _exrpos; ++ uint64_t _exrsize; + unsigned char *_exrbuf; + }; + +@@ -182,12 +183,12 @@ class IFileStream : public Imf::IStream + return check_error(); + } + +- Int64 tellg() override ++ uint64_t tellg() override + { + return std::streamoff(ifs.tellg()); + } + +- void seekg(Int64 pos) override ++ void seekg(uint64_t pos) override + { + ifs.seekg(pos); + check_error(); +@@ -231,19 +232,19 @@ class OMemStream : public OStream { + ibuf->encodedsize += n; + } + +- Int64 tellp() override ++ uint64_t tellp() override + { + return offset; + } + +- void seekp(Int64 pos) override ++ void seekp(uint64_t pos) override + { + offset = pos; + ensure_size(offset); + } + + private: +- void ensure_size(Int64 size) ++ void ensure_size(uint64_t size) + { + /* if buffer is too small increase it. */ + while (size > ibuf->encodedbuffersize) { +@@ -254,7 +255,7 @@ class OMemStream : public OStream { + } + + ImBuf *ibuf; +- Int64 offset; ++ uint64_t offset; + }; + + /* File Output Stream */ +@@ -284,12 +285,12 @@ class OFileStream : public OStream { + check_error(); + } + +- Int64 tellp() override ++ uint64_t tellp() override + { + return std::streamoff(ofs.tellp()); + } + +- void seekp(Int64 pos) override ++ void seekp(uint64_t pos) override + { + ofs.seekp(pos); + check_error(); +--- a/build_files/cmake/Modules/FindOpenEXR.cmake ++++ b/build_files/cmake/Modules/FindOpenEXR.cmake +@@ -25,6 +25,7 @@ + # see accompanying file BSD-3-Clause-license.txt for details. + #============================================================================= + ++ + # If OPENEXR_ROOT_DIR was defined in the environment, use it. + IF(NOT OPENEXR_ROOT_DIR AND NOT $ENV{OPENEXR_ROOT_DIR} STREQUAL "") + SET(OPENEXR_ROOT_DIR $ENV{OPENEXR_ROOT_DIR}) +@@ -33,6 +34,16 @@ ENDIF() + # Old versions (before 2.0?) do not have any version string, just assuming this should be fine though. + SET(_openexr_libs_ver_init "2.0") + ++find_package(Imath CONFIG QUIET) ++if(TARGET Imath::Imath) ++SET(_openexr_FIND_COMPONENTS ++ Imath ++ Iex ++ OpenEXR ++ IlmThread ++) ++ ++else() + SET(_openexr_FIND_COMPONENTS + Half + Iex +@@ -40,6 +51,7 @@ SET(_openexr_FIND_COMPONENTS + IlmThread + Imath + ) ++endif() + + SET(_openexr_SEARCH_DIRS + ${OPENEXR_ROOT_DIR} +@@ -121,6 +133,9 @@ IF(OPENEXR_FOUND) + SET(OPENEXR_LIBRARIES ${_openexr_LIBRARIES}) + # Both include paths are needed because of dummy OSL headers mixing #include and #include :( + SET(OPENEXR_INCLUDE_DIRS ${OPENEXR_INCLUDE_DIR} ${OPENEXR_INCLUDE_DIR}/OpenEXR) ++ if(TARGET Imath::Imath) ++ list(APPEND OPENEXR_INCLUDE_DIRS ${OPENEXR_INCLUDE_DIR}/Imath) ++ endif() + ENDIF() + + MARK_AS_ADVANCED( -- cgit v1.2.3-80-g2a13