git: ba1796ef177b - main - x11/babl: fix build on powerpc

From: Piotr Kubaj <pkubaj_at_FreeBSD.org>
Date: Sat, 12 Aug 2023 01:38:15 UTC
The branch main has been updated by pkubaj:

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

commit ba1796ef177be725eff5319198ecb1c3bdf52184
Author:     Piotr Kubaj <pkubaj@FreeBSD.org>
AuthorDate: 2023-08-11 16:10:30 +0000
Commit:     Piotr Kubaj <pkubaj@FreeBSD.org>
CommitDate: 2023-08-12 01:37:44 +0000

    x11/babl: fix build on powerpc
    
    Clang miscompiles babl-html-dump:
    pid 27736 (babl-html-dump), jid 963, uid 65534: exited on signal 11 (core dumped)
    
    Also, -Wno-error=incompatible-function-pointer-types is not compatible with GCC.
---
 Mk/Uses/vala.mk   |  2 ++
 x11/babl/Makefile | 10 +++++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/Mk/Uses/vala.mk b/Mk/Uses/vala.mk
index 402e0338d67c..f80bc07529c9 100644
--- a/Mk/Uses/vala.mk
+++ b/Mk/Uses/vala.mk
@@ -24,6 +24,8 @@ BUILD_DEPENDS+=		${_VALA_BINARY}:${_VALA_PORT}
 .  endif
 
 # remove after https://gitlab.gnome.org/GNOME/vala/-/issues/1408 is fixed
+.if ${ARCH} != powerpc
 CFLAGS+=	-Wno-error=incompatible-function-pointer-types
+.endif
 
 .endif
diff --git a/x11/babl/Makefile b/x11/babl/Makefile
index 91d29b698080..c15881474fb0 100644
--- a/x11/babl/Makefile
+++ b/x11/babl/Makefile
@@ -12,7 +12,7 @@ LICENSE_FILE=	${WRKSRC}/COPYING
 
 LIB_DEPENDS=	liblcms2.so:graphics/lcms2
 
-USES=		compiler:c11 gnome libtool localbase meson pathfix pkgconfig tar:xz vala:build
+USES=		gnome libtool localbase meson pathfix pkgconfig tar:xz vala:build
 
 USE_LDCONFIG=	yes
 USE_GNOME=	introspection:build
@@ -29,6 +29,14 @@ BABL_SHLIB=	0.205.1
 BABL_VER=	0.1
 PLIST_SUB+=	BABL_SHLIB=${BABL_SHLIB} BABL_VER=${BABL_VER}
 
+.include <bsd.port.options.mk>
+
+.if ${ARCH} == powerpc
+USES+=		compiler:gcc-c++11-lib
+.else
+USES+=		compiler:c11
+.endif
+
 .include <bsd.port.pre.mk>
 
 .if ${ARCH} == "amd64"