From 469cf4550780287322f220723437cd7b2b6e5547 Mon Sep 17 00:00:00 2001 From: q66 Date: Fri, 1 Nov 2019 00:48:59 +0100 Subject: [PATCH] darktable: enable opencl on ppc [ci skip] --- srcpkgs/darktable/patches/altivec.patch | 37 +++++++++++++++++++++++++ srcpkgs/darktable/template | 1 - 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/darktable/patches/altivec.patch diff --git a/srcpkgs/darktable/patches/altivec.patch b/srcpkgs/darktable/patches/altivec.patch new file mode 100644 index 00000000000000..4bed6ef4b5f5b9 --- /dev/null +++ b/srcpkgs/darktable/patches/altivec.patch @@ -0,0 +1,37 @@ +This fixes compilation on ppc with opencl on. Prevent opencl +headers from defining keywords as macros which would conflict +with C++ keywords as well as C99 keyword macro bool. + +--- src/external/CL/cl_platform.h ++++ src/external/CL/cl_platform.h +@@ -275,14 +275,23 @@ typedef unsigned int cl_GLenum; + + /* Define basic vector types */ + #if defined( __VEC__ ) ++ #ifndef __APPLE_ALTIVEC__ ++ /* prevent gcc from defining the keywords as macros ++ * do not manually undef for c99 stdbool.h compat ++ */ ++ #define __APPLE_ALTIVEC__ 1 ++ #include ++ #undef __APPLE_ALTIVEC__ ++ #else + #include /* 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; ++ #endif ++ 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 diff --git a/srcpkgs/darktable/template b/srcpkgs/darktable/template index a411cab62c9621..fd52616e595a2c 100644 --- a/srcpkgs/darktable/template +++ b/srcpkgs/darktable/template @@ -25,6 +25,5 @@ distfiles="https://github.com/darktable-org/darktable/releases/download/release- checksum=a518999c8458472edfc04577026ce5047d74553052af0f52d10ba8ce601b78f0 case "$XBPS_TARGET_MACHINE" in - ppc64le*) configure_args+=" -DUSE_OPENCL=OFF" ;; aarch64*) broken="https://build.voidlinux.org/builders/aarch64_builder/builds/22479/steps/shell_3/logs/stdio" ;; esac