1 |
commit: 3259951943dda77ac2072c4079668c948537f82a |
2 |
Author: Jonathan Scruggs <j.scruggs <AT> gmail <DOT> com> |
3 |
AuthorDate: Thu Sep 22 17:26:26 2016 +0000 |
4 |
Commit: Michael Palimaka <kensington <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Sep 29 15:12:39 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=32599519 |
7 |
|
8 |
media-gfx/blender: add gcc-6 compile fix |
9 |
|
10 |
Not doing a revision bump as this patch only affects compiling |
11 |
with GCC 6. |
12 |
|
13 |
- Remove one dependency as it's not even used at all |
14 |
- Add patch that fixes compiling with GCC 6 |
15 |
Closes Gentoo-Bug: 594694 |
16 |
|
17 |
Signed off by Jonathan Scruggs (j.scruggs <AT> gmail.com, irc: Dracwyrm) |
18 |
|
19 |
media-gfx/blender/blender-2.72b-r4.ebuild | 2 +- |
20 |
.../blender/files/blender-2.72b-gcc6-fixes.patch | 126 +++++++++++++++++++++ |
21 |
2 files changed, 127 insertions(+), 1 deletion(-) |
22 |
|
23 |
diff --git a/media-gfx/blender/blender-2.72b-r4.ebuild b/media-gfx/blender/blender-2.72b-r4.ebuild |
24 |
index c0a7e4d..970b009 100644 |
25 |
--- a/media-gfx/blender/blender-2.72b-r4.ebuild |
26 |
+++ b/media-gfx/blender/blender-2.72b-r4.ebuild |
27 |
@@ -68,7 +68,6 @@ RDEPEND=" |
28 |
media-libs/glew |
29 |
media-libs/libpng:0 |
30 |
media-libs/libsamplerate |
31 |
- sci-libs/ldl |
32 |
sys-libs/zlib |
33 |
virtual/glu |
34 |
virtual/jpeg:0 |
35 |
@@ -112,6 +111,7 @@ PATCHES=( |
36 |
"${FILESDIR}"/${PN}-2.70-sse2.patch |
37 |
"${FILESDIR}"/${PN}-2.72-T42797.diff |
38 |
"${FILESDIR}"/${P}-fix-util_simd.patch |
39 |
+ "${FILESDIR}"/${P}-gcc6-fixes.patch |
40 |
) |
41 |
|
42 |
pkg_pretend() { |
43 |
|
44 |
diff --git a/media-gfx/blender/files/blender-2.72b-gcc6-fixes.patch b/media-gfx/blender/files/blender-2.72b-gcc6-fixes.patch |
45 |
new file mode 100644 |
46 |
index 00000000..1c4ab09 |
47 |
--- /dev/null |
48 |
+++ b/media-gfx/blender/files/blender-2.72b-gcc6-fixes.patch |
49 |
@@ -0,0 +1,126 @@ |
50 |
+diff -purN a/source/blender/imbuf/intern/dds/ColorBlock.cpp b/source/blender/imbuf/intern/dds/ColorBlock.cpp |
51 |
+--- a/source/blender/imbuf/intern/dds/ColorBlock.cpp 2014-10-20 08:58:23.000000000 +0100 |
52 |
++++ b/source/blender/imbuf/intern/dds/ColorBlock.cpp 2016-09-22 15:50:25.359318967 +0100 |
53 |
+@@ -86,8 +86,8 @@ void ColorBlock::init(const Image *img, |
54 |
+ |
55 |
+ void ColorBlock::init(uint w, uint h, const uint *data, uint x, uint y) |
56 |
+ { |
57 |
+- const uint bw = min(w - x, 4U); |
58 |
+- const uint bh = min(h - y, 4U); |
59 |
++ const uint bw = MIN(w - x, 4U); |
60 |
++ const uint bh = MIN(h - y, 4U); |
61 |
+ |
62 |
+ // Blocks that are smaller than 4x4 are handled by repeating the pixels. |
63 |
+ // @@ Thats only correct when block size is 1, 2 or 4, but not with 3. :( |
64 |
+@@ -107,8 +107,8 @@ void ColorBlock::init(uint w, uint h, co |
65 |
+ |
66 |
+ void ColorBlock::init(uint w, uint h, const float *data, uint x, uint y) |
67 |
+ { |
68 |
+- const uint bw = min(w - x, 4U); |
69 |
+- const uint bh = min(h - y, 4U); |
70 |
++ const uint bw = MIN(w - x, 4U); |
71 |
++ const uint bh = MIN(h - y, 4U); |
72 |
+ |
73 |
+ // Blocks that are smaller than 4x4 are handled by repeating the pixels. |
74 |
+ // @@ Thats only correct when block size is 1, 2 or 4, but not with 3. :( |
75 |
+@@ -124,10 +124,10 @@ void ColorBlock::init(uint w, uint h, co |
76 |
+ const uint idx = ((y + by) * w + x + bx); |
77 |
+ |
78 |
+ Color32 & c = color(e, i); |
79 |
+- c.r = uint8(255 * clamp(data[idx + 0 * srcPlane], 0.0f, 1.0f)); // @@ Is this the right way to quantize floats to bytes? |
80 |
+- c.g = uint8(255 * clamp(data[idx + 1 * srcPlane], 0.0f, 1.0f)); |
81 |
+- c.b = uint8(255 * clamp(data[idx + 2 * srcPlane], 0.0f, 1.0f)); |
82 |
+- c.a = uint8(255 * clamp(data[idx + 3 * srcPlane], 0.0f, 1.0f)); |
83 |
++ c.r = uint8(255 * CLAMP(data[idx + 0 * srcPlane], 0.0f, 1.0f)); // @@ Is this the right way to quantize floats to bytes? |
84 |
++ c.g = uint8(255 * CLAMP(data[idx + 1 * srcPlane], 0.0f, 1.0f)); |
85 |
++ c.b = uint8(255 * CLAMP(data[idx + 2 * srcPlane], 0.0f, 1.0f)); |
86 |
++ c.a = uint8(255 * CLAMP(data[idx + 3 * srcPlane], 0.0f, 1.0f)); |
87 |
+ } |
88 |
+ } |
89 |
+ } |
90 |
+diff -purN a/source/blender/imbuf/intern/dds/Common.h b/source/blender/imbuf/intern/dds/Common.h |
91 |
+--- a/source/blender/imbuf/intern/dds/Common.h 2014-10-20 08:58:23.000000000 +0100 |
92 |
++++ b/source/blender/imbuf/intern/dds/Common.h 2016-09-22 15:47:31.327081239 +0100 |
93 |
+@@ -28,14 +28,14 @@ |
94 |
+ #ifndef __COMMON_H__ |
95 |
+ #define __COMMON_H__ |
96 |
+ |
97 |
+-#ifndef min |
98 |
+-#define min(a,b) ((a) <= (b) ? (a) : (b)) |
99 |
++#ifndef MIN |
100 |
++#define MIN(a,b) ((a) <= (b) ? (a) : (b)) |
101 |
+ #endif |
102 |
+-#ifndef max |
103 |
+-#define max(a,b) ((a) >= (b) ? (a) : (b)) |
104 |
++#ifndef MAX |
105 |
++#define MAX(a,b) ((a) >= (b) ? (a) : (b)) |
106 |
+ #endif |
107 |
+-#ifndef clamp |
108 |
+-#define clamp(x,a,b) min(max((x), (a)), (b)) |
109 |
++#ifndef CLAMP |
110 |
++#define CLAMP(x,a,b) MIN(MAX((x), (a)), (b)) |
111 |
+ #endif |
112 |
+ |
113 |
+ template<typename T> |
114 |
+diff -purN a/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp b/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp |
115 |
+--- a/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp 2014-10-20 08:58:23.000000000 +0100 |
116 |
++++ b/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp 2016-09-22 16:10:53.985775837 +0100 |
117 |
+@@ -1102,8 +1102,8 @@ void DirectDrawSurface::mipmap(Image *im |
118 |
+ // Compute width and height. |
119 |
+ for (uint m = 0; m < mipmap; m++) |
120 |
+ { |
121 |
+- w = max(1U, w / 2); |
122 |
+- h = max(1U, h / 2); |
123 |
++ w = MAX(1U, w / 2); |
124 |
++ h = MAX(1U, h / 2); |
125 |
+ } |
126 |
+ |
127 |
+ img->allocate(w, h); |
128 |
+@@ -1223,9 +1223,9 @@ void DirectDrawSurface::readBlockImage(I |
129 |
+ readBlock(&block); |
130 |
+ |
131 |
+ // Write color block. |
132 |
+- for (uint y = 0; y < min(4U, h-4*by); y++) |
133 |
++ for (uint y = 0; y < MIN(4U, h-4*by); y++) |
134 |
+ { |
135 |
+- for (uint x = 0; x < min(4U, w-4*bx); x++) |
136 |
++ for (uint x = 0; x < MIN(4U, w-4*bx); x++) |
137 |
+ { |
138 |
+ img->pixel(4*bx+x, 4*by+y) = block.color(x, y); |
139 |
+ } |
140 |
+@@ -1240,7 +1240,7 @@ static Color32 buildNormal(uint8 x, uint |
141 |
+ float ny = 2 * (y / 255.0f) - 1; |
142 |
+ float nz = 0.0f; |
143 |
+ if (1 - nx*nx - ny*ny > 0) nz = sqrt(1 - nx*nx - ny*ny); |
144 |
+- uint8 z = clamp(int(255.0f * (nz + 1) / 2.0f), 0, 255); |
145 |
++ uint8 z = CLAMP(int(255.0f * (nz + 1) / 2.0f), 0, 255); |
146 |
+ |
147 |
+ return Color32(x, y, z); |
148 |
+ } |
149 |
+@@ -1379,9 +1379,9 @@ uint DirectDrawSurface::mipmapSize(uint |
150 |
+ |
151 |
+ for (uint m = 0; m < mipmap; m++) |
152 |
+ { |
153 |
+- w = max(1U, w / 2); |
154 |
+- h = max(1U, h / 2); |
155 |
+- d = max(1U, d / 2); |
156 |
++ w = MAX(1U, w / 2); |
157 |
++ h = MAX(1U, h / 2); |
158 |
++ d = MAX(1U, d / 2); |
159 |
+ } |
160 |
+ |
161 |
+ if (header.pf.flags & DDPF_FOURCC) |
162 |
+diff -purN a/source/blender/imbuf/intern/dds/FlipDXT.cpp b/source/blender/imbuf/intern/dds/FlipDXT.cpp |
163 |
+--- a/source/blender/imbuf/intern/dds/FlipDXT.cpp 2014-10-20 08:58:23.000000000 +0100 |
164 |
++++ b/source/blender/imbuf/intern/dds/FlipDXT.cpp 2016-09-22 16:11:35.626829002 +0100 |
165 |
+@@ -246,8 +246,8 @@ int FlipDXTCImage(unsigned int width, un |
166 |
+ |
167 |
+ // mip levels are contiguous. |
168 |
+ data += block_bytes * blocks; |
169 |
+- mip_width = max(1U, mip_width >> 1); |
170 |
+- mip_height = max(1U, mip_height >> 1); |
171 |
++ mip_width = MAX(1U, mip_width >> 1); |
172 |
++ mip_height = MAX(1U, mip_height >> 1); |
173 |
+ } |
174 |
+ |
175 |
+ return 1; |