1 |
commit: 3c7abed13a49d96d90fdeda81bba828271cace87 |
2 |
Author: Bernd Waibel <waebbl-gentoo <AT> posteo <DOT> net> |
3 |
AuthorDate: Thu Apr 28 06:06:12 2022 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Apr 29 02:22:31 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3c7abed1 |
7 |
|
8 |
media-libs/assimp: build with gcc-12 |
9 |
|
10 |
Fix an -Werror=array-bounds issue with gcc-12, by patching out the |
11 |
global -Werror flag used by upstream. |
12 |
Drop failing tests for x86_32. |
13 |
|
14 |
Closes: https://bugs.gentoo.org/840616 |
15 |
Closes: https://bugs.gentoo.org/840767 |
16 |
Bug: https://github.com/assimp/assimp/issues/4438 |
17 |
Bug: https://github.com/assimp/assimp/issues/4433 |
18 |
Signed-off-by: Bernd Waibel <waebbl-gentoo <AT> posteo.net> |
19 |
Closes: https://github.com/gentoo/gentoo/pull/25234 |
20 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
21 |
|
22 |
media-libs/assimp/assimp-5.2.3.ebuild | 9 ++ |
23 |
.../assimp-5.2.3-drop-Werror-gcc-option.patch | 22 ++++ |
24 |
...p-5.2.3-drop-failing-tests-for-abi_x86_32.patch | 131 +++++++++++++++++++++ |
25 |
3 files changed, 162 insertions(+) |
26 |
|
27 |
diff --git a/media-libs/assimp/assimp-5.2.3.ebuild b/media-libs/assimp/assimp-5.2.3.ebuild |
28 |
index ba654ddd393f..451858172fc2 100644 |
29 |
--- a/media-libs/assimp/assimp-5.2.3.ebuild |
30 |
+++ b/media-libs/assimp/assimp-5.2.3.ebuild |
31 |
@@ -32,11 +32,20 @@ BDEPEND=" |
32 |
|
33 |
PATCHES=( |
34 |
"${FILESDIR}"/${PN}-5.2.2-fix-usage-of-incompatible-minizip-data-structure.patch |
35 |
+ "${FILESDIR}"/${P}-drop-Werror-gcc-option.patch |
36 |
"${FILESDIR}"/${PN}-5.2.2-disable-failing-tests.patch |
37 |
) |
38 |
|
39 |
DOCS=( CodeConventions.md Readme.md ) |
40 |
|
41 |
+src_prepare() { |
42 |
+ if use abi_x86_32; then |
43 |
+ eapply "${FILESDIR}"/${P}-drop-failing-tests-for-abi_x86_32.patch |
44 |
+ fi |
45 |
+ |
46 |
+ cmake_src_prepare |
47 |
+} |
48 |
+ |
49 |
src_configure() { |
50 |
local mycmakeargs=( |
51 |
-DASSIMP_ASAN=OFF |
52 |
|
53 |
diff --git a/media-libs/assimp/files/assimp-5.2.3-drop-Werror-gcc-option.patch b/media-libs/assimp/files/assimp-5.2.3-drop-Werror-gcc-option.patch |
54 |
new file mode 100644 |
55 |
index 000000000000..708f45ee3503 |
56 |
--- /dev/null |
57 |
+++ b/media-libs/assimp/files/assimp-5.2.3-drop-Werror-gcc-option.patch |
58 |
@@ -0,0 +1,22 @@ |
59 |
+From dea8b4d8c533c131bd546c316f8df8af8897ac75 Mon Sep 17 00:00:00 2001 |
60 |
+From: Bernd Waibel <waebbl-gentoo@××××××.net> |
61 |
+Date: Mon, 25 Apr 2022 17:39:33 +0200 |
62 |
+Subject: [PATCH] drop -Werror gcc option |
63 |
+ |
64 |
+Temporary hack to allow building with gcc-12 |
65 |
+ |
66 |
+Signed-off-by: Bernd Waibel <waebbl-gentoo@××××××.net> |
67 |
+--- a/code/CMakeLists.txt |
68 |
++++ b/code/CMakeLists.txt |
69 |
+@@ -1179,8 +1179,6 @@ TARGET_USE_COMMON_OUTPUT_DIRECTORY(assimp) |
70 |
+ # enable warnings as errors ######################################## |
71 |
+ IF (MSVC) |
72 |
+ TARGET_COMPILE_OPTIONS(assimp PRIVATE /WX) |
73 |
+-ELSE() |
74 |
+- TARGET_COMPILE_OPTIONS(assimp PRIVATE -Werror) |
75 |
+ ENDIF() |
76 |
+ |
77 |
+ # adds C_FLAGS required to compile zip.c on old GCC 4.x compiler |
78 |
+-- |
79 |
+2.35.1 |
80 |
+ |
81 |
|
82 |
diff --git a/media-libs/assimp/files/assimp-5.2.3-drop-failing-tests-for-abi_x86_32.patch b/media-libs/assimp/files/assimp-5.2.3-drop-failing-tests-for-abi_x86_32.patch |
83 |
new file mode 100644 |
84 |
index 000000000000..4c4ea0486a2f |
85 |
--- /dev/null |
86 |
+++ b/media-libs/assimp/files/assimp-5.2.3-drop-failing-tests-for-abi_x86_32.patch |
87 |
@@ -0,0 +1,131 @@ |
88 |
+From f963a15bbbcfa1e3c4bd0c24173f90151e023469 Mon Sep 17 00:00:00 2001 |
89 |
+From: Bernd Waibel <waebbl-gentoo@××××××.net> |
90 |
+Date: Thu, 28 Apr 2022 07:59:26 +0200 |
91 |
+Subject: [PATCH] drop failing tests for abi_x86_32 |
92 |
+ |
93 |
+Signed-off-by: Bernd Waibel <waebbl-gentoo@××××××.net> |
94 |
+--- a/test/unit/AssimpAPITest_aiMatrix3x3.cpp |
95 |
++++ b/test/unit/AssimpAPITest_aiMatrix3x3.cpp |
96 |
+@@ -68,13 +68,6 @@ TEST_F(AssimpAPITest_aiMatrix3x3, aiMatrix3FromMatrix4Test) { |
97 |
+ EXPECT_EQ(result_cpp, result_c); |
98 |
+ } |
99 |
+ |
100 |
+-TEST_F(AssimpAPITest_aiMatrix3x3, aiMatrix3FromQuaternionTest) { |
101 |
+- const auto q = random_quat(); |
102 |
+- result_cpp = q.GetMatrix(); |
103 |
+- aiMatrix3FromQuaternion(&result_c, &q); |
104 |
+- EXPECT_EQ(result_cpp, result_c); |
105 |
+-} |
106 |
+- |
107 |
+ TEST_F(AssimpAPITest_aiMatrix3x3, aiMatrix3AreEqualTest) { |
108 |
+ result_c = result_cpp = random_mat3(); |
109 |
+ EXPECT_EQ(result_cpp == result_c, |
110 |
+--- a/test/unit/AssimpAPITest_aiMatrix4x4.cpp |
111 |
++++ b/test/unit/AssimpAPITest_aiMatrix4x4.cpp |
112 |
+@@ -78,15 +78,6 @@ TEST_F(AssimpAPITest_aiMatrix4x4, aiMatrix4FromMatrix3Test) { |
113 |
+ EXPECT_EQ(result_cpp, result_c); |
114 |
+ } |
115 |
+ |
116 |
+-TEST_F(AssimpAPITest_aiMatrix4x4, aiMatrix4FromScalingQuaternionPositionTest) { |
117 |
+- const aiVector3D s = random_vec3(); |
118 |
+- const aiQuaternion q = random_quat(); |
119 |
+- const aiVector3D t = random_vec3(); |
120 |
+- result_cpp = aiMatrix4x4(s, q, t); |
121 |
+- aiMatrix4FromScalingQuaternionPosition(&result_c, &s, &q, &t); |
122 |
+- EXPECT_EQ(result_cpp, result_c); |
123 |
+-} |
124 |
+- |
125 |
+ TEST_F(AssimpAPITest_aiMatrix4x4, aiMatrix4AddTest) { |
126 |
+ const aiMatrix4x4 temp = random_mat4(); |
127 |
+ result_c = result_cpp = random_mat4(); |
128 |
+@@ -135,12 +126,6 @@ TEST_F(AssimpAPITest_aiMatrix4x4, aiMatrix4InverseTest) { |
129 |
+ EXPECT_EQ(result_cpp, result_c); |
130 |
+ } |
131 |
+ |
132 |
+-TEST_F(AssimpAPITest_aiMatrix4x4, aiMatrix4DeterminantTest) { |
133 |
+- result_c = result_cpp = random_mat4(); |
134 |
+- EXPECT_EQ(result_cpp.Determinant(), |
135 |
+- aiMatrix4Determinant(&result_c)); |
136 |
+-} |
137 |
+- |
138 |
+ TEST_F(AssimpAPITest_aiMatrix4x4, aiMatrix4IsIdentityTest) { |
139 |
+ EXPECT_EQ(result_cpp.IsIdentity(), |
140 |
+ (bool)aiMatrix4IsIdentity(&result_c)); |
141 |
+--- a/test/unit/AssimpAPITest_aiQuaternion.cpp |
142 |
++++ b/test/unit/AssimpAPITest_aiQuaternion.cpp |
143 |
+@@ -54,19 +54,6 @@ protected: |
144 |
+ aiQuaternion result_c, result_cpp; |
145 |
+ }; |
146 |
+ |
147 |
+-TEST_F(AssimpAPITest_aiQuaternion, aiCreateQuaternionFromMatrixTest) { |
148 |
+- // Use a predetermined transformation matrix |
149 |
+- // to prevent running into division by zero. |
150 |
+- aiMatrix3x3 m, r; |
151 |
+- aiMatrix3x3::Translation(aiVector2D(14,-25), m); |
152 |
+- aiMatrix3x3::RotationZ(Math::aiPi<float>() / 4.0f, r); |
153 |
+- m = m * r; |
154 |
+- |
155 |
+- result_cpp = aiQuaternion(m); |
156 |
+- aiCreateQuaternionFromMatrix(&result_c, &m); |
157 |
+- EXPECT_EQ(result_cpp, result_c); |
158 |
+-} |
159 |
+- |
160 |
+ TEST_F(AssimpAPITest_aiQuaternion, aiQuaternionFromEulerAnglesTest) { |
161 |
+ const float x(RandPI.next()), |
162 |
+ y(RandPI.next()), |
163 |
+--- a/test/unit/AssimpAPITest_aiVector2D.cpp |
164 |
++++ b/test/unit/AssimpAPITest_aiVector2D.cpp |
165 |
+@@ -67,28 +67,6 @@ TEST_F(AssimpAPITest_aiVector2D, aiVector2AreEqualEpsilonTest) { |
166 |
+ (bool)aiVector2AreEqualEpsilon(&result_cpp, &result_c, Epsilon)); |
167 |
+ } |
168 |
+ |
169 |
+-TEST_F(AssimpAPITest_aiVector2D, aiVector2AddTest) { |
170 |
+- result_c = result_cpp = random_vec2(); |
171 |
+- result_cpp += temp; |
172 |
+- aiVector2Add(&result_c, &temp); |
173 |
+- EXPECT_EQ(result_cpp, result_c); |
174 |
+-} |
175 |
+- |
176 |
+-TEST_F(AssimpAPITest_aiVector2D, aiVector2SubtractTest) { |
177 |
+- result_c = result_cpp = random_vec2(); |
178 |
+- result_cpp -= temp; |
179 |
+- aiVector2Subtract(&result_c, &temp); |
180 |
+- EXPECT_EQ(result_cpp, result_c); |
181 |
+-} |
182 |
+- |
183 |
+-TEST_F(AssimpAPITest_aiVector2D, aiVector2ScaleTest) { |
184 |
+- const float FACTOR = RandNonZero.next(); |
185 |
+- result_c = result_cpp = random_vec2(); |
186 |
+- result_cpp *= FACTOR; |
187 |
+- aiVector2Scale(&result_c, FACTOR); |
188 |
+- EXPECT_EQ(result_cpp, result_c); |
189 |
+-} |
190 |
+- |
191 |
+ TEST_F(AssimpAPITest_aiVector2D, aiVector2SymMulTest) { |
192 |
+ result_c = result_cpp = random_vec2(); |
193 |
+ result_cpp = result_cpp.SymMul(temp); |
194 |
+@@ -96,21 +74,6 @@ TEST_F(AssimpAPITest_aiVector2D, aiVector2SymMulTest) { |
195 |
+ EXPECT_EQ(result_cpp, result_c); |
196 |
+ } |
197 |
+ |
198 |
+-TEST_F(AssimpAPITest_aiVector2D, aiVector2DivideByScalarTest) { |
199 |
+- const float DIVISOR = RandNonZero.next(); |
200 |
+- result_c = result_cpp = random_vec2(); |
201 |
+- result_cpp /= DIVISOR; |
202 |
+- aiVector2DivideByScalar(&result_c, DIVISOR); |
203 |
+- EXPECT_EQ(result_cpp, result_c); |
204 |
+-} |
205 |
+- |
206 |
+-TEST_F(AssimpAPITest_aiVector2D, aiVector2DivideByVectorTest) { |
207 |
+- result_c = result_cpp = random_vec2(); |
208 |
+- result_cpp = result_cpp / temp; |
209 |
+- aiVector2DivideByVector(&result_c, &temp); |
210 |
+- EXPECT_EQ(result_cpp, result_c); |
211 |
+-} |
212 |
+- |
213 |
+ TEST_F(AssimpAPITest_aiVector2D, aiVector2LengthTest) { |
214 |
+ result_c = result_cpp = random_vec2(); |
215 |
+ EXPECT_EQ(result_cpp.Length(), aiVector2Length(&result_c)); |
216 |
+-- |
217 |
+2.35.1 |
218 |
+ |