blender-3.0.1-openexr.patch 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. https://src.fedoraproject.org/rpms/blender/blob/rawhide/f/blender-openexr.patch
  2. --- a/source/blender/imbuf/intern/openexr/openexr_api.cpp
  3. +++ b/source/blender/imbuf/intern/openexr/openexr_api.cpp
  4. @@ -32,30 +32,31 @@
  5. #include <stdexcept>
  6. #include <string>
  7. -#include <Iex.h>
  8. +#include <OpenEXR/Iex.h>
  9. #include <ImathBox.h>
  10. -#include <ImfArray.h>
  11. -#include <ImfChannelList.h>
  12. -#include <ImfCompression.h>
  13. -#include <ImfCompressionAttribute.h>
  14. -#include <ImfIO.h>
  15. -#include <ImfInputFile.h>
  16. -#include <ImfOutputFile.h>
  17. -#include <ImfPixelType.h>
  18. -#include <ImfStandardAttributes.h>
  19. -#include <ImfStringAttribute.h>
  20. -#include <ImfVersion.h>
  21. -#include <half.h>
  22. +#include <OpenEXR/ImfArray.h>
  23. +#include <OpenEXR/ImfFrameBuffer.h>
  24. +#include <OpenEXR/ImfChannelList.h>
  25. +#include <OpenEXR/ImfCompression.h>
  26. +#include <OpenEXR/ImfCompressionAttribute.h>
  27. +#include <OpenEXR/ImfIO.h>
  28. +#include <OpenEXR/ImfInputFile.h>
  29. +#include <OpenEXR/ImfOutputFile.h>
  30. +#include <OpenEXR/ImfPixelType.h>
  31. +#include <OpenEXR/ImfStandardAttributes.h>
  32. +#include <OpenEXR/ImfStringAttribute.h>
  33. +#include <OpenEXR/ImfVersion.h>
  34. +#include <Imath/half.h>
  35. /* multiview/multipart */
  36. -#include <ImfInputPart.h>
  37. -#include <ImfMultiPartInputFile.h>
  38. -#include <ImfMultiPartOutputFile.h>
  39. -#include <ImfMultiView.h>
  40. -#include <ImfOutputPart.h>
  41. -#include <ImfPartHelper.h>
  42. -#include <ImfPartType.h>
  43. -#include <ImfTiledOutputPart.h>
  44. +#include <OpenEXR/ImfInputPart.h>
  45. +#include <OpenEXR/ImfMultiPartInputFile.h>
  46. +#include <OpenEXR/ImfMultiPartOutputFile.h>
  47. +#include <OpenEXR/ImfMultiView.h>
  48. +#include <OpenEXR/ImfOutputPart.h>
  49. +#include <OpenEXR/ImfPartHelper.h>
  50. +#include <OpenEXR/ImfPartType.h>
  51. +#include <OpenEXR/ImfTiledOutputPart.h>
  52. #include "DNA_scene_types.h" /* For OpenEXR compression constants */
  53. @@ -131,12 +132,12 @@ class IMemStream : public Imf::IStream {
  54. return false;
  55. }
  56. - Int64 tellg() override
  57. + uint64_t tellg() override
  58. {
  59. return _exrpos;
  60. }
  61. - void seekg(Int64 pos) override
  62. + void seekg(uint64_t pos) override
  63. {
  64. _exrpos = pos;
  65. }
  66. @@ -146,8 +147,8 @@ class IMemStream : public Imf::IStream {
  67. }
  68. private:
  69. - Int64 _exrpos;
  70. - Int64 _exrsize;
  71. + uint64_t _exrpos;
  72. + uint64_t _exrsize;
  73. unsigned char *_exrbuf;
  74. };
  75. @@ -182,12 +183,12 @@ class IFileStream : public Imf::IStream
  76. return check_error();
  77. }
  78. - Int64 tellg() override
  79. + uint64_t tellg() override
  80. {
  81. return std::streamoff(ifs.tellg());
  82. }
  83. - void seekg(Int64 pos) override
  84. + void seekg(uint64_t pos) override
  85. {
  86. ifs.seekg(pos);
  87. check_error();
  88. @@ -231,19 +232,19 @@ class OMemStream : public OStream {
  89. ibuf->encodedsize += n;
  90. }
  91. - Int64 tellp() override
  92. + uint64_t tellp() override
  93. {
  94. return offset;
  95. }
  96. - void seekp(Int64 pos) override
  97. + void seekp(uint64_t pos) override
  98. {
  99. offset = pos;
  100. ensure_size(offset);
  101. }
  102. private:
  103. - void ensure_size(Int64 size)
  104. + void ensure_size(uint64_t size)
  105. {
  106. /* if buffer is too small increase it. */
  107. while (size > ibuf->encodedbuffersize) {
  108. @@ -254,7 +255,7 @@ class OMemStream : public OStream {
  109. }
  110. ImBuf *ibuf;
  111. - Int64 offset;
  112. + uint64_t offset;
  113. };
  114. /* File Output Stream */
  115. @@ -284,12 +285,12 @@ class OFileStream : public OStream {
  116. check_error();
  117. }
  118. - Int64 tellp() override
  119. + uint64_t tellp() override
  120. {
  121. return std::streamoff(ofs.tellp());
  122. }
  123. - void seekp(Int64 pos) override
  124. + void seekp(uint64_t pos) override
  125. {
  126. ofs.seekp(pos);
  127. check_error();
  128. --- a/build_files/cmake/Modules/FindOpenEXR.cmake
  129. +++ b/build_files/cmake/Modules/FindOpenEXR.cmake
  130. @@ -25,6 +25,7 @@
  131. # see accompanying file BSD-3-Clause-license.txt for details.
  132. #=============================================================================
  133. +
  134. # If OPENEXR_ROOT_DIR was defined in the environment, use it.
  135. IF(NOT OPENEXR_ROOT_DIR AND NOT $ENV{OPENEXR_ROOT_DIR} STREQUAL "")
  136. SET(OPENEXR_ROOT_DIR $ENV{OPENEXR_ROOT_DIR})
  137. @@ -33,6 +34,16 @@ ENDIF()
  138. # Old versions (before 2.0?) do not have any version string, just assuming this should be fine though.
  139. SET(_openexr_libs_ver_init "2.0")
  140. +find_package(Imath CONFIG QUIET)
  141. +if(TARGET Imath::Imath)
  142. +SET(_openexr_FIND_COMPONENTS
  143. + Imath
  144. + Iex
  145. + OpenEXR
  146. + IlmThread
  147. +)
  148. +
  149. +else()
  150. SET(_openexr_FIND_COMPONENTS
  151. Half
  152. Iex
  153. @@ -40,6 +51,7 @@ SET(_openexr_FIND_COMPONENTS
  154. IlmThread
  155. Imath
  156. )
  157. +endif()
  158. SET(_openexr_SEARCH_DIRS
  159. ${OPENEXR_ROOT_DIR}
  160. @@ -121,6 +133,9 @@ IF(OPENEXR_FOUND)
  161. SET(OPENEXR_LIBRARIES ${_openexr_LIBRARIES})
  162. # Both include paths are needed because of dummy OSL headers mixing #include <OpenEXR/foo.h> and #include <foo.h> :(
  163. SET(OPENEXR_INCLUDE_DIRS ${OPENEXR_INCLUDE_DIR} ${OPENEXR_INCLUDE_DIR}/OpenEXR)
  164. + if(TARGET Imath::Imath)
  165. + list(APPEND OPENEXR_INCLUDE_DIRS ${OPENEXR_INCLUDE_DIR}/Imath)
  166. + endif()
  167. ENDIF()
  168. MARK_AS_ADVANCED(