1 |
commit: 884d9dafc85fe80042e62fd1434e9ca7e8668183 |
2 |
Author: Niccolò Belli <niccolo.belli <AT> linuxsystems <DOT> it> |
3 |
AuthorDate: Tue Nov 8 11:40:14 2022 +0000 |
4 |
Commit: Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Nov 27 21:45:46 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=884d9daf |
7 |
|
8 |
sci-physics/bullet: rename altivec vector keywords |
9 |
|
10 |
Altivec vectors can be defined with either the "vector" keyword or the |
11 |
"__vector" type. In general "__vector" should be prefered for |
12 |
include files, as otherwise it might conflicts with other type define |
13 |
in the source code (define a vector class in C++ is quite common). |
14 |
This causes bullet to fail to build on powerpc if the |
15 |
code is compiled with -maltivec, or by default on ppc64el which always |
16 |
has altivec enabled. |
17 |
|
18 |
See also: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=760310 |
19 |
Closes: https://bugs.gentoo.org/852101 |
20 |
Signed-off-by: Niccolò Belli <niccolo.belli <AT> linuxsystems.it> |
21 |
Closes: https://github.com/gentoo/gentoo/pull/28193 |
22 |
Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> gentoo.org> |
23 |
|
24 |
sci-physics/bullet/bullet-3.21.ebuild | 2 ++ |
25 |
...ullet-3.21-replace_altivec_vector_keyword.patch | 24 ++++++++++++++++++++++ |
26 |
2 files changed, 26 insertions(+) |
27 |
|
28 |
diff --git a/sci-physics/bullet/bullet-3.21.ebuild b/sci-physics/bullet/bullet-3.21.ebuild |
29 |
index 2dd6ebe42362..fab2d923dee4 100644 |
30 |
--- a/sci-physics/bullet/bullet-3.21.ebuild |
31 |
+++ b/sci-physics/bullet/bullet-3.21.ebuild |
32 |
@@ -45,6 +45,8 @@ pkg_setup() { |
33 |
} |
34 |
|
35 |
src_prepare() { |
36 |
+ (use ppc || use ppc64) && PATCHES+=( "${FILESDIR}/${P}-replace_altivec_vector_keyword.patch" ) |
37 |
+ |
38 |
cmake_src_prepare |
39 |
|
40 |
# allow to generate docs |
41 |
|
42 |
diff --git a/sci-physics/bullet/files/bullet-3.21-replace_altivec_vector_keyword.patch b/sci-physics/bullet/files/bullet-3.21-replace_altivec_vector_keyword.patch |
43 |
new file mode 100644 |
44 |
index 000000000000..01ef90646d5b |
45 |
--- /dev/null |
46 |
+++ b/sci-physics/bullet/files/bullet-3.21-replace_altivec_vector_keyword.patch |
47 |
@@ -0,0 +1,24 @@ |
48 |
+--- a/src/clew/clew.h 2022-02-16 18:12:48.879740507 +0100 |
49 |
++++ b/src/clew/clew.h 2022-02-16 18:13:32.403061196 +0100 |
50 |
+@@ -319,14 +319,14 @@ |
51 |
+ |
52 |
+ /* Define basic vector types */ |
53 |
+ #if defined(__VEC__) |
54 |
+ #include <altivec.h> /* may be omitted depending on compiler. AltiVec spec provides no way to detect whether the header is required. */ |
55 |
+- typedef vector unsigned char __cl_uchar16; |
56 |
+- typedef vector signed char __cl_char16; |
57 |
+- typedef vector unsigned short __cl_ushort8; |
58 |
+- typedef vector signed short __cl_short8; |
59 |
+- typedef vector unsigned int __cl_uint4; |
60 |
+- typedef vector signed int __cl_int4; |
61 |
+- typedef vector float __cl_float4; |
62 |
++ typedef __vector unsigned char __cl_uchar16; |
63 |
++ typedef __vector signed char __cl_char16; |
64 |
++ typedef __vector unsigned short __cl_ushort8; |
65 |
++ typedef __vector signed short __cl_short8; |
66 |
++ typedef __vector unsigned int __cl_uint4; |
67 |
++ typedef __vector signed int __cl_int4; |
68 |
++ typedef __vector float __cl_float4; |
69 |
+ #define __CL_UCHAR16__ 1 |
70 |
+ #define __CL_CHAR16__ 1 |
71 |
+ #define __CL_USHORT8__ 1 |