git: bc5017985fdd - main - games/tome4: drop gcc on powerpc

From: Piotr Kubaj <pkubaj_at_FreeBSD.org>
Date: Wed, 04 Jan 2023 23:04:23 UTC
The branch main has been updated by pkubaj:

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

commit bc5017985fdd6e88f413353c59b58a33bae457e9
Author:     Piotr Kubaj <pkubaj@FreeBSD.org>
AuthorDate: 2023-01-04 22:56:49 +0000
Commit:     Piotr Kubaj <pkubaj@FreeBSD.org>
CommitDate: 2023-01-04 23:04:13 +0000

    games/tome4: drop gcc on powerpc
---
 games/tome4/Makefile                               | 15 +++++++--------
 games/tome4/files/patch-src_luajit2_src_lj__arch.h | 17 +++++++++++++++++
 2 files changed, 24 insertions(+), 8 deletions(-)

diff --git a/games/tome4/Makefile b/games/tome4/Makefile
index 8b713859cce1..04f9e8d9e1fe 100644
--- a/games/tome4/Makefile
+++ b/games/tome4/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	tome4
 DISTVERSION?=	1.7.4
-PORTREVISION=	2
+PORTREVISION=	3
 CATEGORIES=	games
 MASTER_SITES=	https://te4.org/dl/t-engine/ \
 		SF/lifanov-ports-distfiles/${PORTNAME}/:icons
@@ -19,7 +19,7 @@ BUILD_DEPENDS=	premake4:devel/premake4
 LIB_DEPENDS=	libvorbisfile.so:audio/libvorbis \
 		libpng.so:graphics/png
 
-USES=		gl gmake openal:al sdl tar:bzip2 xorg
+USES=		compiler:c++11-lang gl gmake openal:al sdl tar:bzip2 xorg
 USE_SDL=	image2 sdl2 ttf2
 USE_GL=		gl glu
 SUB_FILES=	tome4
@@ -34,12 +34,11 @@ WRKSRC=		${WRKDIR}/t-engine4-src-${DISTVERSION}
 MAKE_ARGS+=	config=release verbose=yes ARCH="" CC=${CC} CXX=${CXX}
 LDFLAGS_i386=	-Wl,-znotext
 
-.include <bsd.port.options.mk>
+.include <bsd.port.pre.mk>
 
-.if ${ARCH} == powerpc
-USES+=		compiler:gcc-c++11-lib
-.else
-USES+=		compiler:c++11-lang
+.if ${ARCH:Mpowerpc*} && ${COMPILER_VERSION} < 140
+BUILD_DEPENDS+=	as:devel/binutils
+CFLAGS+=	-fno-integrated-as
 .endif
 
 pre-build:
@@ -61,4 +60,4 @@ do-install:
 	${INSTALL_DATA} ${_DISTDIR}/${PORTNAME}.png \
 		${STAGEDIR}${PREFIX}/share/pixmaps
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
diff --git a/games/tome4/files/patch-src_luajit2_src_lj__arch.h b/games/tome4/files/patch-src_luajit2_src_lj__arch.h
new file mode 100644
index 000000000000..b6c8e57c82b7
--- /dev/null
+++ b/games/tome4/files/patch-src_luajit2_src_lj__arch.h
@@ -0,0 +1,17 @@
+--- src/luajit2/src/lj_arch.h.orig	2023-01-04 21:49:40 UTC
++++ src/luajit2/src/lj_arch.h
+@@ -291,8 +291,14 @@
+ #error "Need at least GCC 4.2 or newer"
+ #endif
+ #elif !LJ_TARGET_PS3
++#if __clang__
++#if ((__clang_major__ < 3) || ((__clang_major__ == 3) && __clang_minor__ < 5))
++#error "Need at least Clang 3.5 or newer"
++#endif
++#else
+ #if (__GNUC__ < 4) || ((__GNUC__ == 4) && __GNUC_MINOR__ < 3)
+ #error "Need at least GCC 4.3 or newer"
++#endif
+ #endif
+ #endif
+ #endif