summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiccolò Belli <niccolo.belli@linuxsystems.it>2022-11-08 12:40:14 +0100
committerAndrew Ammerlaan <andrewammerlaan@gentoo.org>2022-11-27 22:45:46 +0100
commit884d9dafc85fe80042e62fd1434e9ca7e8668183 (patch)
tree427fd1274fe07ee4324605cd3763eff789d578f9
parentwww-client/vivaldi: Drop old 5.5.2805.42 (diff)
downloadgentoo-884d9daf.tar.gz
gentoo-884d9daf.tar.bz2
gentoo-884d9daf.zip
sci-physics/bullet: rename altivec vector keywords
Altivec vectors can be defined with either the "vector" keyword or the "__vector" type. In general "__vector" should be prefered for include files, as otherwise it might conflicts with other type define in the source code (define a vector class in C++ is quite common). This causes bullet to fail to build on powerpc if the code is compiled with -maltivec, or by default on ppc64el which always has altivec enabled. See also: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=760310 Closes: https://bugs.gentoo.org/852101 Signed-off-by: Niccolò Belli <niccolo.belli@linuxsystems.it> Closes: https://github.com/gentoo/gentoo/pull/28193 Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
-rw-r--r--sci-physics/bullet/bullet-3.21.ebuild2
-rw-r--r--sci-physics/bullet/files/bullet-3.21-replace_altivec_vector_keyword.patch24
2 files changed, 26 insertions, 0 deletions
diff --git a/sci-physics/bullet/bullet-3.21.ebuild b/sci-physics/bullet/bullet-3.21.ebuild
index 2dd6ebe42362..fab2d923dee4 100644
--- a/sci-physics/bullet/bullet-3.21.ebuild
+++ b/sci-physics/bullet/bullet-3.21.ebuild
@@ -45,6 +45,8 @@ pkg_setup() {
}
src_prepare() {
+ (use ppc || use ppc64) && PATCHES+=( "${FILESDIR}/${P}-replace_altivec_vector_keyword.patch" )
+
cmake_src_prepare
# allow to generate docs
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
new file mode 100644
index 000000000000..01ef90646d5b
--- /dev/null
+++ b/sci-physics/bullet/files/bullet-3.21-replace_altivec_vector_keyword.patch
@@ -0,0 +1,24 @@
+--- a/src/clew/clew.h 2022-02-16 18:12:48.879740507 +0100
++++ b/src/clew/clew.h 2022-02-16 18:13:32.403061196 +0100
+@@ -319,14 +319,14 @@
+
+ /* Define basic vector types */
+ #if defined(__VEC__)
+ #include <altivec.h> /* may be omitted depending on compiler. AltiVec spec provides no way to detect whether the header is required. */
+- typedef vector unsigned char __cl_uchar16;
+- typedef vector signed char __cl_char16;
+- typedef vector unsigned short __cl_ushort8;
+- typedef vector signed short __cl_short8;
+- typedef vector unsigned int __cl_uint4;
+- typedef vector signed int __cl_int4;
+- typedef vector float __cl_float4;
++ typedef __vector unsigned char __cl_uchar16;
++ typedef __vector signed char __cl_char16;
++ typedef __vector unsigned short __cl_ushort8;
++ typedef __vector signed short __cl_short8;
++ typedef __vector unsigned int __cl_uint4;
++ typedef __vector signed int __cl_int4;
++ typedef __vector float __cl_float4;
+ #define __CL_UCHAR16__ 1
+ #define __CL_CHAR16__ 1
+ #define __CL_USHORT8__ 1