$ git show --format=fuller --patch-with-stat --summary 228255434b91a2fec48c17f98d344a543cf7792b
commit 228255434b91a2fec48c17f98d344a543cf7792b
Author: itchka (Colin Close) <itchka@compuserve.com>
AuthorDate: Sun May 20 16:33:15 2018 +0100
Commit: itchka (Colin Close) <itchka@compuserve.com>
CommitDate: Sun May 20 16:33:15 2018 +0100
Fix openjpeg libs and min-max issues
---
blender.spec | 15 ++++++++++-----
fix-min-max-declarations.patch | 40 ++++++++++++++++++++++++++++++++++++++++
fix-min-max.patch | 12 ++++++++++++
fix-openjpeg2.2-version.patch | 19 +++++++++++++++++++
4 files changed, 81 insertions(+), 5 deletions(-)
create mode 100644 fix-min-max-declarations.patch
create mode 100644 fix-min-max.patch
create mode 100644 fix-openjpeg2.2-version.patch
diff --git a/blender.spec b/blender.spec
index d94ecf7..cd90239 100644
--- a/blender.spec
+++ b/blender.spec
@@ -10,7 +10,7 @@
Summary: A fully functional 3D modeling/rendering/animation package
Name: blender
Version: 2.76b
-Release: 3
+Release: 4
Group: Graphics
License: GPLv2+
Url: http://www.blender.org/
@@ -24,13 +24,16 @@ Patch3: blender-2.65-openjpeg_stdbool.patch
Patch6: blender-2.67-uninit-var.patch
Patch7: blender-2.71-sse2.patch
Patch8: blender-ffmpeg3.patch
+Patch9: fix-min-max.patch
+Patch10: fix-openjpeg2.2-version.patch
BuildRequires: cmake >= 2.8
BuildRequires: boost-devel
-BuildRequires: ffmpeg-devel >= 0.7
+BuildRequires: pkgconfig(libavcodec)
+#BuildRequires: ffmpeg-devel >= 0.7
BuildRequires: gomp-devel
BuildRequires: jpeg-devel
BuildRequires: jemalloc-devel
-BuildRequires: pkgconfig(libopenjpeg1)
+BuildRequires: pkgconfig(libopenjp2)
BuildRequires: pkgconfig(libtiff-4)
BuildRequires: pkgconfig(glew)
BuildRequires: pkgconfig(glu)
@@ -74,6 +77,8 @@ implemented.
%patch6 -p1
%patch7 -p1
%patch8 -p1
+%patch9 -p1
+%patch10 -p1
%build
#build with gcc for sse and openmp support
@@ -112,7 +117,7 @@ export CXX=g++
-DWITH_CYCLES:BOOL=OFF \
%endif
-DWITH_RAYOPTIMIZATION:BOOL=OFF
-%make
+%make LDFLAGS="$LDFLAGS -lopenjpeg2"
cd ..
mv build non-sse
%endif
@@ -148,7 +153,7 @@ mv build non-sse
-DWITH_CYCLES:BOOL=OFF \
%endif
-DWITH_RAYOPTIMIZATION:BOOL=ON
-%make
+%make LDFLAGS="$LDFLAGS -lopenjpeg2"
%install
#install sse flavour
diff --git a/fix-min-max-declarations.patch b/fix-min-max-declarations.patch
new file mode 100644
index 0000000..e49836b
--- /dev/null
+++ b/fix-min-max-declarations.patch
@@ -0,0 +1,40 @@
+diff --git a/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp b/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp
+index 6bf8277..6173a8f 100644
+--- a/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp
++++ b/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp
+@@ -1102,8 +1102,8 @@ void DirectDrawSurface::mipmap(Image *img, uint face, uint mipmap)
+ // Compute width and height.
+ for (uint m = 0; m < mipmap; m++)
+ {
+- w = max(1U, w / 2);
+- h = max(1U, h / 2);
++ w = fmax(1U, w / 2);
++ h = fmax(1U, h / 2);
+ }
+
+ img->allocate(w, h);
+@@ -1223,9 +1223,9 @@ void DirectDrawSurface::readBlockImage(Image *img)
+ readBlock(&block);
+
+ // Write color block.
+- for (uint y = 0; y < min(4U, h-4*by); y++)
++ for (uint y = 0; y < fmin(4U, h-4*by); y++)
+ {
+- for (uint x = 0; x < min(4U, w-4*bx); x++)
++ for (uint x = 0; x < fmin(4U, w-4*bx); x++)
+ {
+ img->pixel(4*bx+x, 4*by+y) = block.color(x, y);
+ }
+@@ -1379,9 +1379,9 @@ uint DirectDrawSurface::mipmapSize(uint mipmap) const
+
+ for (uint m = 0; m < mipmap; m++)
+ {
+- w = max(1U, w / 2);
+- h = max(1U, h / 2);
+- d = max(1U, d / 2);
++ w = fmax(1U, w / 2);
++ h = fmax(1U, h / 2);
++ d = fmax(1U, d / 2);
+ }
+
+ if (header.pf.flags & DDPF_FOURCC)
diff --git a/fix-min-max.patch b/fix-min-max.patch
new file mode 100644
index 0000000..a25a0ec
--- /dev/null
+++ b/fix-min-max.patch
@@ -0,0 +1,12 @@
+diff --git a/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp b/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp
+index 6bf8277..9511033 100644
+--- a/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp
++++ b/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp
+@@ -55,6 +55,7 @@
+ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ // OTHER DEALINGS IN THE SOFTWARE.
+
++#include <cmath>
+ #include <DirectDrawSurface.h>
+ #include <BlockDXT.h>
+ #include <PixelFormat.h>
diff --git a/fix-openjpeg2.2-version.patch b/fix-openjpeg2.2-version.patch
new file mode 100644
index 0000000..0cb2966
--- /dev/null
+++ b/fix-openjpeg2.2-version.patch
@@ -0,0 +1,19 @@
+diff --git a/build_files/cmake/Modules/FindOpenJPEG.cmake b/build_files/cmake/Modules/FindOpenJPEG.cmake
+index d765103..f9d6998 100644
+--- a/build_files/cmake/Modules/FindOpenJPEG.cmake
++++ b/build_files/cmake/Modules/FindOpenJPEG.cmake
+@@ -42,12 +42,12 @@ FIND_PATH(OPENJPEG_INCLUDE_DIR
+ ${_openjpeg_SEARCH_DIRS}
+ PATH_SUFFIXES
+ include
+- include/openjpeg-1.5
++ include/openjpeg-2.2
+ )
+
+ FIND_LIBRARY(OPENJPEG_LIBRARY
+ NAMES
+- openjpeg
++ openjp2
+ HINTS
+ ${_openjpeg_SEARCH_DIRS}
+ PATH_SUFFIXES