git: c9e6c6117f6f - main - graphics/darktable: fix build on powerpc64le

From: Piotr Kubaj <pkubaj_at_FreeBSD.org>
Date: Wed, 23 Aug 2023 22:26:03 UTC
The branch main has been updated by pkubaj:

URL: https://cgit.FreeBSD.org/ports/commit/?id=c9e6c6117f6f432c1ef4077c99be29f0076aca17

commit c9e6c6117f6f432c1ef4077c99be29f0076aca17
Author:     Piotr Kubaj <pkubaj@FreeBSD.org>
AuthorDate: 2023-08-23 22:24:16 +0000
Commit:     Piotr Kubaj <pkubaj@FreeBSD.org>
CommitDate: 2023-08-23 22:24:16 +0000

    graphics/darktable: fix build on powerpc64le
    
    /wrkdirs/usr/ports/graphics/darktable/work/darktable-4.4.2/src/common/iop_profile.c:1273:6: error: 'target_clones' attribute needs GLIBC (2.23 and newer) that exports hardware capability bits
---
 graphics/darktable/Makefile                           |  2 +-
 graphics/darktable/files/patch-src_common_darktable.h | 11 +++++++++++
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/graphics/darktable/Makefile b/graphics/darktable/Makefile
index 73b450fd5eec..28dc9292ce1b 100644
--- a/graphics/darktable/Makefile
+++ b/graphics/darktable/Makefile
@@ -98,7 +98,7 @@ TOOLS_RUN_DEPENDS=	exiftool:graphics/p5-Image-ExifTool
 
 .include <bsd.port.options.mk>
 
-.if ${ARCH} == aarch64
+.if ${ARCH} == aarch64 || ${ARCH} == powerpc64le
 CMAKE_ARGS+=	-DUSE_OPENCL:BOOL=OFF
 CXXFLAGS+=	-DGDK_DISABLE_DEPRECATED
 PLIST_SUB+=	NO_OPENCL="@comment "
diff --git a/graphics/darktable/files/patch-src_common_darktable.h b/graphics/darktable/files/patch-src_common_darktable.h
new file mode 100644
index 000000000000..f53e478d8234
--- /dev/null
+++ b/graphics/darktable/files/patch-src_common_darktable.h
@@ -0,0 +1,11 @@
+--- src/common/darktable.h.orig	2023-08-23 11:50:51 UTC
++++ src/common/darktable.h
+@@ -143,7 +143,7 @@ extern "C" {
+ #if __has_attribute(target_clones) && !defined(_WIN32) && !defined(NATIVE_ARCH)
+ # if defined(__amd64__) || defined(__amd64) || defined(__x86_64__) || defined(__x86_64)
+ #define __DT_CLONE_TARGETS__ __attribute__((target_clones("default", "sse2", "sse3", "sse4.1", "sse4.2", "popcnt", "avx", "avx2", "avx512f", "fma4")))
+-# elif defined(__PPC64__)
++# elif defined(__PPC64__) && defined(__GLIBC__)
+ /* __PPC64__ is the only macro tested for in is_supported_platform.h, other macros would fail there anyway. */
+ #define __DT_CLONE_TARGETS__ __attribute__((target_clones("default","cpu=power9")))
+ # else